/* Discle. One idea on every screen: a night sky, a big record as the ground, a pixel runner on its rim, and the
   controls laid over the bottom like a pixel panel. Chunky edges and stepped shadows throughout.
   --u is one runner pixel in CSS pixels and --pu one record pixel (both set from app.js to fit the screen).
   The art is about 3 CSS pixels per art pixel: finer than a chunky 8-bit look, coarser than a modern pixel illustration. */
:root {
  --u: 3px;
  --pu: 4px;
  --night: #150f2e;
  --night-ea: #150f2eea;
  --night-cc: #150f2ecc;
  --night-2: #1b1342;
  --deep: #0c0820;
  --deep-d9: #0c0820d9;
  --panel: #241c4f;
  --panel-f2: #241c4ff2;
  --panel-e6: #241c4fe6;
  --edge: #0a0618;
  --line: #4a3d86;
  --text: #f6f0e6;
  --muted: #b2a9d6;
  --gold: #ffd25e;
  --accent: #ff8a2a;
  --teal: #28c8c0;
  --pink: #ff6b9a;
  --good: #5ff0b8;
  --bad: #ff6b8a;
  --pixel: "Silkscreen", "Press Start 2P", ui-monospace, "Courier New", monospace;
  --body: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; overflow-x: hidden; overflow-x: clip; }
body { background: var(--deep); color: var(--text); font: 16px/1.45 var(--body); -webkit-text-size-adjust: 100%; }
#app { max-width: 480px; margin: 0 auto; }
h1, h2, h3, p, ul, ol { margin: 0; }
img { image-rendering: pixelated; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); font-size: 15px; }

/* ---------- the screen: sky, world, and three columns laid over it ---------- */
.screen { position: relative; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; overflow: hidden; overflow: clip; background: var(--night); box-shadow: 0 0 0 2px var(--edge); }
.sky { position: absolute; inset: 0; z-index: 0; image-rendering: pixelated; background-size: 320px 320px, 100% 100%; }
.twink { position: absolute; width: 4px; height: 4px; background: #f6f0e6; animation: twink 2.6s steps(1) infinite; }
.twink.t1 { left: 14%; top: 9%; } .twink.t2 { left: 78%; top: 6%; animation-delay: .9s; } .twink.t3 { left: 56%; top: 17%; animation-delay: 1.7s; } .twink.t4 { left: 30%; top: 26%; animation-delay: .4s; }
.cloud { position: absolute; width: 180px; height: 60px; background-size: 100% 100%; image-rendering: pixelated; opacity: .85; animation: drift 90s linear infinite; }
.cloud.c1 { top: 15%; left: -200px; }
.cloud.c2 { top: 36%; left: -200px; animation-duration: 130s; animation-delay: -60s; transform: scale(.7); }
.col { position: relative; z-index: 3; padding: 0 16px; }
.col.top { padding-top: calc(12px + env(safe-area-inset-top, 0px)); display: grid; gap: 8px; }
.col.mid { padding-top: 10px; }
.col.dock { margin-top: auto; padding-top: 12px; padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
.screen:not(.home):not(.plain) .col.dock { margin: auto 12px 16px; padding: 14px; background: var(--night-ea); border: 2px solid var(--edge); box-shadow: 0 0 0 1px var(--line), 0 3px 0 var(--edge); }
.screen.plain { background: var(--night); }

.toprow { display: flex; align-items: center; gap: 12px; }
.toprow.spread { justify-content: space-between; }
.iconbtn { width: 48px; height: 48px; display: grid; place-items: center; padding: 0; border: 2px solid var(--edge); border-radius: 0; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line), 0 3px 0 var(--edge); cursor: pointer; flex: none; }
.iconbtn img { width: 36px; height: 36px; display: block; }
.iconbtn:active { transform: translateY(2px); box-shadow: inset 0 0 0 1px var(--line), 0 1px 0 var(--edge); }
.iconbtn:focus-visible, .btn:focus-visible, input:focus-visible, .tab:focus-visible, .modebtn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.pips { flex: 1; display: flex; gap: 4px; }
.pip { flex: 1; height: 8px; background: var(--panel); box-shadow: inset 0 0 0 2px var(--edge); }
.pip.done { background: var(--accent); }
.pip.now { background: var(--text); }
.meta { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.tag { font: 700 11px var(--pixel); letter-spacing: .14em; text-transform: uppercase; color: var(--text); text-shadow: 0 2px 0 var(--edge); }
.tag.grow { flex: 1; }
.metar { display: flex; align-items: center; gap: 12px; }
.sndbtn { position: relative; width: 40px; height: 36px; display: grid; place-items: center; padding: 0; border: 2px solid var(--edge); border-radius: 0; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line), 0 2px 0 var(--edge); cursor: pointer; }
.sndbtn::after { content: ''; position: absolute; inset: -6px; }
.sndbtn img { width: 24px; height: 24px; display: block; }
.sndbtn:active { transform: translateY(2px); box-shadow: inset 0 0 0 1px var(--line); }
.sndbtn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.tgroup { display: flex; gap: 8px; }
.score { font: 700 20px var(--mono); text-shadow: 0 2px 0 var(--edge); }
.score small { color: var(--muted); font-size: 12px; }

/* the countdown: just the number, in a circle */
.clock { flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: #0f0a26; border: 4px solid var(--gold); box-shadow: 0 0 0 3px var(--edge), 0 4px 0 3px var(--edge); font: 700 22px var(--pixel); font-variant-numeric: tabular-nums; }
.clock.low { border-color: var(--bad); color: var(--bad); animation: pulse .6s steps(2) infinite; }

/* ---------- buttons and inputs: chunky, with a stepped drop edge ---------- */
.btn {
  min-height: 50px; padding: 0 16px; border: 2px solid var(--edge); border-radius: 0;
  background: var(--panel); color: var(--text); box-shadow: inset 0 0 0 1px var(--line), 0 3px 0 var(--edge);
  font: 700 13px var(--pixel); letter-spacing: .08em; text-transform: uppercase; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
}
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 0 0 1px var(--line), 0 1px 0 var(--edge); }
.btn.primary { background: var(--accent); color: #1a0d00; box-shadow: inset 0 0 0 2px #ffb36a, 0 3px 0 var(--edge); }
.btn.ghost { background: var(--night-cc); }
.btn.locked { background: var(--night-cc); border-style: dashed; border-color: var(--gold); color: var(--gold); box-shadow: 0 3px 0 var(--edge); }
.btn.small { min-height: 38px; padding: 0 12px; font-size: 11px; }
.btn.wide { width: 100%; margin-top: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 12px; margin-top: 12px; }
.row .btn { flex: 1; padding: 0 8px; font-size: 11px; }

input[type=text], input[type=email] {
  flex: 1; min-width: 0; height: 50px; padding: 0 12px; border: 2px solid var(--edge); border-radius: 0;
  background: #0f0a26; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); font: 600 17px var(--body);
}
input[type=text]::placeholder, input[type=email]::placeholder { color: var(--muted); font-weight: 400; }
input[type=text]:focus, input[type=email]:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.guess { display: flex; gap: 10px; }
.btn.go { flex: none; width: 58px; min-height: 50px; padding: 0 0 4px; font: 700 28px/1 var(--pixel); letter-spacing: 0; }
.panel { display: grid; gap: 12px; }
.note { margin-top: 8px; font-size: 14px; color: var(--muted); min-height: 1.4em; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.chips:empty { display: none; }
.chip { padding: 2px 8px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font-size: 13px; text-decoration: line-through; }
.chip.try { text-decoration: none; color: var(--text); cursor: pointer; border: 0; font: 600 13px var(--body); box-shadow: inset 0 0 0 2px var(--gold); }
.shake { animation: shake .38s; }

/* ---------- the world: a big record is the ground, the runner jogs along its rim ---------- */
.runzone { position: relative; z-index: 1; flex: none; height: calc(60 * var(--u)); margin-top: 14px; cursor: pointer; image-rendering: pixelated; }
.ridge { position: absolute; left: 0; right: 0; top: calc(60 * var(--u) - 52px); height: 640px; background-repeat: repeat-x, no-repeat; background-position: 0 0, 0 71px; background-size: 320px 72px, 100% 100%; image-rendering: pixelated; pointer-events: none; }
.planet { position: absolute; left: 50%; top: calc(60 * var(--u) - 18 * var(--pu)); width: calc(144 * var(--pu)); height: calc(144 * var(--pu)); margin-left: calc(-72 * var(--pu)); transform-origin: 50% 50%; will-change: transform; }
.planet img { display: block; width: 100%; height: 100%; }
.runner { position: absolute; left: 50%; top: calc(21 * var(--u) - var(--pu) / 2); width: calc(32 * var(--u)); height: calc(40 * var(--u)); margin-left: calc(-16 * var(--u)); transform-origin: 50% 55%; }
.fig { width: 100%; height: 100%; background-repeat: no-repeat; background-size: calc(256 * var(--u)) calc(40 * var(--u)); background-position: calc(var(--f, 0) * -32 * var(--u)) 0; image-rendering: pixelated; }
.fig.idle { animation: bob 1.2s steps(1) infinite; }
.hud { position: absolute; left: 16px; top: 6px; font: 700 11px var(--pixel); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); text-shadow: 0 2px 0 var(--edge); }
.fx { position: absolute; inset: 0; pointer-events: none; }
/* spin: drag or flick the record, tap it for a spin, tap the runner for a flip */
.runzone.spin { cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.runzone.spin.pany { touch-action: pan-y; }
.runzone.spin img { -webkit-user-drag: none; user-drag: none; }
.runzone.spin.drag { cursor: grabbing; }
.spinhint { position: absolute; right: 16px; top: 6px; padding: 2px 6px; background: var(--deep-d9); font: 700 11px var(--pixel); letter-spacing: .12em; text-transform: uppercase; color: var(--text); text-shadow: 0 2px 0 var(--edge); pointer-events: none; animation: hintbob 1.4s steps(2) infinite; transition: opacity .3s; }
.spinhint.gone { opacity: 0; animation: none; }
@keyframes hintbob { 50% { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .spinhint { animation: none; } }
.pop { position: absolute; left: 0; right: 0; top: calc(3 * var(--u)); text-align: center; font: 700 28px var(--pixel); color: var(--text); text-shadow: 3px 0 0 var(--edge), -3px 0 0 var(--edge), 0 3px 0 var(--edge), 0 -3px 0 var(--edge); animation: pop 1.4s steps(14) forwards; }
.pop.t0 { font-size: 22px; } .pop.t1 { font-size: 27px; } .pop.t2 { font-size: 32px; } .pop.t3 { font-size: 38px; }
.pop.t4 { font-size: 44px; animation: pop 1.4s steps(14) forwards, glow .6s steps(3) infinite; }
.pop.miss { color: var(--bad); }
.pop.lap { left: 0; right: 0; top: calc(-2 * var(--u)); color: var(--good); font-size: 18px; animation-name: poplap; }
.spark { position: absolute; left: 50%; top: calc(38 * var(--u)); width: 6px; height: 6px; margin-left: -3px; animation: spark .9s steps(9) forwards; }
.screen.compact .hud { display: none; }
.prop { position: absolute; z-index: 2; pointer-events: none; image-rendering: pixelated; }
.prop img { display: block; width: 100%; height: 100%; }
.prop .nt { position: absolute; top: -6px; width: 16px; height: 20px; background-size: 100% 100%; image-rendering: pixelated; opacity: 0; animation: noteup 2.6s steps(13) infinite; }
.prop .nt.n1 { left: 28%; } .prop .nt.n2 { left: 58%; animation-delay: 1.3s; }
.prop.jam img { animation: hop .45s steps(4) 3; }
.prop.jam .nt { animation-duration: .8s; }

/* ---------- prompts ---------- */
.promptcard { padding: 16px; background: var(--panel-f2); border: 2px solid var(--edge); box-shadow: 0 0 0 1px var(--line), 0 3px 0 var(--edge); font: 700 16px/1.5 var(--pixel); letter-spacing: .04em; text-transform: uppercase; text-wrap: balance; }
.qcard { padding: 14px 14px 16px; background: var(--panel-f2); border: 2px solid var(--edge); box-shadow: 0 0 0 1px var(--line), 0 3px 0 var(--edge); display: grid; gap: 10px; }
.qtag { justify-self: start; padding: 3px 8px; background: var(--edge); font: 700 10px var(--pixel); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.qtext { font: 700 20px/1.35 var(--body); text-wrap: balance; }
.coverwrap { display: flex; justify-content: center; }
.cover { position: relative; width: min(60vw, 36vh, 260px); width: min(60vw, 36dvh, 260px); aspect-ratio: 1; overflow: hidden; background: #000; border: 2px solid var(--edge); box-shadow: 0 0 0 2px var(--line), 0 6px 0 var(--edge); }
.cover-in { width: 100%; height: 100%; transition: transform .9s cubic-bezier(.2, .8, .2, 1); }
.cover-in svg, .cover-in img { display: block; width: 100%; height: 100%; object-fit: cover; image-rendering: auto; }
.stagebar { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.dots { display: flex; gap: 5px; }
.dots i { width: 26px; height: 8px; background: var(--panel); box-shadow: inset 0 0 0 2px var(--edge); }
.dots i.on { background: var(--gold); }
.worth { font: 700 14px var(--mono); color: var(--gold); text-shadow: 0 2px 0 var(--edge); }

input[type=text].yval { text-align: center; font: 700 30px/1 var(--pixel); padding: 0; height: 56px; min-width: 0; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.guess:has(.yval) .btn.go { min-height: 56px; }

/* ---------- reveal (lives in the dock) ---------- */
.reveal { position: relative; display: grid; gap: 8px; animation: rvin .3s steps(6); }
.reveal .answer { font-size: 22px; }
.reveal .sub, .reveal .clue { font-size: 14px; color: var(--muted); }
.reveal::before { content: ''; position: absolute; left: -14px; right: -14px; top: -14px; height: 5px; background: var(--tc); }
.pts { font: 700 44px/1 var(--pixel); color: var(--tc, var(--text)); text-shadow: 3px 0 0 var(--edge), -3px 0 0 var(--edge), 0 3px 0 var(--edge), 0 -3px 0 var(--edge); }
.reveal.t4 .pts { animation: glow .6s steps(3) infinite; }
.answer { font: 700 18px/1.3 var(--pixel); letter-spacing: .05em; text-transform: uppercase; overflow-wrap: anywhere; }
.sub { color: var(--muted); font-size: 15px; }
.clue { font-size: 15px; }
.credit { font-size: 13px; color: var(--muted); }
.reveal .btn { margin-top: 8px; }
/* short phones: tighten the reveal card so Next stays on screen; the tier name is already on the badge */
@media (max-height: 700px) {
  .reveal { gap: 3px; }
  .pts { font-size: 34px; }
  .reveal .btn { margin-top: 4px; }
  .home .tagline.sm { display: none; }
}
.ladder { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.ladder li { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; padding: 5px 8px; color: var(--muted); background: var(--night); box-shadow: inset 3px 0 0 var(--tc); }
.ladder li.hit { color: var(--text); background: #2a1f58; box-shadow: inset 3px 0 0 var(--tc), inset 0 0 0 2px var(--tc); }
.ladder em { display: block; font: 700 11px var(--pixel); font-style: normal; letter-spacing: .08em; text-transform: uppercase; color: var(--tc); }
.ladder b { font: 700 15px var(--pixel); color: var(--tc); }
.ladder .none { opacity: .55; }

/* ---------- home ---------- */
.screen.home .col.mid { text-align: center; padding-top: 6px; }
.logo { margin: 8px 0 2px; }
.logo img { width: 279px; max-width: 80%; }
.themeseg { display: inline-flex; gap: 3px; margin-top: 8px; padding: 3px; background: var(--night-ea); border: 2px solid var(--edge); box-shadow: 0 0 0 1px var(--line), 0 3px 0 var(--edge); }
.ts-b { appearance: none; border: 0; border-radius: 0; min-height: 38px; padding: 8px 16px; background: transparent; color: var(--muted); font: 700 12px var(--pixel); letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }
.ts-b.on { background: var(--accent); color: #1a0d00; box-shadow: inset 0 0 0 2px #fff6; cursor: default; }
.ts-b:not(.on):hover { color: var(--text); background: var(--panel); }
.ts-b:not(.on):active { transform: translateY(1px); }
.ts-b:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }
.tagline { color: var(--text); font: 700 12px var(--pixel); letter-spacing: .16em; text-transform: uppercase; text-shadow: 0 2px 0 var(--edge); }
.tagline.sm { margin-top: 6px; color: var(--muted); font: 500 14px var(--body); letter-spacing: 0; text-transform: none; }
.tierchips { display: grid; grid-template-columns: repeat(3, max-content); justify-content: center; gap: 6px; margin-top: 12px; }
.tierchip { padding: 3px 7px; color: #1a0d00; font: 700 10px var(--pixel); letter-spacing: .08em; text-transform: uppercase; box-shadow: inset 0 0 0 2px #0003, 0 2px 0 var(--edge); }
.modebtns { display: grid; gap: 12px; }
.modebtn { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 64px; padding: 8px 14px; border: 2px solid var(--edge); border-radius: 0; color: #1a0d00; text-align: left; cursor: pointer; box-shadow: inset 0 0 0 2px #fff6, 0 3px 0 var(--edge); }
.modebtn[data-mode=rarity] { background: var(--accent); }
.modebtn[data-mode=cover] { background: var(--teal); }
.modebtn[data-mode=year] { background: var(--pink); }
.modebtn:active { transform: translateY(3px); box-shadow: inset 0 0 0 2px #fff6, 0 1px 0 var(--edge); }
.modebtn.done { filter: saturate(.55) brightness(.85); }
.mb-text { display: grid; gap: 2px; }
.mb-name { font: 700 16px var(--pixel); letter-spacing: .08em; text-transform: uppercase; }
.mb-sub { font: 600 12px var(--body); opacity: .85; }
.mb-go { font: 700 22px var(--pixel); }
.mb-go small { font-size: 12px; }
.today { width: max-content; max-width: 100%; margin: 12px auto 10px; padding: 4px 10px; background: var(--deep-d9); text-align: center; font: 700 11px var(--pixel); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); text-shadow: 0 2px 0 var(--edge); }
.smallrow { display: flex; justify-content: center; gap: 10px; }
.foot { width: max-content; max-width: 100%; margin: 12px auto 0; padding: 4px 10px; background: var(--deep-d9); font-size: 12px; color: var(--muted); text-align: center; }

/* ---------- final ---------- */
.screen.compact .col.mid { text-align: center; }
.bigscore { font: 700 64px/1 var(--pixel); margin-top: 4px; font-variant-numeric: tabular-nums; text-shadow: 0 3px 0 var(--edge); }
.bigscore small { font-size: 20px; color: var(--muted); margin-left: 8px; }
.rank { font: 700 14px/1.35 var(--pixel); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 8px auto; max-width: 30ch; text-wrap: balance; text-shadow: 0 2px 0 var(--edge); }
.emojis { display: flex; justify-content: center; gap: 7px; margin: 2px 0 8px; }
.etile { display: grid; place-items: center; font-style: normal; font-size: 17px; line-height: 1; width: 30px; height: 30px; background: var(--tc); box-shadow: 0 0 0 2px var(--edge), inset 3px 3px 0 #ffffff40, inset -3px -3px 0 #00000030; }
.laps { margin: 2px 0 4px; font-weight: 700; color: var(--good); text-shadow: 0 2px 0 var(--edge); }
.h3 { font: 700 12px var(--pixel); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin: 14px 0 6px; text-align: left; }
.rcards { display: grid; gap: 8px; margin: 4px 0 12px; text-align: left; }
.rcard { background: #0f0a26; border: 2px solid var(--edge); box-shadow: inset 0 0 0 1px var(--line); }
.rcard summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 14px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; }
.rcard .sq { width: 14px; height: 14px; background: var(--tc); box-shadow: 0 0 0 2px var(--edge); }
.rcard summary::-webkit-details-marker { display: none; }
.rcard[open] summary { border-bottom: 2px solid var(--edge); }
.tbadge { width: 36px; height: 36px; flex: none; image-rendering: pixelated; }
.tbadge.lg { width: 54px; height: 54px; }
.tbadge.none { display: grid; place-items: center; font: 700 24px var(--pixel); color: var(--muted); }
.rmain { display: grid; gap: 2px; min-width: 0; }
.rans { font: 700 17px/1.25 var(--body); overflow-wrap: anywhere; }
.rprompt { color: var(--muted); font-size: 14px; line-height: 1.35; padding: 10px 14px 4px; }
.rtier { color: var(--tc); font: 700 11px var(--pixel); letter-spacing: .1em; text-transform: uppercase; }
.rpts { font: 700 24px var(--pixel); color: var(--tc); text-shadow: 2px 0 0 var(--edge), -2px 0 0 var(--edge), 0 2px 0 var(--edge), 0 -2px 0 var(--edge); }
.meter { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; margin-top: 6px; }
.meter i { height: 6px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--edge); }
.yfact { padding: 10px 14px 12px 16px; font-size: 15px; }
.yfact b { color: var(--tc); }
.rcard .ladder { padding: 8px; }
.share { margin: 0 0 10px; padding: 12px; background: #0f0a26; box-shadow: inset 0 0 0 1px var(--line); font: 600 15px/1.5 var(--body); white-space: pre-wrap; user-select: all; }
.next { margin: 12px 0 2px; color: var(--muted); text-align: center; }
.next .mono { color: var(--text); font-weight: 700; }
.unlock { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; margin: 0 0 10px; padding: 10px; background: #3a2a10; border: 2px solid var(--edge); box-shadow: 0 0 0 2px var(--gold); }
.unlock img { width: 64px; height: 64px; }
.unlock img.cthumb { height: 56px; }
.unlock b { display: block; font: 700 11px var(--pixel); letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.unlock span { font-size: 16px; font-weight: 700; }
.unmore { margin: 0 0 10px; }
.unmore summary { display: flex; align-items: center; justify-content: center; min-height: 44px; list-style: none; cursor: pointer; background: #2a1e0c; border: 2px dashed var(--gold); color: var(--gold); font: 700 11px var(--pixel); letter-spacing: .1em; text-transform: uppercase; }
.unmore summary::-webkit-details-marker { display: none; }
.unmore[open] summary { margin-bottom: 10px; }

/* ---------- wardrobe and lab ---------- */
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tab { min-height: 42px; border: 2px solid var(--edge); border-radius: 0; background: var(--panel-e6); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); font: 700 10px var(--pixel); letter-spacing: .03em; padding: 0 2px; text-transform: uppercase; cursor: pointer; }
.tab[aria-selected=true] { background: var(--accent); color: #1a0d00; box-shadow: inset 0 0 0 2px #ffb36a; }
.count { margin-bottom: 4px; }
.skins { list-style: none; padding: 0; margin-top: 10px; display: grid; gap: 10px; }
.skin { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 10px; background: var(--panel); border: 2px solid var(--edge); box-shadow: 0 0 0 2px var(--line); }
.skin img { width: 64px; height: 64px; }
.skin.off img { filter: grayscale(1) brightness(.55); }
.s-text { display: grid; gap: 2px; min-width: 0; }
.s-text b { font: 700 13px var(--pixel); letter-spacing: .06em; text-transform: uppercase; }
.s-text span { font-size: 14px; color: var(--muted); }
.s-text .pn { font: 700 12px var(--mono); }
.prog { height: 8px; background: #0f0a26; box-shadow: inset 0 0 0 2px var(--edge); margin-top: 4px; }
.prog i { display: block; height: 100%; background: var(--good); }
.rthumb { display: block; justify-self: center; width: calc(32 * 2px); height: calc(40 * 2px); background-repeat: no-repeat; background-size: calc(256 * 2px) calc(40 * 2px); background-position: 0 0; image-rendering: pixelated; }
.gthumb { display: grid; place-items: center; width: 64px; height: 80px; justify-self: center; }
.gthumb img { image-rendering: pixelated; max-width: 64px; max-height: 80px; }
.skin.off .gthumb { filter: grayscale(1) brightness(.55); }
.skin.off .rthumb { filter: grayscale(1) brightness(.55); }
.lab { display: grid; gap: 12px; }
.pick { position: relative; cursor: crosshair; width: 100%; }
.pick img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: auto; }
.aim { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border: 3px solid var(--gold); box-shadow: 0 0 0 2px #000a; pointer-events: none; }

/* ---------- Answer Book ---------- */
.book .col.mid { display: grid; gap: 12px; padding-bottom: 40px; align-content: start; }
.book .promptcard { margin: 0; }
.bres { display: grid; gap: 10px; }
.bres:empty { display: none; }
.bhit { display: grid; gap: 6px; padding: 10px; background: var(--panel); border: 2px solid var(--edge); box-shadow: inset 0 0 0 1px var(--line), 0 3px 0 var(--edge); }
.bhero { display: grid; gap: 8px; padding: 12px; background: var(--panel); border: 2px solid var(--edge); box-shadow: inset 0 0 0 1px var(--line), 0 3px 0 var(--edge); }
.bh-s { font: 700 12px var(--pixel); letter-spacing: .08em; text-transform: uppercase; }
.bh-s b { color: var(--gold); font-size: 15px; }
.bh-d { color: var(--muted); font-size: 14px; }
.bh-lad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.bh-cell { display: grid; justify-items: center; gap: 2px; padding: 8px 4px 6px; background: #0f0a26; box-shadow: inset 0 -3px 0 var(--tc), inset 0 0 0 1px var(--line); text-align: center; }
.bh-cell b { font: 700 9px/1.2 var(--pixel); letter-spacing: .06em; text-transform: uppercase; color: var(--tc); }
.bh-cell small { font: 700 12px var(--mono); }
.bn { font: 700 18px/1.3 var(--body); overflow-wrap: anywhere; }
.bhit { display: grid; gap: 6px; padding: 10px; background: var(--panel); border: 2px solid var(--edge); box-shadow: inset 0 0 0 1px var(--line), 0 3px 0 var(--edge); }
.bline { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; min-height: 50px; padding: 5px 10px; border: 0; background: #0f0a26; box-shadow: inset 3px 0 0 var(--tc), inset 0 0 0 1px var(--line); color: var(--text); text-align: left; cursor: pointer; }
.bline:active { background: var(--night-2); }
.bl-t { display: grid; gap: 1px; min-width: 0; }
.bl-p { font: 500 14px/1.3 var(--body); }
.bl-n { font: 700 10px var(--pixel); letter-spacing: .08em; text-transform: uppercase; color: var(--tc); }
.bl-pts { font: 700 17px var(--pixel); color: var(--tc); }
.bcat { margin: 0 0 8px; background: var(--panel); border: 2px solid var(--edge); box-shadow: inset 0 0 0 1px var(--line); }
.bcat summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 14px; list-style: none; cursor: pointer; font: 700 12px var(--pixel); letter-spacing: .1em; text-transform: uppercase; }
.bcat summary::-webkit-details-marker { display: none; }
.bcat summary b { font: 700 13px var(--mono); color: var(--muted); }
.bcat[open] summary { border-bottom: 2px solid var(--edge); }
.bprompts { list-style: none; margin: 0; padding: 6px; display: grid; gap: 4px; }
.bprompt { width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; border: 0; background: #0f0a26; color: var(--text); text-align: left; font: 500 15px/1.3 var(--body); cursor: pointer; }
.bprompt:disabled { color: var(--muted); cursor: default; }
.bprompt em { flex: none; font: 700 10px var(--pixel); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); font-style: normal; }
.tfilter { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.tfilter::-webkit-scrollbar { display: none; }
.tf { flex: none; display: flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 10px 0 6px; border: 2px solid var(--edge); border-radius: 0; background: var(--night); color: var(--text); box-shadow: inset 0 -3px 0 var(--tc, var(--line)), inset 0 0 0 1px var(--line); cursor: pointer; font: 700 12px var(--mono); }
.tf img { width: 30px; height: 30px; }
.tf span { padding-left: 6px; font: 700 10px var(--pixel); letter-spacing: .08em; text-transform: uppercase; }
.tf.on { background: var(--tc, var(--accent)); color: #1a0d00; box-shadow: inset 0 0 0 2px #fff7; }
.tf:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.pcheck { display: grid; grid-template-columns: 54px 1fr auto; gap: 10px; align-items: center; padding: 10px; background: #0f0a26; border: 2px solid var(--tc, var(--line)); box-shadow: inset 4px 0 0 var(--tc, var(--line)); }
.pcheck.miss { --tc: var(--bad); }
.pc-t { display: grid; gap: 2px; min-width: 0; }
.pc-t b { font: 700 17px/1.3 var(--body); overflow-wrap: anywhere; }
.pc-t span { font-size: 13px; color: var(--muted); }
.pcheck.hit .pc-t span { color: var(--tc); font: 700 11px var(--pixel); letter-spacing: .08em; text-transform: uppercase; }
.pc-pts { font: 700 22px var(--pixel); color: var(--tc); text-shadow: 2px 0 0 var(--edge), -2px 0 0 var(--edge), 0 2px 0 var(--edge), 0 -2px 0 var(--edge); }
.btier { margin-top: 14px; padding: 0 10px 10px; background: var(--night); border: 2px solid var(--edge); box-shadow: inset 0 4px 0 var(--tc), 0 0 0 1px var(--line); }
.bth { display: grid; grid-template-columns: 54px 1fr auto 16px; gap: 10px; align-items: center; margin: 0; padding: 14px 0 8px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.bth:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.bt-chev { width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 8px solid var(--tc); justify-self: center; transition: transform .15s steps(3); }
.btier.shut .bt-chev { transform: rotate(-90deg); }
.btier.shut { padding-bottom: 0; }
.btier.shut .bth { padding-bottom: 14px; }
.btier.shut .bans, .btier.shut .more { display: none; }
@media (prefers-reduced-motion: reduce) { .bt-chev { transition: none; } }
.bt-text { display: grid; gap: 2px; min-width: 0; }
.bt-name { font: 700 14px var(--pixel); letter-spacing: .08em; text-transform: uppercase; color: var(--tc); }
.bt-say { font-size: 12px; line-height: 1.3; color: var(--muted); }
.bt-pts { text-align: right; font: 700 22px var(--pixel); color: var(--tc); text-shadow: 2px 0 0 var(--edge), -2px 0 0 var(--edge), 0 2px 0 var(--edge), 0 -2px 0 var(--edge); }
.bt-pts small { display: block; font: 600 11px var(--body); color: var(--muted); text-shadow: none; }
.bans { list-style: none; margin: 6px 0 8px; padding: 0; display: block; }
.bans li { display: flex; align-items: center; min-height: 34px; padding: 6px 10px 6px 14px; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; background: transparent; border-top: 1px solid #ffffff14; box-shadow: inset 3px 0 0 var(--tc); }
.bans li:first-child { border-top: 0; }
.bans li:nth-child(even) { background: #ffffff08; }
.bans li.hl { background: #3a2a10; color: var(--gold); box-shadow: inset 0 0 0 2px var(--gold); }
.btier .more { margin: 2px 0 0; }

/* ---------- Shelf ---------- */
.shelfscr .col.mid { display: grid; gap: 14px; padding-bottom: 36px; align-content: start; }
.shelfhead { display: flex; align-items: center; gap: 14px; }
.shelfhead p { color: var(--muted); font-size: 14px; }
.sh-n { flex: none; white-space: nowrap; font: 700 32px/1 var(--pixel); color: var(--gold); text-shadow: 0 3px 0 var(--edge); }
.sh-n small { font-size: 14px; color: var(--muted); }
.shelf { display: grid; gap: 14px; }
.srow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 0 6px; background: linear-gradient(#0000 60%, #0004); border-bottom: 10px solid #7a5334; box-shadow: 0 3px 0 var(--edge), inset 0 -2px 0 #9a6c44; }
.slot { position: relative; display: grid; justify-items: center; align-content: end; gap: 2px; min-height: 120px; padding: 12px 2px 6px; border: 0; background: none; color: var(--text); cursor: pointer; }
.slot img { width: min(96px, 100%); height: auto; aspect-ratio: 32 / 28; }
.slot.off img { filter: brightness(0) opacity(.5); }
.slot:active img { transform: translateY(2px); }
.slot:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }
.sn { font: 700 10px/1.25 var(--pixel); letter-spacing: .04em; text-transform: uppercase; text-align: center; }
.se { font: 600 11px var(--mono); color: var(--muted); }
.slot.on { box-shadow: inset 0 0 0 2px var(--gold); }
.onflag { position: absolute; top: 4px; right: 4px; padding: 1px 4px; background: var(--gold); color: #1a0d00; font: 700 9px var(--pixel); font-style: normal; }
.itemhero { display: grid; place-items: center; padding: 14px; background: var(--night); box-shadow: inset 0 0 0 1px var(--line); }
.itemhero img { width: 128px; height: 112px; }
.itemhero.off img { filter: brightness(0) opacity(.5); }
.era { font: 700 12px var(--pixel); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: -6px; }
.fact { font-size: 16px; }
.ladfoot { padding: 0 8px 10px; }

/* ---------- dialogs ---------- */
#dlg { position: fixed; inset: 0; z-index: 10; display: grid; place-items: end center; }
.veil { position: absolute; inset: 0; background: #05030fcc; }
.sheet { position: relative; width: min(480px, 100%); max-height: 92vh; overflow: auto; padding: 20px 16px 22px; background: var(--panel); border: 2px solid var(--edge); box-shadow: 0 0 0 2px var(--gold); display: grid; gap: 10px; }
.sheet h2 { font: 700 20px var(--pixel); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.price { font: 700 34px/1 var(--pixel); }
.price small { font-size: 12px; color: var(--muted); }
.perks { padding-left: 20px; display: grid; gap: 4px; }
.demo { font-size: 13px; color: var(--muted); padding: 8px 10px; box-shadow: inset 0 0 0 1px var(--line); }
.sheet .btn.wide { margin-top: 4px; }

/* ---------- motion ---------- */
@keyframes bob { 50% { transform: translateY(calc(-2 * var(--u))); } }
@keyframes pop { 0% { opacity: 0; transform: translateY(8px); } 12% { opacity: 1; transform: translateY(0); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-26px); } }
@keyframes poplap { 0% { opacity: 0; transform: translateY(8px); } 12% { opacity: 1; transform: translateY(0); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
@keyframes spark { to { transform: translate(var(--dx), var(--dy)); opacity: 0; } }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
@keyframes twink { 0%, 100% { opacity: 1; } 50% { opacity: .15; } }
@keyframes drift { to { transform: translateX(calc(480px + 400px)); } }
@keyframes glow { 0% { text-shadow: 3px 0 0 #0a0618, -3px 0 0 #0a0618, 0 3px 0 #0a0618, 0 -3px 0 #0a0618, 0 0 14px #ff5fa0, 0 0 4px #ff5fa0; } 34% { text-shadow: 3px 0 0 #0a0618, -3px 0 0 #0a0618, 0 3px 0 #0a0618, 0 -3px 0 #0a0618, 0 0 14px #4fd8ea, 0 0 4px #4fd8ea; } 67% { text-shadow: 3px 0 0 #0a0618, -3px 0 0 #0a0618, 0 3px 0 #0a0618, 0 -3px 0 #0a0618, 0 0 14px #ffd25e, 0 0 4px #ffd25e; } }
@keyframes noteup { 0% { opacity: 0; transform: translate(0, 0); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(14px, -38px); } }
@keyframes hop { 50% { transform: translateY(-9px); } }
@keyframes rvin { 0% { opacity: 0; transform: translateY(10px); } 100% { opacity: 1; transform: none; } }
@keyframes pulse { 50% { transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) {
  .shake, .fig.idle, .pop, .pop.lap, .pop.t4, .reveal, .reveal.t4 .pts, .twink, .cloud, .clock.low { animation: none; }
  .prop .nt { display: none; } .prop.jam img { animation: none; }
  .spark { display: none; }
  .cover-in { transition: none; }
  .cloud.c1 { left: 20%; } .cloud.c2 { left: 55%; }
}
@media (max-width: 380px) {
  .bigscore { font-size: 52px; }
  .mb-name { font-size: 14px; }
}

/* ---------- How to play sheet ---------- */
.howmode { display: grid; gap: 4px; }
.howmode b { font: 700 14px var(--pixel); letter-spacing: .08em; text-transform: uppercase; }
.howmode p, .howfoot { color: var(--muted); font-size: 14px; line-height: 1.45; }
.howscale { display: grid; gap: 6px; }
.howscale b { font: 700 12px var(--pixel); letter-spacing: .1em; text-transform: uppercase; }
.howscale .tierchips { margin-top: 0; justify-content: start; }
.note:empty { min-height: 0; margin: 0; }

.thumbbtn { display: grid; place-items: center; width: 64px; padding: 0; background: none; border: 0; cursor: pointer; color: inherit; }
.thumbbtn:active { transform: translateY(2px); }
.thumbbtn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* The film & series version: the same screens in a cinema palette (velvet red, gold, warm ink). Switched from the menu. */
:root[data-theme="film"] {
  --night: #1a0a10; --night-ea: #1a0a10ea; --night-cc: #1a0a10cc; --night-2: #2a1018; --deep: #0e0508; --deep-d9: #0e0508d9;
  --panel: #3a1620; --panel-f2: #3a1620f2; --panel-e6: #3a1620e6; --edge: #0a0305; --line: #7a3248;
  --text: #fbf1e2; --muted: #d9bba8; --gold: #ffd25e; --accent: #f2a93b;
}
.themebtn { display: grid; gap: 2px; text-align: left; padding: 12px 14px; border-color: var(--gold); }
.themebtn .tb-t { font: 700 13px var(--pixel); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.themebtn .tb-s { font-size: 13px; color: var(--muted); font-weight: 400; }

/* ---------- fun fact under a hidden answer ---------- */
.fun { margin: 10px 0 0; padding: 8px 10px; text-align: left; font-size: 13px; line-height: 1.4; color: var(--text); background: #ffffff0d; border-left: 4px solid var(--tc, var(--accent)); }
.fun b { display: block; margin-bottom: 2px; font: 700 10px var(--pixel); letter-spacing: .08em; text-transform: uppercase; color: var(--tc, var(--accent)); }
.bans li.hasnote { display: block; }
.bans li .ln { display: block; }
.bans li .lf { display: block; margin-top: 3px; font-size: 12px; line-height: 1.35; color: var(--muted); }
.bans li.hasnote.hl .lf { color: #e8cf9a; }

/* ---------- account ---------- */
.linkbtn { display: block; margin: 8px auto 0; min-height: 36px; padding: 0 8px; background: none; border: 0; color: var(--muted); font: 600 13px var(--body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkbtn:hover, .linkbtn:focus-visible { color: var(--text); }
a.btn { text-decoration: none; display: flex; align-items: center; justify-content: center; }
.sheet form { display: grid; gap: 10px; }
.sheet .howfoot a { color: var(--gold); }
