/* GG Medium — dark emerald + gold, minimalist, image-led. No external assets. */

:root {
  --bg: #07120d;
  --bg-deep: #050d09;
  --surface: #0a1a12;
  --surface-2: #0e2418;
  --surface-3: #123322;
  --line: #1d3d2b;
  --line-gold: rgba(212, 175, 55, 0.35);
  --emerald: #0e7a5f;
  --emerald-hover: #17a67e;
  --emerald-dark: #0a5c47;
  --gold: #d4af37;
  --gold-soft: #e8cf7a;
  --cream: #f2ead8;
  --cream-dim: #cfc6ae;
  --muted: #93a89a;
  --danger: #b3402e;
  --danger-hover: #cf5340;
  --success: #3ecf8e;
  --warning: #e8b93e;
  --radius: 14px;
  --radius-small: 9px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(1200px 600px at 50% -120px, #0d2a1b 0%, var(--bg) 55%);
  color: var(--cream);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 0.5em; font-weight: 700; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; }
button { font: inherit; cursor: pointer; }
input, textarea { font: inherit; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--gold); color: #111; padding: 0.5rem 1rem; z-index: 50;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 1.25rem; }
.muted { color: var(--muted); }
.view { padding-bottom: 4rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(7, 18, 13, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.header-inner {
  display: flex; align-items: center; gap: 1rem;
  padding-top: 0.65rem; padding-bottom: 0.65rem; flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  background: none; border: 0; color: var(--cream); padding: 0;
}
.brand-mark { width: 40px; height: 40px; border-radius: 8px; object-fit: contain; }
.brand-name { font-size: 1.25rem; font-weight: 800; letter-spacing: 0.02em; }
.brand-name-accent { color: var(--gold); }
.site-nav { display: flex; gap: 0.25rem; margin-left: 0.5rem; }
.nav-link {
  background: none; border: 0; color: var(--cream-dim);
  padding: 0.45rem 0.8rem; border-radius: 999px; font-weight: 600;
}
.nav-link:hover { color: var(--cream); background: var(--surface-2); }
.nav-link.is-active { color: var(--gold); }
.account-area { margin-left: auto; display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }

.account-chip {
  display: inline-flex; align-items: center; gap: 0.55rem;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 0.35rem 0.35rem 0.35rem 0.85rem;
}
.account-chip-email { font-size: 0.9rem; color: var(--cream); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge {
  display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; border-radius: 999px; padding: 0.18rem 0.6rem;
}
.badge-free { background: var(--surface-3); color: var(--cream-dim); border: 1px solid var(--line); }
.badge-subscriber { background: var(--gold); color: #171204; }
.badge-admin { background: var(--emerald); color: #eafff6; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; border: 1px solid transparent; border-radius: 999px;
  padding: 0.65rem 1.35rem; font-weight: 700; text-decoration: none;
  text-align: center; transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  background: var(--surface-2); color: var(--cream);
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--emerald); color: #f4fffa; }
.btn-primary:hover:not(:disabled) { background: var(--emerald-hover); }
.btn-gold { background: var(--gold); color: #171204; }
.btn-gold:hover:not(:disabled) { background: var(--gold-soft); }
.btn-danger { background: var(--danger); color: #fff5f2; }
.btn-danger:hover:not(:disabled) { background: var(--danger-hover); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--cream); }
.btn-ghost:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-soft); }
.btn-small { padding: 0.4rem 0.9rem; font-size: 0.9rem; }
.btn-block { display: block; width: 100%; }

/* ---------- Messages ---------- */
.global-message, .form-message, .section-message {
  border-radius: var(--radius-small); padding: 0.75rem 1rem; font-size: 0.95rem;
}
.global-message { margin-top: 1rem; }
.message-info { background: var(--surface-2); border: 1px solid var(--line); color: var(--cream); }
.message-success { background: #0c2b1e; border: 1px solid var(--emerald); color: #c9f5e3; }
.message-error, .form-message { background: #2b120d; border: 1px solid var(--danger); color: #ffd9d0; }
.message-warning, .form-message.is-warning { background: #2b230c; border: 1px solid var(--line-gold); color: var(--gold-soft); }
.form-message { margin: 0 0 1rem; }
.section-message { margin-bottom: 1rem; }

/* ---------- Hero ---------- */
.hero { border-bottom: 1px solid var(--line); background: var(--bg-deep); }
.hero-inner {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 2.5rem;
  align-items: center; padding-top: 3rem; padding-bottom: 3rem;
}
.hero-mark { width: 84px; height: 84px; border-radius: 16px; object-fit: contain; margin-bottom: 1.25rem; }
.eyebrow {
  color: var(--gold); font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 0.75rem;
}
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); color: var(--cream); }
.hero-lede { font-size: 1.13rem; color: var(--cream-dim); max-width: 34rem; }
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin: 1.5rem 0 0.75rem; }
.hero-note { color: var(--muted); font-size: 0.95rem; min-height: 1.2em; }
.hero-figure { margin: 0; }
.hero-figure img {
  width: 100%; height: auto; border-radius: var(--radius);
  border: 1px solid var(--line-gold); object-fit: cover;
}

/* ---------- Sections & panels ---------- */
.section-heading { font-size: 1.7rem; color: var(--gold); margin-top: 2.75rem; }
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.5rem; margin-top: 2rem;
}
.panel-heading { font-size: 1.35rem; color: var(--cream); }
.panel-sub { color: var(--cream-dim); max-width: 44rem; }
.sub-heading { font-size: 1.05rem; color: var(--gold); margin-bottom: 0.75rem; }
.fine-print { color: var(--muted); font-size: 0.88rem; margin-bottom: 0; }

/* ---------- Strengths ---------- */
.strengths-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem;
}
.strength-card {
  background: var(--surface); border: 1px solid var(--line);
  border-top: 3px solid var(--emerald); border-radius: var(--radius); padding: 1.2rem;
}
.strength-card h3 { font-size: 1.05rem; color: var(--cream); }
.strength-card p { color: var(--cream-dim); font-size: 0.94rem; margin-bottom: 0; }

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: 1rem; }
.field > span { display: block; font-weight: 600; margin-bottom: 0.35rem; color: var(--cream); }
.field input, .field textarea {
  width: 100%; background: var(--bg-deep); color: var(--cream);
  border: 1px solid var(--line); border-radius: var(--radius-small);
  padding: 0.65rem 0.8rem;
}
.field input:focus, .field textarea:focus { border-color: var(--emerald-hover); outline: none; }
.field textarea { resize: vertical; }

.auth-panel { max-width: 560px; }
.auth-toggle { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; }
.auth-tab {
  background: var(--surface-2); color: var(--cream-dim); border: 1px solid var(--line);
  border-radius: 999px; padding: 0.5rem 1.1rem; font-weight: 700;
}
.auth-tab.is-active { background: var(--emerald); color: #f4fffa; border-color: var(--emerald); }

.account-line strong { color: var(--gold-soft); overflow-wrap: anywhere; }
.account-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.75rem; }

/* ---------- Story shelf ---------- */
.shelf-head { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.shelf-sub { color: var(--muted); margin-top: 2.75rem; margin-left: auto; }
.shelf .section-heading { margin-top: 2.75rem; }
.stories-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem;
}
.story-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.4rem; display: flex; flex-direction: column; gap: 0.5rem;
}
.story-card:hover { border-color: var(--line-gold); }
.story-title { font-size: 1.25rem; color: var(--cream); margin-bottom: 0; }
.story-sub { color: var(--gold); font-weight: 600; font-size: 0.95rem; margin-bottom: 0; }
.story-blurb { color: var(--cream-dim); flex: 1; margin-bottom: 0.5rem; }
.story-note { color: var(--muted); font-style: italic; margin-bottom: 0; }
.story-card .btn { align-self: flex-start; }

/* ---------- Play ---------- */
.play-topbar {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding-top: 1.5rem;
}
.play-story-title { font-weight: 700; color: var(--gold); margin: 0; font-size: 1.1rem; }
.play-message { margin-top: 1rem; }

/* ---------- Sound ---------- */
.sound-bar { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; margin-top: 1rem; }
.sound-segs { display: inline-flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.sound-lbl { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; color: var(--muted); margin-right: 0.15rem; }
.seg {
  font-size: 0.85rem; font-weight: 700; cursor: pointer;
  background: var(--surface-2); color: var(--cream-dim);
  border: 1px solid var(--line); border-radius: 999px; padding: 0.38rem 0.85rem;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.seg:hover { border-color: var(--gold); color: var(--cream); }
.seg.on { background: var(--emerald); color: #f4fffa; border-color: var(--emerald); }
.music-note { font-size: 0.82rem; color: var(--muted); }
.music-note.live { color: var(--cream-dim); font-weight: 600; }
.music-note.blocked {
  background: #2b230c; border: 1px solid var(--line-gold); color: var(--gold-soft);
  border-radius: 999px; padding: 0.3rem 0.8rem; font-weight: 700; cursor: pointer;
}

.path-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-top: 1.25rem; }
.path-card {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.4rem;
}
.path-name { font-size: 1.5rem; margin-bottom: 0.15rem; }
.path-name-angel { color: var(--gold); }
.path-name-demon { color: #e0785f; }
.path-tag { color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; }
.path-list { color: var(--cream-dim); padding-left: 1.2rem; }
.path-list li { margin-bottom: 0.35rem; }

.path-banner {
  margin-top: 1.25rem; border-radius: var(--radius); padding: 0.9rem 1.2rem;
  font-weight: 700; display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap;
  border: 1px solid var(--line);
}
.path-banner-angel { background: #1d2408; border-color: var(--line-gold); color: var(--gold-soft); }
.path-banner-demon { background: #2b120d; border-color: var(--danger); color: #ffb4a3; }
.path-banner .banner-note { font-weight: 400; font-size: 0.92rem; color: var(--cream-dim); }

.play-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.5rem;
  align-items: start; margin-top: 1.25rem;
}
.scene-figure { margin: 0 0 1rem; }
.scene-figure img {
  width: 100%; max-height: 440px; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--line-gold);
  transition: opacity 0.19s ease;
}
.scene-figure img.is-fading { opacity: 0; }
.scene-caption {
  color: var(--muted); font-size: 0.86rem; font-style: italic;
  margin-top: 0.5rem; line-height: 1.45;
}
.scene-panel { margin-top: 0; }
/* A scene enters as a beat: a short rise-and-settle, never a jolt. */
.scene-panel.beat-in { animation: beat-in 0.45s ease both; }
@keyframes beat-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.scene-progress { color: var(--muted); font-size: 0.88rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.scene-name { font-size: 1.6rem; color: var(--cream); }
.scene-stakes { color: var(--gold-soft); font-weight: 600; }
.scene-text { color: var(--cream); white-space: pre-wrap; }
.scene-ask { color: var(--cream-dim); font-weight: 600; margin-bottom: 0; }

.result-panel {
  margin-top: 1.25rem; background: #0c2417; border: 1px solid var(--emerald);
  border-left: 4px solid var(--gold); border-radius: var(--radius); padding: 1.2rem 1.4rem;
}
.result-panel.is-failure { border-color: #6e3527; background: #241009; }
/* The roll reveal: the die face lands like a thrown die in a gold
   frame, the math beside it, the verdict as a chip. One beat. */
.roll-reveal { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.6rem; }
.roll-die {
  flex: none; width: 58px; height: 58px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem; font-weight: 800; color: var(--gold-soft);
  background: var(--bg-deep); border: 2px solid var(--gold); border-radius: 12px;
  transform: rotate(-3deg);
}
.result-panel.is-failure .roll-die { border-color: #cf5340; color: #ffb4a3; }
.roll-detail { display: grid; gap: 0.25rem; }
.roll-line { font-size: 1.05rem; font-weight: 800; color: var(--gold-soft); }
.result-panel.is-failure .roll-line { color: #ffb4a3; }
.roll-verdict {
  justify-self: start; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em;
  border-radius: 999px; padding: 0.18rem 0.65rem;
}
.roll-verdict.is-win { background: #0c2b1e; border: 1px solid var(--emerald); color: var(--success); }
.roll-verdict.is-loss { background: #2b120d; border: 1px solid var(--danger); color: #ff9d8a; }
.result-panel.roll-in .roll-die { animation: roll-pop 0.35s ease both; }
@keyframes roll-pop {
  0% { transform: rotate(-3deg) scale(0.6); opacity: 0; }
  60% { transform: rotate(2deg) scale(1.12); opacity: 1; }
  100% { transform: rotate(-3deg) scale(1); opacity: 1; }
}
.result-label { font-weight: 700; margin-bottom: 0.4rem; }
.result-narration { color: var(--cream); white-space: pre-wrap; }
/* Change-moments: favor shifts and tracker effects land here as a
   short list of beats, then settle into the tracker. */
.result-notes { color: var(--cream-dim); padding-left: 1.2rem; margin-bottom: 0; }
.result-notes li { margin-bottom: 0.25rem; }

.choices-panel { margin-top: 1.5rem; }
.choices-help { color: var(--muted); font-size: 0.92rem; max-width: 40rem; margin-bottom: 1rem; }
.choices { display: grid; gap: 0.75rem; margin-bottom: 1.5rem; }
.choice-btn {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  width: 100%; text-align: left; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--cream); padding: 1rem 1.2rem;
}
.choice-btn:hover:not(:disabled) { border-color: var(--emerald-hover); background: var(--surface-3); }
.choice-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.choice-label { font-weight: 700; }
.choice-meta { color: var(--gold-soft); font-size: 0.88rem; font-weight: 700; white-space: nowrap; }
.choice-writein { border-style: dashed; }
.choice-writein.is-selected { border-style: solid; border-color: var(--gold); background: var(--surface-3); }
.choice-writein.is-locked { color: var(--cream-dim); }
.choice-writein.is-locked .choice-meta { color: var(--muted); }
.writein-tag { background: var(--gold); color: #1a1405; padding: 0.12rem 0.55rem; border-radius: 999px; font-size: 0.8rem; }
.writein-note {
  border: 1px dashed var(--line-gold); border-radius: var(--radius);
  background: var(--surface-2); color: var(--cream-dim);
  padding: 1rem 1.2rem; margin-bottom: 1.5rem; line-height: 1.55;
}
.choice-continue { border-color: var(--line-gold); }
.writein-form { border-top: 1px solid var(--line); padding-top: 1.25rem; }
.writein-fair { color: var(--muted); font-size: 0.88rem; margin: 0.75rem 0 0; }
.run-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; flex-wrap: wrap; }

.ending-panel { border-color: var(--line-gold); }
.ending-key { color: var(--gold); font-weight: 700; }
.ending-text { white-space: pre-wrap; font-size: 1.05rem; }

/* ---------- Debrief: the chapter's proof of memory ---------- */
.debrief { border-top: 1px solid var(--line-gold); margin-top: 1.5rem; padding-top: 1.25rem; }
.debrief-quest { color: var(--cream-dim); font-style: italic; }
.debrief-beats { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 0.55rem; }
.debrief-beat {
  display: flex; gap: 0.7rem; align-items: flex-start;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-small); padding: 0.7rem 0.9rem;
}
.debrief-mark { font-weight: 800; flex: none; }
.debrief-beat.is-win .debrief-mark { color: var(--success); }
.debrief-beat.is-loss .debrief-mark { color: #ff9d8a; }
.debrief-outcome { color: var(--muted); font-size: 0.9rem; }
.debrief-changes { border-top: 1px solid var(--line); margin-bottom: 1rem; }
.debrief-threads { color: var(--cream-dim); padding-left: 1.2rem; }
.debrief-threads li { margin-bottom: 0.4rem; }
.debrief-note { color: var(--muted); font-size: 0.92rem; margin-bottom: 1.25rem; }

/* ---------- Tracker ---------- */
/* Subordinate by design: quieter surface, smaller type than the stage.
   The story shouts; the record speaks when spoken to. */
.tracker { margin-top: 0; position: sticky; top: 84px; background: var(--surface-2); }
.tracker-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; }
.tracker-head .sub-heading { margin-bottom: 0.2rem; font-size: 1rem; }
.tracker-sub { color: var(--muted); font-size: 0.85rem; margin: 0; }
.tracker-toggle { flex: none; }
.tracker-position {
  color: var(--gold-soft); font-weight: 700; font-size: 0.95rem;
  border-top: 1px solid var(--line); padding-top: 0.85rem; margin-top: 0.85rem;
}
.tracker-save {
  color: var(--muted); font-size: 0.85rem; line-height: 1.5;
  border-top: 1px solid var(--line); padding-top: 0.85rem; margin: 1rem 0 0;
}
.tracker-line { color: var(--cream-dim); font-size: 0.94rem; margin-bottom: 0.4rem; }
.tracker-line strong { color: var(--cream); }
.tracker-group { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1rem; }
.tracker-group-heading { color: var(--muted); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; }
.bar-row { margin-bottom: 0.85rem; }
.bar-head { display: flex; justify-content: space-between; font-size: 0.9rem; margin-bottom: 0.3rem; }
.bar-label { font-weight: 600; }
.bar-value { color: var(--cream-dim); }
.bar-track { height: 10px; background: var(--bg-deep); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--emerald), var(--emerald-hover)); border-radius: 999px; transition: width 0.3s ease; }
.meter-row { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; padding: 0.45rem 0; }
.meter-name { font-weight: 600; }
.meter-value { color: var(--cream-dim); font-size: 0.92rem; }
.band {
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.04em;
  background: var(--surface-3); border: 1px solid var(--line); color: var(--gold-soft);
  border-radius: 999px; padding: 0.15rem 0.55rem; white-space: nowrap;
}
.log-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.65rem; }
.log-item { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-small); padding: 0.65rem 0.8rem; }
.log-head { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.9rem; margin-bottom: 0.2rem; }
.log-label { font-weight: 700; }
.log-outcome { font-weight: 800; font-size: 0.78rem; letter-spacing: 0.05em; }
.log-outcome-win { color: var(--success); }
.log-outcome-loss { color: #ff9d8a; }
.log-text { color: var(--cream-dim); font-size: 0.9rem; margin: 0; white-space: pre-wrap; }

/* ---------- Admin ---------- */
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-small); padding: 1rem; }
.stat-label { color: var(--muted); font-size: 0.82rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 0.3rem; }
.stat-value { font-size: 1.3rem; font-weight: 800; color: var(--cream); margin: 0; }
.stat-sub { color: var(--cream-dim); font-size: 0.88rem; margin: 0.25rem 0 0; }
.admin-flags { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.flag {
  border-radius: 999px; padding: 0.35rem 0.8rem; font-size: 0.85rem; font-weight: 700;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--cream-dim);
}
.flag-ok { border-color: var(--emerald); color: #c9f5e3; }
.flag-bad { border-color: var(--danger); background: #2b120d; color: #ffd9d0; }
.admin-table-section { margin-top: 2rem; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.ledger-table { width: 100%; border-collapse: collapse; min-width: 880px; background: var(--surface); }
.ledger-table th, .ledger-table td { padding: 0.65rem 0.8rem; text-align: left; font-size: 0.9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.ledger-table th { color: var(--gold); background: var(--surface-2); white-space: nowrap; }
.ledger-table td { color: var(--cream-dim); overflow-wrap: anywhere; }
.ledger-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-deep); padding: 2rem 0 2.5rem; }
.footer-inner { display: grid; gap: 0.4rem; }
.footer-brand { display: flex; align-items: center; gap: 0.55rem; font-weight: 800; font-size: 1.05rem; }
.footer-brand .brand-mark { width: 32px; height: 32px; }
.footer-line { margin: 0; color: var(--cream-dim); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; padding-top: 2rem; padding-bottom: 2rem; }
  .play-layout { grid-template-columns: 1fr; }
  .tracker { position: static; }
  .path-grid { grid-template-columns: 1fr; }
  .shelf-sub { margin: 0; }
  .account-area { margin-left: 0; }
  .choice-btn { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bar-fill { transition: none; }
  .scene-figure img { transition: none; }
  .scene-panel.beat-in, .result-panel.roll-in .roll-die { animation: none; }
}

/* ================= 2.0 port components ================= */

/* Three gold dots — the loading indicator at every wait */
.dots { display: inline-flex; gap: 5px; align-items: center; vertical-align: middle; margin-right: 8px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: #c9a227; display: block; animation: ggm-rise 1.05s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: 0.18s; }
.dots i:nth-child(3) { animation-delay: 0.36s; }
@keyframes ggm-rise {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* Shelf: flagship + continue watching */
.flagship-row { grid-column: 1 / -1; }
.story-card-flagship { border-color: var(--line-gold, #c9a227); background: linear-gradient(160deg, rgba(201,162,39,0.12), transparent 55%); }
.flagship-tag { color: #c9a227; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.78rem; margin: 0 0 0.4rem; }
.survival-tag { color: #d98a4b; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.75rem; margin: 0 0 0.4rem; }
.story-genre { color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; margin: 0.2rem 0; }
.story-tone { color: var(--muted); font-style: italic; font-size: 0.9rem; }
.continue-section { margin: 2rem 0 0; }
.continue-row { display: flex; gap: 0.75rem; overflow-x: auto; padding-bottom: 0.5rem; }
.continue-card { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem; padding: 0.8rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2, #0d231a); color: inherit; cursor: pointer; text-align: left; }
.continue-card:hover { border-color: var(--line-gold, #c9a227); }
.continue-title { font-weight: 600; }
.continue-meta { color: var(--muted); font-size: 0.82rem; }

/* Reader: scene stream */
.path-banner { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin: 0.5rem 0 1rem; }
.path-chip { padding: 0.25rem 0.7rem; border-radius: 999px; font-size: 0.82rem; border: 1px solid var(--line-gold, #c9a227); color: #f2e7c3; }
.path-chip-demon { border-color: #a33; color: #f3c1c1; }
.banner-meta { color: var(--muted); font-size: 0.88rem; }
.scene-stream { display: grid; gap: 1.1rem; }
.scene { border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem 1.2rem; background: var(--surface-2, #0d231a); }
.scene-past { opacity: 0.72; }
.scene-current { border-color: var(--line-gold, #c9a227); }
.scene-memory { border-style: dashed; }
.scene-flag { color: #c9a227; font-size: 0.85rem; letter-spacing: 0.04em; margin: 0 0 0.6rem; }
.scene-flag-revival { color: #9fd6a8; }
.scene-day { color: #d98a4b; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.8rem; margin: 0 0 0.5rem; }
.scene-para { line-height: 1.7; margin: 0 0 0.8rem; }
.scene-para:last-of-type { margin-bottom: 0; }
.scene-chosen { margin: 0.8rem 0 0; color: var(--muted); font-size: 0.92rem; border-top: 1px dashed var(--line); padding-top: 0.6rem; }
.scene-cliff { margin: 0.8rem 0 0; font-style: italic; color: #f2e7c3; }
.scene-figure { margin: 0 0 1rem; }
.scene-figure img { max-width: 100%; border-radius: 8px; display: block; }
.recap-card { border-color: var(--line-gold, #c9a227); }
a.term { color: #c9a227; text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; }

/* Narration dock — lives at the top of the current scene (the client
   moves it into the scene article on every render); the parked spot
   below the stream is only its pre-session home. */
.narr-dock { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 1.4rem 0 0; padding: 0.7rem 0.9rem; border: 1px solid var(--line-gold, #c9a227); border-radius: 10px; background: rgba(201,162,39,0.06); }
.scene .narr-dock { margin: 0 0 1rem; }
.narr-status { color: var(--muted); font-size: 0.88rem; }
.narr-unsupported { color: var(--muted); font-size: 0.88rem; font-style: italic; }

/* Jewel markers + read-along highlight (narration discoverability,
   Oct 29 2026): every paragraph carries a small gold jewel — tap it
   and narration starts at that paragraph. The paragraph currently
   being read wears a subtle gold wash with an inset gold edge. */
.para-jewel { background: none; border: none; padding: 0 0.1rem; margin-right: 0.35rem; color: #c9a227; font-size: 0.72em; line-height: 1; vertical-align: 0.18em; cursor: pointer; opacity: 0.55; }
.para-jewel:hover, .para-jewel:focus-visible { opacity: 1; }
.scene-para.para-reading { background: rgba(201,162,39,0.10); box-shadow: inset 3px 0 0 #c9a227; border-radius: 4px; }

/* Floating narration button — fixed bottom-LEFT, the mirror of the
   Kubera button (bottom-right): narration is findable from anywhere
   in the story, including the middle a returning reader lands in. */
.narr-float-btn { position: fixed; left: 18px; bottom: 18px; z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 2px; background: #0d231a; border: 2px solid #c9a227; border-radius: 50%; width: 76px; height: 76px; padding: 8px 0 6px; cursor: pointer; }
.narr-float-btn[hidden] { display: none; }
.narr-float-btn:disabled { opacity: 0.55; cursor: default; }
.narr-float-jewel { color: #c9a227; font-size: 1.35rem; line-height: 1.1; }
.narr-float-label { color: #f2e7c3; font-size: 0.6rem; letter-spacing: 0.04em; }
.narr-float-btn.is-playing { box-shadow: 0 0 0 3px rgba(201,162,39,0.35); }

/* Resume prompt — floats above the narration button (bottom-left,
   mirroring the Kubera panel on the right) when the reader returns
   to a narration that auto-paused on hide. */
.narr-resume-prompt { position: fixed; left: 18px; bottom: 106px; z-index: 62; width: min(360px, calc(100vw - 36px)); background: #0a1f16; border: 1px solid #c9a227; border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,0.55); padding: 0.9rem 1rem; }
.narr-resume-prompt[hidden] { display: none; }
.narr-resume-text { margin: 0 1.2rem 0.7rem 0; color: #f2e7c3; }
.narr-resume-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.narr-resume-close { position: absolute; top: 0.35rem; right: 0.6rem; background: none; border: none; color: inherit; font-size: 1.25rem; line-height: 1; cursor: pointer; }
.narr-select { background: var(--surface-2, #0d231a); color: inherit; border: 1px solid var(--line); border-radius: 6px; padding: 0.3rem 0.4rem; max-width: 170px; }

/* Choices busy state */
.choices-busy { color: #f2e7c3; margin: 0.4rem 0 0.8rem; }
.wait-note { display: block; color: var(--gold, #c9a227); font-size: 0.88rem; margin-top: 0.3rem; }
.choice-hint { display: block; color: var(--muted); font-size: 0.86rem; margin-top: 0.25rem; }
.play-loading { color: #f2e7c3; padding: 1rem 0; }

/* Ending */
.ending-big { font-size: 1.35rem; color: #f2e7c3; }
.ending-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1rem; }

/* Tracker: survival */
.survival-day { font-size: 1.6rem; font-weight: 700; color: #f2e7c3; margin: 0; }
.survival-pressure { color: #d98a4b; margin: 0.15rem 0; letter-spacing: 0.04em; }
.survival-meta { color: var(--muted); font-size: 0.88rem; margin: 0.15rem 0; }
.rel-line { margin: 0.3rem 0; font-size: 0.94rem; }

/* Dashboard stat tiles */
.stat-tile { border: 1px solid var(--line); border-radius: 10px; padding: 0.8rem 1rem; background: var(--surface-2, #0d231a); }
.stat-value { font-size: 1.3rem; font-weight: 700; margin: 0; color: #f2e7c3; }
.stat-label { color: var(--muted); font-size: 0.82rem; margin: 0.2rem 0 0; text-transform: uppercase; letter-spacing: 0.06em; }
.badge-sub { background: #c9a227; color: #1a1405; border-radius: 999px; padding: 0.1rem 0.6rem; font-size: 0.78rem; font-weight: 700; }

/* Kubera */
.kubera-btn { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 2px; background: #0d231a; border: 2px solid #c9a227; border-radius: 50%; width: 76px; height: 76px; padding: 8px 0 6px; cursor: pointer; animation: ggm-bob 3.2s ease-in-out infinite; }
.kubera-btn img { border-radius: 50%; }
.kubera-btn-label { color: #f2e7c3; font-size: 0.6rem; letter-spacing: 0.04em; }
@keyframes ggm-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.kubera-panel { position: fixed; right: 18px; bottom: 106px; z-index: 61; width: min(360px, calc(100vw - 36px)); max-height: 70vh; display: flex; flex-direction: column; background: #0a1f16; border: 1px solid #c9a227; border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,0.55); }
.kubera-head { display: flex; align-items: center; gap: 0.6rem; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line); }
.kubera-head img { border-radius: 50%; }
.kubera-name { margin: 0; font-weight: 700; color: #f2e7c3; }
.kubera-sub { margin: 0; color: var(--muted); font-size: 0.78rem; }
.kubera-close { margin-left: auto; background: none; border: none; color: inherit; font-size: 1.3rem; cursor: pointer; }
.kubera-messages { overflow-y: auto; padding: 0.8rem 0.9rem; display: grid; gap: 0.7rem; }
.kmsg { display: flex; gap: 0.5rem; align-items: flex-start; }
.kmsg p { margin: 0; line-height: 1.55; font-size: 0.94rem; }
.kmsg-you { justify-content: flex-end; }
.kmsg-you .kmsg-body { background: rgba(201,162,39,0.14); border-radius: 10px; padding: 0.5rem 0.7rem; }
.kmsg-kubera .kmsg-body { background: rgba(255,255,255,0.04); border-radius: 10px; padding: 0.5rem 0.7rem; }
.kmsg-badge { border-radius: 50%; flex: none; margin-top: 2px; }
.kubera-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0 0.9rem 0.6rem; }
.chip { border: 1px solid var(--line-gold, #c9a227); background: none; color: #f2e7c3; border-radius: 999px; padding: 0.3rem 0.7rem; font-size: 0.8rem; cursor: pointer; }
.chip:hover { background: rgba(201,162,39,0.15); }
.kubera-form { display: flex; gap: 0.5rem; padding: 0.7rem 0.9rem; border-top: 1px solid var(--line); }
.kubera-form input { flex: 1; background: var(--surface-2, #0d231a); border: 1px solid var(--line); border-radius: 8px; color: inherit; padding: 0.5rem 0.6rem; }

/* Define card */
.define-card { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 62; width: min(480px, calc(100vw - 36px)); background: #0a1f16; border: 1px solid #c9a227; border-radius: 12px; padding: 1rem 1.1rem; box-shadow: 0 18px 50px rgba(0,0,0,0.55); }
.define-close { position: absolute; top: 6px; right: 10px; background: none; border: none; color: inherit; font-size: 1.3rem; cursor: pointer; }
.define-term { margin: 0 0 0.4rem; color: #c9a227; }
.define-text { margin: 0; line-height: 1.6; }
.define-source { margin: 0.5rem 0 0; color: var(--muted); font-size: 0.82rem; font-style: italic; }

/* Share modal */
.share-modal { position: fixed; inset: 0; z-index: 63; background: rgba(0,0,0,0.66); display: flex; align-items: center; justify-content: center; padding: 18px; }
.share-box { max-width: 640px; width: 100%; }
.share-box canvas { width: 100%; height: auto; border-radius: 8px; display: block; }
.share-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.8rem; }
.share-note { color: var(--muted); font-size: 0.9rem; }

.footer-legal a { color: #c9a227; }
#define-toggle.is-on { border-color: #c9a227; color: #f2e7c3; }
