:root {
  --bg: #ffffff; --ink: #15163a; --muted: #5f6390; --line: #e2e4f3; --soft: #f1f2fa; --accent: #2b4bff; --on-accent: #ffffff;
  --danger: #b92c18; --danger-bg: #fbe6e2; --check: #e9ebf7;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12133a; --ink: #eef0ff; --muted: #a9acd6; --line: #2f3163; --soft: #1e2050; --accent: #5571ff; --on-accent: #ffffff;
    --danger: #ff9a88; --danger-bg: #40201d; --check: #25275a;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.45 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; -webkit-font-smoothing: antialiased; }
#app { max-width: 460px; min-height: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; padding: max(20px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(20px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
h1 { margin: 0; font-size: 28px; line-height: 1.15; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
.wordmark { font-size: 40px; line-height: 1; font-weight: 600; letter-spacing: -0.02em; color: var(--accent); }
p { margin: 0; }
.muted { color: var(--muted); font-size: 14px; }
.grow { flex: 1; min-height: 8px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
button, .btn { appearance: none; border: 0; cursor: pointer; font-family: inherit; font-size: 16px; font-weight: 600; line-height: 1.25; display: block; width: 100%; text-align: center; text-decoration: none; border-radius: 16px; padding: 16px; background: var(--accent); color: var(--on-accent); transition: transform 120ms ease-out, opacity 120ms ease-out; }
button:active:not(:disabled) { transform: scale(0.985); }
button.ghost, .btn.ghost { background: var(--soft); color: var(--ink); }
button.link { background: none; color: var(--muted); font-weight: 400; font-size: 14px; padding: 8px; text-decoration: underline; text-underline-offset: 2px; }
button:disabled { opacity: 0.45; cursor: default; }
button:focus-visible, input:focus-visible, textarea:focus-visible, .pick:focus-visible, .thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.frame { position: relative; width: 100%; aspect-ratio: 1; border-radius: 18px; overflow: hidden; background: var(--soft); }
.frame.tall { aspect-ratio: 3 / 4; }
.frame video, .frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.frame video.mirror { transform: scaleX(-1); }
.tick { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; cursor: pointer; }
.tick input { width: 20px; height: 20px; flex: none; margin: 1px 0 0; accent-color: var(--accent); }
.notice { background: var(--danger-bg); color: var(--danger); padding: 12px 16px; border-radius: 12px; font-size: 15px; }
.styles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.styles.few { grid-template-columns: minmax(0, 1fr); }
.styles.few .pick { grid-template-columns: 128px minmax(0, 1fr); gap: 16px; align-items: center; background: var(--soft); padding: 8px; border-radius: 20px; }
.styles.few .pick[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: -2px; }
.styles.few .pick[aria-pressed="true"] img { outline: 0; }
.pick b { display: block; font-size: 17px; font-weight: 600; }
.pick small { display: block; font-size: 14px; font-weight: 400; color: var(--muted); margin-top: 4px; }
.pick { appearance: none; background: none; color: inherit; padding: 0; border-radius: 16px; font-weight: 500; font-size: 14px; display: grid; gap: 8px; text-align: left; }
.pick img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; display: block; }
.pick[aria-pressed="true"] img { outline: 3px solid var(--accent); outline-offset: -3px; }
.board { background: conic-gradient(var(--check) 25%, transparent 0 50%, var(--check) 0 75%, transparent 0) 0 0 / 22px 22px; border-radius: 16px; padding: 8px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.board a { display: block; }
.board img { width: 100%; display: block; }
.wait { display: grid; place-items: center; gap: 18px; flex: 1; text-align: center; padding: 40px 0; }
.dots { display: flex; gap: 8px; }
.dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); animation: hop 1s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes hop { 40% { transform: translateY(-8px); } 80% { transform: none; } }
.studio { background: conic-gradient(var(--check) 25%, transparent 0 50%, var(--check) 0 75%, transparent 0) 0 0 / 22px 22px; border-radius: 16px; overflow: hidden; }
.studio canvas { display: block; width: 100%; height: auto; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.thumb { appearance: none; flex: none; width: 64px; height: 64px; padding: 4px; background: var(--soft); border-radius: 12px; }
.thumb[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: -2px; }
.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { appearance: none; width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 1px solid var(--line); }
.swatch[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 2px; }
label.field { display: grid; gap: 8px; font-size: 14px; color: var(--muted); }
input[type=text], textarea { font: inherit; color: var(--ink); background: var(--soft); border: 1px solid transparent; border-radius: 12px; padding: 12px 16px; width: 100%; }
textarea { min-height: 120px; resize: vertical; }
button.vk { background: #0077ff; color: #ffffff; }
.check-code { font-size: 44px; line-height: 1; font-weight: 600; letter-spacing: 0.1em; text-align: center; font-variant-numeric: tabular-nums; }
.channels { display: flex; flex-direction: column; gap: 8px; }
.channel { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 12px 16px; background: var(--soft); border-radius: 16px; min-height: 64px; }
.channel b { display: block; font-size: 16px; font-weight: 600; }
.channel small { display: block; font-size: 14px; color: var(--muted); }
.channel.done small { color: var(--accent); }
.channel button { flex: none; width: auto; padding: 8px 16px; font-size: 14px; border-radius: 12px; background: var(--accent); color: var(--on-accent); }
.tick a, .muted a { color: inherit; text-underline-offset: 2px; }
.legal { text-align: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .dots i { animation: none; } button { transition: none; } }
