/* Layout: one column on every screen size: sentence card, then the costume stage (#scene) under it (Daniel 2026-11-01). */
:root {
  --bg: #f6f4ee;          /* paper */
  --panel: #ffffff;
  --ink: #23262b;         /* steel-black text */
  --muted: #6b6f76;       /* steel grey */
  --line: #dcd8cc;
  --accent: #c8361f;       /* ant red trim */
  --accent-ink: #8e2414;   /* red text on paper */
  --on-accent: #ffffff;    /* text on red fills */
  --alarm: #6e1a10;       /* bites, misses (darker than the trim) */
  --shade: rgba(20, 22, 26, 0.45);
  --cap: #a84a3c; --cap-ink: #ffffff; --tick: #1e9e57;   /* question box header: duller ant red (Daniel 2026-11-01, was #c8361f); tick green */
  --steel-hi: #f1f3f5; --steel: #d5d9de; --steel-lo: #b9bec5; --steel-dark: #8a9099;  /* metal nest */
  --display: "Fredoka", "Nunito", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17191c; --panel: #212429; --ink: #eceae4; --muted: #9da2aa; --line: #343840; --cap: #9a4a3e;
    --accent: #e8553a; --accent-ink: #ffab98; --on-accent: #1a0703; --alarm: #ff8a75; --shade: rgba(0, 0, 0, 0.6);
    --steel-hi: #4a5059; --steel: #3a3f47; --steel-lo: #2f333a; --steel-dark: #5d646e;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #17191c; --panel: #212429; --ink: #eceae4; --muted: #9da2aa; --line: #343840; --cap: #9a4a3e;
  --accent: #e8553a; --accent-ink: #ffab98; --on-accent: #1a0703; --alarm: #ff8a75; --shade: rgba(0, 0, 0, 0.6);
    --steel-hi: #4a5059; --steel: #3a3f47; --steel-lo: #2f333a; --steel-dark: #5d646e;
  color-scheme: dark;
}
/* Settings: colour-blind colours swap red/yellow for blue/orange; larger text scales everything in rem. */
:root[data-colour-blind="on"] { --accent: #f08a24; --accent-ink: #8a4300; --alarm: #2667d1; }
:root[data-colour-blind="on"][data-theme="dark"] { --accent-ink: #ffc58a; --alarm: #6fa3ff; }
:root[data-large-text="on"] { font-size: 112.5%; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 1rem; line-height: 1.45;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.app { max-width: 34rem; margin: 0 auto; padding-block: 0.75rem 2rem; display: grid; gap: 1rem;
  grid-template-areas: "top" "play" "scene" "foot"; }
.top { grid-area: top; } .play { grid-area: play; display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
#scene { grid-area: scene; min-width: 0; } .foot { grid-area: foot; }
#scene:empty { display: none; }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.logo { font-family: var(--display); font-weight: 600; font-size: 1.9rem; margin: 0; letter-spacing: -0.01em; }
.logo span { color: var(--accent); }
.icons { display: flex; gap: 0.25rem; }
.icon { width: 2.5rem; height: 2.5rem; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--ink); cursor: pointer; }
.icon:hover { background: var(--panel); }
.icon svg { width: 1.45rem; height: 1.45rem; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon svg .dot { fill: currentColor; stroke: none; }

.archive-tag { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin: 0 0 0.6rem; padding: 0.4rem 0.75rem;
  border-radius: 8px; border: 1px dashed var(--line); font-size: 0.9rem; color: var(--muted); }
.archive-tag[hidden] { display: none; }
.archive-tag button { font: inherit; font-weight: 800; background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0.25rem 0; }
.archive-days { display: flex; flex-direction: column; gap: 0.4rem; max-height: 55vh; overflow-y: auto; }
.archive-days button { font: inherit; display: grid; grid-template-columns: 3rem 1fr auto; align-items: center; gap: 0.6rem; text-align: left;
  min-height: 2.75rem; padding: 0.35rem 0.75rem; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; }
.archive-days button em { font-style: normal; font-size: 0.85rem; color: var(--muted); }
.archive-days button[aria-current="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

/* Progress row: 1 2 3 4 5 ⬡ on the left, points or stings on the right */
main { display: flex; flex-direction: column; gap: 1rem; }
.progress { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.steps { position: relative; display: flex; align-items: flex-start; gap: 0.9rem; width: 14.7rem; height: 2.3rem; flex: none; }
.steps .trail { position: absolute; inset: 0; width: 100%; height: 100%; }
.steps .trail line { stroke: var(--line); stroke-width: 2; stroke-dasharray: 0.1 3.4; stroke-linecap: round; }
.steps .trail line.done { stroke: var(--accent); }
.steps i { position: relative; font-style: normal; display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 6px;
  margin-top: 0.6rem; background: var(--bg); font-family: var(--display); font-size: 0.85rem; color: var(--muted); border: 1.5px solid var(--line); }
.steps i.hi { margin-top: 0; }
.steps .boss { width: 1.45rem; height: 1.45rem; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.steps .boss .eye { fill: currentColor; stroke: none; }
.steps i.done { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.steps i.now { border-color: var(--ink); color: var(--ink); }
.runpts { font-family: var(--display); font-variant-numeric: tabular-nums; }
.hearts { display: flex; gap: 0.2rem; }   /* Nest lives: red heart = life left, empty outline = used */
.hearts b { display: grid; place-items: center; width: 1.7rem; height: 1.7rem; }
.hearts svg { width: 1.55rem; height: 1.55rem; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linejoin: round; transition: fill 0.25s; }
.hearts b.on svg { fill: var(--accent); stroke: var(--accent-ink); }

.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; font-weight: 800; color: var(--muted); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.sentence { font-family: var(--display); font-weight: 500; font-size: 1.5rem; line-height: 1.3; margin: 0; text-wrap: balance; }
.blank { display: inline-block; border-bottom: 3px solid var(--accent); color: var(--accent-ink); }
.blank.empty { min-width: 4.5ch; }

form.guess { display: flex; gap: 0.5rem; }
form.guess input { flex: 1; min-width: 0; font: inherit; font-size: 1.1rem; padding: 0.7rem 0.85rem; border-radius: 10px;
  border: 2px solid var(--line); background: var(--bg); color: var(--ink); }
form.guess input:focus { outline: none; border-color: var(--accent); }
button.primary { font: inherit; font-weight: 800; padding: 0.7rem 1.1rem; border-radius: 10px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--on-accent); }
button.primary:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }
button.ghost { font: inherit; font-weight: 800; padding: 0.7rem 1.1rem; border-radius: 10px; cursor: pointer;
  background: none; color: var(--ink); border: 2px solid var(--line); }
button:focus-visible, summary:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
button .opt { font-weight: 400; color: var(--muted); font-size: 0.85em; }
button.link { font: inherit; background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 0; }
.hint { font-size: 0.85rem; color: var(--muted); min-height: 1.2em; margin: 0; }
.hint.warn { color: var(--alarm); }
.note { font-size: 0.9rem; color: var(--muted); margin: 0; }
.hint:empty { display: none; }
.note.warn { color: var(--alarm); font-weight: 700; }
.row { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }

/* Fast result card */
.sentence-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.sentence-row .sentence { min-width: 0; }
.sentence-row .pts { flex: none; font-family: var(--display); font-size: 2rem; font-variant-numeric: tabular-nums; }
.sentence-row .pts.zero { color: var(--alarm); }
/* Ranked answers: #1 bottle (37%) ····· 100 */
.toplist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.95rem; line-height: 1.3; }
.toplist li { display: flex; align-items: baseline; gap: 0.5rem; }
.toplist .rk { flex: none; width: 2.2rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.toplist .w { min-width: 0; overflow-wrap: anywhere; }
.toplist .tw { font-weight: 700; }
.toplist .pc { color: var(--muted); font-variant-numeric: tabular-nums; }
.toplist .dots { flex: 1; min-width: 1rem; border-bottom: 2px dotted var(--line); transform: translateY(-0.3em); }
.toplist .n { flex: none; font-family: var(--display); font-variant-numeric: tabular-nums; min-width: 2.2rem; text-align: right; }
.toplist li.you .tw { color: var(--accent-ink); border-bottom: 3px solid var(--accent); }
.toplist li.gap { color: var(--muted); padding-left: 2.7rem; line-height: 0.8; }

/* The Nest (Daniel's sketch): a tunnel drops in from the top and forks; each fork curls into a chamber on the right
   and carries on down-left to a chamber on the left. Doodle style: thick ink outlines, hand-cut rounded boxes, offset shadow.
   game.js places each .cell with inline left/top/width/height (% of the nest box); .tunnels draws the tunnels behind. */
.nest { position: relative; width: 100%; margin: 0.4rem 0 0.6rem; aspect-ratio: var(--ar); }
/* Short phones only (Daniel 2026-11-01): squash the board ~20% shorter so the scene below stays on screen. */
@media (max-width: 520px) and (max-height: 740px) {
  .nest { aspect-ratio: calc(var(--ar) * 1.25); margin: 0.2rem 0 0; }
  .cap-body:has(.nest) { padding-bottom: 0.45rem; }   /* and a bit less space down to the dotted line */
  .cell { border-radius: 12px 9px 11px 8px / 9px 11px 8px 10px; }
  .cell:not(.found):not(.missed) .rk { font-size: 1rem; }
}
.tunnels { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tunnels path { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.tunnels .pipe { stroke: var(--ink); stroke-width: 15px; }
.tunnels .pipe-in { stroke: var(--steel); stroke-width: 9px; }
.cell { position: absolute; display: flex; align-items: center; justify-content: center; gap: 0.3rem; padding: 0 0.4rem;
  border: 2.5px solid var(--ink); border-radius: 15px 11px 14px 10px / 11px 14px 10px 13px;   /* hand-drawn, not perfect */
  background: var(--panel); box-shadow: 3px 3px 0 var(--steel-lo); font-variant-numeric: tabular-nums; text-align: center; color: var(--ink); }
.cell .rk { font-family: var(--display); color: var(--muted); font-size: 0.85rem; line-height: 1; }
.cell .tw { font-weight: 800; font-size: 0.9rem; line-height: 1.1; overflow-wrap: anywhere; min-width: 0; }
.cell .tw.long { font-size: 0.72rem; letter-spacing: -0.02em; }   /* immigration, etc.: shrink rather than split mid-word */
.cell .sep { opacity: 0.6; font-weight: 800; }
.cell:not(.found):not(.missed) .rk { font-size: 1.15rem; }
.cell.found { background: var(--accent); color: var(--on-accent); box-shadow: 3px 3px 0 var(--accent-ink); }
.cell.found .rk { color: var(--on-accent); opacity: 0.6; }
.cell.missed { background: var(--panel); border-style: dashed; color: var(--muted); box-shadow: none; }
.cell.pop { animation: pop 0.35s ease-out; }
@keyframes pop { 0% { transform: scale(0.85); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
.tried { font-size: 0.85rem; color: var(--muted); margin: 0; }
.tried s { color: var(--alarm); }

/* Results */
.total { font-family: var(--display); font-size: 3.2rem; line-height: 1; margin: 0; font-variant-numeric: tabular-nums; }
.total small { font-size: 1.2rem; color: var(--muted); }
.rows { display: flex; flex-direction: column; }
.rows details { border-bottom: 1px solid var(--line); }
/* Results rows (Daniel 2026-11-01): fixed invisible columns so lines compare easily; each row centred vertically. */
.rows summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 2.1rem minmax(0, 1fr) 6.5rem 0.5rem 1.4rem 2.9rem 1.4rem;
  align-items: center; column-gap: 0.25rem; padding: 0.5rem 0; }
.rows summary::-webkit-details-marker { display: none; }
.rows summary .l { min-width: 0; }
.rows summary .k { font-variant-numeric: tabular-nums; display: flex; align-items: baseline; justify-content: space-between; padding-right: 0.15rem; }
.rows summary .k .boss { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.rows summary .k .boss .eye { fill: currentColor; stroke: none; }
@media (max-width: 520px) { .rows summary .l { font-size: 0.8rem; line-height: 1.3; } }
.rows summary .s { display: block; color: var(--muted); font-size: 0.85rem; }
.rows summary .g { text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.rows summary .d { text-align: center; color: var(--muted); }
.rows summary .e { text-align: center; }
.rows summary .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 800; }
.rows summary .you { color: var(--accent-ink); border-bottom: 3px solid var(--accent); }   /* same as your answer in the top-8 list */
/* Down arrow at the end of each row = tap to open its top answers (Daniel 2026-11-01); flips up when open. */
.rows summary::after { content: ""; width: 0.5rem; height: 0.5rem; margin: 0 0.15rem 0.25rem 0; justify-self: end;
  border-right: 2.5px solid var(--muted); border-bottom: 2.5px solid var(--muted); transform: rotate(45deg); transition: transform 0.15s; }
.rows details[open] > summary::after { transform: translateY(0.3rem) rotate(-135deg); }
@media (max-width: 520px) { .rows summary { grid-template-columns: 1.7rem minmax(0, 1fr) 4.3rem 0.35rem 1.1rem 2.4rem 1.05rem; column-gap: 0.15rem; } .rows summary .g, .rows summary .n { font-size: 0.88rem; } .rows summary .e { font-size: 0.85rem; } }
/* Score and verdict line on one row (Daniel 2026-11-01). */
.total-row { display: flex; align-items: stretch; gap: 0.8rem; }
.total-row .total { flex: none; }
/* Streak top right, verdict below it with its bottom on the score's bottom; both fit inside the score's height (Daniel 2026-11-01). */
.total-meta { min-width: 0; margin-left: auto; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end;
  text-align: right; font-size: 0.9rem; color: var(--muted); line-height: 1.25; padding-top: 0.15rem; }
.total-meta .streak { font-weight: 700; color: var(--ink); white-space: nowrap; }
@media (max-width: 520px) { .total-row .total { font-size: 2.6rem; } .total-meta { font-size: 0.82rem; } }
.rows details[open] { padding-bottom: 0.75rem; }
.share { white-space: pre-wrap; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.9rem;
  background: var(--bg); border-radius: 10px; padding: 0.75rem; margin: 0; user-select: all; }
.countdown { font-variant-numeric: tabular-nums; }
/* Share text with the Copy button inside the same box, right and vertically centred (Daniel 2026-11-01). */
.share-box { display: flex; align-items: center; gap: 0.75rem; background: var(--bg); border-radius: 10px; padding: 0.75rem; }
.share-box .share { flex: 1; min-width: 0; padding: 0; background: none; border-radius: 0; }
.share-box #copy { flex: none; }
/* Both labels share one grid cell so the button keeps the width of the longer one (Daniel 2026-11-01). */
#copy { display: grid; } #copy > span { grid-area: 1 / 1; } #copy .c2, #copy.copied .c1 { visibility: hidden; } #copy.copied .c2 { visibility: visible; }
.row.ends { justify-content: space-between; }
@media (max-width: 520px) { .share-box { padding: 0.65rem; gap: 0.5rem; } .share-box .share { font-size: 0.68rem; }
  .share-box #copy { padding-left: 0.65rem; padding-right: 0.65rem; font-size: 0.85rem; } }

/* Bottom sheets */
.sheet-backdrop { position: fixed; inset: 0; background: var(--shade); z-index: 20; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; margin: 0 auto; max-width: 34rem; max-height: 85vh; overflow-y: auto;
  background: var(--panel); color: var(--ink); border-radius: 18px 18px 0 0; display: flex; flex-direction: column; gap: 0.75rem;
  padding: 1.25rem max(1.25rem, env(safe-area-inset-right, 0px)) calc(1.5rem + env(safe-area-inset-bottom, 0px)) max(1.25rem, env(safe-area-inset-left, 0px));
  animation: rise 0.22s ease-out; }
@keyframes rise { from { transform: translateY(30%); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet > header { display: flex; justify-content: space-between; align-items: center; }
.sheet h2 { font-family: var(--display); font-weight: 600; font-size: 1.4rem; margin: 0; }
.sheet p { margin: 0; }
.sheet .close:not(.primary) { font-size: 1.1rem; width: 2.25rem; height: 2.25rem; border-radius: 50%; border: 0; background: var(--bg); color: var(--ink); cursor: pointer; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; text-align: center; }
.stats b { display: block; font-family: var(--display); font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.stats span { font-size: 0.8rem; color: var(--muted); }
.spread { display: grid; grid-template-columns: auto 1fr auto; gap: 0.3rem 0.6rem; align-items: center; font-size: 0.85rem; margin-top: 0.75rem; font-variant-numeric: tabular-nums; }
.spread .track { height: 12px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.spread .fill { display: block; height: 100%; background: var(--accent); }
.toggles { display: flex; flex-direction: column; }
.toggle { display: flex; justify-content: space-between; align-items: center; padding: 0.7rem 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.toggle input { width: 1.2rem; height: 1.2rem; accent-color: var(--accent); }

.foot { font-size: 0.8rem; color: var(--muted); text-align: center; }

@media (max-width: 380px) { .sentence { font-size: 1.3rem; } .stats { grid-template-columns: repeat(2, 1fr); } }
@media (prefers-reduced-motion: reduce) { .cell.pop, .sheet { animation: none; } }
:root[data-skip-anim="on"] .cell.pop, :root[data-skip-anim="on"] .sheet { animation: none; }

/* Scene (art/scene.js): scrolling chip-die world with the guards, the cast walking in place, CAPTCHA bubble.
   The art has fixed colours, so the stage stays light even in dark mode. */
.vb-stage { background: #e4ebe6; border: 2.5px solid var(--ink); border-radius: 14px 10px 16px 9px / 10px 15px 9px 14px;
  box-shadow: 3px 3px 0 color-mix(in srgb, var(--ink) 25%, transparent); overflow: hidden; }
.vb-stage svg { display: block; width: 100%; height: auto; aspect-ratio: 600 / 160; }
@media (max-width: 520px) { .vb-stage svg { aspect-ratio: 440 / 160; } }   /* phones: crop the back of the queue, bigger cast */
.vb-guard, .vb-player { transform-box: fill-box; transform-origin: 50% 100%; }
.is-bite .vb-guard { animation: vb-lunge .6s ease-out; }
.is-bite .vb-player { animation: vb-shake .6s ease-out; }
.is-pass .vb-guard { animation: vb-nod .6s ease-out; }
.is-walking .vb-player, .is-stepping .vb-player { animation: vb-bob .46s ease-in-out infinite; }
.vb-bg { animation: vb-bgscroll 5s linear infinite paused; }
.is-walking .vb-bg { animation-play-state: running; }
@keyframes vb-bgscroll { to { transform: translateX(-1200px); } }
@keyframes vb-lunge { 0%, 100% { transform: none; } 30% { transform: translateX(-9%); } }
@keyframes vb-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-3%) rotate(-4deg); }
  40% { transform: translateX(2%) rotate(3deg); } 60% { transform: translateX(-1%) rotate(-2deg); } }
@keyframes vb-nod { 0%, 100% { transform: none; } 35% { transform: rotate(-2deg) translateY(-2%); } }
@keyframes vb-bob { 50% { transform: translateY(-3%) rotate(2deg); } }
/* ANTCHA box over the guard (CAPTCHA-style widget as a speech bubble): ask = empty box, spin = checking, ok = tick, bang = "!" */
.vb-cap[data-show="none"] { display: none; }
.vb-cap .bb, .vb-cap .bb-tail, .vb-cap .bb-s { fill: #f9f9f9; stroke: #8f8f8f; stroke-width: 2; stroke-linejoin: round; }
.vb-cap .bb-tail-in { fill: #f9f9f9; stroke: none; }
.vb-cap .cb { fill: #fff; stroke: #c1c1c1; stroke-width: 2; }
.vb-cap .spin { fill: none; stroke: #3a78bd; stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 46 24;
  transform-box: fill-box; transform-origin: center; animation: vb-spin .7s linear infinite; }
.vb-cap .tk { fill: none; stroke: #1e9e57; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 44; animation: cap-draw .35s ease-out both; }
.vb-cap .lbl { font: 600 15px var(--body); fill: #222; }
.vb-cap .logo path { stroke-linecap: round; }
.vb-cap .ar1, .vb-cap .ar2 { fill: none; stroke-width: 4.2; }
.vb-cap .ar1 { stroke: #d23b2a; } .vb-cap .ah1 { fill: #d23b2a; }
.vb-cap .ar2 { stroke: #8e2414; } .vb-cap .ah2 { fill: #8e2414; }
.vb-cap .logo { transform-box: fill-box; transform-origin: center; }
.vb-cap[data-show="spin"] .logo { animation: vb-spin 1s linear infinite; }
.vb-cap .brand { font: 800 8.5px var(--body); fill: #555; letter-spacing: .4px; }
.vb-cap .fine { font: 600 5.6px var(--body); fill: #8a8a8a; }
.vb-cap .bang { font: 700 36px var(--display); fill: #c8341f; }
.vb-cap:not([data-show="spin"]) .spin, .vb-cap:not([data-show="ok"]) .tk, .vb-cap:not([data-show="ask"]) .cb { display: none; }
.vb-cap[data-show="bang"] :is(.bb, .bb-tail, .bb-tail-in, .b-cap) { display: none; }
.vb-cap:not([data-show="bang"]) :is(.bb-s, .bang) { display: none; }
@keyframes vb-spin { to { transform: rotate(360deg); } }
/* Guards transmitting: antenna tips blink, radio waves pulse out */
.tx .tx-dot { fill: var(--light); }
.tx .tx-glow { fill: var(--light); opacity: .25; }
.tx .tx-wave { fill: none; stroke: var(--light); stroke-width: 2.6; stroke-linecap: round; opacity: 0; }
.tx { animation: tx-blink 1.1s steps(1, end) infinite; }
.tx .tx-wave { animation: tx-wave 1.1s ease-out infinite; }
@keyframes tx-blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes tx-wave { 0% { opacity: .9; } 60%, 100% { opacity: 0; } }

[data-skip-anim="on"] #scene * { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { #scene * { animation: none !important; } }

/* Question box as a doodle CAPTCHA (Daniel 2026-11-01): blue header with the sentence, answer area, footer with the
   progress trail and the one action button. Hand-drawn border to match the Nest chambers. */
.card.captcha { padding: 0; gap: 0; overflow: hidden; border: 2.5px solid var(--ink);
  border-radius: 14px 10px 16px 9px / 10px 15px 9px 14px; box-shadow: 3px 3px 0 color-mix(in srgb, var(--ink) 25%, transparent); }
.cap-head { background: var(--cap); color: var(--cap-ink); padding: 0.5rem 1.1rem 0.95rem; display: flex; flex-direction: column; gap: 0.3rem;
  border-bottom: 2.5px solid var(--ink); }
.cap-top { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; min-height: 1.5rem; }
.cap-label { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; font-weight: 800; opacity: 0.9; }
.cap-top .runpts, .cap-score { font-family: var(--display); font-variant-numeric: tabular-nums; margin-left: auto; white-space: nowrap; }
.cap-top .hearts { flex: none; }
.cap-top .hearts svg { stroke: var(--cap-ink); opacity: 0.55; }
.cap-top .hearts b.on svg { fill: var(--cap-ink); stroke: var(--cap-ink); opacity: 1; }   /* white = life left on the red header */
.cap-head .sentence { color: var(--cap-ink); }
.cap-head .blank { border-bottom-color: var(--cap-ink); color: var(--cap-ink); font-weight: 600; }
.cap-head .sentence-row .pts, .cap-head .sentence-row .pts.zero { color: var(--cap-ink); }
.cap-head .sentence-row { gap: 0.6rem; }
.cap-head .sentence-row .sentence { flex: 1; }
.cap-mark { flex: none; display: grid; place-items: center; width: 2rem; height: 2rem; background: #fff; border: 2.5px solid var(--ink);
  border-radius: 5px 4px 6px 4px; }
.cap-mark svg { width: 1.5rem; height: 1.5rem; fill: none; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.cap-mark.ok svg { stroke: var(--tick); } .cap-mark.no svg { stroke: #c8341f; }
.cap-mark svg path { stroke-dasharray: 30; animation: cap-draw 0.45s ease-out both; }
@keyframes cap-draw { from { stroke-dashoffset: 30; } to { stroke-dashoffset: 0; } }
.cap-body { padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.85rem; }
.cap-body:empty { display: none; }
.cap-foot { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 0.6rem 0.75rem;
  padding: 0.7rem 1.1rem 0.8rem; border-top: 2px dashed var(--line); }
.cap-foot .steps { zoom: 0.78; }
button.cap-btn { margin-left: auto; text-transform: uppercase; letter-spacing: 0.05em; background: var(--cap); color: var(--cap-ink);
  border: 2.5px solid var(--ink); border-radius: 8px 6px 9px 6px; box-shadow: 2px 2px 0 color-mix(in srgb, var(--ink) 30%, transparent); }
[data-skip-anim="on"] .cap-mark svg path { animation: none; }
.antcha { flex: none; display: flex; flex-direction: column; align-items: center; gap: 0.1rem; color: var(--cap-ink); }
.antcha svg { width: 2.4rem; height: 2.4rem; fill: none; stroke-width: 4.2; stroke-linecap: round; }
.antcha .a1 { stroke: currentColor; } .antcha .h1 { fill: currentColor; stroke: none; }
.antcha .a2 { stroke: currentColor; opacity: 0.7; } .antcha .h2 { fill: currentColor; stroke: none; opacity: 0.7; }
.antcha b { font-size: 0.6rem; font-weight: 800; letter-spacing: 0.06em; opacity: 0.9; }

/* Phones (Daniel 2026-11-01): give the sentence more width and keep the footer on one line so the scene sits higher. */
@media (max-width: 520px) {
  .cap-head { padding: 0.45rem 0.8rem 0.8rem; }
  .cap-body { padding: 0.8rem 0.8rem; gap: 0.7rem; }
  .cap-foot { padding: 0.55rem 0.8rem 0.6rem; gap: 0.5rem; }
  .cap-head .sentence-row { gap: 0.4rem; }
  .antcha svg { width: 1.8rem; height: 1.8rem; }
  .antcha b { font-size: 0.5rem; }
  .cap-head .sentence-row .pts { font-size: 1.6rem; }
  .cap-foot .steps { zoom: 0.7; }
  .cap-head .sentence { text-wrap: pretty; }   /* fill each line instead of balancing them narrow */
  .cap-label { letter-spacing: 0.03em; font-size: 0.7rem; }
  .cap-top { gap: 0.5rem; }
  button.cap-btn { padding-left: 0.9rem; padding-right: 0.9rem; }
}
@media (max-width: 520px) { form.guess input::placeholder { font-size: 0.88em; } }

/* Licence credit in the How to play footer (Daniel 2026-11-01). */
.note.credit { font-size: 0.75rem; text-align: center; } .note.credit a { color: inherit; }
/* Narrow phones (Daniel 2026-11-01): icons a little closer so "Verified Bot" stays on one line. */
.logo { white-space: nowrap; }
@media (max-width: 400px) { .top { gap: 0.4rem; } .icons { gap: 0; } .icon { width: 2.25rem; } }
@media (max-width: 340px) { .logo { font-size: 1.6rem; } }
