/* style.css — generated — do not edit directly */
/* Edit files in src/css/ instead */

/* style.css — Alea v0.97.2 */
/* All styling — extracted from rpg-mockup.html */
/* rem base: 16px (browser default). All font-size, padding, margin, gap use rem for accessibility. */

:root {
  color-scheme: dark;
  --bg: #0d0b0a;
  --surface: #131110;
  --surface2: #1c1916;
  --border: #2e2820;
  --border-bright: #4a3e30;
  --gold: #c9a84c;
  --gold-dim: #7a6230;
  --gold-bright: #e8c96a;
  --text: #d4c9b8;
  --text-dim: #8a7e70;
  --text-muted: #6a5f54;
  --red: #8b3a3a;
  --red-bright: #c05050;
  --green: #3a6b4a;
  --green-bright: #5a9b6a;
  --blue: #3a5a8b;
  --soul: #7a4a8b;
  --soul-bright: #a87abf;
  --success: #c9a84c;
  --panel-w: 300px;
}

/* --- Achievement UI Themes --- */
[data-theme="aurum"] {
  --bg: #0e0b07; --surface: #15110a; --surface2: #1e1810;
  --gold: #dab44c; --gold-dim: #8a6a28; --gold-bright: #f0d87a;
  --border-bright: #5a4828;
  --aurum-rose: #d4956a; --aurum-champagne: #f5e6b8; --aurum-amber: #e8a832;
}

/* --- Aurum shimmer effects --- */
@keyframes aurum-shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes aurum-border-shift {
  0%   { border-color: var(--gold-dim); }
  33%  { border-color: var(--aurum-amber); }
  66%  { border-color: var(--aurum-rose); }
  100% { border-color: var(--gold-dim); }
}

@keyframes aurum-glow-pulse {
  0%, 100% { box-shadow: 0 0 4px rgba(218, 180, 76, 0.08); }
  50%      { box-shadow: 0 0 12px rgba(218, 180, 76, 0.18), 0 0 4px rgba(212, 149, 106, 0.1); }
}

/* Game title — prismatic gradient text */
[data-theme="aurum"] .game-title {
  background: linear-gradient(
    105deg,
    var(--gold) 0%,
    var(--aurum-champagne) 25%,
    var(--aurum-amber) 45%,
    var(--aurum-rose) 65%,
    var(--gold-bright) 85%,
    var(--gold) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: aurum-shimmer 8s linear infinite;
}

/* Submit / Advance buttons — warm shifting border + glow */
[data-theme="aurum"] .submit-btn,
[data-theme="aurum"] .advance-btn {
  border-image: linear-gradient(
    135deg,
    var(--gold-dim),
    var(--aurum-amber),
    var(--aurum-rose),
    var(--gold-dim)
  ) 1;
  animation: aurum-glow-pulse 4s ease-in-out infinite;
}
[data-theme="aurum"] .submit-btn:hover,
[data-theme="aurum"] .advance-btn:hover {
  border-image: linear-gradient(
    135deg,
    var(--gold),
    var(--aurum-champagne),
    var(--aurum-rose),
    var(--gold)
  ) 1;
  box-shadow: 0 0 16px rgba(218, 180, 76, 0.25), 0 0 6px rgba(212, 149, 106, 0.15);
  animation: none;
}

/* Challenge prompt dot — warm amber glow */
[data-theme="aurum"] .challenge-prompt::before {
  background: var(--aurum-amber);
  box-shadow: 0 0 6px rgba(232, 168, 50, 0.5);
}

/* Challenge prompt text — enriched warm gold */
[data-theme="aurum"] .challenge-prompt {
  color: var(--aurum-champagne);
}

/* Cinzel Decorative headings — prismatic shimmer on panel titles */
[data-theme="aurum"] .score-latin,
[data-theme="aurum"] .changelog-title,
[data-theme="aurum"] .fortune-outcome.fortune-triumph {
  background: linear-gradient(
    105deg,
    var(--gold) 0%,
    var(--aurum-champagne) 40%,
    var(--aurum-amber) 70%,
    var(--gold) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: aurum-shimmer 6s linear infinite;
}

/* Toast notifications — gradient border top */
[data-theme="aurum"] .toast {
  border-top: 2px solid transparent;
  border-image: linear-gradient(90deg, var(--gold-dim), var(--aurum-amber), var(--aurum-rose), var(--gold-dim)) 1;
}

/* Scene narration emphasis — warm rose-gold tint */
[data-theme="aurum"] .scene-narration em {
  color: var(--aurum-champagne);
}

/* Fortune die — subtle warm glow */
[data-theme="aurum"] .fortune-die {
  box-shadow: 0 0 4px rgba(218, 180, 76, 0.12);
}

/* Verdict triumph block — enriched gold gradient left border */
[data-theme="aurum"] .verdict--triumph {
  border-image: linear-gradient(180deg, var(--gold), var(--aurum-amber), var(--aurum-rose)) 1;
}

/* Icon buttons — warm border shift on hover */
[data-theme="aurum"] .icon-btn:hover {
  border-color: var(--aurum-amber);
  box-shadow: 0 0 6px rgba(232, 168, 50, 0.15);
}

/* Stat pills — subtle warm accent */
[data-theme="aurum"] .stat-pill .val {
  color: var(--aurum-champagne);
}

/* Achievement badges — prismatic text */
[data-theme="aurum"] .achievement-badge {
  background: linear-gradient(
    105deg,
    var(--gold) 0%,
    var(--aurum-champagne) 35%,
    var(--aurum-amber) 65%,
    var(--gold) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: aurum-shimmer 7s linear infinite;
}

/* Player response border — gradient accent */
[data-theme="aurum"] .player-response-record {
  border-image: linear-gradient(180deg, var(--gold-dim), var(--aurum-amber), var(--aurum-rose)) 1;
}

/* Topbar bottom border — subtle gradient */
[data-theme="aurum"] .topbar {
  border-image: linear-gradient(90deg, transparent, var(--gold-dim), var(--aurum-amber), var(--gold-dim), transparent) 1;
}

/* Lore note — warm glow border */
[data-theme="aurum"] .lore-note {
  border-color: var(--aurum-amber);
  box-shadow: 0 0 8px rgba(232, 168, 50, 0.08);
}

[data-theme="umbra"] {
  --bg: #080a0d; --surface: #0e1115; --surface2: #151a20;
  --gold: #8a9aac; --gold-dim: #506070; --gold-bright: #a8b8cc;
  --text: #b8c4d0; --text-dim: #6a7888;
  --border: #222830; --border-bright: #3a4858;
}
[data-theme="sanguis"] {
  --bg: #0d0808; --surface: #150e0e; --surface2: #1e1414;
  --gold: #c05050; --gold-dim: #6a2828; --gold-bright: #e06868;
  --text: #d4bab8; --border-bright: #4a2828;
}
[data-theme="caelum"] {
  --bg: #08090d; --surface: #0e1015; --surface2: #14181e;
  --gold: #6a8ac4; --gold-dim: #3a5080; --gold-bright: #8aaade;
  --text: #bcc8d8; --text-dim: #6a7888; --border-bright: #2a3a58;
}

/* --- Achievement badges --- */
.achievement-badge {
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: 0.75rem;
  color: var(--gold);
  padding: 2px 0;
}
.achievement-english {
  font-family: 'Crimson Pro', serif;
  font-size: 0.7rem;
  color: var(--text-dim);
}

.achievement-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6875rem;
  color: var(--text-dim);
  margin-left: 0.35rem;
  opacity: 0.7;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1.375rem;
  line-height: 1.7;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* HIDDEN UTILITY */
.hidden { display: none !important; }

/* APP CONTENT CONTAINER */
#app-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

/* TOP BAR */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  gap: 0.75rem;
  position: relative;
  z-index: 10;
}

.game-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.5rem;
  color: var(--gold);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  white-space: nowrap;
}

.topbar-pills {
  display: flex;
  gap: 0.375rem;
  align-items: center;
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1875rem 0.625rem;
  background: var(--surface2);
}

.stat-pill .label { color: var(--gold-dim); text-transform: uppercase; letter-spacing: 0.1em; }
.stat-pill .val { color: var(--gold-bright); font-weight: 400; }

#topbar-world, #topbar-difficulty { display: contents; }
.world-pill {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  color: var(--text-dim);
  padding: 0.1875rem 0.625rem;
  border-radius: 4px;
  background: var(--surface2);
  white-space: nowrap;
  position: relative;
}
.world-pill .wp-text {
  display: inline-block;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  color: var(--gold-bright);
}
.world-pill .wp-label { color: var(--gold-dim); text-transform: uppercase; letter-spacing: 0.1em; }
.world-pill-beat { border-left: 2px solid var(--gold-dim); }
.world-pill-doom { border-left: 2px solid #c44; }
.world-pill-diff { cursor: pointer; }

.topbar-actions {
  display: flex;
  gap: 0.5rem;
}

.icon-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.125rem;
  line-height: 1;
  transition: all 0.2s;
}
.icon-btn:hover { border-color: var(--gold-dim); color: var(--gold); }
.icon-btn.muted { opacity: 0.4; }

/* MAIN LAYOUT */
.main {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* NARRATIVE COLUMN */
.narrative-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  position: relative;
}

/* Ambient wallpaper — slow Ken Burns drift */
.narrative-col::before {
  content: '';
  position: absolute;
  inset: -5%;
  background: url('wallpaper.png') center/cover no-repeat;
  opacity: 0.1;
  filter: blur(1px) saturate(0.6);
  animation: ambientDrift 120s ease-in-out infinite;
  z-index: 0;
  pointer-events: none;
}

@keyframes ambientDrift {
  0%, 100% { transform: scale(1.05) translate(0, 0); }
  33% { transform: scale(1.08) translate(-1%, -0.5%); }
  66% { transform: scale(1.06) translate(0.5%, -0.8%); }
}

.narrative-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 2.5rem 1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  position: relative;
  z-index: 2;
  box-shadow: inset 0 0 120px 40px rgba(13,11,10,0.5);
}

.narrative-scroll::-webkit-scrollbar { width: 4px; }
.narrative-scroll::-webkit-scrollbar-track { background: transparent; }
.narrative-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* AMBIENT PARTICLES — floating embers */
.ambient-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.ambient-particle {
  position: absolute;
  bottom: -10px;
  width: var(--size, 3px);
  height: var(--size, 3px);
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold) 0%, transparent 70%);
  opacity: 0;
  pointer-events: none;
  animation: particleFloat var(--dur, 18s) var(--delay, 0s) infinite;
}

@keyframes particleFloat {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  8% { opacity: 0.3; }
  50% { transform: translateY(-50vh) translateX(var(--drift, 12px)); }
  92% { opacity: 0.15; }
  100% { transform: translateY(-110vh) translateX(var(--drift-end, -8px)); opacity: 0; }
}

.scene {
  position: relative;
  z-index: 1;
  margin-bottom: 2.25rem;
  padding-bottom: 2.25rem;
  border-bottom: 1px solid var(--border);
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes sceneFlash { 0% { border-left-color: var(--gold); } 100% { border-left-color: transparent; } }
.scene-highlight { border-left: 3px solid var(--gold); padding-left: 0.75rem; animation: sceneFlash 1.5s ease-out forwards; }

.scene-narration {
  font-size: 1.375rem;
  line-height: 1.8;
  color: var(--text);
  font-style: italic;
  margin-bottom: 1.25rem;
}

.scene-narration em { font-style: normal; color: var(--gold); }
.scene-narration em.thought { color: var(--gold-dim); }

.scene-narration blockquote {
  margin: 0.75rem 0;
  padding: 0.625rem 1rem;
  border-left: 3px solid var(--gold-dim);
  background: var(--surface);
  font-style: normal;
  font-family: 'Crimson Pro', serif;
  color: var(--text-dim);
  font-size: 1.25rem;
}
.scene-narration blockquote p { margin: 0; }
.scene-narration blockquote em { font-style: italic; color: var(--gold-dim); }

.scene-narration.typewriter-active > p:last-child::after {
  content: '\2595';
  animation: blink-cursor 0.6s step-end infinite;
  color: var(--gold);
}

@keyframes blink-cursor {
  50% { opacity: 0; }
}

.score-breakdown {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

.score-headline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  cursor: pointer;
}

.score-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}

.score-breakdown.expanded .score-detail {
  max-height: 300px;
  opacity: 1;
}

.score-expand-label {
  font-family: 'Cinzel Decorative', serif;
  font-size: 0.75rem;
  color: var(--gold-dim);
  letter-spacing: 0.06em;
  transition: color 0.2s;
  cursor: pointer;
}

.score-expand-label::before {
  content: '\25B8';
  display: inline-block;
  margin-right: 0.25rem;
  font-size: 0.6875rem;
  transition: transform 0.2s ease;
}

.score-breakdown.expanded .score-expand-label::before {
  transform: rotate(90deg);
}

.score-expand-label:hover {
  color: var(--gold-dim);
}

.score-total {
  font-size: 0.9375rem;
  font-weight: 400;
  padding: 0.1875rem 0.625rem;
  border-radius: 4px;
  border: 1px solid;
}

.score-total.success { color: var(--green-bright); border-color: var(--green); background: rgba(58,107,74,0.1); }
.score-total.minor { color: var(--gold); border-color: var(--gold-dim); background: rgba(201,168,76,0.1); }
.score-total.failure { color: var(--red-bright); border-color: var(--red); background: rgba(139,58,58,0.1); }
.score-total.critical-success { color: var(--green-bright); border-color: var(--green); background: rgba(58,107,74,0.15); }
.score-total.critical-failure { color: var(--red-bright); border-color: var(--red); background: rgba(139,58,58,0.15); }

.score-components { color: var(--text-muted); }
.score-rescue { font-family: 'Crimson Pro', Georgia, serif; font-style: italic; font-size: 0.8125rem; color: var(--gold-dim); margin-top: 0.25rem; width: 100%; }
.score-rescue .score-latin { font-family: 'Cinzel Decorative', serif; font-size: 0.75rem; color: var(--gold); }
.score-reasoning { color: var(--text-muted); font-size: 0.8125rem; font-style: italic; margin-top: 0.25rem; width: 100%; }

.score-bonus-breakdown {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.375rem 0.625rem;
  background: var(--surface2);
  border-radius: 4px;
  border: 1px solid var(--border);
}
.bonus-line { display: flex; gap: 0; font-size: 0.75rem; color: var(--text-dim); }
.bonus-val { min-width: 2.5em; text-align: right; }
.bonus-sep { color: var(--border-bright); margin: 0 0.375rem; }
.bonus-label { color: var(--text-muted); }
.bonus-val { color: var(--gold); }
.bonus-earned { font-size: 0.8125rem; color: var(--green-bright); margin-top: 0.25rem; }
.bonus-missed { font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.125rem; font-style: italic; }

/* LATIN SCORE LABELS */
.score-latin { font-family: 'Cinzel Decorative', serif; font-size: 0.75rem; color: var(--gold); letter-spacing: 0.03em; }
.score-latin-sm { font-family: 'Cinzel Decorative', serif; font-size: 0.8125rem; color: var(--gold-dim); letter-spacing: 0.03em; }
.score-english-sm { font-size: 0.75rem; color: var(--text-muted); font-style: normal; }
.score-threshold-latin { font-family: 'Cinzel Decorative', serif; letter-spacing: 0.05em; }
.score-threshold-english { font-family: 'Crimson Pro', Georgia, serif; font-size: 0.8125rem; color: var(--text-muted); font-style: italic; }
/* English-primary mode labels (when latinLabels is off) */
.score-english-primary { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: var(--gold); letter-spacing: 0.03em; }
.score-latin-sub { font-family: 'Cinzel Decorative', serif; font-size: 0.75rem; color: var(--text-muted); letter-spacing: 0.03em; margin-left: 0.125rem; }
.score-threshold-english-primary { font-family: 'Crimson Pro', Georgia, serif; font-size: inherit; color: inherit; }
.score-threshold-latin-sub { font-family: 'Cinzel Decorative', serif; font-size: 0.8125rem; color: var(--text-muted); letter-spacing: 0.05em; margin-left: 0.25rem; }
.score-separator { color: var(--text-muted); }

/* --- Fortune Roll Display --- */
.fortune-roll {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

.fortune-headline {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.fortune-outcome {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1rem;
  font-weight: 400;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  border: 1px solid;
  display: inline-block;
  letter-spacing: 0.05em;
}

.fortune-outcome.fortune-triumph { color: var(--gold); border-color: var(--gold-dim); background: rgba(201,168,76,0.15); }
.fortune-outcome.fortune-mixed { color: var(--text-muted); border-color: var(--border-bright); background: rgba(180,180,180,0.08); }
.fortune-outcome.fortune-setback { color: var(--red-bright); border-color: var(--red); background: rgba(139,58,58,0.12); }

.fortune-dice-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.8125rem;
}

.fortune-die {
  display: inline-block;
  background: var(--surface2);
  border: 1px solid var(--border-bright);
  border-radius: 4px;
  padding: 0.125rem 0.375rem;
  font-weight: 600;
  color: var(--gold);
  min-width: 1.5em;
  text-align: center;
}

.fortune-die-beaten {
  border-color: var(--green);
  color: var(--green-bright);
  background: rgba(58, 107, 74, 0.15);
}

.fortune-die-unbeaten {
  border-color: var(--red);
  color: var(--red-bright);
  background: rgba(139, 58, 58, 0.15);
}

.fortune-die-perfect {
  border-color: #aa4444;
  color: #aa4444;
  background: rgba(170, 68, 68, 0.1);
}

.fortune-die-rolling {
  animation: dieShake 0.12s ease-in-out infinite;
  border-color: var(--gold-dim);
}

.fortune-die-settled {
  animation: dieSettle 0.3s ease-out forwards;
}

@keyframes dieShake {
  0%   { transform: translateY(-2px) rotate(-3deg); }
  50%  { transform: translateY(2px) rotate(3deg); }
  100% { transform: translateY(-2px) rotate(-3deg); }
}

@keyframes dieSettle {
  0%   { transform: scale(1.15); }
  60%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}

.fortune-vs {
  color: var(--text-dim);
  font-style: italic;
}

.fortune-action strong {
  color: var(--gold);
}

.fortune-twist {
  font-family: 'Crimson Pro', Georgia, serif;
  font-style: italic;
  font-size: 0.8125rem;
  color: var(--gold-dim);
  padding: 0.25rem 0;
}

.fortune-modifiers {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.fortune-mod-item {
  display: inline-block;
  margin-right: 0.5rem;
  padding: 0.0625rem 0.25rem;
  background: var(--surface2);
  border-radius: 3px;
}

.fortune-mod-mismatch {
  color: var(--gold-dim);
  font-style: italic;
}

.mismatch-note {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.8125rem;
  font-style: italic;
  color: var(--gold-dim);
  padding: 0.25rem 0;
}

.fortune-legacy {
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.player-response-record {
  background: var(--surface2);
  border-left: 2px solid var(--gold-dim);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 1.25rem;
  color: var(--text-dim);
  border-radius: 0 4px 4px 0;
}

.player-response-record .stat-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  color: var(--gold-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
}

/* BOON/BANE PROPOSAL */
.proposal-card {
  border: 1px solid var(--gold-dim);
  background: rgba(201,168,76,0.05);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  animation: fadeIn 0.3s ease;
}

.proposal-card.bane {
  border-color: var(--red);
  background: rgba(139,58,58,0.05);
}

.proposal-title {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--gold);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.proposal-card.bane .proposal-title { color: var(--red-bright); }

.proposal-desc { font-size: 1.1875rem; color: var(--text-dim); margin-bottom: 0.75rem; }

.proposal-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.btn {
  padding: 0.375rem 1rem;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  border: 1px solid;
  transition: all 0.2s;
}

.btn-accept { background: rgba(201,168,76,0.1); border-color: var(--gold-dim); color: var(--gold); }
.btn-accept:hover { background: rgba(201,168,76,0.2); }
.btn-alt { background: var(--surface2); border-color: var(--border-bright); color: var(--text-dim); }
.btn-alt:hover { border-color: var(--text-dim); color: var(--text); }
.btn-alt:disabled { opacity: 0.4; cursor: not-allowed; }

.proposal-purge-list {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.proposal-purge-label {
  font-size: 0.8125rem;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.btn-purge-pick {
  padding: 0.375rem 1rem;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  cursor: pointer;
  border: 1px solid var(--red-dim, var(--border-bright));
  background: rgba(139,58,58,0.08);
  color: var(--text);
  text-align: left;
  transition: all 0.2s;
}

.btn-purge-pick:hover { background: rgba(139,58,58,0.2); border-color: var(--red, #8b3a3a); }

/* ACTION PROMPT + INPUT */
.action-zone {
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.challenge-prompt {
  padding: 0.875rem 2.5rem 0;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.challenge-prompt::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
  animation: pulse 2s infinite;
}

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

.input-row {
  display: flex;
  align-items: flex-end;
  gap: 0.625rem;
  padding: 0.625rem 2.5rem 0.875rem;
}

.input-controls-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 2.5rem 0;
}

.input-textarea-row {
  padding: 0.5rem 2.5rem 0.375rem;
}

.stat-select {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  padding: 0.5rem 0.625rem;
  border-radius: 4px;
  cursor: pointer;
  outline: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex-shrink: 0;
  transition: border-color 0.2s;
  appearance: none;
  min-width: 160px;
}
.stat-select:focus { border-color: var(--gold-dim); }

.response-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1.3125rem;
  line-height: 1.5;
  padding: 0.625rem 0.875rem;
  border-radius: 4px;
  resize: none;
  outline: none;
  min-height: 80px;
  max-height: 180px;
  transition: border-color 0.2s;
}

.response-input::placeholder { color: var(--text-muted); font-style: italic; }
.response-input:focus { border-color: var(--gold-dim); }

.submit-btn {
  background: var(--surface2);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  padding: 0.625rem 1.125rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Cinzel Decorative', serif;
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  flex-shrink: 0;
  transition: all 0.2s;
  align-self: flex-end;
}
.submit-btn:hover { background: rgba(201,168,76,0.1); border-color: var(--gold-bright); }
.submit-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.clarify-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.0625rem;
  background: var(--surface2);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  padding: 0.375rem 0.875rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.6875rem;
  transition: border-color 0.2s, background 0.2s;
  animation: clarify-pulse 2.5s ease-in-out infinite;
}
.clarify-btn:hover { background: rgba(201,168,76,0.1); border-color: var(--gold-bright); animation: none; }
.clarify-latin { font-family: 'Cinzel Decorative', serif; font-size: 0.75rem; font-weight: 700; line-height: 1.2; }
.clarify-english { font-size: 0.6875rem; color: var(--text-muted); line-height: 1.2; }
.clarify-wrapper { position: relative; display: inline-flex; }
.clarify-dismiss {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.6875rem;
  line-height: 0.875rem;
  text-align: center;
  padding: 0;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s, color 0.2s, border-color 0.2s;
}
.clarify-dismiss:hover { opacity: 1; color: var(--gold); border-color: var(--gold-dim); }

/* ADVANCE BUTTON */
.advance-btn {
  background: var(--surface2);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  padding: 0.625rem 1.125rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Cinzel Decorative', serif;
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  flex-shrink: 0;
  transition: border-color 0.2s, background 0.2s;
  animation: clarify-pulse 2.5s ease-in-out infinite;
}
.advance-btn:hover { background: rgba(201,168,76,0.1); border-color: var(--gold-bright); animation: none; }

/* QUESTION BUTTON */
.question-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Cinzel Decorative', serif;
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.question-btn:hover { background: rgba(201,168,76,0.08); border-color: var(--gold-dim); color: var(--gold); }

/* ENHANCE BUTTON */
.enhance-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 0.625rem 0.875rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Cinzel Decorative', serif;
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  flex-shrink: 0;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  align-self: flex-end;
}
.enhance-btn:hover:not(:disabled) { background: rgba(201,168,76,0.08); border-color: var(--gold-dim); color: var(--gold); }
.enhance-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.enhance-undo {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s;
}
.enhance-undo:hover { color: var(--gold); }
@keyframes clarify-pulse {
  0%, 100% { border-color: var(--gold-dim); }
  50% { border-color: var(--gold); }
}

.version-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
  padding: 0 2.5rem 0.375rem;
  letter-spacing: 0.08em;
}
.version-tag .version-link {
  cursor: pointer;
  transition: color 0.2s;
}
.version-tag .version-link:hover { color: var(--gold-dim); }
.version-tag .footer-note { color: var(--text-muted); border-bottom: 1px dotted transparent; transition: color 0.2s, border-color 0.2s; }
.version-tag .footer-note:hover { color: var(--gold-dim); border-bottom-color: var(--gold-dim); }

/* CHANGELOG FLYOUT */
.changelog-flyout {
  position: absolute;
  bottom: 100%;
  right: 20px;
  width: 360px;
  max-height: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border-bright);
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
  opacity: 0;
  transform: translateY(8px);
  transition: max-height 0.3s ease, opacity 0.2s ease, transform 0.2s ease;
  z-index: 80;
  pointer-events: none;
}
.changelog-flyout.open {
  max-height: 420px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.changelog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem 0.5rem;
  border-bottom: 1px solid var(--border);
}
.changelog-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 0.9375rem;
  color: var(--gold);
  letter-spacing: 0.08em;
}
.changelog-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
}
.changelog-close:hover { color: var(--text-dim); }
.changelog-body {
  overflow-y: auto;
  max-height: 360px;
  padding: 0.75rem 1rem 1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.changelog-entry { margin-bottom: 1rem; }
.changelog-entry:last-child { margin-bottom: 0; }
.changelog-version {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--gold);
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}
.changelog-entry-title {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.8125rem;
  color: var(--text-dim);
  font-style: italic;
  font-weight: normal;
  letter-spacing: 0;
}
.changelog-list {
  margin: 0;
  padding-left: 1rem;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.9375rem;
  color: var(--text-dim);
  line-height: 1.5;
}
.changelog-list li { margin-bottom: 0.125rem; }
.changelog-list li::marker { color: var(--border-bright); }

/* Panel/form layout utilities */
.section-title-row { display: flex; justify-content: space-between; align-items: center; padding-bottom: 0; }
.section-title-row .panel-section-title { margin: 0; }
.form-edit-stack { margin-bottom: 0.5rem; }
.form-actions { display: flex; gap: 0.5rem; }
.form-actions .btn { flex: 1; }
.panel-section-title-mt { margin-top: 0.75rem; }

/* SIDE PANEL */
.side-panel {
  width: var(--panel-w);
  border-left: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.3s ease;
  flex-shrink: 0;
}

.side-panel.collapsed { width: 0; border-left: none; }

.panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg);
}

.panel-close-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.375rem;
  padding: 0.375rem 0.75rem;
  cursor: pointer;
  line-height: 1;
}

.panel-tab {
  flex: 1;
  padding: 0.625rem 0.25rem;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.panel-tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.panel-tab:hover:not(.active) { color: var(--gold-dim); }

.panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1rem;
  background: var(--surface);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.panel-section { margin-bottom: 1.5rem; }

.panel-section-title {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 0.75rem;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid var(--border);
}

.panel-latin-sub {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
  font-weight: normal;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.stat-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.stat-bar-wrap { display: flex; align-items: center; gap: 0.5rem; }

.stat-bar {
  width: 60px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--gold);
  transition: width 0.4s ease;
}

.stat-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--gold);
  min-width: 24px;
  text-align: right;
}

.training-wrap { width:100%; margin-top:0.25rem; padding-bottom:0.125rem; }
.training-bar { height:3px; background:var(--border); border-radius:2px; width:100%; }
.training-bar-fill { height:100%; background:var(--gold-dim); border-radius:2px; transition:width 0.3s; }
.training-label { text-align:right; margin-top:0.1875rem; font-size:0.6rem; color:var(--text-dim); font-family:'JetBrains Mono',monospace; }

.boon-item, .bane-item {
  padding: 0.5rem 0.625rem;
  border-radius: 4px;
  margin-bottom: 0.375rem;
  font-size: 0.9375rem;
}

.boon-item { background: rgba(58,107,74,0.1); border: 1px solid var(--green); color: var(--green-bright); }
.bane-item { background: rgba(139,58,58,0.1); border: 1px solid var(--red); color: var(--red-bright); }

.boon-item .item-name, .bane-item .item-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.125rem;
}

.item-desc { font-size: 0.875rem; opacity: 0.7; font-style: italic; }

/* OVERLAY PANELS */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.overlay.open { display: flex; pointer-events: auto; }

.overlay-box {
  background: var(--surface);
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  padding: 2rem;
  max-width: 480px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.overlay-title {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 1.25rem;
  letter-spacing: 0.05em;
}

.overlay-box:has(.settings-toc) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-width: 640px;
}

.settings-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.settings-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.settings-toc-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.1875rem 0.5rem;
  border-radius: 3px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.settings-toc-btn:hover {
  color: var(--gold);
  border-color: var(--gold-dim);
}

.form-group { margin-bottom: 1rem; }
.form-label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 0.375rem;
}

.form-input, .form-textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1.25rem;
  padding: 0.625rem 0.75rem;
  border-radius: 4px;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus, .form-textarea:focus { border-color: var(--gold-dim); }
.form-textarea { resize: vertical; min-height: 80px; }

.overlay-actions { display: flex; gap: 0.625rem; margin-top: 1.25rem; justify-content: flex-end; flex-shrink: 0; }

.btn-primary {
  background: rgba(201,168,76,0.15);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  padding: 0.5rem 1.25rem;
  border-radius: 4px;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.2s;
}
.btn-primary:hover { background: rgba(201,168,76,0.25); }

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.5rem 1.25rem;
  border-radius: 4px;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.2s;
}
.btn-secondary:hover { background: rgba(201,168,76,0.10); border-color: var(--gold-dim); color: var(--gold); }

.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Button + dialog utilities */
.btn-full { width: 100%; text-align: center; padding: 0.625rem; }
.btn-full-lg { width: 100%; text-align: center; padding: 0.75rem 1.25rem; }
.btn-gold { color: var(--gold); border-color: var(--gold-dim); }
.btn-danger-text { color: var(--red-bright); border-color: var(--red); }
.btn-muted { color: var(--text-dim); border-color: var(--border); }
.overlay-box-scroll { max-width: 640px; max-height: 80vh; display: flex; flex-direction: column; }
.overlay-scroll-body { flex: 1; overflow-y: auto; }

/* SETUP SCREENS */
.setup-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100%;
  padding: 2.5rem 1.25rem;
}

.setup-box {
  background: var(--surface);
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  padding: 2.5rem;
  max-width: 520px;
  width: 100%;
  margin: auto 0;
}

.setup-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.8125rem;
  color: var(--gold);
  text-align: center;
  margin-bottom: 0.5rem;
  letter-spacing: 0.1em;
}

.setup-subtitle {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1.125rem;
  color: var(--text-dim);
  text-align: center;
  font-style: italic;
  margin-bottom: 2rem;
}

.step-indicator {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1.125rem;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 1.5rem;
}

.setup-back-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 1.125rem;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
}
.setup-back-btn:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
}

.provider-hint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  line-height: 1.6;
}

.token-usage-note {
  margin-top: 1.5rem;
  padding: 0.75rem 0.875rem;
  background: var(--bg-alt, #1a1816);
  border: 1px solid var(--border, #2a2420);
  border-radius: 4px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.token-usage-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 0.375rem;
}
.token-usage-body {
  margin-bottom: 0.5rem;
}
.token-usage-body strong {
  color: var(--text-dim);
}
.token-usage-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
}
.token-usage-table td {
  padding: 0.125rem 0;
  border: none;
}
.token-usage-val {
  text-align: right;
  color: var(--text-dim);
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  white-space: nowrap;
}
.token-usage-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  opacity: 0.7;
}
.token-usage-tip {
  font-size: 0.75rem;
  font-style: italic;
  color: var(--text-muted);
  opacity: 0.7;
}

/* BEGIN PROMPT (shown before first scene — no AI calls until player clicks) */
.begin-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3.75rem 1.5rem;
  min-height: 40vh;
}
.begin-prompt-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.375rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}
.begin-prompt-desc {
  font-family: 'Crimson Pro', serif;
  font-size: 1.125rem;
  color: var(--text-dim);
  margin-bottom: 1.75rem;
  font-style: italic;
}
.begin-prompt-btn {
  font-size: 1.125rem;
  padding: 0.75rem 2.5rem;
  letter-spacing: 0.05em;
}

/* LOADING INDICATOR (inline, action zone) */
.loading-indicator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 2.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.loading-indicator::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  animation: pulse 1s infinite;
}

/* LOADING OVERLAY (prominent, narrative area) */
.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  pointer-events: none;
  animation: fadeIn 0.4s ease;
}

.loading-overlay.loading-fade-out {
  animation: fadeOut 0.3s ease forwards;
}
@keyframes fadeOut { to { opacity: 0; } }

.loading-sigil {
  width: 32px;
  height: 32px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1.25rem;
  color: var(--text-dim);
  font-style: italic;
  font-variant: small-caps;
  letter-spacing: 0.15em;
  animation: pulse 2s infinite;
}

/* PIPELINE PROGRESS (gameplay loading overlay) */
.pipeline-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem;
  animation: fadeIn 0.4s ease;
}
.pipeline-overlay.loading-fade-out {
  animation: fadeOut 0.3s ease forwards;
}
.pipeline-collapsed {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.pipeline-current-label {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1.125rem;
  color: var(--text-dim);
  font-style: italic;
}
.pipeline-current-label .pipeline-step-latin {
  font-family: 'Cinzel Decorative', serif;
  font-size: 0.875rem;
  color: var(--gold);
  font-style: normal;
}
.pipeline-current-label .pipeline-step-english {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-left: 0.25rem;
}
.pipeline-current-label .pipeline-step-english:only-child {
  font-family: 'Cinzel Decorative', serif;
  font-style: normal;
  font-size: 1rem;
  color: var(--gold);
  margin-left: 0;
}
.pipeline-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.6875rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  opacity: 0.5;
  transition: opacity 0.2s;
}
.pipeline-toggle:hover { opacity: 1; }
.pipeline-steps {
  display: none;
  flex-direction: column;
  gap: 0.375rem;
  margin-top: 0.75rem;
  width: 100%;
  max-width: 280px;
}
.pipeline-expanded .pipeline-steps { display: flex; }
.pipeline-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem;
  border-left: 2px solid var(--border);
  transition: border-color 0.3s;
}
.pipeline-step-icon {
  font-size: 0.875rem;
  color: var(--text-muted);
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}
.pipeline-step-latin {
  font-family: 'Cinzel Decorative', serif;
  font-size: 0.75rem;
  color: var(--text-dim);
}
.pipeline-step-english {
  font-size: 0.75rem;
  color: var(--text-dim);
}
.pipeline-step-english:only-child {
  font-family: 'Cinzel Decorative', serif;
  font-size: 0.8125rem;
}
.pipeline-step-latin + .pipeline-step-english {
  color: var(--text-muted);
}
.pipeline-step-timer {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-left: auto;
}
.pipeline-step-active {
  border-left-color: var(--gold);
}
.pipeline-step-active .pipeline-step-icon { color: var(--gold); }
.pipeline-step-active .pipeline-step-latin { color: var(--gold); }
.pipeline-step-active .pipeline-step-english { color: var(--gold); }
.pipeline-step-done .pipeline-step-icon { color: var(--green-bright, #6a9); }
.pipeline-step-error .pipeline-step-icon { color: var(--red-bright, #c66); }
.pipeline-cancel {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6875rem;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 0.5rem;
  align-self: center;
  transition: color 0.2s, border-color 0.2s;
}
.pipeline-cancel:hover { color: var(--red-bright, #c66); border-color: var(--red-bright, #c66); }

/* SPLASH SCREEN */
.splash-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 3.75rem;
  padding: 2.5rem;
  animation: fadeIn 1s ease;
}

.splash-image {
  width: 380px;
  max-width: 40vw;
  border-radius: 8px;
  opacity: 0.9;
  flex-shrink: 0;
}

.splash-text {
  max-width: 360px;
}

.splash-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 3.3125rem;
  color: var(--gold);
  letter-spacing: 0.2em;
  margin-bottom: 0.5rem;
}

.splash-tagline {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1.125rem;
  color: var(--text-dim);
  font-style: italic;
  font-variant: small-caps;
  letter-spacing: 0.15em;
  margin-bottom: 1.5rem;
}

.splash-desc {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1.1875rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 2rem;
}

.splash-btn {
  padding: 0.75rem 2rem !important;
  font-size: 1rem !important;
}

@media (max-width: 640px) {
  .splash-screen {
    flex-direction: column;
    gap: 2rem;
    padding: 1.5rem;
  }
  .splash-image {
    max-width: 80vw;
    width: 280px;
  }
  .splash-text {
    text-align: center;
  }
}

/* SLOT PICKER */
.slot-picker {
  max-width: 420px;
  width: 100%;
  margin-top: 1.5rem;
}
.slot-picker-title {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.9375rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}
.slot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.slot-row:hover {
  border-color: var(--gold-dim);
  background: rgba(201, 168, 76, 0.05);
}
.slot-row-info {
  flex: 1;
  min-width: 0;
}
.slot-row-name {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1.0625rem;
  color: var(--gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.slot-row-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
}
.slot-row-menu {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.125rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: color 0.2s;
  flex-shrink: 0;
}
.slot-row-menu:hover {
  color: var(--gold);
}
/* Settings slot list (compact inline view) */
.settings-slot-list {
  margin-bottom: 0.5rem;
  border: 1px solid var(--gold-dim);
  border-radius: 6px;
  padding: 0.375rem 0.625rem;
}
.settings-slot-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
  opacity: 0.6;
}
.settings-slot-item.active {
  color: var(--gold);
  opacity: 1;
}
.settings-slot-icon {
  font-size: 0.85em;
}
.settings-slot-name {
  flex: 1;
  font-size: 0.9em;
}
.settings-slot-meta {
  font-size: 0.75em;
  opacity: 0.7;
}
.slot-new-btn {
  display: block;
  width: 100%;
  padding: 0.625rem 0.875rem;
  text-align: left;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1rem;
  color: var(--text-dim);
  background: none;
  border: 1px dashed var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  margin-bottom: 0.75rem;
}
.slot-new-btn:hover:not(:disabled) {
  border-color: var(--gold-dim);
  color: var(--gold);
}
.slot-new-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-style: dotted;
}
.slot-storage-bar {
  margin-top: 0.25rem;
}
.slot-storage-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.25rem;
}
.slot-storage-fill {
  height: 100%;
  background: var(--gold-dim);
  border-radius: 2px;
  transition: width 0.3s;
}
.slot-storage-fill.warning { background: #b8860b; }
.slot-storage-fill.danger { background: var(--red); }
.slot-storage-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-align: right;
}

.slot-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 10;
  background: var(--surface);
  border: 1px solid var(--border-bright);
  border-radius: 6px;
  padding: 0.25rem 0;
  min-width: 140px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.slot-dropdown-item {
  display: block;
  width: 100%;
  padding: 0.5rem 0.875rem;
  text-align: left;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.875rem;
  color: var(--text-dim);
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.slot-dropdown-item:hover {
  background: rgba(201, 168, 76, 0.1);
}
.slot-dropdown-item.danger {
  color: var(--red-bright);
}

/* CURATED BEATS */
.curated-beat-row {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 0.375rem;
}
.curated-beat-row .form-input {
  flex: 1;
  min-width: 0;
}
.curated-beat-remove {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 1rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  flex-shrink: 0;
  line-height: 1;
}
.curated-beat-remove:hover {
  color: var(--red-bright);
  border-color: var(--red-bright);
}
.curated-counter {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}
.curated-counter.over-limit {
  color: var(--red-bright);
}
.curated-counter.expanded {
  color: var(--gold);
}
.curated-ending-hint {
  font-size: 0.6875rem;
  margin-left: 1.375rem;
}
.curated-add-btn {
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  padding: 0.25rem 0.625rem;
}

/* SCENE NARRATION PARAGRAPHS */
.scene-narration p {
  margin-bottom: 0.5rem;
}

.scene-narration p:last-child {
  margin-bottom: 0;
}

/* INTRO SCREEN */
.intro-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  animation: fadeIn 1s ease;
}

.intro-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(2.75rem, 4.5vw, 4.375rem);
  color: var(--gold);
  letter-spacing: 0.2em;
  margin-bottom: 1rem;
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

.intro-tagline {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: clamp(1.125rem, 1.6vw, 1.5rem);
  color: var(--text-dim);
  font-style: italic;
  font-variant: small-caps;
  letter-spacing: 0.15em;
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}

/* Update gate */
.gate-checkbox { display: flex; align-items: center; justify-content: center; gap: 0.375rem; margin-top: 0.5rem; font-size: 0.8125rem; color: var(--text-muted); cursor: pointer; }
.gate-divider { border-color: var(--border); margin: 1.25rem 0; }
.gate-changelog-container { display: none; max-height: 300px; overflow-y: auto; margin: 0.75rem 0; border: 1px solid var(--border); border-radius: 4px; padding: 0.75rem; }
.gate-changelog-entry { margin-bottom: 0.75rem; }
.gate-changelog-version { font-weight: 600; color: var(--gold); font-size: 0.8125rem; }
.gate-changelog-title { color: var(--text-muted); font-weight: 400; }
.gate-changelog-list { margin: 0.25rem 0 0 1rem; padding: 0; font-size: 0.8125rem; color: var(--text-secondary); }
.gate-changelog-list li { margin: 0.125rem 0; }

/* MESSAGES */
.error-message {
  background: rgba(139,58,58,0.1);
  border: 1px solid var(--red);
  color: var(--red-bright);
  padding: 0.625rem 0.875rem;
  border-radius: 4px;
  font-size: 0.9375rem;
  margin-top: 0.75rem;
}

.success-message {
  background: rgba(58,107,74,0.1);
  border: 1px solid var(--green);
  color: var(--green-bright);
  padding: 0.625rem 0.875rem;
  border-radius: 4px;
  font-size: 0.9375rem;
  margin-top: 0.75rem;
}

/* VALIDATION FEEDBACK */
.validation-area {
  margin-top: 0.75rem;
  min-height: 40px;
}

/* INLINE CHALLENGE (duplicated in narrative scroll for visibility) */
.inline-challenge {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gold);
  padding: 0.75rem 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  animation: fadeIn 0.4s ease;
}

.interview-progress {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  letter-spacing: 0.04em;
  animation: pulse 2s infinite;
}

.inline-challenge::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
  animation: pulse 2s infinite;
}

/* Gameplay one-offs */
.no-bottom-border { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

/* REROLL THROBBER (in-narrative spinner during reroll) */
.reroll-throbber {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.25rem;
  min-height: 80px;
}

/* REROLL CONTROLS */
.commit-choice {
  display: flex;
  gap: 0.625rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.75rem;
  padding: 0.5rem 0;
}
.uncommitted-warning {
  width: 100%;
  text-align: center;
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.125rem;
}

.reroll-controls {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  background: var(--surface2);
  animation: fadeIn 0.3s ease;
}

.reroll-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.625rem;
}

.reroll-counter {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex: 1;
  text-align: center;
}

.reroll-prev,
.reroll-next {
  padding: 0.25rem 0.625rem;
  font-size: 0.9375rem;
  min-width: 32px;
}

.reroll-prev:disabled,
.reroll-next:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.steering-buttons {
  display: flex;
  gap: 0.375rem;
  margin-bottom: 0.375rem;
}
.correction-buttons {
  display: flex;
  gap: 0.375rem;
  margin-bottom: 0.5rem;
}
.correction-btn {
  flex: 1;
  padding: 0.375rem 0.5rem;
  font-size: 0.8125rem;
  font-family: 'JetBrains Mono', monospace;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}
.correction-btn:hover {
  border-color: var(--gold);
  color: var(--text);
}
.correction-btn.correction-active {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.1);
  color: var(--gold);
}

.reroll-suggestion {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.9375rem;
  padding: 0.5rem 0.625rem;
  border-radius: 4px;
  resize: none;
  outline: none;
  margin-bottom: 0.625rem;
  transition: border-color 0.2s;
}

.reroll-suggestion::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.reroll-suggestion:focus {
  border-color: var(--gold-dim);
}

.reroll-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
}

.reroll-btn {
  flex: 1;
}

.reroll-commit {
  flex: 1;
}

/* TOAST NOTIFICATIONS */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
  z-index: 200;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  background: var(--surface);
  border: 1px solid var(--gold-dim);
  padding: 0.5rem 0.75rem 0.5rem 1rem;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: auto;
  cursor: pointer;
}

.toast.visible {
  opacity: 1;
}

.toast-text {
  flex: 1;
}

.toast-close {
  background: none;
  border: none;
  color: var(--gold-dim);
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.125rem;
  cursor: pointer;
  transition: color 0.2s;
  flex-shrink: 0;
}

.toast-close:hover {
  color: var(--gold);
}

/* COACHING TOGGLE */
.coaching-toggle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  width: 100%;
  cursor: pointer;
}

.coaching-toggle summary {
  list-style: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.coaching-toggle summary::-webkit-details-marker { display: none; }

.coaching-toggle summary::before {
  content: '+ ';
  color: var(--gold-dim);
}

.coaching-toggle[open] summary::before {
  content: '- ';
}

.coaching-note {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.875rem;
  font-style: italic;
  color: var(--text-dim);
  border-left: 2px solid var(--border);
  padding: 0.375rem 0 0.375rem 0.625rem;
  margin-top: 0.375rem;
}

.coaching-mechanical {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.375rem;
  padding: 0.375rem 0 0.125rem 0.625rem;
  border-left: 2px solid var(--border);
  line-height: 1.6;
}

.lore-note {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  color: var(--gold);
  background: rgba(201,168,76,0.05);
  border: 1px solid var(--gold-dim);
  border-radius: 4px;
  padding: 0.375rem 0.625rem;
  margin-top: 0.5rem;
  width: 100%;
}

.lore-note::before {
  content: 'LORE: ';
  color: var(--gold-dim);
  font-weight: 400;
  letter-spacing: 0.08em;
}

/* VERDICT BLOCK */
.verdict-block {
  border-left: 3px solid var(--verdict-color, #888);
  padding: 0.75rem 1rem;
  margin: 1.25rem 0;
  background: var(--verdict-bg, rgba(255,255,255,0.03));
  border-radius: 0 4px 4px 0;
}

.verdict-label {
  display: block;
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.35rem;
}

.verdict-text {
  font-family: 'Crimson Pro', serif;
  font-size: 1.2rem;
  font-style: italic;
  line-height: 1.5;
  margin: 0;
  color: var(--verdict-text-color, inherit);
}

.verdict--triumph {
  --verdict-color: #c9a84c;
  --verdict-bg: rgba(201,168,76,0.07);
  --verdict-text-color: #e8d5a0;
}
.verdict--success {
  --verdict-color: #7aad7a;
  --verdict-bg: rgba(122,173,122,0.06);
}
.verdict--minor {
  --verdict-color: #8899aa;
  --verdict-bg: rgba(136,153,170,0.05);
}
.verdict--failure {
  --verdict-color: #aa8866;
  --verdict-bg: rgba(170,136,102,0.06);
}
.verdict--ruin {
  --verdict-color: #aa4444;
  --verdict-bg: rgba(170,68,68,0.08);
  --verdict-text-color: #cc8888;
}

/* REVEAL ANIMATION */
.reveal-hidden {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

/* INTRO WALLPAPER BACKDROP */
#wallpaper-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.wallpaper-layer {
  position: absolute;
  inset: -5%;
  background-size: cover;
  background-position: center;
  filter: blur(1px) saturate(0.6);
  animation: ambientDrift 120s ease-in-out infinite;
  transition: opacity 2s ease;
}

.wallpaper-layer-start {
  background-image: url('wallpaper_start.png');
  opacity: 0.15;
}

.wallpaper-layer-main {
  background-image: url('wallpaper.png');
  opacity: 0;
}

#wallpaper-backdrop.crossfade .wallpaper-layer-start {
  opacity: 0;
}

#wallpaper-backdrop.crossfade .wallpaper-layer-main {
  opacity: 0.1;
}

/* INTRO SEQUENCE */
.intro-sequence {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 0;
}

.intro-line {
  text-align: center;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  margin-bottom: 1.5rem;
}

.intro-line.visible {
  opacity: 1;
  transform: translateY(0);
}

.intro-line-latin {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(1.5rem, 2.5vw, 2.1875rem);
  color: var(--gold);
  margin-bottom: 0.25rem;
  text-shadow: 0 1px 8px rgba(0,0,0,0.6);
}

.intro-line-english {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: clamp(0.9375rem, 1.6vw, 1.375rem);
  color: var(--text-dim);
  font-style: italic;
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}

.intro-reveal {
  text-align: center;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 1s ease, transform 1s ease;
}

.intro-reveal.visible {
  opacity: 1;
  transform: scale(1);
}

.intro-title-large {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(3.3125rem, 5vw, 5.5rem);
  color: var(--gold);
  letter-spacing: 0.3em;
  padding-left: 0.3em;
  margin-bottom: 0.75rem;
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

.intro-phrase-rest {
  display: inline-block;
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  vertical-align: bottom;
  white-space: nowrap;
  transition: opacity 1.5s ease, max-width 1.5s ease;
}

.intro-phrase-rest.visible {
  opacity: 1;
  max-width: 15em;
}

.intro-subtitle {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: clamp(0.9375rem, 1.5vw, 1.3125rem);
  color: var(--text-dim);
  font-style: italic;
  opacity: 0;
  transition: opacity 1.5s ease;
  margin-bottom: 0.25rem;
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}

.intro-subtitle.visible {
  opacity: 1;
}

.intro-sequence { cursor: pointer; }

.intro-skip {
  position: absolute;
  bottom: 32px;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: clamp(0.8125rem, 1.2vw, 1.125rem);
  color: var(--text-muted);
  letter-spacing: 0.1em;
  opacity: 0;
  animation: introSkipFadeIn 1s ease 3s forwards;
  cursor: pointer;
}
.intro-skip:hover { color: var(--text-dim); }

@keyframes introSkipFadeIn {
  to { opacity: 1; }
}

.intro-begin-btn {
  margin-top: 1.5rem;
  padding: 0.625rem 2rem;
  font-size: clamp(0.9375rem, 1.4vw, 1.25rem);
}

/* Lorebook form utilities */
.lore-budget-input { width: 80px; }

/* INTERVIEW CHAT */
.interview-container {
  display: flex;
  flex-direction: column;
  max-height: 400px;
  margin-bottom: 1rem;
}

.interview-messages {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.75rem 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  min-height: 120px;
  max-height: 300px;
}


.interview-msg {
  margin-bottom: 0.75rem;
  animation: fadeIn 0.3s ease;
}

.interview-msg-agent {
  padding: 0.625rem 0.875rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px 12px 12px 4px;
  margin-right: 2rem;
}

.interview-msg-player {
  padding: 0.625rem 0.875rem;
  background: rgba(201,168,76,0.06);
  border: 1px solid var(--gold-dim);
  border-radius: 12px 4px 4px 12px;
  margin-left: 2rem;
}

.interview-msg-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
}

.interview-msg-agent .interview-msg-label { color: var(--text-muted); }
.interview-msg-player .interview-msg-label { color: var(--gold-dim); }

.interview-msg-text {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1rem;
  color: var(--text-dim);
  line-height: 1.6;
}

.interview-msg-agent .interview-msg-latin {
  font-family: 'Cinzel Decorative', serif;
  font-size: 0.875rem;
  color: var(--gold);
  margin-bottom: 0.25rem;
}

.interview-input-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.interview-input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1rem;
  padding: 0.625rem 0.75rem;
  border-radius: 4px;
  outline: none;
  resize: none;
  min-height: 44px;
  max-height: 100px;
  transition: border-color 0.2s;
}

.interview-input::placeholder { color: var(--text-muted); font-style: italic; }
.interview-input:focus { border-color: var(--gold-dim); }

.interview-send {
  align-self: flex-end;
}

.interview-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.25rem;
  justify-content: flex-end;
}

.interview-status {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.interview-field-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.1875rem 0.5rem;
  border-radius: 3px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.interview-field-tag.covered {
  border-color: var(--green);
  color: var(--green-bright);
  background: rgba(58,107,74,0.1);
}

.interview-entry-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--gold-dim);
  margin-left: auto;
  line-height: 1;
  align-self: center;
}

/* TOOLTIPS */
[data-tooltip] {
  position: relative;
  cursor: help;
}
/* CSS ::after tooltips disabled — all tooltips use JS floating tooltip for viewport clamping */
[data-tooltip]::after { display: none; }
.floating-tooltip { position: fixed; background: var(--surface); color: var(--text-dim); padding: 0.375rem 0.625rem; border-radius: 4px; border: 1px solid var(--border); font-size: 0.8125rem; font-family: 'JetBrains Mono', monospace; line-height: 1.5; z-index: 9999; pointer-events: none; max-width: min(720px, 80vw); white-space: normal; word-wrap: break-word; display: none; }

/* LORE TERM (narrative annotation) */
.lore-term {
  color: var(--gold);
  font-style: normal;
  border-bottom: 1px dotted var(--gold-dim);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.lore-term:hover {
  color: var(--gold-bright);
  border-bottom-color: var(--gold-bright);
}

/* LORE ENTRIES (panel) */
.lore-entry {
  padding: 0.375rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.375rem;
  border: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s;
}
.lore-entry-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}
.lore-entry-desc {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.125rem;
  line-height: 1.5;
}
.lore-highlight {
  background: rgba(201,168,76,0.12);
  border-color: var(--gold-dim);
  animation: loreFlash 2s ease forwards;
}
@keyframes loreFlash {
  0% { background: rgba(201,168,76,0.2); border-color: var(--gold); }
  100% { background: transparent; border-color: transparent; }
}
.lore-optimized {
  background: rgba(80,200,200,0.12);
  border-color: rgba(80,200,200,0.4);
}

/* SELECTION POPUP (lorebook shortcut) */
.lore-selection-popup { position: fixed; z-index: 9998; background: var(--surface); border: 1px solid var(--gold-dim); border-radius: 4px; padding: 0.1875rem; pointer-events: auto; display: none; }
.lore-selection-btn { font-size: 0.8125rem; padding: 0.25rem 0.625rem; white-space: nowrap; min-height: 2rem; }

/* LOREBOOK V2 ENTRIES */
.lore-category-header { font-family: 'JetBrains Mono', monospace; font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold); margin: 0.75rem 0 0.375rem 0; padding: 0; }
.lore-entry-v2 { margin-bottom: 0.25rem; border-radius: 4px; border: 1px solid transparent; transition: background 0.3s, border-color 0.3s; }
.lore-entry-v2 details { padding: 0.25rem 0.5rem; }
.lore-entry-summary { cursor: pointer; display: flex; align-items: center; gap: 0.5rem; list-style: none; padding: 0.125rem 0; }
.lore-entry-summary::-webkit-details-marker { display: none; }
.lore-entry-label { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.lore-entry-content { font-family: 'Crimson Pro', Georgia, serif; font-size: 0.875rem; color: var(--text-muted); font-style: italic; padding: 0.25rem 0 0.125rem 0; line-height: 1.5; }
.lore-entry-keys { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: var(--text-muted); opacity: 0.6; padding: 0.125rem 0 0.25rem 0; }
.lore-type-badge { font-family: 'JetBrains Mono', monospace; font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.05em; padding: 0.0625rem 0.3125rem; border-radius: 3px; white-space: nowrap; }
.lore-type-constant { background: rgba(201,168,76,0.15); color: var(--gold); }
.lore-type-selective { background: rgba(100,180,100,0.15); color: #8fc98f; }
.lore-type-disabled { background: rgba(128,128,128,0.15); color: var(--text-muted); }
.lore-entry-disabled { opacity: 0.5; }

/* LORE HEALTH BANNER */
.lore-health-banner { padding: 0.625rem 0.875rem; border-radius: 4px; border-left: 3px solid var(--gold-dim); margin-bottom: 0.75rem; }
.lore-health-poor { border-left-color: var(--red); background: rgba(139,58,58,0.08); }
.lore-health-fair { border-left-color: var(--gold); background: rgba(201,168,76,0.08); }
.lore-health-title { font-family: 'Cinzel Decorative', serif; font-size: 0.875rem; color: var(--gold); margin-bottom: 0.25rem; }
.lore-health-poor .lore-health-title { color: var(--red-bright); }
.lore-health-body { font-family: 'Crimson Pro', Georgia, serif; font-size: 0.8125rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 0.5rem; }
.lore-health-banner .btn { font-size: 0.8125rem; padding: 0.25rem 0.75rem; }

/* LORE EDITING */
.lore-edit-btn { font-size: 0.8125rem; padding: 0.125rem 0.5rem; margin-left: auto; flex-shrink: 0; }
.lore-edit-form { padding: 0.25rem 0; }
.lore-edit-form select.form-input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='6'%3E%3Cpath d='M0 0l4 6 4-6z' fill='%234a4238'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; padding-right: 1.5rem; cursor: pointer; }
.btn-danger { background: rgba(139,58,58,0.1); border-color: var(--red); color: var(--red-bright); }
.btn-danger:hover { background: rgba(139,58,58,0.2); }
.lore-add-btn { width: 100%; margin-top: 0.75rem; text-align: center; padding: 0.5rem; font-size: 0.8125rem; }

/* WA IMPORT PROGRESS */
.wa-progress { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.25rem; }
.wa-progress-step { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 4px; background: var(--surface2); transition: border-color 0.3s, background 0.3s; }
.wa-step-active { border-color: var(--gold-dim); background: rgba(201,168,76,0.06); }
.wa-step-label { font-family: 'Crimson Pro', Georgia, serif; font-size: 0.9375rem; color: var(--text-dim); }
.wa-step-status { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: var(--gold); }
.wa-summary { border: 1px solid var(--gold-dim); border-radius: 4px; padding: 1rem; background: rgba(201,168,76,0.04); margin-bottom: 1rem; }
.wa-summary-title { font-family: 'Cinzel Decorative', serif; font-size: 1rem; color: var(--gold); margin-bottom: 0.5rem; }
.wa-summary-stats { font-family: 'Crimson Pro', Georgia, serif; font-size: 0.875rem; color: var(--text-dim); margin-bottom: 0.5rem; line-height: 1.6; }
.wa-cat-row { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.wa-cat-badge { font-family: 'JetBrains Mono', monospace; font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.05em; padding: 0.125rem 0.5rem; border-radius: 3px; background: rgba(201,168,76,0.15); color: var(--gold); white-space: nowrap; }

/* HINT EXPLAINERS */
.hint-explainer { background: rgba(201,168,76,0.08); border: 1px solid var(--gold-dim); border-radius: 6px; padding: 0.75rem 1rem; margin: 0.75rem 0; animation: fadeIn 0.4s ease; }
.hint-title { font-family: 'JetBrains Mono', monospace; font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold); margin-bottom: 0.375rem; }
.hint-body { font-family: 'Crimson Pro', Georgia, serif; font-size: 1rem; color: var(--text-dim); line-height: 1.6; }
.hint-dismiss { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; cursor: pointer; background: none; border: none; padding: 0; margin-top: 0.5rem; }
.hint-dismiss:hover { color: var(--text-dim); }

/* TTS PLAY BUTTON */
.tts-btn-wrap { margin-top: 0.5rem; }
.tts-play-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  padding: 0.1875rem 0.5rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}
.tts-play-btn:hover { border-color: var(--gold-dim); color: var(--text-dim); }
.tts-play-btn--error { border-color: var(--fortune-setback); color: var(--fortune-setback); }

/* Checkbox labels */
.checkbox-label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.checkbox-label .form-label { margin: 0; }

/* Desktop — centered readable column */
@media (min-width: 1200px) {
  :root { --panel-w: 340px; }

  .narrative-scroll > * {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Action zone: 800px to account for 40px padding = 720px text aligned with scenes */
  .challenge-prompt,
  .input-row,
  .input-controls-row,
  .input-textarea-row,
  .version-tag {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (min-width: 1600px) {
  :root { --panel-w: 380px; }
}

/* Mobile */
/* EPIGRAPH */
.epigraph {
  text-align: center;
  padding: 2rem 1.5rem;
  margin: 1rem auto;
  max-width: 500px;
  animation: epigraphCycle 8s ease forwards;
}

@keyframes epigraphCycle {
  0%   { opacity: 0; }
  12%  { opacity: 1; }
  75%  { opacity: 1; }
  100% { opacity: 0.3; }
}

.epigraph-latin {
  font-family: 'Cinzel Decorative', serif;
  color: var(--gold);
  font-size: 1.375rem;
  letter-spacing: 0.05em;
}

.epigraph-english {
  font-family: 'Crimson Pro', Georgia, serif;
  font-style: italic;
  color: var(--text-dim);
  font-size: 1rem;
  margin-top: 0.5rem;
}

.epigraph-author {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.375rem;
  cursor: help;
}

/* PROPHECY */
.prophecy {
  text-align: center;
  padding: 1.75rem 1.5rem;
  margin: 1rem auto;
  max-width: 500px;
  border-left: 2px solid var(--gold-dim);
  border-right: 2px solid var(--gold-dim);
  animation: epigraphCycle 10s ease forwards;
}

.prophecy-header {
  font-family: 'Cinzel Decorative', serif;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.prophecy-line {
  font-family: 'Crimson Pro', Georgia, serif;
  font-style: italic;
  color: var(--gold);
  font-size: 1.125rem;
  line-height: 1.6;
}

.model-rec-hint {
  font-size: 0.78em;
  opacity: 0.6;
}

/* QUO VADIS */
.quo-vadis {
  position: absolute;
  top: -34px;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.75rem 1rem;
  background: rgba(13,11,10,0.92);
  border-top: 1px solid var(--gold-dim);
  opacity: 1;
  transition: opacity 1s ease;
  animation: fadeIn 0.6s ease;
  pointer-events: auto;
  cursor: pointer;
  z-index: 3;
}

.quo-vadis.fading {
  opacity: 0;
}

.quo-vadis-latin {
  font-family: 'Cinzel Decorative', serif;
  color: var(--gold);
  font-size: 1.25rem;
  font-style: italic;
}

.quo-vadis-english {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 0.125rem;
}

.quo-vadis-note {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1rem;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 0.25rem;
}

/* LAST CALL */
.last-call {
  position: absolute;
  top: -34px;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.75rem 1rem;
  background: rgba(13,11,10,0.92);
  border-top: 1px solid var(--gold-dim);
  opacity: 1;
  transition: opacity 1s ease;
  animation: fadeIn 0.6s ease;
  pointer-events: none;
  z-index: 3;
}

.last-call.fading {
  opacity: 0;
}

.last-call-latin {
  font-family: 'Cinzel Decorative', serif;
  color: var(--gold);
  font-size: 1.25rem;
  font-style: italic;
}

.last-call-english {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 0.125rem;
}

/* STORY COMPLETE OVERLAY */
.story-complete-title {
  font-family: 'Cinzel Decorative', serif;
  color: var(--gold);
  font-size: 2.25rem;
  letter-spacing: 0.15em;
  text-align: center;
  margin-bottom: 0.5rem;
}

.story-complete-subtitle {
  font-family: 'Crimson Pro', Georgia, serif;
  color: var(--text-dim);
  font-style: italic;
  font-size: 1.125rem;
  text-align: center;
  margin-bottom: 1.25rem;
}

.story-complete-stats {
  border: 1px solid var(--gold-dim);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}

.story-complete-stat {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
}

.story-complete-stat-label {
  color: var(--text-muted);
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.9375rem;
}

.story-complete-stat-value {
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
}

.story-complete-prompt {
  font-family: 'Crimson Pro', Georgia, serif;
  color: var(--text-dim);
  font-size: 0.9375rem;
  text-align: center;
  margin-bottom: 1rem;
}

/* STORY COMPLETE INPUT */
.story-complete-input {
  text-align: center;
  padding: 1.25rem 1rem;
}

.story-complete-label {
  font-family: 'Cinzel Decorative', serif;
  color: var(--gold-dim);
  font-size: 1.125rem;
  margin-bottom: 0.75rem;
}

/* GOAL SUGGESTION + SURPRISE */
.goal-surprise-btn {
  margin-top: 0.375rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: transparent;
  border: 1px solid var(--gold-dim);
  color: var(--gold-dim);
  padding: 0.25rem 0.875rem;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.goal-surprise-btn:hover:not(:disabled) {
  color: var(--gold);
  border-color: var(--gold);
}

.goal-surprise-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.goal-suggestion {
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(201, 168, 76, 0.08);
  border: 1px solid var(--gold-dim);
  border-radius: 6px;
}

.goal-suggestion-hint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.goal-suggestion-text {
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
  font-style: italic;
  color: var(--gold);
  line-height: 1.5;
  margin-bottom: 0.625rem;
}

.goal-accept-btn {
  font-size: 0.8125rem;
  padding: 0.3125rem 1rem;
}

/* STORY CONFIG SCREEN */
.story-config-radios {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.375rem;
}

.config-radio {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1rem;
  color: var(--text-dim);
  cursor: pointer;
}

.config-radio input[type="radio"] {
  accent-color: var(--gold);
}

.config-hint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* STREAK DISPLAY */
.streak-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--gold);
  background: rgba(201,168,76,0.08);
  border: 1px solid var(--gold-dim);
  border-radius: 4px;
  padding: 0.375rem 0.625rem;
  text-align: center;
  cursor: help;
}

/* WORLD STATE (lore panel) */
.world-state-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.75rem;
  font-size: 0.9375rem;
}

.world-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.world-value {
  font-family: 'Crimson Pro', Georgia, serif;
  color: var(--text-dim);
  font-size: 1rem;
}

/* STYLE SAMPLE in settings */
.style-sample {
  min-height: 18px;
}

/* GENERATION PARAMETERS (settings modal) */
.gen-tabs {
  display: flex;
  overflow-x: auto;
  gap: 0.125rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
  scrollbar-width: none;
  cursor: grab;
}
.gen-tabs:active { cursor: grabbing; }
.gen-tabs::-webkit-scrollbar { display: none; }
.gen-tab {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  padding: 0.25rem 0.625rem;
  cursor: pointer;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--text-muted);
  white-space: nowrap;
  transition: all 0.2s;
}
.gen-tab:hover { color: var(--text-dim); }
.gen-tab.active { border-bottom-color: var(--gold); color: var(--gold); }
.gen-tab-agent { font-family: 'Cinzel Decorative', serif; font-size: 0.8125rem; }
.gen-param-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
}
.gen-param-toggle { accent-color: var(--gold); flex-shrink: 0; }
.gen-param-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-dim);
  min-width: 110px;
}
.gen-param-slider { width: 120px; accent-color: var(--gold); }
.gen-param-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--gold);
  min-width: 50px;
  text-align: right;
}
.gen-param-inherit {
  font-size: 0.75rem;
  font-style: italic;
  color: var(--text-muted);
}

/* API CONFIG LIST */
.api-config-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.api-config-card {
  display: flex;
  align-items: center;
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--border);
  cursor: default;
  transition: background 0.15s;
}
.api-config-card:hover {
  background: var(--surface2);
}
.api-config-card-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.125rem;
  min-width: 0;
}
.api-config-card-name {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1rem;
  color: var(--gold);
}
.api-config-card-detail {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.api-config-card-default {
  font-size: 0.75rem;
  font-style: italic;
  color: var(--text-muted);
}
.api-config-card-actions {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  flex-shrink: 0;
}
.api-config-reorder-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.8125rem;
  padding: 0.125rem 0.375rem;
  cursor: pointer;
  border-radius: 3px;
}
.api-config-reorder-btn:hover {
  color: var(--gold);
  border-color: var(--gold-dim);
}
.api-config-delete-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8125rem;
  padding: 0.125rem 0.375rem;
  cursor: pointer;
  border-radius: 3px;
}
.api-config-delete-btn:hover {
  color: var(--red-bright);
  border-color: var(--red);
}

/* API CONFIG EDIT */
.api-config-edit {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.api-config-helper-btn {
  padding: 0.25rem 0.5rem !important;
  font-size: 0.8125rem !important;
  white-space: nowrap;
}
.api-config-delete-zone {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}
.api-config-delete-action {
  color: var(--red-bright) !important;
  border-color: var(--red) !important;
  width: 100%;
  text-align: center;
}

/* INLINE INPUT (in narrative scroll) */
.inline-input-area {
  margin-top: 1rem;
  padding-bottom: 1rem;
  animation: fadeIn 0.4s ease;
  position: relative;
}
.inline-input-area .input-row {
  padding: 0.625rem 0 0;
}
.inline-input-area .input-controls-row {
  padding: 0.625rem 0 0;
}
.inline-input-area .input-textarea-row {
  padding: 0.5rem 0 0.375rem;
}

/* IMPORT DROPZONE */
.import-dropzone {
  border: 2px dashed var(--border);
  border-radius: 4px;
  padding: 1rem;
  text-align: center;
  transition: border-color 0.2s;
  cursor: pointer;
}
.import-dropzone.dragover {
  border-color: var(--gold);
}

/* WALLPAPER BACKDROP */
#app-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  transition: background-image 0.6s ease;
  pointer-events: none;
}
#app-backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.78);
}
body.has-wallpaper .main,
body.has-wallpaper .action-zone {
  position: relative;
  z-index: 1;
}
body.has-wallpaper .narrative-col {
  background: rgba(0, 0, 0, 0.3);
}
body.has-wallpaper .narrative-col::before {
  opacity: 0;
}
body.has-wallpaper .panel {
  background: rgba(0, 0, 0, 0.4);
}

/* SCENE IMAGES */
.scene-image-wrap {
  margin-top: 1rem;
  position: relative;
}
.scene-image {
  width: 100%;
  border-radius: 4px;
  display: block;
}
.scene-wallpaper-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: 0.8125rem;
  padding: 0.125rem 0.5rem;
  background: rgba(13,11,10,0.8);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 3px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}
.scene-image-wrap:hover .scene-wallpaper-btn {
  opacity: 1;
}
.scene-wallpaper-btn:hover {
  color: var(--gold);
  border-color: var(--gold-dim);
}
.scene-img-btn {
  font-size: 0.8125rem;
  padding: 0.125rem 0.5rem;
  margin-top: 0.375rem;
}
.scene-copy-btn {
  font-size: 0.8125rem;
  padding: 0.125rem 0.5rem;
  margin-top: 0.375rem;
  margin-left: 0.25rem;
}

/* SCENE DEBUG (Specula inline) */
.scene-debug {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  margin-top: 0.5rem;
  padding: 0.25rem 0;
}
.scene-debug-line {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0;
}
.scene-debug-agent {
  color: var(--text-dim);
}
.scene-debug-sep {
  margin: 0 0.375rem;
  opacity: 0.4;
}
.scene-debug-reasoning {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin: 0.125rem 0 0.25rem;
}
.scene-debug-reasoning summary {
  cursor: pointer;
  color: var(--gold-dim);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.scene-debug-reasoning pre {
  margin: 0.25rem 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 200px;
  overflow-y: auto;
  padding: 0.375rem;
  background: var(--surface);
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* WORD COUNT HINT */
.word-count-hint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: right;
  padding: 0.125rem 0.25rem 0;
  height: 18px;
  line-height: 1.125rem;
  transition: color 0.2s;
}

/* BEAT TOOLTIP IN WORLD STATE */
.beat-current {
  cursor: help;
}

/* BEAT OVERRIDE DROPDOWN (DEBUG) */
.beat-override-select {
  background: var(--bg, #0d0b0a);
  color: var(--gold, #c9a84c);
  border: 1px solid var(--gold, #c9a84c);
  font-family: 'Crimson Pro', serif;
  font-size: 0.85em;
  padding: 0.125em 0.25em;
  border-radius: 3px;
  cursor: pointer;
  max-width: 10em;
  text-overflow: ellipsis;
}

/* HISTORY PANEL IMAGE TOGGLE */
.history-image-wrap {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}
.history-image-wrap.expanded {
  max-height: 400px;
}
.history-image-wrap img {
  width: 100%;
  border-radius: 4px;
  margin-top: 0.5rem;
}
.history-image-toggle {
  font-size: 0.8125rem;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  margin-left: 0.375rem;
}
.history-image-toggle:hover {
  color: var(--gold);
}

/* --- Onboarding: Scope Selection --- */
.scope-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
  margin-bottom: 1rem;
}
.scope-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.75rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.9375rem;
  color: var(--text-dim);
  transition: border-color 0.2s, color 0.2s;
}
.scope-item:hover {
  border-color: var(--gold-dim);
  color: var(--text);
}
.scope-item:has(input:checked) {
  border-color: var(--gold-dim);
  color: var(--gold);
}
.scope-required {
  opacity: 0.7;
}
.scope-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-style: italic;
  margin-left: auto;
}

/* --- Onboarding: Tutorial Annotation --- */
.tutorial-annotation {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  background: var(--surface2);
  border: 1px solid var(--gold-dim);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  max-width: 320px;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.tutorial-annotation.visible {
  opacity: 1;
}
.tutorial-annotation-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 0.8125rem;
  color: var(--gold);
  letter-spacing: 0.05em;
  margin-bottom: 0.375rem;
}
.tutorial-annotation-text {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.875rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 0.625rem;
}
.tutorial-annotation-dismiss {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
}

/* --- Onboarding: Entry Choice Buttons --- */
.entry-choice-btn {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.entry-choice-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* --- Onboarding: Template Selection --- */
.template-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem;
}
.template-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.15s;
}
.template-card:hover {
  border-color: var(--gold-dim);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.template-card-name {
  font-family: 'Cinzel Decorative', serif;
  font-size: 0.9375rem;
  color: var(--gold);
  margin-bottom: 0.375rem;
}
.template-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.template-card-genre {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.template-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  padding: 0.0625rem 0.375rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.template-badge-sfw {
  background: rgba(46,204,113,0.15);
  color: #2ecc71;
  border: 1px solid rgba(46,204,113,0.3);
}
.template-badge-nsfw {
  background: rgba(231,76,60,0.15);
  color: #e74c3c;
  border: 1px solid rgba(231,76,60,0.3);
}
.template-card-summary {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.875rem;
  color: var(--text-dim);
  font-style: italic;
  line-height: 1.4;
}
.template-preview-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0;
}
.template-stat-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.125rem 0.5rem;
}
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
@media (max-width: 600px) {
  .template-grid { grid-template-columns: 1fr; }
}

/* INLINE STYLE REPLACEMENTS — utility classes for common patterns */
.setting-hint { font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.25rem; font-style: italic; }
.setting-sublabel { font-size: 0.8125rem; color: var(--gold-dim); text-transform: uppercase; letter-spacing: 1px; margin-top: 0.75rem; margin-bottom: 0.25rem; }
.setting-readonly { font-family: 'JetBrains Mono', monospace; font-size: 0.875rem; color: var(--text-dim); padding: 0.375rem 0.625rem; border: 1px solid var(--border); border-radius: 4px; background: rgba(255,255,255,0.02); opacity: 0.7; }
.setting-hint-warn { color: var(--gold-dim); margin-top: 0.5rem; padding: 0.375rem 0.625rem; border-left: 2px solid var(--gold-dim); background: rgba(201,168,76,0.05); font-size: 0.8125rem; font-style: italic; }
.panel-empty { font-size: 0.875rem; color: var(--text-muted); font-style: italic; }
.panel-empty-padded { font-size: 0.875rem; color: var(--text-muted); font-style: italic; padding: 0.5rem; }
.panel-prose { font-size: 0.9375rem; color: var(--text-dim); font-style: italic; }
.panel-prose-sm { font-size: 0.875rem; color: var(--text-dim); }
.panel-inline-label { font-size: 0.8125rem; color: var(--text-muted); }
.rival-epithet, .aemulus-epithet { font-size: 0.875rem; color: var(--text-muted); font-style: italic; margin-top: 0.25rem; }
.setup-hint { font-size: 0.875rem; color: var(--text-muted); text-align: center; font-style: italic; margin-top: 0.375rem; }
.schema-link { display: inline-block; margin-top: 0.25rem; color: var(--gold); text-decoration: underline; cursor: pointer; font-size: 0.85rem; }
.setup-prose { font-size: 0.875rem; color: var(--text-dim); font-style: italic; margin-bottom: 1rem; }
.form-input-compact { font-size: 0.875rem; padding: 0.25rem 0.5rem; }
.form-textarea-mono { font-family: 'JetBrains Mono', monospace; font-size: 0.8125rem; }
.form-textarea-compact { font-size: 0.8125rem; padding: 0.25rem 0.5rem; resize: vertical; }
.form-select-compact { font-size: 0.8125rem; padding: 0.25rem 0.5rem; }
.history-entry { font-size: 0.875rem; color: var(--text-dim); padding: 0.3125rem 0; border-bottom: 1px solid var(--border); position: relative; padding-right: 2.75rem; transition: opacity 0.2s; }
.history-entry:hover { color: var(--gold); }
.history-dimmed { opacity: 0.3; }
.history-rewind-btn { position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 0.875rem; color: var(--gold-dim); opacity: 0.5; transition: opacity 0.2s; background: none; border: none; cursor: pointer; padding: 0.125rem 0.25rem; }
.history-rewind-btn:hover { opacity: 1; color: var(--gold); }
.history-branch-btn { position: absolute; right: 1.25rem; top: 50%; transform: translateY(-50%); font-size: 0.875rem; color: var(--gold-dim); opacity: 0.5; transition: opacity 0.2s; background: none; border: none; cursor: pointer; padding: 0.125rem 0.25rem; }
.history-branch-btn:hover { opacity: 1; color: var(--gold); }
.history-quo-vadis { padding-right: 0; cursor: default; }
.history-quo-vadis:hover { color: var(--text-dim); }
.history-qv-label { font-family: 'Cinzel Decorative', serif; color: var(--gold-dim); }
.history-qv-answer { font-size: 0.8125rem; color: var(--text-muted); font-style: italic; margin-top: 0.125rem; }
.history-search { width: 100%; padding: 0.375rem 0.5rem; margin-bottom: 0.5rem; font-size: 0.8125rem; font-family: 'Crimson Pro', Georgia, serif; background: var(--bg-input, rgba(255,255,255,0.05)); border: 1px solid var(--border); border-radius: 4px; color: var(--text-dim); outline: none; box-sizing: border-box; }
.history-search:focus { border-color: var(--gold-dim); }
.history-search::placeholder { color: var(--text-muted); }
.label-muted-sm { font-size: 0.75rem; color: var(--text-muted); }
.label-dim { font-size: 0.875rem; color: var(--text-dim); }
.panel-footnote { font-size: 0.75rem; color: var(--text-muted); font-style: italic; text-align: center; }
.tier-badge { display: inline-block; padding: 0.0625rem 0.375rem; border-radius: 3px; font-size: 0.75rem; font-family: 'JetBrains Mono', monospace; color: var(--text-dim); margin-right: 0.25rem; vertical-align: 1px; }
.tier-suggested { font-size: 0.75rem; color: var(--text-muted); opacity: 0.7; }
.lbc-feedback { font-size: 0.8125rem; color: var(--text-dim); font-style: italic; }

/* RIVAL PROGRESS COLORS */
.rival-progress-lurking, .aemulus-progress-lurking { color: var(--text-muted); }
.rival-progress-advancing, .aemulus-progress-advancing { color: var(--gold); }
.rival-progress-threatening, .aemulus-progress-threatening { color: #c0392b; }
.rival-progress-confronting, .aemulus-progress-confronting { color: #e74c3c; font-weight: 600; }

/* REPUTATION BAR */
.reputation-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.125rem 0;
  font-size: 0.875rem;
  font-family: 'JetBrains Mono', monospace;
}
.reputation-name {
  flex: 1;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.reputation-bar-wrap {
  width: 60px;
  height: 6px;
  background: var(--surface2);
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}
.reputation-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.reputation-label {
  width: 65px;
  text-align: right;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.reputation-bar.reputation-hostile { background: var(--red-bright); }
.reputation-bar.reputation-unfriendly { background: var(--red); }
.reputation-bar.reputation-neutral { background: var(--text-muted); }
.reputation-bar.reputation-friendly { background: var(--gold-dim); }
.reputation-bar.reputation-allied { background: var(--gold); }
.reputation-bar.reputation-complicated { background: var(--gold-dim); }
.reputation-label.reputation-hostile { color: var(--red-bright); }
.reputation-label.reputation-unfriendly { color: var(--red); }
.reputation-label.reputation-neutral { color: var(--text-muted); }
.reputation-label.reputation-friendly { color: var(--gold-dim); }
.reputation-label.reputation-allied { color: var(--gold); }
.reputation-label.reputation-complicated { color: var(--gold-dim); }

/* NPC Personae */
.npc-row {
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--surface2);
}
.npc-row:last-child { border-bottom: none; }
.npc-name {
  color: var(--text-dim);
  font-size: 0.9375rem;
  font-family: 'Crimson Pro', serif;
}

/* STORY FACTS */
.story-fact-row { font-size: 0.9375rem; color: var(--text-dim); padding: 0.1875rem 0; border-bottom: 1px solid var(--surface2); font-family: 'Crimson Pro', serif; }
.story-fact-row:last-of-type { border-bottom: none; }

/* ARCANA */
.arcana-title { font-family: 'Cinzel Decorative', serif; color: var(--gold); }
.arcana-row { font-size: 0.9375rem; color: var(--text-dim); padding: 0.1875rem 0; border-bottom: 1px solid var(--surface2); }
.arcana-row:last-of-type { border-bottom: none; }
.arcana-label { font-family: 'Cinzel Decorative', serif; font-size: 0.875rem; color: var(--gold); margin-right: 0.25rem; }
.arcana-npc { color: var(--text); }
.arcana-count { font-family: 'JetBrains Mono', monospace; font-size: 0.8125rem; color: var(--text-muted); }
.arcana-recovering { font-family: 'JetBrains Mono', monospace; font-size: 0.8125rem; color: var(--gold-dim); }
.arcana-buffs { font-family: 'JetBrains Mono', monospace; font-size: 0.8125rem; color: var(--gold-dim); margin-top: 0.375rem; padding: 0.25rem 0; }

/* SPECULA DEBUG PANEL */
.specula-header { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0; }
.specula-actions { display: flex; gap: 0.375rem; }
.specula-actions button { font-size: 0.75rem; padding: 0.125rem 0.5rem; }
.specula-scene { margin-bottom: 0.75rem; }
.specula-scene-title { font-family: 'Cinzel Decorative', serif; font-size: 0.8125rem; color: var(--gold); border-bottom: 1px solid var(--surface2); padding-bottom: 0.25rem; margin-bottom: 0.375rem; }
.specula-entry { display: grid; grid-template-columns: 100px 80px 60px 60px auto; gap: 0.25rem; align-items: center; font-size: 0.75rem; color: var(--text-dim); padding: 0.1875rem 0; border-bottom: 1px solid var(--surface1); }
.specula-agent { font-family: 'Cinzel Decorative', serif; font-size: 0.8125rem; color: var(--gold); }
.specula-model { font-family: 'JetBrains Mono', monospace; font-size: 0.8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.specula-duration { font-family: 'JetBrains Mono', monospace; font-size: 0.8125rem; }
.specula-tokens { font-family: 'JetBrains Mono', monospace; font-size: 0.8125rem; }
.specula-toggle { cursor: pointer; color: var(--gold-dim); font-size: 0.8125rem; }
.specula-raw { display: none; grid-column: 1 / -1; max-height: 300px; overflow: auto; background: var(--surface1); padding: 0.375rem; border-radius: 4px; margin: 0.25rem 0; }
.specula-raw.open { display: block; }
.specula-raw pre { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: var(--text-dim); white-space: pre-wrap; word-break: break-all; margin: 0; }
.specula-empty { font-style: italic; color: var(--text-dim); font-size: 0.8125rem; padding: 1.25rem 0; text-align: center; }

/* HOW TO PLAY */
.htp-section { margin-bottom: 1.125rem; }
.htp-section p { font-family: 'Crimson Pro', Georgia, serif; font-size: 1rem; color: var(--text-dim); line-height: 1.6; margin: 0.375rem 0; }
.htp-latin { font-family: 'Cinzel Decorative', serif; color: var(--gold); }
.htp-formula { font-family: 'JetBrains Mono', monospace; font-size: 0.8125rem; color: var(--text); background: var(--surface2); padding: 0.5rem 0.75rem; border-radius: 4px; margin: 0.5rem 0; }
.htp-table { width: 100%; font-size: 0.875rem; font-family: 'JetBrains Mono', monospace; border-collapse: collapse; margin: 0.5rem 0; }
.htp-table th, .htp-table td { padding: 0.25rem 0.5rem; text-align: left; border-bottom: 1px solid var(--border); }
.htp-table th { color: var(--gold-dim); font-weight: normal; text-transform: uppercase; font-size: 0.8125rem; letter-spacing: 0.05em; }
.htp-table td { color: var(--text-dim); }
.htp-agents { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 0.75rem; font-size: 0.875rem; margin: 0.5rem 0; }
.htp-agents dt { font-family: 'Cinzel Decorative', serif; color: var(--gold); }
.htp-agents dd { font-family: 'Crimson Pro', Georgia, serif; color: var(--text-dim); margin: 0; }

/* --- Mind Map (Fatum tab) --- */
.mm-empty {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 1.5rem 0.5rem;
  text-align: center;
}
.mm-progress { padding: 0 0 0.5rem; }
.mm-progress-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.mm-progress-fill {
  height: 100%;
  background: var(--gold);
  transition: width 0.3s;
}
.mm-progress-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 0.125rem;
}
.mind-map-svg {
  width: 100%;
  display: block;
  margin-bottom: 0.5rem;
  background: var(--bg);
}
.mm-node { cursor: pointer; }
.mm-node:hover rect { filter: brightness(1.2); }
.mm-annotation-editor {
  border-top: 1px solid var(--border);
  padding: 0.625rem 0;
}
.mm-annotation-label {
  font-family: 'Cinzel Decorative', serif;
  font-size: 0.875rem;
  color: var(--gold-dim);
  margin-bottom: 0.375rem;
}
.mm-annotation-text {
  width: 100%;
  font-size: 0.9375rem;
  resize: vertical;
  margin-bottom: 0.375rem;
}
.mm-annotation-actions {
  display: flex;
  gap: 0.375rem;
}
.mm-annotation-actions .btn { font-size: 0.8125rem; padding: 0.1875rem 0.625rem; }
.mm-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0.25rem 0 0.5rem;
}
.mm-actions .btn { flex: 1; font-size: 0.8125rem; text-align: center; }
.mm-add-thread {
  border-top: 1px solid var(--border);
  padding: 0.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.mm-add-thread .form-input { font-size: 0.9375rem; padding: 0.25rem 0.5rem; }
.mm-add-thread .btn { font-size: 0.875rem; align-self: flex-end; }
.mm-edge--story { opacity: 0.6; }
.mm-edge--antagonistic { opacity: 0.8; }
.mm-edge--allied { opacity: 0.7; }
.mm-edge--neutral { opacity: 0.5; }
.mm-edge--custom { opacity: 0.5; }

/* Reduce motion — respect user preference */
@media (prefers-reduced-motion: reduce) {
  .narrative-col::before { animation: none; }
  .ambient-particle { animation: none; display: none; }
  .fortune-die-rolling { animation: none; }
  .fortune-die-settled { animation: none; }
}

@media (max-width: 640px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
  }
  .side-panel {
    display: none;
    position: fixed;
    top: 44px; left: 0; right: 0; bottom: 0;
    width: 100%;
    height: calc(100% - 44px);
    z-index: 900;
    border-left: none;
  }
  .side-panel.mobile-open {
    display: flex;
  }
  /* Panel tabs: scrollable row with all tabs visible, close button absolute */
  .panel-tabs {
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-right: 2.5rem; /* space for absolute close button */
    background: var(--bg);
    border-bottom: 1px solid var(--border);
  }
  .panel-tabs::-webkit-scrollbar { display: none; }
  .panel-tab {
    flex: 1 0 auto;
    padding: 0.875rem 0.625rem;
    font-size: 0.75rem;
    white-space: nowrap;
    min-width: 0;
  }
  .panel-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 40px;
    padding: 0;
    font-size: 1.5rem;
    background: var(--surface);
    border-left: 1px solid var(--border);
  }
  .narrative-scroll { padding: 1.25rem 1.25rem 1.5rem; box-shadow: none; }
  .challenge-prompt { padding: 0.75rem 1.25rem 0; }
  .input-row { padding: 0.5rem 1.25rem 0.75rem; }
  .topbar-pills { display: none; }
  .topbar { padding: 0.5rem 0.75rem; gap: 0.5rem; position: sticky; top: 0; }
  .game-title { font-size: 1.125rem; }
  .topbar-actions { gap: 0.25rem; }
  .icon-btn { padding: 0.25rem 0.375rem; font-size: 0.875rem; }
  .setup-screen { justify-content: flex-start; min-height: auto; padding: 1.5rem 1rem; }
  .setup-box { padding: 1.5rem; }
  .interview-container { max-height: none; }
  .interview-messages { max-height: 45vh; }
  .inline-input-area { padding-bottom: 1.5rem; }
  .inline-input-area .input-row { padding: 0.625rem 0 0; }
  .inline-input-area .input-controls-row { padding: 0.625rem 0 0; }
  .inline-input-area .input-textarea-row { padding: 0.5rem 0 0.375rem; }
  .input-row { padding: 0.5rem 1.25rem 1.25rem; }
  .input-controls-row { padding: 0.5rem 1.25rem 0; }
  .input-textarea-row { padding: 0.375rem 1.25rem 0.75rem; }
  .response-input { min-height: 90px; font-size: 1.1875rem; }
  .quo-vadis { top: -28px; padding: 0.625rem 0.75rem; }
  .last-call { top: -28px; padding: 0.625rem 0.75rem; }
  .last-call-latin { font-size: 1.0625rem; }
  .story-complete-title { font-size: 1.75rem; }
  .intro-title-large { letter-spacing: 0.2em; }

  .epigraph-latin { font-size: 1.1875rem; }
  .quo-vadis-latin { font-size: 1.0625rem; }
  .narrative-col::before { opacity: 0.06; animation: none; }
  .ambient-layer { display: none; }
}

/* Utility classes */
.font-mono { font-family: 'JetBrains Mono', monospace; }
.flex-col-stack { display: flex; flex-direction: column; gap: 0.5rem; }
.flex-row { display: flex; gap: 0.5rem; }
.flex-row-center { display: flex; align-items: center; gap: 0.5rem; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.spinner-center { margin: 0 auto; }
.mt-05 { margin-top: 0.5rem; }
.mt-075 { margin-top: 0.75rem; }
.mt-1 { margin-top: 1rem; }
.disabled-look { opacity: 0.4; cursor: not-allowed; }

/* Lorebook Chat (Expand World) */
.lorebook-chat-box { max-width: 560px; }
.lorebook-chat-box .interview-messages { max-height: 50vh; min-height: 200px; }
.lbc-entry-count { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: var(--gold-dim); text-align: right; margin-top: 0.25rem; }
.lbc-thinking-dots span { animation: thinkingDot 1.4s infinite; opacity: 0.2; font-size: 1.25rem; letter-spacing: 2px; }
.lbc-thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.lbc-thinking-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes thinkingDot { 0%, 80%, 100% { opacity: 0.2; } 40% { opacity: 1; } }

/* New Story overlay subtitles */
.new-story-subtitle {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.125rem;
}

/* Background lorebook compilation indicators */
.panel-tab-expanding::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  margin-left: 4px;
  vertical-align: middle;
  animation: expandPulse 1.2s ease-in-out infinite;
}
@keyframes expandPulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
.lore-expanding-banner {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  border-radius: 4px;
  padding: 0.375rem 0.625rem;
  margin-bottom: 0.5rem;
  animation: expandPulse 1.2s ease-in-out infinite;
}

/* Death scene & fable overlay */
.death-scene-label, .death-fable-label {
  font-family: 'Cinzel Decorative', serif;
  font-size: 0.875rem;
  color: var(--gold);
  margin: 1rem 0 0.5rem;
  letter-spacing: 0.5px;
}
.death-scene-label:first-child { margin-top: 0; }
.death-scene {
  font-family: 'Crimson Pro', Georgia, serif;
  font-style: italic;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-dim);
  white-space: pre-wrap;
}
.death-fable {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-dim);
  border-left: 2px solid var(--gold-dim);
  padding-left: 1rem;
  white-space: pre-wrap;
}

/* DOCS PAGE */
.docs-body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  height: auto;
  overflow: auto;
  padding: 0 0 0 13.75rem;
}

/* --- Sidebar --- */
.docs-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 220px;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow-y: auto;
  z-index: 100;
  flex-shrink: 0;
}

.docs-sidebar-header {
  padding: 1.25rem 1rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.docs-sidebar-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.375rem;
  color: var(--gold);
  font-weight: 700;
  display: block;
}

.docs-sidebar-version {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6875rem;
  color: var(--text-muted);
  display: block;
  margin-top: 0.125rem;
}

.docs-sidebar-links {
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
  flex: 1;
  overflow-y: auto;
}

.docs-sidebar-links li { margin: 0; }
.docs-sidebar-group { font-family: 'JetBrains Mono', monospace; font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold-dim); padding: 0.75rem 1rem 0.25rem; pointer-events: none; }
.docs-sidebar-group:first-child { padding-top: 0.375rem; }
.docs-sidebar-layer3 a { opacity: 0.65; }
.docs-sidebar-layer3 a:hover, .docs-sidebar-layer3 a.active { opacity: 1; }

.docs-sidebar-links a {
  display: block;
  padding: 0.4375rem 1rem;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.875rem;
  color: var(--text-dim);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.docs-sidebar-links a:hover {
  color: var(--gold);
  background: var(--surface2);
}

.docs-sidebar-links a.active {
  color: var(--gold);
  border-left-color: var(--gold);
  background: var(--surface2);
}

.docs-sidebar-actions {
  display: flex;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--border);
}

.docs-sidebar-action-btn {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-dim);
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.75rem;
  padding: 0.25rem 0;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.docs-sidebar-action-btn:hover {
  color: var(--gold);
  border-color: var(--gold-dim);
}

.docs-sidebar-back {
  display: block;
  padding: 0.75rem 1rem;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.8125rem;
  color: var(--gold-dim);
  text-decoration: none;
  border-top: 1px solid var(--border);
}
.docs-sidebar-back:hover { color: var(--gold); }

/* --- Menu button (mobile only) --- */
.docs-menu-btn {
  display: none;
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--gold);
  font-size: 1.375rem;
  padding: 0.25rem 0.625rem;
  cursor: pointer;
  line-height: 1;
}

/* --- Main content with sidebar offset --- */
#docs-content {
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem 2.5rem 4rem;
  box-sizing: border-box;
}

/* --- Header --- */
.docs-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.docs-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 2.25rem;
  color: var(--gold);
  margin: 0 0 0.25rem;
  font-weight: 700;
}

.docs-subtitle {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1.125rem;
  color: var(--text-dim);
  margin: 0 0 0.75rem;
  font-style: italic;
}
.docs-md-link {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}
.docs-md-link a { color: rgba(80,200,200,0.8); text-decoration: none; }
.docs-md-link a:hover { text-decoration: underline; }

.docs-version {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--surface2);
  padding: 0.125rem 0.5rem;
  border-radius: 3px;
  margin-bottom: 0.5rem;
}

.docs-back-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.875rem;
  color: var(--gold-dim);
  text-decoration: none;
}
.docs-back-link:hover { color: var(--gold); }

/* --- Sections (collapsible) --- */
.docs-section {
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  overflow: hidden;
}

.docs-section[open] {
  border-left: 3px solid var(--gold-dim);
}

.docs-section-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.125rem;
  color: var(--gold);
  padding: 0.875rem 1.125rem;
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.docs-section-title::-webkit-details-marker { display: none; }
.docs-section-title::before {
  content: '\25B8';
  display: inline-block;
  margin-right: 0.625rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: transform 0.15s;
}
.docs-section[open] > .docs-section-title::before {
  transform: rotate(90deg);
  color: var(--gold-dim);
}

.docs-section-content {
  padding: 0 1.125rem 1.125rem;
}

.docs-section-content p {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0.5rem 0;
}

.docs-section-content h3 {
  font-family: 'Cinzel Decorative', serif;
  font-size: 0.875rem;
  color: var(--gold-dim);
  margin: 1.25rem 0 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.docs-section-content code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  background: var(--surface2);
  padding: 0.0625rem 0.3125rem;
  border-radius: 3px;
  color: var(--text);
}

.docs-section-content strong { color: var(--text); }
.docs-section-content em { font-style: italic; color: var(--text); }

/* --- Tables --- */
.docs-table {
  width: 100%;
  font-size: 0.875rem;
  font-family: 'JetBrains Mono', monospace;
  border-collapse: collapse;
  margin: 0.625rem 0;
}

.docs-table th,
.docs-table td {
  padding: 0.375rem 0.625rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.docs-table th {
  color: var(--gold-dim);
  font-weight: normal;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.docs-table td { color: var(--text-dim); }

/* --- Formula blocks --- */
.docs-formula {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  color: var(--text);
  background: var(--surface2);
  padding: 0.625rem 0.875rem;
  border-radius: 4px;
  margin: 0.625rem 0;
  border-left: 3px solid var(--gold-dim);
}

/* --- Code blocks --- */
.docs-code-block {
  margin: 0.625rem 0;
}

.docs-code-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.docs-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  color: var(--text);
  background: var(--surface2);
  padding: 0.625rem 0.875rem;
  border-radius: 4px;
  margin: 0.25rem 0;
  overflow-x: auto;
  white-space: pre;
  line-height: 1.5;
}

/* --- Schema (collapsible code) --- */
.docs-schema {
  margin: 0.5rem 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface2);
}

.docs-schema > summary {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  color: var(--text-dim);
  padding: 0.375rem 0.75rem;
  cursor: pointer;
  user-select: none;
}
.docs-schema > summary:hover { color: var(--gold); }

.docs-schema .docs-code {
  margin: 0;
  border-radius: 0 0 4px 4px;
  border-top: 1px solid var(--border);
  max-height: 400px;
  overflow-y: auto;
}

/* --- Agent grid --- */
.docs-agent-grid {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin: 0.625rem 0;
}

.docs-agent {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface2);
}

.docs-agent > summary {
  padding: 0.5rem 0.875rem;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
}

.docs-agent-english {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.9375rem;
  color: var(--text);
  font-weight: 400;
}

.docs-agent-latin {
  font-family: 'Cinzel Decorative', serif;
  font-size: 0.8125rem;
  color: var(--gold-dim);
}

.docs-agent-body {
  padding: 0 0.875rem 0.75rem;
}

.docs-agent-body p {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.875rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 0.25rem 0;
}

.docs-agent-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem !important;
  color: var(--text-muted) !important;
}

/* --- Arc table (NSFW) --- */
.docs-arc {
  margin: 0.375rem 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface2);
}

.docs-arc > summary {
  font-family: 'Cinzel Decorative', serif;
  font-size: 0.875rem;
  color: var(--gold-dim);
  padding: 0.5rem 0.875rem;
  cursor: pointer;
  user-select: none;
}

.docs-arc-trigger {
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.75rem !important;
  color: var(--text-muted) !important;
  padding: 0 0.875rem;
  margin: 0 !important;
}

.docs-arc-stages {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.875rem;
  color: var(--text-dim);
  padding: 0.25rem 0.875rem 0.75rem 2rem;
  margin: 0;
  line-height: 1.6;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .docs-sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    width: 240px;
  }

  .docs-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0,0,0,0.5);
  }

  .docs-menu-btn {
    display: block;
  }

  .docs-body {
    padding-left: 0;
  }

  #docs-content {
    padding: 3.5rem 0.75rem 3rem;
  }

  .docs-title { font-size: 1.75rem; }
  .docs-section-title { font-size: 1rem; padding: 0.75rem 0.875rem; }
  .docs-section-content { padding: 0 0.875rem 0.875rem; }
  .docs-table { font-size: 0.75rem; }
  .docs-table th, .docs-table td { padding: 0.25rem 0.375rem; }
}

/* ORACLE WIDGET */
.oracle-widget-btn {
  position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 9000;
  width: 3rem; height: 3rem; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--gold-dim);
  color: var(--gold); font-size: 1.25rem; font-family: 'Cinzel Decorative', serif;
  cursor: pointer; transition: background 0.2s, border-color 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.oracle-widget-btn:hover { background: var(--surface2); border-color: var(--gold); }
.oracle-widget {
  position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 9001;
  width: 380px; max-height: 540px;
  background: var(--bg); border: 1px solid var(--gold-dim); border-radius: 8px;
  flex-direction: column; overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}
.oracle-header {
  display: flex; align-items: center; padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--border); gap: 0.5rem;
}
.oracle-title {
  flex: 1; font-family: 'Cinzel Decorative', serif; font-size: 0.875rem;
  color: var(--gold); letter-spacing: 0.05em;
}
.oracle-header-btn {
  background: none; border: none; color: var(--text-muted); font-size: 1rem;
  cursor: pointer; padding: 0.125rem 0.25rem; transition: color 0.15s;
}
.oracle-header-btn:hover { color: var(--gold); }
.oracle-messages {
  flex: 1; overflow-y: auto; padding: 0.75rem; min-height: 200px; max-height: 380px;
}
.oracle-msg { margin-bottom: 0.75rem; font-family: 'Crimson Pro', Georgia, serif; font-size: 0.9375rem; line-height: 1.55; }
.oracle-msg-user { text-align: right; color: var(--text-dim); }
.oracle-msg-agent { color: var(--text); }
.oracle-msg-agent strong { color: var(--gold); }
.oracle-msg-agent code { font-family: 'JetBrains Mono', monospace; font-size: 0.8125rem; background: var(--surface2); padding: 0.125rem 0.25rem; border-radius: 3px; }
.oracle-msg-empty { color: var(--text-muted); font-style: italic; }
.oracle-input-row {
  display: flex; align-items: flex-end; border-top: 1px solid var(--border);
  padding: 0.375rem;
}
.oracle-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text-dim); font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.9375rem; padding: 0.375rem 0.5rem; resize: none;
  min-height: 1.5rem; max-height: 4rem;
}
.oracle-input::placeholder { color: var(--text-muted); }
.oracle-send-btn {
  background: none; border: none; color: var(--gold-dim); font-size: 1.125rem;
  cursor: pointer; padding: 0.25rem 0.5rem; transition: color 0.15s;
}
.oracle-send-btn:hover { color: var(--gold); }

@media (max-width: 640px) {
  .oracle-widget {
    bottom: 0; right: 0; left: 0; width: 100%; max-height: 60vh;
    border-radius: 12px 12px 0 0; border-bottom: none;
  }
  .oracle-widget-btn { bottom: 0.75rem; right: 0.75rem; }
}
/* 25-feedback.css — Alea v0.108.0 */
/* Feedback modal — minimal additions, reuses overlay-box/proposal-card/form classes */

.feedback-error {
  color: var(--red-bright);
  font-size: 0.85rem;
  margin-top: 0.25rem;
  min-height: 1.2em;
}

.feedback-board-link {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-size: 0.85rem;
}

.feedback-board-link:hover {
  color: var(--gold-bright);
}

.feedback-char-count {
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}

.feedback-char-count.over-limit {
  color: var(--red-bright);
}

.feedback-cooldown {
  text-align: center;
  padding: 1rem 0;
  color: var(--text-dim);
}

.feedback-contact {
  font-size: 0.85rem;
}
