*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: var(--fs-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select { font: inherit; color: inherit; }
img, svg { display: block; }
:focus-visible { outline: 2.5px solid var(--honey); outline-offset: 3px; }

#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; z-index: 0; touch-action: none; cursor: grab; }
body.explore #scene:active { cursor: grabbing; }
#fallback-bg {
  position: fixed; inset: 0; z-index: 0;
  background: radial-gradient(ellipse at 50% 70%, rgba(224, 169, 59, 0.18), transparent 55%), linear-gradient(180deg, #0b1412 0%, #172521 60%, #0d1513 100%);
}
/* Pre-rendered exterior stills (Blender) with drift, rain and lightning */
#backdrop { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity 900ms var(--ease-in-out); background: #050807; overflow: hidden; }
#backdrop.on { opacity: 1; }
#backdrop .bd { position: absolute; inset: -4%; background-size: cover; background-position: center; opacity: 0; transition: opacity 1400ms var(--ease-in-out); }
#backdrop .bd.show { opacity: 1; }
#backdrop .bd.drift { animation: drift 26s ease-out both; }
@keyframes drift { from { transform: scale(1.0) translate3d(0, 0, 0); } to { transform: scale(1.06) translate3d(-1.2%, -0.6%, 0); } }
#backdrop canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#backdrop .bd-flash { position: absolute; inset: 0; background: #dfe8ff; opacity: 0; mix-blend-mode: screen; }
#backdrop.lightning .bd-flash { animation: bdflash 1.1s ease-out both; }
@keyframes bdflash { 0% { opacity: calc(var(--flash, 0.6) * 0.9); } 12% { opacity: 0.05; } 22% { opacity: calc(var(--flash, 0.6) * 0.6); } 100% { opacity: 0; } }

.vignette { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse at 50% 45%, transparent 50%, rgba(0, 0, 0, 0.5) 100%); transition: opacity var(--dur-2); }

/* ---------- Panorama hotspots & explore mode ---------- */
#hotspots { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
#hotspots[hidden] { display: none; }
.hotspot {
  position: absolute; left: 0; top: 0; margin: -22px 0 0 -22px; width: 44px; height: 44px;
  border: none; background: none; cursor: pointer; pointer-events: auto; padding: 0; opacity: 0; transition: opacity var(--dur-2);
}
body.explore .hotspot, .hotspot.active { opacity: 1; }
.hotspot .ring {
  position: absolute; inset: 11px; border-radius: 50%;
  border: 2px solid var(--on-scene); background: rgba(110, 143, 123, 0.45);
  animation: spot 2.2s ease-out infinite;
}
.hotspot.active .ring { border-color: var(--honey); background: rgba(224, 169, 59, 0.55); }
.hotspot .label {
  position: absolute; left: 50%; top: 46px; transform: translateX(-50%); white-space: nowrap;
  font-size: var(--fs-xs); font-weight: 700; color: var(--text);
  background: var(--surface-solid); padding: 3px 10px; border-radius: var(--r-sm); box-shadow: var(--shadow-soft);
  opacity: 0; transition: opacity var(--dur-1);
}
.hotspot:hover .label, .hotspot:focus-visible .label, .hotspot.active .label, body.explore .hotspot .label { opacity: 1; }
@keyframes spot { 0% { box-shadow: 0 0 0 0 rgba(224, 169, 59, 0.55); } 100% { box-shadow: 0 0 0 18px rgba(224, 169, 59, 0); } }
body.explore #app { opacity: 0; pointer-events: none; transition: opacity var(--dur-2); }
body.explore .vignette { opacity: 0.5; }
body.lock-mode #hotspots, body.lock-mode #explore-hint { display: none; }
#explore-hint {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 15;
  padding: 10px 18px; border-radius: var(--r-md); background: var(--surface-solid); box-shadow: var(--shadow-soft);
  font-size: var(--fs-sm); font-weight: 600; color: var(--text); opacity: 0; pointer-events: none; transition: opacity var(--dur-2);
}
body.explore #explore-hint { opacity: 1; }

/* ---------- HUD ---------- */
#hud {
  position: fixed; top: 12px; left: 12px; right: 12px; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  pointer-events: none;
}
#hud[hidden] { display: none; }
#hud > * { pointer-events: auto; }
.brand {
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-sm); letter-spacing: -0.01em;
  color: var(--text); background: var(--surface); padding: 8px 14px; border-radius: var(--r-md); box-shadow: var(--shadow-soft);
}
.hud-mid { display: flex; align-items: center; gap: var(--sp-3); background: var(--surface); padding: 6px 12px; border-radius: var(--r-md); box-shadow: var(--shadow-soft); }
.locks { display: flex; gap: 5px; }
.locks span {
  width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px;
  background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; transition: all var(--dur-2) var(--ease-out);
}
.locks span.done { background: var(--sage); color: #fff; }
.clock { font-variant-numeric: tabular-nums; color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.hud-right { display: flex; gap: var(--sp-2); }
.icon-btn {
  width: 42px; height: 42px; border-radius: var(--r-md); border: none; background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-soft); cursor: pointer; display: grid; place-items: center; transition: background var(--dur-1), transform var(--dur-1);
}
.icon-btn:hover { background: var(--surface-solid); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn.on { background: var(--accent); color: var(--accent-contrast); }
.icon-btn[hidden] { display: none; }
.icon-btn svg { width: 19px; height: 19px; }

/* ---------- Main stage ---------- */
#app {
  position: relative; z-index: 10; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 80px var(--sp-4) var(--sp-7);
}
#app.align-end { align-items: flex-end; }
body.lock-mode #app { opacity: 0; pointer-events: none; }

.card {
  width: min(640px, 100%);
  background: var(--surface);
  backdrop-filter: blur(16px) saturate(1.05);
  -webkit-backdrop-filter: blur(16px) saturate(1.05);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: clamp(22px, 4vw, 40px);
}
.card.wide { width: min(1180px, 100%); }
.card.bare { background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 0; }

.eyebrow { font-size: var(--fs-xs); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin: 0 0 var(--sp-3); font-weight: 800; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; margin: 0 0 var(--sp-3); line-height: 1.08; letter-spacing: -0.02em; color: var(--text); }
h1, h2, h3, .menu-card h3 { -webkit-hyphens: auto; hyphens: auto; overflow-wrap: break-word; }
#app, .card { min-width: 0; max-width: 100%; }
h1 { font-size: var(--fs-3xl); font-weight: 800; letter-spacing: -0.035em; }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-lg); }
p { margin: 0 0 var(--sp-4); max-width: 64ch; }
.lead { font-size: var(--fs-lg); }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }

/* Welcome hero sits directly on the 3D scene */
.hero { text-align: center; max-width: 900px; position: relative; }
.hero::before { content: ""; position: absolute; inset: -18% -22%; z-index: -1; background: radial-gradient(ellipse at center, rgba(8, 12, 11, 0.62), transparent 68%); pointer-events: none; }
.cinema { position: relative; }
.cinema::before { content: ""; position: absolute; inset: -30% -15% -10%; z-index: -1; background: radial-gradient(ellipse at center 70%, rgba(8, 12, 11, 0.7), transparent 70%); pointer-events: none; }
.hero h1, .hero .lead, .hero .note { color: var(--on-scene); text-shadow: 0 4px 30px rgba(0, 0, 0, 0.65); }
.hero h1 em { font-style: normal; color: var(--honey); }
.hero .eyebrow { color: var(--honey); }
.hero .lead { margin-inline: auto; color: var(--on-scene); }
.hero .actions { justify-content: center; }
.hero .note { justify-content: center; margin: 28px auto 0; color: var(--on-scene-muted); }

.lang-switch { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--r-md); background: rgba(248, 244, 236, 0.16); backdrop-filter: blur(8px); margin-bottom: var(--sp-5); }
.lang-switch button { border: none; background: none; color: var(--on-scene); font-weight: 700; padding: 8px 16px; border-radius: 9px; cursor: pointer; transition: background var(--dur-1), color var(--dur-1); }
.lang-switch button.on { background: var(--surface-solid); color: var(--text); }
.lang-switch button:not(.on):hover { background: rgba(248, 244, 236, 0.18); }

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-5); align-items: center; }
.btn {
  appearance: none; border: 1.5px solid transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 50px; padding: 0 var(--sp-5); border-radius: var(--r-md);
  font-weight: 700; letter-spacing: 0.005em;
  transition: transform var(--dur-1) var(--ease-out), background var(--dur-1), box-shadow var(--dur-2), opacity var(--dur-1), border-color var(--dur-1);
}
.btn-primary { background: var(--accent); color: var(--accent-contrast); box-shadow: 0 8px 20px -10px rgba(168, 50, 74, 0.9); }
.btn-primary:hover { background: var(--accent-hi); transform: translateY(-1px); }
.btn-ghost { background: var(--surface-solid); color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.hero .btn-ghost { background: rgba(248, 244, 236, 0.14); color: var(--on-scene); border-color: rgba(248, 244, 236, 0.35); }
.btn-text { background: none; color: var(--muted); padding: 0 var(--sp-3); min-height: 40px; }
.btn-text:hover { color: var(--text); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: var(--sp-4); }
.field label { font-size: var(--fs-sm); color: var(--muted); font-weight: 700; }
.input {
  width: 100%; min-height: 50px; padding: 0 var(--sp-4); border-radius: var(--r-md);
  background: #fffdf8; border: 1.5px solid var(--line-strong); color: var(--text);
  transition: border-color var(--dur-1), box-shadow var(--dur-1);
}
.input::placeholder { color: var(--faint); }
.input:focus { outline: none; border-color: var(--sage); box-shadow: 0 0 0 4px var(--sage-soft); }
.input.invalid { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(192, 57, 43, 0.12); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }
.toggle { display: flex; align-items: center; gap: var(--sp-3); cursor: pointer; margin: var(--sp-2) 0 var(--sp-4); font-weight: 600; }
.toggle input { appearance: none; width: 46px; height: 26px; border-radius: 999px; background: var(--surface-3); position: relative; cursor: pointer; transition: background var(--dur-1); flex: none; }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-soft); transition: transform var(--dur-2) var(--ease-out); }
.toggle input:checked { background: var(--sage); }
.toggle input:checked::after { transform: translateX(20px); }
.note { font-size: var(--fs-xs); color: var(--muted); display: flex; gap: var(--sp-2); align-items: flex-start; }

/* ---------- Size choice ---------- */
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); margin-top: var(--sp-5); }
@media (max-width: 720px) { .choices { grid-template-columns: 1fr; } }
.choice, .menu-card {
  text-align: left; cursor: pointer; padding: var(--sp-5); border-radius: var(--r-md);
  background: #fffdf8; border: 1.5px solid var(--line);
  transition: transform var(--dur-2) var(--ease-out), border-color var(--dur-1), box-shadow var(--dur-2), background var(--dur-1);
}
.choice:hover, .menu-card:hover { transform: translateY(-4px); border-color: var(--sage); box-shadow: var(--shadow-soft); }
.choice.selected, .menu-card.selected { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px var(--accent-soft); }
.choice .num { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-2xl); line-height: 1; color: var(--accent); }
.choice .people { display: flex; gap: 4px; margin: var(--sp-3) 0; }
.choice .people i { width: 14px; height: 22px; border-radius: 7px 7px 3px 3px; background: var(--sage); }
.choice .people i.ghost { background: transparent; border: 1.5px dashed var(--accent); }
.choice p, .menu-card p { font-size: var(--fs-sm); color: var(--muted); margin: 0; }

/* ---------- Menu choice ---------- */
.menus { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); margin-top: var(--sp-5); }
@media (max-width: 980px) { .menus { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .menus { grid-template-columns: 1fr; } }
.menu-card { display: flex; flex-direction: column; gap: var(--sp-2); }
.menu-icon { font-size: 34px; line-height: 1; }
.menu-region { font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sage); }
.menu-card h3 { margin: 0; font-size: var(--fs-lg); }
.menu-courses { list-style: none; padding: 0; margin: var(--sp-2) 0 0; display: grid; gap: 4px; font-size: var(--fs-sm); border-top: 1px dashed var(--line-strong); padding-top: var(--sp-3); }
.menu-courses b { display: inline-block; min-width: 92px; color: var(--accent); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- Players & teams ---------- */
.players { display: grid; gap: var(--sp-3); }
.player-row { display: flex; align-items: center; gap: var(--sp-3); }
.avatar { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; color: #fff; }
.teams { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--sp-3); margin-top: var(--sp-5); }
.team { padding: var(--sp-4); border-radius: var(--r-md); background: var(--sage-soft); }
.team h4 { margin: 0 0 var(--sp-2); font-family: var(--font-display); font-size: var(--fs-base); color: var(--text); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 4px; border-radius: 10px; background: #fffdf8; margin: 2px; font-size: var(--fs-sm); font-weight: 600; }
.chip .avatar { width: 24px; height: 24px; font-size: 12px; border-radius: 7px; }
.shuffle-anim .chip { animation: pop var(--dur-3) var(--ease-out) both; }

/* ---------- Ghost reveal ---------- */
.reveal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: var(--sp-3); margin-top: var(--sp-4); }
.reveal-card { min-height: 92px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: #fffdf8; cursor: pointer; display: grid; place-items: center; gap: 4px; padding: var(--sp-3); font-weight: 700; transition: border-color var(--dur-1); }
.reveal-card:hover { border-color: var(--sage); }
.reveal-card.seen { opacity: 0.45; }
.secret { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: var(--sp-4); background: rgba(10, 16, 14, 0.9); backdrop-filter: blur(10px); }
.secret .card { text-align: center; }
.secret .role { font-family: var(--font-display); font-size: var(--fs-2xl); margin: var(--sp-4) 0; }
.secret .role em { font-style: normal; color: var(--accent); }
.hold { user-select: none; -webkit-user-select: none; touch-action: none; }

/* ---------- Paper (Hank's letters) ---------- */
.paper {
  position: relative; color: var(--ink);
  background: radial-gradient(ellipse at 15% 0%, rgba(255,255,255,0.6), transparent 55%), linear-gradient(180deg, var(--paper), var(--paper-2));
  border-radius: 6px; padding: clamp(24px, 5vw, 48px);
  box-shadow: var(--shadow-paper);
  font-family: var(--font-hand); font-size: clamp(1.45rem, 1.25rem + 0.8vw, 1.85rem); line-height: 1.3;
}
.paper::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: 6px; opacity: 0.22; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.5'/></svg>");
}
.paper h3 { color: var(--ink-muted); font-size: var(--fs-xs); letter-spacing: 0.16em; text-transform: uppercase; font-family: var(--font-text); font-weight: 800; }
.paper p { max-width: none; margin-bottom: 0.7em; }
.paper .ps { font-size: 0.85em; color: var(--ink-muted); }
.paper .sign { text-align: right; font-size: 1.4em; margin: 0; }
.paper mark { background: var(--honey-soft); color: var(--accent); font-weight: 700; padding: 0 4px; border-radius: 4px; }
.paper.small-paper { font-size: clamp(1.25rem, 1.15rem + 0.4vw, 1.45rem); padding: var(--sp-5); }
.unfold { animation: unfold 1.1s var(--ease-out) both; transform-origin: 50% 0; }
@keyframes unfold {
  0% { transform: perspective(900px) rotateX(-70deg) translateY(30px); opacity: 0; clip-path: inset(0 0 70% 0); }
  60% { opacity: 1; }
  100% { transform: none; opacity: 1; clip-path: inset(0 0 0 0); }
}

/* ---------- Prolog ---------- */
.cinema { width: min(820px, 100%); text-align: center; }
.cinema .eyebrow { color: var(--honey); }
.cinema .line { font-family: var(--font-display); font-weight: 600; color: var(--on-scene); font-size: var(--fs-xl); line-height: 1.3; min-height: 4.2em; text-shadow: 0 4px 30px rgba(0,0,0,0.85); }
.cinema .btn-text { color: var(--on-scene-muted); }
.cinema .caret { display: inline-block; width: 3px; height: 1em; background: var(--honey); margin-left: 4px; vertical-align: -0.12em; animation: blink 1s steps(2) infinite; }
.dots { display: flex; gap: 8px; justify-content: center; margin-top: var(--sp-5); }
.dots i { width: 22px; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.25); transition: background var(--dur-2); }
.dots i.on { background: var(--honey); }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Phase layout ---------- */
.phase-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-5); }
.roles { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.role-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 10px; font-size: var(--fs-sm); background: var(--surface-2); }
.role-pill b { color: var(--accent); font-weight: 800; }
.phase-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); align-items: start; }
.phase-grid.single { grid-template-columns: 1fr; max-width: 720px; margin-inline: auto; }
.panel { background: #fffdf8; border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-5); }
.panel h3 { display: flex; align-items: center; gap: var(--sp-2); }
.tabs { display: none; gap: var(--sp-2); margin-bottom: var(--sp-4); padding: 4px; background: var(--surface-2); border-radius: var(--r-md); }
.tab { flex: 1; min-height: 42px; border-radius: 9px; border: none; background: transparent; cursor: pointer; font-weight: 700; color: var(--muted); }
.tab[aria-selected="true"] { background: #fff; color: var(--text); box-shadow: var(--shadow-soft); }
@media (max-width: 860px) {
  .phase-grid { grid-template-columns: 1fr; }
  .tabs { display: flex; }
  .phase-grid [data-pane][hidden-mobile] { display: none; }
}
.split { display: grid; gap: var(--sp-2); margin: var(--sp-4) 0; }
.split div { padding: var(--sp-3); border-radius: var(--r-sm); background: var(--sage-soft); border-left: 3px solid var(--sage); font-size: var(--fs-sm); }

/* Steps */
.ingredients { margin: var(--sp-3) 0 var(--sp-4); }
.ingredients summary { cursor: pointer; font-weight: 800; color: var(--accent); }
.ingredients ul { list-style: none; padding: 0; margin: var(--sp-3) 0 0; columns: 2; column-gap: var(--sp-5); font-size: var(--fs-sm); }
.ingredients li { break-inside: avoid; display: flex; justify-content: space-between; gap: var(--sp-2); padding: 4px 0; border-bottom: 1px dashed var(--line-strong); }
.ingredients li span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
@media (max-width: 560px) { .ingredients ul { columns: 1; } }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-2); }
.step { display: grid; grid-template-columns: 34px 1fr auto; gap: var(--sp-3); align-items: center; padding: var(--sp-3); border-radius: var(--r-sm); background: var(--surface-solid); border: 1.5px solid transparent; transition: background var(--dur-2), opacity var(--dur-2), border-color var(--dur-2); }
.step.done { opacity: 0.55; }
.step.running { border-color: var(--honey); background: var(--honey-soft); }
.step .check { width: 30px; height: 30px; border-radius: 9px; border: 1.5px solid var(--line-strong); background: #fff; cursor: pointer; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: var(--muted); }
.step.done .check { background: var(--sage); border-color: var(--sage); color: #fff; }
.step .txt { font-size: var(--fs-sm); }
.step .big { display: block; color: var(--accent); font-size: var(--fs-xs); margin-top: 2px; font-weight: 600; }
.timer { display: inline-flex; align-items: center; gap: 6px; min-width: 92px; justify-content: center; padding: 6px 12px; border-radius: 9px; border: 1.5px solid var(--line-strong); background: #fff; font-variant-numeric: tabular-nums; cursor: pointer; font-weight: 800; font-size: var(--fs-sm); }
.timer.running { background: var(--honey); border-color: var(--honey); color: #2b1d05; }
.timer.ring { animation: ring 0.5s ease-in-out infinite alternate; background: var(--accent); border-color: var(--accent); color: #fff; }
@keyframes ring { to { transform: scale(1.08); } }

/* Hints */
.hints { display: grid; gap: var(--sp-2); margin-top: var(--sp-4); }
.hint { border-radius: var(--r-sm); border: 1.5px dashed var(--line-strong); padding: var(--sp-3); font-size: var(--fs-sm); }
.hint.locked { opacity: 0.45; }
.hint.open { border-style: solid; border-color: var(--honey); background: var(--honey-soft); animation: rise var(--dur-3) var(--ease-out) both; }
.hint button { width: 100%; text-align: left; background: none; border: none; cursor: pointer; color: var(--muted); padding: 0; font-weight: 700; }
.hint button:hover { color: var(--text); }

/* Digital material */
details.digital { margin-top: var(--sp-4); border-radius: var(--r-sm); border: 1.5px solid var(--line); padding: var(--sp-3) var(--sp-4); background: var(--surface-solid); }
details.digital summary { cursor: pointer; font-weight: 800; }
.arrange { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-2); margin-top: var(--sp-4); touch-action: none; }
.arrange.long { grid-template-columns: 1fr; }
.acard { position: relative; min-height: 110px; border-radius: var(--r-sm); cursor: grab; user-select: none; perspective: 600px; transition: transform var(--dur-2) var(--ease-out); }
.arrange.long .acard { min-height: 74px; }
.acard.dragging { z-index: 5; transform: scale(1.04); cursor: grabbing; }
.acard .face { position: absolute; inset: 0; border-radius: var(--r-sm); padding: var(--sp-3); display: grid; place-items: center; text-align: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform 0.6s var(--ease-out); background: linear-gradient(180deg, var(--paper), var(--paper-2)); color: var(--ink); box-shadow: var(--shadow-soft); }
.acard .front .ic { font-size: 30px; }
.acard .front .lbl { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-sm); }
.arrange.long .acard .front { text-align: left; place-items: center start; font-size: var(--fs-sm); padding-left: 38px; }
.acard .front .val { position: absolute; top: 6px; right: 10px; font-family: var(--font-display); font-weight: 800; color: var(--accent); }
.acard .back { transform: rotateY(180deg); background: var(--sage); color: #fff; font-family: var(--font-display); font-weight: 800; font-size: var(--fs-2xl); }
.acard.flipped .front { transform: rotateY(180deg); }
.acard.flipped .back { transform: rotateY(360deg); }
.acard .tag { position: absolute; left: 12px; top: 8px; font-weight: 800; color: var(--accent); font-size: var(--fs-xs); }
.codes-board { display: grid; gap: var(--sp-2); margin-top: var(--sp-4); }
.code-row { display: flex; align-items: center; gap: var(--sp-2); }
.code-row .lbl { width: 96px; font-size: var(--fs-xs); color: var(--muted); font-weight: 700; }
.digit { width: 42px; height: 50px; border-radius: 10px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: var(--fs-lg); background: #fff; border: 1.5px solid var(--line-strong); cursor: pointer; transition: all var(--dur-1); }
.digit.marked { background: var(--honey); border-color: var(--honey); transform: translateY(-3px); }
.digit.big { width: 64px; height: 84px; font-size: 2.4rem; }

/* ---------- Lock UI (over the 3D scene) ---------- */
#lock-ui { position: fixed; inset: 0; z-index: 30; pointer-events: none; }
#lock-ui[hidden] { display: none; }
#lock-ui .top { position: absolute; top: 72px; left: 50%; transform: translateX(-50%); text-align: center; padding: 14px 22px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-card); width: min(560px, calc(100% - 32px)); }
#lock-ui .top h2 { font-size: var(--fs-xl); margin-bottom: 4px; }
#lock-ui .top p { margin: 0 auto; color: var(--muted); }
.arrow { position: absolute; pointer-events: auto; width: 44px; height: 38px; margin-left: -22px; border-radius: 10px; border: none; background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow-soft); cursor: pointer; display: grid; place-items: center; transition: background var(--dur-1), transform var(--dur-1); }
.arrow:hover { background: #fff; }
.arrow:active { transform: scale(0.92); }
.arrow.on { background: var(--honey); }
#lock-ui .bottom { position: absolute; left: 0; right: 0; bottom: max(24px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); padding: 0 var(--sp-4); pointer-events: auto; }
#lock-ui .feedback { min-height: 1.6em; font-weight: 800; text-align: center; padding: 4px 14px; border-radius: 10px; }
#lock-ui .feedback:empty { visibility: hidden; }
#lock-ui .feedback.bad { color: #fff; background: var(--danger); }
#lock-ui .feedback.good { color: #2b1d05; background: var(--honey); }
#lock-ui .row { display: flex; gap: var(--sp-3); flex-wrap: wrap; justify-content: center; }
.dom-lock { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; gap: 14px; pointer-events: auto; }
.sr-code { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Reward ---------- */
.reward { text-align: center; }
.reward .burst { font-size: 56px; animation: pop 0.9s var(--ease-out) both; }

/* ---------- Finale ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); margin: var(--sp-5) 0; }
.stat { padding: var(--sp-4); border-radius: var(--r-md); background: var(--surface-2); text-align: center; }
.stat b { display: block; font-family: var(--font-display); font-weight: 800; font-size: var(--fs-xl); font-variant-numeric: tabular-nums; color: var(--accent); }
.stat span { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }

/* ---------- Menu sheet, toast ---------- */
.sheet { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: var(--sp-4); background: rgba(10, 16, 14, 0.6); backdrop-filter: blur(6px); animation: fade var(--dur-2) both; }
.sheet .card { max-height: 90vh; overflow: auto; }
.menu-list { display: grid; gap: var(--sp-2); }
.menu-list .btn { justify-content: flex-start; width: 100%; }
.solutions { margin-top: var(--sp-4); border-top: 1px dashed var(--line-strong); padding-top: var(--sp-3); }
.solutions h4 { font-family: var(--font-display); margin: var(--sp-4) 0 var(--sp-2); color: var(--accent); }
.solutions ol { margin: 0; padding-left: 20px; }
.codes-table { width: 100%; border-collapse: collapse; margin: var(--sp-3) 0; }
.codes-table td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.codes-table td:last-child { text-align: right; font-family: var(--font-display); font-weight: 800; font-size: var(--fs-lg); letter-spacing: 0.1em; color: var(--accent); }
#toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; pointer-events: none; width: min(560px, calc(100% - 32px)); }
.toast { padding: 12px 18px; border-radius: var(--r-md); background: var(--surface-solid); color: var(--text); border-left: 4px solid var(--sage); box-shadow: var(--shadow-card); font-weight: 600; animation: rise var(--dur-2) var(--ease-out) both; }
.checklist { list-style: none; padding: 0; margin: var(--sp-4) 0; display: grid; gap: var(--sp-2); }
.checklist label { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3); border-radius: var(--r-sm); background: #fffdf8; border: 1px solid var(--line); cursor: pointer; font-size: var(--fs-sm); }
.checklist input { width: 20px; height: 20px; accent-color: var(--sage); flex: none; margin-top: 1px; }

/* ---------- Motion ---------- */
.stagger > * { animation: rise var(--dur-3) var(--ease-out) both; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { opacity: 0; transform: scale(0.6); } 60% { transform: scale(1.08); } 100% { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } }
.screen-out { animation: out var(--dur-1) var(--ease-in-out) both; }
@keyframes out { to { opacity: 0; transform: translateY(-8px); } }
.flash { position: fixed; inset: 0; z-index: 50; pointer-events: none; background: #e6eeff; animation: flash 0.9s ease-out both; }
@keyframes flash { 0% { opacity: 0.85; } 15% { opacity: 0.1; } 25% { opacity: 0.6; } 100% { opacity: 0; } }

@media (max-width: 560px) {
  #hud { top: 8px; left: 8px; right: 8px; }
  .brand { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; }
}

/* =====================================================================================================
   Version 3: screen games (radio, candle ring, cipher wheel), finds and the guest book
   ===================================================================================================== */
.game-stage { margin-top: var(--sp-4); }
.game { display: grid; gap: var(--sp-3); }
.game .row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.game .msg { font-weight: 700; font-size: var(--fs-sm); min-height: 1.4em; }
.game .msg.good { color: var(--sage); }
.game .msg.bad { color: var(--danger); animation: shake 0.4s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.rbtn { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: #fff; font-weight: 800; font-size: 18px; cursor: pointer; color: var(--text); }
.rbtn:hover { border-color: var(--accent); color: var(--accent); }

/* ---- radio ---- */
.radio-set { border-radius: var(--r-lg); padding: var(--sp-4); background: linear-gradient(180deg, #46564a, #2f3c33); box-shadow: inset 0 1px 0 rgba(255,255,255,.15), var(--shadow-soft); color: #efe6cc; display: grid; gap: var(--sp-3); }
.radio-top { display: flex; align-items: center; gap: var(--sp-4); }
.radio-display { font-family: var(--font-display); background: #15100b; color: #ffcf70; border-radius: 8px; padding: 6px 14px; min-width: 96px; text-align: center; box-shadow: inset 0 0 12px rgba(255, 176, 59, .25); }
.radio-display .rf { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; display: block; line-height: 1; }
.radio-display small { font-size: 10px; letter-spacing: .2em; opacity: .7; }
.radio-meter { flex: 1; display: grid; gap: 4px; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; opacity: .9; }
.radio-meter div { display: flex; gap: 3px; align-items: end; height: 22px; }
.radio-meter i { flex: 1; background: rgba(255,255,255,.12); border-radius: 2px; height: 30%; transition: background .2s; }
.radio-meter i:nth-child(n+4) { height: 50%; } .radio-meter i:nth-child(n+7) { height: 75%; } .radio-meter i:nth-child(n+9) { height: 100%; }
.radio-meter i.on { background: #9fd18a; }
.radio-lamp { width: 26px; height: 26px; border-radius: 50%; background: #5a2a1c; box-shadow: inset 0 2px 4px rgba(0,0,0,.5); transition: background .04s, box-shadow .04s; flex: none; }
.radio-lamp.on { background: #ffcf70; box-shadow: 0 0 18px 6px rgba(255, 190, 80, .7); }
.radio-scale { position: relative; height: 62px; border-radius: 8px; background: linear-gradient(180deg, #e3d3a6, #cdb987); color: #2a2018; cursor: ew-resize; touch-action: none; outline-offset: 3px; }
.radio-scale:focus-visible { outline: 2px solid var(--honey); }
.radio-scale .ticks { position: absolute; inset: 8px 10px auto; display: flex; justify-content: space-between; }
.radio-scale .ticks b { width: 1px; height: 8px; background: #2a2018; }
.radio-scale .ticks b.mid { height: 13px; } .radio-scale .ticks b.major { height: 18px; width: 2px; }
.radio-scale .nums { position: absolute; left: 10px; right: 10px; bottom: 6px; height: 18px; }
.radio-scale .nums span { position: absolute; transform: translateX(-50%); font-weight: 800; font-size: 12px; }
.radio-scale .needle { position: absolute; top: 4px; bottom: 4px; width: 3px; margin-left: -1.5px; background: var(--accent); box-shadow: 0 0 6px rgba(168,50,74,.6); left: 0; transition: left .08s; pointer-events: none; }
.radio-scale .needle, .radio-scale .ticks, .radio-scale .nums { margin: 0 10px; }
.radio-scale .needle { margin: 0; }
.radio-knobs { display: flex; align-items: center; justify-content: center; gap: var(--sp-4); }
.radio-knobs .rbtn { background: #2a2018; border-color: #6b5a3e; color: #efe6cc; }
.knob { width: 92px; height: 92px; cursor: grab; touch-action: none; }
.knob svg { width: 100%; height: 100%; filter: drop-shadow(0 4px 6px rgba(0,0,0,.4)); }
.knob .kn { transition: transform .08s; transform-origin: 0 0; }
.radio-drag { color: #c9bf9f; text-align: center; margin: 0; }
.radio-cap { margin: 0; min-height: 2.6em; font-size: var(--fs-sm); color: #d8ccaa; font-style: italic; }
.radio-cap.on { color: #ffcf70; font-style: normal; font-weight: 700; }
.radio-note { margin: 0; font-size: var(--fs-sm); color: var(--muted); }
.radio-decode { display: grid; gap: var(--sp-3); padding: var(--sp-4); border-radius: var(--r-md); background: var(--surface-solid); border: 1.5px solid var(--honey); animation: rise var(--dur-3) var(--ease-out) both; }
.radio-decode[hidden] { display: none; }
.check-slow { display: inline-flex; gap: 6px; align-items: center; font-weight: 700; font-size: var(--fs-sm); }
.letters { display: flex; gap: var(--sp-2); }
.letters input { width: 48px; height: 58px; text-align: center; font: 800 26px var(--font-display); text-transform: uppercase; border-radius: 10px; border: 1.5px solid var(--line-strong); background: #fff; color: var(--ink); }
.letters input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.chart summary { cursor: pointer; font-weight: 800; font-size: var(--fs-sm); }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 4px 10px; margin-top: var(--sp-2); font-size: var(--fs-sm); }
.chart-grid span { display: flex; gap: 8px; font-variant-numeric: tabular-nums; letter-spacing: .08em; }
.chart-grid b { width: 14px; color: var(--accent); }

/* ---- candle ring ---- */
.candle-stage { max-width: 460px; width: 100%; margin: 0 auto; }
.candle-stage svg { width: 100%; height: auto; display: block; }
.candles .wall { fill: #1b130d; stroke: #4a3322; stroke-width: 4; }
.candles .wallglow { opacity: 0; transition: opacity 1.4s; }
.candles .ringline { fill: none; stroke: #6b4a32; stroke-width: 6; }
.candles .cd { cursor: pointer; outline: none; }
.candles .cd .halo { fill: url(#cg); opacity: 0; transition: opacity .35s; }
.candles .cd .wax { fill: #e9dcc0; stroke: #b9a67e; stroke-width: 1; }
.candles .cd .wick { fill: #2a2018; }
.candles .cd .flame { fill: #ffcf70; opacity: 0; transform-origin: 0 -14px; transition: opacity .25s, transform .25s; transform: scale(.3); }
.candles .cd .smoke { fill: none; stroke: #9c9184; stroke-width: 2; stroke-linecap: round; opacity: .45; }
.candles .cd.lit .flame { opacity: 1; transform: scale(1); animation: flicker 1.6s ease-in-out infinite alternate; }
.candles .cd.lit .halo { opacity: 1; }
.candles .cd.lit .smoke { opacity: 0; }
.candles .cd .nm { fill: #d8ccaa; font-size: 15px; font-family: var(--font-hand); font-weight: 600; }
.candles .cd:focus-visible .wax { stroke: var(--honey); stroke-width: 3; }
.candles .cd:hover .wax { fill: #fff3d6; }
@keyframes flicker { 0% { transform: scale(1) rotate(-2deg); } 50% { transform: scale(1.06, .95) rotate(2deg); } 100% { transform: scale(.96, 1.05) rotate(-1deg); } }
.candles .shadownum text { font-family: var(--font-hand); font-weight: 700; font-size: 120px; fill: #000; opacity: 0; transition: opacity 2s 0.6s, fill 2s; }
.candles.won .shadownum text { opacity: .9; fill: #e9b85a; }
.candles.won .wallglow { opacity: 1; }
.candle-bar { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; justify-content: center; }
.candle-bar .pill { padding: 6px 12px; border-radius: 999px; background: var(--surface-2); font-size: var(--fs-sm); }
.candle-done { text-align: center; font-weight: 700; color: var(--accent); min-height: 1.4em; margin: 0; }
@media (prefers-reduced-motion: reduce) { .candles .cd.lit .flame { animation: none; } }

/* ---- cipher wheel ---- */
.cipher-wrap { display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: var(--sp-4); align-items: center; }
.wheel-box { width: 100%; aspect-ratio: 1; cursor: grab; touch-action: none; border-radius: 50%; outline-offset: 4px; }
.wheel-box:focus-visible { outline: 2px solid var(--honey); }
.wheel-box svg { width: 100%; height: 100%; filter: drop-shadow(0 8px 16px rgba(0,0,0,.35)); }
.wheel-box .inner { transition: transform .18s var(--ease-out); }
.wheel-box text { font-family: var(--font-display); font-weight: 800; }
.wheel-box .knum { font-size: 34px; }
.wheel-side { display: grid; gap: var(--sp-3); justify-items: center; }
.wheel-side .turn { display: flex; align-items: center; gap: var(--sp-3); }
.wheel-side .tnum { display: grid; text-align: center; min-width: 70px; }
.wheel-side .tnum small { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.wheel-side .tnum b { font: 800 36px var(--font-display); color: var(--accent); }
.readable { color: var(--sage); font-weight: 800; min-height: 1.4em; margin: 0; }
.ctext { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: var(--sp-4); border-radius: var(--r-md); background: linear-gradient(180deg, var(--paper), var(--paper-2)); box-shadow: var(--shadow-soft); }
.ctext .cw { display: inline-flex; gap: 1px; }
.ctext .cl { display: grid; text-align: center; min-width: 13px; font-family: ui-monospace, "SF Mono", Menlo, monospace; line-height: 1.25; }
.ctext .cl i { font-style: normal; color: var(--ink-muted); font-size: 13px; }
.ctext .cl u { text-decoration: none; color: var(--ink); font-weight: 800; font-size: 15px; transition: color .2s; }
.cipher.readable-now .ctext .cl u { color: var(--accent); }
.cipher .ask { margin-top: var(--sp-2); }
.cipher .ask label { font-weight: 800; width: 100%; }
.cipher .ask .txt { flex: 1; min-width: 140px; height: 48px; padding: 0 14px; border-radius: 10px; border: 1.5px solid var(--line-strong); font: 700 var(--fs-base) var(--font-text); text-transform: uppercase; }
@media (max-width: 640px) { .cipher-wrap { grid-template-columns: 1fr; } .wheel-box { max-width: 300px; margin: 0 auto; } }

/* ---- finds (one per chapter) ---- */
.find { margin: var(--sp-5) 0 0; display: grid; gap: var(--sp-4); text-align: left; }
.find-art { border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-paper); transform: rotate(-1deg); animation: develop 1.6s var(--ease-out) both; background: #2a1c12; }
.find-art .art { display: block; width: 100%; height: auto; }
@keyframes develop { from { filter: sepia(1) brightness(1.8) blur(4px); opacity: 0; transform: rotate(-4deg) scale(.96); } to { filter: none; opacity: 1; transform: rotate(-1deg); } }
.find figcaption p { margin: 0 0 .5em; }
.find-quote { margin: 0 0 var(--sp-3); padding: var(--sp-3) var(--sp-4); border-left: 3px solid var(--honey); background: var(--honey-soft); font-family: var(--font-hand); font-size: 1.35em; line-height: 1.25; color: var(--ink); border-radius: 0 8px 8px 0; }
.finds summary { cursor: pointer; font-weight: 800; margin-top: var(--sp-5); }
.finds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-4); }
.finds-grid .find { margin-top: var(--sp-3); font-size: var(--fs-sm); }
.finds-grid .find-quote { font-size: 1.15em; }

/* ---- finale: radio message and guest book ---- */
.radio-final { margin: var(--sp-4) 0; padding: var(--sp-5); border-radius: var(--r-md); background: #1d2620; color: #efe6cc; box-shadow: inset 0 0 30px rgba(0,0,0,.4); }
.radio-final .rf-head { margin: 0 0 var(--sp-3); font-weight: 800; letter-spacing: .08em; color: #9fd18a; font-size: var(--fs-sm); text-transform: uppercase; }
.radio-final .rf-line { margin: 0 0 .7em; font-family: var(--font-hand); font-size: 1.45em; line-height: 1.25; opacity: 0; animation: rf-in .9s var(--ease-out) forwards; animation-delay: calc(var(--d) * 1.6s + .8s); }
.radio-final .rf-line.sign { text-align: right; }
@keyframes rf-in { from { opacity: 0; filter: blur(6px); transform: translateY(6px); } to { opacity: 1; filter: none; transform: none; } }
.guestbook { display: grid; grid-template-columns: 1fr 1fr; margin: var(--sp-5) 0; border-radius: 6px; box-shadow: var(--shadow-paper); overflow: hidden; color: var(--ink); }
.gb-page { padding: var(--sp-5); background: linear-gradient(90deg, var(--paper), var(--paper-2)); font-family: var(--font-hand); font-size: 1.3em; position: relative; }
.gb-page.right { background: linear-gradient(270deg, var(--paper), var(--paper-2)); border-left: 1px solid rgba(0,0,0,.12); }
.gb-title { font-family: var(--font-text); font-size: var(--fs-xs); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted); font-weight: 800; margin: 0 0 var(--sp-3); }
.gb-page ol { margin: 0; padding-left: 1.4em; columns: 2; column-gap: 1.2em; }
.gb-page li { transform: rotate(var(--r)); line-height: 1.35; }
.gb-page li.twelfth { color: var(--accent); font-weight: 700; }
.gb-page li.twelfth span { font-size: .8em; color: var(--ink-muted); }
.gb-entry { margin: 0; line-height: 1.3; }
.gb-name { font-size: 1.5em; font-weight: 700; color: var(--accent); display: inline-block; clip-path: inset(0 100% 0 0); animation: write 2.4s steps(28) forwards; animation-delay: calc(var(--lines, 5) * 1.6s + 1.5s); }
.gb-text { display: inline-block; opacity: 0; animation: rf-in 1s forwards; animation-delay: calc(var(--lines, 5) * 1.6s + 4s); }
.gb-sign { margin: var(--sp-4) 0 0; font-size: .9em; color: var(--ink-muted); }
@keyframes write { to { clip-path: inset(0 0 0 0); } }
@media (max-width: 640px) { .guestbook { grid-template-columns: 1fr; } .gb-page.right { border-left: 0; border-top: 1px solid rgba(0,0,0,.12); } }
@media (prefers-reduced-motion: reduce) { .radio-final .rf-line, .gb-name, .gb-text { animation: none; opacity: 1; clip-path: none; } .find-art { animation: none; } }
.finale .stats { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }

/* ---- play mode (welcome) and print downloads ---- */
.switches { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: flex-start; justify-content: center; margin-bottom: var(--sp-5); }
.switches .lang-switch { margin-bottom: 0; }
.mode-pick { display: grid; gap: 6px; justify-items: center; }
.mode-note { margin: 0; max-width: 34ch; font-size: var(--fs-xs); color: var(--on-scene-muted); text-align: center; line-height: 1.4; }
.downloads { max-width: 640px; }
.dl-all { width: 100%; justify-content: center; margin-top: var(--sp-4); text-decoration: none; }
.dl-all.done::after { content: " ✓"; }
.dl-all.nudge { animation: shake 0.45s; }
.dl-list { list-style: none; margin: var(--sp-2) 0 0; padding: 0; display: grid; gap: var(--sp-2); }
.dl-list a { display: grid; grid-template-columns: 40px 1fr auto; gap: var(--sp-3); align-items: center; padding: var(--sp-3); border-radius: var(--r-sm); border: 1.5px solid var(--line); background: var(--surface-solid); color: var(--text); text-decoration: none; transition: border-color var(--dur-1), background var(--dur-1); }
.dl-list a:hover { border-color: var(--accent); }
.dl-list a.done { border-color: var(--sage); background: var(--sage-soft); }
.dl-ic { font-size: 24px; text-align: center; }
.dl-txt { display: grid; }
.dl-txt b em { font-style: normal; font-size: var(--fs-xs); color: var(--accent); margin-left: 6px; }
.dl-txt small { color: var(--muted); font-size: var(--fs-xs); }
.dl-state { font-weight: 800; color: var(--muted); }
.dl-list a.done .dl-state { color: var(--sage); }

/* ---- Hank's voice: play buttons on letters and on the radio message ---- */
.voice-btn { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 10px; border-radius: 999px; border: 1.5px solid rgba(43, 42, 58, .25); background: rgba(255, 255, 255, .55); color: var(--ink); font: 700 var(--fs-sm) var(--font-text); cursor: pointer; transition: background var(--dur-1), border-color var(--dur-1); }
.voice-btn .vi { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 11px; }
.voice-btn:hover { border-color: var(--accent); background: #fff; }
.voice-btn.playing { border-color: var(--accent); background: var(--accent-soft); }
.voice-btn.playing .vi { animation: vpulse 1.2s ease-in-out infinite; }
@keyframes vpulse { 50% { box-shadow: 0 0 0 6px rgba(168, 50, 74, .18); } }
.paper .voice-btn { float: right; margin: -6px -6px 8px 12px; font-family: var(--font-text); }
.radio-final .voice-btn { margin-left: 10px; color: #efe6cc; border-color: rgba(239, 230, 204, .35); background: rgba(255, 255, 255, .06); text-transform: none; letter-spacing: 0; vertical-align: middle; }
.radio-final .voice-btn:hover, .radio-final .voice-btn.playing { background: rgba(255, 255, 255, .14); border-color: #9fd18a; }
@media (prefers-reduced-motion: reduce) { .voice-btn.playing .vi { animation: none; } }
