/* Who Knows You, one design system: Bulle.

   The top block is the shared ground (reset, layout primitives, accessibility,
   the width scale and the share-card boards); the bottom block is the look:
   design tokens, type roles, the press-down blocks and the mascot. The mascot
   shapes live in Go (internal/art) and are rendered by two backends: this
   stylesheet colours the inline SVG, the PNG cards resolve the same role names
   to sRGB values. TestMascotRolesMatchStylesheet keeps these rules equal to
   art.Roles(). */

/* ---- ground ---- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  height: 100%;
  /* Tilted cards and the slap-in keyframes briefly reach past the column;
     clipping keeps the mobile layout viewport from widening to fit them. */
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-wrap: break-word;
  overscroll-behavior-y: none;
  overflow-x: clip;
}

img, svg { max-width: 100%; display: block; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-appearance: none; appearance: none; touch-action: manipulation; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
p { margin: 0; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
ol, ul { margin: 0; padding: 0; list-style: none; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#play:focus { outline: none; }

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 50;
  padding: 12px 16px;
}
.skip:focus { left: 12px; }

/* One page column, safe-area aware. */
.page {
  flex: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}
.top, .foot {
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}
.top-inner, .foot-inner { max-width: 560px; margin: 0 auto; }
.foot { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }

/* Every tappable thing is at least 44px tall. */
.pill, .quiet, .row-report, .brand, .foot-nav a, .milestone {
  min-height: 44px;
}
.cta, .quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  text-align: center;
  border: 0;
  background: none;
}
.cta-wide { width: 100%; }
.quiet { padding: 0; }
.stack { display: grid; gap: 14px; }
.actions { display: grid; gap: 12px; }

/* Forms: 16px floor so iOS never zooms. */
input[type="text"], input[type="password"], textarea {
  width: 100%;
  min-height: 52px;
  font-size: 16px;
}
textarea { min-height: 124px; resize: vertical; }

/* Reduced motion: no transform motion; colour and opacity still say what
   changed. play.js reads the same query and skips the count-up and confetti. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Width scale keeps progress and bars out of inline styles (strict CSP). */
.w-0{width:0%}.w-1{width:1%}.w-2{width:2%}.w-3{width:3%}.w-4{width:4%}.w-5{width:5%}.w-6{width:6%}.w-7{width:7%}.w-8{width:8%}.w-9{width:9%}
.w-10{width:10%}.w-11{width:11%}.w-12{width:12%}.w-13{width:13%}.w-14{width:14%}.w-15{width:15%}.w-16{width:16%}.w-17{width:17%}.w-18{width:18%}.w-19{width:19%}
.w-20{width:20%}.w-21{width:21%}.w-22{width:22%}.w-23{width:23%}.w-24{width:24%}.w-25{width:25%}.w-26{width:26%}.w-27{width:27%}.w-28{width:28%}.w-29{width:29%}
.w-30{width:30%}.w-31{width:31%}.w-32{width:32%}.w-33{width:33%}.w-34{width:34%}.w-35{width:35%}.w-36{width:36%}.w-37{width:37%}.w-38{width:38%}.w-39{width:39%}
.w-40{width:40%}.w-41{width:41%}.w-42{width:42%}.w-43{width:43%}.w-44{width:44%}.w-45{width:45%}.w-46{width:46%}.w-47{width:47%}.w-48{width:48%}.w-49{width:49%}
.w-50{width:50%}.w-51{width:51%}.w-52{width:52%}.w-53{width:53%}.w-54{width:54%}.w-55{width:55%}.w-56{width:56%}.w-57{width:57%}.w-58{width:58%}.w-59{width:59%}
.w-60{width:60%}.w-61{width:61%}.w-62{width:62%}.w-63{width:63%}.w-64{width:64%}.w-65{width:65%}.w-66{width:66%}.w-67{width:67%}.w-68{width:68%}.w-69{width:69%}
.w-70{width:70%}.w-71{width:71%}.w-72{width:72%}.w-73{width:73%}.w-74{width:74%}.w-75{width:75%}.w-76{width:76%}.w-77{width:77%}.w-78{width:78%}.w-79{width:79%}
.w-80{width:80%}.w-81{width:81%}.w-82{width:82%}.w-83{width:83%}.w-84{width:84%}.w-85{width:85%}.w-86{width:86%}.w-87{width:87%}.w-88{width:88%}.w-89{width:89%}
.w-90{width:90%}.w-91{width:91%}.w-92{width:92%}.w-93{width:93%}.w-94{width:94%}.w-95{width:95%}.w-96{width:96%}.w-97{width:97%}.w-98{width:98%}.w-99{width:99%}.w-100{width:100%}

/* Share card art boards: fixed-pixel boards scaled to the column by play.js
   (--s), or shown at native size in raw capture mode. */
.board-wrap { position: relative; width: 100%; overflow: hidden; }
.board-wrap[data-format="story"] { aspect-ratio: 1080 / 1920; }
.board-wrap[data-format="preview"] { aspect-ratio: 1200 / 630; }
.card-board {
  position: absolute;
  inset: 0 auto auto 0;
  transform-origin: top left;
  transform: scale(var(--s, 1));
  overflow: hidden;
}
.card-board[data-format="story"] { width: 1080px; height: 1920px; }
.card-board[data-format="preview"] { width: 1200px; height: 630px; }
/* The 1200x630 preview is a thumbnail in a chat: the score and the taunt
   carry it, the explanatory line stays on the story board. */
.card-board[data-format="preview"] .cb-line { display: none; }
body.raw { display: block; min-height: 0; }
body.raw .card-board { position: static; transform: none; }

/* ---- the look ---- */

/* Bulle: character-led, sunny, chunky. A speech bubble with legs reacts to
   every answer; buttons are physical blocks you press down. Type: Fredoka
   (display) + Nunito (text), self-hosted and subset by `make fonts-generate`. */

@font-face {
  font-family: "Fredoka";
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/fredoka-600.woff2?v=26a36331e8066f4d") format("woff2");
}
@font-face {
  font-family: "Nunito";
  font-weight: 500 800;
  font-display: swap;
  src: url("/static/fonts/nunito-var.woff2?v=972dc3108b856c95") format("woff2");
}

:root {
  --bg: oklch(0.94 0.09 96);
  --bg-deep: oklch(0.90 0.14 95);
  --card: oklch(0.99 0.012 95);
  --ink: oklch(0.25 0.05 50);
  --ink-deep: oklch(0.15 0.03 50);
  --muted: oklch(0.47 0.05 55);
  --coral: oklch(0.63 0.21 25);
  --coral-ink: oklch(0.42 0.17 25);
  --pink: oklch(0.88 0.06 20);
  --sky: oklch(0.85 0.09 230);
  --sky-ink: oklch(0.40 0.09 240);
  --good: oklch(0.82 0.17 145);
  --good-ink: oklch(0.36 0.10 145);
  --good-tint: oklch(0.93 0.08 145);
  --bad-tint: oklch(0.92 0.04 25);
  --white: oklch(1 0 0);
  /* contrast: ink on bg, muted on bg, ink on card, muted on card, coral-ink on bg, white on coral-ink, white on sky-ink, white on good-ink, ink on pink, ink on sky, sky-ink on sky, ink on good, good-ink on good-tint, coral-ink on bad-tint, bg on ink, white on ink, good-ink on card, ink on bg-deep, coral-ink on card */
  --display: "Fredoka", "Arial Rounded MT Bold", system-ui, sans-serif;
  --text: "Nunito", system-ui, sans-serif;
  --r: 22px;
  --edge: 2.5px;
  --drop: 5px;
  --pop: cubic-bezier(0.3, 1.5, 0.4, 1);
  --hop: cubic-bezier(0.3, 0.7, 0.4, 1);
  --out: cubic-bezier(0.23, 1, 0.32, 1);
  color-scheme: light;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.45;
}

a { color: var(--coral-ink); }
:focus-visible { outline: 3px solid var(--sky-ink); outline-offset: 3px; border-radius: 8px; }
.skip { background: var(--ink); color: var(--bg); border-radius: 12px; font-weight: 800; }

/* Type roles */
.hero-title, .sheet-title, .q-prompt, .tier, .score, .hud-count, .cta, .opt-tag, .choice-n, .step-no, .rank-badge, .brand-name, .row-rank, .row-score b, .cb-score, .cb-headline, .cb-name, .cb-tier {
  font-family: var(--display);
  font-weight: 600;
}
.hero-title { font-size: clamp(38px, 10.5vw, 52px); line-height: 1.02; letter-spacing: -0.01em; margin: 0 0 12px; }
.sheet-title { font-size: clamp(30px, 8vw, 40px); line-height: 1.06; margin: 0 0 10px; }
.lede { font-size: 17px; color: var(--muted); margin: 0 0 20px; max-width: 42ch; }
.fine, .hint, .meta, .share-note, .foot-line, .board-count, .empty { font-size: 14px; color: var(--muted); }
.kicker {
  margin: 0 0 8px;
  font: 800 13px/1.2 var(--text);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--coral-ink);
}

/* Header */
.top { padding-top: max(10px, env(safe-area-inset-top)); }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-size: 19px; white-space: nowrap; }
.langs { display: flex; gap: 0; flex: none; }
.pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; padding: 0 6px; border-radius: 999px;
  color: var(--muted); font: 800 13px/1 var(--text); text-transform: uppercase; text-decoration: none;
}
@media (max-width: 374px) { .brand { font-size: 17px; } .brand .logo { width: 30px; height: 30px; } }
.pill.is-current { background: var(--ink); color: var(--bg); }

.page { padding-top: 16px; padding-bottom: 24px; }

/* Blocks: the press-down button that is the design's signature. */
.cta {
  gap: 8px;
  min-height: 56px;
  padding: 12px 20px;
  border-radius: 18px;
  border: var(--edge) solid var(--ink);
  background: var(--card);
  color: var(--ink);
  font-size: 19px;
  box-shadow: 0 var(--drop) 0 var(--ink);
  transform: translateY(0);
  transition: transform 90ms var(--out), box-shadow 90ms var(--out), background-color 120ms ease;
}
.cta:active, .cta[data-down] { transform: translateY(var(--drop)); box-shadow: 0 0 0 var(--ink); }
.cta-primary { background: var(--ink); color: var(--bg); box-shadow: 0 var(--drop) 0 var(--ink-deep); border-color: var(--ink-deep); }
.cta-primary:active { background: var(--ink-deep); box-shadow: 0 0 0 var(--ink-deep); }
.cta-small { min-height: 44px; padding: 8px 14px; font-size: 16px; border-radius: 14px; --drop: 4px; }
.cta-danger { background: var(--coral-ink); color: var(--white); border-color: var(--coral-ink); box-shadow: 0 var(--drop) 0 var(--ink); }
.cta[disabled] { opacity: 0.7; cursor: progress; }
.cta.is-copied { background: var(--good-tint); border-color: var(--good-ink); color: var(--good-ink); box-shadow: 0 var(--drop) 0 var(--good-ink); }
.quiet { color: var(--muted); font-weight: 800; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }
.quiet.danger { color: var(--coral-ink); }
.actions { margin-top: 24px; }
.actions .quiet { justify-self: center; }

/* Forms */
.field { display: grid; }
.field > label, legend { font: 800 15px/1.3 var(--text); margin-bottom: 8px; }
input[type="text"], input[type="password"], textarea {
  padding: 12px 16px;
  border: var(--edge) solid var(--ink);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  font-weight: 700;
  box-shadow: inset 0 3px 0 oklch(0.25 0.05 50 / 0.08);
}
input[aria-invalid="true"] { border-color: var(--coral-ink); }
.hint { margin-top: 8px; min-height: 20px; }
.hint.is-error { color: var(--coral-ink); font-weight: 800; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 14px;
  min-height: 92px;
  border: var(--edge) solid var(--ink);
  border-radius: var(--r);
  background: var(--card);
  box-shadow: 0 var(--drop) 0 var(--ink);
  cursor: pointer;
  transition: transform 90ms var(--out), box-shadow 90ms var(--out);
}
.choice:active { transform: translateY(var(--drop)); box-shadow: 0 0 0 var(--ink); }
.choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.choice:has(input:checked) { background: var(--sky); border-color: var(--sky-ink); box-shadow: 0 var(--drop) 0 var(--sky-ink); }
.choice:has(input:focus-visible) { outline: 3px solid var(--sky-ink); outline-offset: 3px; }
.choice-n { font-size: 34px; line-height: 1; }
.choice-body { font-size: 13.5px; color: var(--muted); font-weight: 700; }
.stack .fine { text-align: center; }
.optional { color: var(--muted); font-weight: 600; }

.banner {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: var(--edge) solid var(--ink);
  border-radius: 16px;
  background: var(--card);
  font-size: 15px;
}
.banner strong { display: block; margin-bottom: 4px; }
.banner-error { border-color: var(--coral-ink); background: var(--bad-tint); color: var(--coral-ink); font-weight: 800; }

/* Mascot. Geometry, stroke widths and caps come with the shapes from package
   art; this block owns colour only, resolved from the tokens above. */
.mascot { width: 100%; height: auto; overflow: visible; }
.art-body { fill: var(--card); stroke: var(--ink); stroke-linejoin: round; }
.art-eye { fill: var(--white); stroke: var(--ink); }
.art-pupil { fill: var(--ink); }
.art-eye-shut, .art-brow, .art-mouth { fill: none; stroke: var(--ink); stroke-linecap: round; }
.art-mouth-open { fill: var(--coral-ink); stroke: var(--ink); stroke-linejoin: round; }
.art-blush { fill: var(--coral); opacity: 0.6; }
.art-limb { fill: none; stroke: var(--ink); stroke-linecap: round; }
.art-foot { fill: var(--ink); }
.art-shadow { fill: var(--ink); opacity: 0.12; }
.art-hand { fill: var(--card); stroke: var(--ink); }
/* Brand mark */
.art-logo-body { fill: var(--card); stroke: var(--ink); stroke-linejoin: round; }
.art-logo-eye { fill: var(--ink); }
.art-logo-mouth { fill: none; stroke: var(--ink); stroke-linecap: round; }

/* Home */
.hero { padding: 8px 0 0; text-align: left; }
.hero-art { width: 170px; margin: 0 0 6px -8px; }
.hero .cta-wide { margin-top: 10px; }
.hero .fine { margin-top: 12px; text-align: center; }
.demo { margin: 36px 0 0; padding: 20px; border: var(--edge) solid var(--ink); border-radius: var(--r); background: var(--card); box-shadow: 0 var(--drop) 0 var(--ink); }
.demo-q { font-family: var(--display); font-size: 24px; line-height: 1.15; margin: 0 0 14px; }
.opts-demo .opt { min-height: 60px; padding: 10px 12px; font-size: 17px; box-shadow: none; --drop: 0px; }
.opts-demo .opt-tag { width: 30px; height: 30px; font-size: 15px; }
.steps { display: grid; gap: 14px; margin: 32px 0 0; counter-reset: step; }
.step { display: grid; grid-template-columns: 44px 1fr; gap: 4px 12px; align-items: start; }
.step-no {
  grid-row: 1 / 3;
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 14px;
  background: var(--sky); color: var(--sky-ink);
  font-size: 22px;
}
.step h2 { font: 800 18px/1.25 var(--text); margin: 8px 0 0; }
.step p { font-size: 15px; color: var(--muted); }
.name-sentence { margin: 28px 0 0; font-size: 14px; color: var(--muted); }

/* Sheets (new, invite, delete, done, error, report, board) */
.sheet-art { width: 120px; margin: 0 0 4px -6px; }
.sheet .meta { margin: -8px 0 18px; font-weight: 700; }
.sheet .quiet { margin-top: 18px; }
.done { text-align: center; }
.done .sheet-art { margin: 0 auto 8px; }
.error .code { color: var(--muted); }
.danger-card { padding: 20px; border: var(--edge) solid var(--coral-ink); border-radius: var(--r); background: var(--card); display: grid; gap: 14px; justify-items: center; }
.delete-name { font-family: var(--display); font-size: 28px; }

/* HUD */
.hud { display: flex; align-items: center; gap: 12px; margin: 2px 0 18px; }
.hud-progress { flex: 1; display: flex; align-items: center; gap: 10px; }
.hud-count { font-size: 22px; line-height: 1; white-space: nowrap; }
.hud-of { font-size: 15px; color: var(--muted); }
.hud-track { flex: 1; height: 16px; border: var(--edge) solid var(--ink); border-radius: 999px; background: var(--card); overflow: hidden; }
.hud-fill { display: block; height: 100%; background: var(--sky-ink); border-radius: 999px; transition: width 420ms var(--out); }
.hud-streak { display: flex; }
.hud-streak[data-n="0"] .streak-pip, .hud-streak[data-n="1"] .streak-pip { display: none; }
.streak-pip {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 34px; padding: 0 10px 0 8px;
  border-radius: 999px; border: var(--edge) solid var(--ink);
  background: var(--coral); color: var(--ink);
  font: 800 15px/1 var(--text);
  animation: pop 420ms cubic-bezier(0.34, 1.6, 0.5, 1) both;
}
.flame { fill: var(--ink); }
.streak-pip b { font-family: var(--display); font-size: 17px; }

/* Question */
.q-art { width: 96px; margin: 0 auto 2px; }
.q .kicker { text-align: center; }
.q-prompt {
  font-size: clamp(27px, 7.4vw, 36px);
  line-height: 1.12;
  text-align: center;
  margin: 0 0 20px;
}
.opts { display: grid; gap: 14px; }
.opt {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 84px;
  padding: 14px 16px;
  border: var(--edge) solid var(--ink);
  border-radius: var(--r);
  background: var(--card);
  color: var(--ink);
  font: 800 20px/1.2 var(--text);
  text-align: left;
  box-shadow: 0 var(--drop) 0 var(--ink);
  transition: transform 90ms var(--out), box-shadow 90ms var(--out), background-color 120ms ease;
}
.opt:active, .opt[data-down] { transform: translateY(var(--drop)); box-shadow: 0 0 0 var(--ink); background: var(--bg-deep); }
.opt-a { background: var(--pink); }
.opt-b { background: var(--sky); }
.opt-a:active { background: var(--pink); }
.opt-b:active { background: var(--sky); }
.opt[aria-pressed="true"] { border-width: 4px; }
.opt-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.opt-tag {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--coral-ink); color: var(--white);
  font-size: 18px;
}
.opt-b .opt-tag { background: var(--sky-ink); }
.q-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; }

/* Reveal: the chosen card lands, the creator's card springs green. */
.opts.is-reveal .opt { box-shadow: none; --drop: 0px; transform: none; position: relative; }
.opts.is-reveal .opt:not(.is-creator):not(.is-guess) { background: var(--card); border-color: var(--muted); color: var(--muted); }
.opts.is-reveal .opt:not(.is-creator):not(.is-guess) .opt-tag { background: var(--muted); }
.opt.is-creator { background: var(--good); border-color: var(--good-ink); animation: pop 520ms var(--pop) both; animation-delay: 160ms; }
.opt.is-guess:not(.is-creator) { background: var(--bad-tint); border-color: var(--coral-ink); color: var(--coral-ink); animation: shake 380ms ease both; }
.opt-mark { display: inline-flex; margin-left: 4px; }
.mark { fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.opt.is-creator .mark { color: var(--good-ink); }
.opt-you {
  position: absolute; top: -12px; right: 14px;
  padding: 3px 9px; border-radius: 999px;
  border: 2px solid var(--ink); background: var(--card); color: var(--ink);
  font: 800 11.5px/1.2 var(--text); text-transform: uppercase; letter-spacing: 0.04em;
}
.verdict {
  margin: 18px 0 16px;
  padding: 14px 18px;
  border-radius: 18px;
  border: var(--edge) solid var(--ink);
  font: 800 18px/1.3 var(--text);
  text-align: center;
  animation: drop-in 420ms var(--pop) both;
  animation-delay: 300ms;
}
.verdict-right { background: var(--good); color: var(--ink); }
.verdict-wrong { background: var(--bad-tint); color: var(--coral-ink); border-color: var(--coral-ink); }
.q.is-reveal .q-art { animation: hop 560ms var(--hop) both; }
.q.is-reveal .mascot-oops { animation: wobble 480ms ease both; }
.next { animation: rise 320ms var(--out) both; animation-delay: 420ms; }
.play[data-state="reveal"] .streak-pip { animation: pop 420ms cubic-bezier(0.34, 1.6, 0.5, 1) both; animation-delay: 360ms; }

/* Result */
.result .kicker { text-align: center; }
.score-hero { display: grid; justify-items: center; margin: 0 0 8px; }
.score-art { width: 150px; animation: hop 560ms var(--hop) both; animation-delay: 200ms; }
.score { display: flex; align-items: baseline; justify-content: center; gap: 4px; line-height: 1; }
.score-n { font-size: clamp(88px, 26vw, 120px); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.score-of { font-size: 30px; color: var(--muted); }
.tier { text-align: center; font-size: clamp(30px, 8.5vw, 42px); color: var(--coral-ink); margin: 6px 0 6px; }
.tier-body { text-align: center; margin-left: auto; margin-right: auto; margin-bottom: 16px; }
.rank { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 20px; font-weight: 700; }
.rank-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 52px; height: 52px; padding: 0 12px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-size: 24px;
}
.breakdown { margin: 32px 0 0; }
.breakdown h2 { font: 800 17px/1.3 var(--text); margin: 0 0 8px; }
.bk-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 10px 0; }
.bk-topic { font-weight: 800; }
.bk-count { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bk-bar { grid-column: 1 / -1; height: 12px; border: 2px solid var(--ink); border-radius: 999px; background: var(--card); overflow: hidden; }
.bk-fill { display: block; height: 100%; background: var(--sky-ink); border-radius: 999px; }
.your-turn { margin: 32px 0 0; padding: 22px; border-radius: var(--r); background: var(--ink); color: var(--bg); }
.your-turn h2 { font-family: var(--display); font-size: 26px; margin: 0 0 6px; }
.your-turn p { color: oklch(0.90 0.06 96); margin: 0 0 16px; }
.your-turn .cta-primary { background: var(--bg-deep); color: var(--ink); border-color: var(--ink-deep); box-shadow: 0 var(--drop) 0 var(--ink-deep); }

/* Share */
.share { margin: 24px 0 0; }
.share-title { font: 800 20px/1.3 var(--text); margin: 0 0 4px; }
.share-lede { color: var(--muted); font-size: 15px; margin: 0 0 14px; }
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; }
.share-btn { font-size: 16px; padding: 10px 12px; }
.share-btn[data-surface="whatsapp"] { grid-column: 1 / -1; background: var(--good-ink); color: var(--white); border-color: var(--good-ink); box-shadow: 0 var(--drop) 0 var(--ink); font-size: 20px; min-height: 60px; }
.share-btn[data-surface="instagram"] { background: var(--pink); }
/* WhatsApp takes the first row, so an even child count leaves the last button
   alone on its row: let it span instead of sitting half-width. */
.share-btn:last-child:nth-child(even) { grid-column: 1 / -1; }
.linkbox { display: grid; gap: 10px; margin: 16px 0 10px; padding: 12px; border: 2px dashed var(--ink); border-radius: 16px; background: var(--card); }
.linkbox-url { font: 700 14px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.share-note { margin-top: 10px; }
.result-creator .sheet-art { width: 120px; }

/* Board */
.board-count { margin: 0 0 10px; font-weight: 700; }
.board-live { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--good-tint); color: var(--good-ink); font-size: 12px; font-weight: 800; }
.rows { display: grid; gap: 10px; }
.row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 0 12px;
  align-items: center;
  padding: 10px 14px 10px 10px;
  border: var(--edge) solid var(--ink);
  border-radius: 18px;
  background: var(--card);
}
.row[data-rank="1"] { background: var(--bg-deep); }
.row[data-rank="2"], .row[data-rank="3"] { background: var(--sky); }
.row-rank { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 14px; background: var(--ink); color: var(--bg); font-size: 20px; grid-row: 1 / 3; }
.row-name { font-weight: 800; font-size: 17px; min-width: 0; overflow-wrap: anywhere; }
.row-score { font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }
.row-score b { font-size: 22px; color: var(--ink); }
.row-when { grid-column: 2; font-size: 12.5px; color: var(--muted); }
.row-report { grid-column: 3; grid-row: 2; justify-self: end; display: inline-flex; align-items: center; font-size: 12.5px; color: var(--muted); font-weight: 800; }
.milestones { display: grid; gap: 10px; margin: 0 0 18px; }
.milestone { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border: var(--edge) solid var(--ink); border-radius: 16px; background: var(--card); color: var(--ink); text-decoration: none; font-weight: 800; }
.milestone-cta { color: var(--coral-ink); font-size: 14px; }
.boardpage .actions { margin-top: 26px; }

/* Admin */
.admin-head { font: 800 17px/1.3 var(--text); margin: 26px 0 4px; }
.admin-list { margin: 0 0 8px; }
.admin-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 12px 0; border-top: 2px solid oklch(0.25 0.05 50 / 0.12); flex-wrap: wrap; }
.admin-meta { display: block; font-size: 12.5px; color: var(--muted); }
.admin-actions { display: flex; gap: 8px; }
.banner-warn { border-color: var(--coral-ink); background: var(--bad-tint); }

/* Prose */
.prose { max-width: 60ch; }
.prose h2 { font: 800 18px/1.3 var(--text); margin: 26px 0 6px; }
.prose p { margin: 0; }
.prose section .cta { margin-top: 14px; }

/* Footer */
.foot { margin-top: auto; padding-top: 28px; color: var(--muted); font-size: 13px; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 0 16px; margin-top: 4px; }
.foot-nav a { display: inline-flex; align-items: center; color: var(--ink); font-weight: 700; text-underline-offset: 3px; }

/* Card screen */
.cardpage .kicker { text-align: left; }
.card-format { font: 800 14px/1.3 var(--text); color: var(--muted); margin: 22px 0 8px; text-transform: uppercase; letter-spacing: 0.06em; }
.board-wrap { border: var(--edge) solid var(--ink); border-radius: 16px; background: var(--card); }
.card-board { background: var(--bg); color: var(--ink); font-family: var(--text); display: grid; }
.card-board[data-format="story"] { grid-template-rows: auto 1fr auto; padding: 96px 80px 110px; }
.card-board[data-format="preview"] { grid-template-columns: 1fr 360px; grid-template-rows: auto 1fr auto; padding: 48px 64px; column-gap: 32px; }
.cb-brand { display: flex; align-items: center; gap: 18px; font-family: var(--display); font-size: 44px; }
.cb-brand .logo { width: 72px; height: 72px; }
.cb-art { width: 520px; margin: 40px auto 0; }
.card-board[data-format="preview"] .cb-art { grid-column: 2; grid-row: 1 / 4; width: 340px; margin: 0; align-self: center; }
.cb-body { align-self: center; text-align: center; }
.card-board[data-format="preview"] .cb-body { text-align: left; align-self: center; }
.cb-name { font-size: 64px; line-height: 1; margin: 0 0 12px; }
.cb-headline { font-size: 104px; line-height: 0.98; margin: 0 0 28px; }
.card-board[data-format="preview"] .cb-headline { font-size: 72px; }
.card-board[data-format="preview"] .cb-name { font-size: 40px; margin: 0; }
.cb-score { display: flex; justify-content: center; align-items: baseline; gap: 10px; line-height: 1; margin: 8px 0 12px; }
.card-board[data-format="preview"] .cb-score { justify-content: flex-start; margin: 0; }
.cb-score-n { font-size: 320px; letter-spacing: -0.03em; }
.card-board[data-format="preview"] .cb-score-n { font-size: 170px; line-height: 0.9; }
.cb-score-of { font-size: 88px; color: var(--muted); }
.card-board[data-format="preview"] .cb-score-of { font-size: 52px; }
.cb-tier { font-size: 80px; color: var(--coral-ink); line-height: 1; margin: 0 0 24px; }
.card-board[data-format="preview"] .cb-tier { font-size: 44px; margin: 0 0 10px; }
.cb-line { font-size: 36px; font-weight: 700; color: var(--muted); margin: 0 0 20px; }
.card-board[data-format="preview"] .cb-line { font-size: 24px; margin: 0 0 8px; }
.cb-taunt { display: inline-block; padding: 18px 36px; border: 5px solid var(--ink); border-radius: 999px; background: var(--card); font: 800 44px/1 var(--text); box-shadow: 0 10px 0 var(--ink); }
.card-board[data-format="preview"] .cb-taunt { font-size: 28px; padding: 12px 24px; box-shadow: 0 6px 0 var(--ink); border-width: 4px; }
.cb-foot { display: flex; align-items: center; gap: 36px; }
.card-board[data-format="preview"] .cb-foot { grid-column: 1; gap: 24px; }
.cb-qr { width: 300px; height: 300px; padding: 20px; background: var(--white); border: 5px solid var(--ink); border-radius: 28px; }
.card-board[data-format="preview"] .cb-qr { width: 120px; height: 120px; padding: 8px; border-width: 3px; border-radius: 14px; }
.cb-qr path { fill: var(--ink); }
.cb-url { display: grid; gap: 10px; }
.cb-cta { font: 800 40px/1.1 var(--text); }
.cb-link { font: 700 34px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.card-board[data-format="preview"] .cb-cta { font-size: 24px; }
.card-board[data-format="preview"] .cb-link { font-size: 18px; }

/* Confetti canvas: present only while a burst is in the air. */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 30; }

/* Motion vocabulary */
@keyframes pop {
  0% { transform: scale(0.6); }
  45% { transform: scale(1.18); }
  100% { transform: scale(1); }
}
@keyframes drop-in {
  0% { opacity: 0; transform: translateY(-10px) scale(0.92); }
  100% { opacity: 1; transform: none; }
}
@keyframes rise {
  0% { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: none; }
}
@keyframes shake {
  25% { transform: translateX(-6px) rotate(-1.5deg); }
  50% { transform: translateX(5px) rotate(1deg); }
  75% { transform: translateX(-3px); }
}
@keyframes hop {
  0% { transform: none; }
  22% { transform: translateY(-14px) rotate(-5deg); }
  48% { transform: translateY(-4px) rotate(3deg); }
  66% { transform: translateY(0) rotate(-1deg) scale(1.04, 0.95); }
  82% { transform: rotate(0.5deg); }
  100% { transform: none; }
}
@keyframes wobble {
  25% { transform: rotate(-5deg); }
  50% { transform: rotate(4deg); }
  75% { transform: rotate(-2deg); }
}

@media (min-width: 480px) {
  .hero-art { width: 200px; }
  .share-grid { grid-template-columns: repeat(3, 1fr); }
  .share-btn[data-surface="whatsapp"], .share-btn:last-child:nth-child(even) { grid-column: auto; }
  .linkbox { grid-template-columns: 1fr auto; align-items: center; }
}

/* Reduced motion: nothing moves; the states still read through colour. */
@media (prefers-reduced-motion: reduce) {
  .cta, .opt, .choice { transition: background-color 120ms ease; }
  .cta:active, .opt:active, .choice:active, .cta[data-down], .opt[data-down] { transform: none; }
  .opt.is-creator, .opt.is-guest, .verdict, .next, .streak-pip, .q-art, .score-art { animation: none; }
  .hud-fill { transition: none; }
  .confetti { display: none; }
}
