/* Nine Lives: Manchester spirit, a live threat hunting terminal.
 * Green = findings/live. Coral = wrong submissions/lost lives.
 * All motion respects the system's reduced-motion preference. */
@font-face {
  font-family: Recursive;
  src: url("recursive.woff2") format("woff2");
  font-weight: 300 1000;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;
  --floor: #090c0a;
  --sea: #101411;
  --sea-2: #1a201b;
  --field: #0b0f0c;
  --edge: #303a31;
  --edge-2: #5e7257;
  --hair: rgb(75 91 72 / 40%);
  --ink: #f0f3ea;
  --ink-2: #c9d1c4;
  --muted: #9da997;
  --action: #c6fa73;
  --action-hi: #d9ffa2;
  --action-ink: #152109;
  --accent: #dfba78;
  --safety: #9ec5ff;
  --downgrade: #e7a6ff;
  --capture: #c6fa73;
  --damage: #ff8078;
  --wake-capture: #c6fa73;
  --wake-damage: #ff8078;
  --water-line: rgb(190 220 170 / 13%);
  --bw: 1px;
  --shadow: 0 24px 70px rgb(0 0 0 / 45%);
  --scrim: rgb(2 5 3 / 82%);
}

:root {
  --font: "Recursive", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --display: "Recursive", ui-monospace, "SFMono-Regular", Consolas, monospace;
  /* Type scale. Nothing on the page is set below 14px. */
  --t-14: 0.875rem;
  --t-15: 0.9375rem;
  --t-16: 1rem;
  --t-17: 1.0625rem;
  --t-18: 1.125rem;
  --t-20: 1.25rem;
  --t-24: 1.5rem;
  --t-28: 1.75rem;
  --t-36: 2.25rem;
  --r-sm: 2px;
  --r-md: 3px;
  --r-lg: 4px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html {
  min-width: 320px;
  height: 100%;
  overflow: hidden;
  background: var(--floor);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--floor);
  font: 400 var(--t-16) / 1.5 var(--font);
  font-variant-numeric: tabular-nums;
  font-variation-settings: "MONO" 1, "CASL" 0;
  -webkit-font-smoothing: antialiased;
  isolation: isolate;
}

h1, h2, h3, p, dl, dd, ol, ul, fieldset, legend { margin: 0; padding: 0; }
ol, ul { list-style: none; }
fieldset { border: 0; min-width: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:disabled, input:disabled { cursor: not-allowed; }
[hidden] { display: none !important; }
img { display: block; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i {
  width: 1.25em; height: 1.25em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.skip-link {
  position: fixed; z-index: 100; top: 12px; left: 12px; padding: 12px 20px; border-radius: var(--r-sm);
  color: var(--floor); background: var(--ink); transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* A quiet phosphor grid: decorative, never over text. */
.backdrop { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; background: radial-gradient(ellipse at 80% 0%, #20351b66, transparent 55%), var(--floor); }
.backdrop::before { content: ""; position: absolute; inset: 0; opacity: .35; background: linear-gradient(90deg, #aac69b0b 1px, transparent 1px) 0 0 / 64px 64px, linear-gradient(#aac69b0b 1px, transparent 1px) 0 0 / 64px 64px; }
/* ---------- Controls ---------- */
.btn, .btn-icon {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 2.75rem; border: var(--bw) solid transparent; border-radius: var(--r-md);
  font-size: var(--t-16); font-weight: 600; line-height: 1.2; white-space: nowrap;
  transition: background-color 140ms, border-color 140ms, transform 80ms;
}
.btn { padding: 0 18px; }
.btn-icon { width: 2.75rem; padding: 0; color: var(--ink-2); background: none; border-color: var(--edge); }
.btn-icon:hover { color: var(--ink); background: var(--sea-2); border-color: var(--edge-2); }
.btn:active, .btn-icon:active { transform: translateY(1px); }
.btn-primary {
  color: var(--action-ink); border-color: color-mix(in srgb, var(--action-hi) 70%, transparent);
  background: linear-gradient(var(--action-hi), var(--action));
  box-shadow: inset 0 1px rgb(255 255 255 / 35%), 0 4px 18px rgb(244 179 74 / 14%);
}
.btn-primary:hover:not(:disabled) { background: var(--action-hi); }
.btn-primary:disabled { color: color-mix(in srgb, var(--action-ink) 60%, transparent); background: color-mix(in srgb, var(--action) 45%, var(--sea)); border-color: transparent; box-shadow: none; }
.btn-quiet { color: var(--ink); background: color-mix(in srgb, var(--sea-2) 60%, transparent); border-color: var(--edge); }
.btn-quiet:hover { background: var(--sea-2); border-color: var(--edge-2); }
.btn-lg { min-height: 3.5rem; padding: 0 28px; font-size: var(--t-18); }
.btn-block { width: 100%; }
a.btn { text-decoration: none; }

.badge {
  display: inline-grid; place-items: center; min-width: 1.5rem; height: 1.5rem; padding: 0 6px; border-radius: 999px;
  color: var(--action-ink); background: var(--action); font-size: var(--t-14); font-weight: 700;
}

.input, .select select {
  width: 100%; min-height: 3rem; padding: 0 14px; border: var(--bw) solid var(--edge); border-radius: var(--r-md);
  color: var(--ink); background: var(--field); font-size: var(--t-16);
  transition: border-color 140ms, box-shadow 140ms;
}
.input::placeholder { color: var(--muted); opacity: 0.85; }
.input:hover, .select select:hover { border-color: var(--edge-2); }
.input:focus-visible, .select select:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.input:disabled { opacity: 0.6; }
.input-code { font-variation-settings: "MONO" 1; font-size: var(--t-15); }
textarea.input { min-height: 7rem; padding-block: 12px; line-height: 1.6; resize: vertical; }
.input-flag { min-height: 3.5rem; font-size: var(--t-18); font-variation-settings: "MONO" 1; }

.select { position: relative; display: block; }
.select select { appearance: none; -webkit-appearance: none; padding-right: 2.75rem; cursor: pointer; text-overflow: ellipsis; }
.select::after {
  content: ""; position: absolute; right: 18px; top: 50%; width: 9px; height: 9px; pointer-events: none;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg);
}

.seg {
  display: inline-flex; gap: 4px; padding: 4px; border: var(--bw) solid var(--edge); border-radius: var(--r-md);
  background: var(--field);
}
.seg button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 2.5rem; padding: 0 12px; border: var(--bw) solid transparent;
  border-radius: calc(var(--r-md) - 4px); color: var(--ink-2); background: none; font-size: var(--t-15); font-weight: 600; white-space: nowrap;
  transition: background-color 140ms, color 140ms;
}
.seg button:hover { color: var(--ink); background: color-mix(in srgb, var(--sea-2) 80%, transparent); }
.seg button[aria-pressed="true"] {
  color: var(--ink); background: var(--sea-2); border-color: var(--action);
}
.seg-wrap { flex-wrap: wrap; }
.seg .count { margin-left: 2px; color: var(--muted); font-weight: 500; }
.seg .count:empty { display: none; }

.swatch { display: inline-block; flex: none; width: 1.4rem; height: 0; border-top: 3px solid currentColor; }
.swatch-prompt { border-top-style: dashed; }
.swatch-code { height: 5px; border-top: 2px solid currentColor; border-bottom: 2px solid currentColor; }

.field-label, legend { display: block; margin-bottom: 8px; color: var(--ink-2); font-size: var(--t-16); font-weight: 600; }
.notice {
  margin: 0 0 12px; padding: 12px 18px; border: var(--bw) solid var(--accent); border-radius: var(--r-md);
  color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); font-size: var(--t-16); line-height: 1.5;
}
.feedback { min-height: 1.5em; margin-top: 12px; color: var(--ink-2); font-size: var(--t-17); font-weight: 550; line-height: 1.5; }
.feedback:empty { display: none; }
.feedback.ok { color: var(--capture); }
.feedback.bad { color: var(--damage); }

/* ---------- Shell ---------- */
.shell {
  display: flex; flex-direction: column; height: 100dvh; max-width: 1720px; margin: 0 auto;
  padding: 0 clamp(12px, 2vw, 32px) env(safe-area-inset-bottom);
}
.topbar { display: flex; flex: none; align-items: center; gap: 24px; min-height: 4.5rem; }
.brand { display: flex; align-items: center; gap: 12px; flex: none; }
.brand-mark { width: 3rem; height: 3rem; object-fit: contain; filter: drop-shadow(0 0 10px rgb(79 232 214 / 28%)); }
.brand-name { font: 700 var(--t-24) / 1.05 var(--display); letter-spacing: -0.01em; }
.brand-name strong { color: var(--action); font-weight: inherit; letter-spacing: 0.045em; }
.live {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px; border: var(--bw) solid var(--edge); border-radius: 999px;
  color: var(--capture); font-size: var(--t-15); font-weight: 650; white-space: nowrap; cursor: default;
}
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--capture); box-shadow: 0 0 0 0 color-mix(in srgb, var(--capture) 60%, transparent); animation: beat 2.4s ease-out infinite; }
.live-time { color: var(--muted); font-weight: 450; }
.live-time:empty { display: none; }
.live.is-off { color: var(--accent); }
.live.is-off .live-dot { background: var(--accent); animation: none; box-shadow: none; }
@keyframes beat { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--capture) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 9px transparent; } }
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

main { display: flex; flex: 1; flex-direction: column; min-height: 0; padding-bottom: clamp(12px, 2vw, 24px); }
.board {
  display: flex; flex: 1; flex-direction: column; min-height: 0; overflow: hidden;
  border: var(--bw) solid var(--edge); border-radius: var(--r-lg); background: var(--sea); box-shadow: var(--shadow);
}
.board-head {
  display: flex; flex: none; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px;
  padding: 14px 24px; border-bottom: var(--bw) solid var(--edge);
}
.board-title h2 { font: 650 var(--t-28) / 1.15 var(--display); }
.board-count { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; color: var(--muted); font-size: var(--t-16); }
.board-count strong { color: var(--ink); font-weight: 650; }
.count-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 2.25rem; padding: 0 14px; border: var(--bw) solid color-mix(in srgb, var(--capture) 45%, transparent);
  border-radius: 999px; color: var(--capture); background: color-mix(in srgb, var(--capture) 9%, transparent); font-size: var(--t-15); font-weight: 600;
  transition: background-color 140ms;
}
.count-chip i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.count-chip strong { color: inherit; }
.count-chip:hover, .count-chip[aria-pressed="true"] { background: color-mix(in srgb, var(--capture) 22%, transparent); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.search { position: relative; display: block; width: 12.5rem; }
.search .i { position: absolute; left: 14px; top: 50%; color: var(--muted); transform: translateY(-50%); pointer-events: none; }
.search input {
  width: 100%; min-height: 3rem; padding: 0 14px 0 2.75rem; border: var(--bw) solid var(--edge); border-radius: var(--r-md);
  color: var(--ink); background: var(--field); font-size: var(--t-16);
}
.search input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.toolbar-method { align-items: center; }

/* ---------- Race ---------- */
.race {
  position: relative; flex: 1; min-height: 0; overflow: hidden auto; overscroll-behavior: contain; overflow-anchor: none;
  container-type: inline-size; scrollbar-width: thin; scrollbar-color: var(--edge-2) transparent;
}
.race-axis, .lane {
  --pad: 24px; --inset: 44px;
  display: grid; grid-template-columns: 21rem minmax(14rem, 1fr) 17rem 10.5rem; column-gap: 20px; align-items: center; padding-inline: var(--pad);
}
.race-axis {
  position: sticky; top: 0; z-index: 5; min-height: 3.5rem; padding-block: 6px;
  border-bottom: var(--bw) solid var(--edge); background: color-mix(in srgb, var(--sea) 94%, transparent); backdrop-filter: blur(8px);
  color: var(--muted); font-size: var(--t-14); font-weight: 600;
}
.axis-course { display: grid; gap: 2px; }
.axis-caption { text-align: center; }
.axis-ticks { display: flex; justify-content: space-between; margin-inline: var(--inset); color: var(--ink-2); font-size: var(--t-15); font-weight: 600; }
.axis-ticks span { display: flex; justify-content: center; width: 0; white-space: nowrap; }
.axis-status { padding-left: 0; }

.lane {
  position: relative; min-height: 6.25rem; padding-block: 12px; border-bottom: var(--bw) solid var(--hair);
  --trail: var(--wake-capture); --hp-color: var(--capture);
  cursor: pointer; transition: background-color 140ms;
}
.lane:hover { background: color-mix(in srgb, var(--sea-2) 55%, transparent); }
.lane:has(.lane-open:focus-visible) { outline: 3px solid var(--accent); outline-offset: -3px; }
.lane.dead { --trail: var(--wake-damage); background: color-mix(in srgb, var(--damage) 5%, transparent); }
.lane.dead:hover { background: color-mix(in srgb, var(--damage) 9%, transparent); }
.lane.won, .lane.complete { --trail: var(--action-hi); }
.lane.low-hp { --hp-color: var(--damage); }

.lane-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.rank {
  position: relative; z-index: 0; flex: none; width: 3.5rem; color: var(--ink-2);
  font: 700 1.875rem / 1 var(--font); text-align: center;
}
.podium-1 .rank { color: #ffcb68; }
.podium-2 .rank { color: #d6e8f3; }
.podium-3 .rank { color: #eda96f; }

.who { min-width: 0; }
.who-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.who-name { min-width: 0; font-size: var(--t-20); font-weight: 650; line-height: 1.25; }
.lane-open {
  display: block; cursor: pointer; max-width: 100%; margin: 0; padding: 0; border: 0; color: inherit; background: none;
  font: inherit; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lane-open:focus-visible { outline: none; }
.who-method { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; }
.method-chip { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: var(--t-15); font-weight: 600; }
.method-chip.is-plain .swatch { display: none; }
.human-chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 1px 10px 1px 8px; border: var(--bw) solid var(--edge-2); border-radius: 999px;
  color: var(--ink-2); font-size: var(--t-14); font-weight: 600;
}
.human-chip .i { width: 1rem; height: 1rem; }
.you-chip { flex: none; padding: 1px 10px; border-radius: 999px; color: var(--action-ink); background: var(--action); font-size: var(--t-14); font-weight: 700; }
.lane.is-you { box-shadow: inset 4px 0 0 var(--action); background: color-mix(in srgb, var(--action) 6%, transparent); }
.who-meta { margin-top: 2px; color: var(--muted); font-size: var(--t-14); line-height: 1.4; overflow-wrap: anywhere; }

/* Legacy percentage course; the open hunt shows a count, with no denominator. */
.course { position: relative; height: 3rem; }
.water { position: absolute; inset: 0; background: var(--field); border: 1px solid var(--hair); }
.lane-axis { position: absolute; inset: 0 12px; }
.wake { position: absolute; left: 0; top: 50%; width: var(--progress, 0%); height: 2px; background: var(--trail); transition: width 500ms var(--ease); }
.course-cursor { position: absolute; left: var(--progress, 0%); top: 50%; color: var(--trail); transform: translate(-50%, -50%); transition: left 500ms var(--ease); }
.course-note { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; padding: 12px; color: var(--muted); font-size: var(--t-15); }
.not-started .course-note { display: flex; }
.not-started .wake, .not-started .course-cursor { display: none; }
.lane-stats { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "score clock" "hp hp"; align-items: baseline; gap: 6px 12px; }
.score { grid-area: score; display: flex; align-items: baseline; gap: 6px; font-size: var(--t-36); font-weight: 700; line-height: 1.05; }
.score b { font-weight: inherit; }
.score small { color: var(--muted); font-size: var(--t-18); font-weight: 450; }
.lane.dead .score b { color: var(--damage); }
.lane.won .score b, .lane.complete .score b { color: var(--action); }
.clock { grid-area: clock; display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: var(--t-18); font-weight: 550; font-variation-settings: "MONO" 1; white-space: nowrap; }
.clock .i { width: 1.1rem; height: 1.1rem; color: var(--muted); }
.hp { grid-area: hp; display: flex; align-items: center; gap: 12px; }
.hp-label { min-width: 4.4rem; color: var(--muted); font-size: var(--t-16); font-weight: 500; white-space: nowrap; }
.hp-label strong { color: var(--ink); font-weight: 700; }
.low-hp .hp-label strong { color: var(--damage); }
.hp-bar { flex: 1; height: 12px; overflow: hidden; border-radius: 999px; background: color-mix(in srgb, var(--ink) 12%, transparent); }
.hp-bar > span { display: block; width: var(--hp, 0%); height: 100%; border-radius: inherit; background: var(--hp-color); box-shadow: 0 0 10px color-mix(in srgb, var(--hp-color) 55%, transparent); transition: width 500ms var(--ease); }
.hp-bar[hidden], .lane-life-pips[hidden] { display: none; }
.lane-life-pips { display: flex; flex: none; align-items: center; gap: .25rem; }
.lane-life-pips .life-pip { width: .85rem; height: .85rem; }
.lane-life-pips .life-pip .i { width: .65rem; height: .65rem; }
.not-started .hp, .not-started .clock { opacity: 0.45; }

.lane-status { display: flex; align-items: center; gap: 8px; }
.lane-chevron { margin-left: auto; }
.status {
  display: inline-flex; align-items: center; gap: 8px; min-height: 2.25rem; padding: 0 14px 0 10px; border: var(--bw) solid var(--tone-line);
  border-radius: 999px; color: var(--tone); background: var(--tone-bg); font-size: var(--t-15); font-weight: 650; white-space: nowrap;
  --tone: var(--capture); --tone-line: color-mix(in srgb, var(--tone) 42%, transparent); --tone-bg: color-mix(in srgb, var(--tone) 12%, transparent);
}
.status .i { width: 1.1rem; height: 1.1rem; }
.status.tone-dead { --tone: var(--damage); }
.status.tone-won { --tone: var(--action); --tone-bg: color-mix(in srgb, var(--action) 16%, transparent); }
.status.tone-warn { --tone: var(--accent); }
.status.tone-safety { --tone: var(--safety); }
.status.tone-downgrade { --tone: var(--downgrade); }
.status.tone-quiet { --tone: var(--muted); --tone-line: var(--edge); --tone-bg: transparent; }
.status.tone-live .i { animation: beat-icon 2.4s ease-in-out infinite; }
@keyframes beat-icon { 50% { opacity: 0.45; } }
.lane-chevron { color: var(--muted); transition: transform 140ms var(--ease), color 140ms; }
.lane:hover .lane-chevron { color: var(--ink); transform: translateX(3px); }

.race-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; color: var(--muted); font-size: var(--t-16); border-bottom: var(--bw) solid var(--hair); }
.empty { display: grid; justify-items: center; gap: 8px; padding: 64px 24px; text-align: center; }
.empty-mark { width: 4.5rem; height: 4.5rem; object-fit: contain; opacity: 0.85; }
.empty-title { font: 600 var(--t-24) / 1.25 var(--display); }
.empty-hint { max-width: 34rem; color: var(--muted); font-size: var(--t-17); }
.empty .btn { margin-top: 10px; }

/* Narrower boards: the course drops under the identity row; the scale header follows it. */
@container (max-width: 1120px) {
  .race-axis { grid-template-columns: 1fr; }
  .race-axis > :not(.axis-course) { display: none; }
  .lane { grid-template-columns: minmax(0, 1fr) 17rem 10.5rem; grid-template-areas: "id stats status" "course course course"; row-gap: 14px; }
  .lane-id { grid-area: id; }
  .lane-stats { grid-area: stats; }
  .lane-status { grid-area: status; }
  .course { grid-area: course; }
}
@container (max-width: 700px) {
  .race-axis { display: none; }
  .race-axis, .lane { --pad: 16px; --inset: 36px; }
  .lane { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "id status" "course course" "stats stats"; row-gap: 12px; padding-block: 16px; }
  .rank { width: 2.75rem; font-size: 1.5rem; }
  .who-name { font-size: var(--t-18); }
  .course { height: 4.25rem; }
  .lane-stats { grid-template-columns: auto auto 1fr; grid-template-areas: "score clock hp"; align-items: center; gap: 16px; }
  .score { font-size: var(--t-28); }
  .hp-label { min-width: 0; }
  .lane-chevron { display: none; }
}
@container (max-width: 480px) {
  .lane-stats { grid-template-columns: auto 1fr; grid-template-areas: "score clock" "hp hp"; gap: 8px 16px; }
  .clock { justify-self: end; }
}

/* ---------- Modals ---------- */
.modal {
  --modal-w: 40rem;
  width: min(var(--modal-w), calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px); margin: auto; padding: 0;
  overflow: hidden; color: var(--ink); background: var(--sea); border: var(--bw) solid var(--edge-2); border-radius: var(--r-lg); box-shadow: var(--shadow);
}
.modal[open] { display: flex; flex-direction: column; animation: modal-in 200ms var(--ease); }
.modal::backdrop { background: var(--scrim); backdrop-filter: blur(6px); animation: fade-in 200ms ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(0.985); } }
@keyframes fade-in { from { opacity: 0; } }
.modal-narrow { --modal-w: 36rem; }
.modal-wide { --modal-w: 64rem; }
.modal-desk { --modal-w: 78rem; height: min(52rem, calc(100dvh - 24px)); }
.modal-head { display: flex; flex: none; align-items: center; gap: 14px; padding: 16px 16px 14px 28px; border-bottom: var(--bw) solid var(--edge); }
.modal-title { flex: 1; min-width: 0; font: 650 var(--t-28) / 1.2 var(--display); overflow-wrap: anywhere; }
.modal-sub { color: var(--muted); font-size: var(--t-14); overflow-wrap: anywhere; text-align: right; }
.modal-body { flex: 1; min-height: 0; padding: 24px 28px 28px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--edge-2) transparent; }
.modal-stack { display: grid; gap: 24px; align-content: start; }
.modal-foot { display: flex; flex: none; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; padding: 16px 28px; border-top: var(--bw) solid var(--edge); background: color-mix(in srgb, var(--field) 55%, var(--sea)); }
.modal-foot .btn-primary { min-width: 10rem; }
.flag-row .btn-lg { min-width: 10.5rem; }
.group { display: grid; gap: 0; }
.group-hint { margin-top: 10px; color: var(--muted); font-size: var(--t-15); line-height: 1.5; }
.group-hint:empty { display: none; }
.group .select-field select { min-height: 3.25rem; }

/* Desk */
.tabs { display: flex; flex: none; gap: 4px; padding: 0 20px; overflow-x: auto; border-bottom: var(--bw) solid var(--edge); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; min-height: 3.25rem; margin-bottom: -1px; padding: 0 16px; border: 0;
  border-bottom: 3px solid transparent; color: var(--muted); background: none; font-size: var(--t-16); font-weight: 600; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--action); }
.tab .i { width: 1.15rem; height: 1.15rem; }
.modal-body:has(> .panel-challenges:not([hidden])) { display: flex; padding: 0; overflow: hidden; }
.panel-challenges { display: grid; flex: 1; grid-template-columns: 22rem minmax(0, 1fr); min-width: 0; min-height: 0; }
.picker { padding: 24px 12px 24px 28px; overflow-y: auto; scrollbar-width: none; }
.picker-title { margin-bottom: 12px; color: var(--ink-2); font-size: var(--t-16); font-weight: 600; }
.dataset-download { display: grid; gap: 4px; margin-bottom: 16px; color: var(--muted); font-size: var(--t-14); line-height: 1.5; overflow-wrap: anywhere; }
.dataset-download a { color: var(--capture); text-decoration: underline; text-underline-offset: 3px; }
.dataset-download .btn { justify-content: flex-start; text-decoration: none; }
.picker-grid { display: grid; grid-template-columns: repeat(4, 3.25rem); gap: 8px; }
.tile {
  position: relative; display: grid; place-items: center; align-content: center; gap: 4px; width: 3.25rem; height: 3.25rem; padding: 0;
  border: var(--bw) solid var(--edge); border-radius: var(--r-sm); color: var(--ink-2); background: var(--field); font-size: var(--t-17); font-weight: 650;
  transition: background-color 140ms, border-color 140ms;
}
.tile:hover { border-color: var(--edge-2); background: var(--sea-2); }
.tile[aria-current="true"] { color: var(--ink); border-color: var(--action); background: var(--sea-2); box-shadow: 0 0 0 1px var(--action); }
.tile-dots { display: flex; gap: 3px; }
.tile-dots i { width: 6px; height: 6px; border-radius: 50%; background: color-mix(in srgb, var(--ink) 22%, transparent); }
.tile-dots i.is-done { background: var(--capture); }
.tile.is-complete { border-color: color-mix(in srgb, var(--capture) 60%, transparent); }
.challenge { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.challenge-scroll { display: flex; flex: 1; flex-direction: column; gap: 18px; min-height: 0; padding: 24px 28px 20px 32px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--edge-2) transparent; }
.answer {
  display: grid; flex: none; gap: 14px; max-height: 62%; padding: 16px 28px 22px 32px; overflow-y: auto;
  border-top: var(--bw) solid var(--edge); background: color-mix(in srgb, var(--field) 70%, var(--sea));
}
.callout {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding: 12px 16px 12px 20px;
  border: var(--bw) solid color-mix(in srgb, var(--action) 45%, transparent); border-radius: var(--r-md); background: color-mix(in srgb, var(--action) 8%, var(--sea));
}
.callout[data-state="live"] { border-color: color-mix(in srgb, var(--capture) 50%, transparent); background: color-mix(in srgb, var(--capture) 8%, var(--sea)); }
.callout[data-state="over"] { border-color: var(--edge-2); background: color-mix(in srgb, var(--sea-2) 60%, transparent); }
.callout-text { flex: 1 1 16rem; font-size: var(--t-16); font-weight: 500; line-height: 1.5; }
.callout-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.standing { display: flex; flex: 1 1 16rem; flex-wrap: wrap; gap: 8px 28px; }
.standing div { display: grid; }
.standing dt { color: var(--muted); font-size: var(--t-14); }
.standing dd { font-size: var(--t-20); font-weight: 700; }
.standing dd.warn { color: var(--damage); }
.challenge-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.challenge-title { font: 650 var(--t-28) / 1.2 var(--display); }
.challenge-progress { color: var(--muted); font-size: var(--t-16); }
.question { max-width: 76ch; color: var(--ink-2); font-size: var(--t-18); line-height: 1.7; white-space: pre-line; }
.flag-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.flag-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 2.75rem; padding: 0 16px; border: var(--bw) solid var(--edge); border-radius: var(--r-md);
  color: var(--ink-2); background: var(--field); font-size: var(--t-16); font-weight: 600;
}
.flag-chip:hover { border-color: var(--edge-2); background: var(--sea-2); }
.flag-chip[aria-pressed="true"] { color: var(--ink); border-color: var(--action); background: var(--sea-2); box-shadow: 0 0 0 1px var(--action); }
.flag-chip .i { width: 1.1rem; height: 1.1rem; color: var(--capture); }
.format-label { margin-bottom: 6px; color: var(--muted); font-size: var(--t-15); }
.format-code {
  display: block; padding: 10px 14px; border: var(--bw) solid var(--edge); border-radius: var(--r-md); background: var(--field);
  font-size: var(--t-16); font-weight: 500; font-variation-settings: "MONO" 1; line-height: 1.6; overflow-wrap: anywhere;
}
.format-code .slot { color: var(--capture); }
.flag-row { display: flex; gap: 12px; }
.flag-row .input { flex: 1; min-width: 0; }
.flag-form .field-label { margin-bottom: 6px; }
.answer.flash-ok { animation: flash-ok 900ms ease-out; }
.answer.flash-bad { animation: flash-bad 900ms ease-out; }
@keyframes flash-ok { 0% { box-shadow: inset 0 0 0 3px var(--capture), inset 0 0 44px color-mix(in srgb, var(--capture) 32%, transparent); } 100% { box-shadow: inset 0 0 0 3px transparent, inset 0 0 0 transparent; } }
@keyframes flash-bad { 0% { box-shadow: inset 0 0 0 3px var(--damage), inset 0 0 44px color-mix(in srgb, var(--damage) 28%, transparent); } 100% { box-shadow: inset 0 0 0 3px transparent, inset 0 0 0 transparent; } }
.flag-form .feedback { margin-top: 10px; }

.panel-title { margin-bottom: 14px; font: 650 var(--t-24) / 1.25 var(--display); }
.prose { max-width: 72ch; color: var(--ink-2); font-size: var(--t-18); line-height: 1.75; }
.prose p { margin-bottom: 1em; }
.prose ul { margin: 0 0 1em; padding-left: 1.3em; list-style: disc; }
.prose li { margin: 0.5em 0; padding-left: 0.2em; }
.prose li::marker { color: var(--action); }
.prose-note { max-width: 70ch; margin-bottom: 12px; color: var(--muted); font-size: var(--t-16); line-height: 1.6; }
.prose-note:empty { display: none; }
.link-card {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; max-width: 44rem; margin-bottom: 28px; padding: 18px 22px;
  border: var(--bw) solid var(--edge); border-radius: var(--r-md); background: var(--field); transition: border-color 140ms, background-color 140ms;
}
.link-card:hover { border-color: var(--capture); background: var(--sea-2); }
.link-card-text { display: grid; gap: 2px; }
.link-card strong { font-size: var(--t-18); }
.link-card-text span { color: var(--muted); font-size: var(--t-16); }
.console { display: grid; grid-template-columns: minmax(0, 27rem) minmax(0, 1fr); gap: 20px 40px; align-items: start; }
.query-form { display: grid; gap: 10px; }
.query-form .field-label { margin: 6px 0 0; }
.query-result {
  min-height: 12rem; max-height: 26rem; margin: 0; padding: 14px 16px; overflow: auto; border: var(--bw) solid var(--edge); border-radius: var(--r-md);
  color: var(--ink-2); background: var(--field); font: 450 var(--t-15) / 1.6 var(--font); font-variation-settings: "MONO" 1; white-space: pre-wrap; overflow-wrap: anywhere;
}
.panel-session { display: grid; grid-template-columns: minmax(0, 30rem) minmax(0, 28rem); gap: 20px 48px; align-items: start; }
.session-card { min-width: 0; }
.session-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.account { margin-top: 24px; padding-top: 22px; border-top: var(--bw) solid var(--edge); }
.token-row, .operator-form, .token-form { display: flex; gap: 10px; }
.token-row .input, .operator-form .input, .token-form .input { flex: 1; min-width: 0; }
.fold { min-width: 0; padding: 4px 18px; border: var(--bw) solid var(--edge); border-radius: var(--r-md); background: var(--field); }
.fold summary { display: flex; align-items: center; gap: 10px; min-height: 3rem; color: var(--ink); font-size: var(--t-16); font-weight: 600; cursor: pointer; list-style: none; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform 140ms; }
.fold[open] summary::before { transform: rotate(45deg); }
.fold[open] { padding-bottom: 16px; }
.fold .prose-note { margin-top: 4px; }
.fold .feedback { margin-top: 10px; }

/* Filters, join, appearance */
.join-intro { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.join-intro img { width: 5.5rem; height: 5.75rem; flex: none; object-fit: contain; }
.join-intro p { color: var(--ink-2); font-size: var(--t-17); line-height: 1.6; }
.register-form { display: grid; gap: 20px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 16px; }
.field { min-width: 0; }
.other-field { margin-top: 10px; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice { position: relative; display: block; }
.choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.choice-body {
  position: relative; display: grid; align-content: start; gap: 4px; height: 100%; padding: 14px 16px; border: var(--bw) solid var(--edge); border-radius: var(--r-md);
  background: var(--field); cursor: pointer; transition: border-color 140ms, background-color 140ms;
}
.choice-body::after { content: ""; position: absolute; top: 14px; right: 14px; width: 18px; height: 18px; border: 2px solid var(--edge-2); border-radius: 50%; }
.choice-body strong { display: flex; align-items: center; gap: 10px; padding-right: 26px; font-size: var(--t-16); }
.choice-body > span { color: var(--muted); font-size: var(--t-15); line-height: 1.45; }
.choice:hover .choice-body { border-color: var(--edge-2); }
.choice input:checked + .choice-body { border-color: var(--action); background: var(--sea-2); box-shadow: 0 0 0 1px var(--action); }
.choice input:checked + .choice-body::after { border-color: var(--action); background: radial-gradient(circle, var(--action) 0 42%, transparent 46%); }
.choice input:focus-visible + .choice-body { outline: 3px solid var(--accent); outline-offset: 3px; }
.token-login { margin-top: 20px; }

/* Attempt details */
.detail-head { align-items: flex-start; }
.detail-name { flex: 1; min-width: 0; }
.detail-variant { margin-top: 4px; color: var(--muted); font-size: var(--t-16); }
.detail-head .status { margin-top: 4px; }
.detail-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.detail-stats > div { padding: 14px 16px; border: var(--bw) solid var(--edge); border-radius: var(--r-md); background: var(--field); }
.detail-stats dt { color: var(--muted); font-size: var(--t-14); white-space: nowrap; }
.detail-stats dd { margin-top: 4px; font-size: var(--t-28); font-weight: 700; line-height: 1.15; white-space: nowrap; }
.detail-stats dd small { display: block; margin-top: 2px; color: var(--muted); font-size: var(--t-14); font-weight: 450; }
.detail-stats dd small:empty { display: none; }
.detail-pulse { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; padding: 12px 16px; border: var(--bw) solid var(--edge); border-radius: var(--r-md); font-size: var(--t-16); }
.detail-pulse i { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--muted); }
.detail-pulse.fresh i { background: var(--capture); animation: beat 2.4s ease-out infinite; }
.detail-pulse.slow i { background: var(--accent); }
.detail-pulse.quiet { color: var(--damage); }
.detail-pulse.quiet i { background: var(--damage); }
.detail-note { margin-bottom: 20px; color: var(--muted); font-size: var(--t-16); line-height: 1.6; }
.detail-failure {
  margin-bottom: 20px; padding: 12px 16px; border: var(--bw) solid color-mix(in srgb, var(--damage) 45%, transparent);
  border-radius: var(--r-md); color: var(--ink-2); background: color-mix(in srgb, var(--damage) 9%, transparent);
  font-size: var(--t-16); line-height: 1.55; overflow-wrap: anywhere;
}
.detail-block { position: relative; margin-bottom: 20px; padding: 18px 20px; border: var(--bw) solid var(--edge); border-radius: var(--r-md); background: color-mix(in srgb, var(--field) 65%, transparent); }
.detail-block h3 { font-size: var(--t-18); font-weight: 650; }
.detail-block h3 small { color: var(--muted); font-size: var(--t-16); font-weight: 450; }
.detail-block-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; margin-bottom: 12px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--ink-2); font-size: var(--t-15); }
.chart-legend span { display: inline-flex; align-items: center; gap: 8px; }
.chart-legend i { width: 18px; height: 3px; border-radius: 2px; }
.key-flags { background: var(--health-color, var(--capture)); }
.chart-legend .key-success, .chart-legend .key-wrong { display: inline-grid; place-items: center; width: 14px; height: 14px; font-style: normal; font-size: 11px; font-weight: 700; line-height: 1; color: var(--sea); }
.chart-legend .key-success { border-radius: 50%; background: var(--capture); }
.chart-legend .key-wrong { background: var(--damage); }
.chart-health { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 14px; color: var(--ink-2); font-size: var(--t-15); }
.chart-health[hidden] { display: none; }
.chart-health .health-segments { display: flex; flex-wrap: wrap; gap: 4px; }
.chart-health .health-segment { width: 18px; height: 8px; background: var(--health-color, var(--capture)); border: 1px solid var(--health-color, var(--capture)); }
.chart-health .health-segment.lost { background: color-mix(in srgb, var(--health-color, var(--capture)) 8%, transparent); border-color: color-mix(in srgb, var(--health-color, var(--capture)) 35%, transparent); }
.chart-health progress { width: 140px; height: 8px; accent-color: var(--capture); }
.detail-chart { min-height: 17rem; }
.detail-chart svg { display: block; overflow: visible; }
.detail-chart .grid line { stroke: var(--hair); stroke-width: 1; }
.detail-chart .axis { fill: var(--muted); font-size: 14px; font-family: var(--font); }
.detail-chart .line-flags { fill: none; stroke-width: 2.5; stroke-linejoin: round; }
.detail-chart .line-flags { stroke: var(--capture); }
.detail-chart .submission-marker { pointer-events: none; }
.detail-chart .submission-marker circle, .detail-chart .submission-marker rect { stroke: var(--sea); stroke-width: 2; }
.detail-chart .submission-marker.success circle { fill: var(--capture); }
.detail-chart .submission-marker.failure rect { fill: var(--damage); }
.detail-chart .submission-marker path { fill: none; stroke: var(--sea); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.detail-chart .end-label { fill: var(--ink); font-size: 15px; font-weight: 650; font-family: var(--font); }
body.open-hunt .detail-chart .end-label { paint-order: stroke; stroke: var(--field); stroke-width: 5px; stroke-linejoin: round; }
.detail-chart .crosshair { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.detail-chart .hit { fill: transparent; cursor: crosshair; }
.debrief-content { display: grid; gap: 14px; color: var(--ink-2); font-size: var(--t-16); line-height: 1.65; overflow-wrap: anywhere; }
.debrief-content > h4 { color: var(--ink); font: 650 var(--t-20) / 1.3 var(--display); }
.debrief-topic { display: grid; gap: 7px; }
.debrief-topic > h4 { color: var(--ink); font-size: var(--t-16); font-weight: 650; }
.debrief-content p { margin: 0; white-space: pre-wrap; }
.debrief-list { display: grid; gap: 7px; margin: 0; padding-left: 1.25rem; }
.debrief-list li::marker { color: var(--capture); }
.debrief-dl { display: grid; gap: 9px; margin: 0; }
.debrief-row { display: grid; grid-template-columns: minmax(8rem, .3fr) minmax(0, 1fr); gap: 12px; }
.debrief-row dt { color: var(--muted); font-weight: 600; }
.debrief-row dd { min-width: 0; margin: 0; }
.chart-tip { position: absolute; top: 0; z-index: 3; padding: 8px 12px; border: var(--bw) solid var(--edge-2); border-radius: var(--r-sm); color: var(--ink); background: var(--sea); font-size: var(--t-15); white-space: nowrap; box-shadow: 0 8px 24px rgb(0 0 0 / 35%); pointer-events: none; }
.detail-columns { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 20px; }
.detail-columns .detail-block { margin-bottom: 0; }
.calls-title { margin-top: 22px; }
.tool-bars, .submission-log, .call-log { margin-top: 12px; }
.tool-bars li { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr) 3.5rem; align-items: center; gap: 12px; min-height: 2.25rem; color: var(--ink-2); font-size: var(--t-15); }
.tool-bar { height: 10px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 8%, transparent); overflow: hidden; }
.tool-bar i { display: block; height: 100%; min-width: 3px; border-radius: 999px; background: var(--capture); }
.tool-bars b { color: var(--ink); font-weight: 600; text-align: right; }
.submission-log, .call-log { max-height: 20rem; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--edge-2) transparent; }
.submission-log li, .call-log li { display: grid; align-items: center; gap: 4px 12px; min-height: 2.5rem; padding: 6px 0; border-bottom: var(--bw) solid var(--hair); font-size: var(--t-15); }
.submission-log li { grid-template-columns: 4.5rem minmax(0, 1fr) auto 4rem; }
.call-log li { grid-template-columns: 4.5rem minmax(0, 1fr) 3rem minmax(0, auto); }
.submission-log time, .call-log time { color: var(--muted); }
.submission-log span, .call-log span { overflow: hidden; color: var(--ink-2); text-overflow: ellipsis; white-space: nowrap; }
.submission-log b, .call-log b { font-weight: 650; }
.good { color: var(--capture); }
.bad { color: var(--damage); }
.quiet { color: var(--muted); font-weight: 450; }
.submission-log small, .call-log small { color: var(--muted); font-size: var(--t-14); text-align: right; }
.call-log small { color: var(--accent); }
.empty-line { display: block !important; color: var(--muted); border: 0 !important; font-size: var(--t-16); }
.call-query {
  grid-column: 1 / -1; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; padding: 8px 10px; border-radius: 8px;
  color: var(--ink-2); background: var(--field); font-size: var(--t-14); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; cursor: pointer; font-variation-settings: "MONO" 1;
}
.call-query.open { display: block; -webkit-line-clamp: unset; }
.detail-meta { color: var(--muted); font-size: var(--t-14); line-height: 1.6; overflow-wrap: anywhere; }
.attempt-id { overflow-wrap: anywhere; }

/* ---------- Responsive ---------- */
@media (max-width: 1320px) {
  .toolbar-method { display: none; }
}
@media (max-width: 1040px) {
  .detail-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .console, .panel-session { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 980px) {
  .live-time { display: none; }
  .modal-body:has(> .panel-challenges:not([hidden])) { display: block; overflow-y: auto; }
  .panel-challenges { display: block; }
  .picker { position: sticky; top: 0; z-index: 2; min-width: 0; padding: 14px 20px 6px; overflow: visible; background: var(--sea); border-bottom: var(--bw) solid var(--hair); }
  .picker-title { display: none; }
  .picker-grid { display: flex; padding-bottom: 8px; overflow-x: auto; scrollbar-width: thin; }
  .tile { flex: none; width: 3.5rem; }
  .challenge-scroll { padding: 14px 20px 16px; overflow: visible; }
  .answer { max-height: none; padding: 14px 20px 18px; overflow: visible; }
  .flag-picker { flex-wrap: nowrap; margin-inline: -20px; padding-inline: 20px; overflow-x: auto; scrollbar-width: none; }
  .flag-chip { flex: none; }
  .detail-columns { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .topbar-actions .btn { width: 2.75rem; padding: 0; }
  .topbar-actions .btn-text { display: none; }
  .topbar-actions { gap: 8px; }
  .topbar-actions .dataset-button { width: auto; padding-inline: 12px; }
  .topbar-actions .dataset-button .btn-text { display: inline; }
}
@media (max-width: 720px) {
  .topbar { gap: 12px; min-height: 4rem; }
  .brand-name { font-size: var(--t-20); }
  .board-head { padding: 14px 16px; }
  .board-title h2 { font-size: var(--t-24); }
  .toolbar { width: 100%; }
  .search { flex: 1 1 10rem; width: auto; }
  .modal-head { padding-left: 20px; }
  .modal-sub { display: none; }
  .tabs { flex-wrap: wrap; padding-inline: 12px; overflow: visible; }
  .tab { min-height: 3rem; padding-inline: 12px; }
  .modal-body { padding: 20px; }
  .modal-foot { padding: 14px 20px; }
  .modal-foot .btn { flex: 1 1 auto; }
  .field-grid, .choice-grid { grid-template-columns: 1fr; }
  .detail-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-stats > div { padding: 12px; }
  .detail-stats dt { white-space: normal; line-height: 1.3; }
  .detail-stats dd { font-size: var(--t-24); white-space: normal; overflow-wrap: anywhere; }
  .debrief-row { grid-template-columns: 1fr; gap: 3px; }
  .flag-row { flex-direction: column; }
  .flag-row .btn { width: 100%; }
  .tool-bars li { grid-template-columns: 7rem minmax(0, 1fr) 3rem; }
}
@media (max-width: 520px) {
  .brand-name { display: none; }
  .live-word { display: none; }
  .live { padding-inline: 12px; }
  .join-intro { flex-direction: column; align-items: flex-start; }
  .call-log li { grid-template-columns: 4rem minmax(0, 1fr) 2.5rem; }
  .call-log li small { display: none; }
  .submission-log li { grid-template-columns: 4rem minmax(0, 1fr) auto; }
  .submission-log li small { display: none; }
}
@media (max-height: 560px) {
  .topbar { min-height: 3.5rem; }
  .modal-desk { height: calc(100dvh - 12px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Page-styled dropdown lists where the browser supports them; others keep the native list. */
.game-brief { display: flex; align-items: center; gap: 1rem; margin: 1rem 0 1.5rem; padding: 1rem 1.25rem; border: 1px solid var(--edge-2); border-radius: var(--r-md); background: var(--sea); }
.game-brief > .i { width: 2.25rem; height: 2.25rem; flex: none; color: var(--capture); }
.game-brief div { display: grid; gap: .3rem; }
.game-brief strong { font-size: 1.1rem; }
.game-brief div > span { font-size: .8rem; color: var(--ink-2); line-height: 1.5; }
.best-score { display: flex !important; grid-template-columns: none; align-items: baseline; gap: .55rem; margin-left: auto; white-space: nowrap; }
.best-score span { color: var(--ink-2); font-size: .9rem; }
.best-score strong { color: var(--capture); font-size: 1.35rem; font-variation-settings: "MONO" 1; }
.open-hunt-guide { display: grid; gap: .55rem; }
.open-hunt-guide[hidden] { display: none; }
.guide-title { margin-top: 1rem; color: var(--ink); font: 650 var(--t-18) / 1.3 var(--display); }
.guide-mission { color: var(--ink-2); font-size: var(--t-15); line-height: 1.6; white-space: pre-line; }
.guide-list { display: grid; gap: .7rem; margin: 0; padding-left: 1.15rem; color: var(--ink-2); font-size: var(--t-14); line-height: 1.5; overflow-wrap: anywhere; }
.guide-list li::marker { color: var(--capture); }
.guide-list code { color: var(--capture); font-size: .9em; overflow-wrap: anywhere; }
.guide-links { color: var(--capture); font-size: var(--t-14); line-height: 1.7; }
.guide-links a { text-decoration: underline; text-underline-offset: 3px; }
.guide-coverage-label { margin-top: .35rem; color: var(--muted); font-size: var(--t-14); }
.tip-exchange { display: grid; gap: .65rem; margin-top: 1rem; padding: 1rem; border: 1px solid var(--edge-2); border-radius: var(--r-md); background: var(--sea); }
.tip-exchange[hidden] { display: none; }
.tip-exchange .guide-title { margin: 0; }
.tip-exchange-note { color: var(--ink-2); font-size: var(--t-14); line-height: 1.5; }
.unlocked-tips:empty { display: none; }
body.open-hunt .axis-ticks { display: none; }
body.open-hunt .lane .water,
body.open-hunt .lane .lane-axis { display: none; }
body.open-hunt .lane .course-note { display: flex; position: static; inset: auto; padding: 0; color: var(--capture); font-size: var(--t-17); font-weight: 650; }
body.open-hunt .lane .course { display: grid; align-items: center; height: auto; min-height: 2.5rem; }
body.open-hunt .race-axis .axis-caption { text-align: left; }
.life-pip { display: grid; place-items: center; flex: none; width: 1.125rem; height: 1.125rem; border-radius: 50%; background: var(--capture); }
.life-pip.lost { color: var(--sea); background: var(--damage); }
.life-pip .i { width: .875rem; height: .875rem; stroke-width: 2.2; }
#check-format { justify-self: start; margin-top: .65rem; }
@media (max-width: 700px) { .seven-lives-intro { flex-wrap: wrap; } }
@media (max-width: 980px) {
  body.open-hunt .picker { position: relative; max-height: none; padding-top: 14px; overflow: visible; }
  body.open-hunt .picker-title { display: block; }
}
@media (max-width: 700px) {
  .best-score { flex: 1 1 100%; margin-left: 3.25rem; white-space: normal; }
  body.open-hunt .race-axis, body.open-hunt .lane { grid-template-columns: minmax(8rem, 1fr) minmax(6rem, .75fr) auto; }
  body.open-hunt .race-axis .axis-stats { display: none; }
  body.open-hunt .lane-stats { grid-column: 2; grid-row: 1; }
  body.open-hunt .lane-status { grid-column: 3; grid-row: 1; }
  .lane .course { display: none; }
}
@supports (appearance: base-select) {
  .select select, .select select::picker(select) { appearance: base-select; }
  .select select { display: flex; align-items: center; padding-right: 2.75rem; white-space: nowrap; overflow: hidden; }
  .select select::picker-icon { display: none; }
  .select select::picker(select) {
    max-height: min(22rem, 60vh); margin-top: 6px; padding: 6px; overflow-y: auto; border: var(--bw) solid var(--edge-2); border-radius: var(--r-md);
    color: var(--ink); background: var(--sea); box-shadow: var(--shadow); scrollbar-width: thin; scrollbar-color: var(--edge-2) transparent;
  }
  .select select option { display: flex; align-items: center; gap: 10px; min-height: 2.75rem; padding: 0 12px; border-radius: 8px; color: var(--ink-2); font-size: var(--t-16); cursor: pointer; }
  .select select option::checkmark { order: 1; margin-left: auto; color: var(--capture); font-size: var(--t-16); }
  .select select option:hover, .select select option:focus-visible { outline: none; color: var(--ink); background: var(--sea-2); }
  .select select option:checked { color: var(--ink); font-weight: 650; }
}

/* ---------- Manchester terminal ---------- */
html { height: auto; overflow: auto; }
body { min-height: 100dvh; height: auto; overflow: visible; }
::selection { color: var(--floor); background: var(--capture); }
.shell { height: auto; min-height: 100dvh; max-width: 1560px; padding-inline: clamp(16px, 3.3vw, 52px); }
main { flex: 1; padding-bottom: 0; }
.topbar { min-height: 92px; gap: 24px; border-bottom: 1px solid var(--hair); }
.brand { gap: 14px; }
.brand-mark { width: auto; height: auto; color: var(--capture); font-size: 31px; font-weight: 650; letter-spacing: -3px; filter: none; }
.brand-name { display: grid; gap: 6px; font: 650 18px/1 var(--font); letter-spacing: .065em; }
.brand-sub { color: var(--muted); font-size: 10px; letter-spacing: .14em; font-weight: 450; }
.live { border: 0; padding: 0; border-radius: 0; gap: 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .025em; }
.live-dot { width: 6px; height: 6px; border-radius: 0; }
.live-time { font-size: 11px; }
.btn, .btn-icon, .input, .seg, .search input, .select select, .status, .count-chip, .fold { border-radius: 2px; }
.btn { gap: 9px; padding-inline: 16px; font-size: 13px; font-weight: 550; letter-spacing: .015em; }
.btn-icon { width: 40px; min-height: 40px; }
.btn-primary { background: var(--action); border-color: var(--action); box-shadow: none; }
.btn-primary:hover:not(:disabled) { background: var(--action-hi); border-color: var(--action-hi); box-shadow: 0 0 20px #c6fa7320; }
.btn-quiet { background: transparent; }
.btn-quiet:hover { background: var(--sea-2); }
.btn:active { transform: translateY(1px); }
.btn-lg { min-height: 48px; font-size: 14px; }
.hero { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: clamp(32px, 6vw, 100px); padding: 43px 0 38px; }
.eyebrow { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; line-height: 1.5; letter-spacing: .13em; font-weight: 550; }
.signal-square { width: 6px; height: 6px; background: var(--capture); box-shadow: 0 0 10px #c6fa7344; }
.hero h1 { margin-top: 15px; font: 750 clamp(42px, 4.8vw, 74px)/.97 var(--font); letter-spacing: -.068em; }
.hero h1 .glitch-green { color: var(--capture); }
.terminal-cursor { display: inline-block; color: var(--capture); animation: cursor 1.25s steps(1) infinite; }
@keyframes cursor { 50% { opacity: 0; } }
.hero-deck { margin-top: 22px; color: var(--ink-2); font-size: 13px; line-height: 1.75; letter-spacing: -.015em; }
.hero-actions { display: flex; align-items: center; gap: 26px; margin-top: 22px; }
.hero-actions .btn { min-height: 43px; min-width: 155px; justify-content: space-between; }
.hero-actions .btn span { font-size: 18px; }
.hero-link { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; border: 0; padding: 0; background: none; color: var(--ink-2); font-size: 12px; }
.hero-link span { color: var(--capture); transition: transform 160ms ease; }
.hero-link:hover { color: var(--capture); }
.hero-link:hover span { transform: translateX(4px); }
.field-terminal { position: relative; background: #0c100d; border: 1px solid var(--edge); box-shadow: 10px 10px 0 -1px var(--floor), 10px 10px 0 var(--edge); border-radius: 3px; animation: terminal-arrive .6s var(--ease) both; }
.field-terminal::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .15; background: repeating-linear-gradient(transparent 0 3px, #000 3px 4px); }
.terminal-chrome { display: flex; align-items: center; justify-content: space-between; height: 36px; padding: 0 15px; border-bottom: 1px solid var(--edge); color: var(--muted); font-size: 10px; }
.terminal-chrome > span:first-child { display: flex; gap: 6px; }
.terminal-chrome i { width: 6px; height: 6px; border: 1px solid var(--edge-2); }
.terminal-chrome i:first-child { border-color: var(--capture); background: var(--capture); }
.terminal-content { padding: 21px 24px 19px; }
.terminal-command { font-size: 14px; color: var(--ink); }
.terminal-command > span:first-child { color: var(--capture); margin-right: 10px; }
.small-cursor { margin-left: 9px; color: var(--capture); animation: cursor 1.25s steps(1) infinite; }
.evidence-map { margin-top: 9px; }
.evidence-map svg { display: block; width: 100%; height: auto; }
.map-grid { stroke: #c6fa7309; stroke-width: 1; }
.map-muted { stroke: #33462c; stroke-width: 1; }
.map-trace { stroke: var(--capture); stroke-width: 1.5; stroke-dasharray: 700; animation: draw-thread 1.8s ease-out both; }
@keyframes draw-thread { from { stroke-dashoffset: 700; } to { stroke-dashoffset: 0; } }
.map-node { fill: #10170d; stroke: var(--capture); stroke-width: 1.5; }
.map-dust { fill: #617251; }
.map-packet { fill: #ecffd1; filter: drop-shadow(0 0 4px #c6fa73); }
.terminal-sequence { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 9px; letter-spacing: .015em; }
.terminal-note { display: flex; gap: 13px; margin-top: 22px; padding-top: 16px; border-top: 1px dashed var(--edge); color: var(--muted); font-size: 12px; line-height: 1.7; }
.terminal-note > span { color: var(--capture); }
.terminal-note strong { color: var(--ink); font-weight: 450; }
.terminal-bottom { display: flex; justify-content: space-between; gap: 8px; padding: 9px 15px; border-top: 1px solid var(--edge); color: var(--muted); font-size: 9px; letter-spacing: .06em; }
.terminal-bottom b { color: var(--capture); font-weight: 400; margin-left: 8px; }
@keyframes terminal-arrive { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.hero-copy { animation: terminal-arrive .5s var(--ease) both; }
.game-brief { display: flex; align-items: center; gap: 20px; margin: 0 0 30px; padding: 18px 20px; border: 1px solid var(--edge); background: #121a0f; border-radius: 2px; }
.game-brief .brief-index { display: block; color: var(--capture); font-size: 11px; letter-spacing: .04em; }
.game-brief .brief-copy { flex: 1; display: grid; gap: 5px; }
.game-brief .brief-copy strong { font-size: 13px; font-weight: 600; color: var(--ink); }
.game-brief .brief-copy > span { font-size: 11px; color: var(--muted); line-height: 1.65; }
.best-score { flex: none; display: grid !important; gap: 3px; margin-left: auto; padding-left: 22px; border-left: 1px solid var(--edge); text-align: right; }
.best-score span { font-size: 10px; color: var(--muted); letter-spacing: .025em; }
.best-score strong { font-size: 30px; line-height: 1; font-weight: 550; color: var(--capture); }
.board { flex: none; overflow: visible; min-height: 320px; border-color: var(--edge); border-radius: 3px; box-shadow: none; background: #101410; }
.board-head { padding: 23px 24px 20px; gap: 18px; }
.board-eyebrow { margin-bottom: 7px; color: var(--capture); font-size: 9px; }
.board-title h2 { font: 600 23px/1.2 var(--font); letter-spacing: -.045em; }
.board-count { font-size: 11px; margin-top: 7px; }
.count-chip { min-height: 24px; padding-inline: 8px; font-size: 10px; border: 0; background: #c6fa7310; }
.count-chip i { width: 5px; height: 5px; border-radius: 0; }
.search { width: 175px; }
.search input { min-height: 38px; font-size: 11px; padding-left: 34px; }
.search .i { width: 14px; height: 14px; left: 12px; }
.seg { padding: 3px; gap: 2px; }
.seg button { min-height: 30px; padding-inline: 9px; font-size: 10px; gap: 6px; font-weight: 500; }
.seg button[aria-pressed="true"] { color: var(--capture); border-color: var(--edge-2); background: #c6fa730d; }
.seg .swatch { width: 12px; }
.toolbar > .btn { min-height: 38px; font-size: 11px; padding-inline: 12px; }
.race { overflow: visible; container-type: inline-size; }
.race-axis, .lane { --pad: 24px; grid-template-columns: minmax(260px, 1.2fr) minmax(180px, .8fr) minmax(250px, 1fr) 114px; column-gap: 22px; }
body.open-hunt .race-axis, body.open-hunt .lane { grid-template-columns: minmax(260px, 1.2fr) minmax(250px, 1fr) 114px; grid-template-areas: "id stats status"; }
body.open-hunt .race-axis .axis-course { display: none; }
.race-axis { position: relative; min-height: 36px; font-size: 9px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; background: #151b13; border-block: 1px solid var(--edge); }
.race-axis .axis-caption { text-align: left; }
.lane { min-height: 108px; padding-block: 18px; border-bottom-color: var(--hair); }
.lane:last-child { border-bottom: 0; }
.lane.dead { background: transparent; }
.lane.dead:hover, .lane:hover { background: #c6fa7304; }
.lane:hover { box-shadow: inset 2px 0 var(--capture); }
.rank { width: 24px; font: 450 13px/1 var(--font); color: var(--muted); text-align: left; }
.podium-1 .rank, .podium-2 .rank, .podium-3 .rank { color: var(--muted); }

.rank::after { content: "/"; margin-left: 5px; color: var(--edge-2); }
.lane-id { gap: 19px; }
.who-name { font-size: 16px; font-weight: 550; }
.who-method { margin-top: 6px; gap: 8px; }
.method-chip { font-size: 10px; font-weight: 500; color: var(--muted); gap: 7px; }
.method-chip .swatch { width: 15px; border-top-width: 1px; }
.method-chip .swatch-code { border-bottom-width: 1px; height: 3px; }
.who-meta { font-size: 9px; margin-top: 5px; line-height: 1.6; color: var(--muted); }
.human-chip, .you-chip { font-size: 9px; border-radius: 2px; }
body.open-hunt .lane .course { display: none; }
body.open-hunt .lane .course-note { font-size: 11px; font-weight: 450; color: var(--muted); text-align: left; }
.course-note::before { content: "↳"; margin-right: 10px; color: var(--capture); }
.lane-stats { gap: 10px 16px; grid-template-columns: auto 1fr; }
.score { font-size: 28px; font-weight: 500; color: var(--capture); }
.lane.dead .score b { color: var(--ink); }
.score small { font-size: 13px; }
.clock { justify-self: end; font-size: 12px; font-weight: 450; color: var(--muted); }
.clock .i { width: 13px; height: 13px; }
.hp { gap: 10px; }
.hp-label { min-width: 73px; font-size: 10px; letter-spacing: .01em; }
.hp-label strong { font-weight: 450; }
.lane-life-pips { gap: 4px; flex: 1; min-width: 0; }
.lane-life-pips .life-pip { width: auto; flex: 1; max-width: 15px; min-width: 7px; height: 6px; border-radius: 0; background: var(--health-color, var(--capture)); border: 1px solid var(--health-color, var(--capture)); }
.lane-life-pips .life-pip.lost { background: color-mix(in srgb, var(--health-color, var(--capture)) 8%, transparent); border-color: color-mix(in srgb, var(--health-color, var(--capture)) 35%, transparent); }
.hp-bar { height: 5px; border-radius: 0; }
.status { min-height: 26px; padding-inline: 7px; gap: 5px; font-size: 10px; font-weight: 450; letter-spacing: .015em; background: none; border-color: var(--tone-line); }
.status .i { width: 12px; height: 12px; }
.lane-chevron { width: 13px; height: 13px; }
.race-foot { padding: 16px 24px; font-size: 12px; }
.empty-mark { width: auto; height: auto; font-size: 32px; color: var(--capture); }
.empty-title { font-size: 20px; }
.empty-hint { font-size: 13px; }
.system-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; padding: 21px 0 24px; color: var(--muted); font-size: 9px; letter-spacing: .05em; }
.system-footer > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.footer-signal { width: 4px; height: 4px; background: var(--capture); }
/* Windows retain every working API hook and independent scroll region. */
.modal { border-radius: 3px; border-color: var(--edge-2); background: #101510; }
.modal::backdrop { background: #030703dc; backdrop-filter: blur(5px); }
.modal-head { padding: 20px 20px 18px 26px; background: #161e13; }
.modal-title { font-size: 22px; font-weight: 550; letter-spacing: -.04em; }
.modal-title::before { content: "> "; color: var(--capture); }
.modal-sub { font-size: 10px; }
.modal-foot { background: #0b100a; }
.modal-body { padding: 25px 26px; }
.tabs { gap: 0; background: #10170d; padding-inline: 16px; }
.tab { min-height: 48px; font-size: 12px; font-weight: 500; padding-inline: 15px; border-bottom-width: 2px; }
.tab[aria-selected="true"] { color: var(--capture); }
.panel-title, .challenge-title { font-size: 21px; font-weight: 550; letter-spacing: -.025em; }
.picker { padding: 24px 20px 24px 26px; border-right: 1px solid var(--edge); scrollbar-width: thin; }
.picker-title { font-size: 13px; color: var(--capture); }
.guide-title { font: 550 13px/1.4 var(--font); margin-top: 16px; color: var(--ink); }
.guide-mission, .guide-list { font-size: 12px; line-height: 1.8; }
.guide-list { padding-left: 0; }
.guide-list li { padding: 8px 0; border-bottom: 1px dashed var(--hair); }
.guide-list strong { color: var(--ink); font-weight: 500; }
.guide-list code { display: block; margin-top: 5px; font-size: 11px; }
.coverage-list { font-size: 10px; }
.guide-links, .guide-coverage-label { font-size: 11px; }
.tip-exchange { padding: 13px; background: #c6fa7307; border-color: var(--edge); }
.tip-exchange-note { font-size: 11px; }
.tip-exchange .btn { white-space: normal; line-height: 1.4; }
.dataset-download { font-size: 10px; gap: 7px; padding-bottom: 16px; border-bottom: 1px dashed var(--edge); }
.dataset-download .btn { font-size: 12px; }
.challenge-scroll { padding: 24px 26px; gap: 20px; }
.callout { border-color: var(--edge); border-radius: 2px; background: #c6fa7305; padding: 17px; }
.callout-text { font-size: 12px; line-height: 1.8; }
.question { font-size: 13px; line-height: 1.8; }
.answer { padding: 22px 26px 24px; background: #0c110a; gap: 17px; }
.format-label { font-size: 11px; text-transform: uppercase; letter-spacing: .035em; }
.format-code { font-size: 13px; border-radius: 2px; padding: 13px; line-height: 1.8; }
.field-label, legend { font-size: 12px; font-weight: 550; }
.input, .select select { min-height: 44px; font-size: 13px; }
.input-flag { min-height: 48px; font-size: 13px; }
.prose { font-size: 14px; line-height: 1.95; }
.prose-note { font-size: 12px; line-height: 1.8; }
.feedback { font-size: 13px; font-weight: 450; line-height: 1.8; }
.standing dt { font-size: 10px; }
.standing dd { font-size: 18px; }
.link-card strong { font-size: 14px; }
.link-card-text span { font-size: 12px; }
.query-result { font-size: 12px; line-height: 1.9; color: var(--capture); }
.join-intro { align-items: flex-start; gap: 14px; padding-bottom: 20px; border-bottom: 1px dashed var(--edge); }
.join-prompt { color: var(--capture); font-size: 25px; }
.join-intro p { font-size: 12px; line-height: 1.8; }
.choice-body { border-radius: 2px; }
.choice-body strong, .fold summary { font-size: 12px; }
.choice-body > span { font-size: 11px; line-height: 1.6; }
.choice-body::after { width: 12px; height: 12px; border-width: 1px; border-radius: 0; }
.choice-body strong { padding-right: 16px; }
.detail-stats { gap: 9px; }
.detail-stats > div { padding: 16px 12px; border-radius: 2px; background: #0d130b; }
.detail-stats dt { font-size: 10px; line-height: 1.7; white-space: normal; }
.detail-stats dd { font-size: 26px; line-height: 1.35; white-space: normal; overflow-wrap: anywhere; }
#detail-flags { font-size: 21px; }
.detail-stats dd small { font-size: 10px; }
.detail-variant, .detail-pulse, .detail-note, .detail-failure { font-size: 12px; }
.detail-block { border-radius: 2px; background: #0c120a; }
.detail-block h3 { font-size: 13px; font-weight: 500; }
.detail-block h3 small { font-size: 11px; }
.chart-legend { font-size: 10px; gap: 12px; }
.detail-chart .axis { font-size: 10px; }
.detail-chart .end-label { font-size: 11px; }
.detail-chart .line-flags { filter: drop-shadow(0 0 3px #c6fa7320); }
.tool-bars li, .submission-log li, .call-log li { font-size: 11px; }
.tool-bar, .tool-bar i { border-radius: 0; height: 4px; }
.submission-log small, .call-log small, .detail-meta { font-size: 10px; }
.submission-log li { grid-template-columns: 3.5rem minmax(0, 1fr) auto 4rem; }
.call-log li { grid-template-columns: 3.5rem minmax(0, 1fr) 2.5rem minmax(0, auto); }
.call-query { font-size: 11px; }
#detail-calls li { grid-template-columns: 21ch minmax(0, 1fr) 2.5rem minmax(0, auto); }
#detail-calls time { font-variant-numeric: tabular-nums; white-space: nowrap; }
#detail-calls .call-date, #detail-calls .call-clock { display: block; overflow: visible; color: var(--muted); }
#detail-calls .call-date { font-size: 9px; opacity: .8; }
@media (max-width: 700px) { #detail-calls li { grid-template-columns: 21ch minmax(0, 1fr) 2.5rem; gap: 4px 8px; } }
@media (max-width: 370px) { #detail-calls time { grid-column: 1 / -1; } #detail-calls li { grid-template-columns: minmax(0, 1fr) auto; } }
.debrief-content { font-size: 13px; }
@container (max-width: 1120px) {
  .race-axis, .lane { grid-template-columns: minmax(180px, 1fr) minmax(220px, .75fr) 108px; grid-template-areas: "id stats status"; }
  .race-axis > :not(.axis-course) { display: block; }
  .race-axis .axis-course { display: none; }
  .race-axis .axis-id { grid-column: 1; }
  .race-axis .axis-stats { grid-column: 2; }
  .race-axis .axis-status { grid-column: 3; }
  .lane .course { display: none; }
  .lane { row-gap: 0; }
}
@media (max-width: 1180px) { .toolbar-method { display: none; } .live-time { display: none; } }
@media (max-width: 980px) {
  .hero { gap: 40px; }
  .hero h1 { font-size: 56px; }
  .brand-sub { font-size: 9px; }
  .live { margin-left: auto; }
  .topbar-actions { margin-left: 0; gap: 7px; }
  .topbar-actions .btn { width: auto; padding-inline: 11px; }
  .topbar-actions #desk-open .btn-text { display: none; }
  .topbar-actions #join-open .btn-text, .topbar-actions .dataset-button .btn-text { display: inline; }
  .topbar-actions .btn .i { width: 15px; height: 15px; }
  .modal-body:has(> .panel-challenges:not([hidden])) { overflow: auto; display: block; }
  body.open-hunt .picker { position: static; border-right: 0; padding: 22px; }
  .challenge-scroll, .answer { padding: 22px; overflow: visible; max-height: none; }
  .console, .panel-session { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .topbar { min-height: 76px; gap: 14px; }
  .brand-mark { font-size: 27px; }
  .brand-name { font-size: 14px; }
  .brand-sub { font-size: 8px; letter-spacing: .05em; }
  .live { display: none; }
  .topbar-actions { margin-left: auto; }
  .topbar-actions #join-open { display: none; }
  .hero { grid-template-columns: 1fr 1fr; gap: 24px; padding: 32px 0; }
  .hero h1 { font-size: clamp(34px, 6.6vw, 50px); }
  .hero-deck { font-size: 11px; }
  .hero-actions { gap: 15px; }
  .hero-actions .btn { min-width: 135px; }
  .hero-link { font-size: 11px; }
  .terminal-content { padding: 16px; }
  .terminal-sequence { font-size: 7px; }
  .game-brief { gap: 14px; padding: 16px; margin-bottom: 22px; }
  .brief-index { display: none !important; }
  .best-score { margin-left: auto; padding-left: 14px; }
  .best-score span { max-width: 85px; white-space: normal; line-height: 1.5; font-size: 9px; }
  .board-head { padding: 20px 16px; }
  .board-title h2 { font-size: 20px; }
  .toolbar { width: auto; }
  .search { width: 145px; }
  .system-footer { font-size: 8px; }
  .system-footer > span:last-child { display: none; }
  .modal-head, .modal-body { padding: 18px; }
  .modal-title { font-size: 19px; }
  .tabs { flex-wrap: wrap; padding-inline: 8px; }
  .tab { min-height: 43px; padding-inline: 10px; font-size: 11px; }
  .modal-foot { padding: 16px 18px; }
  .detail-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail-columns { grid-template-columns: 1fr; }
}
@container (max-width: 700px) {
  .race-axis { display: none; }
  body.open-hunt .lane, .lane { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "id status" "stats stats"; row-gap: 18px; --pad: 16px; padding-block: 20px; }
  body.open-hunt .lane-stats, .lane-stats { grid-area: stats; grid-column: 1 / -1; grid-row: 2; grid-template-columns: auto auto minmax(0, 1fr); grid-template-areas: "score clock hp"; gap: 18px; align-items: center; }
  body.open-hunt .lane-status { grid-area: status; grid-column: 2; grid-row: 1; }
  .score { font-size: 25px; }
  .clock { font-size: 11px; justify-self: start; }
  .hp { justify-content: flex-end; gap: 8px; }
  .hp-label { min-width: 0; font-size: 9px; }
  .lane-life-pips { flex: none; gap: 3px; }
  .lane-life-pips .life-pip { width: 8px; min-width: 0; height: 5px; }
  .rank { width: 23px; font-size: 11px; }
  .lane-id { gap: 13px; }
  .who-name { font-size: 15px; }
  .who-meta { font-size: 9px; }
}
@media (max-width: 540px) {
  .shell { padding-inline: 16px; }
  .topbar { min-height: 72px; gap: 8px; }
  .brand { gap: 8px; }
  .brand-mark { font-size: 23px; }
  .brand-name { font-size: 13px; }
  .topbar-actions .btn { min-height: 36px; padding-inline: 9px; font-size: 10px; }
  .topbar-actions #desk-open { display: none; }
  .hero { grid-template-columns: 1fr; gap: 30px; padding: 31px 0 32px; }
  .eyebrow { font-size: 9px; }
  .hero h1 { font-size: clamp(46px, 13vw, 67px); margin-top: 16px; }
  .hero-deck { font-size: 12px; margin-top: 19px; }
  .hero-actions { margin-top: 20px; gap: 22px; }
  .hero-actions .btn { min-width: 155px; }
  .field-terminal { box-shadow: 5px 5px 0 -1px var(--floor), 5px 5px 0 var(--edge); }
  .terminal-chrome { height: 30px; font-size: 9px; }
  .terminal-content { padding: 17px 18px 15px; }
  .terminal-command { font-size: 12px; }
  .evidence-map { margin: 6px 0 4px; }
  .terminal-sequence { font-size: 8px; }
  .terminal-note { margin-top: 15px; padding-top: 12px; font-size: 11px; }
  .terminal-note p br { display: none; }
  .terminal-note p strong::before { content: " "; }
  .terminal-bottom { font-size: 8px; }
  .game-brief { align-items: center; gap: 12px; }
  .game-brief .brief-copy strong { font-size: 12px; line-height: 1.6; }
  .game-brief .brief-copy span { font-size: 10px; }
  .best-score { flex: 0 0 76px; padding-left: 12px; }
  .best-score strong { font-size: 26px; }
  .board-head { align-items: stretch; gap: 15px; }
  .toolbar { width: 100%; }
  .search { flex: 1; width: auto; }
  .board { min-height: 250px; }
  .system-footer { line-height: 1.6; }
  .detail-head .status { margin-top: 0; }
  .detail-stats > div { padding: 12px 9px; }
  .detail-stats dd { font-size: 20px; }
  #detail-flags { font-size: 16px; }
  .detail-block { padding: 14px 12px; }
  .detail-foot .btn { white-space: normal; }
  .modal-foot .btn-primary { min-width: 7rem; }
  .flag-row { flex-direction: column; gap: 10px; }
  .field-grid, .choice-grid { grid-template-columns: 1fr; }
  .token-row, .token-form, .operator-form { flex-wrap: wrap; }
  .detail-variant { font-size: 11px; }
  .detail-stats dt { font-size: 9px; }
  .detail-meta { font-size: 9px; }
  .tool-bars li { grid-template-columns: 7rem minmax(0, 1fr) 2.5rem; }
  .chart-legend { font-size: 9px; gap: 8px; }
}
@media (max-width: 370px) {
  .brand-sub { display: none; }
  .hero h1 { font-size: 43px; }
  .best-score { flex-basis: 63px; }
  .hp { gap: 6px; }
  .lane-life-pips { gap: 2px; }
  .lane-life-pips .life-pip { width: 6px; }
  .clock .i { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .map-packet { display: none; }
}

/* A row appears only when received; numbers pulse only when their value changes. */
.lane { animation: terminal-arrive 350ms var(--ease) backwards; animation-delay: calc(var(--entry-order, 0) * 45ms); }
.score b { display: inline-block; }

/* One shared scanner clock controls the beam, text and graphic echoes. */
.glitch-text { position: relative; display: inline-block; }
.scan-layer { position: fixed; inset: 0; z-index: 30; pointer-events: none; overflow: hidden; contain: layout paint; }
.scan-beam {
  position: absolute; inset: 0 0 auto; height: 1px; opacity: .08;
  background: linear-gradient(90deg, transparent, #c6fa73 15%, #e7ffe6 50%, #c6fa73 85%, transparent);
  will-change: transform;
}
.scan-beam::before, .scan-beam::after { content: none; }
.scan-echo { position: absolute !important; margin: 0 !important; overflow: hidden !important; pointer-events: none !important; box-sizing: border-box !important; color: #75f4ff !important; text-shadow: -2px 0 #ff6bad !important; background: transparent !important; border-color: transparent !important; box-shadow: none !important; animation: none !important; transition: none !important; opacity: .82; }
.scan-window { position: absolute; inset: 0 0 auto; height: 18px; overflow: hidden; will-change: transform; }
.scan-content { position: absolute; inset: 0 0 auto; will-change: transform; }
.scan-text *, .scan-text::before, .scan-text::after { color: #75f4ff !important; text-shadow: -2px 0 #ff6bad !important; background: transparent !important; border-color: transparent !important; box-shadow: none !important; animation: none !important; transition: none !important; }
.scan-text svg, .scan-text img, .scan-text canvas, .scan-text video { visibility: hidden !important; }
.scan-text *::before, .scan-text *::after { content: none !important; }
.scan-graphic { filter: brightness(1.5) saturate(1.6) hue-rotate(75deg) drop-shadow(-2px 0 #ff6bad); }
.scan-graphic *, .scan-shell::before, .scan-shell::after { animation: none !important; transition: none !important; pointer-events: none !important; }
.scan-graphic svg { color: #75f4ff !important; }
.scan-shell::before, .scan-shell::after { content: none !important; }
.scan-echo::before, .scan-echo::after { content: none !important; }
@media (prefers-reduced-motion: reduce) { .scan-layer { display: none; } }

.agent-guide-link { color: var(--capture); text-underline-offset: 3px; }
.agent-guide-link:hover { text-decoration: underline; }



/* Data changes have their own cues; the scan never rewrites a value. */
.clock-unit { display: inline-block; min-width: 2ch; text-align: center; transform-origin: center; }
.clock-colon { display: inline-block; opacity: .65; }
.clock-zone { opacity: .75; }
#live-time { display: inline-block; white-space: normal; line-height: 1.5; }
#live-time .clock-zone { display: block; font-size: 9px; overflow-wrap: anywhere; }
#live-state { white-space: normal; min-width: 0; }
@media (max-width: 700px) {
  .topbar { flex-wrap: wrap; padding-block: 12px; }
  #live-state { display: inline-flex; order: 3; flex-basis: 100%; flex-wrap: wrap; gap: 4px 8px; margin-left: 0; }
  #live-time { flex: 1; min-width: 0; font-size: 10px; }
}
@media (max-width: 370px) { .topbar-actions .dataset-button .btn-text { display: none; } }
.best-score strong { display: inline-block; transform-origin: right center; }
.lane.is-best { box-shadow: inset 2px 0 var(--capture); background: #c6fa7305; }
.best-chip { flex: none; border: 1px solid #c6fa7340; padding: 2px 5px; color: var(--capture); font-size: 8px; letter-spacing: .08em; line-height: 1.4; }
.lane.is-best .rank { color: var(--capture); }
@container (max-width: 700px) { .lane-stats { gap: 12px; } .clock { font-size: 10px; } }
@media (max-width: 370px) { .lane-stats { gap: 9px; } .clock { font-size: 9px; } .best-chip { font-size: 7px; } }
#detail-time { white-space: nowrap; font-size: clamp(13px, 1.5vw, 24px); }

/* Comparison cinema: observed events on a shared elapsed-time axis. */
.replay-modal { --modal-w: 88rem; background: #0a100c; }
.replay-head { justify-content: space-between; background: linear-gradient(110deg,#202c16,#101810 65%); padding: 24px 28px; }
.replay-head h2 { font: 570 clamp(23px,3vw,38px)/1.15 var(--display); letter-spacing: -.065em; }
.replay-eyebrow { color: var(--action); font-size: 11px; letter-spacing: .19em; margin-bottom: 9px; }
.replay-body { padding: 24px; }
.replay-intro { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; }
.replay-kicker { font-size: 10px; letter-spacing: .16em; color: #9aa990; display: block; }
.replay-intro p { font-size: 12px; color: #a4b39e; margin-top: 5px; }
.replay-finished-only { font-size: 10px; letter-spacing: .08em; color: var(--action); border: 1px solid #495e35; padding: 6px 10px; white-space: nowrap; }
.replay-filters { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)) auto; gap: 10px; margin-bottom: 22px; align-items: end; }
.replay-filters label { font-size: 11px; color: #a4b39e; display: grid; gap: 5px; }
.replay-filters select { width: 100%; min-width: 0; padding: 9px 7px; font: 400 12px var(--font); color: var(--ink); background: #111a10; border: 1px solid #3c4c34; border-radius: 2px; }
.replay-filters .btn { font-size: 12px; min-height: 36px; }
.replay-stage { position: relative; padding: 24px 20px 14px; border: 1px solid #42543b; background: radial-gradient(ellipse at 60% 0%,#27371750,transparent 70%),#090f0b; isolation: isolate; overflow: hidden; }
.replay-stage::before { content: ''; position: absolute; inset: 0; z-index: -1; background: repeating-linear-gradient(0deg,transparent 0 3px,#b2e89903 3px 4px); pointer-events: none; }
.replay-stage::after { content: ''; position: absolute; height: 1px; left: 0; right: 0; top: 0; background: linear-gradient(90deg,transparent,var(--action),transparent); box-shadow: 0 0 20px #c6fa7355; opacity: 0; pointer-events: none; }
.replay-stage[data-state="playing"]::after { opacity: .35; animation: replay-scan 5s linear forwards; }
@keyframes replay-scan { from { top: 0; } to { top: 100%; } }
.replay-stage-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.replay-clock strong { display: block; font-size: clamp(34px,4vw,54px); font-weight: 450; line-height: 1.15; letter-spacing: -.06em; color: #e4f3d6; text-shadow: 0 0 35px #c6fa7330; }
.replay-speed { text-align: right; }
.replay-speed strong { color: var(--action); font-size: 24px; font-weight: 450; }
.replay-speed span { display: block; color: #91a585; font-size: 10px; letter-spacing: .13em; margin-top: 5px; }
.replay-stage[data-state="finished"] .replay-speed span { color: var(--action); }
.replay-notice { color: #c9dba9; padding: 12px; border: 1px dashed #4e623c; font-size: 13px; margin-bottom: 16px; }
.replay-axis { display: flex; justify-content: space-between; padding-left: 4%; padding-right: 6%; margin-left: 230px; margin-right: 100px; color: #84947d; font-size: 11px; border-bottom: 1px solid #435739; padding-bottom: 8px; }
.replay-tracks { position: relative; min-height: 0; margin-bottom: 8px; transition: height .25s ease; }
.replay-lane { position: absolute; top: 0; left: 0; right: 0; height: 94px; display: grid; grid-template-columns: 230px minmax(0,1fr) 100px; align-items: center; border-bottom: 1px solid #31432a70; transition: transform 450ms cubic-bezier(.22,.8,.2,1); }
.replay-identity { display: flex; align-items: center; gap: 12px; padding-right: 14px; min-width: 0; }
.replay-rank { font-size: 20px; font-weight: 350; color: #56664e; flex: none; }
.replay-name { min-width: 0; }
.replay-name strong { display: block; color: var(--racer); font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.replay-name small { display: block; color: #8a9a80; font-size: 10px; margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.replay-track { position: relative; height: 72px; background: repeating-linear-gradient(90deg,transparent 0 calc(25% - 1px),#35493050 calc(25% - 1px) 25%); }
.replay-track::before { content: ''; position: absolute; left: 4%; right: 6%; top: 37px; height: 1px; background: #415737; }
.replay-trail { position: absolute; top: 34px; height: 7px; background: linear-gradient(90deg,transparent,var(--racer)); box-shadow: 0 0 15px color-mix(in srgb,var(--racer) 35%,transparent); transition: left 180ms ease-out,width 180ms ease-out; }
.replay-runner { position: absolute; top: 16px; width: 42px; height: 42px; margin-left: -21px; transition: left 180ms cubic-bezier(.16,.8,.25,1); z-index: 3; }
.replay-token { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--racer); border-radius: 50%; background: #0c170e; color: var(--racer); box-shadow: 0 0 22px color-mix(in srgb,var(--racer) 22%,transparent),inset 0 0 12px color-mix(in srgb,var(--racer) 10%,transparent); transition: color .2s,border-color .2s,background .2s; }
.replay-token::before { content: ''; position: absolute; inset: -5px; border: 1px dashed color-mix(in srgb,var(--racer) 45%,transparent); border-radius: 50%; }
.replay-stage[data-state="playing"] .replay-token::before { animation: replay-orbit 3s linear infinite; }
@keyframes replay-orbit { to { transform: rotate(360deg); } }
.replay-token .i { width: 22px; height: 22px; }
.replay-runner-state { position: absolute; left: 50%; top: 51px; transform: translateX(-50%); color: #83967a; font-size: 9px; white-space: nowrap; text-transform: uppercase; letter-spacing: .07em; }
.replay-fx { position: absolute; inset: 0; pointer-events: none; }
.replay-particle { position: absolute; width: 4px; height: 7px; left: 19px; top: 19px; border-radius: 1px; box-shadow: 0 0 8px currentColor; }
.replay-shockwave { position: absolute; inset: -4px; border: 2px solid var(--burst-color); border-radius: 50%; }
.replay-marker { position: absolute; top: 13px; margin-left: -5px; color: var(--racer); opacity: .5; }
.replay-marker .i { width: 12px; height: 12px; }
.replay-marker.death { top: 21px; color: var(--damage); opacity: .8; }
.replay-marker.death .i { width: 25px; height: 25px; }
.replay-counters { text-align: right; padding-left: 12px; }
.replay-counters strong { display: block; font-size: 29px; color: var(--racer); font-weight: 430; line-height: 1; }
.replay-counters small { display: block; margin-top: 8px; font-size: 10px; color: #90a383; }
.replay-lane.is-leading .replay-rank { color: var(--action); }
.replay-lane.is-leading.is-finished { background: linear-gradient(90deg,#c6fa7312,transparent); }
.replay-lane.is-dead .replay-token { color: var(--damage); border-color: var(--damage); background: #28100e; box-shadow: 0 0 22px #ff807830; }
.replay-lane.is-dead .replay-token::before { border-color: #ff807855; animation: none; }
.replay-lane.is-dead .replay-trail { opacity: .3; }
.replay-lane.is-dead .replay-runner-state,.replay-lane.is-dead .replay-counters small { color: var(--damage); }
.replay-lane.is-unavailable { opacity: .5; }
.replay-lane.is-unavailable .replay-runner { visibility: hidden; }
.replay-events { min-height: 43px; display: flex; align-items: center; gap: 8px; overflow: hidden; padding-top: 10px; flex-wrap: wrap; }
.replay-event { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #526839; color: #c6fa73; padding: 5px 8px; font-size: 10px; background: #182113; animation: replay-chip .28s ease-out; max-width: 100%; }
.replay-event b { font-weight: 450; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 140px; }
.replay-event .i { height: 14px; width: 14px; }
.replay-event time { color: #99ad8b; }
.replay-event.death { color: #ff8078; border-color: #7a3d37; background: #231311; }
@keyframes replay-chip { from { transform: translateY(8px); opacity: 0; } }
.replay-legend { display: flex; align-items: center; gap: 18px; margin-top: 14px; padding-top: 12px; border-top: 1px solid #34492c; color: #94a58a; font-size: 10px; }
.replay-legend span { display: flex; gap: 7px; align-items: center; }
.replay-legend span:last-child { margin-left: auto; }
.replay-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--action); box-shadow: 0 0 9px #c6fa7370; }
.replay-dot.damage { background: var(--damage); box-shadow: 0 0 9px #ff807870; }
.replay-controls { display: flex; align-items: center; gap: 18px; margin-top: 18px; }
.replay-controls .btn { min-width: 108px; font-size: 12px; }
.replay-scrub { flex: 1; min-width: 0; }
.replay-scrub input { display: block; width: 100%; accent-color: var(--action); cursor: pointer; }
.replay-scrub > span { display: flex; justify-content: space-between; font-size: 10px; color: #97a58c; margin-top: 5px; }
.replay-summary { font-size: 12px; color: #a5b992; margin-top: 12px; min-height: 20px; }
.replay-statistics { margin-top: 26px; border-top: 1px solid #3a4c30; padding-top: 25px; }
.replay-stats-head { display: flex; justify-content: space-between; gap: 15px; align-items: end; margin-bottom: 16px; }
.replay-stats-head h3 { font-size: 23px; font-weight: 460; letter-spacing: -.04em; margin-top: 6px; }
.replay-stats-head > span { font-size: 11px; color: #8c9c81; }
.replay-table-scroll { overflow-x: auto; border: 1px solid #35472d; scrollbar-width: thin; scrollbar-color: #526e3c #0b100a; }
.replay-table { border-collapse: collapse; width: 100%; font-size: 12px; white-space: nowrap; }
.replay-table th { padding: 0; text-align: right; font-weight: 450; background: #152010; border-bottom: 1px solid #3c5031; }
.replay-table th button { width: 100%; border: 0; padding: 14px 12px; color: #afc39d; background: none; font: inherit; cursor: pointer; text-align: inherit; }
.replay-table th[aria-sort]:not([aria-sort="none"]) button { color: var(--action); }
.replay-table td { padding: 14px 12px; text-align: right; border-bottom: 1px solid #2b392650; position: relative; }
.replay-table th:first-child,.replay-table td:first-child { position: sticky; left: 0; z-index: 2; text-align: left; min-width: 200px; background: #10190e; border-right: 1px solid #34472b; }
.replay-table td:first-child strong { display: block; color: var(--racer); font-weight: 500; }
.replay-table td:first-child small { color: #839578; font-size: 10px; }
.replay-table td.is-best { color: var(--action); }
.replay-table tbody tr:hover td { background-color: #1a2614; }
.replay-cell-bar { display: block; position: absolute; bottom: 0; height: 2px; left: 12px; max-width: calc(100% - 24px); background: currentColor; opacity: .35; }
.replay-data-note { color: #8b9a7e; font-size: 11px; line-height: 1.7; margin-top: 12px; }
.replay-tool-details { margin-top: 16px; border: 1px solid #34462b; padding: 14px; font-size: 12px; }
.replay-tool-details summary { cursor: pointer; color: #c1d1b3; }
#replay-tool-mix { margin-top: 15px; display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 16px; }
.replay-tool-card { background: #131d0f; padding: 14px; }
.replay-tool-card h4 { margin: 0 0 12px; color: var(--racer); font-size: 12px; font-weight: 450; }
.replay-tool-row { display: grid; grid-template-columns: 1fr 70px 35px; gap: 10px; align-items: center; color: #a8b69c; font-size: 11px; padding: 4px 0; }
.replay-tool-row i { height: 4px; display: block; background: var(--racer); }
.replay-tool-row b { font-weight: 450; text-align: right; }
@media (max-width: 760px) {
  .replay-filters { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .replay-body { padding: 16px; }
  .replay-stage { padding: 18px 12px 12px; }
  .replay-lane { grid-template-columns: 150px minmax(0,1fr) 72px; }
  .replay-axis { margin-left: 150px; margin-right: 72px; }
  .replay-name strong { font-size: 11px; }
  .replay-rank { font-size: 16px; }
  .replay-identity { gap: 7px; padding-right: 8px; }
  .replay-counters strong { font-size: 24px; }
  .replay-finished-only { display: none; }
  .replay-stats-head { display: block; }
  .replay-stats-head > span { display: block; margin-top: 8px; }
}
@media (max-width: 480px) {
  .replay-head { padding: 20px 16px; }
  .replay-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .replay-lane { grid-template-columns: minmax(0,1fr) 66px; grid-template-rows: 30px 64px; }
  .replay-identity { grid-column: 1 / -1; align-self: end; }
  .replay-name { display: flex; align-items: baseline; gap: 8px; }
  .replay-name strong { max-width: 145px; }
  .replay-name small { font-size: 9px; }
  .replay-rank { font-size: 13px; }
  .replay-track { grid-column: 1; height: 64px; }
  .replay-counters { grid-column: 2; }
  .replay-counters small { font-size: 9px; }
  .replay-runner { width: 32px; height: 32px; margin-left: -16px; top: 20px; }
  .replay-token { width: 32px; height: 32px; }
  .replay-token .i { width: 18px; height: 18px; }
  .replay-runner-state { top: 38px; font-size: 8px; }
  .replay-axis { margin-left: 0; margin-right: 66px; }
  .replay-controls { gap: 10px; flex-wrap: wrap; }
  .replay-controls .btn { min-width: 82px; padding: 10px; }
  .replay-scrub { flex-basis: calc(100% - 100px); }
  .replay-controls #replay-restart { width: 100%; }
  .replay-legend { gap: 10px; font-size: 9px; flex-wrap: wrap; }
  .replay-legend span:last-child { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .replay-stage::after,.replay-token::before { animation: none !important; }
  .replay-lane,.replay-runner,.replay-trail,.replay-tracks { transition: none; }
  .replay-event { animation: none; }
}
.replay-legend select { color: #baceab; background: #15200f; border: 1px solid #445936; font: 400 10px var(--font); padding: 5px 7px; }
.replay-modal:has(.replay-lane) .replay-track { overflow: visible; }
/* The seek ruler labels real round time; the smaller row labels the 5s film. */
.replay-scrub > .replay-time-ticks { display: block; position: relative; height: 15px; margin-top: 7px; color: #c1d2b2; }
.replay-time-ticks > span { position: absolute; transform: translateX(-50%); white-space: nowrap; font-size: 10px; }
.replay-time-ticks > span:first-child { transform: none; }
.replay-time-ticks > span:last-child { transform: translateX(-100%); }
@media (max-width:480px) { .replay-time-ticks > span { font-size: 9px; } .replay-time-ticks > span:nth-child(2),.replay-time-ticks > span:nth-child(4) { display: none; } }

/* A compact timeline holds the published standings still; time is the course. */
.replay-modal { --replay-row-height: 42px; --replay-identity-width: 230px; --replay-timing-width: 90px; --replay-counter-width: 70px; }
.replay-head { padding: 10px 18px; }
.replay-head h2 { font-size: 24px; letter-spacing: -.045em; }
.replay-eyebrow { margin-bottom: 3px; font-size: 9px; }
.replay-head .btn-icon { width: 30px; height: 30px; }
.replay-body { padding: 12px 16px; }
.replay-intro { margin-bottom: 8px; gap: 8px; }
.replay-intro .replay-kicker { display: none; }
.replay-intro p { margin: 0; font-size: 11px; }
.replay-finished-only { padding: 4px 6px; font-size: 9px; }
.replay-filters { margin-bottom: 10px; gap: 8px; }
.replay-filters label { font-size: 10px; gap: 3px; }
.replay-filters select { padding: 5px 6px; font-size: 11px; }
.replay-filters .btn { min-height: 28px; padding: 5px 10px; font-size: 11px; }
.replay-stage { padding: 10px 12px 8px; }
.replay-stage-top { margin-bottom: 7px; }
.replay-clock strong { font-size: 30px; }
.replay-kicker { font-size: 9px; }
.replay-speed strong { font-size: 16px; }
.replay-speed span { font-size: 9px; margin-top: 2px; }
.replay-column-labels { display: grid; grid-template-columns: var(--replay-identity-width) minmax(0,1fr) var(--replay-timing-width) var(--replay-counter-width); color: #a8b89a; font-size: 9px; }
.replay-column-labels span:nth-child(n+3) { text-align: right; }
.replay-axis { margin-left: var(--replay-identity-width); margin-right: calc(var(--replay-timing-width) + var(--replay-counter-width)); padding-top: 4px; padding-bottom: 4px; font-size: 9px; }
.replay-tracks { margin: 0; transition: none; }
.replay-lane { position: relative; height: var(--replay-row-height); grid-template-columns: var(--replay-identity-width) minmax(0,1fr) var(--replay-timing-width) var(--replay-counter-width); grid-template-rows: none; transition: none; }
.replay-identity { grid-column: auto; gap: 8px; padding-right: 10px; align-self: center; }
.replay-rank { font-size: 14px; min-width: 2ch; font-variant-numeric: tabular-nums; }
.replay-name { display: block; }
.replay-name strong { font-size: 11px; max-width: none; }
.replay-name small { font-size: 9px; margin-top: 2px; }
.replay-track { grid-column: auto; height: var(--replay-row-height); }
.replay-track::before { top: 50%; }
.replay-trail { top: calc(50% - 2px); height: 4px; transition: none; }
.replay-runner { top: calc(50% - 12px); width: 24px; height: 24px; margin-left: -12px; transition: none; }
.replay-token { width: 24px; height: 24px; box-shadow: 0 0 12px color-mix(in srgb,var(--racer) 22%,transparent); }
.replay-token::before { inset: -3px; }
.replay-token .i { width: 14px; height: 14px; }
.replay-particle { left: 11px; top: 11px; width: 3px; height: 4px; }
.replay-end-marker { position: absolute; height: 65%; top: 17.5%; border-left: 1px dashed color-mix(in srgb,var(--racer) 45%,transparent); }
.replay-marker { top: calc(50% - 7px); opacity: .45; }
.replay-marker .i { width: 9px; height: 9px; }
.replay-marker.death { top: calc(50% - 9px); }
.replay-marker.death .i { width: 18px; height: 18px; }
.replay-timing { text-align: right; font-variant-numeric: tabular-nums; padding-left: 8px; }
.replay-timing time { display: block; color: #d5e3ca; font-size: 11px; }
.replay-runner-state { display: block; position: static; transform: none; white-space: nowrap; font-size: 8px; letter-spacing: .02em; margin-top: 2px; }
.replay-counters { grid-column: auto; padding-left: 8px; }
.replay-counters strong { font-size: 20px; }
.replay-counters small { font-size: 9px; margin-top: 2px; }
.replay-lane.is-finished .replay-token::before { animation: none; border-style: solid; opacity: .35; }
.replay-lane.is-finished .replay-runner-state { color: #b4c5a6; }
.replay-lane.is-finished .replay-end-marker { border-color: var(--racer); }
.replay-lane.is-dead .replay-timing time,.replay-lane.is-dead .replay-runner-state { color: #ff9388; }
.replay-events { min-height: 26px; max-height: 26px; padding-top: 5px; flex-wrap: nowrap; }
.replay-event { font-size: 9px; padding: 3px 5px; gap: 4px; }
.replay-event .i { width: 10px; height: 10px; }
.replay-legend { margin-top: 5px; padding-top: 5px; gap: 12px; font-size: 9px; }
.replay-legend select { font-size: 9px; padding: 3px 5px; }
.replay-controls { margin-top: 8px; gap: 12px; }
.replay-controls .btn { min-width: 82px; min-height: 30px; font-size: 11px; padding: 6px 10px; }
.replay-summary { margin-top: 6px; min-height: 15px; font-size: 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.replay-statistics { margin-top: 6px; padding-top: 0; }
.replay-statistics > summary { color: #d0e3b9; cursor: pointer; padding: 8px 0; font-size: 11px; }
.replay-statistics > summary span { color: #8c9e81; margin-left: 10px; font-size: 10px; }
.replay-statistics[open] .replay-stats-head { margin-top: 12px; }
.replay-extra-dense .replay-name small,.replay-extra-dense .replay-counters small { display: none; }
.replay-extra-dense .replay-token { width: 20px; height: 20px; }
.replay-extra-dense .replay-runner { width: 20px; height: 20px; top: calc(50% - 10px); margin-left: -10px; }
.replay-extra-dense .replay-timing { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.replay-extra-dense .replay-runner-state { margin: 0; font-size: 7px; }
.replay-extra-dense .replay-counters strong { font-size: 16px; }
@media (max-width:760px) {
  .replay-modal { --replay-identity-width: 155px; --replay-timing-width: 75px; --replay-counter-width: 48px; }
  .replay-body { padding: 10px; }
  .replay-head h2 { font-size: 21px; }
  .replay-filters { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px 8px; }
  .replay-clock strong { font-size: 26px; }
}
@media (max-width:480px) {
  .replay-modal { --replay-identity-width: 105px; --replay-timing-width: 57px; --replay-counter-width: 32px; }
  .replay-head { padding: 8px 10px; }
  .replay-head h2 { font-size: 19px; }
  .replay-body { padding: 8px; }
  .replay-stage { padding: 7px; }
  .replay-name strong { font-size: 9px; }
  .replay-name small { font-size: 8px; }
  .replay-rank { font-size: 11px; }
  .replay-identity { gap: 4px; padding-right: 6px; }
  .replay-column-labels { font-size: 7px; }
  .replay-axis { font-size: 8px; }
  .replay-axis span:nth-child(2),.replay-axis span:nth-child(4) { visibility: hidden; }
  .replay-timing { padding-left: 3px; }
  .replay-timing time { font-size: 9px; }
  .replay-controls { flex-wrap: nowrap; gap: 6px; }
  .replay-controls .btn { min-width: 56px; padding: 6px; font-size: 10px; }
  .replay-controls #replay-restart { width: auto; }
  .replay-scrub { flex-basis: auto; }
  .replay-legend { gap: 6px; font-size: 8px; flex-wrap: nowrap; }
  .replay-legend span:last-child { display: none; }
  .replay-statistics > summary span { display: none; }
  .replay-extra-dense .replay-timing { display: block; }
}

/* One bounded effects surface and compositor transforms replace per-event DOM animations. */
.replay-many .replay-eyebrow,.replay-many .replay-events { display: none; }
.replay-many .replay-head { padding: 8px 14px; }
.replay-many .replay-head h2 { font-size: 21px; }
.replay-many .replay-body { padding: 8px 12px; }
.replay-many .replay-intro { margin-bottom: 5px; }
.replay-many .replay-intro p { line-height: 1.3; }
.replay-many .replay-finished-only { padding: 2px 5px; font-size: 8px; }
.replay-many .replay-filters { margin-bottom: 7px; }
.replay-many .replay-filters label { font-size: 0; gap: 0; }
.replay-many .replay-stage-top { margin-bottom: 4px; }
.replay-many .replay-clock strong { font-size: 26px; }
.replay-many .replay-column-labels { line-height: 1.2; white-space: nowrap; font-size: 8px; }
.replay-many .replay-axis { line-height: 1.2; padding-block: 4px; }
.replay-many .replay-legend { margin-top: 4px; padding-top: 4px; }
.replay-many .replay-statistics > summary { padding-block: 5px; }
.replay-ultra-dense .replay-name strong,.replay-ultra-dense .replay-timing time { line-height: 1.2; }
.replay-ultra-dense .replay-runner-state { display: none; }
.replay-ultra-dense .replay-token { width: 18px; height: 18px; }
.replay-ultra-dense .replay-runner { width: 18px; height: 18px; top: calc(50% - 9px); margin-left: -9px; }
.replay-effects-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 4; }
.replay-runner { left: 0; will-change: transform; }
.replay-trail { left: 4%; width: 90%; transform-origin: left center; will-change: transform; }
.replay-stage::after { top: 0; will-change: transform; }
@keyframes replay-scan { from { transform: translate3d(0,0,0); } to { transform: translate3d(0,var(--replay-stage-height,600px),0); } }
@media (prefers-reduced-motion: reduce) { .replay-effects-canvas { display: none; } .replay-runner,.replay-trail { will-change: auto; } }

/* The pen draws new ECG segments; old samples remain in place and fade. */
.detail-chart .ecg-animation { pointer-events: none; }
.detail-chart .ecg-running .line-flags { display: none; }
.detail-chart .line-flags { stroke: var(--health-color, var(--capture)); }
.detail-chart .ecg-dead .ecg-history { opacity: .8; }
.detail-chart .ecg-history { fill: none; stroke: var(--health-color, var(--capture)); stroke-width: 1.5; opacity: .2; stroke-linejoin: round; }
.detail-chart .ecg-trail, .detail-chart .ecg-previous-trail { fill: none; stroke: url(#score-ecg-fade); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 3px var(--health-color, var(--capture))); }
.detail-chart .ecg-previous-trail { stroke: url(#score-ecg-fade-wrap); }
.detail-chart .ecg-dot { fill: var(--health-color, var(--capture)); filter: drop-shadow(0 0 5px var(--health-color, var(--capture))); }
.scan-echo .ecg-animation { display: none; }
.chart-legend .key-tip { width: 10px; height: 10px; border-radius: 0; background: var(--accent); transform: rotate(45deg); margin: 0 2px; }
.detail-chart .submission-marker.tip polygon { fill: var(--accent); stroke: var(--sea); stroke-width: 2; }
.detail-chart .submission-marker .tip-stem { stroke: var(--accent); stroke-width: 1; opacity: .65; }
.detail-chart .submission-marker .tip-number { fill: var(--sea); font: 700 9px var(--font); }
@media (prefers-reduced-motion: reduce) { .detail-chart .ecg-animation { display: none; } }

/* Mobile cards: one identity row, one result row, and a full-width lives row. */
@container (max-width: 700px) {
  body.open-hunt .lane, .lane {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "id id id" "score clock status" "hp hp hp";
    gap: 12px;
    min-height: 0;
    padding-block: 18px;
  }
  .lane-id { grid-area: id; align-items: flex-start; }
  .who { flex: 1; }
  .who-head { flex-wrap: wrap; }
  .who-name { max-width: 100%; font-size: 16px; }
  .lane-open { white-space: normal; overflow-wrap: anywhere; text-overflow: clip; }
  .who-meta { font-size: 10px; }
  body.open-hunt .lane .course { display: none; }
  body.open-hunt .lane-stats, .lane-stats { display: contents; }
  body.open-hunt .lane-status, .lane-status {
    grid-area: status;
    grid-column: auto;
    grid-row: auto;
  }
  .clock { justify-self: end; font-size: 11px; }
  .hp { justify-content: flex-start; min-width: 0; gap: 10px; }
  .hp-label { flex: none; font-size: 11px; }
  .lane-life-pips { flex: 1; max-width: 150px; }
  .lane-life-pips .life-pip { flex: 1; width: auto; height: 6px; }
}
@media (max-width: 540px) {
  .system-footer { flex-direction: column; align-items: flex-start; gap: 10px; font-size: 10px; }
  #terminal-clock { max-width: 100%; overflow-wrap: anywhere; }
}

/* Submission rows distinguish the local timestamp from time since the attempt began. */
#detail-log li {
  grid-template-columns: 21ch minmax(0, 1fr) auto;
  grid-template-areas: "timestamp outcome elapsed";
  gap: 8px 12px;
}
#detail-log li.has-submission-subject { grid-template-columns: 21ch minmax(0, 1fr) auto auto; grid-template-areas: "timestamp subject outcome elapsed"; }
#detail-log .submission-timestamp { grid-area: timestamp; font-variant-numeric: tabular-nums; white-space: nowrap; }
#detail-log .call-date, #detail-log .call-clock { display: block; overflow: visible; text-overflow: clip; color: var(--muted); }
#detail-log .call-date { font-size: 9px; opacity: .8; }
#detail-log .submission-subject { grid-area: subject; white-space: normal; overflow-wrap: anywhere; }
#detail-log .submission-outcome { grid-area: outcome; text-align: right; }
#detail-log .submission-elapsed { display: block; grid-area: elapsed; font-size: 10px; white-space: nowrap; }
@media (max-width: 700px) {
  #detail-log li { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "timestamp elapsed" "outcome outcome"; padding-block: 10px; }
  #detail-log li.has-submission-subject { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "timestamp elapsed" "subject outcome"; }
  #detail-log .submission-timestamp { font-size: 10px; }
  #detail-log .submission-outcome { white-space: normal; max-width: 18ch; }
}


.ai-toggle { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; line-height: 1.5; }
.ai-toggle input { appearance: auto; width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--action); }
.ai-disclosure .group-hint { margin-top: 10px; }
#ai-model-fields[hidden] { display: none; }

#detail-log .submitted-flag { grid-column: 1 / -1; display: block; padding: 10px 12px; background: var(--field); border: 1px solid var(--edge); color: var(--ink-2); font: 12px/1.6 var(--font); white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; user-select: text; }
