:root {
  --ink: #0b0b0d;
  --panel: #101013;
  --rule: #2a2723;
  --text: #efe9dd;
  --dim: #a8a092;
  --lamp: #e9a23b;
  --lamp-deep: #b9741c;
  --signal: #7ee6a1;
  --ink-rgb: 11, 11, 13;
  --panel-rgb: 16, 16, 19;
  --text-rgb: 239, 233, 221;
  --dim-rgb: 168, 160, 146;
  --lamp-rgb: 233, 162, 59;
  --signal-rgb: 126, 230, 161;
  --surface: #15151a;
  --surface-hi: #2a2118;
  --on-accent: #17110a;
  --note: #f3d7a6;
  --warn: #d9482b;
  --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;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ink); color: var(--text); }
body { font-family: var(--prose); -webkit-text-size-adjust: 100%; }
/* The page lock belongs to the game page alone (<html class="game">): nothing scrolls or rubber-bands behind the game.
   Every other page that loads this sheet (the choice map, What changed, make/, a story's own pages) scrolls like any page. */
html.game, html.game body { height: 100%; }
html.game body { 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, particles, 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%, var(--ink) 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); } }
.particles { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
/* Weather and light (engine/ui/sky.js, sky:<name>): quiet layers over the picture, under the shade. None takes a tap. */
.sky, .sky > * { position: absolute; inset: 0; pointer-events: none; }
.sky-tint { opacity: 0; transition: opacity 2.4s ease, background-color 2.4s ease; }
.sky-dawn { opacity: 0; background: linear-gradient(to top, rgba(255, 184, 108, .55), rgba(255, 204, 148, .2) 46%, rgba(255, 224, 186, 0) 82%); transition: opacity 2.6s ease; }
.sky-mist { opacity: 0; transition: opacity 3s ease; }
.sky-mist i { position: absolute; left: -35%; width: 170%; height: 32%; border-radius: 50%; background: radial-gradient(closest-side, rgba(238, 240, 242, .3), rgba(238, 240, 242, 0)); filter: blur(8px); }
.sky-mist i.a { top: 48%; animation: sky-mist 44s ease-in-out infinite alternate; }
.sky-mist i.b { top: 62%; height: 26%; animation: sky-mist 61s ease-in-out infinite alternate-reverse; }
@keyframes sky-mist { from { transform: translate3d(-9%, 0, 0); } to { transform: translate3d(9%, -4%, 0); } }
.sky-glow { opacity: 0; background: radial-gradient(62% 56% at var(--gx, 50%) var(--gy, 58%), rgba(255, 176, 84, var(--ga, .2)), rgba(255, 176, 84, 0) 72%); transition: opacity 2.4s ease; }
.sky-glow.on { opacity: 1; animation: sky-glow 5.2s ease-in-out infinite; }
@keyframes sky-glow { 0%, 100% { opacity: 1; } 22% { opacity: .82; } 31% { opacity: .93; } 47% { opacity: .78; } 64% { opacity: .96; } 81% { opacity: .86; } }
.sky-rain { width: 100%; height: 100%; }
.sky-flash { opacity: 0; background: radial-gradient(130% 90% at 50% 0%, rgba(222, 232, 255, 1), rgba(190, 206, 255, .5) 55%, rgba(190, 206, 255, .15)); }
.sky-flash.go { animation: sky-flash .62s ease-out both; }
@keyframes sky-flash { 0% { opacity: 0; } 7% { opacity: var(--f, .4); } 20% { opacity: calc(var(--f, .4) * .25); } 32% { opacity: calc(var(--f, .4) * .7); } 100% { opacity: 0; } }
.sky.still .sky-mist i, .sky.still .sky-glow.on { animation: none; }
.sky.still .sky-tint, .sky.still .sky-dawn, .sky.still .sky-mist, .sky.still .sky-glow { transition: none; }
.sky.still .sky-flash.go { animation: none; }
@media (prefers-reduced-motion: reduce) { .sky-mist i, .sky-glow.on, .sky-flash.go { animation: 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(var(--ink-rgb), .55) 0%, rgba(var(--ink-rgb), 0) 22%, rgba(var(--ink-rgb), 0) 58%, rgba(var(--panel-rgb), .92) 92%, var(--panel) 100%),
  radial-gradient(120% 100% at 50% 45%, rgba(0,0,0,0) 45%, rgba(0,0,0,.55) 100%); }

.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-img { width: 100%; aspect-ratio: 3 / 4; border-radius: 6px; background: var(--surface) center 18% / cover no-repeat; border: 1px solid rgba(var(--lamp-rgb), .55); box-shadow: 0 10px 30px rgba(0,0,0,.7), 0 0 0 4px rgba(var(--ink-rgb), .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(var(--text-rgb), .22); background: rgba(var(--ink-rgb), .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 { display: none; }
.tool span { color: var(--lamp); margin-right: 2px; }
.tool .tool-word { color: inherit; margin: 0; }
/* The mute button: sound on and off in one tap, beside Settings, on every screen. Kept by the device. */
.tool.mute { display: inline-grid; place-items: center; width: 36px; padding: 0; }
.tool.mute svg { display: block; fill: none; stroke: var(--lamp); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tool.mute .spk { fill: var(--lamp); stroke: none; }
.tool.mute .slash { display: none; stroke: var(--dim); }
.tool.mute[aria-pressed="true"] .wave { display: none; }
.tool.mute[aria-pressed="true"] .slash { display: block; }
.tool.mute[aria-pressed="true"] .spk { fill: var(--dim); }
.tool.mute[aria-pressed="true"] { color: var(--dim); }
@media (max-width: 349px) { #settingsBtn .tool-word { display: none; } #settingsBtn { width: 40px; padding: 0; } #settingsBtn span { margin: 0; } }   /* a small phone: the gear alone, so the mute button fits beside it */

/* ── 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(var(--panel-rgb), 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 on a phone. A screen taller than the panel scrolls instead,
   and its top edge fades while there is text above (.scrolled, set in engine/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: var(--note); padding: 10px 12px 10px 14px; border-left: 3px solid var(--lamp); background: rgba(var(--lamp-rgb), .08); border-radius: 0 6px 6px 0; min-height: 0; }
.text.consequence::before { content: "◆ "; color: var(--lamp); }
/* 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, .app.reserving .text { min-height: 0; }
/* Room held for the choice that follows, while the words above it come (UX-RULES R12): laid out, not seen, not
   reachable. The panel has its full height from the first word, so nothing moves when the choice shows. */
.choicebox.reserved { visibility: hidden; pointer-events: none; }
.text.past { color: var(--dim); transition: color .25s ease; }
.timer.held { opacity: .85; }
.timer.over { box-shadow: 0 0 0 1px rgba(255,90,60,.8); }   /* time is up; a press under way is being allowed to finish */
/* 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: var(--rule); 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(var(--lamp-rgb), .5); background: linear-gradient(180deg, var(--surface-hi), var(--surface)); 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 { pointer-events: none; }
.choice:hover, .choice:focus-visible { border-color: var(--lamp); background: linear-gradient(180deg, var(--surface-hi), var(--surface-hi)); 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: grid; place-items: center; background: var(--ink); transition: opacity .6s ease; }
.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(var(--lamp-rgb), .20), rgba(var(--lamp-rgb), .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; display: grid; justify-items: center; gap: 14px; }
.gate-btn { min-width: 220px; min-height: 60px; padding: 0 28px; border-radius: 30px; border: 1px solid var(--lamp); background: rgba(var(--lamp-rgb), .1); font: 700 15px/1 var(--ui); letter-spacing: .2em; text-transform: uppercase; color: var(--text); cursor: pointer; }
.gate-btn:hover { background: rgba(var(--lamp-rgb), .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-news { margin: 2px 0 0; font: 600 13px/1.4 var(--ui); color: var(--lamp); text-align: center; }
.listnote.news { color: var(--lamp); font-weight: 600; }
.gate-note { margin: 4px 0 0; font: 500 13px/1.4 var(--ui); color: var(--dim); }
.gate-foot { position: absolute; left: 0; right: 0; bottom: calc(20px + env(safe-area-inset-bottom)); margin: 0; 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(var(--ink-rgb), .955) 0%, rgba(var(--ink-rgb), .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)); }
@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(--signal); }
.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: var(--on-accent); font: 800 15px/1 var(--ui); letter-spacing: .16em; text-transform: uppercase; cursor: pointer; }
.again:hover { background: var(--lamp); filter: brightness(1.1); }
.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 */
.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(var(--lamp-rgb), .5); color: var(--text); font: 700 14px/1 var(--ui); letter-spacing: .1em; text-transform: uppercase; text-decoration: none; background: rgba(var(--lamp-rgb), .06); }
.maplink:hover, .maplink:focus-visible { background: rgba(var(--lamp-rgb), .14); 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(var(--ink-rgb), .5) 0%, rgba(var(--ink-rgb), 0) 20%, rgba(var(--ink-rgb), 0) 45%, rgba(var(--ink-rgb), .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(var(--text-rgb), .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; }
  @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; }
  .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; }
}

@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; }
  .gate-lamp, .more span { animation: none; }
  .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 { display: none; }


/* ── The picture answers a hold (engine/ui/main.js `react`): it pushes in toward the ring, trembles while a keep-hold
   is held against the pull, and jerks back when it is let go. `scale` and `translate` are their own properties, so
   they sit on top of the picture's own transform (the drag and zoom) without fighting it. ── */
.bgwrap.reacting { scale: var(--rz, 1); transform-origin: var(--rx, 50%) var(--ry, 50%); transition: transform .6s ease-out, scale .45s ease-out; }
.bgwrap.trembling { animation: react-tremble .2s linear infinite; }
.bgwrap.jerk { animation: react-jerk .32s ease-out; transition: transform .6s ease-out, scale .12s ease-out; }
@keyframes react-tremble { 0%, 100% { translate: 0 0; } 25% { translate: 1.4px -1px; } 50% { translate: -1.2px 1.2px; } 75% { translate: 1px 1.3px; } }
@keyframes react-jerk { 0% { translate: 0 0; } 16% { translate: 0 12px; } 100% { translate: 0 0; } }
.iring { position: absolute; width: 64px; height: 64px; margin: -32px 0 0 -32px; padding: 0; border-radius: 50%; border: 2px solid rgba(var(--lamp-rgb), .95); background: rgba(var(--lamp-rgb), .06); box-shadow: 0 0 0 2px rgba(5,6,10,.62), inset 0 0 0 1.5px rgba(5,6,10,.5), 0 0 16px 4px rgba(var(--lamp-rgb), .5); cursor: pointer; pointer-events: auto; touch-action: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; animation: sg-glint 2.2s ease-in-out infinite; }
.iring.down { border-width: 3px; border-color: #ffe2a8; animation: none; box-shadow: 0 0 0 2px rgba(5,6,10,.62), 0 0 26px 8px rgba(var(--lamp-rgb), .85); }
.iring:focus-visible { outline: 2px solid var(--lamp); outline-offset: 3px; }
.choice.grip.nobar .hold-fill { display: none; }
@media (prefers-reduced-motion: reduce) { .bgwrap.reacting { scale: none; } .bgwrap.trembling, .bgwrap.jerk, .iring { animation: 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 ── */
.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: var(--surface); border: 1px solid rgba(var(--text-rgb), .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(var(--text-rgb), .22); border-radius: 8px; overflow: hidden; }
.segs button { min-width: 62px; min-height: 40px; padding: 0 12px; border: 0; border-left: 1px solid rgba(var(--text-rgb), .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: var(--on-accent); }
.sheet-link { min-height: 40px; padding: 0 2px; border: 0; background: none; font: 600 15px/1 var(--ui); color: var(--lamp); 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(var(--text-rgb), .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(var(--lamp-rgb), .12); }
.sheet-btn.warn { border-color: var(--warn); color: var(--warn); }
.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) {
  .sheet { place-items: center; }
  .sheet-card { border-bottom: 1px solid rgba(var(--text-rgb), .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; }
  .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: var(--note); padding: 9px 12px 9px 14px; border-left: 3px solid var(--lamp); background: rgba(var(--lamp-rgb), .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; }

/* ── 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; }
/* A hold takes a press from the moment it is on the page: a press that began early and is still down is a press. */
.choices:not(.ready) .choice.hold { pointer-events: auto; }
.choice.hold .hold-fill { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(var(--lamp-rgb), .55), rgba(var(--lamp-rgb), .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.hold.down small, .choice.hold.done small { color: var(--on-accent); }
.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; }
}

/* ── Art spots, paragraph marks, spoken lines ── */
/* 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(var(--lamp-rgb), .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(var(--ink-rgb), .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; }
.again.next { margin: 0 0 22px; background: transparent; color: var(--text); border-color: var(--signal); }
.again.next:hover { background: rgba(var(--signal-rgb), .1); }
.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, .spotline { animation: none; } .bgwrap { transition: none; } }

.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(var(--text-rgb), .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(var(--lamp-rgb), .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(var(--lamp-rgb), .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; } }
@media (prefers-reduced-motion: reduce) { .layers { animation: none; } .layer-line { transition: none; } }
/* ── Chapters, save slots, Start over ── */
.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(var(--signal-rgb), .45); background: rgba(var(--ink-rgb), .72); font: 600 11.5px/1.2 var(--ui); letter-spacing: .04em; color: var(--signal); 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: var(--note); padding: 8px 12px; border-left: 3px solid var(--lamp); background: rgba(var(--lamp-rgb), .08); border-radius: 0 6px 6px 0; }
.listnote.dev { color: var(--signal); }
.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(--signal); }
.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(var(--lamp-rgb), .55); background: rgba(var(--lamp-rgb), .08); font: 700 14px/1.25 var(--ui); color: var(--text); text-align: center; cursor: pointer; }
.chgo:hover { background: rgba(var(--lamp-rgb), .16); }
.chgo.locked, .chgo:disabled { border-color: var(--rule); background: none; color: var(--dim); cursor: default; }
.chgo.warn { border-color: var(--warn); color: var(--warn); background: none; }
.chgo.warn.armed { background: rgba(217,72,43,.16); }
.chgo.dev { border-color: rgba(var(--signal-rgb), .5); background: rgba(var(--signal-rgb), .06); }
.chscenes { margin-top: 8px; }
.chscene { display: block; width: 100%; min-height: 44px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--rule); background: var(--surface); 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: var(--surface); 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; }
/* The dev tools (preview builds only) */
.devbar { position: absolute; z-index: 30; left: 50%; bottom: 0; transform: translateX(-50%); display: flex; align-items: stretch; max-width: calc(100% - 16px); border-radius: 8px 8px 0 0; overflow: hidden; background: rgba(6,19,11,.94); border: 1px solid rgba(var(--signal-rgb), .55); border-bottom: 0; }
.devbar .devtag { display: flex; align-items: center; gap: 6px; margin: 0; padding: 0 10px; background: rgba(var(--signal-rgb), .85); font: 800 10px/1.4 var(--mono); letter-spacing: .1em; color: #06130b; white-space: nowrap; }
.devbar .devshot { letter-spacing: .04em; }
.devbar-btn { min-height: 40px; padding: 0 12px; border: 0; background: transparent; font: 700 12px/1 var(--ui); color: var(--signal); cursor: pointer; white-space: nowrap; }
.devbar-btn:disabled { opacity: .35; cursor: default; }
.devbar-btn:hover:not(:disabled), .devbar-btn:focus-visible { background: rgba(var(--signal-rgb), .16); outline: none; }
.app.devbar-on .panel { padding-bottom: calc(52px + env(safe-area-inset-bottom)); }
.app.devbar-on .end { padding-bottom: 56px; }
.app.devbar-on .gate { padding-bottom: 48px; }
@media (min-width: 1040px) and (min-height: 560px) { .app.devbar-on .panel { bottom: 48px; padding-bottom: 20px; } }
.app.devbar-on .devsheet .listpage { padding-bottom: 56px; }   /* the last row scrolls clear of the dev bar */
.devnote { color: var(--text); }
/* A carry notice (rule W7): a short line in the interface's look, at the top of the picture, clear of everything. */
.carrynote { position: absolute; z-index: 8; margin: 0; padding: 7px 11px 7px 10px; border-left: 3px solid var(--signal); border-radius: 0 6px 6px 0; background: rgba(6, 12, 9, .88); font: 600 13px/1.35 var(--ui); letter-spacing: .02em; color: var(--signal); overflow-wrap: break-word; pointer-events: none; box-shadow: 0 6px 18px rgba(0,0,0,.45); }
.carrynote.in { animation: noticein .35s ease-out both; }
.carrynote.out { opacity: 0; transition: opacity .45s ease-in; }
@keyframes noticein { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .carrynote.in { animation: none; } }
@media (min-width: 1040px) and (min-height: 560px) { .carrynote { font-size: 14px; } }
.tmap-note { margin: 0 0 10px; font: 500 12.5px/1.45 var(--ui); color: var(--dim); }
.tmap-ch { margin: 14px 0 4px; font: 800 11px/1.3 var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--signal); }
.tmap-scene, .tmap-row { display: grid; grid-template-columns: 4.2em minmax(0, 1fr) auto; gap: 8px; align-items: baseline; width: 100%; min-height: 44px; padding: 8px 10px; margin: 0 0 4px; text-align: left; border-radius: 6px; border: 1px solid rgba(var(--signal-rgb), .22); background: rgba(6,19,11,.55); font: 600 13px/1.3 var(--ui); color: var(--text); cursor: pointer; }
.tmap-scene { border-color: rgba(var(--signal-rgb), .45); background: rgba(var(--signal-rgb), .08); font-weight: 700; }
.tmap-row { margin-left: 14px; width: calc(100% - 14px); font-weight: 500; }
.tmap-scene:hover, .tmap-row:hover, .tmap-scene:focus-visible, .tmap-row:focus-visible { border-color: var(--signal); outline: none; }
.tmap-id { font: 700 12px/1.3 var(--mono); color: var(--signal); white-space: nowrap; }
.tmap-what { overflow-wrap: anywhere; }
.tmap-kind { font: 800 10px/1.3 var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--lamp); text-align: right; }
.tool.dev { border-color: rgba(var(--signal-rgb), .6); color: var(--signal); }
.devstrip { position: absolute; z-index: 7; left: 10px; right: 10px; top: calc(56px + env(safe-area-inset-top)); padding: 8px 10px; border-radius: 6px; border: 1px solid rgba(var(--signal-rgb), .4); background: rgba(6,19,11,.9); font: 500 12px/1.45 var(--mono); color: var(--signal); overflow-wrap: anywhere; pointer-events: none; }
.devmono { margin: 0 0 2px; font: 500 12.5px/1.5 var(--mono); color: var(--text); overflow-wrap: anywhere; }
.devrow { display: grid; gap: 4px; margin: 0 0 10px; font: 600 13px/1.3 var(--ui); color: var(--text); }
@media (min-width: 1040px) { .devstrip { left: auto; right: 20px; width: 420px; top: 64px; } }
.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. A chapter told by someone other than the main narrator 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; min-width: 64px; max-width: 40vw; text-align: center; pointer-events: none; animation: fadein .5s ease both; }
.pov-img { width: 52px; height: 52px; margin: 0 auto; border-radius: 50%; background: var(--surface) 47% 22% / 190% auto no-repeat; border: 1.5px solid rgba(var(--lamp-rgb), .75); box-shadow: 0 6px 18px rgba(0,0,0,.7), 0 0 0 3px rgba(var(--ink-rgb), .55); }
.pov figcaption { margin-top: 6px; font: 700 11px/1 var(--ui); font-size: clamp(9px, calc(100px / (var(--n, 4) * .9)), 11px); letter-spacing: .16em; white-space: nowrap; 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); }
.app.has-pov .devstrip { top: calc(96px + env(safe-area-inset-top)); }
@media (min-width: 1040px) and (min-height: 560px) {
  .pov { left: 20px; top: 18px; min-width: 76px; }
  .pov-img { width: 64px; height: 64px; }
  .pov figcaption { font-size: clamp(10px, calc(120px / (var(--n, 4) * .9)), 12px); margin-top: 8px; }
  .app.has-pov .sidetag { left: 108px; top: 22px; max-width: 360px; }
  .app.has-pov .devstrip { top: 64px; }
}

.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(var(--ink-rgb), .95) 0%, rgba(var(--ink-rgb), .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: var(--surface) 47% 22% / 190% auto no-repeat; border: 2px solid rgba(var(--lamp-rgb), .8); box-shadow: 0 14px 40px rgba(0,0,0,.75), 0 0 0 5px rgba(var(--ink-rgb), .6), 0 0 60px rgba(var(--lamp-rgb), .18); }
.povcard-img.none { display: none; }
.povcard-name { margin: 0; font: 800 clamp(40px, 13vw, 72px)/1 var(--ui); font-size: clamp(20px, min(13vw, calc(min(100vw - 48px, 520px) / (var(--n, 4) * .96 + .3))), 72px); white-space: nowrap; letter-spacing: .2em; text-indent: .2em; text-transform: uppercase; color: var(--lamp); text-shadow: 0 0 30px rgba(var(--lamp-rgb), .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: clamp(20px, min(40px, calc(min(100vw - 48px, 520px) / (var(--n, 4) * .96 + .3))), 40px); } .povcard-hint { margin-top: 18px; } }

@media (prefers-reduced-motion: reduce) { .pov, .povcard { animation: none; } }

/* The title screen's own title (every-road) */
.gate-title { margin: 0 0 22px; font: 700 clamp(28px, 7vw, 44px)/1.1 var(--prose); color: var(--text); text-align: center; text-wrap: balance; overflow-wrap: normal; }
.gate-foot { overflow-wrap: anywhere; }

/* ── Demo mode (UX rules D1 to D5; engine/ui/main.js) ── */
/* D1: the pill, top left on every screen of the story, the title screen and the end cards (top right is Settings),
   in line with Settings (and, like Settings, not while a countdown runs);
   under the narrator's face in a chapter someone else tells. A title card, a full-screen small game and a sheet sit
   over it. Everything else at the top left moves down to make room: the side-trip tag, the dev strip. */
.demopill { position: absolute; z-index: 11; left: 10px; top: calc(10px + env(safe-area-inset-top)); box-sizing: border-box; display: inline-flex; align-items: center; gap: 5px; min-height: 36px; max-width: calc(100% - 172px); padding: 0 11px; border-radius: 18px; border: 1px solid rgba(var(--signal-rgb), .55); background: rgba(var(--ink-rgb), .72); font: 600 12px/1.15 var(--ui); letter-spacing: .02em; color: var(--signal); text-decoration: none; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.demopill:hover, .demopill:focus-visible { border-color: var(--signal); background: rgba(var(--ink-rgb), .9); }
.app.demo.has-pov .demopill { top: calc(96px + env(safe-area-inset-top)); }
.app[data-timed="1"] .demopill { display: none; }   /* like Settings, it steps aside while a countdown runs: a tap on it never costs a choice */
.app.demo .sidetag { top: calc(54px + env(safe-area-inset-top)); }
.app.demo.has-pov .sidetag { top: calc(140px + env(safe-area-inset-top)); }
.app.demo.has-pov .devstrip { top: calc(140px + env(safe-area-inset-top)); }
@media not ((min-width: 1040px) and (min-height: 560px)) {
  .app.demo.has-pov .panel { max-height: calc(100dvh - 140px - env(safe-area-inset-top)); }
}
@media (min-width: 1040px) and (min-height: 560px) {
  .app.demo .demopill { top: 18px; left: 20px; }
  .app.demo.has-pov .demopill { top: 124px; }
  .app.demo.has-pov .sidetag { left: 108px; top: 22px; }
  .app.demo.has-pov .devstrip { top: 168px; }
}
.app.demo .gate { box-sizing: border-box; padding-top: calc(52px + env(safe-area-inset-top)); }
/* On an end card the pill sits on a band of its own, so the card never scrolls under it. */
.app.demo .end::before { content: ""; position: sticky; z-index: 1; top: 0; display: block; height: calc(54px + env(safe-area-inset-top)); margin-bottom: calc(-54px - env(safe-area-inset-top)); background: var(--ink); }
.gate-intro { margin: -12px 0 4px; max-width: min(88vw, 420px); font: 500 15px/1.45 var(--prose); color: var(--dim); text-align: center; text-wrap: balance; }

/* D2, D3: a note, in the layout. Above the question at a choice (with an arrow down at the options), above its
   paragraph on a payoff screen, above the hint in a full-screen small game. Its × hides it and keeps its room. */
.demonote { position: relative; box-sizing: border-box; display: flex; align-items: flex-start; gap: 6px; margin: 0 0 14px; padding: 8px 4px 8px 12px; border-left: 3px solid var(--signal); border-radius: 0 6px 6px 0; background: rgba(var(--signal-rgb), .09); font: 600 13.5px/1.4 var(--ui); letter-spacing: .01em; color: var(--signal); text-align: left; cursor: default; }
.demonote[hidden] { display: none; }
.demonote.gone { visibility: hidden; }
.choicebox > .demonote::after { content: ""; position: absolute; left: 22px; bottom: -8px; border: 8px solid transparent; border-bottom: 0; border-top-color: rgba(var(--signal-rgb), .5); }
.demonote-lines { display: block; flex: 1; min-width: 0; padding-top: 1px; overflow-wrap: break-word; }
.demonote-line { display: block; }
.demonote-line + .demonote-line { margin-top: 4px; }
.demonote-line.kicker { font: 700 10.5px/1.35 var(--ui); letter-spacing: .14em; text-transform: uppercase; opacity: .9; }
.demonote-line.kicker + .demonote-line { margin-top: 2px; }
.demonote-x { flex: none; width: 36px; height: 36px; margin: -7px 0 -7px 0; padding: 0; border: 0; border-radius: 18px; background: none; font: 600 19px/1 var(--ui); color: var(--signal); cursor: pointer; }
.demonote-x:hover, .demonote-x:focus-visible { background: rgba(var(--signal-rgb), .14); }
.text .demonote { display: flex; margin: 0 0 12px; }
.layers > .demonote { flex: none; margin: 0; background: rgba(var(--signal-rgb), .12); }

/* D4: the end-card cards. */
.democard { margin: 0 0 22px; padding: 14px 16px 6px; border: 1px solid rgba(var(--signal-rgb), .4); border-radius: 8px; background: rgba(var(--signal-rgb), .05); }
.democard-title { margin: 0 0 6px; font: 700 11.5px/1.2 var(--ui); letter-spacing: .16em; text-transform: uppercase; color: var(--signal); }
.democard-list { list-style: none; margin: 0; padding: 0; }
.democard-list li { padding: 8px 0; border-bottom: 1px solid var(--rule); }
.democard-list li:last-child { border-bottom: 0; }
.democard-list .did { display: block; margin-bottom: 3px; font: 700 10.5px/1.35 var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.democard-list .got { display: block; font: 600 16px/1.35 var(--prose); color: var(--text); }
.democard-list .lands { display: block; margin-top: 4px; font: 600 13px/1.35 var(--ui); color: var(--signal); }
.democard-link { display: flex; align-items: center; gap: 6px; min-height: 44px; font: 600 13.5px/1.2 var(--ui); color: var(--text); text-decoration: underline; text-underline-offset: 4px; }
.democard-link[hidden] { display: none; }
.democard-steps { margin: 4px 0 12px; padding: 0 0 0 1.25em; font: 500 15.5px/1.45 var(--prose); color: var(--text); }
.democard-steps li { margin: 0 0 6px; text-wrap: pretty; }
.democard-steps li::marker { font: 700 14px/1 var(--ui); color: var(--signal); }
.democard-go { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; margin: 0 0 12px; border-radius: 8px; border: 1px solid rgba(var(--signal-rgb), .6); background: rgba(var(--signal-rgb), .08); font: 700 13.5px/1.2 var(--ui); letter-spacing: .06em; color: var(--text); text-decoration: none; }
.democard-go:hover, .democard-go:focus-visible { background: rgba(var(--signal-rgb), .16); border-color: var(--signal); }

/* ── The small-game library (engine/minigames/, engine/ui/games.js; UX-RULES M1 to M5) ── */
.choice.start { text-align: center; }
/* Keep hold: the meter is the reader's grip. Full at the start; it runs down while they are not holding. */
.choice.grip .hold-fill { transform: scaleX(1); background: linear-gradient(90deg, rgba(var(--lamp-rgb), .4), rgba(var(--lamp-rgb), .7)); }
.choice.grip.pulling { border-color: var(--lamp); }
.choice.grip.slipping { border-color: #ff7a45; animation: gripshake .18s linear infinite; }
.choice.grip.slipping .hold-fill { background: linear-gradient(90deg, rgba(255, 90, 60, .6), rgba(255, 122, 69, .85)); }
@keyframes gripshake { 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }
/* The die */
.choice.die { display: flex; align-items: center; justify-content: center; gap: 16px; min-height: 86px; padding: 12px 16px; text-align: left; touch-action: none; -webkit-touch-callout: none; }
.die-cube { --die: 52px; flex: none; position: relative; width: 60px; height: 60px; }
/* a real die: six pipped faces on a cube, turned so a little of its top and side shows; a soft shadow under it */
.die-cube.real { display: grid; place-items: center; perspective: 420px; }
.die-cube.real::after { content: ""; position: absolute; left: 12%; right: 6%; bottom: -5px; height: 9px; border-radius: 50%; background: rgba(0, 0, 0, .5); filter: blur(4px); }
.die-3d { position: relative; z-index: 1; display: block; width: var(--die); height: var(--die); transform-style: preserve-3d; -webkit-transform-style: preserve-3d; }
.die-face { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 3px; padding: 8px; border-radius: 9px; background: var(--text); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .16), inset 0 -5px 8px rgba(0, 0, 0, .14), inset 0 4px 6px rgba(255, 255, 255, .35); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.die-face.f2, .die-face.f5 { filter: brightness(1.06); }
.die-face.f3, .die-face.f4 { filter: brightness(.86); }
.die-cube .pip { border-radius: 50%; }
.die-cube .pip.on { background: var(--ink); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .6); }
.die-face.f1 .pip.on { background: #c22a17; transform: scale(1.7); }
.die-cube.num { display: flex; align-items: center; justify-content: center; padding: 0; border-radius: 11px; background: var(--text); box-shadow: 0 4px 12px rgba(0, 0, 0, .45), inset 0 -3px 0 rgba(0, 0, 0, .14); font: 800 26px/1 var(--ui); color: var(--ink); }
/* the d12: an oxblood resin die with bone-white carved numbers (a story may set --die-body and --die-ink in its theme) */
.die-cube.d12die { --die-body: 122, 38, 26; --die-ink: #efe2c4; width: 84px; height: 84px; display: grid; place-items: center; }
.die-cube.d12die::after { content: ""; position: absolute; left: 14%; right: 8%; bottom: -4px; height: 10px; border-radius: 50%; background: rgba(0, 0, 0, .55); filter: blur(4px); }
.d12 { position: relative; z-index: 1; display: block; width: 84px; height: 84px; overflow: visible; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .45)); }
.d12-body { transform-box: fill-box; transform-origin: center; }
.d12-side, .d12-front { fill: rgb(var(--die-body)); stroke: rgba(0, 0, 0, .5); stroke-width: .9; stroke-linejoin: round; }
.d12-shade { stroke: none; pointer-events: none; }
.d12-sheen { fill: #fff; fill-opacity: .1; stroke: rgba(255, 220, 180, .3); stroke-width: .8; stroke-linejoin: round; }
.d12-num, .d12-carve, .d12-near { font: 700 25px/1 Georgia, "Times New Roman", serif; text-anchor: middle; dominant-baseline: central; }
.d12-carve { fill: rgba(0, 0, 0, .7); }
.d12-num { fill: var(--die-ink); paint-order: stroke; stroke: rgba(60, 20, 12, .55); stroke-width: .6; }
.d12-near { font-size: 11px; fill: var(--die-ink); opacity: .78; }
.die-cube.d12die.rolling .d12-body { animation: d12roll 1s linear both; }
@keyframes d12roll { 0% { transform: scale(1, 1); } 12% { transform: scale(.8, 1.04); } 26% { transform: scale(1.04, .82); } 40% { transform: scale(.86, 1.02); } 54% { transform: scale(1.02, .9); } 68% { transform: scale(.95, 1); } 82% { transform: scale(1, .97); } 100% { transform: scale(1, 1); } }
.choice.die:has(.d12die) { min-height: 108px; }
.die-words { display: block; min-width: 0; }
.die-label { display: block; font: 600 17.5px/1.3 var(--prose); color: var(--text); overflow-wrap: break-word; }
.choice.die small { display: block; margin-top: 3px; font: 700 10.5px/1.2 var(--ui); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.choice.die:disabled { cursor: default; }
.choice.die.thrown .die-cube.num { animation: dietumble .2s linear infinite; }
.die-cube.hop { animation: diehop 1s linear both; }
.die-cube.hop::after { animation: dieshade 1s linear both; }
@keyframes diehop { 0% { transform: translate(0, 0); animation-timing-function: cubic-bezier(.2, .7, .4, 1); } 34% { transform: translate(var(--fx, 0px), calc(var(--fy, -8px) - 22px)); animation-timing-function: cubic-bezier(.6, 0, .9, .4); } 66% { transform: translate(0, 0); animation-timing-function: cubic-bezier(.2, .7, .4, 1); } 80% { transform: translate(0, -7px); animation-timing-function: cubic-bezier(.6, 0, .9, .4); } 92%, 100% { transform: translate(0, 0); } }
@keyframes dieshade { 0%, 66%, 92%, 100% { opacity: 1; transform: scale(1); } 34% { opacity: .35; transform: scale(.6); } 80% { opacity: .75; transform: scale(.88); } }
.choice.die.landed { border-color: var(--signal); }
.choice.die.landed .die-cube { animation: dieland .32s ease-out; }
@keyframes dietumble { 0% { transform: translate(0, 0) rotate(0); } 50% { transform: translate(var(--fx, 0px), calc(var(--fy, -8px) - 4px)) rotate(180deg); } 100% { transform: translate(0, 0) rotate(360deg); } }
@keyframes dieland { 0% { transform: scale(1.18); } 100% { transform: scale(1); } }
/* Three stones, left to right; one glints */
.choices.runes { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: row; gap: 8px; }
.choice.stone { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-end; gap: 6px; min-height: 122px; padding: 8px 6px 9px; text-align: center; }
.stone-back, .stone-face { flex: 1; min-height: 62px; border-radius: 12px 12px 16px 16px; display: grid; place-items: center; padding: 4px; }
.stone-back { background: radial-gradient(90% 80% at 40% 30%, rgba(var(--text-rgb), .16), rgba(var(--text-rgb), .05)); border: 1px solid rgba(var(--text-rgb), .2); }
.stone-mark { font: 400 20px/1 var(--ui); color: var(--signal); }
.choice.stone.glint .stone-back { border-color: rgba(var(--signal-rgb), .8); box-shadow: 0 0 16px rgba(var(--signal-rgb), .4); animation: glint 1.7s ease-in-out infinite; }
@keyframes glint { 50% { box-shadow: 0 0 5px rgba(var(--signal-rgb), .15); } }
.stone-face { display: none; background: rgba(var(--lamp-rgb), .1); border: 1px solid rgba(var(--lamp-rgb), .35); font: 700 14px/1.25 var(--ui); color: var(--text); overflow-wrap: break-word; }
.choice.stone.turned .stone-back { display: none; }
.choice.stone.turned .stone-face { display: grid; }
.choice.stone.turned.chosen { border-color: var(--signal); }
.choice.stone.turned.chosen .stone-face { background: rgba(var(--signal-rgb), .16); border-color: var(--signal); }
.choice.stone.turned.passed .stone-face { opacity: .75; }
.stone-name { font: 600 13px/1.25 var(--ui); color: var(--dim); overflow-wrap: break-word; }
.choice.stone kbd { float: none; margin: 0; line-height: 1.2; }
.choice.stone:disabled { cursor: default; }
/* A full-screen game: trace, gather */
.fullgame { 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; user-select: none; -webkit-user-select: none; animation: fadein .4s ease both; }
.fullgame-art { position: absolute; inset: 0; background-size: cover; background-position: 50% 50%; opacity: .18; filter: grayscale(.5); pointer-events: none; }
.fullgame-hint { position: relative; flex: none; margin: 0; min-height: 2.8em; font: 700 12.5px/1.4 var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--text); text-align: center; overflow-wrap: break-word; }
.fullgame-foot { position: relative; flex: none; margin: 0; font: 500 13px/1.4 var(--ui); color: var(--dim); text-align: center; overflow-wrap: break-word; }
.trace-pad { position: relative; flex: 1; min-height: 0; width: 100%; max-width: 640px; margin: 0 auto; border: 1px solid rgba(var(--text-rgb), .14); border-radius: 10px; background: rgba(var(--text-rgb), .03); touch-action: none; cursor: crosshair; }
.trace-pad svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.trace-line, .trace-done { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.trace-line { stroke: rgba(var(--text-rgb), .42); stroke-width: 3px; stroke-dasharray: 3 9; }
.trace-done { stroke: var(--lamp); stroke-width: 6px; }
.trace-head { position: absolute; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%; border: 2px solid var(--lamp); background: rgba(var(--lamp-rgb), .28); pointer-events: none; animation: headpulse 1.4s ease-in-out infinite; }
.trace-head.held { animation: none; background: var(--lamp); }
@keyframes headpulse { 50% { box-shadow: 0 0 0 9px rgba(var(--lamp-rgb), .12); } }
.trace-end { --tx: -50%; --ty: calc(-100% - 24px); position: absolute; transform: translate(var(--tx), var(--ty)); max-width: 46%; min-height: 30px; padding: 5px 10px; border-radius: 15px; border: 1px solid rgba(var(--text-rgb), .3); background: rgba(5, 5, 6, .82); color: var(--text); font: 600 13px/1.2 var(--ui); text-align: center; overflow-wrap: break-word; cursor: default; pointer-events: none; }   /* a finger draws; the label is for the eye and the keyboard */
.trace-end.right { --tx: calc(-100% + 22px); }
.trace-end.left { --tx: -22px; }
.trace-end.low { --ty: 24px; }
.trace-end:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; }
.trace-end.took { border-color: var(--signal); color: var(--signal); }
/* a stop on a strand that goes on: once the line has reached it, its label is a button (stop here) */
.trace-end.below { --ty: 24px; }
.trace-end.stop.reached { pointer-events: auto; cursor: pointer; min-height: 44px; padding: 8px 14px; border: 2px solid var(--lamp); background: rgba(5,5,6,.92); color: #ffe2a8; font-weight: 700; box-shadow: 0 0 0 2px rgba(5,6,10,.6), 0 0 16px 2px rgba(var(--lamp-rgb), .5); max-width: 60%; z-index: 2; }
.trace-end.passed { opacity: .45; }
.gather-bar { position: relative; flex: none; width: 100%; max-width: 640px; height: 6px; margin: 0 auto; border-radius: 3px; background: var(--rule); overflow: hidden; }
.gather-fill { height: 100%; background: linear-gradient(90deg, #d9482b, var(--lamp)); transform-origin: left center; }
.gather-bar.urgent .gather-fill { background: linear-gradient(90deg, #ff3b1f, #ff7a45); }
.gather-field { position: relative; flex: 1; min-height: 0; width: 100%; max-width: 640px; margin: 0 auto; border: 1px solid rgba(var(--text-rgb), .14); border-radius: 10px; background: rgba(var(--text-rgb), .03); overflow: hidden; touch-action: none; }
.gather-item { position: absolute; left: 0; top: 0; width: 56px; height: 56px; padding: 0; border: 0; background: none; cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; }
.gather-dot { display: grid; place-items: center; font: 400 20px/1 var(--ui); width: 34px; height: 34px; margin: 11px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 4px rgba(var(--signal-rgb), .22), 0 2px 8px rgba(0, 0, 0, .5); transition: transform .2s ease, opacity .2s ease; }
.gather-item.in { pointer-events: none; }
.gather-item.in .gather-dot { transform: scale(.2); opacity: 0; }
.gather-item:focus-visible { outline: none; }
.gather-item:focus-visible .gather-dot { box-shadow: 0 0 0 3px var(--text), 0 2px 8px rgba(0, 0, 0, .5); }
.gather-count { position: relative; flex: none; margin: 0; font: 700 14px/1.3 var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--text); text-align: center; }
@media (prefers-reduced-motion: reduce) { .fullgame { animation: none; } .choice.grip.slipping, .choice.stone.glint .stone-back, .trace-head, .choice.die.thrown .die-cube, .choice.die.landed .die-cube, .die-cube.hop, .die-cube.hop::after { animation: none; } .gather-dot { transition: none; } }

/* ── Small games on the picture (engine/ui/scene-games.js). One look: an amber ring on the thing itself. ── */
.scenegame { padding: 0; background: #050506; }
.sg-view { position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab; }
.sg-back { position: absolute; inset: -40px; background: center / cover no-repeat; filter: blur(22px) brightness(.45); }
.sg-img, .sg-old { position: absolute; left: 0; top: 0; background: 0 0 / 100% 100% no-repeat; transform-origin: 0 0; }
.sg-old { pointer-events: none; transition: opacity .14s linear; }
.sg-over { position: absolute; inset: 0; pointer-events: none; }
.sg-top { position: absolute; z-index: 3; left: 0; right: 0; top: 0; padding: calc(14px + env(safe-area-inset-top)) 16px 18px; background: linear-gradient(rgba(5,5,6,.82), rgba(5,5,6,.5) 70%, rgba(5,5,6,0)); pointer-events: none; }
.sg-ask { min-height: 0; max-width: 560px; margin: 0 auto; font-size: 13.5px; text-shadow: 0 1px 8px #000; }
.sg-bar { position: relative; max-width: 560px; height: 5px; margin: 10px auto 0; border-radius: 3px; background: rgba(255,255,255,.14); overflow: hidden; }
.sg-fill { height: 100%; background: linear-gradient(90deg, #d9482b, var(--lamp)); transform-origin: left center; }
.sg-bar.held .sg-fill { background: rgba(var(--lamp-rgb), .55); }
.sg-bar.urgent .sg-fill { background: linear-gradient(90deg, #ff3b1f, #ff7a45); }
.sg-foot { position: absolute; z-index: 3; left: 16px; right: 16px; bottom: calc(14px + env(safe-area-inset-bottom)); text-shadow: 0 1px 6px #000; }
/* A ring has a dark edge inside and out, so it shows on any ground: amber on gold grass is not a marker (R13). */
.sg-ring { position: absolute; width: 54px; height: 54px; transform: translate(-50%, -50%); border-radius: 50%; border: 2px solid rgba(var(--lamp-rgb), .95); box-shadow: 0 0 0 2px rgba(5,6,10,.62), inset 0 0 0 1.5px rgba(5,6,10,.5), 0 0 14px 4px rgba(var(--lamp-rgb), .45), inset 0 0 10px rgba(var(--lamp-rgb), .25); animation: sg-glint 2.2s ease-in-out infinite; pointer-events: none; }
@keyframes sg-glint { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.sg-ghost { position: absolute; left: 0; top: 0; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: rgba(255,255,255,.28); border: 2px solid rgba(255,255,255,.6); box-shadow: 0 0 16px rgba(255,255,255,.35); transition: width .15s, height .15s, margin .15s; z-index: 2; }
.sg-ghost.press { width: 26px; height: 26px; margin: -13px 0 0 -13px; background: rgba(255,255,255,.4); }
.sg-ghost.showing { border-color: #fff; background: rgba(255,255,255,.42); box-shadow: 0 0 0 2px rgba(0,0,0,.45), 0 0 18px rgba(255,255,255,.5); }
.sg-flash { position: absolute; inset: 0; z-index: 4; background: #f4f6ff; opacity: 0; pointer-events: none; }
.sg-flash.on { animation: sg-flash .55s ease-out both; }
.sg-flash.soft { animation: sg-flash-soft .7s ease-out both; }
@keyframes sg-flash { 0% { opacity: .95; } 12% { opacity: .2; } 22% { opacity: .8; } 100% { opacity: 0; } }
@keyframes sg-flash-soft { 0% { opacity: .35; } 100% { opacity: 0; } }
.sg-shake .sg-view { animation: shake .5s linear both; }
.sg-flinch .sg-view { animation: sg-flinch .32s ease-out both; }
@keyframes sg-flinch { 0% { transform: translate(0, 0); } 25% { transform: translate(-6px, 2px); } 55% { transform: translate(5px, -1px); } 100% { transform: translate(0, 0); } }
/* whistle: a faint amber line to drag along, lit as the whistle climbs */
.whistle-line { position: absolute; width: 4px; margin-left: -2px; border-radius: 2px; background: linear-gradient(to top, rgba(var(--lamp-rgb), .45), rgba(var(--lamp-rgb), .08)); }
.whistle-lit { position: absolute; inset: 0; border-radius: 2px; background: linear-gradient(to top, var(--lamp), #ffe2a8); transform: scaleY(0); transform-origin: bottom center; box-shadow: 0 0 12px rgba(var(--lamp-rgb), .8); }
.whistle-line::after { content: ""; position: absolute; left: 50%; top: -9px; width: 0; height: 0; margin-left: -7px; border: 7px solid transparent; border-bottom-color: rgba(var(--lamp-rgb), .6); border-top: 0; }
.whistle .sg-view { transition: transform .25s ease-out; }
.whistle.top .sg-view { transform: scale(1.045); }
.whistle-slider { position: absolute; z-index: 3; left: 50%; bottom: 64px; width: min(70vw, 320px); transform: translateX(-50%); accent-color: var(--lamp); }
/* tug: the gate's halves, cut out of its picture, swing over the empty gateway */
.tug-gate { position: absolute; inset: 0; perspective: 900px; pointer-events: none; }
.tug-half { position: absolute; background: 0 0 / 100% 100% no-repeat; will-change: transform; }
.tug-half.left { transform-origin: 0 50%; }
.tug-half.right { transform-origin: 100% 50%; }
.tug-half.gone { transition: transform .35s ease-out, opacity .6s ease .3s; opacity: 0; }
.tug-rain { position: absolute; inset: 0; pointer-events: none; }
.tug-veil { position: absolute; opacity: 0; pointer-events: none; background: rgba(6, 10, 18, .7); -webkit-backdrop-filter: blur(16px) brightness(.5); backdrop-filter: blur(16px) brightness(.5); -webkit-mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 88%, transparent), linear-gradient(to right, transparent, #000 6%, #000 94%, transparent); -webkit-mask-composite: source-in; mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 88%, transparent), linear-gradient(to right, transparent, #000 6%, #000 94%, transparent); mask-composite: intersect; }
.tug .sg-ring { width: 64px; height: 64px; }
.tug.bracing .sg-ring { border-width: 3px; box-shadow: 0 0 0 2px rgba(5,6,10,.62), 0 0 22px 4px rgba(var(--lamp-rgb), .7); }
.tug.leaning .sg-ring { border-color: #ffe2a8; box-shadow: 0 0 0 2px rgba(5,6,10,.62), 0 0 26px 8px rgba(var(--lamp-rgb), .85); animation: none; }
.tug.shoved .sg-ring { border-color: #ff7a45; }
/* the push: a track from where the finger went down toward the post; it fills as far as they have pushed, and its end is red where a gust has knocked the lean back */
.tug-push { position: absolute; z-index: 2; height: 14px; border-radius: 7px; background: rgba(5,6,10,.6); box-shadow: 0 0 0 2px rgba(5,6,10,.6), 0 0 0 3px rgba(var(--lamp-rgb), .5); transform-origin: 0 50%; overflow: hidden; pointer-events: none; }
.tug-pushed, .tug-leaned { position: absolute; inset: 0; transform: scaleX(0); transform-origin: left center; }
.tug-pushed { background: #ff3b1f; }
/* while a gust has the lean knocked back, the red reads: the track takes a red edge and glow */
.tug.shoved .tug-push { box-shadow: 0 0 0 2px rgba(5,6,10,.7), 0 0 0 4px #ff3b1f, 0 0 16px 4px rgba(255,59,31,.6); }
.tug-leaned { background: linear-gradient(90deg, var(--lamp), #ffe2a8); }
.tug-meter { position: absolute; z-index: 3; left: 50%; bottom: 40px; width: min(70vw, 320px); height: 10px; transform: translateX(-50%); border-radius: 5px; background: rgba(255,255,255,.15); overflow: hidden; }
.tug-mfill { height: 100%; background: linear-gradient(90deg, var(--lamp), #ff4a2a); transform: scaleX(0); transform-origin: left center; }
/* lift: the thing, cut out of its own picture, turns up about its foot to the line where it has to stand, then drops into its hole */
.lift-clip { position: absolute; overflow: hidden; pointer-events: none; }   /* ends at the near edge of the hole: what goes below it is in the hole */
.lift-thing { position: absolute; background: center bottom / 100% 100% no-repeat; transform-origin: 50% 100%; filter: sepia(.65) saturate(1.5) brightness(.62) contrast(1.15) drop-shadow(0 6px 8px rgba(0,0,0,.55)); pointer-events: none; transition: filter .3s ease; }
.lift-thing.sunk { filter: sepia(.8) saturate(1.1) brightness(.42) contrast(1.1) drop-shadow(0 2px 3px rgba(0,0,0,.6)); }   /* lying in the mud */
.lift.holding .lift-thing { filter: sepia(.65) saturate(1.6) brightness(.74) contrast(1.15) drop-shadow(0 10px 12px rgba(0,0,0,.55)); }
.lift.home .lift-thing { filter: sepia(.65) saturate(1.5) brightness(.7) contrast(1.15) drop-shadow(0 3px 4px rgba(0,0,0,.6)); }
.lift-target { position: absolute; pointer-events: none; }
.lift-target::before { content: ""; position: absolute; inset: 0; background: var(--img, none) center bottom / 100% 100% no-repeat; opacity: .26; filter: brightness(1.7) saturate(.5); }   /* its own outline, standing */
.lift-target::after { content: ""; position: absolute; left: 50%; top: -14px; bottom: 0; width: 0; margin-left: -1.5px; border-left: 3px dashed rgb(var(--lamp-rgb)); filter: drop-shadow(0 0 1.5px #000) drop-shadow(0 0 1.5px #000); }   /* the line */
.lift-target-label { position: absolute; left: 50%; top: -18px; transform: translate(-50%, -100%); padding: 4px 10px; border-radius: 13px; border: 1px solid rgba(var(--lamp-rgb), .8); background: rgba(5,5,6,.84); font: 700 12px/1.25 var(--ui); letter-spacing: .06em; color: var(--text); white-space: nowrap; }
.lift.lined .lift-target::after { border-left-style: solid; border-left-color: #fff3cf; }
.lift.lined .lift-target-label { border-color: #fff3cf; color: #fff3cf; }
.lift.home .lift-target, .lift.home .lift-arc, .lift.fell .lift-arc { opacity: 0; transition: opacity .3s ease; }
.lift-arc { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.lift-arc path { fill: none; stroke: rgba(var(--lamp-rgb), .7); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1 10; filter: drop-shadow(0 0 1.5px #000); }
.lift-arc path.done { stroke: #ffe2a8; stroke-width: 4; stroke-dasharray: none; }
.lift.holding .lift-ring { border-width: 3px; border-color: #ffe2a8; animation: none; }
.lift.home .sg-view { animation: sg-flinch .28s ease-out both; }
/* gather on the picture: a hit area over each animal, a small ring at its hooves; the ready ones light */
.herd-hit { position: absolute; padding: 0; border: 0; border-radius: 40%; background: none; pointer-events: none; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: none; }
.herd-hit:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; }
.herd-dim { position: absolute; inset: 8%; border-radius: 45%; background: radial-gradient(rgba(5,6,10,.62), rgba(5,6,10,0) 72%); opacity: 0; transition: opacity .35s ease; }
.herd-hit.in .herd-dim { opacity: 1; }
.herd-hit.shy { animation: sg-flinch .3s ease-out both; }
/* The ring is round the animal: small and quiet while it stands; wide, pale and dark-edged when it is the one to tap, so it shows on gold grass as well as on dark. */
.sg-ring.herd-ring { border-width: 2px; opacity: .6; transform: translate(-50%, -50%) scale(.42); transition: transform .16s ease-out, opacity .16s ease-out; animation: none; box-shadow: 0 0 0 2px rgba(5,6,10,.6), inset 0 0 0 1.5px rgba(5,6,10,.45); }
.sg-ring.herd-ring.ready { opacity: 1; transform: translate(-50%, -50%) scale(1); border: 4px solid #fff3cf; box-shadow: 0 0 0 3px rgba(5,6,10,.85), 0 0 0 7px rgb(var(--lamp-rgb)), 0 0 0 9px rgba(5,6,10,.7), 0 0 26px 12px rgba(var(--lamp-rgb), .6), inset 0 0 0 2.5px rgba(5,6,10,.7), inset 0 0 18px rgba(255,243,207,.35); animation: herd-lit .55s ease-in-out infinite; }
@keyframes herd-lit { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.35); } }
.herd-hit.ready::before { content: ""; position: absolute; inset: -6%; border-radius: 50%; background: radial-gradient(rgba(255,246,220,.34), rgba(255,246,220,0) 68%); }   /* the animal itself lights */
.sg-ring.herd-ring.in { opacity: 0; transition: opacity .3s; }
.herd-ropes { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.herd-ropes path { fill: none; stroke: var(--lamp); stroke-width: 2.5; stroke-linecap: round; opacity: .9; stroke-dasharray: 200; stroke-dashoffset: 200; animation: rope .45s ease-out forwards; }
@keyframes rope { to { stroke-dashoffset: 0; } }
.herd-count { position: absolute; z-index: 3; left: 0; right: 0; top: calc(78px + env(safe-area-inset-top)); display: flex; gap: 10px; align-items: center; justify-content: center; text-shadow: 0 1px 6px #000; }
.herd-marks { display: inline-flex; gap: 4px; }
.herd-mark { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid rgba(var(--lamp-rgb), .8); }
.herd-mark.on { background: var(--lamp); }
/* find: the spots that must be found glint amber; a found one shows its line on the picture */
.stage.fit .bg { background-size: var(--fit-size, contain) !important; background-position: var(--fit-pos, 50% 50%) !important; background-repeat: no-repeat; animation: none; }   /* the whole picture, in the room above the text (engine/ui/art.js) */
.stage.fit .bgwrap { background: #07090d; }
.spot.need::after { width: 34px; height: 34px; margin: -17px 0 0 -17px; background: rgba(var(--lamp-rgb), .1); border: 2.5px solid rgb(var(--lamp-rgb)); box-shadow: 0 0 16px 4px rgba(var(--lamp-rgb), .6), 0 0 0 1px rgba(0,0,0,.55); }   /* brighter (2026-11-16): it sits under the shade at the foot of the picture, and has to be seen there */
.spot.need.found::after { border-color: rgba(var(--lamp-rgb), .35); box-shadow: none; animation: none; }
.spot-say { position: absolute; z-index: 3; left: 50%; top: 50%; width: max-content; max-width: min(230px, 46vw); padding: 7px 10px; text-align: left; transform: translate(-50%, calc(-100% - 20px)); border-left: 3px solid var(--lamp); border-radius: 0 6px 6px 0; background: rgba(var(--ink-rgb), .9); font: 500 13.5px/1.4 var(--prose); color: var(--text); box-shadow: 0 8px 20px rgba(0,0,0,.6); pointer-events: none; animation: fadein .2s ease both; }
.spot-say.peek { opacity: .85; }
.spot.edge-r .spot-say { transform: translate(calc(-100% + 18px), calc(-100% - 20px)); }
.spot.edge-l .spot-say { transform: translate(-18px, calc(-100% - 20px)); }
.findline { margin: 14px 0 0; font: 700 15px/1.35 var(--ui); color: var(--text); }
.findline small { display: block; margin-top: 4px; font: 500 12px/1.3 var(--ui); letter-spacing: .06em; text-transform: uppercase; color: var(--lamp); }
/* wrap: the trace drawn on the picture; the part behind the post fades */
.trace.onpic .trace-pad { position: absolute; inset: 0; max-width: none; margin: 0; border: 0; border-radius: 0; background: none; }
.trace-seg { fill: none; stroke: rgba(var(--lamp-rgb), .55); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 6 7; }
.trace-seg.behind { opacity: .3; }
.trace-segdone { fill: none; stroke: #d8c08a; stroke-width: 4.5; stroke-linecap: round; }
.trace-segdone.behind { opacity: .28; }
.trace.done.onpic .trace-segdone { animation: tighten .5s ease-out both; }
@keyframes tighten { 0% { stroke-width: 6; } 60% { stroke-width: 3.2; stroke: #fff2cf; } 100% { stroke-width: 3.6; } }
@media (prefers-reduced-motion: reduce) { .sg-ring, .sg-ring.herd-ring.ready { animation: none; } .sg-ring.herd-ring, .lift-thing { transition: none; } .sg-shake .sg-view, .sg-flinch .sg-view, .herd-hit.shy, .lift.home .sg-view { animation: none; } .herd-ropes path { animation: none; stroke-dashoffset: 0; } }

/* ── The agent seat (engine/ui/seat-ui.js; preview builds with agents on) ──
   The agent window: a panel of its own under the story, with the agent's name on it, there on every screen while an
   agent is seated. It has a fixed height, and the story's panel, a game on the picture and the end card all end where
   it begins, so it never lies over the story and nothing moves when what it shows changes. --seat-foot is what sits
   under it (the dev bar). On a wide screen it is a box under the story's box, the same width. */
.app.seated { --seat-h: calc(98px + env(safe-area-inset-bottom)); --seat-foot: 0px; --seat-all: calc(var(--seat-h) + var(--seat-foot)); }
.app.seated.devbar-on { --seat-h: 98px; --seat-foot: 41px; }
.agentwin { position: absolute; z-index: 16; left: 0; right: 0; bottom: var(--seat-foot, 0px); height: var(--seat-h, 98px); margin: 0; display: flex; align-items: stretch; background: var(--surface); border-top: 1px solid rgba(var(--signal-rgb), .5); }
.agentwin[hidden], .app[data-mode="gate"] .agentwin, .app[data-card="pov"] .agentwin { display: none; }
.aw-main { display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; min-width: 0; height: 100%; margin: 0; padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); border: 0; background: none; text-align: left; color: var(--text); cursor: pointer; overflow: hidden; }
.app.devbar-on .aw-main { padding-bottom: 8px; }
/* Nudge: "what do you think?", one tap, always there beside the window. */
.aw-nudge { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; width: 86px; margin: 8px 10px calc(8px + env(safe-area-inset-bottom)) 0; padding: 0 6px; border-radius: 10px; border: 1px solid rgba(var(--signal-rgb), .6); background: rgba(var(--signal-rgb), .1); color: var(--signal); font: 800 11px/1.2 var(--ui); letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }
.app.devbar-on .aw-nudge { margin-bottom: 8px; }
.aw-nudge b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 13px/1.2 var(--prose); letter-spacing: 0; text-transform: none; color: var(--text); }
.aw-nudge:hover, .aw-nudge:focus-visible { background: rgba(var(--signal-rgb), .2); outline: none; }
.aw-nudge:active { transform: scale(.97); }
.aw-nudge:disabled { opacity: .5; cursor: default; }
.aw-nudge-wide { width: 100%; margin: 0 0 10px; border-color: rgba(var(--signal-rgb), .6); color: var(--signal); }
.aw-main:hover, .aw-main:focus-visible { background: rgba(var(--signal-rgb), .07); outline: none; }
.aw-main:focus-visible { box-shadow: 0 0 0 2px var(--signal) inset; }
.aw-head { display: flex; align-items: center; gap: 8px; flex: none; min-width: 0; font: 800 11px/1.35 var(--ui); letter-spacing: .12em; text-transform: uppercase; }
.aw-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 8px rgba(var(--signal-rgb), .7); }
.agentwin.away .aw-dot { background: none; box-shadow: none; border: 1.5px solid var(--dim); }
.aw-name { flex: 0 1 auto; min-width: 0; max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--signal); }
.aw-mode { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; letter-spacing: .04em; text-transform: none; color: var(--dim); }
.aw-more { flex: none; color: var(--dim); }
.aw-feed { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-height: 0; overflow: hidden; font: 500 14px/1.36 var(--ui); }
.aw-line { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; flex: none; overflow: hidden; overflow-wrap: anywhere; }
.aw-feed > .aw-line:not(:only-child) { -webkit-line-clamp: 1; }
.aw-feed > .aw-line:last-child:not(:only-child) { -webkit-line-clamp: 2; }
.aw-feed > .aw-advice + .aw-line { -webkit-line-clamp: 1 !important; }
.aw-line b { margin-right: 3px; font-weight: 800; color: var(--signal); }
.aw-line.you b, .aw-line.hint { color: var(--dim); }
.aw-advice { display: block; flex: none; overflow: hidden; }
.aw-k { margin-right: 7px; font: 800 10.5px/1.36 var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--signal); }
.aw-pick { font: 700 15px/1.3 var(--prose); overflow-wrap: anywhere; }
.aw-why { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden; color: var(--dim); overflow-wrap: anywhere; }
.aw-feed > .aw-advice:only-child .aw-why { -webkit-line-clamp: 2; }
.aw-think { flex: none; font-weight: 700; color: var(--signal); }
.aw-dots { display: inline-block; margin-left: 1px; animation: aw-dots 1.1s ease-in-out infinite; }
@keyframes aw-dots { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.agentwin.new { animation: aw-new 1.5s ease-out; }
@keyframes aw-new { 0% { background-color: rgba(var(--signal-rgb), .34); } 100% { background-color: var(--surface); } }
.aw-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* The story's panel, a game on the picture and the end card end where the agent window begins. */
.app.seated .panel { bottom: var(--seat-all); min-height: calc(100dvh - var(--stage-h) + 6px - var(--seat-all)); max-height: calc(94dvh - var(--seat-all)); }
.app.seated.devbar-on .panel { padding-bottom: 18px; }
.app.seated .fullgame { bottom: var(--seat-all); }
.app.seated .end { padding-bottom: calc(var(--seat-all) + 12px); }
@media (min-width: 1040px) and (min-height: 560px) {
  .app.seated, .app.seated.devbar-on { --seat-h: 94px; --seat-foot: 28px; }
  .app.seated.devbar-on { --seat-foot: 50px; }
  .agentwin { left: 50%; right: auto; width: 760px; transform: translateX(-50%); border: 1px solid rgba(var(--signal-rgb), .4); border-radius: 10px; background: rgba(13,13,16,.94); overflow: hidden; }
  @keyframes aw-new { 0% { background-color: rgba(var(--signal-rgb), .3); } 100% { background-color: rgba(13,13,16,.94); } }
  .aw-main { padding: 8px 20px; }
  .app.seated .panel, .app.seated.devbar-on .panel { bottom: calc(var(--seat-all) + 8px); min-height: 232px; max-height: calc(80dvh - var(--seat-h)); padding-bottom: 20px; }
  .app.seated .fullgame { bottom: 0; }   /* a wide screen: the picture keeps the window; the agent's box sits over its foot, in the middle */
}
@media (min-width: 1040px) and (min-height: 560px) and (max-width: 1239px) { .agentwin { width: 640px; } }
@media (prefers-reduced-motion: reduce) { .agentwin.new, .aw-dots, .spot.pointed::after { animation: none; } }
/* The option the agent advises carries its name. */
.choice.advised { border-color: var(--signal); box-shadow: 0 0 0 2px rgba(var(--signal-rgb), .3) inset; }
.choice.advised::after { content: attr(data-advisor); display: block; margin-top: 4px; font: 800 10.5px/1.2 var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--signal); }
/* The agent points at a thing on the picture: its glint pulses, with the agent's name by it. */
.spot.pointed::after { width: 34px; height: 34px; margin: -17px 0 0 -17px; background: none; border: 3px solid var(--signal); box-shadow: 0 0 18px 4px rgba(var(--signal-rgb), .6); animation: aw-point 0.9s ease-in-out infinite; }
.spot.pointed::before { content: attr(data-by); position: absolute; left: 50%; top: 100%; transform: translate(-50%, 2px); padding: 2px 7px; border-radius: 10px; background: rgba(var(--ink-rgb), .86); font: 800 10.5px/1.4 var(--ui); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; color: var(--signal); pointer-events: none; }
@keyframes aw-point { 0%, 100% { transform: scale(.82); opacity: .75; } 50% { transform: scale(1.3); opacity: 1; } }
/* The window, opened. */
.awsheet .aw-all { min-height: 120px; }
.awsheet .aw-line { display: block; margin: 0 0 8px; font: 500 15px/1.45 var(--ui); -webkit-line-clamp: none; overflow: visible; }
.awsheet .aw-at { margin: 10px 0 4px; font: 700 10.5px/1.3 var(--mono); letter-spacing: .08em; color: var(--dim); }
.awsheet .aw-advice { padding: 6px 10px; border-left: 3px solid var(--signal); background: rgba(var(--signal-rgb), .07); }
.awsheet .aw-why { -webkit-line-clamp: none; display: block; }
.choice.start.press { touch-action: none; }   /* a game that starts on the press: the drag is the game's, not the page's */
.app[data-seat="watch"] .more { display: none; }
.app[data-choice-mine="0"] .choice { opacity: .92; }
.app[data-choice-mine="0"][data-seat="together-agent"] .choice::after { content: "Tap to suggest"; display: block; margin-top: 4px; font: 700 10.5px/1.2 var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--signal); }
.app[data-choice-mine="0"][data-seat="watch"] .choice { pointer-events: none; }
.choice.suggested { border-color: var(--signal); box-shadow: 0 0 0 2px rgba(var(--signal-rgb), .35) inset; }
.seat-waiting { margin: 6px 0 0; font: 500 14px/1.45 var(--ui); color: var(--dim); }
/* The hand-off (co-op): one choice given to the agent, "Let Scout roll". Under the options, in the agent's colour; a
   full row whatever the options are laid out as (a die, three stones). */
.handoff { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 100%; min-height: 48px; margin: 0; padding: 7px 14px; border-radius: 8px; border: 1px dashed rgba(var(--signal-rgb), .65); background: rgba(var(--signal-rgb), .06); font: 700 14.5px/1.25 var(--ui); color: var(--signal); cursor: pointer; opacity: 0; transition: opacity .25s ease; overflow-wrap: anywhere; }
.choices.ready .handoff { opacity: 1; }
.choices:not(.ready) .handoff { pointer-events: none; }
.handoff small { font: 600 10.5px/1.25 var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.handoff:hover, .handoff:focus-visible { background: rgba(var(--signal-rgb), .16); outline: none; }
.handoff:focus-visible { box-shadow: 0 0 0 2px var(--signal) inset; }
.handoff:disabled { cursor: default; }
.choices.ready .handoff:disabled:not(.handed) { opacity: .5; }
.handoff.handed { border-style: solid; background: rgba(var(--signal-rgb), .14); }
.choice.taken { border-color: var(--signal); background: rgba(var(--signal-rgb), .16); }
.aw-wait { margin-top: 2px; }
.aw-heard { margin: 0 0 8px; }
.aw-newcode { width: 100%; margin: 0 0 8px; }
.aw-newcode-out { margin: 0 0 10px; font: 500 14px/1.45 var(--ui); color: var(--dim); }
.aw-newcode-out .seat-code { margin: 6px 0; }
/* The choice map over the story (an agent is seated): it ends where the agent's window begins. */
.mapsheet { position: absolute; z-index: 15; inset: 0; display: flex; flex-direction: column; background: var(--ink); }
.app.seated .mapsheet { bottom: var(--seat-all); }
.mapsheet-frame { flex: 1 1 auto; min-height: 0; width: 100%; border: 0; background: var(--ink); }
.mapsheet-bar { flex: none; padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--rule); background: var(--surface); }
.app.seated .mapsheet-bar { padding-bottom: 8px; }
.mapsheet-bar .sheet-btn { display: block; width: 100%; max-width: 420px; margin: 0 auto; }
.aw-waitnote { margin: 0 0 10px; }
.seat-modes { display: grid; gap: 8px; margin: 8px 0 14px; }
.seat-mode { display: grid; gap: 3px; min-height: 56px; padding: 10px 12px; text-align: left; border-radius: 8px; border: 1px solid rgba(var(--text-rgb), .22); background: rgba(255,255,255,.03); color: var(--text); cursor: pointer; }
.seat-mode[aria-checked="true"] { border-color: var(--signal); background: rgba(var(--signal-rgb), .08); }
.seat-mode-name { font: 700 14px/1.3 var(--ui); }
.seat-mode-line { font: 500 13px/1.4 var(--ui); color: var(--dim); overflow-wrap: anywhere; }
.seat-code { margin: 10px 0 14px; text-align: center; font: 800 clamp(30px, 10vw, 44px)/1.1 var(--mono); letter-spacing: .14em; color: var(--signal); overflow-wrap: anywhere; }
.seat-how { margin: 0 0 10px; }
.seat-mono { margin: 2px 0 8px; padding: 8px 10px; border-radius: 6px; background: rgba(255,255,255,.06); font: 500 12px/1.45 var(--mono); color: var(--text); overflow-wrap: anywhere; }
.seat-link { display: inline-block; min-height: 44px; line-height: 44px; color: var(--signal); }
.seat-wait { color: var(--signal); }
.seatlog-form { display: flex; gap: 8px; margin: 8px 0; }
.seatlog-form .sheet-btn { flex: none; width: auto; min-width: 84px; margin: 0; padding: 0 16px; }
.app.devbar-on .awsheet .sheet-card, .app.devbar-on .seatsheet .sheet-card { margin-bottom: 44px; }   /* clear of the dev bar */
/* The opened window never loses its last buttons off the bottom: what was said gives way first, then the whole card scrolls. */
.awsheet .sheet-card { overflow-y: auto; overscroll-behavior: contain; }
.awsheet .sheet-card > * { flex-shrink: 0; }
.awsheet .sheet-card > .aw-all { flex: 1 1 120px; }
.app.devbar-on .awsheet .sheet-card { max-height: calc(90dvh - 44px); }
.seatlog-in { flex: 1; min-width: 0; min-height: 44px; padding: 0 10px; border-radius: 8px; border: 1px solid rgba(var(--text-rgb), .25); background: rgba(255,255,255,.05); color: var(--text); font: 500 15px/1.3 var(--ui); }
.seatlog { max-height: 46vh; overflow: auto; margin: 0; padding: 10px; border-radius: 8px; background: rgba(0,0,0,.35); font: 500 12px/1.5 var(--mono); color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.agentdoor { position: absolute; z-index: 2; left: 0; right: 0; bottom: calc(6px + env(safe-area-inset-bottom)); margin: 0; text-align: center; font: 500 12px/1.4 var(--ui); color: var(--dim); }
.agentdoor a { color: var(--signal); }
