/* =========================================================================
   Guess the Model — stylesheet
   Every visual value below resolves to a token declared in DESIGN.md §1–§6.
   Per-model color is content, injected as --model from MODELS[id].color.
   ========================================================================= */

/* ---------- §1 color / §2 type / §3 space / §4 shape / §6 motion --------- */
:root {
  /* core ramp */
  --c-ink-900: #07060f;
  --c-ink-800: #0d0b1a;
  --c-ink-700: #14112a;
  --c-ink-600: #1c1838;
  --c-ink-500: #2a2450;
  --c-line: rgba(255, 255, 255, 0.09);
  --c-line-hi: rgba(255, 255, 255, 0.18);

  --c-text: #f4f1ff;
  --c-text-dim: #b3aacd;
  --c-text-mute: #7d7599;

  /* accents */
  --a-lime: #ccff3d;
  --a-lime-dim: #93b82c;
  --a-magenta: #ff4d9d;
  --a-cyan: #5ee7ff;

  /* semantic state */
  --s-correct: #3ddc97;
  --s-correct-b: rgba(61, 220, 151, 0.16);
  --s-wrong: #ff5470;
  --s-wrong-b: rgba(255, 84, 112, 0.16);
  --s-warn: #ffb648;

  /* type */
  --font-display: "Futura", "Avenir Next", "Century Gothic", "URW Gothic",
    "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --font-ui: system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI",
    sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco,
    "Cascadia Mono", Consolas, "Liberation Mono", monospace;

  --t-mega: clamp(3.25rem, 13vw, 7rem);
  --t-xxl: clamp(1.75rem, 5.5vw, 3rem);
  --t-xl: clamp(1.25rem, 3.2vw, 1.75rem);
  --t-lg: clamp(1.05rem, 2.6vw, 1.35rem);
  --t-phrase: clamp(1.15rem, 3.4vw, 2.1rem);
  --t-md: 1rem;
  --t-sm: 0.875rem;
  --t-xs: 0.78rem;
  --t-label: 0.7rem;

  --lh-display: 1.05;
  --lh-phrase: 1.35;
  --lh-prose: 1.55;
  --tr-tight: -0.03em;
  --tr-ui: -0.01em;
  --tr-label: 0.16em;

  /* space */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-20: 80px;
  --wrap: 68rem;
  --gutter: var(--sp-5);

  /* shape */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 34px;
  --r-pill: 999px;
  --bw: 1px;
  --bw-thick: 2px;

  --sh-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --sh-2: 0 12px 32px -12px rgba(0, 0, 0, 0.7);
  --sh-3: 0 28px 68px -24px rgba(0, 0, 0, 0.85);
  --glow-lime: 0 0 0 var(--bw) rgba(204, 255, 61, 0.35),
    0 12px 40px -14px rgba(204, 255, 61, 0.45);
  --glow-correct: 0 0 0 var(--bw) rgba(61, 220, 151, 0.5),
    0 14px 44px -14px rgba(61, 220, 151, 0.5);
  --glow-wrong: 0 0 0 var(--bw) rgba(255, 84, 112, 0.5),
    0 14px 44px -14px rgba(255, 84, 112, 0.45);

  /* motion */
  --dur-fast: 120ms;
  --dur-base: 240ms;
  --dur-slow: 420ms;
  --dur-pop: 520ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-in: cubic-bezier(0.55, 0, 0.68, 0.19);

  /* component sizing derived from the space scale */
  --opt-min-h: var(--sp-16);
  --tap-min: 44px;
  --meter-h: var(--sp-2);
  --dot-size: var(--sp-2);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--c-ink-900);
  color: var(--c-text);
  font-family: var(--font-ui);
  font-size: var(--t-md);
  line-height: var(--lh-prose);
  letter-spacing: var(--tr-ui);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button {
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  margin: 0;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: var(--sp-1) solid var(--a-lime);
  outline-offset: var(--sp-1);
  border-radius: var(--r-sm);
}

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

/* ------------------------- ground: aurora + grain ----------------------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      60vw 60vw at 8% -8%,
      rgba(204, 255, 61, 0.13),
      transparent 62%
    ),
    radial-gradient(
      55vw 55vw at 102% 106%,
      rgba(255, 77, 157, 0.15),
      transparent 60%
    ),
    radial-gradient(
      70vw 50vw at 50% 40%,
      rgba(94, 231, 255, 0.05),
      transparent 70%
    );
}

/* inline feTurbulence grain — offline-safe, no external asset (DESIGN.md §9) */
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.32;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='140' height='140' filter='url(%23n)' opacity='0.5'/></svg>");
}

/* -------------------------------- layout -------------------------------- */
.shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

main.wrap {
  flex: 1 0 auto;
  padding-block: var(--sp-8) var(--sp-12);
}

.screen {
  animation: screen-in var(--dur-slow) var(--ease-out) both;
}

/* ================================ TYPE ================================== */
.eyebrow {
  font-family: var(--font-ui);
  font-size: var(--t-label);
  font-weight: 700;
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  color: var(--c-text-mute);
}

.lead {
  color: var(--c-text-dim);
  font-size: var(--t-lg);
  line-height: var(--lh-prose);
}

/* ============================= PRIMITIVES =============================== */

/* ---- .btn -------------------------------------------------------------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--c-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: var(--tap-min);
  padding: var(--sp-3) var(--sp-8);
  border: var(--bw-thick) solid transparent;
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-display);
  font-size: var(--t-lg);
  font-weight: 800;
  letter-spacing: var(--tr-ui);
  cursor: pointer;
  transition:
    transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out),
    background-color var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out),
    color var(--dur-base) var(--ease-out);
}

.btn--primary {
  --btn-bg: var(--a-lime);
  --btn-fg: var(--c-ink-900);
  box-shadow: var(--glow-lime);
}

@media (hover: hover) {
  .btn--primary:hover {
    transform: translateY(calc(-1 * var(--sp-1)));
    box-shadow:
      0 0 0 var(--bw) rgba(204, 255, 61, 0.55),
      0 var(--sp-5) var(--sp-12) calc(-1 * var(--sp-4)) rgba(204, 255, 61, 0.6);
  }
}

.btn--primary:active {
  transform: translateY(var(--bw));
  background: var(--a-lime-dim);
}

.btn--ghost {
  --btn-fg: var(--c-text-dim);
  border-color: var(--c-line-hi);
}

@media (hover: hover) {
  .btn--ghost:hover {
    --btn-fg: var(--a-lime);
    border-color: var(--a-lime);
    transform: translateY(calc(-1 * var(--sp-1) / 2));
  }
}

.btn--ghost:active {
  transform: translateY(var(--bw));
}

.btn--xl {
  padding: var(--sp-5) var(--sp-16);
  font-size: var(--t-xl);
}

/* ---- .bubble ----------------------------------------------------------- */
/* Two deliberate deviations from the other surfaces, both load-bearing:
   1. no border — a hairline would cut across the seam where the tail joins.
   2. the screen-glow is an OUTER shadow, not a z-index:-1 pseudo. bubble-pop
      has fill:both, so its retained transform makes .bubble a permanent
      stacking context; a negative-z child then paints OVER the background
      instead of behind it, which washed the body out and left the tail
      looking like a detached diamond. */
.bubble {
  position: relative;
  padding: var(--sp-8) var(--sp-8) var(--sp-10);
  background: var(--c-ink-700);
  border-radius: var(--r-xl) var(--r-xl) var(--r-xl) var(--r-sm);
  box-shadow:
    var(--sh-3),
    0 var(--sp-5) var(--sp-16) calc(-1 * var(--sp-10)) rgba(204, 255, 61, 0.3),
    inset 0 var(--bw) 0 rgba(255, 255, 255, 0.09);
  animation: bubble-pop var(--dur-pop) var(--ease-pop) both;
  --bubble-rot: 0deg;
}

/* tail — the asymmetry that makes it read as speech (DESIGN.md §4).
   bottom offset must be < half the box so the diamond's widest points land
   INSIDE the bubble; at -12px on a 20px box they sat below it and the tail
   read as a detached lozenge. */
.bubble::after {
  content: "";
  position: absolute;
  left: var(--sp-6);
  bottom: calc(-1 * var(--sp-2));
  width: var(--sp-6);
  height: var(--sp-6);
  background: var(--c-ink-700);
  border-bottom-right-radius: var(--sp-1);
  transform: rotate(45deg);
}

.bubble__phrase {
  font-family: var(--font-mono);
  font-size: var(--t-phrase);
  font-weight: 500;
  line-height: var(--lh-phrase);
  letter-spacing: var(--tr-ui);
  color: var(--c-text);
  text-wrap: balance;
}

.bubble__phrase::before,
.bubble__phrase::after {
  color: var(--a-lime);
  opacity: 0.55;
}

.bubble__phrase::before {
  content: "\201C";
}

.bubble__phrase::after {
  content: "\201D";
}

/* ---- typing dots ------------------------------------------------------- */
.typing {
  display: inline-flex;
  gap: var(--sp-2);
  align-items: center;
  height: var(--sp-6);
}

.typing i {
  width: var(--sp-2);
  height: var(--sp-2);
  border-radius: var(--r-pill);
  background: var(--c-text-mute);
  animation: typing-bob 1.1s var(--ease-out) infinite;
}

.typing i:nth-child(2) {
  animation-delay: 0.15s;
}

.typing i:nth-child(3) {
  animation-delay: 0.3s;
}

/* ---- .chip (model) ----------------------------------------------------- */
.chip {
  --model: var(--c-text-mute);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: color-mix(in srgb, var(--model) 9%, var(--c-ink-700));
  border: var(--bw) solid color-mix(in srgb, var(--model) 34%, transparent);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
  transition:
    transform var(--dur-base) var(--ease-pop),
    box-shadow var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out);
}

.chip__emoji {
  flex: none;
  display: grid;
  place-items: center;
  width: var(--sp-10);
  height: var(--sp-10);
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--model) 20%, var(--c-ink-800));
  font-size: var(--t-lg);
  line-height: 1;
}

.chip__body {
  display: grid;
  gap: var(--sp-1);
  min-width: 0;
}

.chip__name {
  display: block;
  font-family: var(--font-display);
  font-size: var(--t-md);
  font-weight: 800;
  letter-spacing: var(--tr-ui);
  color: var(--c-text);
}

.chip__tag {
  display: block;
  font-size: var(--t-xs);
  line-height: 1.3;
  color: var(--c-text-dim);
}

/* roster chips get a playful tilt that straightens on hover */
.roster .chip {
  transform: rotate(var(--tilt, 0deg));
  animation: chip-in var(--dur-slow) var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 45ms);
}

@media (hover: hover) {
  .roster .chip:hover {
    transform: rotate(0deg) translateY(calc(-1 * var(--sp-1)));
    border-color: color-mix(in srgb, var(--model) 70%, transparent);
    box-shadow:
      var(--sh-2),
      0 0 0 var(--bw) color-mix(in srgb, var(--model) 40%, transparent);
  }
}

/* ---- .badge ------------------------------------------------------------ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-1) var(--sp-3);
  border: var(--bw) solid var(--c-line);
  border-radius: var(--r-pill);
  background: var(--c-ink-700);
  font-size: var(--t-label);
  font-weight: 700;
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  color: var(--c-text-mute);
  white-space: nowrap;
}

.badge--streak {
  border-color: color-mix(in srgb, var(--a-magenta) 45%, transparent);
  background: color-mix(in srgb, var(--a-magenta) 14%, var(--c-ink-700));
  color: var(--a-magenta);
}

.badge--pop {
  animation: badge-pop var(--dur-pop) var(--ease-pop);
}

.badge--easy {
  color: var(--s-correct);
  border-color: color-mix(in srgb, var(--s-correct) 35%, transparent);
}

.badge--medium {
  color: var(--s-warn);
  border-color: color-mix(in srgb, var(--s-warn) 35%, transparent);
}

.badge--hard {
  color: var(--s-wrong);
  border-color: color-mix(in srgb, var(--s-wrong) 35%, transparent);
}

/* ---- .meter (timer) ---------------------------------------------------- */
.meter {
  position: relative;
  height: var(--meter-h);
  border-radius: var(--r-pill);
  background: var(--c-ink-500);
  overflow: hidden;
}

.meter__fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--a-lime-dim), var(--a-lime));
  transform-origin: left center;
  transform: scaleX(1);
  will-change: transform;
}

.meter.is-urgent .meter__fill {
  background: linear-gradient(90deg, var(--s-wrong), var(--s-warn));
}

.meter.is-urgent {
  animation: meter-pulse 0.8s var(--ease-out) infinite;
}

/* ---- .dots (progress) -------------------------------------------------- */
.dots {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
}

.dot {
  width: var(--dot-size);
  height: var(--dot-size);
  border-radius: var(--r-pill);
  background: var(--c-ink-500);
  transition:
    transform var(--dur-base) var(--ease-pop),
    background-color var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out);
}

.dot.is-correct {
  background: var(--s-correct);
}

.dot.is-wrong {
  background: var(--s-wrong);
}

.dot.is-current {
  background: var(--a-cyan);
  transform: scale(1.6);
  box-shadow: 0 0 0 var(--sp-1) color-mix(in srgb, var(--a-cyan) 22%, transparent);
}

/* ---- .panel ------------------------------------------------------------ */
.panel {
  padding: var(--sp-6);
  background: var(--c-ink-700);
  border: var(--bw) solid var(--c-line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
}

/* ---- .opt (answer option) ---------------------------------------------- */
.opt {
  --model: var(--c-text-mute);
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  width: 100%;
  min-height: var(--opt-min-h);
  padding: var(--sp-4) var(--sp-5);
  text-align: left;
  background: var(--c-ink-600);
  border: var(--bw) solid var(--c-line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
  cursor: pointer;
  animation: opt-in var(--dur-slow) var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 55ms);
  transition:
    transform var(--dur-fast) var(--ease-out),
    background-color var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out),
    opacity var(--dur-base) var(--ease-out);
}

.opt__emoji {
  flex: none;
  display: grid;
  place-items: center;
  width: var(--sp-10);
  height: var(--sp-10);
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--model) 22%, var(--c-ink-800));
  border: var(--bw) solid color-mix(in srgb, var(--model) 30%, transparent);
  font-size: var(--t-lg);
  line-height: 1;
  transition: transform var(--dur-base) var(--ease-pop);
}

.opt__name {
  flex: 1 1 auto;
  font-family: var(--font-display);
  font-size: var(--t-lg);
  font-weight: 800;
  letter-spacing: var(--tr-ui);
}

.opt__key {
  flex: none;
  display: grid;
  place-items: center;
  min-width: var(--sp-6);
  height: var(--sp-6);
  padding-inline: var(--sp-1);
  border-radius: var(--sp-1);
  background: var(--c-ink-800);
  border: var(--bw) solid var(--c-line);
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: var(--c-text-mute);
}

.opt__mark {
  flex: none;
  font-size: var(--t-lg);
  font-weight: 800;
  opacity: 0;
  transform: scale(0.5);
  transition:
    opacity var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-pop);
}

@media (hover: hover) {
  .opt:not(:disabled):hover {
    transform: translateY(calc(-1 * var(--sp-1) / 2));
    background: var(--c-ink-500);
    border-color: color-mix(in srgb, var(--model) 55%, var(--c-line-hi));
    box-shadow: var(--sh-2);
  }

  .opt:not(:disabled):hover .opt__emoji {
    transform: scale(1.12) rotate(-6deg);
  }
}

.opt:not(:disabled):active {
  transform: translateY(var(--bw)) scale(0.99);
}

.opt:disabled {
  cursor: default;
}

.opt.is-dim {
  opacity: 0.38;
}

.opt.is-correct {
  background: var(--s-correct-b);
  border-color: var(--s-correct);
  box-shadow: var(--glow-correct);
}

.opt.is-correct .opt__mark {
  opacity: 1;
  transform: scale(1);
  color: var(--s-correct);
}

.opt.is-wrong {
  background: var(--s-wrong-b);
  border-color: var(--s-wrong);
  box-shadow: var(--glow-wrong);
  animation: shake var(--dur-slow) var(--ease-out);
}

.opt.is-wrong .opt__mark {
  opacity: 1;
  transform: scale(1);
  color: var(--s-wrong);
}

/* =============================== START ================================== */
.hero {
  display: grid;
  gap: var(--sp-6);
  padding-block: var(--sp-8) var(--sp-12);
  justify-items: start;
}

.title {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: var(--lh-display);
  letter-spacing: var(--tr-tight);
  text-transform: uppercase;
}

.title__small {
  display: block;
  font-size: var(--t-xl);
  color: var(--c-text-dim);
  letter-spacing: var(--tr-label);
}

.title__big {
  position: relative;
  display: block;
  font-size: var(--t-mega);
  background: linear-gradient(
    100deg,
    var(--a-lime) 0%,
    var(--c-text) 55%,
    var(--a-magenta) 120%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* offset stroked ghost — deliberate print-misregistration detail */
.title__big::before {
  content: attr(data-text);
  position: absolute;
  left: calc(-1 * var(--sp-1));
  top: var(--sp-1);
  z-index: -1;
  color: transparent;
  -webkit-text-stroke: var(--bw) var(--a-magenta);
  opacity: 0.45;
}

.hero__sub {
  font-size: var(--t-xl);
  font-weight: 600;
  color: var(--c-text-dim);
}

.hero__bubble {
  max-width: 34rem;
  padding: var(--sp-5) var(--sp-6) var(--sp-6);
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  align-items: center;
}

.hero__hint {
  font-size: var(--t-sm);
  color: var(--c-text-mute);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: var(--t-xl);
  font-weight: 800;
  letter-spacing: var(--tr-ui);
}

.roster {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-3);
}

/* ================================ ROUND ================================= */
.hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3) var(--sp-5);
  margin-bottom: var(--sp-6);
}

.hud__group {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.hud__group--end {
  margin-left: auto;
}

.hud__round {
  font-family: var(--font-display);
  font-size: var(--t-md);
  font-weight: 800;
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  color: var(--c-text-dim);
}

.hud__score {
  font-family: var(--font-mono);
  font-size: var(--t-lg);
  font-weight: 700;
  color: var(--a-lime);
  font-variant-numeric: tabular-nums;
}

.timer {
  display: grid;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
}

.timer__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
}

.timer__value {
  font-family: var(--font-mono);
  font-size: var(--t-sm);
  font-variant-numeric: tabular-nums;
  color: var(--c-text-dim);
}

.timer.is-urgent .timer__value {
  color: var(--s-warn);
}

.quote {
  display: grid;
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
}

.quote__head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.options {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-3);
}

/* ---- reveal ------------------------------------------------------------ */
.reveal {
  --model: var(--c-text-mute);
  display: grid;
  gap: var(--sp-4);
  margin-top: var(--sp-6);
  border-color: color-mix(in srgb, var(--model) 30%, var(--c-line));
  background: color-mix(in srgb, var(--model) 7%, var(--c-ink-700));
  animation: reveal-in var(--dur-slow) var(--ease-out) both;
}

.reveal__verdict {
  font-family: var(--font-display);
  font-size: var(--t-xl);
  font-weight: 800;
  letter-spacing: var(--tr-ui);
}

.reveal.is-correct .reveal__verdict {
  color: var(--s-correct);
}

.reveal.is-wrong .reveal__verdict {
  color: var(--s-wrong);
}

.reveal__points {
  font-family: var(--font-mono);
  font-size: var(--t-sm);
  color: var(--c-text-mute);
  font-variant-numeric: tabular-nums;
}

.reveal__line {
  font-size: var(--t-md);
  line-height: var(--lh-prose);
  color: var(--c-text-dim);
}

.reveal__foot {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: center;
  justify-content: space-between;
}

/* =============================== RESULTS ================================ */
/* minmax(0,1fr): an implicit `auto` track is max-content-sized, so a nowrap
   breakdown row would widen the whole page instead of ellipsising */
.results {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-6);
  justify-items: center;
  text-align: center;
  padding-block: var(--sp-8);
}

.results__tier {
  font-family: var(--font-display);
  font-size: var(--t-xxl);
  font-weight: 800;
  line-height: var(--lh-display);
  letter-spacing: var(--tr-tight);
  text-wrap: balance;
}

.results__verdict {
  max-width: 34rem;
  font-size: var(--t-lg);
  color: var(--c-text-dim);
  text-wrap: balance;
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-3);
  width: 100%;
}

.stat {
  display: grid;
  gap: var(--sp-1);
  padding: var(--sp-5) var(--sp-4);
  background: var(--c-ink-700);
  border: var(--bw) solid var(--c-line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
}

.stat__value {
  font-family: var(--font-mono);
  font-size: var(--t-xxl);
  font-weight: 700;
  line-height: 1.1;
  color: var(--a-lime);
  font-variant-numeric: tabular-nums;
}

.stat--alt .stat__value {
  color: var(--a-magenta);
}

.stat__label {
  font-size: var(--t-label);
  font-weight: 700;
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  color: var(--c-text-mute);
}

.results__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  justify-content: center;
}

.copied {
  min-height: var(--sp-5);
  font-size: var(--t-sm);
  font-weight: 700;
  color: var(--s-correct);
  opacity: 0;
  transform: translateY(calc(-1 * var(--sp-1)));
  transition:
    opacity var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-pop);
}

.copied.is-on {
  opacity: 1;
  transform: translateY(0);
}

.copied.is-error {
  color: var(--s-warn);
}

/* breakdown of the 10 rounds */
.breakdown {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-2);
  text-align: left;
}

.breakdown__row {
  --model: var(--c-text-mute);
  display: flex;
  align-items: center;
  min-width: 0;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  background: var(--c-ink-800);
  border: var(--bw) solid var(--c-line);
  border-left: var(--sp-1) solid var(--model);
  border-radius: var(--r-sm);
  font-size: var(--t-sm);
}

.breakdown__mark {
  flex: none;
  font-weight: 800;
}

.breakdown__row.is-correct .breakdown__mark {
  color: var(--s-correct);
}

.breakdown__row.is-wrong .breakdown__mark {
  color: var(--s-wrong);
}

.breakdown__phrase {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: var(--c-text-dim);
}

.breakdown__model {
  flex: none;
  font-weight: 700;
  white-space: nowrap;
  color: var(--c-text);
}

/* ================================ FOOTER ================================ */
.foot {
  flex: none;
  border-top: var(--bw) solid var(--c-line);
  background: var(--c-ink-800);
  padding-block: var(--sp-6);
}

.foot p {
  font-size: var(--t-xs);
  line-height: var(--lh-prose);
  color: var(--c-text-mute);
  text-align: center;
  text-wrap: balance;
}

.foot__credit {
  margin-top: var(--sp-2);
}

.foot a {
  color: var(--a-lime);
  font-weight: 700;
  text-decoration: none;
  border-bottom: var(--bw) solid transparent;
  transition: border-color var(--t-fast) var(--ease-out);
}

.foot a:hover,
.foot a:focus-visible {
  border-color: var(--a-lime);
}

/* =============================== CONFETTI =============================== */
.confetti {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow: hidden;
  pointer-events: none;
}

.confetti i {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--sp-2);
  height: var(--sp-3);
  background: var(--c, var(--a-lime));
  border-radius: var(--bw-thick);
  will-change: transform, opacity;
  animation: confetti-fly var(--fly, 1100ms) var(--ease-out) forwards;
}

/* ============================== KEYFRAMES =============================== */
@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(var(--sp-4));
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes bubble-pop {
  0% {
    opacity: 0;
    transform: rotate(var(--bubble-rot)) scale(0.92) translateY(var(--sp-5));
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: rotate(var(--bubble-rot)) scale(1) translateY(0);
  }
}

@keyframes reveal-in {
  from {
    opacity: 0;
    transform: translateY(var(--sp-5));
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes opt-in {
  from {
    opacity: 0;
    transform: translateY(var(--sp-4));
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes chip-in {
  from {
    opacity: 0;
    transform: rotate(var(--tilt, 0deg)) translateY(var(--sp-3)) scale(0.96);
  }
  to {
    opacity: 1;
    transform: rotate(var(--tilt, 0deg));
  }
}

@keyframes typing-bob {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  30% {
    transform: translateY(calc(-1 * var(--sp-2)));
    opacity: 1;
  }
}

@keyframes badge-pop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.28) rotate(-6deg);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes meter-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(calc(-1 * var(--sp-2)));
  }
  40% {
    transform: translateX(var(--sp-2));
  }
  60% {
    transform: translateX(calc(-1 * var(--sp-1)));
  }
  80% {
    transform: translateX(var(--sp-1));
  }
}

@keyframes confetti-fly {
  0% {
    opacity: 1;
    transform: translate3d(var(--x0), var(--y0), 0) rotate(0deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--x1), var(--y1), 0) rotate(var(--rot))
      scale(0.6);
  }
}

@keyframes count-flash {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.18);
  }
  100% {
    transform: scale(1);
  }
}

.is-counting {
  animation: count-flash var(--dur-slow) var(--ease-pop);
  display: inline-block;
}

/* ============================== RESPONSIVE ============================== */
@media (min-width: 560px) {
  .options {
    grid-template-columns: 1fr 1fr;
  }

  .roster {
    grid-template-columns: 1fr 1fr;
  }

  .hero__cta {
    gap: var(--sp-5);
  }
}

@media (min-width: 900px) {
  :root {
    --gutter: var(--sp-8);
  }

  .roster {
    grid-template-columns: repeat(3, 1fr);
  }

  .bubble {
    padding: var(--sp-10) var(--sp-10) var(--sp-12);
  }

  main.wrap {
    padding-block: var(--sp-12) var(--sp-16);
  }

  /* copy left, speech bubble right — otherwise the hero leaves half the
     viewport empty at desktop widths */
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
    column-gap: var(--sp-16);
    padding-block: var(--sp-12) var(--sp-16);
  }

  .title {
    grid-area: 1 / 1;
  }

  .hero__sub {
    grid-area: 2 / 1;
  }

  .hero__cta {
    grid-area: 3 / 1;
    align-self: start;
  }

  .hero__bubble {
    grid-area: 1 / 2 / 4 / 3;
    align-self: center;
    justify-self: stretch;
    max-width: none;
    --bubble-rot: 1.5deg;
  }
}

/* ============================ REDUCED MOTION ============================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }

  .btn:hover,
  .opt:not(:disabled):hover,
  .roster .chip:hover {
    transform: rotate(var(--tilt, 0deg));
  }
}
