/* Tall Tales — "Seven-Night Poster Series".
   A Swiss concert-poster world: near-black ground, one drenched colour field per tale, geometry on a strict grid,
   one variable grotesk (Archivo) used condensed for posters and normal for reading.
   Each tale sets --field / --field-ink / --field-2 under body[data-theme="<game>"]. */
@font-face {
  font-family: 'Archivo'; font-style: normal; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
  src: url(../fonts/archivo-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Archivo'; font-style: normal; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
  src: url(../fonts/archivo-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ground: #121212;
  --ground-2: #1B1B1A;
  --ground-3: #262624;
  --paper: #F4F4EF;
  --ink: #121212;
  --muted: #A3A39B;
  --line: rgba(244, 244, 239, .22);
  --line-strong: rgba(244, 244, 239, .55);
  --good: #F4F4EF;
  --bad: #FF6B5A;

  /* the seven fields */
  --c-vonk: #E8402A; --c-needle-drop: #2A3FD6; --c-cue-card: #F5C518; --c-the-couch: #FF8A1F;
  --c-once-upon: #0B7A53; --c-field-notes: #C9D23A; --c-logbook: #0B5D7A;

  --field: var(--paper);
  --field-ink: var(--ink);
  --field-2: #F5C518;

  --font: 'Archivo', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --cond: 68%;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-back: cubic-bezier(.34, 1.4, .64, 1);
  --ease-io: cubic-bezier(.76, 0, .24, 1);
  --gutter: 16px;
  --col: 640px;
  --max: 1120px;

  /* legacy names still read by a few game styles */
  --red: var(--field); --gold: var(--field-2); --navy: var(--ground); --paper-2: var(--ground-2);
  --accent: var(--field); --bg: var(--ground); --mono: var(--font); --display: var(--font); --body: var(--font);
}

body[data-theme="home"], .f-home { --field: var(--paper); --field-ink: var(--ink); --field-2: #E8402A; }
body[data-theme="vonk"], .f-vonk { --field: var(--c-vonk); --field-ink: #121212; --field-2: #F5C518; }
body[data-theme="needle-drop"], .f-needle-drop { --field: var(--c-needle-drop); --field-ink: #F4F4EF; --field-2: #FF8A1F; }
body[data-theme="cue-card"], .f-cue-card { --field: var(--c-cue-card); --field-ink: #121212; --field-2: #E8402A; }
body[data-theme="the-couch"], .f-the-couch { --field: var(--c-the-couch); --field-ink: #121212; --field-2: #2A3FD6; }
body[data-theme="once-upon"], .f-once-upon { --field: var(--c-once-upon); --field-ink: #F4F4EF; --field-2: #F5C518; }
body[data-theme="field-notes"], .f-field-notes { --field: var(--c-field-notes); --field-ink: #121212; --field-2: #0B5D7A; }
body[data-theme="logbook"], .f-logbook { --field: var(--c-logbook); --field-ink: #F4F4EF; --field-2: #E8402A; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; background: var(--ground); color-scheme: dark; scrollbar-color: var(--line-strong) var(--ground); }
body {
  margin: 0; background: var(--ground); color: var(--paper);
  font: 450 17px/1.5 var(--font); font-stretch: 100%;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; min-height: 100dvh;
  font-variant-numeric: tabular-nums;
}
::selection { background: var(--field); color: var(--field-ink); }
img, svg { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
input { caret-color: var(--field); }
h1, h2, h3 { font-family: var(--font); font-weight: 800; font-stretch: var(--cond); line-height: .92; margin: 0; letter-spacing: -.01em; text-transform: uppercase; text-wrap: balance; }
p { margin: 0 0 12px; }
a { color: inherit; text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
:focus-visible { outline: 3px solid var(--field); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); color: var(--ink); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }
[hidden] { display: none !important; }
.ico { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linecap: square; stroke-linejoin: miter; }
.ico.fill { fill: currentColor; stroke: none; }

/* ---------- the column every game sits in ---------- */
.sheet { position: relative; max-width: var(--col); margin: 0 auto; padding: 0 0 48px; color: var(--paper); }

/* ---------- buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 12px 20px; border: 1.5px solid var(--line-strong); border-radius: 0;
  background: transparent; color: var(--paper); font: 700 15px/1.1 var(--font); font-stretch: 85%; letter-spacing: .04em; text-transform: uppercase; text-decoration: none;
  cursor: pointer; transition: background-color .18s var(--ease-out), color .18s var(--ease-out), border-color .18s var(--ease-out), transform .18s var(--ease-out);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:hover { border-color: var(--paper); background: rgba(244, 244, 239, .06); }
.btn:active { transform: translateY(1px); }
.btn-main {
  justify-content: space-between; min-height: 72px; padding: 0 22px; border: 0; background: var(--paper); color: var(--ink);
  font: 850 clamp(24px, 6.6vw, 32px)/1 var(--font); font-stretch: 70%; letter-spacing: .005em;
}
.btn-main::after { content: ''; width: 26px; height: 26px; flex: none; background: currentColor; -webkit-mask: var(--arrow) center / contain no-repeat; mask: var(--arrow) center / contain no-repeat; transition: transform .25s var(--ease-out); }
.btn-main:hover { background: var(--field); color: var(--field-ink); }
.btn-main:hover::after { transform: translateX(5px); }
.btn-main:focus-visible { outline-offset: 4px; }
:root { --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 10.5h15.4l-5.2-5.2 2.1-2.1L23.1 12l-8.8 8.8-2.1-2.1 5.2-5.2H2z'/%3E%3C/svg%3E"); }
.btn-next::after { content: ''; width: 18px; height: 18px; background: currentColor; -webkit-mask: var(--arrow) center / contain no-repeat; mask: var(--arrow) center / contain no-repeat; }
.btn-dark { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn-dark:hover { background: var(--field); color: var(--field-ink); border-color: var(--field); }
.btn-ghost { border-color: transparent; text-decoration: underline; text-transform: none; letter-spacing: 0; font-weight: 550; font-stretch: 100%; color: var(--muted); }
.btn-ghost:hover { background: none; border-color: transparent; color: var(--paper); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .35; pointer-events: none; }
.btn-wide { width: 100%; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 12px; border: 1.5px solid var(--line-strong);
  background: transparent; color: var(--paper); font: 650 13px var(--font); letter-spacing: .02em; cursor: pointer;
}
.chip:hover { border-color: var(--paper); }

/* ---------- game shell: a programme strip ---------- */
.g-top { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 52px 1fr 52px; min-height: 60px; background: var(--ground); border-bottom: 1px solid var(--line); }
.g-top > * { display: flex; align-items: center; }
.g-back, .g-help { justify-content: center; background: none; border: 0; cursor: pointer; color: var(--paper); text-decoration: none; }
.g-back { border-right: 1px solid var(--line); }
.g-help { border-left: 1px solid var(--line); }
.g-back:hover, .g-help:hover { background: var(--ground-2); }
.g-mid { gap: 10px; padding: 8px 14px; min-width: 0; justify-content: space-between; }
.g-score { display: flex; flex-direction: column; min-width: 0; }
.g-score small { font: 650 11px var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.g-score b { font: 850 26px/1 var(--font); font-stretch: 70%; white-space: nowrap; }
.g-score b em { font: 600 13px var(--font); font-style: normal; font-stretch: 100%; margin-left: 4px; color: var(--muted); }
.g-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; min-width: 0; }
.g-day { font: 850 15px/1 var(--font); font-stretch: 70%; letter-spacing: .02em; color: var(--field-ink); background: var(--field); padding: 5px 7px 4px; white-space: nowrap; }
.g-stagename { font: 600 12px var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.g-name { font: 850 22px/1 var(--font); font-stretch: 70%; }
.g-stage { padding: 0 var(--gutter); }
.g-loading, .g-error { padding: 72px 0; color: var(--muted); }
.g-error h2 { font-size: 40px; margin-bottom: 12px; color: var(--paper); }
.dots { display: flex; gap: 6px; margin-bottom: 16px; }
.dots i { width: 14px; height: 14px; background: var(--field); animation: dot 1.1s var(--ease-io) infinite; }
.dots i:nth-child(2) { animation-delay: .15s; border-radius: 50%; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 50% { transform: scale(.4) rotate(45deg); } }

/* scenes, prompt box */
.scene { animation: rise .45s var(--ease-out) both; }
/* counters ('Prompt 2 of 7') read as a caption under the question, never as an eyebrow above it */
.kicker { font: 650 12px var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.q-head { font-size: clamp(38px, 11vw, 64px); margin: 0 0 16px; }
.prompt { margin: 0 calc(var(--gutter) * -1) 20px; padding: 22px var(--gutter) 24px; background: var(--field); color: var(--field-ink); }
.prompt .kicker { margin: 14px 0 0; color: inherit; opacity: .8; }
.prompt h1, .prompt h2 { font: 800 clamp(26px, 7vw, 38px)/1.02 var(--font); font-stretch: 78%; text-transform: none; letter-spacing: -.01em; }
.progress { display: flex; gap: 0; margin: 0 0 18px; padding: 0; list-style: none; height: 6px; }
.progress li { flex: 1; background: currentColor; opacity: .18; }
.progress li + li { margin-left: 3px; }
.progress li.ok { opacity: 1; } .progress li.no { opacity: 0; } .progress li.now { opacity: .5; }
.legs { display: flex; gap: 3px; list-style: none; padding: 0; margin: 0; }
.legs li { width: 10px; height: 14px; border: 1.5px solid var(--field); }
.legs li.on { background: var(--field); }
/* content never fades: it slides into place from an already-visible state */
@keyframes rise { from { transform: translateY(12px); } to { transform: none; } }

/* ---------- closed choices: outlined until chosen, then filled and locked ---------- */
.choices { display: grid; gap: 8px; margin: 0 0 18px; }
.choices.cols-1 { grid-template-columns: 1fr; }
.choices.cols-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 420px) { .choices.cols-2.stack-sm { grid-template-columns: 1fr; } }
.choice {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 12px 14px;
  text-align: left; border: 1.5px solid var(--line-strong); border-radius: 0; background: transparent; color: var(--paper);
  cursor: pointer; font: 650 17px/1.2 var(--font);
  transition: background-color .2s var(--ease-out), border-color .2s var(--ease-out), color .2s var(--ease-out), opacity .3s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; animation: rise .4s var(--ease-out) both;
}
.choice:nth-child(2) { animation-delay: .05s; } .choice:nth-child(3) { animation-delay: .1s; } .choice:nth-child(4) { animation-delay: .15s; } .choice:nth-child(5) { animation-delay: .2s; } .choice:nth-child(6) { animation-delay: .25s; }
.choice:hover { border-color: var(--field); background: rgba(244, 244, 239, .04); }
.choice:active { transform: translateY(1px); }
.choice kbd { flex: none; display: grid; place-items: center; width: 26px; height: 26px; font: 800 14px var(--font); font-stretch: 70%; color: var(--muted); border: 1px solid var(--line); }
.choice-l { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.choice-l small { display: block; font-weight: 450; font-size: 13px; color: var(--muted); margin-top: 3px; }
.choice-note { font: 700 12px var(--font); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.choices.locked .choice { cursor: default; transform: none; }
.choices.locked .choice:hover { background: transparent; border-color: var(--line-strong); }
.choice.is-right, .choices.locked .choice.is-right:hover { background: var(--field); border-color: var(--field); color: var(--field-ink); animation: lock .45s var(--ease-back) both; }
.choice.is-right kbd, .choice.is-right small { color: inherit; border-color: currentColor; opacity: .8; }
.choice.is-right .choice-note::before { content: 'Right'; }
.choice.is-wrong, .choices.locked .choice.is-wrong:hover { border-style: dashed; border-color: var(--bad); color: var(--muted); animation: deadpan .5s var(--ease-out) both; }
.choice.is-wrong .choice-l { text-decoration: line-through; text-decoration-thickness: 2px; }
.choice.is-wrong .choice-note { color: var(--bad); }
.choice.is-wrong .choice-note::before { content: 'Not it'; }
.choice.is-dim { opacity: .35; }
.choice.is-picked { background: var(--paper); color: var(--ink); border-color: var(--paper); }
@keyframes lock { 0% { transform: scale(.97); } 60% { transform: scale(1.015); } 100% { transform: none; } }

.feedback { padding: 16px; border: 1.5px solid var(--line-strong); color: var(--paper); margin-bottom: 16px; animation: rise .35s var(--ease-out) both; }
.feedback b { font: 850 26px/1 var(--font); font-stretch: 70%; text-transform: uppercase; display: block; margin-bottom: 6px; }
.feedback.ok { background: var(--field); color: var(--field-ink); border-color: var(--field); }
.feedback.no { border-style: dashed; border-color: var(--bad); }

/* ---------- typed answers ---------- */
.ans { display: grid; grid-template-columns: 1fr auto; gap: 0; margin: 0 0 10px; }
.ans input {
  min-width: 0; min-height: 62px; padding: 10px 14px; border: 1.5px solid var(--line-strong); border-right: 0; border-radius: 0;
  background: var(--ground-2); font: 650 21px var(--font); color: var(--paper);
}
.ans input::placeholder { color: #8C8C85; }
.ans input:focus { outline: none; border-color: var(--field); background: var(--ground-3); }
.ans .btn { min-height: 62px; padding: 0 18px; background: var(--paper); color: var(--ink); border-color: var(--paper); font-weight: 850; font-stretch: 75%; font-size: 18px; }
.ans .btn:hover { background: var(--field); color: var(--field-ink); border-color: var(--field); }
.ans.locked input { opacity: .5; }
.ans-msg { min-height: 24px; margin: 0 0 12px; font: 550 14px var(--font); color: var(--muted); }
.ans-msg.bad { color: var(--bad); }
.ans.shake { animation: deadpan .5s var(--ease-out); }
.ans-tries { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; padding: 0; list-style: none; }
.ans-tries li { font: 600 12px var(--font); padding: 4px 8px; border: 1px dashed var(--line-strong); color: var(--muted); text-decoration: line-through; }

/* ---------- timer: a draining bar ---------- */
.timer { position: relative; height: 34px; background: var(--ground-2); overflow: hidden; margin: 0 0 14px; color: var(--paper); }
.timer i { position: absolute; inset: 0; background: var(--field); transform-origin: left; }
.timer b { position: relative; display: block; padding-left: 12px; font: 850 18px/34px var(--font); font-stretch: 70%; color: var(--field-ink); mix-blend-mode: normal; }
.timer.low i { background: var(--bad); }
.timer.low b { color: var(--ink); }

/* ---------- rarity stamp: a tier meter plus its name ---------- */
.stamp {
  --lv: 1;
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 10px 6px 8px; color: var(--paper); border: 1.5px solid currentColor;
  font: 850 18px/1 var(--font); font-stretch: 72%; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap;
}
.stamp::before {
  content: ''; width: 44px; height: 12px; flex: none;
  background: linear-gradient(90deg, currentColor 0 calc(var(--lv) * 20%), transparent 0) 0 0 / 100% 100%;
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 7.2px, transparent 7.2px 9px); mask: repeating-linear-gradient(90deg, #000 0 7.2px, transparent 7.2px 9px);
  box-shadow: inset 0 0 0 100px rgba(244, 244, 239, .12);
}
.stamp.t0 { --lv: 1; } .stamp.t1 { --lv: 2; } .stamp.t2 { --lv: 3; } .stamp.t3 { --lv: 4; }
.stamp.t4 { --lv: 5; background: var(--field); color: var(--field-ink); border-color: var(--field); }
.stamp.t-miss { --lv: 0; color: var(--bad); border-style: dashed; }
.stamp.thump { animation: punch .55s var(--ease-back) both; }
@keyframes punch { 0% { transform: scale(1.35); } 100% { transform: none; } }
.verdict { display: grid; gap: 10px; padding: 16px 0 18px; margin: 0 0 16px; border-top: 1.5px solid var(--paper); border-bottom: 1px solid var(--line); color: var(--paper); animation: rise .35s var(--ease-out) both; }
.verdict-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.verdict-ans { font: 800 clamp(28px, 7vw, 36px)/1 var(--font); font-stretch: 72%; text-transform: uppercase; }
.verdict-ans small { font: 500 13px var(--font); text-transform: none; color: var(--muted); }
.verdict-pts { font: 850 30px/1 var(--font); font-stretch: 68%; color: var(--field); white-space: nowrap; }
.verdict p { margin: 0; font-size: 15px; color: var(--muted); }
.verdict p b { color: var(--paper); font-weight: 650; }

/* ---------- the poster: a composition that assembles as you score ---------- */
.journey { position: relative; margin: 0 calc(var(--gutter) * -1) 18px; background: var(--field); color: var(--field-ink); overflow: hidden; }
.journey svg { width: 100%; height: auto; }
.j-route { fill: none; stroke: currentColor; stroke-width: 2; stroke-dasharray: 2 7; opacity: .45; }
.j-seg { fill: none; stroke: currentColor; stroke-width: 6; stroke-linecap: square; stroke-linejoin: miter; }
.j-reg .j-shape { transform-box: fill-box; transform-origin: center; transition: transform .6s var(--ease-back), fill .3s var(--ease-out), opacity .3s; }
.j-reg:not(.reached) .j-shape { fill: transparent !important; stroke: currentColor; stroke-width: 1.5; stroke-dasharray: 5 5; opacity: .5; }
.j-reg.reached .j-shape { stroke: none; animation: land .22s var(--ease-back) both; }
@keyframes land { 0% { transform: scale(1.15); } 100% { transform: none; } }
.j-label { font: 700 13px var(--font); font-stretch: 85%; letter-spacing: .06em; text-transform: uppercase; fill: currentColor; opacity: .7; }
.j-reg.reached .j-label { opacity: 1; font-weight: 850; }
.j-num { font: 850 76px/1 var(--font); font-stretch: 62%; fill: currentColor; }
.j-title { font: 850 22px/1 var(--font); font-stretch: 70%; letter-spacing: .02em; text-transform: uppercase; fill: currentColor; }
.j-sprite { transition: none; }
.j-no { font: 850 22px var(--font); font-stretch: 66%; fill: currentColor; opacity: .5; }
.j-reg.reached .j-no { opacity: 1; }
.j-legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 12px; list-style: none; margin: 0; padding: 4px var(--gutter) 16px; }
@media (min-width: 560px) { .j-legend { grid-template-columns: repeat(6, 1fr); } }
.j-legend li { display: grid; gap: 1px; font: 750 13px/1.15 var(--font); font-stretch: 80%; text-transform: uppercase; letter-spacing: .02em; opacity: .5; transition: opacity .4s var(--ease-out); }
.j-legend li b { font-weight: 850; font-stretch: 66%; font-size: 15px; }
.j-legend li.reached { opacity: 1; }

/* ---------- result / the finished poster ---------- */
.result { margin-top: 26px; padding-top: 22px; border-top: 1.5px solid var(--paper); animation: rise .5s var(--ease-out) both; color: var(--paper); }
.r-by { font: 650 12px var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.r-head { font-size: clamp(36px, 10vw, 56px); margin-bottom: 10px; }
.r-big { font: 850 clamp(64px, 20vw, 120px)/.85 var(--font); font-stretch: 62%; margin: 6px 0 10px; color: var(--field); }
.r-big small { font: 650 .22em var(--font); font-stretch: 85%; color: var(--paper); letter-spacing: .04em; text-transform: uppercase; }
.r-sub { color: var(--muted); }
.camp-rows { list-style: none; padding: 0; margin: 18px 0; border-top: 1px solid var(--line); }
.camp-rows li { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.camp-rows .cr-q { grid-column: 1 / -1; font: 600 12px var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.camp-rows .cr-a { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font: 700 18px/1.2 var(--font); }
.camp-rows .cr-p { font: 850 26px/1 var(--font); font-stretch: 68%; color: var(--field); align-self: center; }
.camp-rows .cr-f { grid-column: 1 / -1; font-size: 14px; color: var(--muted); margin: 0; }
.camp-rows .stamp { font-size: 13px; padding: 3px 7px 3px 5px; gap: 6px; }
.camp-rows .stamp::before { width: 30px; height: 9px; -webkit-mask: repeating-linear-gradient(90deg, #000 0 4.8px, transparent 4.8px 6px); mask: repeating-linear-gradient(90deg, #000 0 4.8px, transparent 4.8px 6px); }
.r-grid { font: 600 16px/1.5 var(--font); background: var(--ground-2); padding: 14px 16px; white-space: pre-wrap; margin: 16px 0; color: var(--paper); }
.r-acts { display: grid; gap: 8px; margin: 6px 0 18px; }
.r-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 0 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.r-stats div { padding: 12px 0; }
.r-stats div + div { padding-left: 14px; border-left: 1px solid var(--line); }
.r-stats dt { font: 650 11px var(--font); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.r-stats dd { margin: 0; font: 850 40px/1 var(--font); font-stretch: 65%; }
.r-next { font: 550 14px var(--font); color: var(--muted); margin: 0; }
.r-next b { color: var(--paper); }
.r-archive { margin-top: 16px; }
.r-archive summary { cursor: pointer; font: 650 14px var(--font); }
.r-days { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ---------- modal & toast ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: end center; padding: 0; background: rgba(10, 10, 10, .72); animation: fade .25s ease both; }
@media (min-width: 640px) { .modal { place-items: center; padding: var(--gutter); } }
.modal-card { width: min(560px, 100%); max-height: 86dvh; overflow: auto; padding: 26px var(--gutter) 22px; background: var(--ground-2); color: var(--paper); border-top: 8px solid var(--field); animation: sheetup .4s var(--ease-out) both; }
.modal-card h2 { font-size: 40px; margin-bottom: 16px; }
.modal-card textarea { width: 100%; font: 14px var(--font); margin: 8px 0 14px; padding: 10px; border: 1px solid var(--line-strong); background: var(--ground); color: var(--paper); }
.how { padding-left: 22px; margin: 0 0 20px; } .how li { margin-bottom: 10px; } .how li::marker { font-weight: 850; color: var(--field); }
@keyframes fade { from { opacity: 0; } }
@keyframes sheetup { from { transform: translateY(40px); } }
#toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 70; transform: translate(-50%, 160%); padding: 14px 18px; background: var(--paper); color: var(--ink); font: 650 14px var(--font); transition: transform .4s var(--ease-out), visibility .4s; visibility: hidden; max-width: calc(100% - 32px); text-align: center; border: 1.5px solid var(--ground); }
#toast.show { transform: translate(-50%, 0); visibility: visible; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 80; }

/* ---------- motion vocabulary (smooth, geometric) ---------- */
.take { animation: take .4s var(--ease-out) both; }
@keyframes take { 0% { transform: scale(1.08); } 100% { transform: none; } }
.nod { animation: nod .4s var(--ease-out) both; }
@keyframes nod { 0% { transform: translateY(-6px); } 100% { transform: none; } }
.deadpan { animation: deadpan .5s var(--ease-out) both; }
@keyframes deadpan { 0%, 100% { transform: none; } 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.talk { animation: nod .4s var(--ease-out); }
.thump { animation: punch .5s var(--ease-back) both; }
.cheer { animation: take .5s var(--ease-out) both; }
.blink, .lid { display: none; }
.sway { animation: none; }
#cutaway { position: fixed; inset: 0; z-index: 75; pointer-events: none; background: var(--field); clip-path: inset(0 0 0 100%); }
#cutaway.in { animation: cutin .38s var(--ease-io) both; }
#cutaway.out { animation: cutout .38s var(--ease-io) both; }
@keyframes cutin { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }
@keyframes cutout { from { clip-path: inset(0 0 0 0); } to { clip-path: inset(0 100% 0 0); } }

/* geometric host marks (replace the old cartoon characters) */
.host { width: 100%; height: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  #cutaway { display: none; }
}

/* trend lines under stats */
.r-stats small { display: block; margin-top: 4px; font: 600 12px var(--font); color: var(--muted); }
.r-stats small.up { color: var(--field); }
.r-stats small.down { color: var(--bad); }
/* legacy aliases resolve where the field is set, so older selectors follow the tale's colour */
body, .f-home, .f-vonk, .f-needle-drop, .f-cue-card, .f-the-couch, .f-once-upon, .f-field-notes, .f-logbook { --red: var(--field); --gold: var(--field-2); --accent: var(--field); }
/* the router moves focus to each view's heading for screen readers; no ring for that programmatic focus */
h1[tabindex="-1"]:focus { outline: none; }

/* ---------- photography: duotone in the tale's colour, always credited ---------- */
.duo { margin: 0; }
.duo-frame { position: relative; display: block; overflow: hidden; background: var(--field); isolation: isolate; }
.duo-frame img { display: block; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.2) brightness(1.08); mix-blend-mode: multiply; }
.duo-label { position: absolute; left: 10px; bottom: 10px; padding: 4px 8px; background: var(--ground); color: var(--paper); font: 800 13px/1 var(--font); font-stretch: 72%; letter-spacing: .04em; text-transform: uppercase; }
.duo-credit { margin-top: 6px; font: 500 11px/1.4 var(--font); color: var(--muted); }
.duo-credit a { color: inherit; }
.duo-credit a:hover { color: var(--paper); }
/* a game's header photo: full-bleed on phones, a wide band above the scene */
.g-photo { margin: 0 calc(var(--gutter) * -1) 18px; }
.g-photo .duo-frame { aspect-ratio: 16 / 9; max-height: 44svh; width: 100%; }
.g-photo .duo-credit { padding: 0 var(--gutter); }
@media (min-width: 640px) { .g-photo { margin-left: 0; margin-right: 0; } .g-photo .duo-credit { padding: 0; } }
