/*
 * The arena's look: a painted playground, refereed by a machine.
 *
 * The page is built around the one thing every player watches, the light.
 * Red and green mean the light and nothing else: the sign in the headline,
 * the lamp behind the doll, the edge of the stage and the calls on it all
 * change together, and no button, link or chart uses either colour. Pink is
 * the colour of things a visitor can press. Teal is the players' tracksuits,
 * and the doll's orange and yellow are her own paint, the same in either
 * theme.
 *
 * Two surfaces carry the page. The hero is the arena itself: a wall painted
 * to look like sky over a sand field, by day or under floodlights. The
 * console that sits on that field is always dark, the way a scoreboard is,
 * so camera footage, drawn players and recorded video all read the same way
 * inside it whichever theme is on.
 *
 * Both themes are declared in full. `:root` carries the day palette; the
 * night palette is redefined under `prefers-color-scheme` (guarded so an
 * explicit light stamp still wins) and again under `[data-theme="dark"]`, so
 * the toggle beats the system in both directions.
 */

/* ----------------------------------------------------------------- fonts */

@font-face {
  font-family: "Black Han Sans";
  src: url("fonts/black-han-sans.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans KR";
  src: url("fonts/ibm-plex-sans-kr-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans KR";
  src: url("fonts/ibm-plex-sans-kr-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---------------------------------------------------------------- tokens */

:root {
  color-scheme: light;

  /* The painted wall and the field in front of it. */
  --sky-1: #5fb2dc;
  --sky-2: #a9d9ef;
  --sky-3: #e2f3fa;
  --cloud: #ffffff;
  --cloud-alpha: 1;
  --sand-1: #ecd8ac;
  --sand-2: #dcbf86;
  --sand-edge: #c9a96c;

  --bg: #eef4f5;
  --surface: #ffffff;
  --surface-2: #f4f8f9;
  --ink: #0c2327;
  --ink-2: #33525a;
  --ink-mute: #4f6d74;
  --rule: rgba(12, 35, 39, 0.12);
  --rule-strong: rgba(12, 35, 39, 0.3);
  --sign-off: rgba(12, 35, 39, 0.4);

  /* Things a visitor can press. */
  --pink: #d1185f;
  --pink-deep: #8f0c3f;
  --pink-ink: #ffffff;
  --pink-text: #b0124f;
  --focus: #d1185f;

  /* The light. Loud by design: a player reads it in peripheral vision. */
  --red-lit: #e3342b;
  --green-lit: #12a150;
  --red-text: #b42318;
  --green-text: #0a7638;

  /* Paint that belongs to the game, not to the theme. */
  --teal: #0f7a6c;
  --teal-bright: #22a08d;
  --orange: #f08a24;
  --yellow: #ffc531;

  /* The console: always dark, like a scoreboard. */
  --console: #0d2026;
  --console-2: #13303a;
  --console-3: #1a3a45;
  --console-ink: #eaf5f5;
  --console-ink-2: #a9c3c7;
  --console-rule: rgba(234, 245, 245, 0.12);
  --stage-bg: #061217;
  --red-on-dark: #ff6f61;
  --led-on: #ff3b2f;
  --led-off: rgba(255, 59, 47, 0.09);
  --lamp-off: #2f454c;

  /* Chart series, in fixed order: no red, no green, no pink. */
  --s1: #0f7a6c;
  --s2: #b86e00;
  --s3: #2a63c6;
  --s4: #8a4fd0;
  --accent: var(--pink);
  --accent-ink: var(--pink-ink);

  --font-display: "Black Han Sans", "Arial Black", Impact, sans-serif;
  --font-body: "IBM Plex Sans KR", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-code: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono",
    monospace;

  --gutter: clamp(16px, 4vw, 40px);
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 1px 0 rgba(12, 35, 39, 0.05), 0 18px 40px -30px rgba(12, 35, 39, 0.55);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --sky-1: #040d16;
    --sky-2: #0a2234;
    --sky-3: #133349;
    --cloud: #9fc9e0;
    --cloud-alpha: 0.08;
    --sand-1: #2b261d;
    --sand-2: #191611;
    --sand-edge: #3b3325;

    --bg: #071319;
    --surface: #0d1f26;
    --surface-2: #10262e;
    --ink: #e6f2f2;
    --ink-2: #aac3c7;
    --ink-mute: #8ea9ad;
    --rule: rgba(230, 242, 242, 0.12);
    --rule-strong: rgba(230, 242, 242, 0.32);
    --sign-off: rgba(230, 242, 242, 0.34);

    --pink: #ff5c9b;
    --pink-deep: #a3174f;
    --pink-ink: #26040f;
    --pink-text: #ff86b3;
    --focus: #ff86b3;

    --red-lit: #ff4b3e;
    --green-lit: #36d07c;
    --red-text: #ff7d72;
    --green-text: #5fe39b;

    --console: #0a1a20;
    --console-2: #10272f;
    --console-3: #17343e;

    --s1: #39c3ae;
    --s2: #e3a640;
    --s3: #6ea3f4;
    --s4: #b88cf2;

    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 18px 40px -26px rgba(0, 0, 0, 0.9);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --sky-1: #040d16;
  --sky-2: #0a2234;
  --sky-3: #133349;
  --cloud: #9fc9e0;
  --cloud-alpha: 0.08;
  --sand-1: #2b261d;
  --sand-2: #191611;
  --sand-edge: #3b3325;

  --bg: #071319;
  --surface: #0d1f26;
  --surface-2: #10262e;
  --ink: #e6f2f2;
  --ink-2: #aac3c7;
  --ink-mute: #8ea9ad;
  --rule: rgba(230, 242, 242, 0.12);
  --rule-strong: rgba(230, 242, 242, 0.32);
  --sign-off: rgba(230, 242, 242, 0.34);

  --pink: #ff5c9b;
  --pink-deep: #a3174f;
  --pink-ink: #26040f;
  --pink-text: #ff86b3;
  --focus: #ff86b3;

  --red-lit: #ff4b3e;
  --green-lit: #36d07c;
  --red-text: #ff7d72;
  --green-text: #5fe39b;

  --console: #0a1a20;
  --console-2: #10272f;
  --console-3: #17343e;

  --s1: #39c3ae;
  --s2: #e3a640;
  --s3: #6ea3f4;
  --s4: #b88cf2;

  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 18px 40px -26px rgba(0, 0, 0, 0.9);
}

/* ------------------------------------------------------------------ base */

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

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

code {
  font-family: var(--font-code);
  font-size: 0.9em;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: min(100% - 2 * var(--gutter), 1140px);
  margin-inline: auto;
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 50;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 0.75rem;
}

/* --------------------------------------------------------------- top bar */

.topbar {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 20;
  padding: 18px 0;
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2.4vw, 28px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  margin-right: auto;
  border-radius: 999px;
}

/* A small lamp that shows the same light as the big one. */
.brand-lamp {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--lamp-off);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.18);
  transition: background-color 120ms linear, box-shadow 120ms linear;
}

.brand-lamp[data-phase="GREEN"] {
  background: var(--green-lit);
  box-shadow: 0 0 12px var(--green-lit);
}

.brand-lamp[data-phase="RED"] {
  background: var(--red-lit);
  box-shadow: 0 0 12px var(--red-lit);
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 24px);
}

.nav a {
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--ink);
  padding: 0.35rem 0.1rem;
  border-bottom: 2px solid transparent;
  transition: color 150ms ease, border-color 150ms ease;
}

.nav a:hover {
  border-bottom-color: var(--rule-strong);
}

.nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--pink);
}

.nav-source {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--rule-strong);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--ink);
  cursor: pointer;
  transition: background-color 150ms ease, transform 150ms ease;
}

.icon-btn:hover {
  background: var(--surface);
}

.icon-btn:active {
  transform: scale(0.94);
}

/* The toggle shows the theme it will switch to. */
.icon-btn .icon-sun {
  display: none;
}

:root[data-theme="dark"] .icon-btn .icon-sun {
  display: block;
}

:root[data-theme="dark"] .icon-btn .icon-moon {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .icon-sun {
    display: block;
  }

  :root:not([data-theme="light"]) .icon-btn .icon-moon {
    display: none;
  }
}

/* --------------------------------------------------------------- buttons */

/* Chunky, game-show buttons: a hard edge under each one, so a press reads as
   a press. */
.btn {
  --edge: rgba(12, 35, 39, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 50px;
  padding: 0.8rem 1.35rem;
  border-radius: 999px;
  border: 2px solid transparent;
  font: 600 1rem/1.1 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 5px 0 var(--edge);
  transform: translateY(0);
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 150ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 0 var(--edge);
}

.btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--edge);
}

.btn:disabled {
  cursor: progress;
  opacity: 0.7;
  transform: none;
}

.btn-primary {
  --edge: var(--pink-deep);
  background: var(--pink);
  color: var(--pink-ink);
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--rule-strong);
}

.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
  --edge: var(--rule-strong);
}

.btn-small {
  min-height: 40px;
  padding: 0.5rem 1rem;
  font-size: 0.92rem;
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--rule-strong);
  box-shadow: 0 3px 0 var(--edge);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.text-link {
  color: var(--pink-text);
  font-weight: 600;
  text-underline-offset: 3px;
}

/* ------------------------------------------------------------------ hero */

.hero {
  position: relative;
  overflow: hidden;
  overflow: clip;
  padding: 104px 0 56px;
  background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 38%, var(--sky-3) 62%);
  isolation: isolate;
}

/* Clouds, painted flat the way they are on the arena's walls. */
.sky {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

.cloud {
  position: absolute;
  height: 26px;
  border-radius: 999px;
  background: var(--cloud);
  opacity: var(--cloud-alpha);
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  bottom: 30%;
  border-radius: 50%;
  background: var(--cloud);
}

.cloud::before {
  left: 16%;
  width: 46%;
  aspect-ratio: 1;
}

.cloud::after {
  left: 48%;
  width: 32%;
  aspect-ratio: 1;
}

/* Placed in the sky the words leave empty: over the sign, between the sign
   and the menu, and peeking out from behind the console's two edges.
   Offsets are measured from the middle of the page, where the content
   column is, so the clouds stay clear of the text at any width. */
.cloud-a {
  top: 96px;
  left: calc(50% - 420px);
  width: 120px;
}

.cloud-b {
  top: 70px;
  left: calc(50% - 60px);
  width: 100px;
}

.cloud-c {
  top: 440px;
  right: calc(50% - 760px);
  width: 200px;
}

.cloud-d {
  top: 560px;
  left: calc(50% - 760px);
  width: 120px;
}

/* The field the console stands on, starting where the painted wall meets the
   ground. */
.field {
  position: absolute;
  inset: auto 0 0 0;
  height: 44%;
  z-index: -1;
  background:
    radial-gradient(70% 90% at 50% 0%, rgba(255, 255, 255, 0.16), transparent 70%),
    linear-gradient(180deg, var(--sand-1), var(--sand-2));
  border-top: 6px solid var(--sand-edge);
}

.hero-inner {
  position: relative;
}

.hero-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: end;
}

/* The sign: both lights, one of them lit. */
.sign {
  display: grid;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3rem, 7.2vw, 6.4rem);
  line-height: 0.9;
  letter-spacing: -0.005em;
  white-space: nowrap;
}

.sign-line {
  display: block;
  color: transparent;
  -webkit-text-stroke: 2px var(--sign-off);
  transition: color 90ms linear, text-shadow 90ms linear, -webkit-text-stroke-color 90ms linear;
}

.sign[data-lit="red"] .sign-red {
  color: var(--red-lit);
  -webkit-text-stroke-color: transparent;
  text-shadow: 0 0 0.32em color-mix(in srgb, var(--red-lit) 50%, transparent);
  animation: ignite 300ms linear;
}

.sign[data-lit="green"] .sign-green {
  color: var(--green-lit);
  -webkit-text-stroke-color: transparent;
  text-shadow: 0 0 0.32em color-mix(in srgb, var(--green-lit) 45%, transparent);
  animation: ignite 300ms linear;
}

/* A lamp catching: two flickers, then on. */
@keyframes ignite {
  0% {
    opacity: 0.35;
  }
  18% {
    opacity: 1;
  }
  30% {
    opacity: 0.5;
  }
  48%,
  100% {
    opacity: 1;
  }
}

.hero-copy {
  display: grid;
  gap: 18px;
  justify-items: start;
  padding-bottom: 6px;
  max-width: 34rem;
}

.lede {
  font-size: clamp(1.1rem, 1.5vw, 1.24rem);
  line-height: 1.55;
  color: var(--ink);
}

.privacy-line {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  color: var(--ink-2);
}

/* --------------------------------------------------------------- console */

.console {
  position: relative;
  margin-top: clamp(28px, 4vw, 44px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 286px;
  gap: 14px;
  padding: 14px;
  border-radius: 24px;
  background: var(--console);
  color: var(--console-ink);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 50px 80px -46px rgba(3, 16, 20, 0.85),
    0 18px 30px -24px rgba(3, 16, 20, 0.6);
}

/* Rows hold their own height. Stretched to a taller referee panel, the
   stage's 4:3 ratio would turn the extra height into extra width and push
   it out of its column. */
.stage-col {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 12px;
}

/* ----------------------------------------------------------------- stage */

.stage {
  position: relative;
  aspect-ratio: 4 / 3;
  width: 100%;
  border-radius: 14px;
  background: var(--stage-bg);
  overflow: hidden;
  overflow: clip;
  isolation: isolate;
  box-shadow: 0 0 0 3px var(--console-3);
  transition: box-shadow 160ms linear;
}

.stage[data-phase="GREEN"] {
  box-shadow: 0 0 0 3px var(--green-lit), 0 0 44px -10px var(--green-lit);
}

.stage[data-phase="RED"] {
  box-shadow: 0 0 0 3px var(--red-lit), 0 0 44px -10px var(--red-lit);
}

.demo-canvas,
#cam,
.replay-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: none;
}

.stage[data-mode="demo"] .demo-canvas {
  display: block;
}

/* The camera is mirrored for the player's benefit; the overlay boxes are
   mirrored by arithmetic instead, so their labels still read forwards. */
#cam {
  object-fit: cover;
  transform: scaleX(-1);
  background: #000;
}

.stage[data-mode="camera"][data-live="true"] #cam {
  display: block;
}

/* «Ледяные статуи» на красном (freezefx.js): поверх камеры, под рамками */
.freeze-fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* как у #cam: иначе холст растянут, а видео обрезано, и маски мимо лиц */
  z-index: 1;
  transform: scaleX(-1);
  pointer-events: none;
  opacity: 0;
}
.stage:not([data-mode="camera"]) .freeze-fx {
  display: none;
}
/* Бонусы на зелёном (greenbonus.js): поверх эффектов, под рамками игроков */
.bonus-fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 3;
  transform: scaleX(-1);
  pointer-events: none;
  opacity: 0;
}
.stage:not([data-mode="camera"]) .bonus-fx {
  display: none;
}

.replay-video {
  object-fit: contain;
  background: #000;
}

.stage[data-mode="replay"] .replay-video {
  display: block;
}

.demo-canvas,
#cam,
.replay-video,
.overlay {
  transition: filter 260ms ease;
}

/* The light, on the footage: green is open and warm, red narrows in. */
.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 220ms ease;
}

.stage[data-phase="GREEN"]::before {
  opacity: 1;
  background: radial-gradient(140% 100% at 50% 120%, rgba(54, 208, 124, 0.14), transparent 70%);
}

.stage[data-phase="RED"]::before {
  opacity: 1;
  background:
    radial-gradient(110% 86% at 50% 46%, transparent 40%, rgba(70, 6, 3, 0.5) 100%),
    radial-gradient(90% 60% at 50% -10%, rgba(255, 75, 62, 0.2), transparent 60%);
}

/* The freeze at the green-to-red snap: for a quarter of a second the picture
   stops looking live and starts looking like evidence. */
.stage[data-freeze="true"] .demo-canvas,
.stage[data-freeze="true"] #cam,
.stage[data-freeze="true"] .replay-video {
  filter: grayscale(0.85) contrast(1.3) brightness(1.08);
}

/* While a red light is armed the referee is reading every player: a slow red
   sweep across the stage says so. */
.scan {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms linear;
}

.scan::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 18%;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--red-lit) 7%, transparent) 75%,
    color-mix(in srgb, var(--red-lit) 55%, transparent) 99%,
    transparent
  );
  animation: scan-sweep 2.6s ease-in-out infinite alternate;
}

.stage[data-armed="true"] .scan {
  opacity: 1;
}

@keyframes scan-sweep {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(560%);
  }
}

.stage[data-outcome="WIPEOUT"]::before {
  opacity: 1;
  background: radial-gradient(102% 78% at 50% 46%, rgba(0, 0, 0, 0.25) 6%, rgba(0, 0, 0, 0.88) 94%);
}

.stage[data-outcome="WIPEOUT"] .demo-canvas,
.stage[data-outcome="WIPEOUT"] #cam,
.stage[data-outcome="WIPEOUT"] .overlay {
  filter: brightness(0.3) saturate(0.15);
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

/* What the stage is showing, in two words. */
.stage-badge {
  position: absolute;
  z-index: 5;
  left: 12px;
  top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.38rem 0.8rem 0.38rem 0.65rem;
  border-radius: 999px;
  background: rgba(4, 14, 18, 0.72);
  color: #f2fbfb;
  font-size: 0.85rem;
  font-weight: 600;
  backdrop-filter: blur(6px);
  pointer-events: none;
}

.badge-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--yellow);
}

.stage[data-mode="camera"] .badge-dot {
  background: var(--pink);
  animation: live-dot 1.6s ease-in-out infinite;
}

.stage[data-mode="replay"] .badge-dot {
  background: #f2fbfb;
}

@keyframes live-dot {
  50% {
    opacity: 0.35;
  }
}

/* One box per player: viewfinder corners, so the player stays visible inside
   it. The corners take the state colour; the faint full edge only places the
   box. */
.player-box {
  --c: rgba(255, 255, 255, 0.95);
  --l: 16px;
  --w: 3px;
  position: absolute;
  border-radius: 6px;
  background:
    linear-gradient(var(--c) 0 0) top left / var(--l) var(--w),
    linear-gradient(var(--c) 0 0) top left / var(--w) var(--l),
    linear-gradient(var(--c) 0 0) top right / var(--l) var(--w),
    linear-gradient(var(--c) 0 0) top right / var(--w) var(--l),
    linear-gradient(var(--c) 0 0) bottom left / var(--l) var(--w),
    linear-gradient(var(--c) 0 0) bottom left / var(--w) var(--l),
    linear-gradient(var(--c) 0 0) bottom right / var(--l) var(--w),
    linear-gradient(var(--c) 0 0) bottom right / var(--w) var(--l);
  background-repeat: no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  transition: left 90ms linear, top 90ms linear, width 90ms linear, height 90ms linear;
}

.player-box[data-state="warn"] {
  --c: var(--red-lit);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red-lit) 60%, transparent),
    inset 0 0 30px color-mix(in srgb, var(--red-lit) 22%, transparent);
}

.player-box[data-state="out"] {
  --c: var(--red-lit);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red-lit) 40%, transparent);
}

/* The stamp: the one word the referee says. */
.player-box[data-state="out"]::after {
  content: "OUT";
  position: absolute;
  left: 50%;
  top: 46%;
  translate: -50% -50%;
  rotate: -12deg;
  padding: 0.1em 0.35em 0;
  border: 3px solid var(--red-lit);
  border-radius: 6px;
  color: var(--red-lit);
  background: rgba(20, 2, 2, 0.35);
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 2.2vw, 1.5rem);
  line-height: 1.1;
  letter-spacing: 0.04em;
  animation: stamp 360ms cubic-bezier(0.2, 1.6, 0.4, 1);
}

@keyframes stamp {
  from {
    scale: 1.9;
    opacity: 0;
  }
  to {
    scale: 1;
    opacity: 1;
  }
}

.player-box[data-broke="true"] {
  animation: box-break 520ms ease-out;
}

@keyframes box-break {
  0% {
    transform: scale(1);
  }
  16% {
    transform: scale(1.06);
  }
  100% {
    transform: scale(1);
  }
}

/* Six pieces, thrown outward on their own rotations. */
.shard {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 1px;
  background: var(--red-lit);
  opacity: 0;
  animation: shard-fly 560ms cubic-bezier(0.16, 0.7, 0.3, 1) var(--wait) both;
}

@keyframes shard-fly {
  0% {
    transform: rotate(var(--throw)) translateY(0) scale(1);
    opacity: 0.95;
  }
  100% {
    transform: rotate(var(--throw)) translateY(-56px) scale(0.28);
    opacity: 0;
  }
}

/* The player's number, worn like a tracksuit patch. */
.player-tag {
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.12rem 0.45rem 0.02rem;
  border-radius: 4px;
  background: #ffffff;
  color: #111;
  font-family: var(--font-display);
  font-size: 0.95rem;
  line-height: 1.25;
  letter-spacing: 0.03em;
  white-space: nowrap;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}

.player-box[data-state="warn"] .player-tag {
  background: var(--red-lit);
  color: #fff;
}

.player-box[data-state="out"] .player-tag {
  background: #5d6b6f;
  color: #e9eeee;
}

/* Movement meter: the smoothed score against the live cutoff. The tick is the
   cutoff; the fill crossing it is what a call is made on. */
.meter {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}

.meter .fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: 999px;
  background: #e8f3f3;
  transition: width 90ms linear, background-color 140ms linear;
}

.meter[data-over="true"] .fill {
  background: var(--red-lit);
}

.meter .tick {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--yellow);
}

.player-box .meter {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  height: 6px;
  background: rgba(4, 14, 18, 0.6);
}

.player-box[data-broke="true"] .fill {
  transition: width 300ms cubic-bezier(0.5, 0, 0.9, 0.35);
}

/* ---------------------------------------------------- full-stage moments */

.flash {
  position: absolute;
  inset: 0;
  z-index: 6;
  background: var(--red-lit);
  opacity: 0;
  pointer-events: none;
}

.flash[data-on="true"] {
  animation: flash-out 620ms ease-out;
}

/* The green-to-red snap is white and over in a third of a second: a camera
   firing, not a verdict. A different colour and length from the elimination
   flash is what stops a player reading the light changing as a call. */
.flash[data-kind="snap"] {
  background: #ffffff;
}

.flash[data-kind="snap"][data-on="true"] {
  animation: flash-snap 300ms ease-out;
}

@keyframes flash-out {
  0% {
    opacity: 0.7;
  }
  100% {
    opacity: 0;
  }
}

@keyframes flash-snap {
  0% {
    opacity: 0.85;
  }
  22% {
    opacity: 0.3;
  }
  100% {
    opacity: 0;
  }
}

.lights-out {
  position: absolute;
  inset: -10% -30%;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  transform: translateX(100%);
  background: linear-gradient(98deg, rgba(4, 12, 10, 0) 0%, rgba(4, 12, 10, 0.96) 20%, rgba(4, 12, 10, 0.96) 100%);
}

.lights-out[data-on="true"] {
  opacity: 1;
  animation: lights-out 900ms cubic-bezier(0.36, 0, 0.2, 1) forwards;
}

@keyframes lights-out {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

.fx {
  position: absolute;
  inset: 0;
  z-index: 9;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* A card laid over the stage: the start screen when the camera fails, and the
   result at the end of a match. */
.stage-idle,
.endcard {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 18px;
  text-align: center;
}

.stage-idle {
  background: rgba(4, 14, 18, 0.78);
  backdrop-filter: blur(3px);
}

.idle-title,
.endcard-title {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 0.95;
}

.idle-title {
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  margin-bottom: 0.6rem;
}

.idle-text {
  max-width: 40ch;
  margin: 0 auto 1.2rem;
  color: var(--console-ink-2);
}

.stage-idle .cta-row,
.endcard .cta-row {
  justify-content: center;
}

.endcard {
  display: none;
  background: rgba(4, 14, 18, 0.42);
}

.endcard[data-show="true"] {
  display: grid;
  animation: fade-in 380ms ease-out;
}

.endcard-inner {
  display: grid;
  justify-items: center;
  gap: 0.3rem;
  max-width: 46ch;
  padding: clamp(18px, 3vw, 28px) clamp(20px, 4vw, 40px);
  border-radius: 18px;
  background: rgba(8, 24, 30, 0.92);
  box-shadow: 0 0 0 2px var(--console-3), 0 30px 60px -30px rgba(0, 0, 0, 0.9);
}

.endcard[data-show="true"] .endcard-inner {
  animation: lift 460ms cubic-bezier(0.2, 0.85, 0.3, 1);
}

.endcard[data-outcome="VICTORY"] .endcard-inner {
  box-shadow: 0 0 0 2px var(--green-lit), 0 30px 60px -30px rgba(0, 0, 0, 0.9);
}

.endcard[data-outcome="WIPEOUT"] .endcard-inner {
  box-shadow: 0 0 0 2px var(--red-lit), 0 30px 60px -30px rgba(0, 0, 0, 0.9);
}

.endcard[data-outcome="WIPEOUT"] {
  background: rgba(4, 14, 18, 0.1);
}

.endcard-eyebrow {
  font-size: 0.9rem;
  color: var(--console-ink-2);
}

.endcard-title {
  font-size: clamp(2.4rem, 6vw, 4rem);
}

.endcard[data-outcome="VICTORY"] .endcard-title {
  color: var(--green-lit);
}

.endcard[data-outcome="WIPEOUT"] .endcard-title {
  color: var(--red-on-dark);
}

.endcard-score {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 1rem;
  color: var(--console-ink-2);
}

.endcard-score .num {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
  color: var(--console-ink);
}

.endcard-detail {
  font-size: 0.92rem;
  color: var(--console-ink-2);
  margin-bottom: 0.8rem;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes lift {
  from {
    transform: translateY(14px);
  }
}

/* The reason for a call: the player's own movement, and the line it crossed. */
.why-card {
  position: absolute;
  z-index: 7;
  left: 12px;
  bottom: 12px;
  width: min(270px, 64%);
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(8, 22, 27, 0.9);
  box-shadow: inset 4px 0 0 var(--red-lit), 0 16px 30px -18px rgba(0, 0, 0, 0.9);
  color: var(--console-ink);
  display: none;
}

.why-card[data-show="true"] {
  display: block;
  animation: fade-in 200ms ease-out;
}

.why-card h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.15rem;
  line-height: 1.1;
  color: var(--red-on-dark);
  margin-bottom: 0.15rem;
}

.why-card .why-line {
  font-size: 0.82rem;
  color: var(--console-ink-2);
  margin-bottom: 0.35rem;
}

.why-card svg {
  display: block;
  width: 100%;
  height: 40px;
  color: var(--console-ink-2);
}

/* ------------------------------------------------------------ console bar */

.console-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 18px;
  align-items: center;
  padding: 2px 4px 2px;
}

.stage-caption {
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--console-ink-2);
}

.controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.difficulty-note,
.calibration-note {
  grid-column: 1 / -1;
  font-size: 0.84rem;
  color: var(--console-ink-2);
}

.difficulty-note:empty,
.calibration-note:empty {
  display: none;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 999px;
  background: var(--console-2);
  box-shadow: inset 0 0 0 1px var(--console-rule);
}

.segmented button {
  min-height: 38px;
  padding: 0.4rem 0.85rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--console-ink-2);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 150ms ease, color 150ms ease;
}

.segmented button:hover {
  color: var(--console-ink);
}

.segmented button[aria-pressed="true"] {
  background: var(--console-ink);
  color: var(--console);
}

.segmented-light {
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--rule);
}

.segmented-light button {
  color: var(--ink-2);
}

.segmented-light button:hover {
  color: var(--ink);
}

.segmented-light button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
}

.icon-btn-dark {
  width: 42px;
  height: 42px;
  background: var(--console-2);
  border-color: var(--console-rule);
  color: var(--console-ink);
}

.icon-btn-dark:hover {
  background: var(--console-3);
}

/* Difficulty and sound belong to a match being played; a replay has
   neither. */
.console[data-mode="replay"] .controls,
.console[data-mode="replay"] .difficulty-note {
  display: none;
}

.icon-btn-dark .icon-off,
.icon-btn-dark[aria-pressed="false"] .icon-on {
  display: none;
}

.icon-btn-dark[aria-pressed="false"] .icon-off {
  display: block;
}

.btn-stop {
  --edge: rgba(0, 0, 0, 0.5);
  min-height: 42px;
  padding: 0.5rem 1rem;
  background: var(--console-ink);
  color: var(--console);
  box-shadow: 0 3px 0 var(--edge);
}

/* --------------------------------------------------------------- referee */

.referee {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 12px 6px 6px;
  min-width: 0;
}

/* The lamp: the light itself, with the doll standing in front of it. */
.lamp {
  position: relative;
  width: min(100%, 210px);
  aspect-ratio: 1;
  margin: 6px auto 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, #3c565d 0%, var(--lamp-off) 62%);
  box-shadow: inset 0 0 0 6px rgba(0, 0, 0, 0.25), 0 0 0 4px var(--console-2);
  transition: background 140ms linear, box-shadow 140ms linear;
}

.lamp[data-phase="GREEN"] {
  background: radial-gradient(circle at 50% 42%, #9ef5c2 0%, var(--green-lit) 46%, #0b6b34 100%);
  box-shadow: inset 0 0 0 6px rgba(0, 0, 0, 0.18), 0 0 0 4px var(--console-2),
    0 0 60px -6px var(--green-lit);
}

.lamp[data-phase="RED"] {
  background: radial-gradient(circle at 50% 42%, #ffb3a8 0%, var(--red-lit) 46%, #861810 100%);
  box-shadow: inset 0 0 0 6px rgba(0, 0, 0, 0.18), 0 0 0 4px var(--console-2),
    0 0 60px -6px var(--red-lit);
}

.lamp[data-phase="VICTORY"] {
  background: radial-gradient(circle at 50% 42%, #ffe6a0 0%, var(--yellow) 50%, #a5740a 100%);
}

.doll-mount {
  position: absolute;
  left: 50%;
  bottom: -30px;
  width: 78%;
  translate: -50% 0;
  aspect-ratio: 200 / 260;
  color: #17110e;
}

.doll-mount svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.light-state {
  display: grid;
  justify-items: center;
  gap: 2px;
  text-align: center;
}

.light-word {
  font-family: var(--font-display);
  font-size: 1.9rem;
  line-height: 1;
  color: var(--console-ink);
}

.light-state[data-phase="GREEN"] .light-word {
  color: var(--green-lit);
}

.light-state[data-phase="RED"] .light-word {
  color: var(--red-on-dark);
}

.light-sub {
  font-size: 0.88rem;
  color: var(--console-ink-2);
}

/* The arena's timer board: red segments on black. */
.timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #030809;
  box-shadow: inset 0 0 0 1px var(--console-rule);
}

.timer-digits svg {
  display: block;
  height: 46px;
  width: auto;
  overflow: visible;
}

.seg {
  fill: var(--led-off);
  transition: fill 60ms linear;
}

.seg.on {
  fill: var(--led-on);
  filter: drop-shadow(0 0 3px rgba(255, 59, 47, 0.75));
}

.timer-label {
  font-size: 0.85rem;
  line-height: 1.2;
  color: var(--console-ink-2);
  max-width: 7rem;
}

.roster-block {
  display: grid;
  gap: 8px;
}

.roster-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--console-ink-2);
}

.roster {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-height: 46px;
}

.roster:empty::before {
  content: "Players appear here once they stand in frame.";
  grid-column: 1 / -1;
  font-size: 0.85rem;
  color: var(--console-ink-2);
}

/* One chip per player: their patch, and how much they are moving. */
.bib {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 10px;
  background: var(--console-2);
  transition: opacity 200ms ease;
}

.bib-num {
  padding: 0.12rem 0.38rem 0;
  border-radius: 3px;
  background: #ffffff;
  color: #111;
  font-family: var(--font-display);
  font-size: 0.95rem;
  line-height: 1.25;
  letter-spacing: 0.03em;
}

.bib-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.bib .meter {
  height: 6px;
}

.bib-state {
  font-size: 0.8rem;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--console-ink-2);
}

.bib-state:empty {
  display: none;
}

/* A recorded match has nine players: three to a row, number and verdict. */
.roster[data-compact="true"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.roster[data-compact="true"] .bib {
  grid-template-columns: auto;
  justify-content: start;
  padding: 6px 7px;
}

/* Nine to a panel leaves no room for the reason; the struck number says
   who is out, and the status line read to screen readers says why. */
.roster[data-compact="true"] .bib-body {
  display: none;
}

.roster[data-compact="true"] .bib[data-out="true"] .bib-num {
  background: color-mix(in srgb, var(--red-lit) 45%, #3a2a2a);
  color: #ffe9e6;
}

.bib[data-out="true"] .bib-num {
  background: #4d5c60;
  color: #cfd8d9;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.bib[data-out="true"] .bib-state {
  color: var(--red-on-dark);
  font-weight: 600;
}

.bib[data-out="true"] .meter {
  display: none;
}

.bib[data-dropped="true"] {
  animation: thud 640ms cubic-bezier(0.3, 1.35, 0.4, 1);
}

@keyframes thud {
  0% {
    transform: translateY(-3px);
  }
  22% {
    transform: translateY(5px);
  }
  48% {
    transform: translateY(0);
  }
  64% {
    transform: translateY(2px);
  }
}

/* ------------------------------------------------------------------ doll
 *
 * Her whole performance is three transforms on three nested groups, kept on
 * separate elements so they can run at once. `.doll-head` is the turn, a
 * transition between fixed angles. `.doll-gaze` inside it is the slow sweep
 * of a red light, and `.eyes` inside that lead the sweep by a fraction.
 * `.doll-body` breathes under all of it.
 */

.doll .doll-head,
.doll .doll-gaze {
  transform-box: fill-box;
  transform-origin: 50% 88%;
}

.doll .doll-head {
  transition: transform 300ms cubic-bezier(0.34, 1.4, 0.42, 1);
}

.doll .face,
.doll .back-head,
.doll .profile-head {
  opacity: 0;
  transition: opacity 110ms linear;
}

.doll[data-facing="away"] .doll-head {
  transform: rotate(0deg);
}

.doll[data-facing="away"] .back-head {
  opacity: 1;
}

.doll[data-facing="player"] .doll-head {
  transform: rotate(-4deg);
}

.doll[data-facing="player"] .face {
  opacity: 1;
}

.doll[data-turn="profile"] .back-head,
.doll[data-turn="profile"] .face {
  opacity: 0;
}

.doll[data-turn="profile"] .profile-head {
  opacity: 1;
}

.doll[data-turn="profile"] .doll-head {
  transform: rotate(-19deg);
}

.doll[data-turn][data-facing] .doll-body {
  animation: doll-follow 520ms cubic-bezier(0.33, 0.9, 0.35, 1);
}

@keyframes doll-follow {
  0% {
    transform: rotate(0deg);
  }
  38% {
    transform: rotate(-2.4deg);
  }
  70% {
    transform: rotate(0.8deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

.doll[data-scan="true"]:not([data-turn]) .doll-gaze {
  animation: doll-scan 3.6s ease-in-out infinite;
}

.doll[data-scan="true"]:not([data-turn]) .eyes {
  animation: doll-eyes 3.6s ease-in-out infinite;
}

@keyframes doll-scan {
  0%,
  100% {
    transform: rotate(-5deg);
  }
  50% {
    transform: rotate(5deg);
  }
}

@keyframes doll-eyes {
  0%,
  100% {
    transform: translateX(-3px);
  }
  44%,
  56% {
    transform: translateX(3px);
  }
}

.doll .eyes {
  transform-box: fill-box;
  transform-origin: 50% 50%;
}

/* Armed: her eyes light up red, exactly while the judge is counting. */
.doll .eye {
  transition: fill 150ms linear;
}

.doll[data-armed="true"] .eye {
  fill: var(--red-lit);
}

.doll .eye-glow {
  opacity: 0;
  fill: var(--red-lit);
  transition: opacity 150ms linear;
}

.doll[data-armed="true"] .eye-glow {
  opacity: 1;
  animation: eye-pulse 1.1s ease-in-out infinite;
}

@keyframes eye-pulse {
  50% {
    opacity: 0.45;
  }
}

.doll[data-snap="true"] .doll-head {
  animation: doll-snap 520ms cubic-bezier(0.2, 0.9, 0.3, 1);
}

@keyframes doll-snap {
  0% {
    transform: rotate(-4deg) scale(1);
  }
  14% {
    transform: rotate(-15deg) scale(1.035);
  }
  46% {
    transform: rotate(-1deg) scale(1);
  }
  100% {
    transform: rotate(-4deg) scale(1);
  }
}

.doll .doll-body {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

.doll[data-facing="away"] .doll-body {
  animation: doll-sway 2.4s ease-in-out infinite;
}

.doll[data-facing="player"] .doll-body {
  animation: doll-breathe 4.2s ease-in-out infinite;
}

@keyframes doll-sway {
  0%,
  100% {
    transform: rotate(-1.1deg);
  }
  50% {
    transform: rotate(1.1deg);
  }
}

@keyframes doll-breathe {
  0%,
  100% {
    transform: translateY(0) scaleY(1);
  }
  50% {
    transform: translateY(-1.5px) scaleY(1.009);
  }
}

/* The bow. Last on purpose: it ties on specificity with both idle body
   animations and has to win. */
.doll[data-pose="bow"] .doll-body {
  animation: doll-bow 1.5s cubic-bezier(0.3, 0.8, 0.35, 1);
}

.doll[data-pose="bow"] .doll-head {
  animation: doll-nod 1.5s cubic-bezier(0.3, 0.8, 0.35, 1);
}

@keyframes doll-bow {
  0%,
  100% {
    transform: rotate(0deg) translateY(0);
  }
  30%,
  55% {
    transform: rotate(-1deg) translateY(7px) scaleY(0.965);
  }
}

@keyframes doll-nod {
  0%,
  100% {
    transform: rotate(-4deg);
  }
  30%,
  55% {
    transform: rotate(-14deg) translateY(6px);
  }
}

/* ---------------------------------------------------------------- bands */

.band {
  padding: clamp(64px, 9vw, 112px) 0;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.2rem, 4.6vw, 3.5rem);
  line-height: 1;
  letter-spacing: -0.005em;
  margin-bottom: 0.9rem;
  max-width: 26ch;
}

.section-lede {
  max-width: 60ch;
  font-size: 1.14rem;
  color: var(--ink-2);
  margin-bottom: clamp(28px, 4vw, 44px);
}

/* ---------------------------------------------------------- how it works */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 2.6vw, 30px);
}

.step {
  display: grid;
  align-content: start;
  gap: 12px;
}

.step p {
  color: var(--ink-2);
  max-width: 40ch;
}

.step-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.24rem;
  font-weight: 600;
  line-height: 1.25;
}

.step-num {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2rem;
  height: 2rem;
  padding-top: 0.12rem;
  border-radius: 50%;
  background: var(--yellow);
  color: #231800;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.step-art {
  margin: 0 0 6px;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  background: var(--console);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.step-art svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Step one: a player, the points a pose model finds, then the box. */
.art-floor {
  fill: #13303a;
}

.art-shadow {
  fill: rgba(0, 0, 0, 0.35);
}

.art-suit,
.art-arm {
  fill: var(--teal-bright);
}

.art-leg {
  fill: #12665b;
}

.art-bib {
  fill: #ffffff;
}

.art-skin {
  fill: #f1c9a5;
}

.art-hair {
  fill: #1b1512;
}

.art-bones path {
  fill: none;
  stroke: var(--yellow);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
}

.art-joints circle {
  fill: var(--yellow);
  transform-box: fill-box;
  transform-origin: center;
}

.art-box path {
  fill: none;
  stroke: #ffffff;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.art-tag rect {
  fill: #ffffff;
}

.art-tag text,
.art-checks text,
.art-out text {
  font-family: var(--font-display);
  font-size: 15px;
  fill: #111;
}

.is-playing .art-joints circle {
  animation: pop 4.8s cubic-bezier(0.3, 1.6, 0.5, 1) infinite;
  animation-delay: calc(var(--i) * 70ms);
}

.is-playing .art-bones {
  animation: appear 4.8s ease infinite;
}

.is-playing .art-box path {
  stroke-dasharray: 60;
  animation: draw 4.8s ease infinite;
}

.is-playing .art-tag {
  animation: appear-late 4.8s ease infinite;
}

@keyframes pop {
  0%,
  6% {
    transform: scale(0);
  }
  14%,
  92% {
    transform: scale(1);
  }
  100% {
    transform: scale(0);
  }
}

@keyframes appear {
  0%,
  22% {
    opacity: 0;
  }
  32%,
  92% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes draw {
  0%,
  34% {
    stroke-dashoffset: 60;
  }
  48%,
  92% {
    stroke-dashoffset: 0;
  }
  100% {
    stroke-dashoffset: 60;
  }
}

@keyframes appear-late {
  0%,
  46% {
    opacity: 0;
    transform: translateY(4px);
  }
  54%,
  92% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
  }
}

/* Step two: two looks at one player, a tenth of a second apart. */
.art-window-frame {
  fill: #0a171c;
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 1.5;
}

.art-pixels rect {
  fill: #20363d;
}

.art-pixels rect.on {
  fill: #9cc0c5;
}

.art-changed rect {
  fill: var(--pink);
}

.art-caption {
  font-size: 11px;
  fill: #a9c3c7;
}

.art-arrow {
  fill: none;
  stroke: #a9c3c7;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.art-meter-track {
  fill: rgba(255, 255, 255, 0.14);
}

.art-meter-fill {
  fill: var(--red-lit);
  transform-box: fill-box;
  transform-origin: left center;
  transform: scaleX(0.62);
}

.art-meter-tick {
  fill: var(--yellow);
}

.is-playing .art-changed {
  animation: blink 2.4s steps(1) infinite;
}

.is-playing .art-meter-fill {
  animation: meter 2.4s ease-in-out infinite;
}

@keyframes blink {
  0%,
  20% {
    opacity: 0;
  }
  25%,
  85% {
    opacity: 1;
  }
}

@keyframes meter {
  0%,
  20% {
    transform: scaleX(0.04);
  }
  45%,
  85% {
    transform: scaleX(0.62);
  }
  100% {
    transform: scaleX(0.04);
  }
}

/* Step three: a red light, the grace, the line, and three checks over it. */
.art-red-zone {
  fill: rgba(255, 75, 62, 0.14);
}

.art-grace {
  fill: rgba(255, 255, 255, 0.07);
}

.art-zone-label,
.art-cutoff-label {
  font-size: 11px;
  fill: #a9c3c7;
}

.art-axis {
  stroke: rgba(255, 255, 255, 0.25);
  stroke-width: 1.5;
}

.art-cutoff {
  stroke: var(--yellow);
  stroke-width: 2;
  stroke-dasharray: 6 5;
}

.art-trace {
  fill: none;
  stroke: #e9f4f4;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.art-checks circle {
  fill: var(--red-lit);
}

.art-checks text {
  font-size: 12px;
  fill: #fff;
}

.art-checks g {
  transform-box: fill-box;
  transform-origin: center;
}

.art-out rect {
  fill: none;
  stroke: var(--red-lit);
  stroke-width: 3;
}

.art-out text {
  font-size: 22px;
  fill: var(--red-lit);
}

.art-out {
  transform-box: fill-box;
  transform-origin: center;
  transform: rotate(-8deg);
}

.is-playing .art-trace {
  stroke-dasharray: 320;
  animation: trace 4.8s linear infinite;
}

.is-playing .art-checks g {
  animation: check 4.8s cubic-bezier(0.3, 1.6, 0.5, 1) infinite;
  animation-delay: calc(var(--i) * 260ms);
}

.is-playing .art-out {
  animation: slam 4.8s cubic-bezier(0.2, 1.4, 0.4, 1) infinite;
}

@keyframes trace {
  0% {
    stroke-dashoffset: 320;
  }
  50%,
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes check {
  0%,
  36% {
    transform: scale(0);
  }
  42%,
  94% {
    transform: scale(1);
  }
  100% {
    transform: scale(0);
  }
}

@keyframes slam {
  0%,
  58% {
    opacity: 0;
    transform: rotate(-8deg) scale(1.8);
  }
  64%,
  94% {
    opacity: 1;
    transform: rotate(-8deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: rotate(-8deg) scale(1);
  }
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin-top: clamp(28px, 4vw, 44px);
  max-width: 62ch;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--rule);
  color: var(--ink-2);
  font-size: 0.97rem;
}

.privacy-note .icon {
  margin-top: 0.15rem;
  color: var(--ink);
}

/* -------------------------------------------------------------- accuracy */

.band-accuracy {
  background: var(--surface-2);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.proof {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: clamp(18px, 2.6vw, 28px);
}

.proof-main {
  padding: clamp(20px, 3vw, 32px);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--rule), var(--shadow);
}

.tallies {
  display: grid;
  gap: clamp(26px, 3.4vw, 40px);
}

.tally-fig {
  margin: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px 20px;
  align-items: end;
}

.tally-fig .dots,
.tally-fig .dots-key {
  grid-column: 1 / -1;
}

.tally-num {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1;
  color: var(--ink-2);
}

.tally-num strong {
  font-weight: 400;
  font-size: clamp(2.6rem, 5vw, 3.8rem);
  color: var(--ink);
}

.tally-cap {
  max-width: 32ch;
  margin-bottom: 4px;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--ink-2);
}

/* Every sample is one square: a unit chart, so the misses are countable. */
.dots {
  width: 100%;
  min-height: 60px;
}

.dots canvas {
  display: block;
}

.dots-key {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: -4px;
  font-size: 0.88rem;
  color: var(--ink-2);
}

.dots-key i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 2px;
  vertical-align: -1px;
}

.proof-note {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
  color: var(--ink-2);
  max-width: 70ch;
}

.proof-side {
  display: grid;
  align-content: start;
  gap: clamp(18px, 2.6vw, 28px);
}

.proof-more {
  display: grid;
  justify-items: start;
  gap: 14px;
  padding: clamp(20px, 3vw, 30px);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--rule), var(--shadow);
}

.proof-more p {
  color: var(--ink-2);
}

.parity {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: clamp(20px, 3vw, 30px);
  border-radius: var(--radius);
  background: var(--console);
  color: var(--console-ink);
  box-shadow: var(--shadow);
}

.parity h3 {
  font-size: 1.24rem;
  font-weight: 600;
  line-height: 1.3;
}

.parity p {
  color: var(--console-ink-2);
}

.parity .text-link {
  color: #ff86b3;
}

/* ---------------------------------------------------------- measurements */

.band-top {
  padding-top: 112px;
  padding-bottom: 8px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 18px;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
}

.back-link:hover {
  color: var(--ink);
}

.page-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3rem, 7vw, 5.4rem);
  line-height: 0.95;
  margin-bottom: 1rem;
}

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toc a {
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--rule-strong);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}

.toc a:hover {
  background: var(--surface-2);
}

#measurements .band + .band {
  border-top: 1px solid var(--rule);
}

.card {
  padding: clamp(18px, 2.6vw, 26px);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--rule), var(--shadow);
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
}

.card h3 {
  font-size: 1.2rem;
  font-weight: 600;
}

.card-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-2);
}

.note {
  font-size: 0.92rem;
  color: var(--ink-2);
}

.wide-note {
  margin-top: 18px;
  max-width: 78ch;
}

/* The referee lab. */
.lab-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  align-items: start;
}

.lab-side {
  display: grid;
  gap: 14px;
}

.plot-frame {
  position: relative;
  padding: 14px 16px 8px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--rule), var(--shadow);
  touch-action: none;
}

.plot-frame svg {
  display: block;
  width: 100%;
  height: auto;
  cursor: ns-resize;
}

.plot-frame .axis-line {
  stroke: var(--rule);
  stroke-width: 1;
}

.plot-frame .axis-text {
  font-family: var(--font-body);
  font-size: 10px;
  fill: var(--ink-mute);
}

.plot-frame .frozen-note {
  fill: var(--s3);
}

.plot-frame .trace-moving {
  fill: none;
  stroke: var(--s1);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.plot-frame .trace-frozen {
  fill: none;
  stroke: var(--s3);
  stroke-width: 3.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.plot-frame[data-focus] polyline {
  opacity: 0.16;
}

.plot-frame[data-focus] polyline.is-focused {
  opacity: 1;
  stroke-width: 4;
}

.plot-frame .caught-dot {
  fill: var(--red-lit);
  stroke: var(--surface);
  stroke-width: 2;
}

.plot-frame .thresh-line {
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 7 4;
}

.plot-frame .thresh-grip {
  fill: var(--accent);
}

.plot-frame .thresh-grip-text {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  fill: var(--accent-ink);
}

.plot-frame .measured-line {
  stroke: var(--ink-mute);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}

.plot-frame .safe-band {
  fill: var(--accent);
  opacity: 0.1;
}

.big-read {
  font-family: var(--font-display);
  font-size: 1.9rem;
  line-height: 1.1;
}

.big-read small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.84rem;
  color: var(--ink-2);
  margin-top: 0.15rem;
}

.big-read .split-read {
  display: block;
  margin-top: 0.5rem;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.tally {
  display: grid;
  gap: 6px;
}

.tally-row {
  display: grid;
  grid-template-columns: 0.75rem minmax(0, 1fr) auto;
  gap: 0.6rem;
  align-items: center;
  font-size: 0.9rem;
  padding: 0.15rem 0.3rem;
  border-radius: 6px;
  cursor: default;
}

.tally-row:hover {
  background: var(--surface-2);
}

.swatch {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 3px;
}

.swatch-moving {
  background: var(--s1);
}

.swatch-frozen {
  background: var(--s3);
}

.verdict-out {
  color: var(--red-text);
  font-weight: 600;
}

.verdict-safe {
  color: var(--ink-2);
}

/* The obvious designs. */
.control-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.control-label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-2);
}

.exhibits {
  display: grid;
  gap: 16px;
}

.exhibit {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 36px);
  align-items: center;
  padding: clamp(18px, 2.6vw, 28px);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--rule), var(--shadow);
}

.exhibit h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.6rem;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.exhibit p {
  color: var(--ink-2);
  font-size: 0.98rem;
}

.exhibit p + p {
  margin-top: 0.6rem;
}

.readout-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.readout {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--rule);
}

.readout-wide {
  grid-column: 1 / -1;
}

.readout .k {
  display: block;
  font-size: 0.82rem;
  color: var(--ink-2);
}

.readout .v {
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.readout[data-flavour="bad"] .v {
  color: var(--red-text);
}

.readout[data-flavour="good"] .v {
  color: var(--green-text);
}

.barline {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.barline-row {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr) 3.4rem;
  gap: 0.6rem;
  align-items: center;
  font-size: 0.85rem;
}

.barline-track {
  height: 14px;
  border-radius: 4px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--rule);
  overflow: hidden;
}

.barline-fill {
  height: 100%;
  background: var(--s1);
  transition: width 200ms ease;
}

.barline-row[data-flavour="bad"] .barline-fill {
  background: var(--red-lit);
}

.barline-row[data-flavour="good"] .barline-fill {
  background: var(--green-lit);
}

.barline-val {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.limitation {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--red-lit) 8%, var(--surface));
  box-shadow: inset 4px 0 0 var(--red-lit);
}

.limitation-title {
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.limitation p:last-child {
  color: var(--ink-2);
  font-size: 0.95rem;
}

/* The benchmark charts. */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  gap: 16px;
}

.chart-card {
  min-width: 0;
  padding: clamp(18px, 2.6vw, 26px);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--rule), var(--shadow);
}

.chart-card-wide {
  margin-top: 16px;
}

.chart-card h3 {
  font-size: 1.12rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.chart-card .note {
  margin-bottom: 14px;
}

.chart-frame {
  position: relative;
  height: 260px;
}

.chart-frame.tall {
  height: 320px;
}

.chart-frame.short {
  height: 150px;
}

.chart-missing {
  display: none;
  font-size: 0.88rem;
  color: var(--ink-2);
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius-sm);
  padding: 0.8rem;
}

.charts-unavailable .chart-frame {
  display: none;
}

.charts-unavailable .chart-missing {
  display: block;
}

.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin-top: 0.8rem;
}

.legend-key {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--ink-2);
}

.legend-key i {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 3px;
}

details.table-view {
  margin-top: 1rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--rule);
  overflow-x: auto;
}

details.table-view summary {
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-2);
}

table {
  width: 100%;
  margin-top: 0.7rem;
  border-collapse: collapse;
  font-size: 0.86rem;
}

th,
td {
  padding: 0.4rem 0.5rem;
  text-align: right;
  border-bottom: 1px solid var(--rule);
  font-variant-numeric: tabular-nums;
}

th:first-child,
td:first-child {
  text-align: left;
}

thead th {
  font-weight: 600;
  color: var(--ink-2);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 0;
}

.stat {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--rule);
}

.stat .k {
  display: block;
  font-size: 0.82rem;
  color: var(--ink-2);
}

.stat .k,
.stat .v {
  margin: 0;
}

.stat .v {
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

#benchMeta {
  margin-top: 14px;
}

/* Running it yourself. */
.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 16px;
  align-items: stretch;
}

pre {
  margin: 0;
  overflow-x: auto;
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--console);
  color: var(--console-ink);
  font-family: var(--font-code);
  font-size: 0.84rem;
  line-height: 1.7;
}

pre code {
  font-size: inherit;
}

/* ---------------------------------------------------------------- footer */

footer {
  padding: 36px 0 48px;
  border-top: 1px solid var(--rule);
  color: var(--ink-2);
  font-size: 0.92rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  align-items: baseline;
}

.footer-fine {
  flex-basis: 100%;
  font-size: 0.84rem;
  color: var(--ink-mute);
}

/* The selftest's verdict, for a person rather than a headless browser. */
.selftest-banner {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 60;
  translate: -50% 0;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--console);
  color: var(--console-ink);
  box-shadow: inset 4px 0 0 var(--green-lit), 0 20px 40px -20px rgba(0, 0, 0, 0.7);
  font-size: 0.95rem;
}

.selftest-banner[data-passed="false"] {
  box-shadow: inset 4px 0 0 var(--red-lit), 0 20px 40px -20px rgba(0, 0, 0, 0.7);
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 1080px) {
  .console {
    grid-template-columns: minmax(0, 1fr);
  }

  .referee {
    grid-template-columns: 170px minmax(0, 1fr);
    grid-template-areas:
      "lamp light"
      "lamp timer"
      "roster roster";
    align-items: center;
    column-gap: 18px;
    padding: 6px 4px 4px;
  }

  .lamp {
    grid-area: lamp;
    width: 150px;
    margin: 4px auto 30px;
  }

  .light-state {
    grid-area: light;
    justify-items: start;
    text-align: left;
  }

  .timer {
    grid-area: timer;
    justify-content: flex-start;
    justify-self: start;
  }

  .roster-block {
    grid-area: roster;
  }

  .roster {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}

@media (max-width: 860px) {
  .hero-head {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .steps {
    grid-template-columns: minmax(0, 1fr);
    max-width: 560px;
  }

  .proof,
  .lab-grid,
  .exhibit {
    grid-template-columns: minmax(0, 1fr);
  }

  .nav a:not(.nav-source):not([data-route="measurements"]) {
    display: none;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 1rem;
  }

  .hero {
    padding-top: 88px;
  }

  .brand-name,
  .nav-source span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .cloud {
    display: none;
  }

  .sign {
    font-size: clamp(2.7rem, 15vw, 4.2rem);
  }

  .cta-row .btn {
    flex: 1 1 100%;
  }

  .console {
    margin-inline: calc(-1 * var(--gutter) + 6px);
    padding: 8px;
    border-radius: 18px;
  }

  .console-bar {
    grid-template-columns: minmax(0, 1fr);
  }

  .controls {
    flex-wrap: wrap;
  }

  .referee {
    grid-template-columns: 116px minmax(0, 1fr);
    column-gap: 12px;
  }

  .lamp {
    width: 110px;
    margin-bottom: 24px;
  }

  .light-word {
    font-size: 1.5rem;
  }

  .timer {
    padding: 8px 10px;
    gap: 8px;
  }

  .timer-digits svg {
    height: 34px;
  }

  .why-card {
    width: calc(100% - 24px);
  }

  /* A phone's stage is a few hundred pixels tall: the result keeps its
     count and its two ways on, and drops the sentences around them. */
  .endcard {
    padding: 8px;
  }

  .endcard-inner {
    gap: 0.15rem;
    padding: 12px 14px;
  }

  .endcard-eyebrow,
  .endcard-detail {
    display: none;
  }

  .endcard-title {
    font-size: 2.1rem;
  }

  .idle-title {
    font-size: 1.35rem;
    margin-bottom: 0.4rem;
  }

  .idle-text {
    font-size: 0.85rem;
    line-height: 1.45;
    margin-bottom: 0.7rem;
  }

  .endcard-score {
    margin-bottom: 0.5rem;
  }

  .endcard .cta-row,
  .stage-idle .cta-row {
    gap: 8px;
  }

  .endcard .cta-row .btn,
  .stage-idle .cta-row .btn {
    flex: 0 1 auto;
    min-height: 40px;
    padding: 0.5rem 0.9rem;
    font-size: 0.88rem;
  }

  .barline-row {
    grid-template-columns: 6.5rem minmax(0, 1fr) 3rem;
    font-size: 0.78rem;
  }

  .readout-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .tally-fig {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .scan::before {
    animation: none;
    width: 100%;
    background: radial-gradient(110% 90% at 50% 50%, transparent 55%, color-mix(in srgb, var(--red-lit) 26%, transparent));
  }
}
