/* registered as a <number> so browsers that support @property TRANSITION it smoothly instead of
   flipping discretely at 50% (the default behavior for an un-registered custom property) */
@property --glow-a { syntax: '<number>'; inherits: true; initial-value: .09; }
:root {
  /* iOS semantic dark palette (calibrated to systemColors) */
  --bg: #0b0c10;                         /* brand near-black */
  --bg-2: #121317;                       /* lifted reading surface (no halation) */
  --panel: #1c1c1e;                      /* secondarySystemBackground — resting surface */
  --panel-elevated: #2c2c2e;             /* elevated — sheets, the options card, popovers */
  --text: #dcd9d1;                       /* warm off-white body (never #fff on #000) */
  --label: #ffffff;                      /* primary label / nav title */
  --muted: rgba(235, 235, 245, .60);     /* secondaryLabel */
  --muted-2: rgba(235, 235, 245, .45);   /* tertiaryLabel — mono micro-labels (>=3:1 over --bg, WCAG) */
  --line: rgba(84, 84, 88, .55);         /* system separator (translucent hairline) */
  --accent-rgb: 212 165 116;             /* amber #D4A574 (kyryllov.com token family) — genre-tinted; play.html overrides per-screen */
  --accent: rgb(var(--accent-rgb));
  --on-accent: #1a1206;                  /* text/icon color on an accent fill */
  /* type: device fonts — SF for UI, New York for prose, zero network cost */
  --font-sans: -apple-system, system-ui, 'SF Pro Text', 'Inter', Segoe UI, Roboto, sans-serif;
  --font-serif: 'Lora', ui-serif, 'New York', Georgia, serif;  /* branded prose, full Cyrillic */
  --font-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', SFMono-Regular, monospace;
  /* spacing · radius · motion · material */
  --pad: 20px;
  --r-sm: 8px; --r: 12px; --r-lg: 16px;
  --ease-ios: cubic-bezier(0.22, 1, 0.36, 1);
  /* an iOS press spring: a button sinks instantly, then overshoots back — the "native game button" feel */
  --spring-press: linear(0, 0.2 3.4%, 0.45 6.9%, 0.84 13.7%, 1.07 20.6%, 1.13, 1.15 28.3%, 1.12, 1.07 38.6%, 1.0 49.3%, 0.98, 0.99 73.5%, 1);
  --mat-blur: saturate(180%) blur(20px);
  --mat-thick: saturate(180%) blur(30px);          /* a UIMenu / thick material */
  --menu-fill: rgb(44 44 47 / .97);                /* translucent glass, but opaque enough that prose can't read through */
  --read-scale: 1;                                 /* Dynamic-Type bridge — native.js sets it from the iOS text size */
  --t-headline: calc(1.0625rem * var(--read-scale));   /* iOS headline; the choice rows read it */
}
/* Re-resolve --accent wherever a template sets --accent-rgb inline. A var() inside a custom property
   is substituted at the element that DECLARES it (here :root) and descendants inherit the RESOLVED
   value — so overriding --accent-rgb alone never re-tinted var(--accent). This line makes each
   genre-tinted scope re-derive --accent from ITS OWN --accent-rgb (fixes play screens stuck on gold). */
.play, .launch, .hero-card, .world, .wrapped, .coop-invite { --accent: rgb(var(--accent-rgb)); }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; color: var(--text); }
html { overflow-y: scroll; background: var(--bg); }
body { font-family: var(--font-sans); line-height: 1.6; -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility; -moz-osx-font-smoothing: grayscale;
  background: radial-gradient(130% 90% at 50% -10%, #15171f 0%, var(--bg) 55%); background-attachment: fixed;
  animation: pagein .4s ease both; }
@keyframes pagein { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
button, input, select, textarea { font-family: inherit; }
a { color: var(--accent); text-decoration: none; }

.screen { max-width: 680px; margin: 0 auto;
  padding: calc(48px + env(safe-area-inset-top)) calc(20px + env(safe-area-inset-right))
           calc(48px + env(safe-area-inset-bottom)) calc(20px + env(safe-area-inset-left)); }
.home { text-align: center; }
.lang-switch { display: flex; justify-content: center; gap: .5em; font-family: var(--font-mono);
  font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.6em; }
.lang-switch a { color: var(--muted); padding: .3em .2em; min-height: 30px; }
.lang-switch a.is-active { color: var(--accent); font-weight: 600; }
.lang-switch span { opacity: .4; }
/* animated brand mark (kyryllov.com ink-art language): a comet traces the open-book spine
   on an endless loop, the spine node pulses — the "story never stops" motif, at rest. */
.brand-mark { display: flex; justify-content: center; margin-bottom: .2em; }
.brand-mark svg { width: 100px; height: auto; overflow: visible; }
.brand-mark .mark-trace, .brand-mark .mark-runner { fill: none; stroke-linejoin: round; stroke-linecap: round; stroke-width: 32; }
.brand-mark .mark-trace { stroke: rgb(var(--accent-rgb) / .35); }
.brand-mark .mark-runner { stroke: rgb(var(--accent-rgb)); stroke-dasharray: 0.045 0.955; stroke-dashoffset: 1;
  animation: markRun 4s linear infinite; }
.brand-mark .mark-node { fill: rgb(var(--accent-rgb)); animation: markPulse 4s ease-in-out infinite; }
@keyframes markRun { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes markPulse { 0%, 100% { r: 24; opacity: .9; } 50% { r: 31; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .brand-mark .mark-runner { animation: none; opacity: .85; }
  .brand-mark .mark-node { animation: none; }
}
.brand { font-size: 2.55rem; margin: .2em 0 0; letter-spacing: .01em; text-shadow: 0 0 44px rgb(var(--accent-rgb) / .22); }
.tagline { color: var(--muted); margin: .3em 0 2em; font-style: italic; }
.cta { display: inline-block; background: var(--accent); color: var(--on-accent); padding: .75em 1.5em;
  border-radius: var(--r); font-weight: bold; border: none; cursor: pointer; font-size: 1rem;
  box-shadow: 0 6px 22px rgb(var(--accent-rgb) / .22); transition: transform .34s var(--spring-press), box-shadow .15s ease, filter .15s; }
.cta:hover { transform: translateY(-1px); box-shadow: 0 9px 30px rgb(var(--accent-rgb) / .38); filter: brightness(1.05); }
.cta.ghost { box-shadow: none; }
.cta.ghost:hover { box-shadow: 0 0 0 1px var(--accent) inset; }
.surprise-form { margin: .8em 0 0; }
.cta.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.hint { color: var(--muted); font-size: .82rem; font-style: italic; text-align: center;
  padding: .5em 1em; max-width: 680px; margin: 0 auto; }
.library { margin-top: 2.5em; display: flex; flex-direction: column; gap: .6em; text-align: left; }
.world { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; position: relative;
  padding: .9em 1em; display: flex; flex-direction: column; transition: border-color .15s ease, transform .15s ease; }
.world .world-title, .world .world-sub { padding-right: 40px; }  /* clear the corner crest, with margin */
.world:hover { border-color: var(--accent); transform: translateY(-1px); }
.world-title { font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.world-sub { color: var(--muted); font-size: .78rem; font-family: var(--font-mono); margin-top: .2em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; display: block; }
.muted { color: var(--muted); }
.account-link { display: block; text-align: center; margin-top: 2.2em; font-size: .85rem;
  color: rgb(var(--accent-rgb) / .8); padding: .6em; min-height: 44px; }  /* a real, tappable affordance */
/* home secondary actions: one even 2-column grid (no ragged pyramid), edge-aligned to the hero */
.home-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .55em; margin-top: .8em; }
.home-actions .cta, .home-actions form { width: 100%; margin: 0; }
.home-actions form { display: grid; }  /* so the wrapped 'Surprise me' .cta fills its stretched cell like the sibling buttons */
.home-actions form .cta { width: 100%; height: 100%; }
.home .create-hero { display: block; }

.setup .back { display: inline-block; margin-bottom: 1em; color: var(--muted); }
.setup h2 { margin-top: 0; font-family: var(--font-serif); font-size: 1.9rem; font-weight: 600; }
html[lang="en"] .setup h2 { font-family: 'Instrument Serif', var(--font-serif); }
.setup-form { display: flex; flex-direction: column; gap: 1.1em; }
.setup-form label { display: flex; flex-direction: column; gap: .4em; color: var(--muted); font-size: .85rem; }
.setup-form select, .setup-form input, .setup-form textarea {
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: .7em; font-size: 1rem; }
.setup-form .cta { margin-top: .5em; }

/* cinematic world-creation warp loader */
.launch { position: fixed; inset: 0; background: var(--bg); overflow: hidden; }
#warp { position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  opacity: 0; animation: warpIn .5s ease forwards; }  /* ease in instead of hard-cutting at full velocity */
@keyframes warpIn { to { opacity: 1; } }
.launch-overlay { position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 2em; pointer-events: none; }
.launch-title { font-size: 1.55rem; color: var(--text); margin-bottom: .7em; max-width: 14em;
  text-shadow: 0 0 30px rgba(0,0,0,.85), 0 2px 6px rgba(0,0,0,.9); }
.launch-msg { color: var(--accent); font-family: var(--font-mono); font-size: .82rem;
  letter-spacing: .1em; text-transform: uppercase; transition: opacity .3s ease;
  text-shadow: 0 0 24px rgba(0,0,0,.95); }
.launch-dots { margin-top: 1.3em; display: flex; gap: .45em; }
.launch-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  opacity: .35; animation: ldot 1.2s infinite ease-in-out; }
.launch-dots span:nth-child(2) { animation-delay: .2s; }
.launch-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes ldot { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }

/* cinematic cold-open (first scene of a new world) */
.coldopen { position: fixed; inset: 0; z-index: 50; cursor: pointer;
  /* a film title-card has depth, not flat black: a soft genre-tinted vignette */
  background: radial-gradient(80% 55% at 50% 42%, rgb(var(--accent-rgb) / .12), transparent 72%), var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 2em; opacity: 0; animation: coIn .9s ease forwards; }
.coldopen.gone { animation: coOut .9s var(--ease-ios) forwards; }
.co-skip { position: absolute; bottom: calc(2.4em + env(safe-area-inset-bottom)); font-family: var(--font-mono);
  font-size: .78rem; letter-spacing: .22em; text-transform: uppercase; color: rgb(var(--accent-rgb) / .85);
  opacity: 0; animation: coUp .8s ease 1.2s forwards, coBreathe 2.6s ease-in-out 2s infinite; }
.co-skip::before { content: "›"; display: block; transform: rotate(-90deg); font-size: 1.1rem; margin: 0 auto .3em;
  color: rgb(var(--accent-rgb) / .7); }
@keyframes coBreathe { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes coIn { to { opacity: 1; } }
@keyframes coOut { to { opacity: 0; visibility: hidden; } }
.co-kicker { font-family: var(--font-mono); color: var(--accent); font-size: .8rem;
  letter-spacing: .25em; text-transform: uppercase; margin-bottom: 1em; opacity: 0; animation: coUp .8s ease .4s forwards; }
.co-title { font-size: 2.6rem; color: var(--text); max-width: 11em; line-height: 1.18; opacity: 0;
  animation: coUp 1s ease .7s forwards; text-shadow: 0 0 40px rgb(var(--accent-rgb) / .2); }
@keyframes coUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* EPISODE CARD: a prestige-TV title slate for a chapter reached MID-play (not the very first scene,
   which the cold-open already owns). Wraps a CLONE of the real .chapter node, so eyebrow/name/
   ghost-folio/genre-voice are pixel-identical to the in-stream heading — same identity, full-screen. */
.episode-card { position: fixed; inset: 0; z-index: 48; cursor: pointer;
  background: radial-gradient(80% 55% at 50% 42%, rgb(var(--accent-rgb) / .12), transparent 72%), var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 2em; opacity: 0; animation: coIn .6s ease forwards; }
.episode-card.gone { animation: coOut .5s var(--ease-ios) forwards; }
.episode-card .chapter { margin: 0; }  /* the in-stream .chapter has flow margins; here it's flex-centered */
.episode-card .ep-time { margin-top: 1.1em; font-family: var(--font-mono); font-size: .78rem;
  color: var(--muted); letter-spacing: .04em; opacity: 0; animation: coUp .6s ease .25s forwards; }
@media (prefers-reduced-motion: reduce) { .episode-card { display: none; } }  /* JS already skips creating it */

/* ── per-world SIGIL: a seeded heraldic mark (sigil.py) — collectible identity across surfaces */
.sigil { width: 22px; height: 22px; display: block; }
/* cold-open: the crest INSCRIBES itself (stroke draw) then the node blooms — the world's seal */
.co-sigil { margin-bottom: 1.1em; opacity: 0; animation: coUp .7s ease .15s forwards; }
.co-crest { width: 46px; height: 46px; color: var(--accent); filter: drop-shadow(0 0 13px rgb(var(--accent-rgb) / .4)); }
.co-crest path { stroke-dasharray: 44; stroke-dashoffset: 44; animation: sigilDraw 1.5s ease .35s forwards; }
.co-crest circle { opacity: 0; animation: coUp .6s ease 1.25s forwards; }
@keyframes sigilDraw { to { stroke-dashoffset: 0; } }
/* library + hero cards: a quiet crest in the corner (the world's identity at a glance) */
.world-crest, .hero-crest { position: absolute; top: .7em; right: .8em; color: rgb(var(--accent-rgb) / .55);
  pointer-events: none; }
.world-crest .sigil, .hero-crest .sigil { width: 26px; height: 26px; }
.hero-crest .sigil { width: 30px; height: 30px; }
.twist-flash { animation: twflash 1.1s ease; }
@keyframes twflash { 15% { box-shadow: 0 0 26px 2px rgb(var(--accent-rgb) / .33); }
  100% { box-shadow: 0 0 0 0 rgb(var(--accent-rgb) / 0); } }

/* play screen — the reading surface is FILM STOCK, not a web page: grain + genre vignette (::before)
   under a slowly BREATHING genre glow (::after). Both fixed, pointer-through, zero JS. */
.play { display: flex; flex-direction: column; height: 100dvh; background: var(--bg);
  --vig-a: .22; --breath: 9s; }
/* DURESS: a run of failures drains the room toward black; a win lets color flood back (typewriter.js
   toggles the class). --glow-a is @property-registered above as a <number> so this actually eases,
   rather than flipping instantly the way an un-registered custom property would. */
.play.duress { --glow-a: .045; }
.play.duress-deep { --glow-a: .02; --breath: 5s; }
/* heavier grade for the dark genres; feather-light for the grounded ones */
.play[data-genre="noir"], .play[data-genre="cosmic_horror"], .play[data-genre="zombie"],
.play[data-genre="mystery"], .play[data-genre="post_apocalypse"] { --vig-a: .34; }
.play[data-genre="travel"], .play[data-genre="startup"], .play[data-genre="city_life"],
.play[data-genre="second_chance"], .play[data-genre="romance"] { --vig-a: .14; }
.play[data-mood="grim"], .play[data-mood="mysterious"] { --breath: 12s; }   /* slow dread */
.play[data-mood="heroic"], .play[data-mood="funny"] { --breath: 7s; }       /* lighter pulse */
.play::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E") repeat,
    radial-gradient(120% 100% at 50% 30%, transparent 58%, rgb(0 0 0 / var(--vig-a))); }
.play[data-genre="litrpg"]::before { background:  /* CRT scanline instead of grain */
    repeating-linear-gradient(0deg, rgb(255 255 255 / .012) 0 1px, transparent 1px 3px),
    radial-gradient(120% 100% at 50% 30%, transparent 58%, rgb(0 0 0 / var(--vig-a))); }
.play::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(125% 55% at 50% 0%, rgb(var(--accent-rgb) / var(--glow-a, .09)), transparent 60%);
  transform-origin: 50% 0%; animation: breathe var(--breath) ease-in-out infinite;
  transition: --glow-a 1.4s ease; }
@keyframes breathe { 50% { transform: scale(1.06); opacity: .75; } }
/* the world holds its breath with you: while a turn is in flight the breathing quickens */
.play:has(.composer.busy)::after { animation-duration: 2.4s; }
/* in-world time of day regrades the room: night dims the world-glow, dawn/dusk warm it */
.play[data-tod="night"] { --glow-a: .05; }
.play[data-tod="dawn"], .play[data-tod="dusk"] { --glow-a: .13; }
/* TWIST: the atmosphere itself surges for one composed beat (sting + haptics + stamp land together) */
.play.twist-beat::after { animation: twistSurge 1.2s var(--ease-ios); }
@keyframes twistSurge { 0% { opacity: .45; transform: scale(.98); }
  30% { opacity: 1; transform: scale(1.1); } 100% { opacity: .9; transform: scale(1); } }
/* the sentence where reality broke keeps a permanent faint accent underline — the story's scar */
.story .scar { text-decoration: underline; text-decoration-color: rgb(var(--accent-rgb) / .4);
  text-decoration-thickness: 1px; text-underline-offset: .18em; }
/* the aether particle field (aether.js) — same layer as the film stock, under the prose */
.aether { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
/* THE COMMIT — your words lift out of the composer and hang in the world while it thinks */
.commit-fly { position: fixed; z-index: 45; pointer-events: none; font-style: italic; font-size: .95rem;
  color: var(--text); padding-left: .8em; border-left: 2px solid rgb(var(--accent-rgb) / .55);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 80vw;
  transition: transform .7s var(--ease-ios), opacity .7s ease; will-change: transform; }
.commit-fly.up { transform: translateY(-16vh) scale(.97); opacity: .55; }
.commit-fly.gone { opacity: 0; transform: translateY(-24vh) scale(.94); }
@media (prefers-reduced-motion: reduce) { .play::after { animation: none; transition: none; } .play.twist-beat::after { animation: none; } }
.topbar { display: flex; align-items: center; gap: .5em; border-bottom: 0;
  /* title is centered in available space (iOS inline-title behavior). True screen-centering would force
     truncating short chapter titles or clipping the 148px control cluster — a worse trade, so left as-is. */
  position: sticky; top: 0; z-index: 20;
  background: rgb(20 20 22 / .72); -webkit-backdrop-filter: var(--mat-blur); backdrop-filter: var(--mat-blur);
  box-shadow: 0 .5px 0 var(--line);  /* hairline like an iOS nav bar */
  padding: calc(.5em + env(safe-area-inset-top)) calc(var(--pad) + env(safe-area-inset-right)) .5em calc(var(--pad) + env(safe-area-inset-left)); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .topbar { background: #15161a; } }
.topbar .back { font-size: 1.55rem; padding: 0 .2em; min-width: 44px; min-height: 44px; color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; }
.topbar .back:active { opacity: .55; transform: scale(.94); }
.topbar-actions { display: flex; align-items: center; gap: .5em; }
.topbar .title { flex: 1; min-width: 0; font-size: 1.0625rem; font-weight: 600;
  color: var(--label); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl { position: relative; }
/* nav-bar controls = borderless glyph buttons (iOS), not boxed web buttons */
.topbar .tl > summary, .topbar .sound-btn { border: 0; background: transparent; }
.tl > summary { list-style: none; cursor: pointer; border: 1px solid var(--line); border-radius: 8px;
  padding: .3em .55em; color: var(--accent); font-size: 1.15rem; min-height: 44px; min-width: 44px;
  display: inline-flex; align-items: center; justify-content: center; }
.tl > summary:active { opacity: .55; }
.sound-btn { border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--accent);
  font-size: 1.15rem; min-height: 44px; min-width: 44px; cursor: pointer; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; }
.sound-btn:active { opacity: .55; }
.sound-btn:active { transform: scale(.96); }
.tl > summary::-webkit-details-marker { display: none; }
.tl-panel { position: absolute; right: 0; top: 2.6em; width: min(80vw, 300px); max-height: 70vh; overflow-y: auto;
  background: var(--menu-fill); border-radius: var(--r-lg); padding: .5em; z-index: 30;
  -webkit-backdrop-filter: var(--mat-thick); backdrop-filter: var(--mat-thick);
  box-shadow: 0 12px 40px rgb(0 0 0 / .55), 0 0 0 .5px var(--line) inset;
  /* a UIMenu pops from its trigger; CSS animation (not transition) re-fires each time <details> opens */
  transform-origin: top right; animation: menuPop .26s var(--spring-press) both; }
@keyframes menuPop { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
.tl-panel.closing { animation: menuClose .18s var(--ease-ios) forwards; pointer-events: none; }
@keyframes menuClose { to { opacity: 0; transform: scale(.96) translateY(4px); } }
/* the panels that open UPWARD (composer chips, in-game settings) scale from their bottom edge */
.bonds-dd .tl-panel, .settings-dd .tl-panel { transform-origin: bottom right; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .tl-panel { background: var(--panel-elevated); } }
/* topbar popovers FLOAT below the bar and POINT at their trigger (an iOS menu, not a welded banner) */
.topbar .tl-panel { top: calc(100% + 10px); }
.topbar .tl-panel::before { content: ""; position: absolute; top: -6px; right: 13px; width: 12px; height: 12px;
  background: var(--menu-fill); -webkit-backdrop-filter: var(--mat-thick); backdrop-filter: var(--mat-thick);
  border-top: .5px solid var(--line); border-left: .5px solid var(--line); transform: rotate(45deg); }
.tl-head { font-family: var(--font-mono); font-size: .7rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em; margin: .4em .3em .2em; }
.tl-node, .tl-branch { margin: 0; }
.tl-node button, .tl-branch button { width: 100%; text-align: left; background: transparent; border: none;
  border-radius: 6px; color: var(--text); padding: .45em .4em; cursor: pointer; display: flex; gap: .5em; font-size: .85rem; }
.tl-node button:hover, .tl-branch button:hover { background: rgb(var(--accent-rgb) / .08); }
.tl-node.cur button { color: var(--accent); }
.tl-dot { color: var(--accent); }
.tl-txt em { color: var(--muted); font-size: .72rem; font-family: var(--font-mono); font-style: normal; }
.tl-branch button { color: var(--muted); }
.sharelink { width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--text);
  border-radius: 6px; padding: .5em; font-size: .78rem; }
.shared-cta { text-align: center; margin: 2.5em 0 1em; }
.shared-cta .cta { margin-top: .6em; }

/* return banner: informative (how long away + the plot's "what changed"), tap to dismiss */
.returnbanner { background: rgb(var(--accent-rgb) / .1); box-shadow: 0 .5px 0 var(--line);
  padding: .7em calc(var(--pad) + env(safe-area-inset-right)) .7em calc(var(--pad) + env(safe-area-inset-left));
  cursor: pointer; display: flex; flex-direction: column; gap: .25em; }
.rb-eyebrow { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .04em; color: var(--accent);
  text-transform: uppercase; }
.rb-beat { font-family: var(--font-serif); font-style: italic; font-size: .95rem; color: var(--text); line-height: 1.4; }
.returnbanner.away { border-left: 3px solid var(--accent); }
.world-nudge { color: var(--accent); font-size: .72rem; margin-top: .35em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* v3.0 — daily hook: streak + genre-spine library cards */
.streak { display: inline-block; margin: 0 0 1.3em; padding: .3em .95em; border-radius: 999px;
  background: rgb(var(--accent-rgb) / .12); color: var(--accent); font-size: .85rem;
  font-family: var(--font-mono); border: 1px solid rgb(var(--accent-rgb) / .3); }
.hdr-streak { color: var(--accent); font-size: .85rem; font-family: var(--font-mono);
  white-space: nowrap; padding: 0 .15em; }
.hdr-streak.milestone { animation: streakPulse 1.6s var(--ease-ios) 2; }
@keyframes streakPulse { 0%, 100% { transform: scale(1); text-shadow: none; }
  40% { transform: scale(1.22); text-shadow: 0 0 14px rgb(var(--accent-rgb) / .7); } }
/* milestone toast — a brief, earned celebration that drops in then fades */
.streak-beat { position: fixed; left: 50%; top: calc(64px + env(safe-area-inset-top)); transform: translateX(-50%);
  z-index: 40; background: rgb(28 28 30 / .92); -webkit-backdrop-filter: var(--mat-blur); backdrop-filter: var(--mat-blur);
  color: var(--label); font-family: var(--font-mono); font-size: .9rem; letter-spacing: .04em;
  padding: .7em 1.2em; border-radius: 999px; box-shadow: 0 8px 30px rgb(0 0 0 / .5), 0 0 0 1px rgb(var(--accent-rgb) / .4) inset;
  animation: streakBeatIn .6s var(--ease-ios) both; }
.streak-beat.gone { animation: streakBeatOut .5s var(--ease-ios) forwards; }
@keyframes streakBeatIn { from { opacity: 0; transform: translate(-50%, -12px) scale(.9); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes streakBeatOut { to { opacity: 0; transform: translate(-50%, -10px); visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .hdr-streak.milestone { animation: none; } .streak-beat { animation: none; } }
.world { border-left-width: 3px; border-left-color: rgb(var(--accent-rgb) / .5); }
.stream { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
  padding: 1em var(--pad) calc(1.5em + env(safe-area-inset-bottom));
  width: 100%; max-width: 680px; margin: 0 auto;
  position: relative; z-index: 1;           /* reading surface rides above the film-stock pseudo layers */
  display: flex; flex-direction: column; }  /* so a short scene's slack sits above the composer, not below it */
/* a chapter opening should feel like a CHAPTER: an eyebrow, a serif title, a rule, and room to breathe */
.chapter { text-align: center; margin: 2.8em auto 1.5em; max-width: 30em; padding: 0 var(--pad); }
.chapter-eyebrow { display: block; font-family: var(--font-mono); color: var(--accent); font-size: .72rem;
  letter-spacing: .3em; text-transform: uppercase; margin-bottom: .55em; }
.chapter-name { display: block; font-family: var(--font-serif); color: var(--label); font-size: 1.55rem;
  line-height: 1.22; text-wrap: balance; }
.chapter::after { content: ""; display: block; width: 38px; height: 2px; margin: 1em auto 0;
  background: var(--accent); opacity: .5; border-radius: 2px; }
.turn { margin: 0 0 1.7em; }
/* full-bleed cinematic scene art (edge to edge, fades into the prose) — not a framed web thumbnail */
.scene { display: block; width: calc(100% + 2 * var(--pad)); max-width: none;
  margin: 0 calc(-1 * var(--pad)) .9em; aspect-ratio: 16 / 9; max-height: 38dvh;
  object-fit: cover; border: 0; border-radius: 0; background: var(--panel);
  -webkit-mask-image: linear-gradient(to bottom, #000 76%, transparent);
          mask-image: linear-gradient(to bottom, #000 76%, transparent);
  /* a slow living drift (Ken Burns) + a soft fade-in as each scene lands — cinematic, free */
  transform-origin: 50% 42%; animation: sceneIn .9s var(--ease-ios) both, kenburns 28s ease-out 0s both; }
@keyframes sceneIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes kenburns { from { transform: scale(1.001); } to { transform: scale(1.05); } }
/* the DEVELOPING PLATE: async chapter art arrives like a photograph developing into the live scene */
.scene.developing { animation: develop 1.8s var(--ease-ios) both, kenburns 28s ease-out 1.8s both; }
@keyframes develop { 0% { opacity: 0; filter: saturate(.15) brightness(.55) blur(6px); }
  60% { opacity: 1; } 100% { opacity: 1; filter: none; } }
@media (prefers-reduced-motion: reduce) { .scene, .scene.developing { animation: sceneIn .9s ease both; } }
.setup-form .check { flex-direction: row; align-items: center; gap: .5em; color: var(--muted); }
.turn .meta { font-family: var(--font-mono); color: var(--muted); font-size: .7rem; margin-bottom: .35em; }
/* "your move": a quiet quoted line of what you chose — reads as the player's input, not body prose */
.turn .you { color: var(--muted); font-size: .92rem; font-style: italic; line-height: 1.4;
  margin: 0 0 .6em; padding-left: .8em; border-left: 2px solid rgb(var(--accent-rgb) / .45);
  position: relative; }
/* the player's words land MONUMENTAL — full-voice for a beat, then settle into their modest echo
   (the core aha staged: your line is the most important text on screen). Transform-only, zero CLS. */
@media (prefers-reduced-motion: no-preference) {
  .turn-enter .you { animation: youLand 1.2s var(--spring-press) both; transform-origin: left top; }
  .turn-enter .you::before { content: "\201C"; position: absolute; left: -.5em; top: .32em;
    font-family: 'Instrument Serif', var(--font-serif); font-style: normal; line-height: 0;
    font-size: 2.2em; color: var(--accent); animation: quoteFade 1.2s ease both; }
}
@keyframes youLand { 0% { transform: scale(1.32) translateY(6px); color: var(--text); } 100% { transform: none; } }
@keyframes quoteFade { 0% { opacity: .9; } 100% { opacity: 0; } }
/* verdict: a small editorial tag, not a chunky web pill */
.verdict { display: inline-block; font-family: var(--font-mono); font-size: .76rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; padding: .26em .65em; border-radius: 6px; margin-bottom: .9em; }
/* the verdict aligns under the "your move" line and OWNS its own line — the header of the consequence prose */
.turn .you + .verdict { margin-left: calc(.8em + 2px); margin-top: .1em; }
.v-success { color: #8fce9b; background: rgba(143,206,155,.12); box-shadow: inset 0 0 0 .5px rgba(143,206,155,.35); }
.v-failure { color: #d98a8a; background: rgba(217,138,138,.12); box-shadow: inset 0 0 0 .5px rgba(217,138,138,.35); }
.v-twist { color: var(--accent); background: rgb(var(--accent-rgb) / .14); box-shadow: inset 0 0 0 .5px rgb(var(--accent-rgb) / .4); }
.story { font-size: 1.13rem; margin: 0 auto; max-width: 34em; }
.story .para { margin: 0 0 .9em; }
.story .para:last-child { margin-bottom: 0; }
.tw-active::after { content: "▍"; color: var(--accent); animation: blink 1s steps(1) infinite; margin-left: 1px; }
@keyframes blink { 50% { opacity: 0; } }
/* a true drop initial: cap-height seated to the first line, ~2 lines of prose wrapping beside it */
.story.dropcap .para:first-of-type::first-letter { float: left; font-size: 3.35em; line-height: .66;
  padding: .07em .1em 0 0; margin-top: .02em; color: var(--accent); font-weight: bold;
  font-family: var(--font-serif); }
@media (min-width: 600px) { .story { font-size: 1.18rem; line-height: 1.7; } }

/* single-scroll: the composer flows at the end of #stream (no pinned panel) — it inherits the
   stream's side padding + bottom safe-area, so it just continues the one scroll after the prose */
.composer { border: 0; background: transparent; box-shadow: none; padding: .5em 0 0; margin: 0; margin-top: auto; }
.status { display: flex; flex-wrap: wrap; gap: .35em; margin-bottom: .4em; align-items: center; }
.status > .chip { max-width: 60%; }  /* a truncated inventory chip on one row beats a 2-row status block eating height */
.chip { font-family: var(--font-mono); font-size: .78rem; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: .22em .65em; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.time { color: var(--accent); }
.chip.offline { color: #b9885a; border-color: #4a392a; }
/* the status-bar dropdown chips (inventory/people/memory) must match the plain .chip pill — NOT inherit
   the 44px header touch-target `.tl > summary` box, which made them taller than the time chip. One
   uniform line-height on ALL status chips (span + summary) so every chip is the exact same height. */
.status .chip { line-height: 1.2; }
.status .tl > summary.chip { min-height: 0; min-width: 0; font-size: .78rem;
  border-radius: 999px; padding: .22em .65em; }
/* Fresh-scene FOUC fix: the full server-rendered scene must NOT flash before the typewriter clears +
   types it. Hidden until the typewriter takes over (adds .tw-typing → empty, then fills). Reduced-motion
   / no-paras paths drop .is-fresh and show it normally. Self-healing: reveal after 6s if the typewriter
   never runs (script error / load failure) so text can never get stranded hidden. */
html.js .story.is-fresh:not(.tw-typing) { visibility: hidden; animation: twReveal 0s linear 6s forwards; }
@keyframes twReveal { to { visibility: visible; } }
.thinking { max-height: 0; opacity: 0; overflow: hidden; color: var(--accent); font-size: .92rem;
  font-family: var(--font-serif); font-style: italic; text-align: center; transition: max-height .3s var(--ease-ios), opacity .3s ease; }
.thinking.htmx-request { max-height: 3em; opacity: 1; margin: .4em 0 .6em; animation: tpulse 1.6s ease-in-out infinite; }
.thinking.htmx-request::after { content: "…"; animation: tdots 1.4s steps(4, end) infinite; }
@keyframes tdots { 0% { content: "" } 25% { content: "·" } 50% { content: "· ·" } 75% { content: "· · ·" } }
@keyframes tpulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.fourthwall { color: var(--accent); font-style: italic; font-size: .98rem; line-height: 1.5;
  border-left: 2px solid var(--accent); padding: .15em 0 .15em .7em; margin-bottom: .6em; }
.bonds-dd .tl-panel { top: auto; bottom: 2.5em; }
.bond { font-size: .9rem; color: var(--text); line-height: 1.4; padding: .55em .4em; border-bottom: .5px solid var(--line); }
.bond:last-child { border-bottom: none; }
.composer .prompt { font-weight: bold; margin-bottom: .65em; font-size: .98rem; }
.prompt.instream { font-weight: 400; font-style: italic; font-family: var(--font-serif); color: var(--muted);
  margin: .9em auto 0; max-width: 34em; font-size: 1.05rem; }  /* the prompt lives in the stream, in the serif voice */
/* choices as an iOS inset-grouped list: one rounded card, hairline-divided rows */
.options { display: flex; flex-direction: column; gap: 0; margin-bottom: .6em;
  background: var(--panel-elevated); border-radius: var(--r-lg); overflow: hidden; }
/* READING MODE — while the scene types, hide the ENTIRE closing beat so nothing below distracts:
   the whole composer (chips + choices + input) AND the in-card 4th-wall/prompt/share. It all
   reveals together the moment typing finishes (or you tap to skip). JS-gated → no-JS shows it all. */
html.js .composer--reading { opacity: 0; max-height: 0; overflow: hidden; pointer-events: none; padding: 0; }
.composer--ready { opacity: 1; }  /* container shows instantly; the staggered row-rise below OWNS the reveal (no double-fade) */
.turn .fourthwall, .turn .prompt.instream, .turn .chapter-share { transition: opacity .4s var(--ease-ios); }
html.js .turn .story.is-fresh ~ .fourthwall,
html.js .turn .story.is-fresh ~ .prompt.instream,
html.js .turn .story.is-fresh ~ .chapter-share { opacity: 0; visibility: hidden; }
.opt-form { margin: 0; }
.opt { width: 100%; text-align: left; background: transparent; border: 0; border-top: .5px solid var(--line);
  color: var(--label); border-radius: 0; padding: 14px 16px; min-height: 50px; font-size: var(--t-headline, 1.0625rem);
  line-height: 1.3; display: flex; align-items: center; cursor: pointer;
  transition: background .15s var(--ease-ios), transform .34s var(--spring-press); }
.opt-form:first-child .opt { border-top: 0; }
.opt::before { content: "\203A"; color: var(--accent); margin-right: .55em; opacity: .7; font-size: 1.1em;
  transition: opacity .15s var(--ease-ios); }
/* press: the row sinks instantly + lights with the accent selection material, then springs back on release */
.opt:active { background: linear-gradient(rgb(var(--accent-rgb) / .20), rgb(var(--accent-rgb) / .13));
  box-shadow: 0 0 0 .5px rgb(var(--accent-rgb) / .35) inset; transform: scale(.975); transition-duration: .06s; }
.opt:active::before { opacity: 1; }
/* legible risk — a quiet amber spark on the bold/tempting option, so you see the stakes you take */
.opt-risk { margin-left: auto; padding-left: .7em; color: #e0b25a; opacity: .9; font-size: .82em; flex: none; }
/* the riskier play carries a hairline amber edge + an amber press wash, so ⚠ never reads as a glitch */
.opt--high { box-shadow: inset 2px 0 0 rgb(224 178 90 / .5); }
.opt--high:active { background: linear-gradient(rgb(224 178 90 / .18), rgb(224 178 90 / .11));
  box-shadow: inset 2px 0 0 rgb(224 178 90 / .7); }
.send:active, .cta:active { transform: scale(.97); transition-duration: .06s; }
/* free-text "type your own" as a native rounded input pill */
.freetext { display: flex; gap: .5em; margin: 0; align-items: stretch; }
.freetext input { flex: 1; background: var(--panel-elevated); border: 0; color: var(--label);
  border-radius: 999px; padding: .75em 1.1em; font-size: max(16px, 1.0625rem); }
.freetext input::placeholder { color: var(--muted); }
.send { background: var(--accent); color: var(--on-accent); border: none; border-radius: 999px;
  padding: 0 1.3em; min-height: 48px; font-weight: 600; cursor: pointer; transition: transform .34s var(--spring-press), filter .15s ease; }
.send:hover { filter: brightness(1.05); }

.htmx-request .opt, .htmx-request .send, .htmx-request.opt-form .opt { opacity: .45; }
/* a turn is in flight: dim the ENTIRE action set so nothing reads as still-tappable (JS adds .busy) */
.composer.busy .opt, .composer.busy .send, .composer.busy .freetext input { opacity: .45; pointer-events: none; }
/* THE WORLD WRITES — the wait is authorship, not loading: the Act button becomes a slow charging
   vessel, and ghost bars of unwritten prose shimmer where the next scene will land (JS inserts .forming) */
@media (prefers-reduced-motion: no-preference) {
  .composer.busy .send { opacity: .8;
    background: linear-gradient(110deg, var(--accent) 25%, rgb(255 255 255 / .75) 50%, var(--accent) 75%);
    background-size: 220% 100%; animation: sendCharge 1.6s linear infinite; }
  @keyframes sendCharge { to { background-position: -220% 0; } }
}
.forming { margin: 1.4em auto 0; max-width: 34em; width: 100%; }
.forming i { display: block; height: .95em; border-radius: 6px; margin: 0 0 .6em;
  background: linear-gradient(100deg, rgb(var(--accent-rgb) / .05) 30%, rgb(var(--accent-rgb) / .13) 50%, rgb(var(--accent-rgb) / .05) 70%);
  background-size: 200% 100%; animation: formingShimmer 1.6s ease-in-out infinite; }
.forming i:nth-child(2) { width: 92%; animation-delay: .15s; }
.forming i:nth-child(3) { width: 61%; animation-delay: .3s; }
@keyframes formingShimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .forming { display: none; } }
/* wet ink: the paragraph being written glows faintly with the genre's ink, then cools to body text */
.story .para { transition: color 1.2s ease; }
.story .para.tw-active { color: color-mix(in oklab, rgb(var(--accent-rgb)) 16%, var(--text)); }

/* v3.2 — smooth on the phone */
* { -webkit-tap-highlight-color: transparent; }                 /* kill the grey iOS tap flash */
button, .opt, .cta, .send, .back, summary { -webkit-touch-callout: none; }
/* ── kill the remaining "web tells" so it reads as a native iOS app ───────────────── */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, [contenteditable], .story { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
input, textarea, select { font-size: max(16px, 1rem); }          /* never focus-zoom on iOS */
.opt, .cta, .send, .back, summary, button, a { touch-action: manipulation; }  /* no 300ms tap delay */
html, body { overscroll-behavior: none; }                        /* CSS belt; the real fix is native (scrollView.bounces=false) */
.stream, .tl-panel { overscroll-behavior: contain; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }  /* visible keyboard focus */
.legal { line-height: 1.65; }
.legal h3 { color: var(--accent); font-size: 1rem; margin: 1.4em 0 .3em; }
.legal code { font-family: var(--font-mono); font-size: .85em; color: var(--muted); }
.legal-links { text-align: center; font-size: .82rem; margin-top: 2em; }
.cta.ghost.danger { color: #d98a8a; border-color: #6e4040; }
.cta.ghost.danger:hover { box-shadow: 0 0 0 1px #d98a8a inset; }
/* account: gold back chevron, a copyable code token, a fenced danger zone (not a Restore twin) */
.acct-back { color: var(--accent); font-size: 1.7rem; line-height: 1; display: inline-flex;
  align-items: center; min-width: 44px; min-height: 44px; margin-bottom: .1em; }
.code-row { display: flex; gap: .5em; align-items: stretch; }
.codeval { flex: 1; background: var(--panel-elevated); border: 1px solid var(--line); color: var(--text);
  border-radius: var(--r); padding: .7em .8em; font-family: var(--font-mono); font-size: .9rem; }
.copy-btn { flex: none; background: rgb(var(--accent-rgb) / .14); color: var(--accent);
  border: 1px solid rgb(var(--accent-rgb) / .4); border-radius: var(--r); padding: 0 1em; min-height: 44px;
  font-size: .85rem; cursor: pointer; }
.danger-zone { margin-top: 2.2em; border-top: .5px solid var(--line); padding-top: 1.2em; }
.danger-h { color: #e06666; font-size: 1rem; margin: 0 0 .4em; }
.cta.danger { background: transparent; color: #e06666; border: 1px solid #e06666; box-shadow: none; }
.cta.danger:active { background: rgb(224 102 102 / .14); }
.netbanner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; text-align: center;
  background: #2a1d12; color: #d8a657; font-size: .82rem; font-family: var(--font-mono);
  padding: .5em calc(1em + env(safe-area-inset-right)) calc(.5em + env(safe-area-inset-bottom)) calc(1em + env(safe-area-inset-left)); border-top: 1px solid #4a392a; }
.turn-error { background: rgba(217,138,138,.1); border: 1px solid #6e4040; color: #d98a8a;
  border-radius: 8px; padding: .6em .8em; margin: .4em 0; font-size: .9rem; display: flex;
  align-items: center; justify-content: space-between; gap: .6em; }
.turn-error button { background: transparent; border: 1px solid #6e4040; color: #d98a8a;
  border-radius: 6px; padding: .35em .8em; cursor: pointer; min-height: 40px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; }
  body { animation: none; }
  .coldopen, .co-kicker, .co-title, .co-skip { opacity: 1 !important; animation: none !important; transform: none !important; }
  .twist-flash { animation: none !important; }
  .tw-active::after { animation: none; }       /* steady caret, no blink */
}

/* v3.3 — first five minutes: setup as cards, continue-hero, free-text teach */
.genre-section { margin-bottom: .9em; }
.gsec-label { font-family: var(--font-mono); font-size: .7rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: .1em; margin: .1em 0 .5em; }
.genre-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5em; }
.gcard { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: .8em .9em; cursor: pointer; min-height: 48px; display: flex; align-items: center;
  transition: border-color .15s ease, background .15s ease, transform .34s var(--spring-press); }
.gcard input { position: absolute; opacity: 0; pointer-events: none; }
.gcard .g-name { font-size: .98rem; color: var(--text); }
.gcard:active { transform: scale(.97); transition-duration: .06s; }
/* baseline (works on every WebView incl. iOS<15.4): the chosen/focused card's name goes accent */
.gcard input:checked + .g-name { color: var(--accent); font-weight: bold; }
.gcard input:focus-visible + .g-name { text-decoration: underline; text-underline-offset: 3px; }
/* grounded genres are the differentiator — one column, taller cards that SELL the premise */
.grounded-grid { grid-template-columns: 1fr; }
.gcard--grounded { flex-direction: column; align-items: flex-start; gap: .25em; padding: .85em 1em; }
.gcard--grounded .g-name { font-size: 1.05rem; font-weight: 600; }
/* density: the serif tease shows ONLY on the SELECTED grounded card (others collapse to a name row),
   so the picker reads as a tight vibe-list, not seven stacked paragraphs */
.g-tease { font-family: var(--font-serif); font-style: italic; font-size: .9rem; color: var(--text);
  line-height: 1.4; display: none; }
.gcard--grounded input:checked ~ .g-tease { display: block; }
/* progressive enhancement where :has() is available — full card highlight + focus ring */
@supports selector(:has(*)) {
  .gcard:has(input:checked) { border-color: var(--accent); background: rgb(var(--accent-rgb) / .1);
    box-shadow: 0 0 0 1px var(--accent) inset; }
  .gcard:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
}
details.more { margin: .2em 0 1em; border: 1px solid var(--line); border-radius: 10px; }
details.more > summary { list-style: none; cursor: pointer; padding: .8em 1em; color: var(--accent); font-size: .9rem; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: " ⌄"; color: var(--muted); }
details.more[open] > summary::after { content: " ⌃"; }
.more-body { padding: 0 1em 1em; display: flex; flex-direction: column; gap: 1.1em; }

.hero-card { display: flex; flex-direction: column; gap: .2em; text-align: left; background: var(--panel); position: relative;
  border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 12px; padding: 1.1em 1.2em;
  box-shadow: 0 8px 26px rgb(0 0 0 / .3); transition: transform .15s ease, border-color .15s ease; }
.hero-card:hover { transform: translateY(-1px); border-color: var(--accent); }
.hero-eyebrow { font-family: var(--font-mono); font-size: .7rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em; padding-right: 44px;  /* clear the corner crest */
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; display: block; }
.hero-title { font-size: 1.3rem; color: var(--text); }
.hero-hook { color: var(--accent); font-size: .85rem; font-style: italic; margin-top: .15em; }
.hero-go { align-self: flex-start; background: var(--accent); color: var(--on-accent); font-weight: 600;
  padding: .32em .85em; border-radius: 999px; margin-top: .65em; }
/* returning home: the 4 secondary actions stay quiet (hairline) so the Continue hero owns the eye */
.home-actions .cta.ghost { border-color: var(--line); color: var(--muted); box-shadow: none; }
.home-actions .cta.ghost:hover, .home-actions .cta.ghost:active { border-color: var(--accent); color: var(--accent); }
.cta.ghost.newworld { margin-top: .7em; }

.freetext input.teach { border-color: var(--accent); animation: teachpulse 1.8s ease-in-out infinite; }
@keyframes teachpulse { 0%, 100% { box-shadow: 0 0 0 0 rgb(var(--accent-rgb) / 0); }
  50% { box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .18); } }

/* metrics */
.metrics h3 { margin: 1.6em 0 .4em; color: var(--accent); font-size: 1rem; }
.spark { width: 100%; height: 44px; display: block; }
.spark rect { fill: rgb(var(--accent-rgb) / .7); }
.mgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6em; margin-top: 1em; }
.mcard { background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 1em; display: flex; flex-direction: column; align-items: center; }
.mnum { font-size: 1.8rem; color: var(--text); }
.mlbl { font-size: .75rem; color: var(--muted); font-family: var(--font-mono); }
.mlist { list-style: none; padding: 0; margin: .3em 0; }
.mlist li { padding: .35em 0; border-bottom: 1px solid var(--line); font-size: .95rem; }

/* ============================================================================
   Type roles (kyryllov.com system): sans = UI (body default) · serif = prose &
   display (Lora, full Cyrillic) · mono = labels. English display gets the
   high-contrast Instrument Serif, exactly like the site.
   ========================================================================== */
.brand, .tagline, .world-title, .hero-title, .co-title, .launch-title,
.story, .returnbanner.away { font-family: var(--font-serif); }
.brand { font-weight: 600; letter-spacing: -.012em; }
.tagline { font-style: italic; font-size: 1.05rem; }
.world-title, .hero-title { letter-spacing: -.006em; }
.co-title, .launch-title { font-weight: 500; }
/* prose: a touch larger + airier for Lora's smaller x-height — the reading surface */
.story { font-size: calc(1.16rem * var(--read-scale)); line-height: 1.74; letter-spacing: .003em; }
@media (min-width: 600px) { .story { font-size: calc(1.2rem * var(--read-scale)); line-height: 1.78; } }
html[lang="en"] .brand, html[lang="en"] .co-title, html[lang="en"] .chapter-name,
html[lang="en"] .hero-title, html[lang="en"] .launch-title {
  font-family: 'Instrument Serif', Georgia, serif; font-weight: 400; letter-spacing: 0; }

/* ── genre typographic identity: the SAME fonts wearing six display dialects, so each world's
   voice is legible before a word is read. All static paint (text-shadow/bg) — zero motion, zero JS. */
/* neon (cyberpunk / space opera): tight white core + accent bloom + wide halo */
.play[data-genre="cyberpunk"] .chapter-name, .play[data-genre="cyberpunk"] .co-title,
.play[data-genre="space_opera"] .chapter-name, .play[data-genre="space_opera"] .co-title {
  text-shadow: 0 0 2px rgb(255 255 255 / .35), 0 0 12px rgb(var(--accent-rgb) / .55), 0 0 34px rgb(var(--accent-rgb) / .25); }
/* letterpress (historical / fantasy / dungeon / heist): ink pressed into paper */
.play[data-genre="historical"] .chapter-name, .play[data-genre="historical"] .co-title,
.play[data-genre="fantasy"] .chapter-name, .play[data-genre="fantasy"] .co-title,
.play[data-genre="dungeon"] .chapter-name, .play[data-genre="dungeon"] .co-title,
.play[data-genre="heist"] .chapter-name, .play[data-genre="heist"] .co-title {
  text-shadow: 0 1px 0 rgb(255 255 255 / .07), 0 -1px 1px rgb(0 0 0 / .7); }
/* smear (cosmic horror / zombie / post-apocalypse): the title bleeds downward */
.play[data-genre="cosmic_horror"] .chapter-name, .play[data-genre="cosmic_horror"] .co-title,
.play[data-genre="zombie"] .chapter-name, .play[data-genre="zombie"] .co-title,
.play[data-genre="post_apocalypse"] .chapter-name, .play[data-genre="post_apocalypse"] .co-title {
  text-shadow: 0 2px 6px rgb(var(--accent-rgb) / .35), 0 7px 16px rgb(var(--accent-rgb) / .16); }
/* hard ink (noir / mystery): a dry stamp with a hard shadow */
.play[data-genre="noir"] .chapter-name, .play[data-genre="noir"] .co-title,
.play[data-genre="mystery"] .chapter-name, .play[data-genre="mystery"] .co-title {
  letter-spacing: .02em; text-shadow: 1px 1px 0 rgb(0 0 0 / .85); }
/* system voice (litrpg): the chapter arrives as a game event */
.play[data-genre="litrpg"] .chapter-name::before { content: "[ "; color: rgb(var(--accent-rgb) / .55); font-family: var(--font-mono); font-size: .7em; vertical-align: .12em; }
.play[data-genre="litrpg"] .chapter-name::after { content: " ]"; color: rgb(var(--accent-rgb) / .55); font-family: var(--font-mono); font-size: .7em; vertical-align: .12em; }
/* comic print offset (superhero) */
.play[data-genre="superhero"] .chapter-name, .play[data-genre="superhero"] .co-title {
  text-shadow: 2px 2px 0 rgb(var(--accent-rgb) / .35); }
/* grounded genres (travel/startup/city_life/second_chance/romance/survival): clean restraint — no rule */

/* ghost folio: an oversized chapter numeral haunting the heading at 7% accent */
.chapter { position: relative; overflow: visible; }
.chapter::before { content: attr(data-n); position: absolute; left: 50%; top: -.28em;
  transform: translateX(-50%); font-family: var(--font-serif); font-size: 6.5rem; line-height: 1;
  color: rgb(var(--accent-rgb) / .07); z-index: -1; pointer-events: none; }

/* illuminated drop-caps per family (extends the base .dropcap rule) */
.play[data-genre="historical"] .story.dropcap .para:first-of-type::first-letter,
.play[data-genre="fantasy"] .story.dropcap .para:first-of-type::first-letter,
.play[data-genre="dungeon"] .story.dropcap .para:first-of-type::first-letter,
.play[data-genre="heist"] .story.dropcap .para:first-of-type::first-letter {
  background: radial-gradient(circle at 30% 30%, rgb(var(--accent-rgb) / .26), rgb(var(--accent-rgb) / .1));
  box-shadow: inset 0 0 0 1px rgb(var(--accent-rgb) / .4); border-radius: 4px;
  padding: .04em .12em 0; margin-right: .1em; }
.play[data-genre="noir"] .story.dropcap .para:first-of-type::first-letter,
.play[data-genre="mystery"] .story.dropcap .para:first-of-type::first-letter {
  background: var(--accent); color: var(--bg); border-radius: 3px; padding: .02em .1em 0; margin-right: .1em; }
.play[data-genre="cyberpunk"] .story.dropcap .para:first-of-type::first-letter,
.play[data-genre="space_opera"] .story.dropcap .para:first-of-type::first-letter {
  text-shadow: 0 0 14px rgb(var(--accent-rgb) / .6); }

/* v4.1 — viral: share page (card-first + fork CTA) + one-tap share */
.sharedmain { text-align: center; padding-top: 1.2em; }
.share-card { width: 100%; max-width: 440px; display: block; margin: 0 auto; border-radius: 14px;
  border: 1px solid var(--line); box-shadow: 0 14px 44px rgb(0 0 0 / .5); }
.share-hook { max-width: 440px; margin: 1.3em auto 0; }
.hookline { font-family: var(--font-serif); font-size: 1.25rem; color: var(--text); margin: 0 0 .9em; line-height: 1.4; }
.share-hook .cta { width: 100%; max-width: 340px; }
.share-hook .small { font-size: .8rem; margin-top: .8em; }
.readstory { max-width: 680px; margin: 1.8em auto 0; border-top: 1px solid var(--line); text-align: left; }
.readstory > summary { list-style: none; cursor: pointer; color: var(--muted); text-align: center; padding: 1em; font-size: .9rem; }
.readstory > summary::-webkit-details-marker { display: none; }
.readstory .stream.nested { padding-top: .4em; }
.share-btn { font-size: 1.05rem; }
.invite-line { font-size: .82rem; color: var(--accent); text-align: center; margin: .7em 0 0; }
.invite-line a { text-decoration: underline; }
/* quiet text link, not a bordered web button mid-flow (the nav-bar ⇪ is the primary share) */
.chapter-share { text-align: center; margin: 1.1em 0 .2em; }
.chapter-share .cta { background: transparent; border: 0; box-shadow: none; color: var(--muted);
  font-size: .82rem; font-weight: 500; padding: .4em .6em; }
.chapter-share .cta:active { color: var(--accent); transform: none; }

/* ── v4.2 front door: landing + genre SEO pages ───────────────────── */
.lp { max-width: 720px; margin: 0 auto; padding: 1.4em 1.1em 3em; }
.lp section { margin: 2.6em 0; }
.lp-hero { text-align: center; margin-top: 1em; }
.lp-headline { font-family: var(--font-serif); font-size: 1.8rem; line-height: 1.25;
  color: var(--text); max-width: 16em; margin: .35em auto .5em; }
html[lang="en"] .lp-headline { font-family: 'Instrument Serif', var(--font-serif); }
.lp-sub { color: var(--muted); max-width: 26em; margin: 0 auto 1.3em; font-size: 1.02rem; }
.lp-cta { font-size: 1.05rem; }
/* live demo */
.lp-demo { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 14px; padding: 1.2em 1.2em 1.3em; }
.lp-demo-title { font-family: var(--font-mono); font-size: .76rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent); margin-bottom: .8em; }
.demo-stream { font-family: var(--font-serif); font-size: 1.05rem; line-height: 1.6; color: var(--text);
  min-height: 4.5em; margin-bottom: .9em; }
.demo-stream .demo-q { font-family: var(--font-sans); font-size: .92rem; color: var(--muted);
  margin: .8em 0 0; font-style: italic; }
.demo-opts { background: var(--panel-elevated); border-radius: var(--r-lg); overflow: hidden; margin-bottom: .7em; }
.demo-opts .opt:first-child { border-top: 0; }  /* demo buttons aren't wrapped in .opt-form, so reset the leading hairline here */
.demo-opts:empty { display: none; }
.lp-demo .freetext { margin-bottom: .9em; }
.lp-demo-cta { display: block; text-align: center; }
/* pillars */
.lp-pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1em; }
.lp-pillar h2 { font-size: 1.02rem; color: var(--text); margin: 0 0 .3em; line-height: 1.25; }
.lp-pillar p { color: var(--muted); font-size: .9rem; margin: 0; line-height: 1.5; }
/* genres */
.lp-genres h2, .lp-close h2, .lp-how h2 { font-family: var(--font-serif); font-size: 1.4rem;
  color: var(--text); text-align: center; margin: 0 0 .9em; }
.lp-genres .gcard { display: flex; align-items: center; justify-content: center; min-height: 64px;
  text-align: center; padding: .8em; transition: border-color .15s, transform .15s, background .15s; }
.lp-genres .gcard:hover { border-color: var(--accent); background: rgb(255 255 255 / .02); transform: translateY(-1px); }
.lp-genres .gcard:hover .g-name { color: var(--accent); }
/* close + waitlist */
.lp-close { text-align: center; }
.lp-ios { margin: 1.4em auto .6em; max-width: 24em; font-size: .88rem; }
.lp-wl { max-width: 22em; margin: 0 auto; }
.lp-close .small { margin-top: 1.4em; font-size: .78rem; }
.lp-close .small a { color: var(--muted); text-decoration: underline; }
/* genre SEO page */
.world-lp { padding-top: .8em; }
.world-back { display: inline-block; font-size: .82rem; margin-bottom: .6em; }
.world-h1 { font-family: var(--font-serif); font-size: 1.9rem; line-height: 1.2;
  color: var(--text); max-width: 13em; margin: .2em auto .4em; }
html[lang="en"] .world-h1 { font-family: 'Instrument Serif', var(--font-serif); }
.lp-how { text-align: center; }
.how-steps { display: inline-block; text-align: left; counter-reset: step; list-style: none;
  padding: 0; margin: 0; max-width: 24em; }
.how-steps li { position: relative; padding: .5em 0 .5em 2.2em; color: var(--text); font-size: .98rem;
  border-bottom: 1px solid var(--line); }
.how-steps li:last-child { border-bottom: none; }
.how-steps li::before { counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: .5em; width: 1.5em; height: 1.5em; border-radius: 50%;
  background: rgb(var(--accent-rgb) / .14); color: var(--accent); font-family: var(--font-mono);
  font-size: .82rem; display: flex; align-items: center; justify-content: center; }
@media (max-width: 560px) {
  .lp-pillars { grid-template-columns: 1fr; gap: 1.3em; }
  .lp-headline { font-size: 1.55rem; }
}
/* social-proof wall (owner-curated shared stories) */
.lp-proof h2 { font-family: var(--font-serif); font-size: 1.4rem; color: var(--text); text-align: center; margin: 0 0 .9em; }
.proof-wall { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6em; }
.proof-card { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line);
  display: block; aspect-ratio: 1 / 1; background: var(--panel); transition: transform .15s, border-color .15s; }
.proof-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.proof-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.proof-turns { position: absolute; bottom: .4em; left: .4em; font-family: var(--font-mono); font-size: .62rem;
  color: var(--text); background: rgb(11 12 16 / .72); border-radius: 5px; padding: .14em .4em; }
@media (max-width: 560px) { .proof-wall { grid-template-columns: repeat(2, 1fr); } }
/* ── v4.3 soft wall: plan picker ──────────────────────────────────── */
.plans { display: grid; gap: .5em; margin: .2em 0 .6em; }
.plan { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: .6em;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: .7em .85em;
  transition: border-color .15s, transform .12s; }
.plan:hover { border-color: var(--accent); transform: translateY(-1px); }
.plan-feat { border-color: var(--accent); box-shadow: 0 0 0 1px rgb(var(--accent-rgb) / .25) inset; }
.plan-name { color: var(--text); font-weight: 600; flex: 1; min-width: 0; }
.plan-badge { font-family: var(--font-mono); font-size: .62rem; font-style: normal; color: var(--accent);
  background: rgb(var(--accent-rgb) / .12); border-radius: 5px; padding: .12em .4em; margin-left: .35em; }
.plan-price { color: var(--accent); font-weight: 700; white-space: nowrap; flex-shrink: 0; }
.plan-unit { color: var(--muted); font-weight: 400; font-size: .72rem; margin-left: .1em; }
.plan-trial { display: block; flex-basis: 100%; color: var(--muted); font-size: .72rem; margin-top: .15em; }
.pw-topup { font-size: .82rem; margin: .2em 0 .5em; }
.pw-topup a { text-decoration: underline; }
/* ── v4.5 activation: seed-first setup + co-author reward ─────────── */
.seed-hero { margin: 0 0 1.4em; }
.seed-label { display: block; font-family: var(--font-serif); font-size: 1.25rem; color: var(--text);
  line-height: 1.3; margin-bottom: .5em; }
html[lang="en"] .seed-label { font-family: 'Instrument Serif', var(--font-serif); }
.seed-input { width: 100%; background: var(--bg); border: 1px solid var(--accent); border-radius: 10px;
  color: var(--text); padding: .7em .8em; font-family: var(--font-serif); font-size: 1rem; line-height: 1.5;
  resize: vertical; box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .1); }
.seed-input::placeholder { color: var(--muted); }
.seed-hint { font-size: .82rem; margin: .45em 0 0; }
.coauthor-nudge { font-family: var(--font-mono); font-size: .76rem; color: var(--accent);
  background: rgb(var(--accent-rgb) / .1); border-left: 2px solid var(--accent); border-radius: 6px;
  padding: .4em .6em; margin: 0 0 .6em; animation: coauthorIn .5s ease; }
@keyframes coauthorIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
/* the memory payoff made visible — the world wove back something you confided */
.echo-nudge { font-family: var(--font-mono); font-size: .76rem; color: #e9c46a;
  background: rgb(233 196 106 / .12); border-left: 2px solid #e9c46a; border-radius: 6px;
  padding: .4em .6em; margin: 0 0 .6em; animation: coauthorIn .5s ease; }
/* when the world weaves your words back, the whole turn briefly glows gold — the memory payoff, felt */
@supports selector(:has(*)) {
  .turn:has(.echo-nudge) { animation: echoGlow 2.4s var(--ease-ios) 1; border-radius: 12px; }
}
@keyframes echoGlow { 0%, 100% { box-shadow: 0 0 0 0 rgb(233 196 106 / 0); }
  25% { box-shadow: 0 0 26px 2px rgb(233 196 106 / .28); } }
.co-sound { display: flex; align-items: center; justify-content: center; gap: .5em;
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted); opacity: 0; margin-top: 1.4em; animation: coUp .8s ease 1s forwards; }
.co-sound-ic { width: 15px; height: 15px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .turn:has(.echo-nudge) { animation: none; } }

/* people panel — readable rows, not a wall of raw model text (speech-signature dropped) */
.bond-name { font-weight: 600; color: var(--label); }
.bond-who { color: var(--muted); font-size: .82rem; }
.bond-feel { color: var(--accent); font-size: .82rem; font-style: italic; margin-top: .15em; }

/* "What the world knows about you" — the wedge, made legible */
.memory-dd > summary.chip { color: #e9c46a; }
.truth { padding: .6em .4em; }
.truth-q { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .04em; color: var(--muted-2);
  text-transform: uppercase; margin-bottom: .2em; }
.truth-a { color: var(--text); font-style: italic; line-height: 1.4; }
.truth-mark { font-family: var(--font-mono); font-size: .72rem; color: #e9c46a; margin-top: .3em; }
.truth--echoed { border-left: 2px solid rgb(233 196 106 / .5); padding-left: .5em; }

/* answer affordance under a narrator question — focuses the composer, never prefills it */
.fw-answer { display: block; width: fit-content; margin: .5em 0 0; background: rgb(var(--accent-rgb) / .14);
  color: var(--accent); border: 1px solid rgb(var(--accent-rgb) / .4); border-radius: 999px;
  font-family: var(--font-sans); font-size: .8rem; padding: .25em .9em; min-height: 32px; cursor: pointer;
  font-style: normal; transition: background .15s var(--ease-ios); }
.fw-answer:hover { background: rgb(var(--accent-rgb) / .24); }

/* in-game settings popover (speed + sound), reachable without leaving the world */
.settings-dd .tl-panel { padding-bottom: .8em; }
.settings-dd .tl-panel .segmented { display: flex; width: 100%; margin: .2em 0 .6em; }
.settings-dd .tl-panel .segmented button { flex: 1; padding: .5em .4em; }
.set-row { display: flex; align-items: center; justify-content: space-between; padding: .5em;
  border-top: .5px solid var(--line); margin-top: .3em; color: var(--text); font-size: .92rem; }
.set-toggle { position: relative; min-width: 46px; }
.set-toggle::after { content: ""; position: absolute; inset: -8px 0; }  /* 44px+ touch target, no pill inflation */
/* inline monoline topbar icons (timeline/share) — crisp, themed, one weight */
.ic { width: 22px; height: 22px; display: block; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
/* iOS-style switch (sound) — visible on/off state, not a bare glyph */
.switch { position: relative; width: 46px; height: 28px; border-radius: 999px; background: var(--panel);
  border: 1px solid var(--line); padding: 0; cursor: pointer; flex: none;
  transition: background .2s var(--ease-ios), border-color .2s var(--ease-ios); }
.switch.on { background: var(--accent); border-color: var(--accent); }
.switch-knob { position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4); transition: transform .2s var(--ease-ios); }
.switch.on .switch-knob { transform: translateX(18px); }
.switch:active { transform: scale(.96); }  /* sinks under the thumb like every other control */

/* the dramatic through-line — one dim, quiet HUD line above the action surface so the endless
   middle has a spine ("what am I really chasing"); appears with the choices, never shouts */
.open-q { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .02em; color: var(--muted);
  line-height: 1.4; padding: 0 .2em .5em; margin-bottom: .2em; border-bottom: .5px solid var(--line);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.open-q .oq-mark { color: var(--accent); }

/* one-time topbar coachmark — decodes ↺ / ⇪ / ⚙ once, then never again */
.topbar-coach { position: sticky; top: 0; z-index: 19; text-align: right;
  font-family: var(--font-mono); font-size: .68rem; color: var(--muted); letter-spacing: .02em;
  background: rgb(20 20 22 / .9); -webkit-backdrop-filter: var(--mat-blur); backdrop-filter: var(--mat-blur);
  padding: 0 var(--pad); max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height .35s var(--ease-ios), opacity .35s var(--ease-ios), padding .35s var(--ease-ios); }
.topbar-coach.show { max-height: 3em; opacity: 1; box-shadow: 0 .5px 0 var(--line);
  padding: .55em calc(var(--pad) + env(safe-area-inset-right)) .55em calc(var(--pad) + env(safe-area-inset-left)); }
.tl-legend { font-size: .72rem; color: var(--muted); line-height: 1.4; padding: .7em .4em .2em;
  border-top: .5px solid var(--line); margin-top: .3em; }

/* iOS segmented control (settings) */
.segmented { display: inline-flex; background: var(--panel); border-radius: 9px; padding: 2px; gap: 2px;
  margin: .2em 0 .4em; max-width: 100%; }
.segmented button { border: 0; background: transparent; color: var(--text); font-family: var(--font-sans);
  font-size: .95rem; padding: .5em 1.05em; border-radius: 7px; min-height: 40px; cursor: pointer;
  transition: background .15s var(--ease-ios); }
.segmented button.on { background: #48484a; color: var(--label); font-weight: 600;
  box-shadow: 0 1px 3px rgb(0 0 0 / .5), 0 0 0 .5px rgb(255 255 255 / .06) inset; }
.segmented button:active { opacity: .7; }

/* graceful scene entrance — the new turn (and its chapter heading) lift in, then the prose types */
.turn-enter { animation: turnIn .55s var(--ease-ios) both; }
@keyframes turnIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .turn-enter { animation: none; } }

/* 4th-wall question: a labelled reflective aside from the narrator (so it's not a mystery line) */
.fw-eyebrow { display: block; font-family: var(--font-mono); font-size: .62rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); font-style: normal; margin-bottom: .35em; }
/* count-chips that open a panel get a tiny caret so they read as tappable */
.bonds-dd > summary.chip::after { content: " ⌄"; opacity: .6; }
.bonds-dd[open] > summary.chip::after { content: " ⌃"; }

/* the verdict tag reveals with a restrained settle (no rotation/bounce — keeps the literary calm) */
.verdict-pop { animation: verdictStamp .42s var(--ease-ios) both; transform-origin: left center; }
@keyframes verdictStamp { 0% { opacity: 0; transform: scale(1.18) translateY(2px); }
  55% { opacity: 1; transform: scale(.97); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .verdict-pop { animation: none; } }

/* Story Wrapped — a shareable, narrator-voiced retrospective across all the player's worlds */
.wrapped { max-width: 540px; }
.wr-empty { text-align: center; padding: 3em 0; }
.wr-empty .cta { margin-top: 1.5em; }
.wr-eyebrow { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent); margin: 1.2em 0 .3em; }
.wr-h { font-size: 2.2rem; margin: 0 0 .8em; letter-spacing: .01em; }
.wr-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 1.1em 1.2em; margin-bottom: .8em; }
.wr-narr { font-family: var(--font-serif); font-size: 1.22rem; line-height: 1.55; font-style: italic;
  color: var(--label); background: rgb(var(--accent-rgb) / .08); border-color: rgb(var(--accent-rgb) / .35);
  text-shadow: 0 0 30px rgb(var(--accent-rgb) / .12); }
.wr-stats { display: flex; gap: .8em; margin-bottom: .8em; }
.wr-stat { flex: 1; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: .7em .6em; text-align: center; display: flex; flex-direction: column; gap: .35em; }
.wr-num { font-size: 1.9rem; font-weight: 700; color: var(--label); line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: .15em; }
.wr-flame { width: .8em; height: .8em; color: var(--accent); }
.wr-lbl { font-size: .66rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.wr-cap { font-family: var(--font-mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: .4em; }
.wr-chips { display: flex; flex-wrap: wrap; gap: .4em; }
.wr-chip { font-size: .85rem; color: var(--text); background: var(--panel-elevated); border-radius: 999px;
  padding: .3em .8em; }
.wr-truth-q { font-family: var(--font-mono); font-size: .72rem; color: var(--muted); margin-bottom: .3em; }
.wr-truth-a { font-family: var(--font-serif); font-style: italic; font-size: 1.1rem; color: var(--label);
  line-height: 1.5; margin-bottom: .5em; }
.wr-person { font-size: 1.15rem; color: var(--label); font-weight: 600; }
.wr-share { margin-top: .8em; width: 100%; }
.wrapped .cta.ghost { display: block; text-align: center; margin-top: .6em; }

/* async two-author co-op — whose-turn is the headline state, so it's a real pill, not a thin strip */
.coop-badge { position: sticky; top: 0; z-index: 18; width: max-content; max-width: 92%;
  margin: .5em auto; font-family: var(--font-mono); font-size: .74rem; letter-spacing: .08em;
  text-transform: uppercase; padding: .42em 1.1em; border-radius: 999px; }
.coop-badge.you { background: var(--accent); color: var(--on-accent); font-weight: 600;
  box-shadow: 0 4px 16px rgb(var(--accent-rgb) / .3); }
.coop-badge.wait { color: var(--muted); border: 1px solid var(--line);
  background: rgb(20 20 22 / .85); -webkit-backdrop-filter: var(--mat-blur); backdrop-filter: var(--mat-blur); }
.coop-wait { text-align: center; color: var(--muted); font-style: italic; line-height: 1.5;
  padding: 1.3em 1em; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  margin-bottom: .6em; animation: coauthorIn .5s ease, coopBreathe 2.4s ease-in-out .6s infinite; }
@keyframes coopBreathe { 0%, 100% { opacity: .62; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .coop-wait { animation: coauthorIn .5s ease; } }
.coop-row { gap: .6em; }
.coop-invite-btn { background: rgb(var(--accent-rgb) / .14); color: var(--accent);
  border: 1px solid rgb(var(--accent-rgb) / .4); border-radius: 999px; font-family: var(--font-sans);
  font-size: .82rem; padding: .35em .9em; min-height: 36px; cursor: pointer; white-space: nowrap; }
.coop-invite-btn:disabled { opacity: .5; }
.coop-link { margin-top: .5em; }
.coop-link input { width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: .55em .7em; font-size: .82rem; font-family: var(--font-mono); }
.coop-copied { display: block; color: var(--accent); font-size: .72rem; margin-top: .3em; text-align: center; }

/* co-op invite interstitial — a designed, centered first impression (not a top-anchored void) */
.coop-invite { min-height: 100dvh; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; position: relative;
  background: radial-gradient(90% 55% at 50% 42%, rgb(var(--accent-rgb) / .12), transparent 70%), var(--bg); }
.ci-inner { max-width: 22em; }
.ci-eyebrow { display: block; font-family: var(--font-mono); font-size: .72rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--accent); margin-bottom: .6em; }
.ci-title { font-family: var(--font-serif); font-size: 1.7rem; color: var(--label); line-height: 1.22; margin: 0 0 .5em; }
.ci-body { color: var(--muted); line-height: 1.5; margin: 0 0 1.6em; }
.ci-back { position: absolute; top: calc(.5em + env(safe-area-inset-top)); left: calc(.5em + env(safe-area-inset-left));
  color: var(--accent); font-size: 1.7rem; line-height: 1; min-width: 44px; min-height: 44px; display: flex;
  align-items: center; justify-content: center; }

/* Wrapped closing beat — the recap resolves instead of stopping dead on flat black */
.wr-signoff { text-align: center; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted-2); margin: 2.4em 0 0;
  padding-bottom: calc(2em + env(safe-area-inset-bottom)); }

/* home: a faint open-book mark resolves the bottom space instead of leaving it barren */
.home-foot { margin-top: 3.4em; display: flex; justify-content: center; }
.foot-mark { width: 30px; height: 30px; color: rgb(var(--accent-rgb) / .2); }

/* ════════════════════════════════════════════════════════════════════════
   v3 UX-audit pass — native fidelity, legibility, game-feel
   ════════════════════════════════════════════════════════════════════════ */
/* monoline inline icons replacing the HUD/menu color-emoji (clock/bag/person/flame) */
.ic-inline { width: 1.05em; height: 1.05em; vertical-align: -.16em; display: inline-block; stroke-width: 1.8; flex: none; }
.chip { display: inline-flex; align-items: center; gap: .3em; }          /* icon + count on one baseline */
.hdr-streak, .streak { display: inline-flex; align-items: center; gap: .25em; }

/* grounded genre cards: a terse always-visible blurb so unselected worlds aren't blind picks */
.g-blurb { font-size: .8rem; color: var(--muted); margin-top: .12em; }
.gcard--grounded input:checked ~ .g-blurb { display: none; }            /* the full tease takes over once selected */

/* zero-state memory chip: names the "it remembers you" wedge before any real chip exists */
.memory-ghost { opacity: .6; color: #e9c46a; border-color: rgb(233 196 106 / .3); }

/* settings popover: a quiet "show topbar guide" re-summon row */
.set-guide { display: block; width: 100%; text-align: left; background: transparent; border: 0;
  border-top: .5px solid var(--line); margin-top: .3em; padding: .6em .5em; color: var(--accent);
  font-family: var(--font-sans); font-size: .85rem; cursor: pointer; min-height: 44px; }
.set-guide:active { opacity: .6; }
.set-book { text-decoration: none; box-sizing: border-box; }
.set-book::before { content: "⬓ "; opacity: .7; }

/* account: cross-reference caption under the reading-speed control */
.speed-also { font-size: .78rem; margin: .5em 0 0; }

/* choices RISE to meet you once the scene is read (the comment in typewriter.js promised this) */
@media (prefers-reduced-motion: no-preference) {
  .composer--ready .status { animation: optRise .34s var(--ease-ios) both; }
  .composer--ready .open-q { animation: optRise .34s var(--ease-ios) both; animation-delay: .03s; }
  .composer--ready .opt { animation: optRise .34s var(--ease-ios) both; }
  .composer--ready .options .opt-form:nth-child(2) .opt { animation-delay: .05s; }
  .composer--ready .options .opt-form:nth-child(3) .opt { animation-delay: .10s; }
  .composer--ready .options .opt-form:nth-child(n+4) .opt { animation-delay: .14s; }
  .composer--ready .freetext { animation: optRise .34s var(--ease-ios) both; animation-delay: .18s; }
}
@keyframes optRise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* the LIVE turn leads: past turns recede so the stream reads as a stage, not a flat transcript.
   Keyed on :last-of-type (DOM position), NEVER is-fresh (stripped post-reveal). Opacity only — prose stays crisp. */
@supports selector(:has(*)) {
  html.js #turns .turn:not(:last-of-type) { opacity: .62; transition: opacity .4s var(--ease-ios); }
  html.js #turns .turn:not(:last-of-type) .you,
  html.js #turns .turn:not(:last-of-type) .verdict { opacity: .82; }
}
@media (prefers-reduced-motion: reduce) { html.js #turns .turn:not(:last-of-type) { transition: none; } }

/* one-time memory coachmark: a glass toast naming the 🎒/👤/✦ mechanic the first time a chip appears */
.mem-coach-toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 8px);
  z-index: 41; max-width: 84%; text-align: center; background: var(--menu-fill);
  -webkit-backdrop-filter: var(--mat-thick); backdrop-filter: var(--mat-thick);
  color: var(--text); font-size: .82rem; line-height: 1.45; padding: .7em 1.1em; border-radius: 14px;
  box-shadow: 0 8px 30px rgb(0 0 0 / .5), 0 0 0 .5px var(--line) inset; opacity: 0;
  transition: opacity .3s var(--ease-ios), transform .3s var(--ease-ios); }
.mem-coach-toast.show { opacity: 1; transform: translate(-50%, 0); }
.mem-pulse { animation: memPulse 1.4s var(--ease-ios) 2; border-radius: 10px; }
@keyframes memPulse { 0%, 100% { box-shadow: 0 0 0 0 rgb(233 196 106 / 0); } 50% { box-shadow: 0 0 0 3px rgb(233 196 106 / .25); } }
@media (prefers-reduced-motion: reduce) { .mem-coach-toast { transition: none; } .mem-pulse { animation: none; } }

/* in-game world switcher rows (settings popover) — hop between your worlds without backing out home */
.tl-world { display: flex; flex-direction: column; gap: .1em; padding: .5em .4em; border-radius: 6px;
  color: var(--text); text-decoration: none; }
.tl-world:active { background: rgb(var(--accent-rgb) / .1); }
.tl-world-title { font-size: .9rem; color: var(--label); }
.tl-world-sub { font-size: .72rem; color: var(--muted); font-family: var(--font-mono);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── cross-document View Transitions: full-page navs (home↔play↔account↔setup) push/pop like a
   native nav controller. htmx in-page turn-appends are same-document, so they're untouched. ───── */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vtOut .26s var(--ease-ios) both; }
::view-transition-new(root) { animation: vtIn .32s var(--ease-ios) both; }
@keyframes vtOut { to { opacity: 0; transform: translateX(-14px); } }
@keyframes vtIn { from { opacity: 0; transform: translateX(18px); } }
/* the VT slide replaces the body fade-in, so it doesn't double up (also guards bfcache restore) */
@supports (view-transition-name: none) { body { animation: none; } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ── bottom sheets on touch: the toolbar/composer popovers rise from the bottom edge with a grab
   handle (more thumb-reachable + native). Keeps the <details> state + the existing outside-tap close
   (mobile.js) — no drag tracking, so no regression risk on the co-op invite flow living in settings. */
@media (pointer: coarse) {
  .tl-panel { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: 100%; max-width: 100%;
    max-height: 82vh; border-radius: 20px 20px 0 0; transform-origin: center bottom;
    animation: sheetUp .3s var(--ease-ios) both;
    padding: 1.5em calc(var(--pad) + env(safe-area-inset-right)) calc(1em + env(safe-area-inset-bottom)) calc(var(--pad) + env(safe-area-inset-left));
    box-shadow: 0 -8px 40px rgb(0 0 0 / .55), 0 0 0 .5px var(--line) inset; }
  .bonds-dd .tl-panel, .settings-dd .tl-panel { top: auto; bottom: 0; transform-origin: center bottom; }
  .tl-panel::after { content: ""; position: absolute; top: .6em; left: 50%; transform: translateX(-50%);
    width: 36px; height: 5px; border-radius: 3px; background: var(--muted-2); }
  .topbar .tl-panel::before { display: none; }   /* a sheet has no trigger-caret */
  .tl-panel.closing { animation: sheetDown .22s var(--ease-ios) forwards; }  /* slide the sheet back down instead of snapping */
}
@keyframes sheetUp { from { opacity: 0; transform: translateY(100%); } to { opacity: 1; transform: none; } }
@keyframes sheetDown { to { opacity: 0; transform: translateY(100%); } }
@media (pointer: coarse) and (prefers-reduced-motion: reduce) { .tl-panel { animation: none; } }

/* ── SEO /worlds pages: breadcrumb · sample scene · FAQ accordion · genres hub grid ───────── */
.crumbs { font-size: .8rem; margin: 0 0 1em; }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--accent); }
.world-sample { margin: 1.4em 0; }
.world-sample .demo-stream { font-family: var(--font-serif); font-size: 1.08rem; line-height: 1.62; color: var(--text); min-height: 0; }
.world-faq { margin: 1.8em 0; }
.world-faq h2 { font-family: var(--font-serif); font-size: 1.3rem; color: var(--text); text-align: center; margin: 0 0 .6em; }
html[lang="en"] .world-faq h2 { font-family: 'Instrument Serif', var(--font-serif); }
.faq-item { border-bottom: .5px solid var(--line); }
.faq-item > summary { list-style: none; cursor: pointer; padding: .85em .2em; font-weight: 600; color: var(--label); font-size: .98rem; }
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after { content: "⌄"; float: right; color: var(--muted); }
.faq-item[open] > summary::after { content: "⌃"; }
.faq-item[open] > summary { color: var(--accent); }
.faq-item p { color: var(--muted); margin: 0 .2em .9em; line-height: 1.6; }
.worlds-grid { grid-template-columns: repeat(2, 1fr); }
.world-card { flex-direction: column; align-items: flex-start; gap: .3em; min-height: 0; padding: .9em 1em; }
.world-card .g-name { font-size: 1.05rem; font-weight: 600; }
.world-card .g-blurb { display: block; font-size: .8rem; color: var(--muted); font-style: normal; line-height: 1.4; }
@media (max-width: 560px) { .worlds-grid { grid-template-columns: 1fr; } }

/* landing hero trust strip under the CTA */
.lp-free-strip { font-size: .82rem; letter-spacing: .02em; margin: .9em 0 0; }
/* demo: framed peak-momentum handoff (replaces the abrupt turn-3 redirect) */
.demo-wall { font-style: italic; }
.demo-continue { text-align: center; font-weight: 600; color: var(--accent); }
.demo-continue::before { content: none; }  /* no leading chevron on the continue link */
/* the 7-card grounded grid on the landing: let a lone last card span full width (no orphaned empty cell) */
.lp-genres .genre-grid > .gcard:last-child:nth-child(odd) { grid-column: 1 / -1; }
/* themed 404 */
.not-found { text-align: center; padding-top: 18vh; }
.not-found .nf-msg { margin: 1em 0 1.6em; }
/* setup seedfirst A/B: the "or pick a ready-made world" fold */
.genre-fold { margin: .3em 0 0; }
.genre-fold > summary { cursor: pointer; color: var(--accent); font-size: .95rem; padding: .5em 0; list-style: none; }
.genre-fold > summary::-webkit-details-marker { display: none; }
.genre-fold > summary::after { content: " ⌄"; }
.genre-fold[open] > summary::after { content: " ⌃"; }
/* paywall disclosures (auto-renew + iOS note) */
.pw-renew, .pw-ios-note { font-size: .8rem; line-height: 1.5; margin: .7em 0 0; }

/* Guide / pillar article (/guide/solo-dnd-with-ai) — readable LEFT-aligned prose (overrides .lp-how center) */
.guide-body { text-align: left; max-width: 40em; margin: 1.4em auto; }
.guide-body h2 { text-align: left; margin: 1.5em 0 .35em; }
.guide-body p { color: var(--text); line-height: 1.62; margin: .5em 0; }
.guide-list { list-style: none; padding: 0; margin: .4em 0 .2em; }
.guide-list li { position: relative; padding: .35em 0 .35em 1.1em; line-height: 1.55; color: var(--text); }
.guide-list li::before { content: "›"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.guide-body a, .world-faq a, .guide-cta-inline a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.guide-body a.cta { color: var(--on-accent); text-decoration: none; }  /* don't recolor the button text into accent-on-accent (invisible) */
/* contextual guide link on the dungeon/litrpg world pages */
.guide-cta-inline { text-align: center; margin: .2em 0 1.2em; font-size: .92rem; }

/* ══════════════════════════════════════════════════════════════════════════════════════
   STORYTIME (ages 2-4, parent-read-aloud) — a DELIBERATELY separate warm/bright design
   system. Everything below is scoped under .storytime; it shares font tokens with the adult
   game (no new fonts) but touches NO adult tokens/classes (.opt/.verdict/.play/etc are never
   referenced here, and nothing here leaks into the adult game's dark theme). */
.storytime { --st-accent: #f2a65a; --st-bg: #fbf3e3; --st-ink: #3a2f28; --st-panel: #ffffff;
  background: var(--st-bg); color: var(--st-ink); min-height: 100dvh; display: flex; flex-direction: column;
  font-family: var(--font-sans); }
.storytime a { color: inherit; }

.st-topbar { display: flex; align-items: center; gap: .5em; padding: calc(.7em + env(safe-area-inset-top)) 1em .7em;
  background: var(--st-panel); box-shadow: 0 1px 0 rgba(0,0,0,.06); position: sticky; top: 0; z-index: 5; }
.st-back, .st-restart { font-size: 1.4rem; min-width: 44px; min-height: 44px; display: inline-flex;
  align-items: center; justify-content: center; color: var(--st-accent); text-decoration: none; }
.st-topbar-title { flex: 1; text-align: center; font-weight: 700; font-size: 1.05rem; }

/* ── setup / topic picker ── */
.st-setup { padding: calc(1.2em + env(safe-area-inset-top)) 1.2em 2em; max-width: 640px; margin: 0 auto; width: 100%; }
.st-back.st-setup-back { display: inline-flex; margin-bottom: .3em; }
.st-h1 { font-family: var(--font-serif); font-size: 1.9rem; font-weight: 600; margin: .2em 0 .8em; }
.st-field { display: flex; flex-direction: column; gap: .4em; font-size: .92rem; color: rgb(58 47 40 / .75); margin-bottom: 1.1em; }
.st-field input { font-size: max(16px, 1.05rem); padding: .8em 1em; border-radius: 14px; border: 2px solid rgb(58 47 40 / .12);
  background: var(--st-panel); color: var(--st-ink); }
.st-topic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8em; margin-bottom: 1.4em; }
.st-topic-card { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: .25em; padding: 1.1em .6em; border-radius: 18px; background: var(--st-panel);
  border: 3px solid transparent; box-shadow: 0 2px 10px rgb(0 0 0 / .06); cursor: pointer;
  transition: transform .15s ease, border-color .15s ease; }
.st-topic-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.st-topic-card:has(input:checked) { border-color: var(--st-accent); transform: translateY(-2px);
  box-shadow: 0 6px 18px rgb(0 0 0 / .12); }
.st-topic-emoji { font-size: 2.6rem; line-height: 1; }
.st-topic-name { font-weight: 700; font-size: .95rem; }
.st-topic-hint { font-size: .76rem; color: rgb(58 47 40 / .6); line-height: 1.3; }
.st-cta { display: block; text-align: center; background: var(--st-accent); color: #fff; font-weight: 700;
  font-size: 1.1rem; padding: .9em 1.4em; border-radius: 999px; text-decoration: none; border: none;
  width: 100%; cursor: pointer; box-shadow: 0 4px 14px rgb(0 0 0 / .12); }
.st-link { display: block; text-align: center; margin-top: .7em; color: rgb(58 47 40 / .6); text-decoration: underline; }

/* ── loading (page 1 generating) ── */
.st-loading { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .6em; padding: 2em; text-align: center; }
.st-loading-emoji { font-size: 4rem; animation: stFloat 2.4s ease-in-out infinite; }
@keyframes stFloat { 50% { transform: translateY(-10px); } }
.st-loading-msg { font-size: 1.05rem; color: rgb(58 47 40 / .75); }
.st-loading-dots { display: flex; gap: .4em; }
.st-loading-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--st-accent); opacity: .35;
  animation: stDot 1.2s infinite ease-in-out; }
.st-loading-dots span:nth-child(2) { animation-delay: .2s; }
.st-loading-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes stDot { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .st-loading-emoji, .st-loading-dots span { animation: none; } }

/* ── reading view: one page at a time, instant reveal (no typewriter — the parent paces it) ── */
.st-page { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 1.4em 1.3em 1em; max-width: 560px; margin: 0 auto; width: 100%;
  animation: stFadeIn .3s ease both; }
@keyframes stFadeIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .st-page { animation: none; } }
.st-portrait { width: 100%; max-width: 340px; aspect-ratio: 1; border-radius: 28px; overflow: hidden;
  background: var(--st-accent); display: flex; align-items: center; justify-content: center;
  margin: 0 auto .8em; box-shadow: 0 8px 24px rgb(0 0 0 / .15); flex: none; }
.st-portrait-emoji { font-size: 5rem; }
.st-illus { width: 100%; height: 100%; object-fit: cover; display: block; animation: stDevelop 1.2s ease both; }
@keyframes stDevelop { from { opacity: 0; filter: saturate(.2) blur(6px); } to { opacity: 1; filter: none; } }
@media (prefers-reduced-motion: reduce) { .st-illus { animation: none; } }
.st-chapter { font-family: var(--font-mono); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--st-accent); margin-bottom: .4em; }
.st-text { font-family: var(--font-serif); font-size: 1.5rem; line-height: 1.55; margin: 0 0 1.3em; }
@media (min-width: 600px) { .st-text { font-size: 1.6rem; } }

.st-choices { display: flex; gap: .55em; width: 100%; margin-top: auto; }
.st-choices form { flex: 1; min-width: 0; }  /* 2 OR 3 choices share the row evenly */
.st-choice-btn { width: 100%; min-height: 100px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: .3em; background: var(--st-panel); color: var(--st-ink);
  border: 3px solid rgb(58 47 40 / .08);
  border-radius: 20px; cursor: pointer; padding: .7em .35em; box-shadow: 0 3px 10px rgb(0 0 0 / .06);
  transition: transform .15s var(--ease-ios), border-color .15s ease; }
.st-choice-btn:active { transform: scale(.94); border-color: var(--st-accent); }
.st-choice-icon { font-size: 2.1rem; line-height: 1; }
.st-choice-label { font-weight: 700; font-size: .82rem; line-height: 1.15; }
.st-cta-ghost { background: transparent; color: var(--st-accent); box-shadow: none;
  border: 2px solid var(--st-accent); }

.st-ending { margin-top: auto; padding-top: 1em; }
.st-the-end { font-family: var(--font-serif); font-size: 1.4rem; margin-bottom: 1em; }
.st-ending-actions { display: flex; flex-direction: column; gap: .3em; align-items: center; }
.st-ending-actions .st-cta { max-width: 280px; }

.st-thinking { opacity: 0; text-align: center; color: var(--st-accent); font-size: 1.3rem; padding-bottom: 1em;
  transition: opacity .15s ease; }
.st-thinking.htmx-request { opacity: 1; animation: stFloat 1s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .st-thinking.htmx-request { animation: none; } }

/* ── home-screen entry point — warm + distinct from the adult ghost buttons ── */
.storytime-cta { display: flex; align-items: center; gap: .8em; margin-top: 1.1em; padding: .9em 1.1em;
  background: linear-gradient(135deg, #f2a65a, #f4879a); border-radius: 16px; text-decoration: none;
  color: #fff; box-shadow: 0 4px 16px rgb(242 166 90 / .25); }
.storytime-cta-emoji { font-size: 2rem; flex: none; }
.storytime-cta-text { display: flex; flex-direction: column; gap: .1em; text-align: left; }
.storytime-cta-text strong { font-size: 1.02rem; }
.storytime-cta-text span { font-size: .8rem; opacity: .92; }
