/* The game on the home page (js/game/main.js). Colours only from css/tokens.css. */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.game{display:block}
.screen:focus,.screen [tabindex="-1"]:focus{outline:none}
.go{display:block;width:100%;max-width:440px;height:62px;border:0;border-radius:999px;background:var(--button-bg);color:var(--button-text);font-family:var(--font-numeral);font-size:22px;font-weight:500;cursor:pointer;touch-action:manipulation}
.go:focus-visible,.opt:focus-visible,.skip:focus-visible,.hud-toggle:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
/* Not available while the tab joins a player's tabs (main.js setJoining): a moment, after a switch. */
.go:disabled,.opt:disabled,.skip:disabled{opacity:.45;cursor:not-allowed}

/* ---------- the pack's face ---------- */
.face{display:block;width:100%;height:100%;overflow:visible;filter:drop-shadow(0 0 8px rgba(var(--accent-rgb),.35))}
.face .head{fill:rgba(var(--accent-rgb),.12);stroke:var(--accent);stroke-width:3}
.face .antenna,.face .brow,.face .lid{stroke:var(--accent);stroke-width:3;stroke-linecap:round}
.face .antenna-light,.face .eye{fill:var(--accent)}
.face .mouth{stroke:var(--accent);stroke-width:3;stroke-linecap:round;stroke-linejoin:round;fill:rgba(var(--accent-rgb),.3)}
.face .sweat{fill:rgba(var(--accent-rgb),.6)}
.face-box{width:88px;height:88px;flex:none}

/* ---------- names and marks (start, result) ---------- */
.pack-list{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:8px}
.pack-list li{display:inline-flex;align-items:center;gap:8px;min-height:38px;padding:5px 14px 5px 5px;border:1px solid var(--hairline);border-radius:999px;font-size:14px;font-weight:600;line-height:1.2}
.badge{display:inline-grid;place-items:center;flex:none;width:28px;height:28px;border-radius:50%;border:1.75px solid var(--accent);background:var(--paper);color:var(--accent-text);font-family:var(--font-numeral);font-weight:600;font-size:13px;line-height:1}
.pack-list .is-ahead .badge{background:var(--accent);color:var(--paper)}
/* A maker's mark (BNB-109): scaled and centred on paper, never recoloured. The makers ask for a
   surface that does not interfere, so "ahead of you" is a thick ring rather than a fill. */
.badge.mk{position:relative;overflow:visible;background:var(--paper)}
.badge.mk .mark-img{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);display:block;max-width:none;pointer-events:none}
.badge.mk.is-ahead,.pack-list .is-ahead .badge.mk{background:var(--paper);border-width:4px}

/* ---------- who is playing (start and result): Human, or Agent ---------- */
.who{display:inline-flex;gap:2px;padding:3px;border:1px solid var(--hairline);border-radius:999px;background:var(--surface)}
.who-opt{position:relative;display:block;cursor:pointer}
.who-opt input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
.who-opt span{display:flex;align-items:center;justify-content:center;min-width:104px;min-height:44px;padding:0 18px;border-radius:999px;font-size:15px;font-weight:700;color:var(--muted);white-space:nowrap}
.who-opt input:checked+span{color:var(--ink);box-shadow:inset 0 0 0 1.75px var(--ink)}
.who-opt input:focus-visible+span{outline:2px solid var(--accent);outline-offset:2px}
@media (hover:hover){.who-opt input:not(:checked):hover+span{color:var(--ink)}}
.who-small .who-opt span{min-width:88px;font-size:13px}

/* ---------- waiting for the day ---------- */
.screen-wait{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;min-height:52vh;text-align:center}
.wait-line{margin:0;font-size:18px;font-weight:600;color:var(--text-2);max-width:28ch}
.wait-line:empty{display:none}

/* ---------- start ---------- */
.screen-start{display:flex;flex-direction:column;align-items:center;gap:22px;max-width:640px;margin:0 auto;padding:40px 0 8px;text-align:center}
.start-pack{justify-content:center}
.dev-slot:empty{display:none}
.dev-day{display:flex;align-items:center;gap:10px;font-size:13px;color:var(--muted);font-weight:600;margin-top:8px}
.dev-day select{font:inherit;color:var(--ink);background:var(--surface);border:1px dashed var(--forming);border-radius:10px;min-height:44px;padding:0 10px}

/* ---------- the run ---------- */
.screen-run{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(150px,1fr) auto;grid-template-areas:"hud" "viz" "play";min-height:0}
.game-page[data-screen="run"]{height:100vh;height:100dvh;display:flex;flex-direction:column;padding-bottom:0;overflow:hidden}
.game-page[data-screen="run"] .game{flex:1;min-height:0;display:flex;flex-direction:column}
.game-page[data-screen="run"] .screen-run{flex:1}

.hud{grid-area:hud;display:flex;align-items:center;gap:8px;height:56px;padding:0 2px;min-width:0}
.hud-face{width:40px;height:40px;flex:none}
.hud-gap{display:flex;align-items:center;gap:6px;min-width:62px}
.hud-gap .num{font-family:var(--font-numeral);font-weight:500;font-size:26px;line-height:1;font-variant-numeric:tabular-nums}
/* The rival's badge, as on its lane: hollow when level or behind you, filled when ahead. */
.hud-gap .rival{width:24px;height:24px;font-size:12px}
.hud-gap .rival:empty{display:none}
.hud-gap .rival.is-ahead{background:var(--accent);color:var(--paper)}
.hud-gap .rival.mk.is-ahead{background:var(--paper);border-width:3.5px}
/* The rival's avatar, standing still in its badge (BNB-113). */
.hud-gap .rival.av .av-still{display:block;width:70%;height:70%;pointer-events:none}
.hud-clock{margin:0 auto;display:flex;align-items:center;justify-content:center;gap:8px;font-family:var(--font-numeral);font-variant-numeric:tabular-nums;line-height:1;min-width:76px}
.hud-clock .num{font-size:36px;font-weight:var(--numeral-weight);color:var(--accent-text);text-shadow:var(--glow-value)}
.hud-clock.urgent .num{font-weight:500}
/* The hold clock is small, quiet and boxed with the gate's bar: the pack is waiting. */
.hud-clock .gate-mark{display:none;width:4px;height:18px;border-radius:2px;background:var(--accent)}
.hud-clock.hold{border:1px solid var(--hairline);border-radius:999px;padding:6px 10px 6px 9px}
.hud-clock.hold .gate-mark{display:block}
.hud-clock.hold .num{font-size:20px;font-weight:400;color:var(--muted);text-shadow:none}
.hud-strikes{display:flex;gap:7px;align-items:center}
/* A strike left is a solid dot; a strike used is a cross, in full ink. Shape, not shade, tells them apart. */
.hud-strikes i{position:relative;width:12px;height:12px;border-radius:50%;background:var(--ink)}
.hud-strikes i.spent{background:transparent;border-radius:0}
.hud-strikes i.spent::before,.hud-strikes i.spent::after{content:'';position:absolute;left:-1px;right:-1px;top:50%;height:2.5px;margin-top:-1.25px;border-radius:2px;background:var(--ink);transform:rotate(45deg)}
.hud-strikes i.spent::after{transform:rotate(-45deg)}
.hud-toggles{display:flex;margin-right:-8px}
.hud-toggle{width:44px;height:44px;border:0;border-radius:50%;background:transparent;color:var(--muted);display:grid;place-items:center;cursor:pointer;flex:none;padding:0}
.hud-toggle svg{width:20px;height:20px}
.hud-toggle .off{display:none}
.hud-toggle[aria-pressed="false"]{color:var(--forming)}
.hud-toggle[aria-pressed="false"] .on{display:none}
.hud-toggle[aria-pressed="false"] .off{display:inline}

.viz{grid-area:viz;position:relative;overflow:hidden;min-height:0;contain:strict}

/* The question: never covered, always in thumb reach. */
/* The question and its four options sit in boxes of fixed size: the answers never move from one
   question to the next, and the lanes get everything above. Long text shrinks to fit (main.js fit). */
.screen-run{--q-h:88px;--q-gap:10px;--opt-h:66px;--opt-gap:8px}
.run-play{grid-area:play;box-sizing:content-box;height:calc(var(--q-h) + var(--q-gap) + 2 * var(--opt-h) + var(--opt-gap));padding:8px 0 max(12px,env(safe-area-inset-bottom));display:flex;flex-direction:column;justify-content:flex-end}
.qa{display:flex;flex-direction:column}
.q-text{flex:none;height:var(--q-h);margin:0 2px var(--q-gap);overflow:hidden;font-size:19px;line-height:1.28;font-weight:700;letter-spacing:-.005em;display:flex;align-items:flex-end;text-wrap:balance}
.opts{display:grid;grid-template-columns:1fr 1fr;grid-auto-rows:var(--opt-h);gap:var(--opt-gap)}
.opt{position:relative;isolation:isolate;height:var(--opt-h);overflow:hidden;padding:8px 12px;border-radius:14px;border:1.5px solid var(--forming);background:var(--surface);color:var(--ink);font:inherit;font-size:17px;font-weight:600;line-height:1.2;text-align:center;cursor:pointer;touch-action:manipulation;display:flex;align-items:center;justify-content:center;transition:border-color .12s;-webkit-user-select:none;user-select:none}
.opt::before{content:'';position:absolute;inset:-1.5px;z-index:-1;border-radius:inherit;pointer-events:none;opacity:0}
.opt kbd{display:none;position:absolute;top:7px;left:9px;font:600 11px/1 var(--font-text);color:var(--muted)}
@media (hover:hover) and (pointer:fine){
  .opt kbd{display:block}
  .opt:hover{border-color:var(--ink)}
}
/* Right or wrong: a brief flash under the next question's text. It never blocks input. */
.opt.flash-right::before{background:rgba(var(--ink-rgb),.2);animation:opt-flash .45s ease-out both}
.opt.flash-wrong::before{border:2px dashed var(--ink);animation:opt-flash .45s ease-out both}
@keyframes opt-flash{from{opacity:1}to{opacity:0}}

.panel{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;height:100%}
.panel-line{margin:0;font-family:var(--font-numeral);font-weight:var(--numeral-weight);font-size:40px;line-height:1.05;text-align:center;letter-spacing:-.01em}
.panel[data-state="waiting"] .panel-line{font-size:26px;color:var(--muted)}
.skip{min-height:48px;padding:0 22px;border:1.5px solid var(--ink);border-radius:999px;background:transparent;color:var(--ink);font:inherit;font-size:15px;font-weight:700;cursor:pointer;touch-action:manipulation}

/* ---------- the result ---------- */
.screen-result{max-width:680px;margin:0 auto;padding:32px 0 24px}
.result-top{text-align:center}
.result-top .who{margin:0 0 18px}
.result-who{margin:0;color:var(--muted);font-size:14px;font-weight:700;letter-spacing:.02em}
.result-headline{margin:6px 0 22px;font-family:var(--font-numeral);font-weight:var(--numeral-weight);font-size:64px;line-height:1;letter-spacing:-.015em;text-shadow:var(--glow-numeral-small-ink)}
.result-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:0}
.result-stats[data-tiles="2"]{grid-template-columns:repeat(2,minmax(0,1fr))}
.result-stats div{display:flex;flex-direction:column-reverse;align-items:center;gap:4px;padding:14px 6px;border:1px solid var(--hairline);border-radius:16px;background:var(--surface);box-shadow:var(--card-edge)}
.result-stats dt{font-size:12px;font-weight:600;color:var(--muted)}
.result-stats dd{margin:0;font-family:var(--font-numeral);font-size:32px;font-weight:400;line-height:1;font-variant-numeric:tabular-nums}
.result-pack{display:grid;gap:18px;margin:26px 0 0}
.result-link{margin:14px 0 0;font-size:14px;font-weight:600;color:var(--muted);overflow-wrap:anywhere}
.result-url{color:var(--ink);font-weight:700;-webkit-user-select:all;user-select:all}
.result-group h3{margin:0 0 10px;font-size:13px;font-weight:700;color:var(--muted);letter-spacing:.02em}
.group-head{display:flex;justify-content:space-between;align-items:baseline;gap:12px}
.group-note{font-size:12px;font-weight:600;color:var(--muted)}
.result-group .pack-list{flex-direction:column;flex-wrap:nowrap;gap:6px}
#beaten-list{flex-direction:row;flex-wrap:wrap}
#passed-list li{width:100%;border-radius:14px}
/* BNB-111 round 2, Seb: "In this view after playing the game we should not have the blue circles around
   the logos." After the race a maker's mark has no ring in the agents' colour, thin or thick, in either
   list. The disc keeps its size (border-box), its paper and its mark, centred as before, with the row's
   own hairline as its edge, so nothing moves. Letter badges, the start screen's list, the lanes and the
   gap readout keep their rings. */
.result-group .pack-list .badge.mk,.result-group .pack-list .is-ahead .badge.mk{border:1px solid var(--hairline)}
.pass-time{margin-left:auto;font-family:var(--font-numeral);font-variant-numeric:tabular-nums;color:var(--accent-text);font-size:16px}
.result-next{display:flex;justify-content:center;align-items:baseline;gap:10px;margin:26px 0 0;font-size:14px;font-weight:600;color:var(--muted)}
.result-next time{font-family:var(--font-numeral);font-variant-numeric:tabular-nums;font-size:22px;color:var(--ink);font-weight:400}
.share-slot{margin:18px 0 0}
.share-slot:empty{margin:0}

/* ---------- the page's last two lines (BNB-119): what is counted, the cookie choice, the affiliation ---------- */
/* The quietest lines on the page, after the game; never on the run screen. */
.page-notes{margin:64px 0 0}
.page-note{margin:0 0 8px;font-size:12px;font-weight:500;line-height:1.5;color:var(--muted)}
/* Beside the counting line: opens the cookie banner again (BNB-115). A button, since it opens and does not go anywhere. */
.page-consent{margin:0;padding:0;border:0;background:none;color:inherit;font:inherit;text-decoration:underline;text-underline-offset:2px}
.page-consent:hover{color:var(--ink)}
.page-consent:focus-visible{outline:2px solid var(--ink);outline-offset:4px;border-radius:8px}
.game-page[data-screen="run"] .page-notes{display:none}

/* ---------- phones ---------- */
@media (max-width:640px){
  /* The pack at the top, the switch and Start at the bottom of the first screen (under the one-row header);
     the page's last lines start below it. */
  .screen-start{min-height:calc(100dvh - 68px - env(safe-area-inset-top));padding:24px 0 calc(38px + env(safe-area-inset-bottom))}
  .screen-start .who{margin-top:auto}
  .page-notes{margin-top:44px}
  .result-headline{font-size:54px}
  /* The run keeps the site header, on one line. */
  .game-page[data-screen="run"]{padding:calc(8px + env(safe-area-inset-top)) 12px 0}
  .game-page[data-screen="run"] .board-header{grid-template-columns:auto minmax(0,1fr) auto;gap:8px;padding:0 4px}
}
@media (max-width:400px){
  .hud{gap:6px}
  .hud-clock{min-width:64px;gap:6px}
  .hud-toggle{width:40px}
  .hud-toggles{margin-right:-6px}
}
@media (max-width:640px) and (max-height:760px){
  .screen-run{--q-h:70px;--q-gap:8px;--opt-h:58px;--opt-gap:6px}
  .hud{height:50px}
  .q-text{font-size:17px}
  .opt{padding:6px 10px;font-size:16px}
}

/* ---------- desktop: the chase on the left, the question on the right ---------- */
@media (min-width:960px){
  .game-page[data-screen="run"]{padding-bottom:0}
  .screen-run{grid-template-columns:minmax(0,1.55fr) minmax(360px,1fr);grid-template-rows:auto minmax(0,1fr);grid-template-areas:"hud hud" "viz play";column-gap:40px;padding-top:12px}
  .hud{height:72px}
  .hud-face{width:52px;height:52px}
  .hud-gap .num{font-size:34px}
  .hud-clock .num{font-size:52px}
  .hud-clock.hold .num{font-size:26px}
  .screen-run{--q-h:150px;--q-gap:20px;--opt-h:64px;--opt-gap:10px}
  .run-play{height:auto;justify-content:center;padding:0 0 32px}
  .qa{height:calc(var(--q-h) + var(--q-gap) + 4 * var(--opt-h) + 3 * var(--opt-gap))}
  .panel{height:auto}
  .q-text{font-size:26px}
  .opts{grid-template-columns:1fr}
  .opt{justify-content:flex-start;text-align:left;padding-left:44px;font-size:18px}
  .opt kbd{top:50%;transform:translateY(-50%);left:16px;font-size:13px}
  .panel{min-height:0}
  .panel-line{font-size:56px}
  .screen-start{padding-top:64px}
}

@media (prefers-reduced-motion: reduce){
  .opt{transition:none}
  .opt.flash-right::before,.opt.flash-wrong::before{animation-duration:.6s;animation-timing-function:steps(2,jump-none)}
}
