:root {
  /* A shadow-puppet theater: the lit stage stays pinned at the top while you play; the calls sit below it on a dark house floor. */
  --bg: #15110d;
  --panel: #211a14;
  --line: #4a3c2e;
  --cream: #f3e7cf;
  --muted: #bfae92;
  --amber: #f0b84b;
  --right: #4f7a34;
  --miss: #9a3a24;
  --display: "Big Shoulders Display", "Arial Narrow", "Helvetica Neue", sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --scripture: "IM Fell English", Georgia, "Times New Roman", serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--cream); }
body { font-family: var(--body); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
.wrap { max-width: 560px; margin: 0 auto; padding: 0 14px calc(40px + env(safe-area-inset-bottom)); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }

.bug { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 2px 6px; font-family: var(--display); text-transform: uppercase; }
.brand { font-weight: 900; font-size: 26px; letter-spacing: .08em; color: var(--amber); line-height: 1; }
.brand small { display: block; font-size: 10.5px; letter-spacing: .12em; color: var(--muted); font-weight: 800; margin-top: 3px; white-space: nowrap; }
.pips { display: flex; gap: 5px; }
.pip { width: 14px; height: 11px; border: 1.5px solid var(--muted); border-radius: 2px; opacity: .5; }
.pip.now { opacity: 1; border-color: var(--cream); }
.pip.hit { background: var(--right); border-color: var(--right); opacity: 1; }
.pip.miss { background: var(--miss); border-color: var(--miss); opacity: 1; }
.meta { font-weight: 800; font-size: 14px; letter-spacing: .1em; color: var(--muted); white-space: nowrap; }

/* Stage */
.stageWrap { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 6px 0 10px; }
.stage { position: relative; border-radius: 10px; overflow: hidden; border: 2px solid #3a2f24; box-shadow: 0 0 0 1px #000, 0 10px 30px rgba(240,184,75,.12); cursor: pointer; }
#scene { display: block; width: 100%; height: auto; aspect-ratio: 400 / 230; }
.hint { position: absolute; right: 8px; top: 7px; font-size: 12px; font-weight: 700; color: #fff7e6; background: rgba(0,0,0,.45); padding: 3px 8px; border-radius: 999px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.hint.on { opacity: 1; }
.sign { font-family: "Big Shoulders Display", "Arial Narrow", sans-serif; font-weight: 900; fill: #fff6df; stroke: #1b1410; stroke-width: 3px; paint-order: stroke; stroke-linejoin: round; }

/* Scene motion (looping, decorative), shared by all stories */
.waveA { animation: waveA 2.6s linear infinite; }
.waveB { animation: waveB 4s linear infinite; }
@keyframes waveA { from { transform: translateX(0); } to { transform: translateX(-40px); } }
@keyframes waveB { from { transform: translateX(-40px); } to { transform: translateX(0); } }
.fall { animation: fall .55s linear infinite; }
@keyframes fall { from { transform: translateY(0); } to { transform: translateY(240px); } }
.bob { animation: bob 3.2s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-2px) rotate(-1deg); } }
.spin { animation: spin 18s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.flap { animation: flap .26s ease-in-out infinite alternate; }
@keyframes flap { from { transform: scaleY(1); } to { transform: scaleY(-.55); } }
.swing { animation: swing .32s ease-in-out infinite alternate; }
@keyframes swing { from { transform: rotate(-40deg); } to { transform: rotate(18deg); } }
.drift { animation: drift 26s ease-in-out infinite alternate; }
.drift.slow { animation-duration: 38s; }
@keyframes drift { from { transform: translateX(-26px); } to { transform: translateX(26px); } }
.shimmer { animation: shimmer 1.8s linear infinite; }
@keyframes shimmer { to { stroke-dashoffset: -32; } }
.walk { animation: walk .3s ease-in-out infinite; }
@keyframes walk { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-1.6px); } }
.run { animation: run .16s ease-in-out infinite; }
@keyframes run { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-2.4px); } }
.stomp { animation: stomp .55s ease-in-out infinite; }
@keyframes stomp { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-1.6px); } }

/* Type */
.eyebrow { font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: .12em; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
h1 { font-family: var(--display); font-weight: 900; font-size: clamp(60px, 18vw, 96px); line-height: .84; text-transform: uppercase; margin: 2px 0 12px; color: var(--cream); }
h1 .amp { color: var(--amber); }
.lede, .situation { font-size: 17px; margin: 0 0 10px; }
h2.q { font-family: var(--display); font-weight: 800; font-size: 30px; line-height: 1; text-transform: uppercase; margin: 10px 0 12px; text-wrap: balance; }
.verse { font-family: var(--scripture); font-style: italic; font-size: 20px; line-height: 1.35; margin: 14px 0; padding: 2px 0 2px 14px; border-left: 4px solid var(--amber); color: #fff3dc; }
.verse cite { display: block; font-family: var(--display); font-style: normal; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; font-size: 12px; margin-top: 5px; color: var(--muted); }
.how { font-size: 14px; color: var(--muted); margin: 10px 0 0; }

button { font: inherit; }
.primary, .ghost { font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: 19px; border-radius: 8px; padding: 13px 20px; width: 100%; cursor: pointer; }
.primary { background: var(--amber); color: #1b1410; border: 0; box-shadow: 0 3px 0 #8a6420; }
.primary:active { transform: translateY(2px); box-shadow: 0 1px 0 #8a6420; }
.primary:focus-visible { outline-color: var(--cream); }
.primary:disabled { opacity: .4; cursor: default; box-shadow: none; transform: none; }
.ghost { background: transparent; color: var(--cream); border: 2px solid var(--line); margin-top: 10px; }

.opts { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.opt { display: flex; gap: 11px; align-items: flex-start; width: 100%; text-align: left; background: var(--panel); color: var(--cream); border: 2px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 16px; line-height: 1.32; cursor: pointer; }
.opt:hover:not(:disabled) { border-color: var(--amber); }
.opt:disabled { cursor: default; }
.opt .key { font-family: var(--display); font-weight: 900; font-size: 20px; line-height: 1; min-width: 1em; color: var(--amber); padding-top: 1px; }
.opt .tagline { display: block; font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: .1em; font-size: 12px; margin-top: 4px; }
.opt.right { background: var(--right); border-color: var(--right); }
.opt.wrong { background: var(--miss); border-color: var(--miss); }
.opt.right .key, .opt.wrong .key { color: #fff; }
.opt.dim { opacity: .45; }
.opt.sel { border-color: var(--amber); background: #4b3a20; box-shadow: inset 0 0 0 1px var(--amber); }
.opts.locked .opt { opacity: .55; }
.lock { margin-top: 12px; }

.reveal { margin-top: 16px; background: var(--panel); border: 2px solid var(--line); border-radius: 8px; padding: 14px; }
.verdict { font-family: var(--display); font-weight: 900; font-size: 30px; line-height: 1; text-transform: uppercase; margin: 0 0 8px; }
.verdict.right { color: #9fd277; }
.verdict.wrong { color: #f08a6c; }
.reveal p { margin: 0 0 10px; }
.extra { font-weight: 700; }
.crowd { margin: 12px 0 14px; display: grid; gap: 6px; }
.crowd-h { font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: .1em; font-size: 13px; margin: 0 0 2px; color: var(--muted); }
.crowd .early { font-size: 14px; color: var(--muted); margin: 0; }
.bar { display: grid; grid-template-columns: 1.3em 1fr 2.8em; gap: 8px; align-items: center; font-variant-numeric: tabular-nums; font-size: 14px; }
.bar-l { font-family: var(--display); font-weight: 900; font-size: 17px; color: var(--muted); }
.track { height: 11px; background: rgba(243,231,207,.08); border-radius: 3px; overflow: hidden; }
.fill { display: block; height: 100%; background: #6b5a45; }
.bar.is-right .fill { background: #7fae5a; }
.bar.mine .track { outline: 2px solid var(--amber); outline-offset: 1px; }
.bar.mine .bar-l { color: var(--amber); }
.pct { text-align: right; }

.score { display: flex; align-items: baseline; gap: 4px; font-family: var(--display); font-weight: 900; line-height: .8; margin: 6px 0 6px; }
.score .big { font-size: 120px; }
.score .of { font-size: 48px; color: var(--muted); }
.row-emoji { font-size: 30px; letter-spacing: 4px; margin: 4px 0 0; }
.streak { font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: .1em; font-size: 14px; color: var(--amber); margin: 10px 0 0; }
.match { background: #0e0b08; border: 2px solid var(--line); border-radius: 8px; padding: 14px; margin: 14px 0; }
.match-k { font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: .12em; font-size: 13px; margin: 0; color: var(--muted); }
.match-n { font-family: var(--display); font-weight: 900; font-size: 56px; line-height: .9; text-transform: uppercase; margin: 4px 0 8px; color: var(--amber); }
.match-l { margin: 0; }
.share-h { font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: .12em; font-size: 13px; margin: 16px 0 6px; color: var(--muted); }
.sharetext { font-family: var(--body); white-space: pre-wrap; background: var(--panel); border: 2px dashed var(--line); border-radius: 8px; padding: 12px; font-size: 16px; margin: 0 0 10px; color: var(--cream); -webkit-user-select: all; user-select: all; }
.status { display: block; min-height: 1.4em; font-size: 14px; color: var(--muted); margin-top: 6px; }
.next { margin: 18px 0 0; padding: 14px; border: 2px solid var(--line); border-radius: 8px; text-align: center; }
.next-k { font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: .12em; font-size: 13px; color: var(--muted); margin: 0; }
.next-t { font-family: var(--display); font-weight: 900; font-size: 44px; line-height: 1; margin: 6px 0 0; font-variant-numeric: tabular-nums; color: var(--cream); }
.next-d { font-size: 14px; color: var(--muted); margin: 6px 0 0; }
.testbar { margin: 8px 0 0; padding: 8px 10px; border: 1px dashed var(--amber); border-radius: 6px; font-size: 13px; color: var(--amber); }
.testbar button { background: none; border: 0; color: var(--cream); text-decoration: underline; cursor: pointer; padding: 0; }
.teaser { padding: 30px 0 10px; }
.teaser h1 { font-size: clamp(54px, 16vw, 88px); }
.foot { font-size: 12px; color: var(--muted); margin-top: 26px; border-top: 1px solid var(--line); padding-top: 10px; }

@media (prefers-reduced-motion: reduce) {
  .waveA, .waveB, .fall, .bob, .spin, .flap, .swing, .drift, .shimmer, .walk, .run, .stomp { animation: none !important; }
}
