/* Wordbound — storybook party-game theme. */
:root {
  --ink: #15121f;
  --ink-2: #1e1a2d;
  --ink-3: #2a2540;
  --line: #3b3458;
  --text: #f3eee2;
  --muted: #a99fbd;
  --paper: #f5ecd6;
  --paper-ink: #2b2118;
  --amber: #f2b134;
  --teal: #3fb7a6;
  --coral: #ef6f5e;
  --plum: #9b7bd1;
  --green: #79c46b;
  --sky: #6aa8e8;
  --good: #79c46b;
  --bad: #ef6f5e;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font: "Atkinson Hyperlegible", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 700px at 20% -10%, #2c2346 0%, var(--ink) 60%) fixed, var(--ink);
  color: var(--text);
  font: 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; line-height: 1.15; margin: 0 0 .4em; }
em { color: var(--amber); font-style: normal; }
a { color: var(--amber); }
.muted { color: var(--muted); }
.small { font-size: .85em; }
.center { text-align: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; color: var(--teal); font-weight: 700; margin: 0 0 .4em; }
.error { color: var(--coral); font-weight: 700; }
.spacer { flex: 1; }

/* ------------------------------------------------------------ buttons */
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, input:focus-visible, textarea:focus-visible, [data-act]:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.primary, .ghost {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 999px; padding: .6em 1.3em; font-weight: 700; text-decoration: none; transition: transform .12s, background .2s;
}
.primary { background: var(--amber); color: #2a1a00; box-shadow: 0 4px 0 #b07a12; }
.primary:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 0 #b07a12; }
.ghost { background: transparent; border: 2px solid var(--line); color: var(--text); }
.ghost:hover:not(:disabled) { border-color: var(--muted); }
.big { font-size: 1.15rem; padding: .8em 1.6em; }
.big small, .primary small, .ghost small { font-weight: 400; font-size: .75rem; opacity: .8; }
.mini { font-size: .72rem; padding: .15em .55em; border-radius: 999px; background: var(--ink-3); border: 1px solid var(--line); color: var(--text); }
.mini:hover { border-color: var(--amber); }
.icon-btn { font-size: 1.3rem; padding: .2em .4em; border-radius: 10px; }
.icon-btn:hover { background: var(--ink-3); }

.badge { display: inline-block; font-size: .7rem; font-weight: 700; padding: .15em .55em; border-radius: 999px; background: var(--ink-3); color: var(--muted); vertical-align: middle; }
.badge.gold { background: var(--amber); color: #2a1a00; }
.badge.teal { background: var(--teal); color: #062a25; }
.chip { display: inline-block; padding: .2em .7em; border-radius: 999px; background: var(--ink-3); margin: .15em; font-size: .9em; }
.chip.here { background: var(--teal); color: #062a25; font-weight: 700; }

.spinner { display: inline-block; width: 1em; height: 1em; border: 3px solid rgba(255,255,255,.2); border-top-color: var(--amber); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -0.15em; margin-right: .4em; }
@keyframes spin { to { transform: rotate(360deg); } }

.avatar { display: inline-grid; place-items: center; width: 2.2em; height: 2.2em; border-radius: 50%; font-weight: 700; font-size: .9em;
  background: hsl(var(--h) 55% 45%); color: #fff; border: 2px solid hsl(var(--h) 60% 70%); flex: none; vertical-align: middle; }
.avatar.sm { width: 1.7em; height: 1.7em; font-size: .75em; }

/* ------------------------------------------------------------ tiles (ransom-note words) */
.tile {
  display: inline-flex; align-items: center; justify-content: center; min-height: 2.2em;
  padding: .2em .7em; margin: .15em; border-radius: 8px; font-weight: 700; letter-spacing: .01em;
  background: var(--paper); color: var(--paper-ink); box-shadow: 0 2px 0 rgba(0,0,0,.35), inset 0 -2px 0 rgba(0,0,0,.08);
  border: 2px solid transparent; transform: rotate(var(--tilt, 0deg)); user-select: none; -webkit-user-select: none;
}
.tile:nth-child(3n) { --tilt: -1.2deg; } .tile:nth-child(4n+1) { --tilt: 1deg; }
.tile.k-character { background: #bfeee6; border-color: var(--teal); }
.tile.k-world { background: #fde2a5; border-color: var(--amber); }
.tile.k-off_theme { background: #e2d4fa; border-color: var(--plum); font-style: italic; }
.tile.k-learned { background: #d6f2c8; border-color: var(--green); }
.tile.k-scene { background: transparent; color: var(--text); border: 2px dashed var(--sky); box-shadow: none; }
.tile.new::after { content: "✦"; color: var(--green); margin-left: .25em; font-size: .8em; }
.tile.sm { min-height: 1.6em; font-size: .85em; padding: .05em .5em; }
.tile.big { font-size: 2rem; padding: .3em .9em; }
.tile.selected { outline: 3px solid var(--amber); transform: translateY(-3px); }
.tile.known { opacity: .5; }
button.tile:active { transform: scale(.94); }

.letter-chip { display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; padding: 0 .3em; border-radius: 10px; background: var(--paper); color: var(--paper-ink); font-family: var(--display); font-weight: 900; }
.letter-chip.big { font-size: 1.7rem; }
.big-letter {
  font-family: var(--display); font-weight: 900; font-size: clamp(6rem, 18vh, 12rem); line-height: 1; width: 1.35em; height: 1.35em;
  margin: .2em auto; display: grid; place-items: center; color: var(--paper-ink);
  background: var(--paper); clip-path: polygon(50% 0, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%);
  animation: pop .5s cubic-bezier(.2,1.6,.4,1);
}
.big-letter.sm { font-size: clamp(3rem, 9vh, 6rem); margin: 0; }
@keyframes pop { from { transform: scale(.3) rotate(-30deg); opacity: 0; } }
.seen, .seen * { animation: none !important; }

/* ------------------------------------------------------------ status, toasts */
#toasts { position: fixed; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: .5rem; width: min(92vw, 460px); pointer-events: none; }
.toast { background: var(--ink-3); border-left: 5px solid var(--sky); padding: .7em 1em; border-radius: 10px; box-shadow: var(--shadow); animation: slidein .25s; transition: opacity .4s, transform .4s; }
.toast.good { border-color: var(--good); } .toast.bad { border-color: var(--bad); } .toast.warn { border-color: var(--amber); }
.toast.out { opacity: 0; transform: translateY(-10px); }
@keyframes slidein { from { opacity: 0; transform: translateY(-10px); } }
#net-status { position: fixed; bottom: .6rem; left: .6rem; z-index: 90; font-size: .8rem; padding: .3em .8em; border-radius: 999px; background: var(--coral); color: #fff; }
#net-status.online { display: none; }
#net-status.connecting { background: var(--ink-3); }
.job { margin: .5rem auto; max-width: 900px; padding: .6em 1em; border-radius: 12px; background: var(--ink-3); text-align: center; }
.job.failed { background: #4a1f25; border: 1px solid var(--coral); }
.job.failed button { margin-left: .6em; background: var(--coral); color: #fff; padding: .2em .8em; border-radius: 999px; }
.job.paused { background: #3a3150; font-weight: 700; }
.fatal { max-width: 520px; margin: 15vh auto; text-align: center; padding: 1rem; }

/* ------------------------------------------------------------ landing */
.landing-main { max-width: 720px; margin: 0 auto; padding: 10vh 16px 4rem; text-align: center; }
.title { font-family: var(--display); font-weight: 900; font-size: clamp(3rem, 10vw, 6rem); letter-spacing: -.02em; margin: 0; }
.title span, .brand span { color: var(--amber); font-style: italic; }
.tagline { font-size: 1.2rem; color: var(--muted); max-width: 36em; margin: 1rem auto 2rem; }
.landing-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 2.5rem; }
.join-form { display: grid; gap: .5rem; justify-content: center; margin-bottom: 2rem; }
.join-form .row { display: flex; gap: .5rem; }
.join-form input { width: 7em; text-align: center; text-transform: uppercase; letter-spacing: .3em; font: 700 1.4rem var(--font); }
#pw-form input { width: 12em; text-transform: none; letter-spacing: .1em; font-size: 1.1rem; }
#recent ul { list-style: none; padding: 0; } #recent li { margin: .3em 0; }

input, textarea {
  width: 100%; font: inherit; color: var(--paper-ink); background: var(--paper); border: 2px solid transparent;
  border-radius: 10px; padding: .65em .8em; margin-top: .3em;
}
input:focus, textarea:focus { border-color: var(--amber); outline: none; }
textarea { resize: vertical; }

/* ------------------------------------------------------------ shared screen */
.stage { min-height: 100vh; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.tv .stage { height: 100vh; }
.topbar { display: flex; align-items: center; gap: 1rem; padding: .6rem 1.4rem; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand { font-family: var(--display); font-weight: 900; font-size: 1.5rem; color: inherit; text-decoration: none; }
.ending-exit { margin: 1.6rem 0 1rem; text-align: center; }
.phase-label { flex: 1; color: var(--muted); font-weight: 700; }
.top-right { display: flex; align-items: center; gap: .8rem; }
.room-code b { font-family: var(--display); font-size: 1.4rem; color: var(--amber); letter-spacing: .1em; }
.word-bag { display: flex; align-items: center; gap: .3em; padding: .2em .7em; border-radius: 999px; background: var(--ink-3); }
.word-bag.gulp { animation: gulp .5s; }
@keyframes gulp { 40% { transform: scale(1.35); background: var(--amber); color: #2a1a00; } }
.stage-main { flex: 1; overflow: auto; padding: 1.2rem clamp(1rem, 3vw, 3rem); }
.hostbar { border-top: 1px solid rgba(255,255,255,.06); }
.hostbar-inner { display: flex; align-items: center; gap: .8rem; padding: .6rem 1.4rem; }
.phase { max-width: 1400px; margin: 0 auto; font-size: clamp(1rem, 1.25vw, 1.35rem); }
.fx-layer { position: absolute; inset: 0; pointer-events: none; z-index: 50; }

.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 92vw); background: var(--ink-2); z-index: 60; overflow: auto; padding: 1.4rem; box-shadow: var(--shadow); border-left: 1px solid var(--line); }
.drawer .close { position: absolute; top: .8rem; right: .8rem; font-size: 1.2rem; }
.drawer h3 { margin-top: 1.2em; color: var(--teal); }
.journal { list-style: none; padding: 0; } .journal li { margin: .4em 0; }
.journal .j-claim { color: var(--muted); font-style: italic; }
.journal .j-secret .badge { background: var(--plum); color: #fff; }
.journal .j-discovery .badge { background: var(--teal); color: #062a25; }
.crisis-line { border-left: 4px solid var(--coral); padding-left: .8em; }

/* lobby */
.lobby { display: grid; justify-items: center; gap: 1.6rem; padding-top: 3vh; text-align: center; }
.lobby .title { font-size: clamp(3rem, 9vw, 7rem); }
.join-card { display: flex; align-items: center; gap: 1.6rem; background: var(--ink-2); border: 1px solid var(--line); padding: 1.2rem 1.6rem; border-radius: 20px; text-align: left; }
.qr { width: 150px; height: 150px; background: #fff; border-radius: 12px; padding: 6px; }
.join-url { font-weight: 700; font-size: 1.2rem; }
.code-big { font-family: var(--display); font-weight: 900; font-size: 4rem; letter-spacing: .15em; color: var(--amber); line-height: 1; }
.lobby-players { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
.lobby-player { display: flex; flex-direction: column; align-items: center; gap: .3rem; font-weight: 700; font-size: 1.2rem; animation: pop .4s; }
.lobby-player .avatar { width: 3.2em; height: 3.2em; font-size: 1.1em; }
.lobby-player small { color: var(--amber); font-size: .7em; text-transform: uppercase; }

/* prompts and waiting */
.prompt-hero, .turn-hero { text-align: center; max-width: 1000px; margin: 2vh auto; }
.prompt-hero h2, .turn-hero h2 { font-size: clamp(1.8rem, 3.2vw, 3rem); }
.rules { display: grid; gap: .5rem; margin: 1rem auto; max-width: 820px; text-align: left; }
.rules > div { background: var(--ink-2); padding: .7em 1em; border-radius: 12px; border-left: 4px solid var(--teal); }
.waiting-row { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: 1.4rem; }
.wait-chip { display: inline-flex; align-items: center; gap: .4em; padding: .35em .9em; border-radius: 999px; background: var(--ink-2); color: var(--muted); border: 2px solid var(--line); }
.wait-chip.done { color: var(--text); border-color: var(--teal); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin: 1rem 0; }
.pitch-card { background: var(--paper); color: var(--paper-ink); border-radius: var(--radius); padding: 1.1em 1.2em; box-shadow: var(--shadow);
  animation: deal .5s backwards; animation-delay: calc(var(--i, 0) * 120ms); transition: transform .4s, opacity .4s; }
@keyframes deal { from { opacity: 0; transform: translateY(30px) rotate(-4deg); } }
.pitch-title { font-family: var(--display); font-weight: 700; font-size: 1.4em; }
.pitch-meta { font-size: .85em; opacity: .7; margin-top: .4em; }
.pitch-card.won { outline: 5px solid var(--amber); transform: scale(1.03); }
.pitch-card.lost { opacity: .55; }
.pitch-card .cloud { margin-top: .5em; }
.pitch-card.crisis p { margin: .4em 0; }
.rubric { display: flex; gap: .3em; flex-wrap: wrap; } .rubric span { font-size: .75em; padding: .1em .5em; border-radius: 999px; }
.rubric .ok { background: var(--teal); color: #062a25; } .rubric .no { background: rgba(0,0,0,.1); text-decoration: line-through; }
.winner { font-family: var(--display); font-weight: 900; text-align: center; font-size: clamp(2.5rem, 6vw, 5rem); color: var(--amber); animation: pop .6s; }

/* clusters and scores */
.score-row { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-bottom: 1rem; }
.score-chip { display: inline-flex; align-items: center; gap: .4em; background: var(--ink-2); padding: .3em .9em; border-radius: 999px; }
.score-chip b { font-family: var(--display); font-size: 1.3em; color: var(--amber); }
.score-chip .plus { color: var(--green); font-weight: 700; }
.clusters h3 { color: var(--teal); margin-top: 1rem; }
.cluster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: .8rem; }
.cluster { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); padding: .8em 1em; animation: deal .4s backwards; }
.cluster.matched { border-color: var(--teal); }
.cluster.in-roster { border-color: var(--amber); box-shadow: 0 0 0 2px var(--amber); }
.cluster-grid.secondary .cluster { opacity: .75; }
.cluster-head { display: flex; flex-wrap: wrap; gap: .4em; align-items: center; margin-bottom: .4em; }
.members { display: flex; flex-wrap: wrap; gap: .3em; }
.member { background: var(--ink-3); border-radius: 10px; padding: .2em .6em; font-size: .85em; }
.member em { font-size: .75em; text-transform: uppercase; letter-spacing: .05em; margin-right: .2em; }
.member.label-overlooked em { color: var(--plum); } .member.label-panel em { color: var(--muted); }
.member small { color: var(--muted); margin-left: .3em; }
.invalid { color: var(--muted); } .invalid li { margin: .3em 0; }
.panel-only { margin-top: .8rem; color: var(--muted); }

/* exceptions / connections */
.challenge-row, .connect-row { display: flex; gap: 1rem; justify-content: center; align-items: stretch; flex-wrap: wrap; margin: 1rem 0; }
.fact-card { background: var(--paper); color: var(--paper-ink); border-radius: var(--radius); padding: 1em 1.2em; max-width: 440px; font-size: 1.15em; font-weight: 700; box-shadow: var(--shadow); animation: deal .5s backwards; }
.fact-card small, .challenge-card small { display: block; font-size: .65em; text-transform: uppercase; letter-spacing: .1em; opacity: .65; }
.challenge-card { background: var(--plum); color: #fff; border-radius: var(--radius); padding: 1em 1.2em; font-weight: 700; font-size: 1.15em; animation: deal .5s .15s backwards; }
.challenge-card p { color: #fff; opacity: .9; font-weight: 400; font-size: .75em; margin: .4em 0; }
.challenge-card .ghost { color: #fff; border-color: rgba(255,255,255,.5); }
.rel-badge { align-self: center; background: var(--teal); color: #062a25; font-weight: 900; padding: .5em 1em; border-radius: 999px; font-family: var(--display); }
.status-line { color: var(--muted); font-size: 1.1em; }
.changes, .links { display: grid; gap: .5rem; max-width: 1100px; margin: 1rem auto; }
.change-row, .link-row { display: flex; flex-wrap: wrap; gap: .5em; align-items: baseline; background: var(--ink-2); padding: .6em 1em; border-radius: 12px; animation: deal .4s backwards; }
.change-row s { color: var(--muted); } .change-row .arrow { color: var(--amber); }
.change-row small, .link-row small { color: var(--muted); width: 100%; }
.mini-fact { font-size: .85em; color: var(--muted); } .rel { color: var(--teal); font-weight: 700; }

/* cast */
.roster-banner { text-align: center; font-size: 1.3em; margin: .5rem 0; }
.roster-pill { display: inline-block; background: var(--amber); color: #2a1a00; font-weight: 700; padding: .2em .8em; border-radius: 999px; margin: .2em; font-family: var(--display); }
.roster-progress { display: flex; gap: .4rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1rem; }
.roster-progress span { padding: .2em .8em; border-radius: 999px; background: var(--ink-2); color: var(--muted); font-size: .85em; }
.roster-progress .now { background: var(--amber); color: #2a1a00; font-weight: 700; } .roster-progress .complete { color: var(--text); }
.scatter-hero { display: flex; align-items: center; justify-content: center; gap: 2rem; flex-wrap: wrap; }
.archetype-big { font-size: clamp(2.2rem, 4.5vw, 4rem); }
.scatter-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin: 1.4rem auto; max-width: 1100px; }
.scatter-cell { background: var(--ink-2); border: 2px dashed var(--line); border-radius: var(--radius); padding: 1em; display: flex; justify-content: space-between; animation: deal .4s backwards; animation-delay: calc(var(--i) * 60ms); }
.scatter-cell span { color: var(--amber); font-family: var(--display); font-weight: 900; }
.countdown { --frac: 1; position: relative; width: 5.5rem; height: 5.5rem; display: grid; place-items: center; }
.countdown svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.countdown circle { fill: none; stroke: var(--teal); stroke-width: 3.2; stroke-dasharray: 100.5; stroke-dashoffset: calc(100.5 * (1 - var(--frac))); transition: stroke-dashoffset .25s linear; }
.countdown .cd-num { font-family: var(--display); font-weight: 900; font-size: 2rem; }
.countdown.warn circle { stroke: var(--coral); } .countdown.warn .cd-num { color: var(--coral); animation: pulse .5s infinite alternate; }
@keyframes pulse { to { transform: scale(1.15); } }

.reveal-wrap { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1.4rem; align-items: start; }
.answers { background: var(--ink-2); border-radius: var(--radius); padding: 1rem; font-size: .9em; }
.ans-row { display: flex; flex-wrap: wrap; gap: .3em; align-items: baseline; margin: .3em 0; }
.ans-row b { width: 8.5em; color: var(--muted); font-weight: 400; }
.ans { background: var(--ink-3); padding: .1em .5em; border-radius: 8px; }
.ans.invalid { text-decoration: line-through; opacity: .55; }
.ans small { color: var(--muted); }

.char-card { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 1rem; background: var(--ink-2); border: 1px solid var(--line); border-radius: 18px; padding: 1rem; box-shadow: var(--shadow); animation: deal .5s backwards; }
.char-card.compact { grid-template-columns: 84px 1fr; padding: .7rem; gap: .7rem; font-size: .9em; }
.char-art { position: relative; align-self: start; display: grid; place-items: end center; aspect-ratio: 3 / 4; background: radial-gradient(circle at 50% 35%, var(--ink-3), transparent 70%); border-radius: 14px; overflow: hidden; }
.char-art .sprite-ph { width: 78%; height: 88%; min-height: 0; }
.char-card.compact .char-art { aspect-ratio: 1; }
.char-art .sprite-img { max-width: 100%; max-height: 100%; object-fit: contain; }
.art-status { position: absolute; top: .4em; left: .4em; font-size: .7rem; background: rgba(0,0,0,.5); padding: .1em .5em; border-radius: 999px; }
.char-body header { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5em; }
.char-body h3 { font-size: 1.6em; margin: 0; } .char-card.compact h3 { font-size: 1.2em; }
.archetype { color: var(--teal); font-weight: 700; }
.desc { margin: .3em 0 .6em; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: .3em; margin: .3em 0; }
.tag { padding: .15em .6em; border-radius: 8px; font-weight: 700; font-size: .85em; }
.tag.pos { background: rgba(63,183,166,.18); color: #8ee6d8; } .tag.neg { background: rgba(239,111,94,.18); color: #ffb3a8; }
.items { margin: .3em 0; } .item { margin-right: .7em; font-size: .9em; }
.details { display: grid; grid-template-columns: auto 1fr; gap: .2em .8em; margin: .5em 0 0; font-size: .9em; }
.details dt { color: var(--muted); } .details dd { margin: 0; } .details .secret { color: var(--plum); font-style: italic; }
.slots { display: grid; gap: .25em; margin-top: .7em; }
.slot { display: grid; grid-template-columns: 8.5em 1fr auto; gap: .5em; align-items: baseline; padding: .25em .5em; border-radius: 8px; background: var(--ink-3);
  animation: slot .5s backwards; animation-delay: calc(var(--i) * 220ms + 200ms); }
@keyframes slot { from { opacity: 0; transform: rotateX(90deg); } }
.slot-label { color: var(--muted); font-size: .85em; } .slot-value { font-weight: 700; } .slot-value.fill { color: var(--muted); font-style: italic; }
.slot-author { font-size: .75em; color: var(--muted); }

.draft-order { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; margin: .5rem 0 1rem; }
.draft-order span { padding: .3em .9em; border-radius: 999px; background: var(--ink-2); }
.draft-order .now { background: var(--amber); color: #2a1a00; font-weight: 700; animation: pulse .8s infinite alternate; }
.draft-order .done { opacity: .5; }
.draft-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 1rem; }
.draft-slot { position: relative; } .draft-slot.taken .char-card { opacity: .5; }
.taken-by { position: absolute; top: 1rem; right: 1rem; background: var(--amber); color: #2a1a00; font-weight: 900; padding: .3em .9em; border-radius: 999px; transform: rotate(4deg); }

.prep { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
.prep-steps ol { list-style: none; padding: 0; font-size: 1.15em; } .prep-steps li { margin: .5em 0; color: var(--muted); }
.prep-steps li.running { color: var(--text); font-weight: 700; } .prep-steps li.done { color: var(--teal); }
.prep-recap { background: var(--ink-2); border-radius: var(--radius); padding: 1rem; }
.mini-cast { display: grid; gap: .6rem; margin-top: .8rem; }
.facts { list-style: none; padding: 0; display: grid; gap: .4rem; }
.fact { background: var(--ink-3); border-radius: 10px; padding: .5em .8em; display: flex; flex-wrap: wrap; gap: .4em; align-items: baseline; }
.fact-kind { font-size: .65em; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.fact.kind-exception .fact-kind { color: var(--amber); } .fact.kind-connection .fact-kind { color: var(--teal); } .fact.kind-crisis .fact-kind { color: var(--coral); }
.fact .before { color: var(--muted); font-size: .85em; } .fact-author { margin-left: auto; font-size: .75em; color: var(--muted); }
.facts.compact .fact { font-size: .88em; }

.ending { max-width: 1100px; margin: 0 auto; text-align: center; }
.ending-card { position: relative; border-radius: 22px; overflow: hidden; aspect-ratio: 16/7; background: var(--ink-3); box-shadow: var(--shadow); }
.ending-card img { width: 100%; height: 100%; object-fit: cover; animation: kenburns 20s ease-out forwards; }
@keyframes kenburns { to { transform: scale(1.08); } }
.ending-ph { position: absolute; inset: 0; background: linear-gradient(135deg, var(--plum), var(--ink)); }
.tier-triumphant .ending-ph { background: linear-gradient(135deg, var(--amber), var(--teal)); }
.tier-disastrous .ending-ph { background: linear-gradient(135deg, #5a1d24, var(--ink)); }
.ending-title { position: absolute; left: 0; right: 0; bottom: 0; padding: 2rem; background: linear-gradient(transparent, rgba(0,0,0,.75)); }
.ending-title small { text-transform: uppercase; letter-spacing: .2em; color: var(--amber); }
.ending-title h1 { font-size: clamp(2rem, 5vw, 4rem); }
.epilogue { font-size: 1.25em; max-width: 50em; margin: 1.5rem auto; }
.char-epilogues { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; text-align: left; }
.ce { display: flex; gap: .8rem; background: var(--ink-2); border-radius: var(--radius); padding: .8rem; align-items: center; }
.ce .sprite-img, .ce .sprite-ph { width: 90px; height: 110px; object-fit: contain; flex: none; }
.aftermath { color: var(--muted); font-style: italic; margin-top: 1.5rem; }
.secrets { text-align: left; margin-top: 1rem; background: var(--ink-2); padding: .8rem 1rem; border-radius: var(--radius); }

/* sprites */
.sprite-img { display: block; user-select: none; }
.sprite-ph { position: relative; width: 100%; height: 100%; min-height: 120px; display: grid; justify-items: center; align-content: end; }
.sprite-ph .ph-head { width: 38%; aspect-ratio: 1; border-radius: 50%; background: hsl(var(--h) 35% 55%); margin-bottom: 4%; }
.sprite-ph .ph-body { width: 72%; height: 45%; border-radius: 50% 50% 8px 8px; background: hsl(var(--h) 35% 40%); }
.sprite-ph span { position: absolute; bottom: 15%; font-weight: 900; color: hsl(var(--h) 60% 85%); font-size: 1.3em; }

/* ------------------------------------------------------------ visual novel */
.phase-adventure, .stage-main:has(.vn) { padding: 0; }
.vn { position: relative; width: 100%; height: 100%; min-height: calc(100vh - 120px); overflow: hidden; background: #000; container-type: size; }
.solo .vn { min-height: 520px; }
.vn-bg, .bg-ph, .bg-img { position: absolute; inset: 0; width: 100%; height: 100%; }
.bg-ph { background: radial-gradient(ellipse at 50% 30%, hsl(var(--h) 40% 35%), hsl(var(--h) 35% 12%) 70%); display: grid; place-items: center; align-content: center; }
.bg-ph span { font-family: var(--display); font-size: clamp(2rem, 6cqw, 5rem); opacity: .18; font-weight: 900; }
.bg-ph small { opacity: .4; }
.bg-img { object-fit: cover; opacity: 0; transition: opacity 1.2s; } .bg-img.in { opacity: 1; }
.vn-top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start; padding: 1rem 1.4rem; z-index: 5; gap: 1rem; }
.loc-chip { background: rgba(10,8,18,.7); backdrop-filter: blur(6px); padding: .4em 1em; border-radius: 999px; font-size: clamp(1rem, 1.6cqw, 1.5rem); }
.clocks { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: flex-end; }
.clock { display: flex; gap: .5em; align-items: center; background: rgba(10,8,18,.7); backdrop-filter: blur(6px); padding: .35em .8em .35em .4em; border-radius: 999px; font-size: clamp(.8rem, 1.1cqw, 1.05rem); }
.clock small { display: block; color: var(--muted); }
.clock-svg path.on { fill: var(--coral); } .clock-svg path.off { fill: rgba(255,255,255,.15); }
.clock.complete { box-shadow: 0 0 0 2px var(--coral); }
.clock.tick { animation: tick .8s; }
@keyframes tick { 30% { transform: scale(1.25); box-shadow: 0 0 30px var(--coral); } }
.vn-cast { position: absolute; bottom: 3.6rem; display: flex; align-items: flex-end; z-index: 3; height: 72%; pointer-events: none; }
.vn-cast.left { left: -2cqw; } .vn-cast.right { right: -2cqw; flex-direction: row-reverse; }
.cast-member { margin: 0 -4cqw 0 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; transition: filter .35s, transform .35s; position: relative; transform-origin: bottom center; }
.vn-cast.right .cast-member { margin: 0 0 0 -4cqw; }
.cast-member:last-child { margin: 0; } .vn-cast.right .cast-member:last-child { margin: 0; }
.cast-member .sprite-img { height: 100%; width: auto; max-width: 40cqw; object-fit: contain; object-position: bottom; filter: drop-shadow(0 10px 18px rgba(0,0,0,.5)); }
.pchip .face { width: 2rem; height: 2rem; border-radius: 50%; object-fit: cover; object-position: top; background: var(--ink-3); }
.also-here { margin-left: .6em; color: var(--muted); font-size: .85em; }
.cast-member .sprite-ph { width: 12cqw; height: 100%; }
.cast-member .sprite-ph .ph-head { width: 46%; }
.cast-member .sprite-ph .ph-body { height: 64%; }
.cast-member .sprite-ph span { bottom: auto; top: calc(36% - 4.6cqw); }
.cast-member figcaption { position: absolute; top: 4%; background: rgba(10,8,18,.75); padding: .1em .7em; border-radius: 999px; font-weight: 700; font-size: clamp(.75rem, 1.1cqw, 1rem); white-space: nowrap; opacity: 0; transition: opacity .3s; }
.cast-member.speaking { transform: scale(1.04); z-index: 2; } .cast-member.speaking figcaption { opacity: 1; }
.cast-member.dim { filter: brightness(.55) saturate(.8); }
.vn-bottom { position: absolute; left: 4%; right: 4%; bottom: 3.6rem; z-index: 6; display: grid; gap: .5rem; }
.vn-dialogue { position: relative; min-height: 6.8em; background: linear-gradient(rgba(16,13,28,.92), rgba(12,10,22,.96)); border: 2px solid rgba(245,236,214,.25); border-radius: 18px; padding: 1.3em 1.6em 1.1em; font-size: clamp(1.05rem, 1.8cqw, 1.7rem); line-height: 1.45; cursor: pointer; pointer-events: auto; box-shadow: var(--shadow); }
.vn-dialogue.npc { border-color: rgba(242,177,52,.55); } .vn-dialogue.pc { border-color: rgba(63,183,166,.6); }
.vn-dialogue.gm .line { font-style: italic; color: #e6dfcf; }
.speaker-tab { position: absolute; top: -1.05em; left: 1.2em; background: var(--amber); color: #2a1a00; font-weight: 900; font-family: var(--display); padding: .1em .9em; border-radius: 10px; font-size: .85em; }
.speaker-tab.pc { background: var(--teal); color: #062a25; }
.beat-nav { position: absolute; right: .8em; bottom: .5em; display: flex; gap: .3em; align-items: center; font-size: .6em; color: var(--muted); }
.phrase-line .tile { font-size: .9em; }
.phrase-meta { color: var(--muted); font-size: .7em; margin-top: .4em; }
.band-success { color: var(--green); } .band-mixed { color: var(--amber); } .band-fail { color: var(--coral); }
.vn-draft:empty, .vn-changes:empty { display: none; }
.draft-box { justify-self: start; background: rgba(10,8,18,.85); border: 2px dashed var(--sky); border-radius: 14px; padding: .4em .8em; display: flex; flex-wrap: wrap; gap: .3em; align-items: center; font-size: clamp(.85rem, 1.3cqw, 1.2rem); }
.draft-box.resolving { border-style: solid; border-color: var(--amber); }
.draft-label { text-transform: uppercase; font-size: .7em; letter-spacing: .1em; color: var(--sky); font-weight: 700; margin-right: .3em; }
.draft-box.resolving .draft-label { color: var(--amber); }
.draft-box .others { color: var(--muted); }
.vn-changes { display: flex; gap: .4rem; flex-wrap: wrap; }
.change-chip { background: rgba(10,8,18,.85); border-left: 4px solid var(--amber); padding: .2em .8em; border-radius: 8px; font-size: clamp(.8rem, 1.2cqw, 1.1rem); animation: deal .4s backwards; animation-delay: calc(var(--i) * 150ms); }
.vn-strip { position: absolute; left: 0; right: 0; bottom: 0; height: 3.2rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 1rem; background: rgba(10,8,18,.85); z-index: 7; overflow: hidden; }
.party-chips { display: flex; gap: .6rem; overflow: hidden; }
.pchip { display: inline-flex; align-items: center; gap: .35em; white-space: nowrap; font-size: .9rem; }
.pchip small { color: var(--muted); } .pchip.offline { opacity: .45; } .pchip.composing b { color: var(--sky); }
.cond { display: inline-block; font-size: .72rem; padding: .05em .5em; border-radius: 999px; background: rgba(239,111,94,.25); color: #ffb3a8; margin-left: .2em; }
.cond.sev-serious { background: rgba(239,111,94,.5); color: #fff; } .cond.sev-severe { background: var(--coral); color: #fff; }
.offers-strip { font-size: .85rem; color: var(--muted); white-space: nowrap; overflow: hidden; }

/* ------------------------------------------------------------ effects */
.fx-overlay { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 1rem; text-align: center; background: rgba(8,6,16,.72); backdrop-filter: blur(3px); animation: fadein .25s; transition: opacity .35s; }
.fx-overlay.out { opacity: 0; }
@keyframes fadein { from { opacity: 0; } }
.lr-label { font-family: var(--display); font-size: 2rem; color: var(--muted); }
.d20 { width: 14rem; height: 14rem; display: grid; place-items: center; background: var(--paper); color: var(--paper-ink); clip-path: polygon(50% 0, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%); transition: transform .08s; }
.d20-letter { font-family: var(--display); font-weight: 900; font-size: 8rem; }
.d20.landed { animation: land .5s; background: var(--amber); }
@keyframes land { 40% { transform: scale(1.2); } }
.lr-note { color: var(--muted); font-size: .9rem; }
.dice-actor { font-family: var(--display); font-size: 1.8rem; }
.dice { display: flex; gap: 2rem; }
.die { width: 7rem; height: 7rem; background: var(--paper); border-radius: 18px; display: grid; grid-template-columns: repeat(3, 1fr); padding: .9rem; gap: .2rem; box-shadow: 0 8px 0 #bfae8a, var(--shadow); transition: transform .08s; }
.die i { display: block; } .die .pip { background: var(--paper-ink); border-radius: 50%; margin: 18%; }
.die.landed { animation: land .45s; }
.dice-math { min-height: 5rem; font-size: 1.6rem; }
.dice-math .sum { font-weight: 700; } .mods { display: inline-flex; gap: .3em; flex-wrap: wrap; }
.mod { font-size: .75em; padding: .1em .6em; border-radius: 999px; } .mod.pos { background: rgba(63,183,166,.3); } .mod.neg { background: rgba(239,111,94,.3); }
.total { font-family: var(--display); font-weight: 900; font-size: 2.6rem; animation: pop .5s; }
.cascade { align-content: center; }
.cascade-title { font-family: var(--display); font-size: 2rem; } .cascade-sub { color: var(--muted); }
.cascade-groups { display: grid; gap: .8rem; max-width: 1100px; padding: 0 1rem; }
.cascade-group { animation: deal .4s backwards; animation-delay: calc(var(--gi) * 150ms); }
.cascade-source { font-weight: 700; color: var(--muted); } .cascade-group.selected .cascade-source { color: var(--amber); }
.fact-transform, .connect-fx { gap: .8rem; }
.ft-card { background: var(--paper); color: var(--paper-ink); border-radius: var(--radius); padding: 1em 1.4em; max-width: 720px; font-size: 1.4rem; font-weight: 700; }
.ft-card.before { text-decoration: line-through; opacity: .6; animation: shrink 1s .6s forwards; }
@keyframes shrink { to { transform: scale(.85); opacity: .35; } }
.ft-card.after { background: var(--amber); animation: pop .6s 1s backwards; }
.ft-arrow { font-size: 2.5rem; color: var(--amber); }
.ft-meta { color: var(--muted); font-size: 1.2rem; } .ft-meta b { color: var(--green); }
.cx-row { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; justify-content: center; }
.cx-row .a { animation: slideR .7s backwards; } .cx-row .b { animation: slideL .7s backwards; }
@keyframes slideR { from { transform: translateX(-30vw); opacity: 0; } } @keyframes slideL { from { transform: translateX(30vw); opacity: 0; } }
.cx-rel { background: var(--teal); color: #062a25; font-weight: 900; padding: .5em 1em; border-radius: 999px; }
.tb-title { font-family: var(--display); font-size: 2.4rem; animation: pulse .4s infinite alternate; }
.onoma { background: transparent; backdrop-filter: none; }
.onoma span { font-family: var(--display); font-weight: 900; font-size: clamp(4rem, 14vw, 11rem); color: var(--amber); -webkit-text-stroke: 4px #2a1a00; transform: rotate(-8deg); animation: onoma .6s cubic-bezier(.2,1.8,.4,1); }
@keyframes onoma { from { transform: scale(.2) rotate(-30deg); opacity: 0; } }
.flash { background: #fff; animation: flash .4s forwards; } @keyframes flash { to { opacity: 0; } }
.reveal-sweep { background: linear-gradient(100deg, transparent 30%, rgba(155,123,209,.6) 50%, transparent 70%); background-size: 300% 100%; animation: sweep 1.1s; }
.reveal-sweep span { font-family: var(--display); font-size: 3rem; font-weight: 900; }
@keyframes sweep { from { background-position: 100% 0; } to { background-position: 0 0; } }
.sparkle { background: transparent; backdrop-filter: none; font-size: 4rem; color: var(--amber); }
.pause-dim { background: rgba(0,0,0,.6); }
.scene-fade { background: #000; animation: fadeinout .7s; } @keyframes fadeinout { 0% { opacity: 0; } 40% { opacity: 1; } }
.learned { background: rgba(8,6,16,.6); font-size: 1.2rem; }
.shake-light { animation: shake .45s; } .shake-hard { animation: shake .5s 2; }
@keyframes shake { 20% { transform: translate(-6px, 3px); } 40% { transform: translate(5px, -4px); } 60% { transform: translate(-4px, -2px); } 80% { transform: translate(3px, 3px); } }

[data-motion="reduced"] *, [data-motion="reduced"] *::before { animation-duration: .01ms !important; transition-duration: .01ms !important; }
@media (prefers-reduced-motion: reduce) { *, *::before { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ------------------------------------------------------------ phone */
.handset { background: var(--ink); }
.phone { max-width: 560px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; position: relative; }
.phone-head { display: flex; align-items: center; gap: .7rem; padding: .7rem 16px; border-bottom: 1px solid rgba(255,255,255,.06); position: sticky; top: 0; background: var(--ink); z-index: 10; }
.phone-head .who { flex: 1; display: grid; } .phone-head .who small { color: var(--muted); }
.head-sprite { width: 44px; height: 44px; object-fit: cover; object-position: top; border-radius: 50%; background: var(--ink-3); }
.phone-head .sprite-ph.head-sprite { min-height: 44px; overflow: hidden; }
.phone-head .score { font-family: var(--display); font-weight: 900; font-size: 1.5rem; color: var(--amber); text-align: center; line-height: 1; }
.phone-head .score small { display: block; font-size: .6rem; color: var(--muted); font-family: var(--font); }
.phone-main { flex: 1; padding: 12px 16px 6rem; }
.phone-foot { position: sticky; bottom: 0; }
.host-tools { display: flex; gap: .5rem; align-items: center; padding: .6rem 16px calc(.6rem + env(safe-area-inset-bottom)); background: var(--ink-2); border-top: 1px solid var(--line); }
.host-tools small { color: var(--muted); margin-right: auto; text-transform: uppercase; font-size: .7rem; }
.phone.sending { cursor: progress; }
.phone-fx { position: fixed; }
.card { background: var(--ink-2); border: 1px solid var(--line); border-radius: 18px; padding: 1.1rem; margin-bottom: 1rem; }
.card h2 { font-size: 1.5rem; }
form.card { display: grid; gap: .7rem; }
form.card label { display: block; font-weight: 700; font-size: .95rem; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: .6rem .8rem .8rem; display: grid; gap: .5rem; }
legend { font-weight: 700; color: var(--amber); padding: 0 .3em; } legend small { color: var(--muted); font-weight: 400; }
.lbl-ovl { color: var(--plum); }
.vote-list { display: grid; gap: .6rem; }
.vote { text-align: left; background: var(--paper); color: var(--paper-ink); padding: .9em 1em; border-radius: 12px; font-weight: 700; border: 3px solid transparent; }
.vote.chosen { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(242,177,52,.35); }
.vote small { font-weight: 400; opacity: .7; }
.radio-list { display: grid; gap: .4rem; max-height: 40vh; overflow: auto; }
.radio { display: flex !important; gap: .6em; align-items: flex-start; background: var(--ink-3); padding: .6em .7em; border-radius: 10px; font-weight: 400 !important; }
.radio input { width: auto; margin-top: .25em; }
.check { display: flex !important; gap: .5em; align-items: center; font-weight: 400 !important; } .check input { width: auto; margin: 0; }
.results { padding-left: 1.2em; } .results b { color: var(--green); }
.scatter-head { display: flex; align-items: center; gap: .8rem; } .scatter-head > div:first-child { flex: 1; }
.scatter-head h2 { margin: 0; } .scatter .countdown { width: 3.6rem; height: 3.6rem; } .scatter .countdown .cd-num { font-size: 1.3rem; }
.pick-list { display: grid; gap: .8rem; } .pick { display: grid; gap: .5rem; }
.prep-mini { list-style: none; padding: 0; color: var(--muted); } .prep-mini .done { color: var(--teal); } .prep-mini .running { color: var(--text); font-weight: 700; }
.phone .char-card { grid-template-columns: 1fr; } .phone .char-art { height: 240px; aspect-ratio: auto; } .phone .char-art .sprite-img { max-height: 236px; }
.phone .char-art .sprite-ph { width: 150px; }
.phone .char-card.compact { grid-template-columns: 72px 1fr; } .phone .char-card.compact .char-art { height: 72px; aspect-ratio: 1; }
.phone .char-card.compact .char-art .sprite-ph { width: 80%; }
.phone .slot { grid-template-columns: 6.5em 1fr; } .phone .slot-author { grid-column: 2; }
.tabs { display: flex; gap: .3rem; margin-bottom: .8rem; background: var(--ink-2); padding: .3rem; border-radius: 999px; }
.tabs button { flex: 1; padding: .5em; border-radius: 999px; font-weight: 700; color: var(--muted); }
.tabs button.on { background: var(--ink-3); color: var(--text); }
.clock-row { display: flex; gap: .6rem; align-items: center; margin: .4rem 0; }
.recent { padding-left: 1em; } .recent li { margin: .5em 0; }
.ending-phone small { text-transform: uppercase; letter-spacing: .15em; color: var(--amber); }

.resolving-banner { background: var(--ink-3); border-left: 4px solid var(--amber); padding: .6em .8em; border-radius: 10px; margin-bottom: .7rem; }
.resolving-banner.failed { border-color: var(--coral); }
.draft-area { background: var(--ink-2); border: 1px solid var(--line); border-radius: 18px; padding: .8rem; position: sticky; top: 62px; z-index: 5; box-shadow: 0 8px 18px rgba(0,0,0,.35); }
.draft-strip { min-height: 3.2rem; display: flex; flex-wrap: wrap; align-items: center; padding: .3rem; border-radius: 12px; background: var(--ink); border: 2px dashed var(--line); }
.draft-strip .tile { font-size: 1.05rem; }
.tile-tools { display: flex; gap: .4rem; justify-content: center; margin-top: .4rem; } .tile-tools .mini { font-size: .9rem; padding: .3em .9em; }
.verbatim { min-height: 1.4em; text-align: center; font-family: var(--display); font-size: 1.15rem; margin: .4rem 0; color: var(--paper); }
.draft-actions { display: flex; align-items: center; gap: .5rem; } .draft-actions .primary { margin-left: auto; }
.share-toggle { display: inline-flex; align-items: center; gap: .4em; font-size: .85rem; color: var(--muted); cursor: pointer; user-select: none; }
.switch { width: 2.2em; height: 1.25em; border-radius: 999px; background: var(--ink-3); position: relative; border: 1px solid var(--line); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: calc(1.25em - 6px); height: calc(1.25em - 6px); border-radius: 50%; background: var(--muted); transition: transform .2s; }
.switch.on { background: var(--teal); } .switch.on::after { transform: translateX(.95em); background: #fff; }
.preview { margin-top: .8rem; border-radius: 16px; padding: .9rem; background: var(--ink-2); border: 2px solid var(--line); }
.preview.feas-risky { border-color: var(--amber); } .preview.feas-automatic { border-color: var(--teal); }
.preview.feas-impossible, .preview.feas-unintelligible { border-color: var(--coral); }
.preview.stale { opacity: .6; }
.past-previews { margin-top: .6rem; display: grid; gap: .35rem; } .past-previews h4 small { color: var(--muted); font-weight: 400; }
.past-pv { text-align: left; padding: .45rem .7rem; border-radius: 12px; background: var(--ink-2); border: 2px solid var(--line); }
.past-pv .feas { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; margin-right: .3em; }
.past-pv.feas-risky .feas { color: var(--amber); } .past-pv.feas-automatic .feas { color: var(--teal); }
.past-pv.feas-impossible .feas, .past-pv.feas-unintelligible .feas { color: var(--coral); }
.past-pv.on { border-color: var(--amber); }
.pv-head { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.feas { font-weight: 900; font-family: var(--display); } .grade { font-size: .85rem; color: var(--muted); }
.interp { font-size: 1.1rem; margin: .5em 0; } .ignored { color: var(--amber); font-size: .9rem; }
.roll { font-weight: 700; font-size: .9rem; }
.pv-actions { display: flex; gap: .5rem; justify-content: flex-end; }
.offers { margin-top: .8rem; } .offers h4 { margin: 0 0 .3rem; font-family: var(--font); } .offers h4 small { color: var(--muted); font-weight: 400; }
.bank { margin-top: 1rem; } .filter { margin-bottom: .5rem; }
.bank-group h4 { font-family: var(--font); font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: .8rem 0 .2rem; }
.bank-tiles { display: flex; flex-wrap: wrap; } .bank-tiles .tile { font-size: 1.02rem; min-height: 2.5em; padding: .2em .8em; }

/* ------------------------------------------------------------ solo */
.solo-page { overflow: hidden; }
.solo-layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; height: 100vh; }
.solo-tabs { display: none; }
.solo-display { overflow: hidden; border-right: 1px solid var(--line); }
.solo-display .stage { height: 100vh; }
.solo-phone { overflow: auto; height: 100vh; }
.solo-phone .phone { min-height: 100%; }
.solo .vn { min-height: 100%; }

@media (max-width: 1000px) {
  .reveal-wrap, .prep { grid-template-columns: 1fr; }
  .scatter-grid { grid-template-columns: repeat(2, 1fr); }
  .draft-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .solo-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .solo-tabs { display: flex; gap: .3rem; padding: .4rem 16px; background: var(--ink-2); }
  .solo-tabs button { flex: 1; padding: .5em; border-radius: 999px; font-weight: 700; color: var(--muted); }
  .solo-tabs button.on { background: var(--ink-3); color: var(--text); }
  .solo-layout[data-view="scene"] .solo-phone, .solo-layout[data-view="controls"] .solo-display { display: none; }
  .solo-display .stage, .solo-phone { height: calc(100vh - 48px); }
}
@media (max-width: 640px) {
  .topbar { padding: .5rem 16px; gap: .5rem; } .phase-label { font-size: .85rem; }
  .stage-main { padding: 1rem 16px; }
  .join-card { flex-direction: column; text-align: center; }
  .cluster-grid { grid-template-columns: 1fr; }
  .scatter-grid { grid-template-columns: 1fr; }
  .char-card { grid-template-columns: 1fr; }
  .vn-cast { height: 58%; } .vn-bottom { left: 2%; right: 2%; }
  .vn-dialogue { min-height: 6.5em; padding: 1.1em 1em .9em; }
  .hostbar-inner { padding: .5rem 16px; flex-wrap: wrap; }
  .landing-actions .big { width: 100%; }
}

/* ------------------------------------------------------------ v2: host powers, intro, help, pacing */
.prep-badge { font-size: .85rem; background: var(--ink-3); padding: .25em .8em; border-radius: 999px; color: var(--muted); white-space: nowrap; }
.prep-badge small { opacity: .7; margin-left: .3em; }
.narrator-card { display: grid; gap: .15rem; text-align: center; background: var(--ink-2); border: 1px solid var(--line); border-radius: 16px; padding: .8rem 1.4rem; }
.narrator-card b { font-family: var(--display); font-size: 1.4rem; color: var(--amber); }
.narrator-card small { color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-size: .7rem; }
.host-tools { flex-direction: column; align-items: stretch; gap: .5rem; }
.host-label { display: flex; align-items: baseline; gap: .5em; font-weight: 700; color: var(--amber); font-size: .85rem; }
.host-label small { color: var(--muted); font-weight: 400; }
.host-btns { display: flex; flex-wrap: wrap; gap: .5rem; }
.host-btns .primary { flex: 1; }
.narrator-pick { display: grid; gap: .4rem; }
.narrator-pick small { color: var(--muted); text-transform: uppercase; font-size: .7rem; }
.narrator { text-align: left; display: grid; padding: .5em .8em; border-radius: 12px; border: 2px solid var(--line); background: var(--ink); }
.narrator span { font-size: .8rem; color: var(--muted); }
.narrator.on { border-color: var(--amber); background: rgba(242,177,52,.12); }
.help-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.small-btn { font-size: .85rem; padding: .4em .9em; }
.sparks { margin: .2rem 0 0; padding-left: 1.2em; color: var(--amber); }
.sparks li { margin: .2em 0; }
.world-facts { background: var(--ink-2); border: 1px solid var(--line); border-radius: 14px; padding: .6rem .9rem; margin-bottom: 1rem; }
.world-facts summary { cursor: pointer; font-weight: 700; }
.world-facts .facts { margin-top: .6rem; }
.world-so-far { max-width: 1000px; margin: 1.5rem auto 0; }
.world-so-far h3 { color: var(--teal); }
.reroll-votes { margin: .6rem 0; }
.ghost.chosen { border-color: var(--amber); color: var(--amber); }
.member.plausible { opacity: .75; border: 1px dashed var(--line); }
.scatter-cell > div { display: grid; }
.scatter-cell small { color: var(--muted); font-size: .75em; }
label small.hint { color: var(--muted); font-weight: 400; font-size: .8em; }
.legend { font-size: .85em; } .legend .ans { margin-right: .3em; }
.gm-thinking { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); z-index: 8; display: flex; gap: 1rem; align-items: center;
  background: rgba(10,8,18,.88); border: 2px solid var(--amber); border-radius: 18px; padding: 1rem 1.6rem; box-shadow: var(--shadow);
  font-size: clamp(1rem, 1.8cqw, 1.6rem); animation: breathe 1.6s ease-in-out infinite; max-width: 80%; }
.gm-thinking small { display: block; color: var(--muted); font-size: .7em; margin-top: .2em; }
.gm-thinking .spinner { width: 1.4em; height: 1.4em; }
@keyframes breathe { 50% { box-shadow: 0 0 34px rgba(242,177,52,.45); } }
.vn-intro { position: absolute; inset: 0; z-index: 9; display: grid; place-items: center; background: radial-gradient(ellipse at center, rgba(10,8,18,.75), rgba(10,8,18,.95)); }
.intro-card { text-align: center; max-width: 900px; padding: 2rem; display: grid; gap: .8rem; justify-items: center; animation: pop .7s; }
.intro-card > small { color: var(--teal); text-transform: uppercase; letter-spacing: .15em; }
.intro-card h1 { font-size: clamp(2.4rem, 6cqw, 5rem); margin: 0; }
.intro-card .tagline { font-size: clamp(1.1rem, 2cqw, 1.6rem); color: var(--text); margin: 0; }
.intro-card .crisis-line { text-align: left; max-width: 46em; color: var(--muted); }
.intro-cast { display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap; }
.intro-cast figure { margin: 0; display: grid; justify-items: center; gap: .3rem; }
.intro-cast .sprite-img, .intro-cast .sprite-ph { height: clamp(140px, 26cqh, 260px); width: auto; max-width: 22cqw; object-fit: contain; }
.intro-cast figcaption { display: grid; } .intro-cast small { color: var(--muted); }
.intro-phone h2 { font-size: 1.9rem; }
.intro-phone > small { color: var(--teal); text-transform: uppercase; letter-spacing: .12em; }
.resolving-banner { display: flex; gap: .7rem; align-items: center; border: 2px solid var(--amber); background: rgba(242,177,52,.1); }
.resolving-banner small { display: block; color: var(--muted); }
.preview.loading { display: flex; gap: .6rem; align-items: center; color: var(--muted); border-style: dashed; }
.heard { margin-top: .4rem; } .heard summary { cursor: pointer; color: var(--muted); font-size: .85rem; margin-bottom: .3rem; }

.story { list-style: none; padding: 0; display: grid; gap: .8rem; }
.story li { border-left: 3px solid var(--line); padding-left: .8rem; }
.story-act { color: var(--teal); margin-bottom: .2rem; } .story-act small { color: var(--muted); }
.story-beat { margin: .2rem 0; } .story-beat.gm { font-style: italic; color: #e6dfcf; }
.people { list-style: none; padding: 0; } .people li { margin: .4rem 0; } .people small.badge { margin-right: .3em; }
.people.heard small { color: var(--muted); }

.roads { text-align: left; margin-top: 1rem; background: var(--ink-2); padding: .8rem 1rem; border-radius: var(--radius); border-left: 4px solid var(--plum); }
.roads h3 { color: var(--plum); }
.chronicle { text-align: left; margin-top: 1rem; background: var(--ink-2); padding: .8rem 1rem; border-radius: var(--radius); }
.chronicle summary { cursor: pointer; font-weight: 700; } .chronicle summary small { color: var(--muted); font-weight: 400; margin-left: .4em; }
.chronicle h3 { margin-top: 1rem; }
.saves { list-style: none; padding: 0; display: grid; gap: .7rem; text-align: left; }
.save { display: flex; gap: .9rem; align-items: center; background: var(--ink-2); border-radius: var(--radius); padding: .7rem; color: inherit; text-decoration: none; border: 2px solid transparent; }
.save:hover { border-color: var(--line); }
.save-thumb { width: 96px; aspect-ratio: 16/9; border-radius: 10px; background: var(--ink-3) center/cover; flex: none; display: grid; place-items: center; font-family: var(--display); color: var(--amber); }
.save-body { min-width: 0; display: grid; gap: .1rem; } .save-body b { font-family: var(--display); font-size: 1.1rem; }
.save-body small { color: var(--muted); } .save-status { color: var(--amber); font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; }
.secrets li { margin: .4em 0; } .secrets li small { color: var(--muted); margin-left: .3em; }
.secrets li.hidden { color: var(--muted); }

.lobby-settings { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.lobby-settings .narrator-card { min-width: 240px; max-width: 360px; }
.length-pick { display: grid; gap: .4rem; }
