/* ==========================================================================
   A Pact of Ash & Velvet / Pacto de Ceniza y Terciopelo
   css/styles.css — Master Dark Romantasy Design System
   ========================================================================== */

:root {
  --bg-obsidian: #08090C;
  --bg-velvet: #0E0F14;
  --card-plum: #171220;
  --card-emerald: #0D1A17;
  --gold-antique: #D4AF37;
  --gold-light: #F3E5AB;
  --gold-dark: #8C7322;
  --wine-crimson: #8B1E3F;
  --wine-deep: #5A1227;
  --rose-gold: #E8B4B8;
  --ivory-champagne: #F9F6EE;
  --text-muted: #A3A8B5;
  --border-gold: rgba(212, 175, 55, 0.35);
  --border-glow: 0 0 15px rgba(212, 175, 55, 0.25);
  --font-display: 'Cinzel Decorative', 'Cinzel', Georgia, serif;
  --font-title: 'Cinzel', Georgia, serif;
  --font-body: 'Lora', Georgia, serif;
  --font-script: 'Cormorant Garamond', Georgia, serif;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --transition-smooth: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--bg-obsidian);
  color: var(--ivory-champagne);
}

body {
  font-family: var(--font-body);
  line-height: 1.75;
  background: radial-gradient(circle at top center, #191424 0%, #08090C 75%);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.65;
}

.app-container {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 20px 80px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* --- Top Utility Bar --- */
.top-utility-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(14, 15, 20, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  font-size: 1.4rem;
  color: var(--gold-antique);
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.brand-title {
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--ivory-champagne);
  text-transform: uppercase;
}

.utility-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-icon-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(22, 18, 30, 0.9);
  color: var(--ivory-champagne);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-family: var(--font-title);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-icon-text:hover {
  background: var(--wine-deep);
  border-color: var(--gold-antique);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 30, 63, 0.35);
}

.lang-switch {
  display: flex;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.lang-btn {
  background: rgba(14, 15, 20, 0.9);
  color: var(--text-muted);
  border: none;
  padding: 6px 12px;
  font-family: var(--font-title);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.lang-btn.active {
  background: var(--gold-antique);
  color: #08090C;
}

/* --- Hero Banner & Rival Profile --- */
.hero-rival-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  align-items: center;
  padding: 24px;
  background: linear-gradient(135deg, rgba(23, 18, 32, 0.95) 0%, rgba(13, 26, 23, 0.9) 100%);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7), inset 0 0 40px rgba(139, 30, 63, 0.15);
  position: relative;
  overflow: hidden;
}

.hero-rival-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.rival-portrait-wrapper {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, var(--gold-antique), var(--wine-crimson));
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}

.rival-portrait {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #111;
  position: relative;
  overflow: hidden;
  border: 2px solid #08090C;
}

.rival-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.rival-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rival-title-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.rival-name {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--ivory-champagne);
  letter-spacing: 1px;
}

.rival-badge {
  font-family: var(--font-title);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 3px 10px;
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold-antique);
  border: 1px solid var(--border-gold);
  border-radius: 20px;
}

.rival-mood-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-title);
  font-size: 0.95rem;
  color: var(--rose-gold);
}

.mood-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--wine-crimson);
  box-shadow: 0 0 8px var(--wine-crimson);
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.3); }
}

.rival-quote {
  font-family: var(--font-script);
  font-size: 1.2rem;
  font-style: italic;
  color: #cfc8b8;
  line-height: 1.5;
  border-left: 2px solid var(--gold-antique);
  padding-left: 14px;
  margin-top: 4px;
}

/* --- Relationship Dual Meters --- */
.relationship-meters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.meter-card {
  background: rgba(14, 15, 20, 0.85);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.meter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.meter-label-tension {
  color: var(--rose-gold);
  display: flex;
  align-items: center;
  gap: 6px;
}

.meter-label-trust {
  color: #A3E4D7;
  display: flex;
  align-items: center;
  gap: 6px;
}

.meter-val {
  font-size: 1.15rem;
  color: var(--ivory-champagne);
}

.progress-track {
  width: 100%;
  height: 14px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.2);
}

.progress-bar-tension {
  height: 100%;
  width: 25%;
  background: linear-gradient(90deg, #8B1E3F 0%, #D4AF37 50%, #E8B4B8 100%);
  border-radius: 10px;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 12px rgba(139, 30, 63, 0.8);
}

.progress-bar-trust {
  height: 100%;
  width: 15%;
  background: linear-gradient(90deg, #0D3B31 0%, #16A085 50%, #A3E4D7 100%);
  border-radius: 10px;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 12px rgba(22, 160, 133, 0.8);
}

/* --- Chapter Stepper Tracker --- */
.chapter-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(14, 15, 20, 0.75);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  overflow-x: auto;
  gap: 8px;
}

.step-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  opacity: 0.45;
  transition: var(--transition-smooth);
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.step-node.completed {
  opacity: 0.9;
}

.step-node.future {
  opacity: 0.28;
  cursor: not-allowed;
  pointer-events: none;
}

.step-node.active {
  opacity: 1;
  transform: scale(1.08);
}

.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-size: 0.85rem;
  font-weight: 700;
  background: rgba(22, 18, 30, 0.8);
  color: var(--ivory-champagne);
}

.step-node.completed .step-circle {
  background: rgba(212, 175, 55, 0.18);
  border-color: var(--gold-antique);
  color: var(--gold-antique);
}

.step-node.future .step-circle {
  border-style: dashed;
}

.step-node.active .step-circle {
  background: var(--wine-crimson);
  border-color: var(--gold-antique);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.6);
  color: var(--gold-antique);
}

.step-label {
  font-family: var(--font-title);
  font-size: 0.65rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.step-node.completed .step-label {
  color: var(--gold-antique);
}

.step-node.active .step-label {
  color: var(--gold-antique);
  font-weight: 700;
}

/* --- Main Story Stage Card --- */
.story-stage-card {
  background: rgba(18, 16, 26, 0.95);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  gap: 28px;
  transition: border-color 0.8s ease, box-shadow 0.8s ease;
}

/* Per-chapter atmospheric tint — same card, a different mood each time */
body[data-act-mood="frost"] .story-stage-card {
  border-color: rgba(140, 190, 230, 0.4);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7), inset 0 0 60px rgba(140, 190, 230, 0.05);
}

body[data-act-mood="blood"] .story-stage-card {
  border-color: rgba(139, 30, 63, 0.55);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7), inset 0 0 60px rgba(139, 30, 63, 0.08);
}

body[data-act-mood="ember"] .story-stage-card {
  border-color: rgba(232, 180, 184, 0.45);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7), inset 0 0 60px rgba(232, 180, 184, 0.06);
}

body[data-act-mood="steel"] .story-stage-card {
  border-color: rgba(212, 175, 55, 0.55);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7), inset 0 0 60px rgba(212, 175, 55, 0.06);
}

body[data-act-mood="destiny"] .story-stage-card {
  border-color: var(--gold-antique);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7), inset 0 0 80px rgba(212, 175, 55, 0.1);
}

/* Cinematic tremble — avalanche, duel clash, siege, or fate landing on the extremes */
.story-stage-card.tremble {
  animation: chapterTremble 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes chapterTremble {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-3px, 2px); }
  20% { transform: translate(4px, -2px); }
  30% { transform: translate(-4px, -1px); }
  40% { transform: translate(3px, 2px); }
  50% { transform: translate(-2px, -3px); }
  60% { transform: translate(2px, 1px); }
  70% { transform: translate(-2px, 2px); }
  80% { transform: translate(1px, -1px); }
  90% { transform: translate(-1px, 1px); }
}

@media (prefers-reduced-motion: reduce) {
  .story-stage-card.tremble {
    animation: none;
  }
}

/* Act Banner & Media */
.act-banner-wrapper {
  position: relative;
  width: 100%;
  height: 320px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-gold);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.7);
}

.act-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}

.act-banner-wrapper:hover .act-banner-img {
  transform: scale(1.03);
}

.btn-cinematic-pill {
  position: absolute;
  bottom: 16px;
  right: 18px;
  background: rgba(11, 12, 16, 0.85);
  backdrop-filter: blur(8px);
  color: var(--gold-light);
  border: 1px solid var(--gold-antique);
  border-radius: 30px;
  padding: 8px 18px;
  font-family: var(--font-title);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.6);
}

.btn-cinematic-pill:hover {
  background: var(--wine-crimson);
  color: var(--ivory-champagne);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.act-header {
  text-align: center;
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
  padding-bottom: 18px;
}

.act-badge {
  font-family: var(--font-title);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--gold-antique);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.act-title {
  font-family: var(--font-display);
  font-size: 2.1rem;
  color: var(--ivory-champagne);
  margin-bottom: 8px;
  line-height: 1.25;
}

.act-tagline {
  font-family: var(--font-script);
  font-size: 1.25rem;
  font-style: italic;
  color: var(--rose-gold);
}

.scene-body {
  font-size: 1.18rem;
  line-height: 1.9;
  color: #EDE8DF;
  text-align: justify;
}

.scene-body::first-letter {
  font-family: var(--font-display);
  font-size: 3.6rem;
  float: left;
  line-height: 0.8;
  margin-right: 12px;
  color: var(--gold-antique);
  text-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

/* --- Choices Section (Organic / Natural) --- */
.choices-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-label {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold-antique);
  display: flex;
  align-items: center;
  gap: 8px;
}

.choice-btn {
  background: rgba(26, 21, 36, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  text-align: left;
  color: var(--ivory-champagne);
  font-family: var(--font-body);
  font-size: 1.08rem;
  line-height: 1.6;
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.choice-btn::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--gold-antique);
  opacity: 0;
  transition: var(--transition-smooth);
}

.choice-btn:hover {
  background: rgba(45, 25, 45, 0.95);
  border-color: var(--gold-antique);
  transform: translateX(4px);
  box-shadow: 0 4px 20px rgba(139, 30, 63, 0.35);
}

.choice-btn:hover::before {
  opacity: 1;
}

.choice-btn.selected {
  background: rgba(85, 20, 45, 0.85);
  border-color: var(--gold-antique);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.35);
}

.choice-btn.selected::before {
  opacity: 1;
  background: var(--rose-gold);
}

.choice-feedback-box {
  background: rgba(14, 26, 23, 0.9);
  border: 1px solid #16A085;
  border-radius: var(--radius-md);
  padding: 18px 24px;
  font-size: 1.05rem;
  color: #D1F2EB;
  line-height: 1.7;
  font-style: italic;
  display: none;
  animation: fadeIn 0.4s ease-in-out;
}

.choice-feedback-box.visible {
  display: block;
}

/* --- The Oracle / D20 Fate Section --- */
.oracle-section {
  background: linear-gradient(135deg, rgba(23, 18, 32, 0.85) 0%, rgba(13, 26, 23, 0.85) 100%);
  border: 1px dashed var(--border-gold);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.oracle-info {
  max-width: 600px;
}

.oracle-title {
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: var(--gold-antique);
  letter-spacing: 1.5px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.oracle-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.oracle-controls {
  display: flex;
  align-items: center;
  gap: 20px;
}

.d20-container {
  width: 64px;
  height: 64px;
  position: relative;
  perspective: 400px;
}

.d20-die {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, #8B1E3F 20%, #200812 100%);
  border: 2px solid var(--gold-antique);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gold-light);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
  cursor: pointer;
  transition: transform 0.2s;
  user-select: none;
}

.d20-die.rolling {
  animation: rollD20 1.2s cubic-bezier(0.17, 0.89, 0.32, 1.28);
}

.d20-die.sealed {
  cursor: default;
  filter: saturate(0.6) brightness(0.85);
  border-color: var(--text-muted);
}

@keyframes rollD20 {
  0% { transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg) scale(0.9); }
  30% { transform: rotateX(360deg) rotateY(180deg) rotateZ(90deg) scale(1.2); }
  60% { transform: rotateX(720deg) rotateY(540deg) rotateZ(180deg) scale(1.1); }
  100% { transform: rotateX(1080deg) rotateY(720deg) rotateZ(360deg) scale(1); }
}

.oracle-result-box {
  width: 100%;
  margin-top: 14px;
  padding: 0;
  display: block;
  font-size: 0.95rem;
  color: #EDE8DF;
}

/* Oracle High-Stakes Peril Card (State A: Awaiting Fate) */
.oracle-peril-card {
  background: radial-gradient(circle at 10% 20%, rgba(139, 30, 63, 0.25), rgba(15, 12, 22, 0.95));
  border: 1px solid var(--border-gold);
  border-left: 4px solid var(--gold-antique);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.oracle-peril-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-title);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--gold-light);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.oracle-peril-text {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--ivory-champagne);
  margin-bottom: 12px;
}

.oracle-peril-hint {
  font-size: 0.86rem;
  color: var(--rose-gold);
  margin-bottom: 12px;
}

.oracle-tiers-guide {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(212, 175, 55, 0.2);
}

.oracle-tier-chip {
  background: rgba(22, 18, 30, 0.7);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.oracle-tier-chip strong {
  color: var(--gold-light);
}

/* Oracle Fate Sealed Twist Card (State B: Rolled) */
.oracle-twist-card {
  background: linear-gradient(135deg, rgba(28, 20, 38, 0.95), rgba(12, 10, 18, 0.98));
  border: 1px solid var(--gold-antique);
  border-left: 4px solid var(--gold-antique);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.25);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  animation: fadeIn 0.4s ease-out;
}

.oracle-twist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.oracle-twist-title {
  font-family: var(--font-display);
  font-size: 1.18rem;
  color: var(--gold-light);
  font-weight: 700;
}

.oracle-twist-modifiers {
  display: flex;
  gap: 8px;
}

.twist-mod-tag {
  font-family: var(--font-title);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}
.twist-mod-tag.tension {
  background: rgba(192, 57, 43, 0.35);
  border: 1px solid #E74C3C;
  color: #FF7675;
}
.twist-mod-tag.trust {
  background: rgba(41, 128, 185, 0.35);
  border: 1px solid #3498DB;
  color: #74B9FF;
}

.oracle-twist-body {
  font-size: 0.98rem;
  line-height: 1.7;
  color: #EDE8DF;
  margin-bottom: 12px;
}

.oracle-twist-hint {
  font-size: 0.84rem;
  color: var(--gold-light);
  font-style: italic;
  border-top: 1px dashed rgba(212, 175, 55, 0.25);
  padding-top: 8px;
}

/* --- Velvet Journal Section --- */
.journal-section {
  background: rgba(14, 15, 20, 0.9);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.journal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.journal-prompt-box {
  background: rgba(22, 18, 30, 0.6);
  border-left: 3px solid var(--wine-crimson);
  padding: 12px 18px;
  font-family: var(--font-script);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--rose-gold);
  line-height: 1.6;
}

.spark-block-btn {
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold-light);
  border: 1px solid var(--border-gold);
  border-radius: 20px;
  padding: 6px 14px;
  font-family: var(--font-title);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.spark-block-btn:hover {
  background: var(--gold-antique);
  color: #08090C;
}

.spark-toggle-arrow {
  font-size: 0.7rem;
  margin-left: 2px;
  color: var(--gold-light);
}

.sparks-drawer {
  display: none;
  flex-direction: column;
  gap: 10px;
  background: rgba(26, 21, 36, 0.95);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 14px;
  animation: fadeIn 0.3s ease;
}

.sparks-drawer.open {
  display: flex;
}

.sparks-title {
  font-family: var(--font-title);
  font-size: 0.78rem;
  letter-spacing: 1.2px;
  color: var(--gold-antique);
  text-transform: uppercase;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sparks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.spark-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 32px;
  background: rgba(14, 15, 20, 0.8);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 1rem;
  font-style: italic;
  color: var(--ivory-champagne);
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  line-height: 1.5;
  user-select: none;
}

.spark-text {
  flex: 1;
}

.btn-spark-story-chip {
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.45);
  color: var(--gold-light);
  font-family: var(--font-title);
  font-size: 0.72rem;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-spark-story-chip:hover {
  background: var(--gold-antique);
  color: #08080c;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
  transform: scale(1.05);
}

.spark-item::before {
  content: '✦';
  position: absolute;
  left: 12px;
  top: 10px;
  color: var(--gold-antique);
  font-size: 0.8rem;
}

.spark-item:hover {
  background: rgba(88, 16, 28, 0.45);
  border-color: var(--gold-light);
  color: #FFFFFF;
  transform: translateX(4px);
}

.spark-item.spark-inserted {
  background: rgba(212, 175, 55, 0.25) !important;
  border-color: var(--gold-antique) !important;
  color: #FFFFFF !important;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.3);
}

.journal-textarea {
  width: 100%;
  min-height: 170px;
  background: rgba(8, 9, 12, 0.9);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: var(--radius-sm);
  padding: 16px;
  color: #FAF6EF;
  font-family: var(--font-body);
  font-size: 1.1rem;
  line-height: 1.8;
  resize: vertical;
  transition: border-color 0.3s;
}

.journal-textarea:focus {
  outline: none;
  border-color: var(--gold-antique);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.25);
}

.journal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.save-status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #52BE80;
}

/* --- Bottom Nav & Action Bar --- */
.bottom-nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0 0 0;
  border-top: 1px solid rgba(212, 175, 55, 0.2);
}

.btn-primary {
  background: linear-gradient(135deg, var(--wine-crimson) 0%, var(--wine-deep) 100%);
  color: var(--ivory-champagne);
  border: 1px solid var(--gold-antique);
  border-radius: var(--radius-md);
  padding: 14px 28px;
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 15px rgba(139, 30, 63, 0.4);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #a6244c 0%, var(--wine-crimson) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(212, 175, 55, 0.4);
}

.btn-secondary {
  background: rgba(22, 18, 30, 0.9);
  color: var(--ivory-champagne);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 14px 24px;
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-secondary:hover {
  background: rgba(35, 28, 48, 0.95);
  border-color: var(--gold-antique);
}

/* --- Modals & Drawers --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-card {
  background: #111018;
  border: 1px solid var(--gold-antique);
  border-radius: var(--radius-lg);
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 30px;
  position: relative;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.9), 0 0 30px rgba(212, 175, 55, 0.2);
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 18px;
  z-index: 50;
  background: none;
  border: none;
  color: var(--gold-antique);
  font-size: 1.8rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.modal-close-btn:hover {
  transform: rotate(90deg);
  color: var(--rose-gold);
}

.vintage-letter-card #btn-close-vintage-letter {
  z-index: 60;
  top: 18px;
  right: 24px;
  color: #7a5e42;
}

.vintage-letter-card #btn-close-vintage-letter:hover {
  color: #8B1E3F;
}

/* Cinematic Video Player Modal */
.video-player-container {
  width: 100%;
  max-width: 720px;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-gold);
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
  margin-top: 16px;
}

.video-player-elem {
  width: 100%;
  height: auto;
  max-height: 480px;
  display: block;
}

/* Letters & Tarot Grids */
.letters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.letter-item {
  background: #181422;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 20px;
  position: relative;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.letter-item:hover {
  transform: translateY(-3px);
  border-color: var(--gold-antique);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

.wax-seal {
  width: 38px;
  height: 38px;
  background: radial-gradient(circle, #8B1E3F 0%, #4D0E20 100%);
  border-radius: 50%;
  border: 2px solid var(--gold-antique);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-light);
  font-size: 1.1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  margin-bottom: 12px;
}

.letter-title {
  font-family: var(--font-title);
  font-size: 1rem;
  color: var(--ivory-champagne);
  margin-bottom: 6px;
}

.letter-sender {
  font-size: 0.85rem;
  color: var(--rose-gold);
  font-style: italic;
}

.tarot-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.tarot-card-thumb {
  background: #14111E;
  border: 1px solid var(--border-gold);
  border-radius: 10px;
  padding: 16px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.tarot-card-thumb.locked {
  opacity: 0.3;
  filter: grayscale(1);
}

.tarot-card-thumb:not(.locked):hover {
  border-color: var(--gold-antique);
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.3);
}

.tarot-icon {
  font-size: 2.2rem;
}

.tarot-name {
  font-family: var(--font-title);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold-antique);
  line-height: 1.3;
}

.tarot-arcana {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.audio-slider-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}

.audio-slider {
  flex: 1;
  accent-color: var(--wine-crimson);
}

#social-preview-canvas {
  width: 100%;
  max-width: 380px;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 0 30px rgba(0,0,0,0.8);
  margin: 0 auto;
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .hero-rival-card {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .rival-portrait-wrapper {
    margin: 0 auto;
  }
  .rival-title-row {
    justify-content: center;
  }
  .rival-quote {
    border-left: none;
    border-top: 1px solid var(--gold-antique);
    padding-left: 0;
    padding-top: 8px;
  }
  .relationship-meters-grid {
    grid-template-columns: 1fr;
  }
  .story-stage-card {
    padding: 24px 20px;
  }
  .act-title {
    font-size: 1.6rem;
  }
  .act-banner-wrapper {
    height: 220px;
  }
}

/* ==========================================================================
   Cinematic Interactive Intro & 2.39:1 Anamorphic CinemaScope Styles
   ========================================================================== */
.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 15000;
  background: var(--bg-obsidian);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 68px 16px;
  box-sizing: border-box;
  transition: opacity 1.4s cubic-bezier(0.25, 1, 0.5, 1), visibility 1.4s;
}

.intro-overlay::-webkit-scrollbar {
  width: 8px;
}
.intro-overlay::-webkit-scrollbar-track {
  background: rgba(8, 9, 12, 0.8);
}
.intro-overlay::-webkit-scrollbar-thumb {
  background: var(--gold-antique);
  border-radius: 4px;
}

.intro-overlay:not(.active) {
  display: none;
}

.intro-overlay.dismissed {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Anamorphic Letterboxing Bars (Fixed & Click-through) */
.letterbox-bar {
  position: fixed;
  left: 0;
  right: 0;
  height: 52px;
  background: #000000;
  z-index: 15002;
  pointer-events: none;
  transition: transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}
.letterbox-top { top: 0; }
.letterbox-bottom { bottom: 0; }
.intro-overlay.dismissed .letterbox-top { transform: translateY(-100%); }
.intro-overlay.dismissed .letterbox-bottom { transform: translateY(100%); }

/* Background Video & Scrim */
.intro-video-wrapper {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}
.intro-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: kenBurnsZoom 24s ease-in-out infinite alternate;
  filter: brightness(0.72) contrast(1.15) saturate(0.9);
}

@keyframes kenBurnsZoom {
  0% { transform: scale(1.0) translateY(0); }
  100% { transform: scale(1.08) translateY(-2%); }
}

.intro-vignette-scrim {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(8,9,12,0.25) 0%, rgba(14,15,20,0.85) 75%, #08090C 100%);
}

.intro-fog-layer {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at bottom, rgba(212,175,55,0.08) 0%, transparent 65%);
  pointer-events: none;
}

/* Intro Particle Canvas */
#intro-particles-canvas {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

/* Stage Container & Typography */
.intro-stage-container {
  position: relative;
  z-index: 15001;
  max-width: 820px;
  width: 100%;
  margin: auto 0;
  text-align: center;
  padding: 10px 0;
  box-sizing: border-box;
}

.wax-emblem-badge {
  font-size: 2.4rem;
  color: var(--gold-antique);
  text-shadow: 0 0 15px rgba(212, 175, 55, 0.6);
  margin-bottom: 8px;
}

.intro-epic-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.5vw, 3.2rem);
  color: var(--gold-antique);
  text-shadow: 0 0 25px rgba(212, 175, 55, 0.55), 0 4px 15px rgba(0,0,0,0.9);
  letter-spacing: 5px;
  margin-bottom: 8px;
  line-height: 1.2;
}

.intro-epic-tagline {
  font-family: var(--font-script);
  font-size: clamp(1.1rem, 2.5vw, 1.45rem);
  font-style: italic;
  color: var(--rose-gold);
  margin-bottom: 24px;
}

/* Synopsis Box & Dots */
.synopsis-carousel {
  background: rgba(14, 15, 20, 0.88);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 24px 30px;
  margin-bottom: 24px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.8);
}

.synopsis-card-content {
  font-size: clamp(1.05rem, 2vw, 1.22rem);
  line-height: 1.8;
  color: #EDE8DF;
  min-height: 75px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.synopsis-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}
.synopsis-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.3);
  transition: var(--transition-smooth);
}
.synopsis-dots .dot.active {
  background: var(--gold-antique);
  box-shadow: 0 0 8px var(--gold-antique);
}

.intro-action-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.btn-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-title);
  font-size: 0.85rem;
  letter-spacing: 1px;
  text-decoration: underline;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.btn-link:hover {
  color: var(--gold-light);
}

/* Covenant & Character Creation */
.covenant-card {
  background: rgba(14, 15, 20, 0.96);
  border: 1px solid var(--gold-antique);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.9), 0 0 35px rgba(212, 175, 55, 0.25);
  text-align: left;
  max-width: 740px;
  margin: 0 auto;
  box-sizing: border-box;
}

.covenant-kicker {
  font-family: var(--font-title);
  font-size: 0.85rem;
  letter-spacing: 3px;
  color: var(--gold-antique);
  text-transform: uppercase;
}

.covenant-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.6;
}

.input-with-button {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.archetype-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.archetype-option {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(24, 20, 34, 0.85);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.archetype-radio {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border-gold);
  flex-shrink: 0;
  transition: var(--transition-smooth);
}

.archetype-option.active {
  border-color: var(--gold-antique);
  background: rgba(77, 14, 32, 0.45);
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.3);
}

.archetype-option.active .archetype-radio {
  border-color: var(--gold-antique);
  background: var(--gold-antique);
  box-shadow: 0 0 6px var(--gold-antique);
}

.archetype-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.arch-name {
  color: var(--ivory-champagne);
  font-size: 0.95rem;
}
.arch-desc {
  font-size: 0.82rem;
  color: var(--rose-gold);
}

.btn-covenant-seal {
  width: 100%;
  margin-top: 20px;
  background: linear-gradient(135deg, #8B1E3F 0%, #4D0E20 100%);
  border: 1px solid var(--gold-antique);
  color: var(--gold-light);
  padding: 15px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-title);
  font-size: 1rem;
  letter-spacing: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(139, 30, 63, 0.5);
  transition: var(--transition-smooth);
}
.btn-covenant-seal:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 26px rgba(212, 175, 55, 0.45);
}

/* ==========================================================================
   Image Lightbox & Hover Expander Styles
   ========================================================================== */
.expandable-img-wrap {
  position: relative;
  cursor: zoom-in;
  overflow: hidden;
  border-radius: inherit;
}

.expandable-img {
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.expandable-img-wrap:hover .expandable-img {
  transform: scale(1.03);
}

.expand-hint-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(8, 9, 12, 0.85);
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  font-family: var(--font-title);
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.6);
  z-index: 5;
}

.expandable-img-wrap:hover .expand-hint-badge {
  opacity: 1;
}

.lightbox-overlay {
  background: rgba(0, 0, 0, 0.94) !important;
  backdrop-filter: blur(12px) !important;
  z-index: 20000 !important;
  display: none;
  align-items: center;
  justify-content: center;
}

.lightbox-overlay.open {
  display: flex !important;
  animation: fadeIn 0.3s ease forwards;
}

.lightbox-container {
  position: relative;
  max-width: 92vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 78vh;
  border-radius: var(--radius-md);
  border: 2px solid var(--gold-antique);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.9), 0 0 30px rgba(212, 175, 55, 0.3);
  object-fit: contain;
  animation: zoomIn 0.35s ease;
}

@keyframes zoomIn {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1.0); opacity: 1; }
}

.lightbox-caption {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--gold-light);
  margin-top: 14px;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0,0,0,0.9);
  letter-spacing: 1px;
}

.lightbox-close-btn {
  position: absolute;
  top: -45px;
  right: 0;
  font-size: 2.4rem;
  color: var(--gold-antique);
  background: none;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.lightbox-close-btn:hover {
  transform: rotate(90deg) scale(1.1);
  color: var(--rose-gold);
}

/* ==========================================================================
   Settings Modal & Accessibility Typography Styles
   ========================================================================== */
.settings-group {
  background: rgba(18, 14, 25, 0.6);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
}

.settings-subheading {
  font-family: var(--font-title);
  font-size: 0.9rem;
  color: var(--gold-antique);
  margin-bottom: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: #EDE8DF;
}

.setting-row:last-child {
  margin-bottom: 0;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .3s;
  border-radius: 24px;
  border: 1px solid rgba(212, 175, 55, 0.4);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--wine-crimson);
  border-color: var(--gold-antique);
}

input:checked + .toggle-slider:before {
  transform: translateX(22px);
  background-color: var(--gold-light);
  box-shadow: 0 0 6px var(--gold-antique);
}

/* Segmented Control */
.segmented-control {
  display: flex;
  background: rgba(8, 9, 12, 0.7);
  border: 1px solid var(--border-gold);
  border-radius: 20px;
  padding: 3px;
  gap: 4px;
}

.font-size-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-title);
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.font-size-btn.active {
  background: var(--wine-crimson);
  color: white;
  border: 1px solid var(--gold-antique);
  box-shadow: 0 2px 8px rgba(139, 30, 63, 0.4);
}

/* Dynamic Typography Scalers on Body */
body.font-size-normal .scene-body { font-size: 1.05rem; line-height: 1.8; }
body.font-size-large .scene-body { font-size: 1.18rem; line-height: 1.95; }
body.font-size-xlarge .scene-body { font-size: 1.32rem; line-height: 2.1; }

body.font-size-normal .journal-textarea { font-size: 1.05rem; }
body.font-size-large .journal-textarea { font-size: 1.2rem; }
body.font-size-xlarge .journal-textarea { font-size: 1.35rem; }

@media (max-width: 680px) {
  .intro-overlay {
    padding: 46px 12px 60px 12px;
  }
  .letterbox-bar {
    height: 38px;
  }
  .covenant-card {
    padding: 16px 18px;
  }
  .covenant-subtitle {
    font-size: 0.85rem;
  }
  .archetype-selector {
    grid-template-columns: 1fr;
  }
  .btn-covenant-seal {
    padding: 13px 18px;
    font-size: 0.88rem;
    letter-spacing: 1px;
  }
}

/* ==========================================================================
   Act Tarot Relic Section & Chapter Progression Checklist
   ========================================================================== */
.act-tarot-section {
  margin-top: 32px;
  background: linear-gradient(135deg, rgba(26, 20, 36, 0.95), rgba(12, 14, 18, 0.95));
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  position: relative;
  overflow: hidden;
}

.act-tarot-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-antique), transparent);
}

.tarot-reveal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  padding-bottom: 10px;
}

.tarot-status-badge {
  font-family: var(--font-title);
  font-size: 0.75rem;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
  text-transform: uppercase;
  transition: var(--transition-smooth);
}

.tarot-status-badge.pending {
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: var(--gold-light);
}

.tarot-status-badge.completed {
  background: rgba(46, 125, 50, 0.25);
  border: 1px solid #4CAF50;
  color: #A5D6A7;
}

.act-tarot-card-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  background: rgba(10, 11, 15, 0.6);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
}

.tarot-card-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 260px;
}

.tarot-preview-icon {
  font-size: 2.4rem;
  color: var(--gold-antique);
  filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.5));
  width: 50px;
  text-align: center;
}

.tarot-preview-arcana {
  font-family: var(--font-title);
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  color: var(--gold-light);
  text-transform: uppercase;
}

.tarot-preview-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--ivory-champagne);
  margin: 2px 0 4px 0;
}

.tarot-preview-teaser {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 0;
}

/* Chapter Checklist Section */
.act-checklist-section {
  margin-top: 30px;
  background: rgba(14, 15, 20, 0.9);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: var(--radius-md);
  padding: 20px;
}

.checklist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.checklist-title {
  font-family: var(--font-title);
  font-size: 0.8rem;
  letter-spacing: 1.5px;
  color: var(--gold-antique);
  font-weight: 600;
  text-transform: uppercase;
}

.checklist-counter {
  font-family: var(--font-title);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.15);
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid var(--border-gold);
}

.checklist-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

@media (max-width: 768px) {
  .checklist-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.checklist-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  transition: var(--transition-smooth);
  user-select: none;
}

.checklist-pill.pending {
  background: rgba(20, 22, 28, 0.7);
  border: 1px dashed rgba(212, 175, 55, 0.3);
  color: var(--text-muted);
}

.checklist-pill.completed {
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid var(--gold-antique);
  color: #FFFFFF;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.checklist-pill .pill-icon {
  font-size: 1rem;
}

.checklist-pill .pill-text {
  flex: 1;
  font-family: var(--font-title);
  font-size: 0.78rem;
  letter-spacing: 0.5px;
}

.checklist-pill .pill-status {
  font-weight: bold;
}

.checklist-pill.completed .pill-status {
  color: #81C784;
}

.checklist-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
}

/* Locked Next Button State */
.btn-primary.locked-btn {
  background: rgba(30, 25, 40, 0.7) !important;
  border: 1px solid rgba(212, 175, 55, 0.3) !important;
  color: var(--text-muted) !important;
  cursor: pointer;
  box-shadow: none !important;
}

.btn-primary.locked-btn:hover {
  border-color: var(--wine-crimson) !important;
  color: var(--rose-gold) !important;
}

.btn-primary.unlocked-btn {
  background: var(--gold-antique) !important;
  color: #08090C !important;
  font-weight: 700 !important;
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.4) !important;
}


/* --- Chapter Clandestine Missive / Interactive Wax Sealed Letter Section --- */
.act-letter-section {
  background: rgba(14, 15, 20, 0.9);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-top: 24px;
}

.letter-reveal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.letter-status-badge {
  font-family: var(--font-title);
  font-size: 0.75rem;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 700;
}

.letter-status-badge.pending {
  background: rgba(220, 53, 69, 0.2);
  border: 1px solid rgba(220, 53, 69, 0.6);
  color: #FF7675;
}

.letter-status-badge.unlocked {
  background: rgba(46, 204, 113, 0.2);
  border: 1px solid #2ECC71;
  color: #81C784;
}

.envelope-sealed-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, rgba(25, 20, 32, 0.8), rgba(12, 10, 16, 0.95));
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  padding: 18px;
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
  outline: none;
}

.envelope-sealed-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold-antique);
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.3);
}

.envelope-img-wrap {
  position: relative;
  width: 140px;
  height: 105px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--gold-antique);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.envelope-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.envelope-sealed-card:hover .envelope-thumb-img {
  transform: scale(1.08);
}

.wax-seal-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  background: radial-gradient(circle, #8B1E3F 30%, #400818 100%);
  border: 2px solid var(--gold-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.7);
  color: var(--gold-light);
  font-size: 1.2rem;
}

.envelope-meta-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.letter-sender-tag {
  font-family: var(--font-title);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--gold-light);
  text-transform: uppercase;
}

.letter-title-text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--ivory-champagne);
  margin: 0;
}

.letter-teaser-text {
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.letter-action-row {
  margin-top: 6px;
}

.btn-open-letter-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  padding: 8px 16px;
  pointer-events: none;
}

/* --- Vintage Letter Modal & Aged Parchment Sheet --- */
.vintage-letter-card {
  max-width: 680px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.vintage-parchment-sheet {
  background: #F4EAD4;
  background-image: 
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.2), rgba(210, 185, 145, 0.4)),
    linear-gradient(135deg, rgba(245, 235, 215, 0.95), rgba(225, 205, 170, 0.98));
  border: 12px double #8B7355;
  border-radius: 8px;
  padding: 36px 40px;
  box-shadow: 
    0 0 35px rgba(0, 0, 0, 0.85),
    inset 0 0 40px rgba(139, 115, 85, 0.35);
  color: #241C16;
  position: relative;
  overflow: hidden;
  animation: fadeIn 0.4s ease-out;
}

.vintage-parchment-sheet::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 6px;
  right: 6px;
  bottom: 6px;
  border: 1px solid rgba(139, 115, 85, 0.45);
  pointer-events: none;
}

.parchment-crest-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 16px;
}

.parchment-wax-seal {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(100, 20, 30, 0.5);
  border: 2px solid #8B1E3F;
}

.parchment-wax-seal-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.parchment-seal-name {
  font-family: var(--font-title);
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #6D2132;
  margin-top: 6px;
  font-weight: 700;
}

.vintage-script-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: #2D1820;
  text-align: center;
  margin-bottom: 4px;
}

.parchment-epistolary-meta {
  text-align: center;
  font-family: var(--font-title);
  font-size: 0.85rem;
  color: #7D5C43;
  margin-bottom: 24px;
  border-bottom: 1px dashed rgba(139, 115, 85, 0.4);
  padding-bottom: 12px;
}

.parchment-letter-body {
  font-family: var(--font-script);
  font-size: 1.45rem;
  line-height: 1.8;
  color: #1A130F;
  white-space: pre-wrap;
  margin-bottom: 28px;
  padding: 0 10px;
}

.parchment-footer {
  text-align: center;
  border-top: 1px solid rgba(139, 115, 85, 0.35);
  padding-top: 20px;
}

/* 5-Column Checklist Grid */
.checklist-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr) !important;
  gap: 8px;
  margin-bottom: 12px;
}

@media (max-width: 992px) {
  .checklist-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

@media (max-width: 600px) {
  .checklist-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .envelope-sealed-card {
    flex-direction: column;
    text-align: center;
  }
  .envelope-img-wrap {
    width: 100%;
    height: 140px;
  }
  .vintage-parchment-sheet {
    padding: 24px 18px;
  }
  .parchment-letter-body {
    font-size: 1.25rem;
  }
}

/* ==========================================================================
   Expanded Chapter Mechanics — Timed Choices, Ash, Wax Pact, QTE, Tarot Spread
   ========================================================================== */

/* --- Timed Choice ("The Pulse of Fate") --- */
.choice-timer-wrap {
  margin-bottom: 14px;
}

.choice-timer-label {
  font-family: var(--font-title);
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  color: var(--rose-gold);
  margin-bottom: 6px;
}

.choice-timer-track {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  overflow: hidden;
}

.choice-timer-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--wine-crimson), var(--gold-antique));
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
}

.choice-ash-tag {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-style: italic;
}

/* --- Ash Meter --- */
.meter-label-ash {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.progress-bar-ash {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3A3A3F 0%, #8C7322 60%, var(--gold-antique) 100%);
  border-radius: 10px;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 12px rgba(140, 115, 34, 0.6);
}

/* --- The Pact of Ash: Wax Seal Ritual --- */
.act-pact-section {
  background: rgba(14, 15, 20, 0.85);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
}

.pact-reveal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.pact-status-badge {
  font-family: var(--font-title);
  font-size: 0.75rem;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 700;
}

.pact-status-badge.pending {
  background: rgba(220, 53, 69, 0.2);
  border: 1px solid rgba(220, 53, 69, 0.6);
  color: #FF7675;
}

.pact-status-badge.completed {
  background: rgba(46, 204, 113, 0.2);
  border: 1px solid #2ECC71;
  color: #81C784;
}

.pact-desc-text {
  font-family: var(--font-script);
  font-size: 1.05rem;
  color: var(--ivory-champagne);
  line-height: 1.6;
  margin-bottom: 16px;
}

.wax-seal-ritual-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.wax-seal-ritual-btn {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 2px solid var(--border-gold);
  background: radial-gradient(circle, #2A0E14 0%, #14111E 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  user-select: none;
  touch-action: none;
}

.wax-seal-fill {
  position: absolute;
  width: 130%;
  height: 130%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--wine-crimson) 0%, var(--wine-deep) 70%);
  transform: scale(0);
  transform-origin: center;
}

.wax-seal-ritual-icon {
  position: relative;
  z-index: 1;
  font-size: 2rem;
  filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.6));
}

.wax-seal-ritual-btn.sealed {
  border-color: var(--gold-antique);
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.5);
  cursor: default;
}

.wax-seal-hint {
  font-family: var(--font-title);
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  text-align: center;
}

/* --- Sensorial QTE (Waltz / Duel) --- */
.act-qte-section {
  background: rgba(14, 15, 20, 0.85);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
}

.qte-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.qte-status-badge {
  font-family: var(--font-title);
  font-size: 0.75rem;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 700;
}

.qte-status-badge.pending {
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: var(--gold-light);
}

.qte-status-badge.completed {
  background: rgba(46, 125, 50, 0.25);
  border: 1px solid #4CAF50;
  color: #A5D6A7;
}

.qte-desc-text {
  font-family: var(--font-script);
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.qte-stage {
  position: relative;
  width: 100%;
  height: 220px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px dashed var(--border-gold);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.qte-target {
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid var(--gold-antique);
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.7);
  cursor: pointer;
  animation: qteShrink 1.4s linear forwards;
}

.qte-target.hit {
  animation: none;
  border-color: #4CAF50;
  box-shadow: 0 0 14px rgba(76, 175, 80, 0.8);
  transform: scale(1.3);
  opacity: 0;
  transition: all 0.25s ease-out;
}

@keyframes qteShrink {
  0% { transform: scale(1.6); opacity: 0.9; }
  100% { transform: scale(0.2); opacity: 0.2; }
}

.qte-result-text {
  margin-top: 14px;
  font-family: var(--font-script);
  font-size: 1.05rem;
  color: var(--rose-gold);
  line-height: 1.6;
}

/* --- Expanded Tarot Spread (Act 6 Shadow / Act 10 Past & Future) --- */
.tarot-extra-wrap {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.tarot-extra-tile {
  flex: 1;
  min-width: 130px;
  background: #14111E;
  border: 1px solid var(--border-gold);
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.tarot-extra-tile:hover {
  border-color: var(--gold-antique);
  transform: translateY(-3px);
}

.tarot-extra-tile.revealed {
  border-color: var(--gold-antique);
  background: rgba(212, 175, 55, 0.06);
}

.tarot-extra-slot {
  font-family: var(--font-title);
  font-size: 0.68rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.tarot-extra-icon {
  font-size: 1.6rem;
  margin-bottom: 6px;
}

.tarot-extra-name {
  font-family: var(--font-script);
  font-size: 0.85rem;
  color: var(--ivory-champagne);
}

@media (max-width: 600px) {
  .wax-seal-ritual-btn {
    width: 76px;
    height: 76px;
  }
  .qte-stage {
    height: 180px;
  }
  .tarot-extra-wrap {
    flex-direction: column;
  }
}
