:root {
  --ink: #0b0b0d;
  --panel: #101013;
  --rule: #2a2723;
  --text: #efe9dd;
  --dim: #a8a092;
  --lamp: #e9a23b;
  --lamp-deep: #b9741c;
  --sys: #7ee6a1;
  --prose: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --stage-h: 57dvh;
}

/* Scrollbars (Paul, 2026-11-13: the Journal's showed as a bright white track on the dark panel). Every scrollable
   panel, on every page and every browser: a slim dark track and a muted thumb. Held by tools/fit.mjs. */
:root { color-scheme: dark; }
* { scrollbar-width: thin; scrollbar-color: rgba(239,233,221,.26) rgba(11,11,13,.55); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(11,11,13,.55); }
::-webkit-scrollbar-thumb { background: rgba(239,233,221,.24); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(239,233,221,.4); }
::-webkit-scrollbar-corner { background: transparent; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--text); }
body { font-family: var(--prose); -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.app { position: fixed; inset: 0; overflow: hidden; background: var(--ink); user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }

/* ── Stage: background art, dust, shade ── */
.stage { position: absolute; left: 0; right: 0; top: 0; height: var(--stage-h); overflow: hidden; overflow: clip; background: radial-gradient(120% 90% at 50% 30%, #2a2119 0%, #121113 55%, #0b0b0d 100%); }
.bgwrap { position: absolute; inset: -8%; transform: translate3d(calc(var(--px, 0) * 1% + var(--dx, 0px)), calc(var(--py, 0) * 1% + var(--dy, 0px)), 0) scale(var(--zoom, 1)); transform-origin: var(--zx, 50%) var(--zy, 50%); transition: transform .6s ease-out; touch-action: none; }
.bgwrap.dragging { transition: none; }
.stage { touch-action: none; cursor: grab; }
.stage.dragging { cursor: grabbing; }
.bg { position: absolute; inset: 0; background-size: cover; background-position: 50% 50%; opacity: 0; transition: opacity 1.1s ease; animation: drift 46s ease-in-out infinite alternate; will-change: transform, opacity; }
.bg.on { opacity: 1; }
@keyframes drift { from { transform: scale(1.02) translate3d(-1.2%, .4%, 0); } to { transform: scale(1.09) translate3d(1.2%, -.8%, 0); } }
.dust { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.flash { position: absolute; inset: 0; background: #d9cfbf; opacity: 0; pointer-events: none; }
.flash.go { animation: flash 1.1s ease-out; }
@keyframes flash { 0% { opacity: 0; } 8% { opacity: .75; } 100% { opacity: 0; } }
.shade { position: absolute; inset: 0; pointer-events: none; background:
  linear-gradient(to bottom, rgba(11,11,13,.55) 0%, rgba(11,11,13,0) 22%, rgba(11,11,13,0) 58%, rgba(16,16,19,.92) 92%, var(--panel) 100%),
  radial-gradient(120% 100% at 50% 45%, rgba(0,0,0,0) 45%, rgba(0,0,0,.55) 100%); }
.edgehud { position: absolute; right: 14px; top: 44%; font: 600 11px/1 var(--mono); letter-spacing: .12em; color: var(--sys); text-shadow: 0 0 10px rgba(126,230,161,.8); opacity: 0; filter: blur(1.2px); pointer-events: none; }
.edgehud.go { animation: edgehud 2.4s steps(1, end) forwards; }
@keyframes edgehudstill { 0%, 85% { opacity: .8; } 100% { opacity: 0; } }
@keyframes edgehud { 0% { opacity: 0; } 6% { opacity: .9; } 12% { opacity: .1; } 18% { opacity: .95; } 46% { opacity: .8; } 52% { opacity: .15; } 58% { opacity: .7; } 70% { opacity: 0; } 100% { opacity: 0; } }

.app.shake .stage, .app.shake .panel, .app.shake .portrait { animation: shake .85s cubic-bezier(.3,.1,.3,1); }
@keyframes shake {
  0% { transform: translate3d(0,0,0); } 8% { transform: translate3d(-9px, 6px, 0) rotate(-.5deg); } 16% { transform: translate3d(8px, -7px, 0) rotate(.5deg); }
  26% { transform: translate3d(-7px, -4px, 0); } 36% { transform: translate3d(6px, 5px, 0) rotate(.3deg); } 48% { transform: translate3d(-5px, 3px, 0); }
  60% { transform: translate3d(4px, -3px, 0); } 74% { transform: translate3d(-2px, 2px, 0); } 88% { transform: translate3d(1px, -1px, 0); } 100% { transform: translate3d(0,0,0); }
}

/* ── Portrait card ── */
.portrait { position: absolute; z-index: 3; margin: 0; left: 16px; top: calc(var(--stage-h) - 158px); width: 104px; opacity: 0; transform: translateY(10px); transition: opacity .35s ease, transform .35s ease; pointer-events: none; }
.portrait.on { opacity: 1; transform: none; }
.portrait.tucked { visibility: hidden; }   /* no room above the panel: not a sliver behind the words (main.js, measurePanel) */
.portrait-img { width: 100%; aspect-ratio: 3 / 4; border-radius: 6px; background: #1a1714 center 18% / cover no-repeat; border: 1px solid rgba(233,162,59,.55); box-shadow: 0 10px 30px rgba(0,0,0,.7), 0 0 0 4px rgba(11,11,13,.55); }
.portrait figcaption { margin-top: 6px; font: 700 11px/1 var(--ui); letter-spacing: .16em; text-transform: uppercase; color: var(--lamp); text-shadow: 0 1px 6px #000; }

/* On a phone the choice list grows upward; lift the portrait so its name stays clear of it. */
.portrait { top: auto; bottom: min(calc(var(--panel-h, 43dvh) - 8px), calc(100dvh - var(--portrait-clear, 230px))); }   /* rides on top of the text panel, however tall it gets */

/* ── Tools ── */
.tools { position: absolute; z-index: 6; top: calc(10px + env(safe-area-inset-top)); right: 10px; display: flex; gap: 8px; }
.tool { min-height: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid rgba(239,233,221,.22); background: rgba(11,11,13,.62); font: 600 12px/1 var(--ui); letter-spacing: .04em; color: var(--text); cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.tool:hover { border-color: var(--lamp); }
.tool[aria-pressed="true"] { color: var(--dim); }
.app[data-mode="gate"] .tools, .app[data-timed="1"] .tools, .app[data-timed="1"] .recintro { display: none; }   /* the record's note goes with its button */
.tool span { color: var(--lamp); margin-right: 2px; }

/* ── Text panel ── */
.panel { position: absolute; z-index: 4; left: 0; right: 0; bottom: 0; min-height: calc(100dvh - var(--stage-h) + 6px); max-height: 94dvh; overflow-y: auto; padding: 14px 20px calc(18px + env(safe-area-inset-bottom)); background: linear-gradient(to bottom, rgba(16,16,19,0) 0, var(--panel) 26px); cursor: pointer; display: flex; flex-direction: column; }
.ctx { margin: 10px 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--rule); font: 700 11.5px/1.35 var(--ui); letter-spacing: .09em; text-transform: uppercase; color: var(--lamp); min-height: 1.35em; }
.speaker { margin: 0 0 4px; font: 700 12px/1 var(--ui); letter-spacing: .16em; text-transform: uppercase; color: var(--lamp); }
/* The panel is a column that scrolls. Nothing in it may be squeezed: a squeezed passage spills over the question and
   the choices under it (Chapter 3 Scene 4 on a phone, 2026-11-13). A screen taller than the panel scrolls instead,
   and its top edge fades while there is text above (.scrolled, set in src/ui/main.js). */
.panel > * { flex-shrink: 0; }
.panel.scrolled { -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 30px); mask-image: linear-gradient(to bottom, transparent 0, #000 30px); }
.panel.below { -webkit-mask-image: linear-gradient(to top, transparent 0, #000 36px); mask-image: linear-gradient(to top, transparent 0, #000 36px); }
.panel.scrolled.below { -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 30px, #000 calc(100% - 36px), transparent 100%); mask-image: linear-gradient(to bottom, transparent 0, #000 30px, #000 calc(100% - 36px), transparent 100%); }
/* On a phone the panel stops short of what sits at the top of the screen: the Settings button, and the narrator's
   face and name in a chapter someone else tells (the name sat on the scene label, same day). */
@media not ((min-width: 1040px) and (min-height: 560px)) {
  .panel { max-height: min(94dvh, calc(100dvh - 54px - env(safe-area-inset-top))); }
  .app.has-pov .panel { max-height: calc(100dvh - 92px - env(safe-area-inset-top)); }
}
.text { margin: 0; font-size: 18.5px; line-height: 1.55; color: var(--text); text-wrap: pretty; min-height: 3.1em; }
.text .rest { visibility: hidden; }
.text.spoken { font-size: 20px; }
.text.consequence { font: 500 16.5px/1.5 var(--ui); color: #f3d7a6; padding: 10px 12px 10px 14px; border-left: 3px solid var(--lamp); background: rgba(233,162,59,.08); border-radius: 0 6px 6px 0; min-height: 0; }
.text.consequence::before { content: "◆ "; color: var(--lamp); }
.text.system { font: 600 15px/1.6 var(--mono); color: var(--sys); }
/* While a choice is up the passage keeps its size and contrast (UX-RULES R4); after the pick it steps back in
   contrast only, for the moment before the next screen. */
.app[data-mode="choice"] .text { min-height: 0; }
.text.past { color: var(--dim); transition: color .25s ease; }
.timer.held { opacity: .85; }
/* The story's own window: the last half of the bar, faster, and it changes so "now it is real" reads at a glance. */
.timer.urgent { background: #3a1712; box-shadow: 0 0 0 1px rgba(255,90,60,.55), 0 0 14px rgba(255,70,40,.35); }
.timer.urgent .timerbar { background: linear-gradient(90deg, #ff3b1f, #ff7a45); animation: urgentpulse .5s ease-in-out infinite alternate; }
@keyframes urgentpulse { from { filter: brightness(1); } to { filter: brightness(1.45); } }
@media (prefers-reduced-motion: reduce) { .timer.urgent .timerbar { animation: none; } }
/* Continue: the one place a tap moves the story on (with the text panel itself). A big target on phones. */
.more { display: block; width: 100%; min-height: 56px; margin: auto 0 0; padding: 0 4px; border: 0; border-top: 1px solid transparent; background: none; text-align: right; font: 600 11px/1 var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); opacity: 0; transition: opacity .25s; cursor: pointer; }
.more.on { opacity: 1; border-top-color: var(--rule); }
.more:focus-visible { outline: 2px solid var(--lamp); outline-offset: -2px; border-radius: 6px; }
.more span { display: inline-block; color: var(--lamp); animation: nudge 1.2s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(4px); } }

/* ── Choices ── */
.choicebox { margin-top: 14px; }
.ask { margin: 0 0 10px; font: 700 16.5px/1.35 var(--ui); color: var(--text); }
.timer { height: 6px; border-radius: 3px; background: #2a2723; overflow: hidden; margin: 0 0 12px; }
.timerbar { height: 100%; width: 100%; background: linear-gradient(90deg, #d9482b, var(--lamp)); transform-origin: left center; }
.choices { display: grid; gap: 10px; }
.choice { display: block; width: 100%; min-height: 54px; padding: 12px 16px; text-align: left; border-radius: 8px; border: 1px solid rgba(233,162,59,.5); background: linear-gradient(180deg, #1d1a16, #151311); font: 600 17.5px/1.3 var(--prose); color: var(--text); cursor: pointer; opacity: 0; transform: translateY(6px); transition: opacity .25s ease, transform .25s ease, border-color .15s, background .15s; }
.choices.ready .choice { opacity: 1; transform: none; }
.choices:not(.ready) .choice:not(.hold) { pointer-events: none; }   /* a hold takes a press at once: it cannot go off by accident */
/* A hold shown with its passage, when they do not both fit: the choices sit at the foot of the panel, on its own colour, and the words scroll above them (src/ui/main.js, pinChoices). */
.choicebox.pinned { position: sticky; bottom: calc(-18px - env(safe-area-inset-bottom)); z-index: 2; margin: 14px -20px calc(-18px - env(safe-area-inset-bottom)); padding: 10px 20px calc(18px + env(safe-area-inset-bottom)); background: var(--panel); box-shadow: 0 -14px 18px -6px var(--panel); }
.choice:hover, .choice:focus-visible { border-color: var(--lamp); background: linear-gradient(180deg, #2a2118, #1b1612); outline: none; }
.choice:active { transform: scale(.985); }
.choice kbd { float: right; margin-left: 10px; font: 600 11px/1.9 var(--ui); color: var(--dim); display: none; }

/* ── Gate ── */
.gate { position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; background: var(--ink); transition: opacity .6s ease; }
/* The title screen: the buttons centred in the first screenful, "Support the build" below them, then the foot (it scrolls,
   never squeezes; UX L3). */
.gate.out { opacity: 0; pointer-events: none; }
.gate-lamp { position: absolute; left: 50%; top: 42%; width: 120vmin; height: 120vmin; transform: translate(-50%, -50%); background: radial-gradient(closest-side, rgba(233,162,59,.20), rgba(233,162,59,.05) 45%, rgba(0,0,0,0) 70%); animation: lamp 5s ease-in-out infinite; pointer-events: none; }
@keyframes lamp { 50% { opacity: .72; } }
.gate-inner { position: relative; flex: 1 0 auto; min-height: 100%; box-sizing: border-box; display: grid; align-content: center; justify-items: center; gap: 14px; padding: 28px 16px; }
.gate-new { margin: 2px 0 0; max-width: min(420px, 88vw); font: 600 13px/1.45 var(--ui); color: var(--text); text-align: center; }
.gate-new a { color: var(--lamp); text-underline-offset: 3px; }
.gate-savenote { margin: 0; max-width: min(420px, 88vw); font: 500 12.5px/1.45 var(--ui); color: var(--dim); text-align: center; }
.gate-support { position: relative; flex: none; width: min(560px, calc(100% - 32px)); box-sizing: border-box; }
.gate-btn { min-width: 220px; min-height: 60px; padding: 0 28px; border-radius: 30px; border: 1px solid var(--lamp); background: rgba(233,162,59,.1); font: 700 15px/1 var(--ui); letter-spacing: .2em; text-transform: uppercase; color: var(--text); cursor: pointer; }
.gate-btn:hover { background: rgba(233,162,59,.2); }
.gate-alt { background: none; border: 0; padding: 10px 14px; font: 600 13px/1 var(--ui); letter-spacing: .08em; color: var(--dim); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.gate-note { margin: 4px 0 0; font: 500 13px/1.4 var(--ui); color: var(--dim); }
.gate-foot { position: relative; flex: none; margin: 4px 0 calc(20px + env(safe-area-inset-bottom)); text-align: center; font: 600 11px/1 var(--ui); letter-spacing: .18em; text-transform: uppercase; color: #6f695e; }

/* ── End card ── */
.end { position: absolute; inset: 0; z-index: 9; overflow-y: auto; background: linear-gradient(180deg, rgba(11,11,13,.955) 0%, rgba(11,11,13,.985) 30%, var(--ink) 100%); animation: fadein .9s ease both; -webkit-overflow-scrolling: touch; }
@keyframes fadein { from { opacity: 0; } }
.end-inner { max-width: 560px; margin: 0 auto; padding: calc(56px + env(safe-area-inset-top)) 22px calc(24px + env(safe-area-inset-bottom)); }
.hud { border: 1px solid rgba(126,230,161,.55); border-radius: 4px; padding: 11px 14px 9px; font-family: var(--mono); color: var(--sys); background: rgba(126,230,161,.04); box-shadow: 0 0 24px rgba(126,230,161,.12), inset 0 0 18px rgba(126,230,161,.06); animation: hudflicker 4.2s steps(1, end) infinite; }
@keyframes hudflicker { 0% { opacity: .15; } 4% { opacity: .9; } 7% { opacity: .3; } 10% { opacity: 1; } 55% { opacity: 1; } 57% { opacity: .45; } 59% { opacity: 1; } 86% { opacity: 1; } 88% { opacity: .2; } 91% { opacity: .95; } 100% { opacity: 1; } }
.hud.lit { animation: hudboot 1.6s steps(1, end) both; display: flex; align-items: flex-end; gap: 6px; }
@keyframes hudboot { 0% { opacity: 0; } 8% { opacity: .9; } 14% { opacity: .2; } 22% { opacity: 1; } 40% { opacity: .55; } 46% { opacity: 1; } 100% { opacity: 1; } }
.hudlines { font: 600 12.5px/1.7 var(--mono); letter-spacing: .08em; color: var(--sys); text-shadow: 0 0 10px rgba(126,230,161,.55); }
.hud-cursor { font: 600 12.5px/1.7 var(--mono); color: var(--sys); animation: blink 1.1s steps(1, end) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.end-kicker { margin: 18px 0 6px; font: 600 12px/1.4 var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--sys); }
.end-next { margin: -10px 0 22px; font: 500 15px/1.4 var(--ui); color: var(--dim); }
.end-title { margin: 0 0 16px; font: 700 30px/1.12 var(--prose); letter-spacing: -.01em; color: var(--text); text-wrap: balance; }
.end-sub { margin: 0 0 10px; font: 700 11.5px/1 var(--ui); letter-spacing: .16em; text-transform: uppercase; color: var(--lamp); }
.recap { list-style: none; margin: 0 0 20px; padding: 0; border-top: 1px solid var(--rule); }
.recap li { padding: 8px 0; border-bottom: 1px solid var(--rule); }
.recap .did { display: block; font: 700 10.5px/1.35 var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); margin-bottom: 3px; }
.recap .got { display: block; font: 600 16.5px/1.3 var(--prose); color: var(--text); }
.again { display: block; width: 100%; min-height: 58px; border-radius: 8px; border: 1px solid var(--lamp); background: var(--lamp); color: #17110a; font: 800 15px/1 var(--ui); letter-spacing: .16em; text-transform: uppercase; cursor: pointer; }
.again:hover { background: #f4b454; }
.end-hint { margin: 10px 0 18px; font: 500 14px/1.45 var(--ui); color: var(--dim); text-align: center; }
/* End card: the choice map link and Support the build (Milestone 4) */
.maplink { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; margin: 0 0 22px; border-radius: 8px; border: 1px solid rgba(233,162,59,.5); color: var(--text); font: 700 14px/1 var(--ui); letter-spacing: .1em; text-transform: uppercase; text-decoration: none; background: rgba(233,162,59,.06); }
.maplink:hover, .maplink:focus-visible { background: rgba(233,162,59,.14); border-color: var(--lamp); }
.support { margin: 0 0 18px; padding: 16px 0 4px; border-top: 1px solid var(--rule); }
.support-title { margin: 0 0 8px; font: 700 11.5px/1 var(--ui); letter-spacing: .16em; text-transform: uppercase; color: var(--lamp); }
.support-text { margin: 0 0 12px; font: 500 14px/1.45 var(--ui); color: var(--dim); }
.support-addr { margin: 0 0 8px; border: 1px solid var(--rule); border-radius: 8px; }
.support-addr summary { min-height: 44px; display: flex; align-items: center; padding: 0 14px; font: 600 14px/1.2 var(--ui); color: var(--text); cursor: pointer; }
.support-code { display: flex; gap: 10px; align-items: flex-start; padding: 0 12px 12px; }
.support-code code { flex: 1; min-width: 0; overflow-wrap: anywhere; font: 500 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text); user-select: text; -webkit-user-select: text; }
.support-copy { flex: none; min-height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid rgba(239,233,221,.28); background: transparent; font: 700 12px/1 var(--ui); letter-spacing: .06em; color: var(--text); cursor: pointer; }
.support-copy:hover { border-color: var(--lamp); }
.credit { margin: 0; padding-top: 16px; border-top: 1px solid var(--rule); font: 500 13px/1.4 var(--ui); color: var(--dim); text-align: center; }

/* ── Wide screens: art fills the window, text box sits low and centred ── */
@media (min-width: 1040px) and (min-height: 560px) {
  :root { --stage-h: 100dvh; }
  .shade { background:
    linear-gradient(to bottom, rgba(11,11,13,.5) 0%, rgba(11,11,13,0) 20%, rgba(11,11,13,0) 45%, rgba(11,11,13,.88) 100%),
    radial-gradient(110% 100% at 50% 40%, rgba(0,0,0,0) 40%, rgba(0,0,0,.6) 100%); }
  .panel { left: 50%; right: auto; bottom: 36px; width: 760px; transform: translateX(-50%); min-height: 268px; max-height: 80dvh; padding: 10px 32px 20px; border-radius: 10px; border: 1px solid rgba(239,233,221,.12); background: rgba(13,13,16,.9); box-shadow: 0 30px 80px rgba(0,0,0,.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
  .app.shake .panel { animation-name: shakewide; }
  .choicebox.pinned { bottom: -20px; margin: 14px -32px -20px; padding: 10px 32px 20px; background: #101013; border-radius: 0 0 10px 10px; box-shadow: 0 -14px 18px -6px #101013; }
  @keyframes shakewide {
    0% { transform: translateX(-50%); } 8% { transform: translateX(calc(-50% - 10px)) translateY(7px); } 16% { transform: translateX(calc(-50% + 9px)) translateY(-8px); }
    26% { transform: translateX(calc(-50% - 8px)) translateY(-4px); } 36% { transform: translateX(calc(-50% + 7px)) translateY(5px); } 48% { transform: translateX(calc(-50% - 5px)) translateY(3px); }
    60% { transform: translateX(calc(-50% + 4px)) translateY(-3px); } 74% { transform: translateX(calc(-50% - 2px)) translateY(2px); } 100% { transform: translateX(-50%); }
  }
  .text { font-size: 21px; line-height: 1.6; }
  .text.spoken { font-size: 23px; }
  .text.consequence { font-size: 18px; }
  .ctx { font-size: 12.5px; margin-top: 12px; }
  .ask { font-size: 18px; }
  .choices { grid-auto-flow: column; grid-auto-columns: 1fr; }
  .choice { min-height: 64px; font-size: 18px; }
  .choice kbd { display: inline; }
  .portrait { left: auto; right: calc(50% + 380px + 22px); top: auto; bottom: 36px; width: 200px; }

  .portrait figcaption { font-size: 12px; margin-top: 8px; }
  .tools { top: 18px; right: 20px; }
  .edgehud { right: 9%; top: 30%; font-size: 14px; }
  .end-inner { padding-top: 9vh; }
  .end-title { font-size: 44px; }
}
@media (min-width: 1040px) and (min-height: 560px) and (max-width: 1239px) {
  .panel { width: 640px; }
  .portrait { right: calc(50% + 320px + 18px); width: 164px; }
}
@media (max-height: 620px) and (max-width: 1039px) { :root { --stage-h: 38dvh; } .portrait { width: 84px; }
  .stage:has(.hudframe.on) .edgehud { display: none; }   /* the short stage has no room for the edge flash beside the interface's frame */
}

@media (prefers-reduced-motion: reduce) {
  .bg { animation: none; transition: opacity .2s linear; }
  .bgwrap { transform: none; transition: none; }
  .app.shake .stage, .app.shake .panel, .app.shake .portrait { animation: none; }
  .flash.go { animation: none; }
  .hud, .gate-lamp, .more span { animation: none; }
  .edgehud.go { animation: edgehudstill 2.4s linear forwards; }   /* no flicker: shown, then gone, as it is with motion on (it used to stay, under the interface's frame) */
  .portrait, .choice { transition: none; }
  .end { animation: none; }
}

/* End card owns the screen: nothing from the scene shows through it. */
.app[data-mode="end"] .panel, .app[data-mode="end"] .portrait, .app[data-mode="end"] .edgehud { display: none; }

/* ── The System's frame, lit on the stage once the interface stays ── */
.hudframe { position: absolute; z-index: 2; left: 16px; right: 16px; top: calc(58px + env(safe-area-inset-top)); padding: 10px 12px; display: none; align-items: flex-end; gap: 6px; border: 1px solid rgba(126,230,161,.6); border-radius: 4px; background: rgba(8,14,11,.72); box-shadow: 0 0 26px rgba(126,230,161,.18), inset 0 0 18px rgba(126,230,161,.07); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); pointer-events: none; }
.hudframe.on { display: flex; animation: hudboot 1.6s steps(1, end) both; }
.hudframe .hudlines div { white-space: normal; overflow-wrap: anywhere; }
.app[data-mode="end"] .hudframe { display: none; }

/* ── Tremor and light flicker ── */
.app.tremor .stage, .app.tremor .panel, .app.tremor .portrait { animation: tremor 2.8s ease-in-out; }
@keyframes tremor {
  0%, 100% { transform: translate3d(0,0,0); } 6% { transform: translate3d(-2px, 1px, 0); } 12% { transform: translate3d(2px, -2px, 0); } 20% { transform: translate3d(-3px, 2px, 0); }
  28% { transform: translate3d(3px, 1px, 0); } 36% { transform: translate3d(-3px, -2px, 0); } 46% { transform: translate3d(2px, 2px, 0); } 56% { transform: translate3d(-2px, -1px, 0); }
  66% { transform: translate3d(2px, 1px, 0); } 78% { transform: translate3d(-1px, 1px, 0); } 90% { transform: translate3d(1px, 0, 0); }
}
.stage.flicker .bgwrap { animation: flicker 1.5s steps(1, end); }
@keyframes flicker { 0% { filter: brightness(1); } 10% { filter: brightness(.25); } 18% { filter: brightness(1); } 44% { filter: brightness(1); } 52% { filter: brightness(.15); } 62% { filter: brightness(.9); } 66% { filter: brightness(.4); } 72% { filter: brightness(1); } 100% { filter: brightness(1); } }

/* ── Settings sheet: the only menu in Chapter 1 ── */
.sheet { position: absolute; inset: 0; z-index: 20; display: grid; place-items: end center; background: rgba(5,5,7,.72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fadein .2s ease both; }
.sheet-card { width: 100%; max-width: 460px; padding: 20px 20px calc(18px + env(safe-area-inset-bottom)); background: #15151a; border: 1px solid rgba(239,233,221,.14); border-bottom: 0; border-radius: 14px 14px 0 0; font-family: var(--ui); box-shadow: 0 -20px 60px rgba(0,0,0,.6); }
.sheet-card h2 { margin: 0 0 12px; font: 700 12px/1 var(--ui); letter-spacing: .16em; text-transform: uppercase; color: var(--lamp); }
.sheet-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; border-top: 1px solid var(--rule); font: 600 16px/1.2 var(--ui); color: var(--text); }
.segs { display: inline-flex; border: 1px solid rgba(239,233,221,.22); border-radius: 8px; overflow: hidden; }
.segs button { min-width: 62px; min-height: 40px; padding: 0 12px; border: 0; border-left: 1px solid rgba(239,233,221,.14); background: transparent; font: 600 14px/1 var(--ui); color: var(--dim); cursor: pointer; }
.segs button:first-child { border-left: 0; }
.segs button[aria-pressed="true"] { background: var(--lamp); color: #17110a; }
.sheet-link { min-height: 40px; padding: 0 2px; border: 0; background: none; font: 600 15px/1 var(--ui); color: #f0b56a; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.sheet-confirm { padding: 4px 0 12px; }
.sheet-confirm p { margin: 0 0 12px; font: 500 15px/1.45 var(--ui); color: var(--text); }
.sheet-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sheet-btn { width: 100%; min-height: 50px; border-radius: 8px; border: 1px solid rgba(239,233,221,.24); background: transparent; font: 700 14px/1 var(--ui); letter-spacing: .06em; color: var(--text); cursor: pointer; }
.sheet-btn.primary { margin-top: 14px; border-color: var(--lamp); background: rgba(233,162,59,.12); }
.sheet-btn.warn { border-color: #d9482b; color: #ff9c86; }
.sheet-note { margin: 12px 0 0; text-align: center; font: 500 12.5px/1.4 var(--ui); color: var(--dim); }

@media (min-width: 1040px) and (min-height: 560px) {
  .hudframe { left: auto; right: 5%; top: 14%; width: 400px; padding: 14px 16px; }
  .hudlines, .hud-cursor { font-size: 14px; }
  .sheet { place-items: center; }
  .sheet-card { border-bottom: 1px solid rgba(239,233,221,.14); border-radius: 14px; padding-bottom: 20px; }
  .end-next { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .app.tremor .stage, .app.tremor .panel, .app.tremor .portrait { animation: none; }
  .stage.flicker .bgwrap { animation: none; }
  .hud.lit, .hudframe.on, .hud-cursor, .sheet { animation: none; }
}

/* ── Several paragraphs on one screen (Scene 4 on) ── */
.text .para { display: block; }
.text .para + .para { margin-top: .55em; }
.text .para.note { font: 500 16px/1.45 var(--ui); color: #f3d7a6; padding: 9px 12px 9px 14px; border-left: 3px solid var(--lamp); background: rgba(233,162,59,.08); border-radius: 0 6px 6px 0; margin-top: .8em; }
.text .para.note::before { content: "◆ "; color: var(--lamp); }
.text .para.note:not(.in) { visibility: hidden; }
.text.system .para + .para { margin-top: 0; }

/* ── One-button actions and press-and-hold ── */
.choices.single .choice { text-align: center; min-height: 62px; border-color: var(--lamp); }
.choice.hold { position: relative; overflow: hidden; touch-action: none; -webkit-touch-callout: none; padding: 10px 16px; }
.choice.hold .hold-fill { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(233,162,59,.55), rgba(233,162,59,.85)); transform: scaleX(0); transform-origin: left center; pointer-events: none; }
.choice.hold .hold-label { position: relative; display: block; }
.choice.hold small { position: relative; display: block; margin-top: 2px; font: 700 10.5px/1.2 var(--ui); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.choice.hold.down { border-color: #ffd08a; }
.choice.tap small { display: block; margin-top: 3px; font: 700 10.5px/1.2 var(--ui); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }   /* a tap against the clock says so (4·6·2) */
.choice.hold.down small, .choice.hold.done small { color: #17110a; }
.choice.hold.done .hold-label, .choice.hold.down .hold-label { text-shadow: 0 1px 2px rgba(0,0,0,.6); }
@media (min-width: 1040px) and (min-height: 560px) {
  .text .para.note { font-size: 17px; }
  .choices.single { grid-auto-columns: minmax(0, 420px); justify-content: center; }
}

/* ── Milestone 5 ── */
/* Scene label: where you are */
.crumb { margin: 6px 0 -4px; font: 600 10.5px/1.3 var(--ui); letter-spacing: .08em; color: var(--dim); min-height: 1.3em; }
/* A spoken paragraph inside a fuller screen: the speaker's name, then the words */
.para .who { display: block; margin: 0 0 2px; font: 700 11px/1.2 var(--ui); letter-spacing: .16em; text-transform: uppercase; color: var(--lamp); }
/* Things on the art that can be touched */
.spots { position: absolute; inset: 0; pointer-events: none; }
.spot { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; pointer-events: auto; }
.spot::after { content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: rgba(255,214,140,.55); box-shadow: 0 0 10px 3px rgba(233,162,59,.45); animation: glint 2.8s ease-in-out infinite; }
.spot:focus-visible { outline: 2px solid var(--lamp); }
@keyframes glint { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: .95; transform: scale(1.15); } }
.spotline { position: absolute; z-index: 3; left: 16px; right: 16px; top: 34%; margin: 0; padding: 10px 14px; border-left: 3px solid var(--lamp); border-radius: 0 6px 6px 0; background: rgba(11,11,13,.86); font: 500 15px/1.45 var(--prose); color: var(--text); box-shadow: 0 10px 30px rgba(0,0,0,.6); animation: fadein .25s ease both; pointer-events: none; }
/* The System button and its pages */
.tool.sys { border-color: rgba(126,230,161,.6); color: var(--sys); }
.tool.sys.new { animation: syspulse 1.4s ease-in-out 3; }
@keyframes syspulse { 0%, 100% { box-shadow: none; } 50% { box-shadow: 0 0 0 4px rgba(126,230,161,.28), 0 0 18px rgba(126,230,161,.5); } }
.syssheet .sheet-card { max-width: 560px; max-height: 88dvh; display: flex; flex-direction: column; padding-bottom: calc(12px + env(safe-area-inset-bottom)); border-color: rgba(126,230,161,.35); background: #0d1210; }
.syssheet h2 { color: var(--sys); }
.systabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 0 12px; }
.systabs button { min-height: 44px; border-radius: 6px; border: 1px solid rgba(126,230,161,.3); background: transparent; font: 700 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: rgba(126,230,161,.7); cursor: pointer; }
.systabs button[aria-selected="true"] { background: rgba(126,230,161,.14); border-color: var(--sys); color: var(--sys); }
.syspage { overflow-y: auto; flex: 1; min-height: 0; padding: 2px 2px 8px; user-select: text; -webkit-user-select: text; }
.sysline { margin: 0; font: 600 13.5px/1.75 var(--mono); letter-spacing: .04em; color: var(--sys); overflow-wrap: anywhere; }
.sysline.dim { color: rgba(126,230,161,.6); }
.sysline.why { padding-left: 14px; font-weight: 500; color: rgba(126,230,161,.72); }
.syshead { margin: 14px 0 4px; font: 700 10.5px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: rgba(126,230,161,.6); }
.syshead:first-child { margin-top: 0; }
.jentry { margin: 0 0 12px; padding: 0 0 10px; border-bottom: 1px solid rgba(126,230,161,.14); }
.jentry .jq { margin: 0 0 3px; font: 600 12.5px/1.35 var(--ui); color: var(--dim); }
.jentry .ja { margin: 0; font: 600 16px/1.35 var(--prose); color: var(--text); }
.jentry .jn { margin: 3px 0 0; font: italic 500 14.5px/1.4 var(--prose); color: #f3d7a6; }
.jthread { margin: 0 0 6px; padding-left: 12px; border-left: 2px solid var(--sys); font: 500 15px/1.4 var(--prose); color: var(--text); }
/* The Sight */
.sight { position: absolute; inset: 0; z-index: 15; background: #050506; overflow: hidden; touch-action: none; animation: fadein .5s ease both; }
.sight-art { position: absolute; inset: 0; background-size: cover; background-position: 50% 50%; opacity: .07; filter: grayscale(1); }
.sight-marks, .sight-lens { position: absolute; inset: 0; pointer-events: none; }
.sight-lens { background: radial-gradient(circle 92px at var(--lx, 50%) var(--ly, 40%), rgba(233,162,59,.16), rgba(233,162,59,.05) 60%, transparent 100%); }
.sight-marks { -webkit-mask-image: radial-gradient(circle 100px at var(--lx, 50%) var(--ly, 40%), #000 35%, transparent 100%); mask-image: radial-gradient(circle 100px at var(--lx, 50%) var(--ly, 40%), #000 35%, transparent 100%); }
.sight-t { position: absolute; width: 120px; height: 120px; margin: -60px 0 0 -60px; }
.sight-t svg { width: 100%; height: 100%; overflow: visible; }
.sight-t path { fill: none; stroke: #e9a23b; stroke-width: 1.4; stroke-linecap: round; opacity: .85; }
.sight-hit { position: absolute; width: 96px; height: 96px; margin: -48px 0 0 -48px; border: 0; border-radius: 50%; background: none; padding: 0; }
.sight-hit.read::after { content: ""; position: absolute; inset: 34px; border-radius: 50%; background: rgba(255,214,140,.9); box-shadow: 0 0 18px 6px rgba(233,162,59,.6); }
.sight-hit:focus-visible { outline: 2px solid var(--lamp); }
.sight-hint { position: absolute; left: 20px; right: 20px; top: calc(18px + env(safe-area-inset-top)); margin: 0; font: 600 12px/1.4 var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); text-align: center; }
.sight-read { position: absolute; left: 20px; right: 20px; bottom: calc(92px + env(safe-area-inset-bottom)); margin: 0; padding: 0; list-style: none; }
.sight-few .sight-read li:not(:nth-last-child(-n+2)) { display: none; }   /* a short screen keeps the last two lines read (src/ui/sight.js, fit) */
.sight-read li { margin: 6px 0 0; font: 500 16px/1.4 var(--prose); color: var(--text); animation: fadein .4s ease both; }
.sight-open { position: absolute; left: 20px; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); min-height: 56px; border-radius: 8px; border: 1px solid var(--lamp); background: rgba(233,162,59,.1); font: 700 14px/1 var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--text); cursor: pointer; }
/* End card: next chapter, the book list */
.again.next { margin: 0 0 22px; background: transparent; color: var(--text); border-color: var(--sys); }
.again.next:hover { background: rgba(126,230,161,.1); }
.booklist { list-style: none; margin: 0 0 20px; padding: 0; border-top: 1px solid var(--rule); }
.booklist li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--rule); font: 500 14.5px/1.3 var(--ui); color: var(--text); }
.booklist .mark { flex: none; font: 600 12px/1.6 var(--ui); letter-spacing: .06em; color: var(--dim); }
.booklist .mark.book { color: var(--lamp); }
.end-links { margin: 0 0 12px; text-align: center; font: 500 13px/1.4 var(--ui); }
.end-links a { color: var(--dim); }
@media (min-width: 1040px) and (min-height: 560px) { .more { min-height: 44px; } .spotline { left: 28px; right: auto; max-width: 420px; } }
@media (prefers-reduced-motion: reduce) { .spot::after, .tool.sys.new, .sight, .spotline { animation: none; } .bgwrap { transition: none; } }

.portrait[data-look="amber"] .portrait-img { filter: sepia(.5) saturate(1.5) hue-rotate(-14deg) brightness(.9); }
/* ── Chapter 3 (Kade): his record in the interface's place, and the math in layers ── */
.tool.rec { border-color: rgba(233,162,59,.6); color: var(--lamp); }
.tool.rec.new { animation: recpulse 1.4s ease-in-out 2; }
@keyframes recpulse { 0%, 100% { box-shadow: none; } 50% { box-shadow: 0 0 0 4px rgba(233,162,59,.24), 0 0 18px rgba(233,162,59,.45); } }
.recsheet .sheet-card { max-width: 560px; max-height: 88dvh; display: flex; flex-direction: column; padding-bottom: calc(12px + env(safe-area-inset-bottom)); border-color: rgba(233,162,59,.35); background: #131110; }
.recpage { overflow-y: auto; flex: 1; min-height: 0; padding: 2px 2px 8px; user-select: text; -webkit-user-select: text; }
.recline { margin: 0 0 9px; padding-left: 12px; border-left: 2px solid var(--lamp-deep); font: 500 16px/1.4 var(--prose); color: var(--text); overflow-wrap: break-word; }
.recline.dim { border-left-color: var(--rule); color: var(--dim); }
.rechead { margin: 16px 0 6px; font: 700 10.5px/1 var(--ui); letter-spacing: .18em; text-transform: uppercase; color: var(--dim); }
.recnote { margin: 0 0 6px; font: italic 500 14.5px/1.4 var(--prose); color: #f3d7a6; overflow-wrap: break-word; }
.recordlist { list-style: none; margin: 0 0 20px; padding: 0; border-top: 1px solid var(--rule); }
.recordlist li { padding: 8px 0 8px 12px; border-bottom: 1px solid var(--rule); border-left: 2px solid var(--lamp-deep); font: 500 15.5px/1.4 var(--prose); color: var(--text); overflow-wrap: break-word; }
.layers { position: absolute; inset: 0; z-index: 15; display: flex; flex-direction: column; gap: 10px; padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom)); background: #050506; overflow: hidden; touch-action: none; animation: fadein .5s ease both; }
.layers-art { position: absolute; inset: 0; background-size: cover; background-position: 50% 50%; opacity: .06; filter: grayscale(1); pointer-events: none; }
.layers-hint { position: relative; margin: 0; min-height: 2.8em; font: 600 12px/1.4 var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); text-align: center; }
.layers-stack { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; max-width: 640px; width: 100%; margin: 0 auto; }
.layer { position: relative; flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 10px 14px 10px 20px; border: 1px solid rgba(239,233,221,.12); border-radius: 6px; text-align: left; color: var(--text); cursor: pointer; overflow: hidden; touch-action: none; -webkit-user-select: none; user-select: none; }
.layer-0 { background: repeating-linear-gradient(172deg, #1b1815 0 9px, #17140f 9px 21px); }
.layer-1 { background: repeating-linear-gradient(176deg, #15171b 0 13px, #111317 13px 24px); }
.layer-2 { background: repeating-linear-gradient(169deg, #121113 0 7px, #0d0c0e 7px 19px); }
.layer-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--lamp); transform: scaleY(0); transform-origin: 50% 0; }
.layer-label { font: 700 11px/1.2 var(--ui); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.layer-line { font: 500 16.5px/1.35 var(--prose); color: var(--text); opacity: 0; transition: opacity .5s ease; overflow-wrap: break-word; }
.layer.read { border-color: rgba(233,162,59,.45); cursor: default; }
.layer.read .layer-label { color: var(--lamp); }
.layer.read .layer-line { opacity: 1; }
.layer:focus-visible { outline: 2px solid var(--lamp); outline-offset: -2px; }
.layers-done { position: relative; flex: none; width: 100%; max-width: 640px; margin: 0 auto; min-height: 56px; border-radius: 8px; border: 1px solid var(--lamp); background: rgba(233,162,59,.1); font: 700 14px/1.2 var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--text); cursor: pointer; }
.layers-done[hidden] { display: block; visibility: hidden; }
@media (max-height: 460px) { .layers-stack { flex-direction: row; max-width: none; } .layer-line { font-size: 14.5px; } .layers-hint { min-height: 1.4em; } .layers-done { min-height: 48px; } }
/* Chapter 2: one place where the Sight reads nothing. The lens goes dark over it. */
.sight-blank { position: absolute; width: 104px; height: 104px; margin: -52px 0 0 -52px; border-radius: 50%; background: radial-gradient(circle, #050506 0 58%, rgba(5,5,6,0) 100%); pointer-events: none; }
.sight-hit.sight-void.read::after { background: #050506; box-shadow: 0 0 0 1px rgba(239,233,221,.16); }
@media (prefers-reduced-motion: reduce) { .tool.rec.new, .layers { animation: none; } .layer-line { transition: none; } }
/* ── Chapters, save slots, Start over (2026-11-11) ── */
.gate-sum { margin: -4px 0 0; min-height: 1.3em; font: 500 13px/1.3 var(--ui); color: var(--dim); text-align: center; }
.gate-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 6px; max-width: 92vw; }
.gate-row .gate-alt { min-height: 44px; }
.gate-alt:disabled { cursor: default; text-decoration: none; opacity: .8; }
.sidetag { position: absolute; z-index: 6; left: 10px; top: calc(14px + env(safe-area-inset-top)); margin: 0; padding: 6px 10px; border-radius: 14px; border: 1px solid rgba(126,230,161,.45); background: rgba(11,11,13,.72); font: 600 11.5px/1.2 var(--ui); letter-spacing: .04em; color: var(--sys); max-width: calc(100% - 200px); }
.listsheet .sheet-card { max-width: 560px; max-height: 90dvh; display: flex; flex-direction: column; }
.listpage { overflow-y: auto; flex: 1; min-height: 0; padding: 2px 2px 8px; }
.listlead { margin: 0 0 12px; font: 500 16px/1.45 var(--prose); color: var(--text); overflow-wrap: break-word; }
.listnote { margin: 10px 0 12px; font: 500 13.5px/1.45 var(--ui); color: var(--dim); overflow-wrap: break-word; }
.listnote.warn { color: #f3d7a6; padding: 8px 12px; border-left: 3px solid var(--lamp); background: rgba(233,162,59,.08); border-radius: 0 6px 6px 0; }
.chrow, .slotrow { padding: 12px 0; border-top: 1px solid var(--rule); }
.chrow:first-child, .slotrow:first-child { border-top: 0; }
.chhead { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.chnum, .slotmeta { margin: 0; font: 700 11px/1.3 var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--lamp); }
.chstate { font: 600 12px/1.3 var(--ui); color: var(--dim); }
.is-finished .chstate { color: var(--sys); }
.is-locked .chnum, .is-locked .chtitle { opacity: .55; }
.chtitle { margin: 4px 0 10px; font: 600 18px/1.3 var(--prose); color: var(--text); overflow-wrap: break-word; }
.chgo { display: block; width: 100%; min-height: 48px; margin: 6px 0 0; padding: 8px 14px; border-radius: 8px; border: 1px solid rgba(233,162,59,.55); background: rgba(233,162,59,.08); font: 700 14px/1.25 var(--ui); color: var(--text); text-align: center; cursor: pointer; }
.chgo:hover { background: rgba(233,162,59,.16); }
.chgo.locked, .chgo:disabled { border-color: var(--rule); background: none; color: var(--dim); cursor: default; }
.chgo.warn { border-color: #d9482b; color: #ff9c86; background: none; }
.chgo.warn.armed { background: rgba(217,72,43,.16); }
.chscenes { margin-top: 8px; }
.chscene { display: block; width: 100%; min-height: 44px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--rule); background: #15151a; color: var(--text); font: 500 14px/1.2 var(--ui); }
.slotname { display: block; width: 100%; min-height: 44px; margin: 6px 0; padding: 0 10px; border-radius: 8px; border: 1px solid var(--rule); background: #15151a; color: var(--text); font: 600 17px/1.2 var(--prose); }
.slotrow.is-active .slotname { border-color: var(--lamp); }
.slotsum { margin: 0 0 4px; font: 500 14px/1.4 var(--ui); color: var(--dim); overflow-wrap: break-word; }
.slotbtns { display: grid; gap: 6px; }
.linkbtn { padding: 0; min-height: 44px; border: 0; background: none; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Who is telling this chapter (Paul, 2026-11-12 playtest). A chapter told by someone other than Voss keeps its
   narrator in the top-left corner the whole way through, and opens on a title card with that name. */
.pov { position: absolute; z-index: 6; left: 10px; top: calc(10px + env(safe-area-inset-top)); margin: 0; width: 64px; text-align: center; pointer-events: none; animation: fadein .5s ease both; }
.pov-img { width: 52px; height: 52px; margin: 0 auto; border-radius: 50%; background: #1a1714 47% 22% / 190% auto no-repeat; border: 1.5px solid rgba(233,162,59,.75); box-shadow: 0 6px 18px rgba(0,0,0,.7), 0 0 0 3px rgba(11,11,13,.55); }
.pov figcaption { margin-top: 6px; font: 700 11px/1 var(--ui); letter-spacing: .16em; text-transform: uppercase; color: var(--lamp); text-shadow: 0 1px 6px #000, 0 0 2px #000; }
.app.has-pov .sidetag { top: calc(96px + env(safe-area-inset-top)); max-width: calc(100% - 20px); }
@media (min-width: 1040px) and (min-height: 560px) {
  .pov { left: 20px; top: 18px; width: 76px; }
  .pov-img { width: 64px; height: 64px; }
  .pov figcaption { font-size: 12px; margin-top: 8px; }
  .app.has-pov .sidetag { left: 108px; top: 22px; max-width: 360px; }
}

.povcard { position: absolute; inset: 0; z-index: 12; display: grid; place-items: center; padding: calc(24px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom)); background: radial-gradient(120% 90% at 50% 45%, rgba(11,11,13,.95) 0%, rgba(11,11,13,.98) 60%, var(--ink) 100%); pointer-events: none; animation: fadein .6s ease both; overflow: hidden; }
.povcard-inner { width: 100%; max-width: 520px; text-align: center; }
.povcard-kicker { margin: 0 0 8px; font: 600 12px/1.4 var(--ui); letter-spacing: .18em; text-transform: uppercase; color: var(--dim); }
.povcard-title { margin: 0 0 28px; font: 700 26px/1.15 var(--prose); color: var(--text); text-wrap: balance; }
.povcard-img { width: 112px; height: 112px; margin: 0 auto 18px; border-radius: 50%; background: #1a1714 47% 22% / 190% auto no-repeat; border: 2px solid rgba(233,162,59,.8); box-shadow: 0 14px 40px rgba(0,0,0,.75), 0 0 0 5px rgba(11,11,13,.6), 0 0 60px rgba(233,162,59,.18); }
.povcard-img.none { display: none; }
.povcard-name { margin: 0; font: 800 clamp(40px, 13vw, 72px)/1 var(--ui); letter-spacing: .2em; text-indent: .2em; text-transform: uppercase; color: var(--lamp); text-shadow: 0 0 30px rgba(233,162,59,.25); }
.povcard-line { margin: 18px auto 0; max-width: 30ch; font: 500 17px/1.45 var(--prose); color: var(--text); text-wrap: balance; }
.povcard-hint { margin: 36px 0 0; font: 600 12px/1 var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
@media (min-width: 1040px) and (min-height: 560px) { .povcard-title { font-size: 32px; } .povcard-img { width: 132px; height: 132px; } }
@media (max-height: 560px) { .povcard-title { margin-bottom: 14px; } .povcard-img { width: 72px; height: 72px; margin-bottom: 10px; } .povcard-name { font-size: 40px; } .povcard-hint { margin-top: 18px; } }

/* The first time a chapter's record button shows: one line under it saying what it is. */
.recintro { position: absolute; z-index: 7; right: 10px; top: calc(62px + env(safe-area-inset-top)); max-width: min(300px, calc(100% - 96px)); margin: 0; padding: 10px 12px; border-radius: 8px; border: 1px solid rgba(233,162,59,.55); background: rgba(19,17,16,.94); box-shadow: 0 10px 30px rgba(0,0,0,.6); font: 500 14.5px/1.4 var(--ui); color: var(--text); animation: fadein .35s ease both; cursor: pointer; }
.recintro::before { content: ""; position: absolute; top: -6px; right: var(--arrow, 40px); width: 10px; height: 10px; transform: rotate(45deg); border-left: 1px solid rgba(233,162,59,.55); border-top: 1px solid rgba(233,162,59,.55); background: rgba(19,17,16,.94); }
@media (min-width: 1040px) and (min-height: 560px) { .recintro { right: 20px; top: 70px; } }
@media (prefers-reduced-motion: reduce) { .pov, .povcard, .recintro { animation: none; } }
