/* ===== 10-13.html ===== */
:root {
  --bg: #080c14;
  --bg2: #0e1320;
  --bg3: #13192e;
  --text: #ddd4c0;
  --text-dim: #8a8070;
  --accent: #c8a46a;
  --accent2: #7a9cc8;
  --divider: #2a3050;
  --ram: #e87aaa;
  --emilia: #aac8ec;
  --bordeaux: #d04040;
  --marcos: #8a9ab0;
  --fiore: #f0c060;
  --sakura: #c08ad0;
  --felt: #e8a050;
  --reinhard: #5090d8;
  --witch: #9040a0;
  --narrator: #ddd4c0;
  --krusch: #5aaa7a;
  --tiga: #d4a060;
  --beatrice: #b08adc;
  --subaru: #90b8e0;
}

/* ── Light theme overrides ── */
body.light-theme {
  --bg: #f0ebe0;
  --bg2: #e8e2d4;
  --bg3: #ddd7c8;
  --text: #1a1610;
  --text-dim: #6a5e4a;
  --accent: #8a5e1a;
  --accent2: #2a5888;
  --divider: #c8bca0;
}

body.light-theme header {
  background: rgba(240,235,224,0.97);
  border-bottom-color: rgba(138,94,26,0.15);
}

body.light-theme p.italic-narr {
  color: #3a3020;
}

body.light-theme p.thought {
  color: #4a3e2a;
  border-left-color: rgba(138,94,26,0.4);
}

body.light-theme .inner-fire {
  color: #5a3a10;
  border-left-color: var(--accent);
}

body.light-theme .moment-resolve {
  background: rgba(240,235,220,0.7);
  border-color: rgba(138,94,26,0.35);
}
body.light-theme .moment-resolve .moment-text { color: #2a1e08; }

body.light-theme .moment-shock {
  background: rgba(220,230,245,0.6);
  border-color: rgba(60,100,180,0.3);
}
body.light-theme .moment-shock .moment-text { color: #1a2a3a; }

body.light-theme .moment-anger {
  background: rgba(245,225,220,0.6);
  border-color: rgba(180,60,60,0.3);
}
body.light-theme .moment-anger .moment-text { color: #2a0808; }

body.light-theme .moment-heavy {
  background: rgba(220,225,235,0.6);
  border-color: rgba(80,90,120,0.3);
}
body.light-theme .moment-heavy .moment-text { color: #1a1e2a; }

body.light-theme .moment-warmth {
  background: rgba(245,235,240,0.6);
  border-color: rgba(200,100,140,0.3);
}
body.light-theme .moment-warmth .moment-text { color: #2a1020; }

body.light-theme .moment-krusch {
  background: rgba(220,240,230,0.6);
  border-color: rgba(60,140,90,0.3);
}
body.light-theme .moment-krusch .moment-text { color: #0a2a18; }

body.light-theme .dragon-eye-reveal {
  background: rgba(245,240,220,0.9);
  border-color: rgba(160,120,20,0.4);
}

body.light-theme .dragon-eye-text {
  color: #7a5000;
  text-shadow: 0 0 8px rgba(160,100,0,0.2);
}

body.light-theme .return-block {
  background: rgba(230,225,245,0.85);
  border-color: rgba(100,60,180,0.3);
}

body.light-theme .return-kanji {
  color: rgba(100,60,180,0.85);
  text-shadow: 0 0 20px rgba(100,60,180,0.4);
}

body.light-theme .return-label {
  color: rgba(100,60,180,0.6);
}

body.light-theme .return-text {
  color: #2a1a4a;
}

body.light-theme .nav-btn {
  background: rgba(230,224,210,0.8);
  border-color: rgba(138,94,26,0.25);
  color: var(--text-dim);
}

body.light-theme .nav-btn:hover {
  background: rgba(215,208,192,0.95);
}

body.light-theme .chapter-kanji {
  color: rgba(138,94,26,0.65);
}

body.light-theme .location-tag {
  color: rgba(138,94,26,0.7);
}

body.light-theme .scroll-hint,
body.light-theme .chapter-arc {
  color: #8a7a60;
}

body.light-theme .chapter-subtitle {
  color: #2a2010;
}

body.light-theme .scroll-chevron {
  border-right-color: rgba(100,70,20,0.5);
  border-bottom-color: rgba(100,70,20,0.5);
}

body.light-theme .divider-line {
  background: linear-gradient(90deg, transparent, rgba(138,94,26,0.5), transparent);
}

body.light-theme .divider-sigil {
  color: rgba(138,94,26,0.8);
}

body.light-theme #canvas {
  opacity: 0.12;
}

/* Dialogue text — override the hardcoded !important */
body.light-theme .dialogue-text {
  color: #1a1610 !important;
}

/* Narration colours */
body.light-theme p.narr {
  color: #1a1610;
}

body.light-theme p.italic-narr {
  color: #3a3020;
}

body.light-theme p.thought {
  color: #4a3e2a;
  border-left-color: rgba(138,94,26,0.4);
}

/* Scene / pov labels */
body.light-theme .scene-label,
body.light-theme .pov-name {
  color: #8a7a60;
}

body.light-theme .pov-subtitle {
  color: rgba(138,94,26,0.55);
}

/* Dragon & cult inline mentions */
body.light-theme .dragon-mention {
  color: #8a5a00;
  text-shadow: 0 0 6px rgba(138,90,0,0.2);
}

.subaru { color: var(--subaru); font-weight: 600; }
.beatrice { color: var(--beatrice); font-weight: 600; }
.krusch { color: var(--krusch); font-weight: 600; }
.felix { color: #f0a0c8; font-weight: 600; }
.rachins { color: #d4a060; font-weight: 600; }
.russell { color: #b8c0d8; font-weight: 600; }
.emilia { color: var(--emilia); font-weight: 600; }
.ram { color: var(--ram); font-weight: 600; }
.rem { color: #80b8f0; font-weight: 600; }
.otto { color: #90c880; font-weight: 600; }
.garfiel { color: #e0b060; font-weight: 600; }
.petra { color: #f0a070; font-weight: 600; }
.meiili { color: #d0a0e8; font-weight: 600; }
.frederica { color: #e0c080; font-weight: 600; }
.roswaal { color: #c090e0; font-weight: 600; }
.moro { color: #c8a46a; font-weight: 600; }
.codename { color: #c8a46a; font-weight: 600; letter-spacing: 0.01em; }

body.light-theme .cult-mention {
  color: #6a3080;
  text-shadow: 0 0 6px rgba(106,48,128,0.2);
}

/* ── Settings panel light ── */
body.light-theme #settings-panel {
  background: rgba(240,235,224,0.97);
  border-color: rgba(138,94,26,0.25);
}
body.light-theme .settings-title {
  color: var(--accent);
  border-bottom-color: rgba(138,94,26,0.2);
}
body.light-theme .settings-label { color: var(--text-dim); }
body.light-theme .settings-btn {
  background: rgba(220,214,200,0.8);
  border-color: rgba(138,94,26,0.2);
  color: var(--text);
}
body.light-theme .settings-btn:hover,
body.light-theme .settings-btn.active {
  background: rgba(138,94,26,0.15);
  border-color: rgba(138,94,26,0.5);
  color: var(--accent);
}
body.light-theme input[type="range"] { accent-color: var(--accent); }

/* ── Settings button group (bottom-left) ── */
#settings-controls {
  position: fixed;
  bottom: 32px;
  left: 32px;
  z-index: 200;
}

/* ── Settings toggle button ── */
#settings-toggle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(200,164,106,0.3);
  background: rgba(14,19,32,0.85);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(200,164,106,0.8);
  transition: background 0.4s ease, border-color 0.4s ease, transform 0.2s ease, box-shadow 0.3s ease, color 0.4s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  user-select: none;
}

#settings-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(0,0,0,0.5);
  border-color: rgba(200,164,106,0.6);
  color: rgba(200,164,106,1);
}

#settings-toggle:active { transform: scale(0.95); }
#settings-toggle.active {
  border-color: rgba(200,164,106,0.7);
  color: rgba(200,164,106,1);
  box-shadow: 0 0 20px rgba(200,164,106,0.2);
}

body.light-theme #settings-toggle {
  background: rgba(230,224,210,0.92);
  border-color: rgba(138,94,26,0.35);
  box-shadow: 0 4px 20px rgba(100,80,40,0.2);
  color: rgba(138,94,26,0.8);
}
body.light-theme #settings-toggle:hover {
  border-color: rgba(138,94,26,0.65);
  box-shadow: 0 6px 28px rgba(100,80,40,0.3);
  color: rgba(138,94,26,1);
}
body.light-theme #settings-toggle.active {
  border-color: rgba(138,94,26,0.7);
  color: rgba(138,94,26,1);
}

/* ── Settings panel ── */
#settings-panel {
  position: fixed;
  bottom: 110px;
  left: 32px;
  z-index: 199;
  width: 300px;
  background: rgba(8,12,20,0.96);
  border: 1px solid rgba(200,164,106,0.2);
  border-radius: 8px;
  padding: 20px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  transform: translateY(12px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#settings-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.settings-title {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(200,164,106,0.15);
}

.settings-group {
  margin-bottom: 16px;
}

.settings-label {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
  display: block;
}

.settings-btn-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.settings-btn {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 0.1em;
  padding: 6px 10px;
  border-radius: 3px;
  border: 1px solid rgba(200,164,106,0.2);
  background: rgba(20,25,40,0.8);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.settings-btn:hover {
  background: rgba(200,164,106,0.08);
  border-color: rgba(200,164,106,0.4);
  color: var(--accent);
}

.settings-btn.active {
  background: rgba(200,164,106,0.12);
  border-color: rgba(200,164,106,0.5);
  color: var(--accent);
}

.settings-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
  cursor: pointer;
  height: 3px;
}

.settings-slider-val {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  color: var(--accent);
  min-width: 36px;
  text-align: right;
  letter-spacing: 0.05em;
}

/* ── Animations disabled class ── */
body.no-anim .reveal {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

body.no-anim .chapter-kanji,
body.no-anim .chapter-arc,
body.no-anim .chapter-num,
body.no-anim .chapter-subtitle {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

body.no-anim .scroll-hint { animation: none !important; opacity: 0.5 !important; }
body.no-anim .divider-sigil { animation: none !important; opacity: 0.7 !important; }
body.no-anim .moment-shock.visible { animation: none !important; }
body.no-anim .moment-resolve.visible { animation: none !important; }
body.no-anim .moment-anger.visible { animation: none !important; }
body.no-anim .scroll-chevron { animation: none !important; opacity: 0.5 !important; }

/* ── Theme toggle button ── */
#theme-toggle {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 200;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(200,164,106,0.3);
  background: rgba(14,19,32,0.85);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(200,164,106,0.8);
  transition: background 0.4s ease, border-color 0.4s ease, transform 0.2s ease, box-shadow 0.3s ease, color 0.4s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  user-select: none;
}

#theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(0,0,0,0.5);
  border-color: rgba(200,164,106,0.6);
  color: rgba(200,164,106,1);
}

#theme-toggle:active {
  transform: scale(0.95);
}

body.light-theme #theme-toggle {
  background: rgba(230,224,210,0.92);
  border-color: rgba(138,94,26,0.35);
  box-shadow: 0 4px 20px rgba(100,80,40,0.2);
  color: rgba(138,94,26,0.8);
}

body.light-theme #theme-toggle:hover {
  border-color: rgba(138,94,26,0.65);
  box-shadow: 0 6px 28px rgba(100,80,40,0.3);
  color: rgba(138,94,26,1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 19px;
  line-height: 1.85;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Ambient particles ── */
#canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

/* ── Progress bar ── */
#progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--krusch), var(--accent), var(--beatrice));
  width: 0%;
  z-index: 100;
  transition: width 0.1s linear;
}

/* ── Header ── */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 14px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(8,12,20,0.96);
  border-bottom: 1px solid rgba(200,164,106,0.1);
}

.header-arc {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.header-title {
  font-family: 'Cormorant SC', 'Cinzel', serif;
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--accent);
}

.header-pov {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--text-dim);
  transition: color 0.6s ease;
}

/* ── Chapter title block ── */
.chapter-title-block {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 40px;
}

.chapter-kanji {
  font-family: serif;
  font-size: 48px;
  color: rgba(200,164,106,0.25);
  letter-spacing: 0.4em;
  margin-bottom: 32px;
  animation: fadeSlideIn 2s ease forwards;
}

.chapter-arc {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 0.5em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 20px;
  animation: fadeSlideIn 2s ease 0.3s both;
}

.chapter-num {
  font-family: 'Cormorant SC', 'Cinzel Decorative', serif;
  font-size: clamp(28px, 5vw, 52px);
  color: var(--accent);
  line-height: 1.2;
  margin-bottom: 12px;
  animation: fadeSlideIn 2s ease 0.5s both;
  text-shadow: 0 0 60px rgba(200,164,106,0.3);
}

.chapter-subtitle {
  font-family: 'Cormorant Infant', 'EB Garamond', serif;
  font-style: italic;
  font-size: clamp(20px, 3vw, 32px);
  color: var(--text);
  margin-bottom: 60px;
  animation: fadeSlideIn 2s ease 0.8s both;
}

.scroll-hint {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.4em;
  color: var(--text-dim);
  text-transform: uppercase;
  animation: pulse 2.5s ease-in-out infinite;
}

/* ── Main content ── */
main {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 80px 40px 160px;
}

/* ── Paragraph reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Narration ── */
p.narr {
  margin-bottom: 1.3em;
  color: var(--text);
}

p.italic-narr {
  font-style: italic;
  color: #c8bcaa;
  margin-bottom: 1.3em;
}

p.thought {
  font-style: italic;
  color: #b0a898;
  padding-left: 20px;
  border-left: 2px solid rgba(200,164,106,0.3);
  margin: 1em 0 1.3em;
}

/* ── Dialogue ── */
.dialogue-block {
  margin: 0.4em 0 1.1em;
  position: relative;
}

.speaker-tag {
  display: none;
}

.dialogue-text {
  font-style: normal;
  color: #e0d8cc;
  display: block;
  padding-left: 4px;
}

.dialogue-text.emotional {
  font-style: italic;
}

.sp-ram { color: var(--ram); }
.sp-emilia { color: var(--emilia); }
.sp-bordeaux { color: var(--bordeaux); }
.sp-marcos { color: var(--marcos); }
.sp-fiore { color: var(--fiore); }
.sp-sakura { color: var(--sakura); }
.sp-felt { color: var(--felt); }
.sp-reinhard { color: var(--reinhard); }
.sp-official { color: #9aaabb; }
.sp-krusch { color: var(--krusch); }
.sp-tiga { color: var(--tiga); }
.sp-beatrice { color: var(--beatrice); }
.sp-subaru { color: var(--subaru); }

/* ── Chapter illustrations ── */
.chapter-illustration {
  margin: 2.4em auto;
  text-align: center;
}

.chapter-illustration img {
  display: block;
  width: min(100%, 720px);
  height: auto;
  margin: 0 auto;
  border-radius: 16px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
}
  
/* ── Character colors stripped: dialogue colour-neutral ── */
.dialogue-text { color: #e0d8cc !important; }
/* ── Section divider ── */
.section-divider {
  text-align: center;
  padding: 50px 0;
  position: relative;
}

.divider-sigil {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  color: var(--accent);
  letter-spacing: 0.3em;
  display: inline-block;
  animation: sigil-pulse 3s ease-in-out infinite;
}

.divider-line {
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: 16px auto;
  width: 60%;
  opacity: 0.4;
}

/* ── Dramatic moments ── */
.moment,
.dragon-eye-reveal,
.return-block {
  --moment-accent: var(--accent);
  --moment-bg: rgba(15, 19, 32, 0.72);
  --moment-border: rgba(200, 164, 106, 0.22);
  position: relative;
  margin: 2.2em auto;
  padding: 24px 28px 24px 32px;
  max-width: 780px;
  border: 1px solid var(--moment-border);
  border-left: 4px solid var(--moment-accent);
  border-radius: 14px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--moment-accent) 14%, transparent), transparent 42%),
    var(--moment-bg);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  text-align: left;
}

.moment::before,
.dragon-eye-reveal::before,
.return-block::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.055), transparent 55%);
  opacity: 1;
  pointer-events: none;
}

.moment::after,
.dragon-eye-reveal::after,
.return-block::after {
  content: '';
  position: absolute;
  top: 18px;
  right: 20px;
  width: 34px;
  height: 2px;
  border-radius: 99px;
  background: var(--moment-accent);
  opacity: 0.45;
}

.moment-label { display: none; }

.moment-text,
.dragon-eye-text,
.return-text {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--text);
  font-family: inherit;
  font-size: 1em;
  line-height: 1.78;
  letter-spacing: 0.01em;
  text-shadow: none;
}

.moment-text + .moment-text,
.moment-text[style*="margin-top"] {
  margin-top: 0.85em !important;
}

.moment-shock { --moment-accent: #7a9cc8; --moment-bg: rgba(12, 22, 38, 0.76); --moment-border: rgba(122,156,200,0.28); }
.moment-anger { --moment-accent: #d06a6a; --moment-bg: rgba(36, 17, 17, 0.74); --moment-border: rgba(208,106,106,0.26); }
.moment-resolve { --moment-accent: #c8a46a; --moment-bg: rgba(32, 27, 17, 0.74); --moment-border: rgba(200,164,106,0.32); }
.moment-heavy { --moment-accent: #8a9ab0; --moment-bg: rgba(14, 17, 28, 0.78); --moment-border: rgba(138,154,176,0.25); }
.moment-warmth { --moment-accent: #e87aaa; --moment-bg: rgba(34, 18, 27, 0.72); --moment-border: rgba(232,122,170,0.25); }
.moment-krusch { --moment-accent: #5aaa7a; --moment-bg: rgba(10, 28, 18, 0.74); --moment-border: rgba(90,170,122,0.27); }
.moment-battle { --moment-accent: #d4a030; --moment-bg: rgba(35, 24, 7, 0.76); --moment-border: rgba(212,160,48,0.30); }

.moment-shock .moment-text,
.moment-anger .moment-text,
.moment-resolve .moment-text,
.moment-heavy .moment-text,
.moment-warmth .moment-text,
.moment-krusch .moment-text,
.moment-battle .moment-text {
  color: var(--text);
  font-style: normal;
}

/* ── Dragon Eye reveal ── */
.dragon-eye-reveal {
  --moment-accent: #d6ad3f;
  --moment-bg: rgba(26, 22, 12, 0.80);
  --moment-border: rgba(214, 173, 63, 0.35);
}

.dragon-eye-glyph {
  display: none;
}

.dragon-eye-text {
  color: #f1dfb2;
  font-style: normal;
}

/* ── Return from death animation ── */
.return-block {
  --moment-accent: #9d77df;
  --moment-bg: rgba(18, 14, 34, 0.82);
  --moment-border: rgba(157, 119, 223, 0.34);
  padding-top: 28px;
}

.return-vortex,
.return-ring {
  display: none;
}

.return-kanji {
  position: relative;
  z-index: 1;
  margin-bottom: 10px;
  color: rgba(205, 184, 244, 0.75);
  font-size: 30px;
  letter-spacing: 0.16em;
  text-shadow: none;
}

.return-label {
  position: relative;
  z-index: 1;
  margin-bottom: 14px;
  color: rgba(205, 184, 244, 0.72);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-shadow: none;
}

.return-text {
  color: var(--text);
}

/* ── Garfiel inner monologue ── */
.inner-fire {
  position: relative;
  margin: 1.8em auto;
  padding: 18px 24px 18px 28px;
  max-width: 760px;
  border-left: 4px solid var(--garfiel, var(--accent));
  border-radius: 0 12px 12px 0;
  background: rgba(212, 160, 64, 0.08);
  color: var(--text);
  font-size: 1em;
  line-height: 1.85;
  font-style: normal;
}

body.light-theme .moment,
body.light-theme .dragon-eye-reveal,
body.light-theme .return-block {
  --moment-bg: rgba(255, 252, 244, 0.78);
  --moment-border: color-mix(in srgb, var(--moment-accent) 38%, rgba(138,94,26,0.22));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--moment-accent) 12%, transparent), transparent 42%),
    var(--moment-bg);
  box-shadow: 0 10px 26px rgba(90, 70, 40, 0.12);
}

body.light-theme .moment-text,
body.light-theme .dragon-eye-text,
body.light-theme .return-text,
body.light-theme .moment-shock .moment-text,
body.light-theme .moment-anger .moment-text,
body.light-theme .moment-resolve .moment-text,
body.light-theme .moment-heavy .moment-text,
body.light-theme .moment-warmth .moment-text,
body.light-theme .moment-krusch .moment-text,
body.light-theme .moment-battle .moment-text {
  color: #1a1610;
}

body.light-theme .dragon-eye-text { color: #3c2b05; }
body.light-theme .return-kanji,
body.light-theme .return-label { color: rgba(76, 43, 132, 0.72); text-shadow: none; }
body.light-theme .inner-fire { color: #2a2010; background: rgba(212, 160, 64, 0.12); border-left-color: var(--accent); }

.moment-shock.visible,
.moment-resolve.visible,
.moment-anger.visible,
.moment-krusch.visible,
.moment-battle.visible,
.dragon-eye-glyph,
.return-kanji {
  animation: none !important;
}


body.plain-moments .moment,
body.plain-moments .dragon-eye-reveal,
body.plain-moments .return-block,
body.plain-moments .inner-fire {
  margin: 1em 0;
  padding: 0;
  max-width: none;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  overflow: visible;
  text-align: inherit;
}

body.plain-moments .moment::before,
body.plain-moments .moment::after,
body.plain-moments .dragon-eye-reveal::before,
body.plain-moments .dragon-eye-reveal::after,
body.plain-moments .return-block::before,
body.plain-moments .return-block::after,
body.plain-moments .dragon-eye-glyph,
body.plain-moments .return-vortex,
body.plain-moments .return-ring,
body.plain-moments .return-kanji,
body.plain-moments .return-label {
  display: none !important;
}

body.plain-moments .moment-text,
body.plain-moments .dragon-eye-text,
body.plain-moments .return-text {
  color: inherit;
  font: inherit;
  line-height: inherit;
  letter-spacing: inherit;
}

/* ── POV section headers ── */
.pov-header {
  display: none;
}
.pov-name {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.pov-subtitle {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 15px;
  color: rgba(200,164,106,0.5);
}

/* ── Scene label ── */
.scene-label {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: center;
  padding: 24px 0 8px;
  opacity: 0.6;
}

/* ── Navigation buttons ── */
.nav-buttons {
  position: relative;
  z-index: 10;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 60px 40px 100px;
  max-width: 760px;
  margin: 0 auto;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  padding: 14px 28px;
  border: 1px solid rgba(200,164,106,0.25);
  border-radius: 3px;
  background: rgba(8,12,20,0.7);
  transition: all 0.35s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.nav-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(200,164,106,0.06), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.nav-btn:hover::before {
  transform: translateX(100%);
}

.nav-btn:hover {
  color: var(--accent);
  border-color: rgba(200,164,106,0.55);
  box-shadow: 0 0 20px rgba(200,164,106,0.1);
  transform: translateY(-1px);
}

.nav-btn-prev { border-color: rgba(90,170,122,0.25); }
.nav-btn-prev:hover { color: var(--krusch); border-color: rgba(90,170,122,0.5); box-shadow: 0 0 20px rgba(90,170,122,0.1); }

.nav-btn-toc { border-color: rgba(200,164,106,0.25); }
.nav-btn-toc:hover { color: var(--accent); border-color: rgba(200,164,106,0.5); }

.nav-btn-next { border-color: rgba(170,100,220,0.25); }
.nav-btn-next:hover { color: var(--beatrice); border-color: rgba(170,100,220,0.5); box-shadow: 0 0 20px rgba(170,100,220,0.1); }

.nav-icon {
  font-size: 14px;
  opacity: 0.7;
}

/* ── Animations ── */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes sigil-pulse {
  0%, 100% { opacity: 0.4; letter-spacing: 0.3em; }
  50% { opacity: 0.9; letter-spacing: 0.45em; }
}

@keyframes shock-flare {
  0% { box-shadow: inset 0 0 40px rgba(80,120,200,0.05), 0 0 30px rgba(80,120,200,0.08); }
  50% { box-shadow: inset 0 0 80px rgba(80,120,200,0.15), 0 0 60px rgba(80,120,200,0.2); }
  100% { box-shadow: inset 0 0 40px rgba(80,120,200,0.05), 0 0 30px rgba(80,120,200,0.08); }
}

.moment-shock.visible { animation: shock-flare 4s ease-in-out infinite; }

@keyframes resolve-glow {
  0%, 100% { box-shadow: inset 0 0 50px rgba(200,164,106,0.06), 0 0 40px rgba(200,164,106,0.12); }
  50% { box-shadow: inset 0 0 80px rgba(200,164,106,0.12), 0 0 70px rgba(200,164,106,0.22); }
}
.moment-resolve.visible { animation: resolve-glow 3.5s ease-in-out infinite; }

@keyframes anger-pulse {
  0%, 100% { box-shadow: inset 0 0 40px rgba(200,60,60,0.05), 0 0 30px rgba(200,60,60,0.08); }
  50% { box-shadow: inset 0 0 60px rgba(200,60,60,0.12), 0 0 50px rgba(200,60,60,0.15); }
}
.moment-anger.visible { animation: anger-pulse 2.5s ease-in-out infinite; }

@keyframes krusch-glow {
  0%, 100% { box-shadow: inset 0 0 40px rgba(90,170,122,0.05), 0 0 30px rgba(90,170,122,0.08); }
  50% { box-shadow: inset 0 0 70px rgba(90,170,122,0.12), 0 0 50px rgba(90,170,122,0.15); }
}
.moment-krusch.visible { animation: krusch-glow 3s ease-in-out infinite; }

@keyframes eye-pulse {
  0%, 100% { filter: drop-shadow(0 0 14px rgba(255,200,40,0.6)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 30px rgba(255,220,60,0.95)) drop-shadow(0 0 50px rgba(200,140,0,0.5)); transform: scale(1.06); }
}

@keyframes return-glow {
  0%, 100% { text-shadow: 0 0 30px rgba(160,80,220,0.7), 0 0 60px rgba(80,40,140,0.4); }
  50% { text-shadow: 0 0 50px rgba(180,100,255,1), 0 0 90px rgba(100,50,180,0.7), 0 0 4px #fff; }
}

@keyframes ring-expand {
  0%   { width: 60px; height: 60px; opacity: 0.8; border-color: rgba(160,80,220,0.7); }
  100% { width: 320px; height: 320px; opacity: 0; border-color: rgba(80,20,140,0); }
}

/* ── Scroll indicator ── */
.scroll-down {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.scroll-chevron {
  width: 16px;
  height: 16px;
  border-right: 1px solid rgba(200,164,106,0.5);
  border-bottom: 1px solid rgba(200,164,106,0.5);
  transform: rotate(45deg);
  animation: bounce 1.5s ease-in-out infinite;
}
@keyframes bounce {
  0%,100% { transform: rotate(45deg) translateY(0); opacity: 0.4; }
  50% { transform: rotate(45deg) translateY(6px); opacity: 0.9; }
}

/* ── Witch cult / Dragon ── */
.cult-mention {
  color: var(--witch);
  font-style: normal;
  text-shadow: 0 0 8px rgba(144,64,160,0.3);
}

.dragon-mention {
  color: #d4a020;
  text-shadow: 0 0 8px rgba(200,150,0,0.3);
}

/* ── Footnote-style location ── */
.location-tag {
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.4em;
  color: rgba(200,164,106,0.35);
  padding: 8px 0 30px;
  text-transform: uppercase;
}

/* Responsive */
@media (max-width: 600px) {
  main { padding: 60px 20px 100px; }
  header { padding: 12px 20px; }
  .header-arc { display: none; }
  body { font-size: 17px; }
  .nav-buttons { padding: 40px 20px 80px; gap: 12px; }
  .nav-btn { padding: 12px 18px; font-size: 10px; }
  .chapter-kanji { font-size: 28px; letter-spacing: 0.25em; margin-bottom: 20px; }
  .moment,
  .dragon-eye-reveal,
  .return-block {
    margin: 1.7em 0;
    padding: 20px 20px 20px 24px;
    border-radius: 12px;
  }
  .moment-text,
  .dragon-eye-text,
  .return-text,
  .inner-fire {
    line-height: 1.72;
  }
}

/* ===== 10-14.html ===== */
:root {
  --bg: #080c14;
  --bg2: #0e1320;
  --bg3: #13192e;
  --text: #ddd4c0;
  --text-dim: #8a8070;
  --accent: #c8a46a;
  --accent2: #7a9cc8;
  --divider: #2a3050;
  --ram: #e87aaa;
  --emilia: #aac8ec;
  --bordeaux: #d04040;
  --marcos: #8a9ab0;
  --fiore: #f0c060;
  --sakura: #c08ad0;
  --felt: #e8a050;
  --reinhard: #5090d8;
  --witch: #9040a0;
  --narrator: #ddd4c0;
  --krusch: #5aaa7a;
  --tiga: #d4a060;
  --beatrice: #b08adc;
  --subaru: #90b8e0;
}

/* ── Light theme overrides ── */
body.light-theme {
  --bg: #f0ebe0;
  --bg2: #e8e2d4;
  --bg3: #ddd7c8;
  --text: #1a1610;
  --text-dim: #6a5e4a;
  --accent: #8a5e1a;
  --accent2: #2a5888;
  --divider: #c8bca0;
}

body.light-theme header {
  background: rgba(240,235,224,0.97);
  border-bottom-color: rgba(138,94,26,0.15);
}

body.light-theme p.italic-narr {
  color: #3a3020;
}

body.light-theme p.thought {
  color: #4a3e2a;
  border-left-color: rgba(138,94,26,0.4);
}

body.light-theme .inner-fire {
  color: #5a3a10;
  border-left-color: var(--accent);
}

body.light-theme .moment-resolve {
  background: rgba(240,235,220,0.7);
  border-color: rgba(138,94,26,0.35);
}
body.light-theme .moment-resolve .moment-text { color: #2a1e08; }

body.light-theme .moment-shock {
  background: rgba(220,230,245,0.6);
  border-color: rgba(60,100,180,0.3);
}
body.light-theme .moment-shock .moment-text { color: #1a2a3a; }

body.light-theme .moment-anger {
  background: rgba(245,225,220,0.6);
  border-color: rgba(180,60,60,0.3);
}
body.light-theme .moment-anger .moment-text { color: #2a0808; }

body.light-theme .moment-heavy {
  background: rgba(220,225,235,0.6);
  border-color: rgba(80,90,120,0.3);
}
body.light-theme .moment-heavy .moment-text { color: #1a1e2a; }

body.light-theme .moment-warmth {
  background: rgba(245,235,240,0.6);
  border-color: rgba(200,100,140,0.3);
}
body.light-theme .moment-warmth .moment-text { color: #2a1020; }

body.light-theme .moment-krusch {
  background: rgba(220,240,230,0.6);
  border-color: rgba(60,140,90,0.3);
}
body.light-theme .moment-krusch .moment-text { color: #0a2a18; }

body.light-theme .dragon-eye-reveal {
  background: rgba(245,240,220,0.9);
  border-color: rgba(160,120,20,0.4);
}

body.light-theme .dragon-eye-text {
  color: #7a5000;
  text-shadow: 0 0 8px rgba(160,100,0,0.2);
}

body.light-theme .return-block {
  background: rgba(230,225,245,0.85);
  border-color: rgba(100,60,180,0.3);
}

body.light-theme .return-kanji {
  color: rgba(100,60,180,0.85);
  text-shadow: 0 0 20px rgba(100,60,180,0.4);
}

body.light-theme .return-label {
  color: rgba(100,60,180,0.6);
}

body.light-theme .return-text {
  color: #2a1a4a;
}

body.light-theme .nav-btn {
  background: rgba(230,224,210,0.8);
  border-color: rgba(138,94,26,0.25);
  color: var(--text-dim);
}

body.light-theme .nav-btn:hover {
  background: rgba(215,208,192,0.95);
}

body.light-theme .chapter-kanji {
  color: rgba(138,94,26,0.65);
}

body.light-theme .location-tag {
  color: rgba(138,94,26,0.7);
}

body.light-theme .scroll-hint,
body.light-theme .chapter-arc {
  color: #8a7a60;
}

body.light-theme .chapter-subtitle {
  color: #2a2010;
}

body.light-theme .scroll-chevron {
  border-right-color: rgba(100,70,20,0.5);
  border-bottom-color: rgba(100,70,20,0.5);
}

body.light-theme .divider-line {
  background: linear-gradient(90deg, transparent, rgba(138,94,26,0.5), transparent);
}

body.light-theme .divider-sigil {
  color: rgba(138,94,26,0.8);
}

body.light-theme #canvas {
  opacity: 0.12;
}

/* Dialogue text — override the hardcoded !important */
body.light-theme .dialogue-text {
  color: #1a1610 !important;
}

/* Narration colours */
body.light-theme p.narr {
  color: #1a1610;
}

body.light-theme p.italic-narr {
  color: #3a3020;
}

body.light-theme p.thought {
  color: #4a3e2a;
  border-left-color: rgba(138,94,26,0.4);
}

/* Scene / pov labels */
body.light-theme .scene-label,
body.light-theme .pov-name {
  color: #8a7a60;
}

body.light-theme .pov-subtitle {
  color: rgba(138,94,26,0.55);
}

/* Dragon & cult inline mentions */
body.light-theme .dragon-mention {
  color: #8a5a00;
  text-shadow: 0 0 6px rgba(138,90,0,0.2);
}

body.light-theme .cult-mention {
  color: #6a3080;
  text-shadow: 0 0 6px rgba(106,48,128,0.2);
}

/* ── Settings panel light ── */
body.light-theme #settings-panel {
  background: rgba(240,235,224,0.97);
  border-color: rgba(138,94,26,0.25);
}
body.light-theme .settings-title {
  color: var(--accent);
  border-bottom-color: rgba(138,94,26,0.2);
}
body.light-theme .settings-label { color: var(--text-dim); }
body.light-theme .settings-btn {
  background: rgba(220,214,200,0.8);
  border-color: rgba(138,94,26,0.2);
  color: var(--text);
}
body.light-theme .settings-btn:hover,
body.light-theme .settings-btn.active {
  background: rgba(138,94,26,0.15);
  border-color: rgba(138,94,26,0.5);
  color: var(--accent);
}
body.light-theme input[type="range"] { accent-color: var(--accent); }

/* ── Settings button group (bottom-left) ── */
#settings-controls {
  position: fixed;
  bottom: 32px;
  left: 32px;
  z-index: 200;
}

/* ── Settings toggle button ── */
#settings-toggle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(200,164,106,0.3);
  background: rgba(14,19,32,0.85);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(200,164,106,0.8);
  transition: background 0.4s ease, border-color 0.4s ease, transform 0.2s ease, box-shadow 0.3s ease, color 0.4s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  user-select: none;
}

#settings-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(0,0,0,0.5);
  border-color: rgba(200,164,106,0.6);
  color: rgba(200,164,106,1);
}

#settings-toggle:active { transform: scale(0.95); }
#settings-toggle.active {
  border-color: rgba(200,164,106,0.7);
  color: rgba(200,164,106,1);
  box-shadow: 0 0 20px rgba(200,164,106,0.2);
}

body.light-theme #settings-toggle {
  background: rgba(230,224,210,0.92);
  border-color: rgba(138,94,26,0.35);
  box-shadow: 0 4px 20px rgba(100,80,40,0.2);
  color: rgba(138,94,26,0.8);
}
body.light-theme #settings-toggle:hover {
  border-color: rgba(138,94,26,0.65);
  box-shadow: 0 6px 28px rgba(100,80,40,0.3);
  color: rgba(138,94,26,1);
}
body.light-theme #settings-toggle.active {
  border-color: rgba(138,94,26,0.7);
  color: rgba(138,94,26,1);
}

/* ── Settings panel ── */
#settings-panel {
  position: fixed;
  bottom: 110px;
  left: 32px;
  z-index: 199;
  width: 300px;
  background: rgba(8,12,20,0.96);
  border: 1px solid rgba(200,164,106,0.2);
  border-radius: 8px;
  padding: 20px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  transform: translateY(12px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#settings-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.settings-title {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(200,164,106,0.15);
}

.settings-group {
  margin-bottom: 16px;
}

.settings-label {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
  display: block;
}

.settings-btn-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.settings-btn {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 0.1em;
  padding: 6px 10px;
  border-radius: 3px;
  border: 1px solid rgba(200,164,106,0.2);
  background: rgba(20,25,40,0.8);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.settings-btn:hover {
  background: rgba(200,164,106,0.08);
  border-color: rgba(200,164,106,0.4);
  color: var(--accent);
}

.settings-btn.active {
  background: rgba(200,164,106,0.12);
  border-color: rgba(200,164,106,0.5);
  color: var(--accent);
}

.settings-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
  cursor: pointer;
  height: 3px;
}

.settings-slider-val {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  color: var(--accent);
  min-width: 36px;
  text-align: right;
  letter-spacing: 0.05em;
}

/* ── Animations disabled class ── */
body.no-anim .reveal {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

body.no-anim .chapter-kanji,
body.no-anim .chapter-arc,
body.no-anim .chapter-num,
body.no-anim .chapter-subtitle {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

body.no-anim .scroll-hint { animation: none !important; opacity: 0.5 !important; }
body.no-anim .divider-sigil { animation: none !important; opacity: 0.7 !important; }
body.no-anim .moment-shock.visible { animation: none !important; }
body.no-anim .moment-resolve.visible { animation: none !important; }
body.no-anim .moment-anger.visible { animation: none !important; }
body.no-anim .scroll-chevron { animation: none !important; opacity: 0.5 !important; }

/* ── Theme toggle button ── */
#theme-toggle {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 200;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(200,164,106,0.3);
  background: rgba(14,19,32,0.85);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(200,164,106,0.8);
  transition: background 0.4s ease, border-color 0.4s ease, transform 0.2s ease, box-shadow 0.3s ease, color 0.4s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  user-select: none;
}

#theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(0,0,0,0.5);
  border-color: rgba(200,164,106,0.6);
  color: rgba(200,164,106,1);
}

#theme-toggle:active {
  transform: scale(0.95);
}

body.light-theme #theme-toggle {
  background: rgba(230,224,210,0.92);
  border-color: rgba(138,94,26,0.35);
  box-shadow: 0 4px 20px rgba(100,80,40,0.2);
  color: rgba(138,94,26,0.8);
}

body.light-theme #theme-toggle:hover {
  border-color: rgba(138,94,26,0.65);
  box-shadow: 0 6px 28px rgba(100,80,40,0.3);
  color: rgba(138,94,26,1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 19px;
  line-height: 1.85;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Ambient particles ── */
#canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

/* ── Progress bar ── */
#progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--krusch), var(--accent), var(--beatrice));
  width: 0%;
  z-index: 100;
  transition: width 0.1s linear;
}

/* ── Header ── */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 14px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(8,12,20,0.96);
  border-bottom: 1px solid rgba(200,164,106,0.1);
}

.header-arc {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.header-title {
  font-family: 'Cormorant SC', 'Cinzel', serif;
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--accent);
}

.header-pov {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--text-dim);
  transition: color 0.6s ease;
}

/* ── Chapter title block ── */
.chapter-title-block {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 40px;
}

.chapter-kanji {
  font-family: serif;
  font-size: 48px;
  color: rgba(200,164,106,0.25);
  letter-spacing: 0.4em;
  margin-bottom: 32px;
  animation: fadeSlideIn 2s ease forwards;
}

.chapter-arc {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 0.5em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 20px;
  animation: fadeSlideIn 2s ease 0.3s both;
}

.chapter-num {
  font-family: 'Cormorant SC', 'Cinzel Decorative', serif;
  font-size: clamp(28px, 5vw, 52px);
  color: var(--accent);
  line-height: 1.2;
  margin-bottom: 12px;
  animation: fadeSlideIn 2s ease 0.5s both;
  text-shadow: 0 0 60px rgba(200,164,106,0.3);
}

.chapter-subtitle {
  font-family: 'Cormorant Infant', 'EB Garamond', serif;
  font-style: italic;
  font-size: clamp(20px, 3vw, 32px);
  color: var(--text);
  margin-bottom: 60px;
  animation: fadeSlideIn 2s ease 0.8s both;
}

.scroll-hint {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.4em;
  color: var(--text-dim);
  text-transform: uppercase;
  animation: pulse 2.5s ease-in-out infinite;
}

/* ── Main content ── */
main {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 80px 40px 160px;
}

/* ── Paragraph reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Narration ── */
p.narr {
  margin-bottom: 1.3em;
  color: var(--text);
}

p.italic-narr {
  font-style: italic;
  color: #c8bcaa;
  margin-bottom: 1.3em;
}

p.thought {
  font-style: italic;
  color: #b0a898;
  padding-left: 20px;
  border-left: 2px solid rgba(200,164,106,0.3);
  margin: 1em 0 1.3em;
}

/* ── Dialogue ── */
.dialogue-block {
  margin: 0.4em 0 1.1em;
  position: relative;
}

.speaker-tag {
  display: none;
}

.dialogue-text {
  font-style: normal;
  color: #e0d8cc;
  display: block;
  padding-left: 4px;
}

.dialogue-text.emotional {
  font-style: italic;
}

.sp-ram { color: var(--ram); }
.sp-emilia { color: var(--emilia); }
.sp-bordeaux { color: var(--bordeaux); }
.sp-marcos { color: var(--marcos); }
.sp-fiore { color: var(--fiore); }
.sp-sakura { color: var(--sakura); }
.sp-felt { color: var(--felt); }
.sp-reinhard { color: var(--reinhard); }
.sp-official { color: #9aaabb; }
.sp-krusch { color: var(--krusch); }
.sp-tiga { color: var(--tiga); }
.sp-beatrice { color: var(--beatrice); }
.sp-subaru { color: var(--subaru); }


/* ── Character colors stripped: dialogue colour-neutral ── */
.dialogue-text { color: #e0d8cc !important; }
/* ── Section divider ── */
.section-divider {
  text-align: center;
  padding: 50px 0;
  position: relative;
}

.divider-sigil {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  color: var(--accent);
  letter-spacing: 0.3em;
  display: inline-block;
  animation: sigil-pulse 3s ease-in-out infinite;
}

.divider-line {
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: 16px auto;
  width: 60%;
  opacity: 0.4;
}

/* ── Dramatic moments ── */
.moment,
.dragon-eye-reveal,
.return-block {
  --moment-accent: var(--accent);
  --moment-bg: rgba(15, 19, 32, 0.72);
  --moment-border: rgba(200, 164, 106, 0.22);
  position: relative;
  margin: 2.2em auto;
  padding: 24px 28px 24px 32px;
  max-width: 780px;
  border: 1px solid var(--moment-border);
  border-left: 4px solid var(--moment-accent);
  border-radius: 14px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--moment-accent) 14%, transparent), transparent 42%),
    var(--moment-bg);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  text-align: left;
}

.moment::before,
.dragon-eye-reveal::before,
.return-block::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.055), transparent 55%);
  opacity: 1;
  pointer-events: none;
}

.moment::after,
.dragon-eye-reveal::after,
.return-block::after {
  content: '';
  position: absolute;
  top: 18px;
  right: 20px;
  width: 34px;
  height: 2px;
  border-radius: 99px;
  background: var(--moment-accent);
  opacity: 0.45;
}

.moment-label { display: none; }

.moment-text,
.dragon-eye-text,
.return-text {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--text);
  font-family: inherit;
  font-size: 1em;
  line-height: 1.78;
  letter-spacing: 0.01em;
  text-shadow: none;
}

.moment-text + .moment-text,
.moment-text[style*="margin-top"] {
  margin-top: 0.85em !important;
}

.moment-shock { --moment-accent: #7a9cc8; --moment-bg: rgba(12, 22, 38, 0.76); --moment-border: rgba(122,156,200,0.28); }
.moment-anger { --moment-accent: #d06a6a; --moment-bg: rgba(36, 17, 17, 0.74); --moment-border: rgba(208,106,106,0.26); }
.moment-resolve { --moment-accent: #c8a46a; --moment-bg: rgba(32, 27, 17, 0.74); --moment-border: rgba(200,164,106,0.32); }
.moment-heavy { --moment-accent: #8a9ab0; --moment-bg: rgba(14, 17, 28, 0.78); --moment-border: rgba(138,154,176,0.25); }
.moment-warmth { --moment-accent: #e87aaa; --moment-bg: rgba(34, 18, 27, 0.72); --moment-border: rgba(232,122,170,0.25); }
.moment-krusch { --moment-accent: #5aaa7a; --moment-bg: rgba(10, 28, 18, 0.74); --moment-border: rgba(90,170,122,0.27); }
.moment-battle { --moment-accent: #d4a030; --moment-bg: rgba(35, 24, 7, 0.76); --moment-border: rgba(212,160,48,0.30); }

.moment-shock .moment-text,
.moment-anger .moment-text,
.moment-resolve .moment-text,
.moment-heavy .moment-text,
.moment-warmth .moment-text,
.moment-krusch .moment-text,
.moment-battle .moment-text {
  color: var(--text);
  font-style: normal;
}

/* ── Dragon Eye reveal ── */
.dragon-eye-reveal {
  --moment-accent: #d6ad3f;
  --moment-bg: rgba(26, 22, 12, 0.80);
  --moment-border: rgba(214, 173, 63, 0.35);
}

.dragon-eye-glyph {
  display: none;
}

.dragon-eye-text {
  color: #f1dfb2;
  font-style: normal;
}

/* ── Return from death animation ── */
.return-block {
  --moment-accent: #9d77df;
  --moment-bg: rgba(18, 14, 34, 0.82);
  --moment-border: rgba(157, 119, 223, 0.34);
  padding-top: 28px;
}

.return-vortex,
.return-ring {
  display: none;
}

.return-kanji {
  position: relative;
  z-index: 1;
  margin-bottom: 10px;
  color: rgba(205, 184, 244, 0.75);
  font-size: 30px;
  letter-spacing: 0.16em;
  text-shadow: none;
}

.return-label {
  position: relative;
  z-index: 1;
  margin-bottom: 14px;
  color: rgba(205, 184, 244, 0.72);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-shadow: none;
}

.return-text {
  color: var(--text);
}

/* ── Garfiel inner monologue ── */
.inner-fire {
  position: relative;
  margin: 1.8em auto;
  padding: 18px 24px 18px 28px;
  max-width: 760px;
  border-left: 4px solid var(--garfiel, var(--accent));
  border-radius: 0 12px 12px 0;
  background: rgba(212, 160, 64, 0.08);
  color: var(--text);
  font-size: 1em;
  line-height: 1.85;
  font-style: normal;
}

body.light-theme .moment,
body.light-theme .dragon-eye-reveal,
body.light-theme .return-block {
  --moment-bg: rgba(255, 252, 244, 0.78);
  --moment-border: color-mix(in srgb, var(--moment-accent) 38%, rgba(138,94,26,0.22));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--moment-accent) 12%, transparent), transparent 42%),
    var(--moment-bg);
  box-shadow: 0 10px 26px rgba(90, 70, 40, 0.12);
}

body.light-theme .moment-text,
body.light-theme .dragon-eye-text,
body.light-theme .return-text,
body.light-theme .moment-shock .moment-text,
body.light-theme .moment-anger .moment-text,
body.light-theme .moment-resolve .moment-text,
body.light-theme .moment-heavy .moment-text,
body.light-theme .moment-warmth .moment-text,
body.light-theme .moment-krusch .moment-text,
body.light-theme .moment-battle .moment-text {
  color: #1a1610;
}

body.light-theme .dragon-eye-text { color: #3c2b05; }
body.light-theme .return-kanji,
body.light-theme .return-label { color: rgba(76, 43, 132, 0.72); text-shadow: none; }
body.light-theme .inner-fire { color: #2a2010; background: rgba(212, 160, 64, 0.12); border-left-color: var(--accent); }

.moment-shock.visible,
.moment-resolve.visible,
.moment-anger.visible,
.moment-krusch.visible,
.moment-battle.visible,
.dragon-eye-glyph,
.return-kanji {
  animation: none !important;
}


body.plain-moments .moment,
body.plain-moments .dragon-eye-reveal,
body.plain-moments .return-block,
body.plain-moments .inner-fire {
  margin: 1em 0;
  padding: 0;
  max-width: none;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  overflow: visible;
  text-align: inherit;
}

body.plain-moments .moment::before,
body.plain-moments .moment::after,
body.plain-moments .dragon-eye-reveal::before,
body.plain-moments .dragon-eye-reveal::after,
body.plain-moments .return-block::before,
body.plain-moments .return-block::after,
body.plain-moments .dragon-eye-glyph,
body.plain-moments .return-vortex,
body.plain-moments .return-ring,
body.plain-moments .return-kanji,
body.plain-moments .return-label {
  display: none !important;
}

body.plain-moments .moment-text,
body.plain-moments .dragon-eye-text,
body.plain-moments .return-text {
  color: inherit;
  font: inherit;
  line-height: inherit;
  letter-spacing: inherit;
}

/* ── POV section headers ── */
.pov-header {
  display: none;
}
.pov-name {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.pov-subtitle {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 15px;
  color: rgba(200,164,106,0.5);
}

/* ── Scene label ── */
.scene-label {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: center;
  padding: 24px 0 8px;
  opacity: 0.6;
}

/* ── Navigation buttons ── */
.nav-buttons {
  position: relative;
  z-index: 10;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 60px 40px 100px;
  max-width: 760px;
  margin: 0 auto;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  padding: 14px 28px;
  border: 1px solid rgba(200,164,106,0.25);
  border-radius: 3px;
  background: rgba(8,12,20,0.7);
  transition: all 0.35s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.nav-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(200,164,106,0.06), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.nav-btn:hover::before {
  transform: translateX(100%);
}

.nav-btn:hover {
  color: var(--accent);
  border-color: rgba(200,164,106,0.55);
  box-shadow: 0 0 20px rgba(200,164,106,0.1);
  transform: translateY(-1px);
}

.nav-btn-prev { border-color: rgba(90,170,122,0.25); }
.nav-btn-prev:hover { color: var(--krusch); border-color: rgba(90,170,122,0.5); box-shadow: 0 0 20px rgba(90,170,122,0.1); }

.nav-btn-toc { border-color: rgba(200,164,106,0.25); }
.nav-btn-toc:hover { color: var(--accent); border-color: rgba(200,164,106,0.5); }

.nav-btn-next { border-color: rgba(170,100,220,0.25); }
.nav-btn-next:hover { color: var(--beatrice); border-color: rgba(170,100,220,0.5); box-shadow: 0 0 20px rgba(170,100,220,0.1); }

.nav-icon {
  font-size: 14px;
  opacity: 0.7;
}

/* ── Animations ── */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes sigil-pulse {
  0%, 100% { opacity: 0.4; letter-spacing: 0.3em; }
  50% { opacity: 0.9; letter-spacing: 0.45em; }
}

@keyframes shock-flare {
  0% { box-shadow: inset 0 0 40px rgba(80,120,200,0.05), 0 0 30px rgba(80,120,200,0.08); }
  50% { box-shadow: inset 0 0 80px rgba(80,120,200,0.15), 0 0 60px rgba(80,120,200,0.2); }
  100% { box-shadow: inset 0 0 40px rgba(80,120,200,0.05), 0 0 30px rgba(80,120,200,0.08); }
}

.moment-shock.visible { animation: shock-flare 4s ease-in-out infinite; }

@keyframes resolve-glow {
  0%, 100% { box-shadow: inset 0 0 50px rgba(200,164,106,0.06), 0 0 40px rgba(200,164,106,0.12); }
  50% { box-shadow: inset 0 0 80px rgba(200,164,106,0.12), 0 0 70px rgba(200,164,106,0.22); }
}
.moment-resolve.visible { animation: resolve-glow 3.5s ease-in-out infinite; }

@keyframes anger-pulse {
  0%, 100% { box-shadow: inset 0 0 40px rgba(200,60,60,0.05), 0 0 30px rgba(200,60,60,0.08); }
  50% { box-shadow: inset 0 0 60px rgba(200,60,60,0.12), 0 0 50px rgba(200,60,60,0.15); }
}
.moment-anger.visible { animation: anger-pulse 2.5s ease-in-out infinite; }

@keyframes krusch-glow {
  0%, 100% { box-shadow: inset 0 0 40px rgba(90,170,122,0.05), 0 0 30px rgba(90,170,122,0.08); }
  50% { box-shadow: inset 0 0 70px rgba(90,170,122,0.12), 0 0 50px rgba(90,170,122,0.15); }
}
.moment-krusch.visible { animation: krusch-glow 3s ease-in-out infinite; }

@keyframes eye-pulse {
  0%, 100% { filter: drop-shadow(0 0 14px rgba(255,200,40,0.6)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 30px rgba(255,220,60,0.95)) drop-shadow(0 0 50px rgba(200,140,0,0.5)); transform: scale(1.06); }
}

@keyframes return-glow {
  0%, 100% { text-shadow: 0 0 30px rgba(160,80,220,0.7), 0 0 60px rgba(80,40,140,0.4); }
  50% { text-shadow: 0 0 50px rgba(180,100,255,1), 0 0 90px rgba(100,50,180,0.7), 0 0 4px #fff; }
}

@keyframes ring-expand {
  0%   { width: 60px; height: 60px; opacity: 0.8; border-color: rgba(160,80,220,0.7); }
  100% { width: 320px; height: 320px; opacity: 0; border-color: rgba(80,20,140,0); }
}

/* ── Scroll indicator ── */
.scroll-down {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.scroll-chevron {
  width: 16px;
  height: 16px;
  border-right: 1px solid rgba(200,164,106,0.5);
  border-bottom: 1px solid rgba(200,164,106,0.5);
  transform: rotate(45deg);
  animation: bounce 1.5s ease-in-out infinite;
}
@keyframes bounce {
  0%,100% { transform: rotate(45deg) translateY(0); opacity: 0.4; }
  50% { transform: rotate(45deg) translateY(6px); opacity: 0.9; }
}

/* ── Witch cult / Dragon ── */
.cult-mention {
  color: var(--witch);
  font-style: normal;
  text-shadow: 0 0 8px rgba(144,64,160,0.3);
}

.dragon-mention {
  color: #d4a020;
  text-shadow: 0 0 8px rgba(200,150,0,0.3);
}

/* ── Footnote-style location ── */
.location-tag {
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.4em;
  color: rgba(200,164,106,0.35);
  padding: 8px 0 30px;
  text-transform: uppercase;
}

/* Responsive */
@media (max-width: 600px) {
  main { padding: 60px 20px 100px; }
  header { padding: 12px 20px; }
  .header-arc { display: none; }
  body { font-size: 17px; }
  .nav-buttons { padding: 40px 20px 80px; gap: 12px; }
  .nav-btn { padding: 12px 18px; font-size: 10px; }
  .chapter-kanji { font-size: 28px; letter-spacing: 0.25em; margin-bottom: 20px; }
  .moment,
  .dragon-eye-reveal,
  .return-block {
    margin: 1.7em 0;
    padding: 20px 20px 20px 24px;
    border-radius: 12px;
  }
  .moment-text,
  .dragon-eye-text,
  .return-text,
  .inner-fire {
    line-height: 1.72;
  }
}

/* ===== 10-15.html ===== */
:root {
  --bg: #080c14;
  --bg2: #0e1320;
  --bg3: #13192e;
  --text: #ddd4c0;
  --text-dim: #8a8070;
  --accent: #c8a46a;
  --accent2: #7a9cc8;
  --divider: #2a3050;
  --ram: #e87aaa;
  --emilia: #aac8ec;
  --bordeaux: #d04040;
  --marcos: #8a9ab0;
  --fiore: #f0c060;
  --sakura: #c08ad0;
  --felt: #e8a050;
  --reinhard: #5090d8;
  --witch: #9040a0;
  --narrator: #ddd4c0;
  --krusch: #5aaa7a;
  --tiga: #d4a060;
  --beatrice: #b08adc;
  --subaru: #90b8e0;
}

/* ── Light theme overrides ── */
body.light-theme {
  --bg: #f0ebe0;
  --bg2: #e8e2d4;
  --bg3: #ddd7c8;
  --text: #1a1610;
  --text-dim: #6a5e4a;
  --accent: #8a5e1a;
  --accent2: #2a5888;
  --divider: #c8bca0;
}

body.light-theme header {
  background: rgba(240,235,224,0.97);
  border-bottom-color: rgba(138,94,26,0.15);
}

body.light-theme p.italic-narr {
  color: #3a3020;
}

body.light-theme p.thought {
  color: #4a3e2a;
  border-left-color: rgba(138,94,26,0.4);
}

body.light-theme .inner-fire {
  color: #5a3a10;
  border-left-color: var(--accent);
}

body.light-theme .moment-resolve {
  background: rgba(240,235,220,0.7);
  border-color: rgba(138,94,26,0.35);
}
body.light-theme .moment-resolve .moment-text { color: #2a1e08; }

body.light-theme .moment-shock {
  background: rgba(220,230,245,0.6);
  border-color: rgba(60,100,180,0.3);
}
body.light-theme .moment-shock .moment-text { color: #1a2a3a; }

body.light-theme .moment-anger {
  background: rgba(245,225,220,0.6);
  border-color: rgba(180,60,60,0.3);
}
body.light-theme .moment-anger .moment-text { color: #2a0808; }

body.light-theme .moment-heavy {
  background: rgba(220,225,235,0.6);
  border-color: rgba(80,90,120,0.3);
}
body.light-theme .moment-heavy .moment-text { color: #1a1e2a; }

body.light-theme .moment-warmth {
  background: rgba(245,235,240,0.6);
  border-color: rgba(200,100,140,0.3);
}
body.light-theme .moment-warmth .moment-text { color: #2a1020; }

body.light-theme .moment-krusch {
  background: rgba(220,240,230,0.6);
  border-color: rgba(60,140,90,0.3);
}
body.light-theme .moment-krusch .moment-text { color: #0a2a18; }

body.light-theme .dragon-eye-reveal {
  background: rgba(245,240,220,0.9);
  border-color: rgba(160,120,20,0.4);
}

body.light-theme .dragon-eye-text {
  color: #7a5000;
  text-shadow: 0 0 8px rgba(160,100,0,0.2);
}

body.light-theme .return-block {
  background: rgba(230,225,245,0.85);
  border-color: rgba(100,60,180,0.3);
}

body.light-theme .return-kanji {
  color: rgba(100,60,180,0.85);
  text-shadow: 0 0 20px rgba(100,60,180,0.4);
}

body.light-theme .return-label {
  color: rgba(100,60,180,0.6);
}

body.light-theme .return-text {
  color: #2a1a4a;
}

body.light-theme .nav-btn {
  background: rgba(230,224,210,0.8);
  border-color: rgba(138,94,26,0.25);
  color: var(--text-dim);
}

body.light-theme .nav-btn:hover {
  background: rgba(215,208,192,0.95);
}

body.light-theme .chapter-kanji {
  color: rgba(138,94,26,0.65);
}

body.light-theme .location-tag {
  color: rgba(138,94,26,0.7);
}

body.light-theme .scroll-hint,
body.light-theme .chapter-arc {
  color: #8a7a60;
}

body.light-theme .chapter-subtitle {
  color: #2a2010;
}

body.light-theme .scroll-chevron {
  border-right-color: rgba(100,70,20,0.5);
  border-bottom-color: rgba(100,70,20,0.5);
}

body.light-theme .divider-line {
  background: linear-gradient(90deg, transparent, rgba(138,94,26,0.5), transparent);
}

body.light-theme .divider-sigil {
  color: rgba(138,94,26,0.8);
}

body.light-theme #canvas {
  opacity: 0.12;
}

/* Dialogue text — override the hardcoded !important */
body.light-theme .dialogue-text {
  color: #1a1610 !important;
}

/* Narration colours */
body.light-theme p.narr {
  color: #1a1610;
}

body.light-theme p.italic-narr {
  color: #3a3020;
}

body.light-theme p.thought {
  color: #4a3e2a;
  border-left-color: rgba(138,94,26,0.4);
}

/* Scene / pov labels */
body.light-theme .scene-label,
body.light-theme .pov-name {
  color: #8a7a60;
}

body.light-theme .pov-subtitle {
  color: rgba(138,94,26,0.55);
}

/* Dragon & cult inline mentions */
body.light-theme .dragon-mention {
  color: #8a5a00;
  text-shadow: 0 0 6px rgba(138,90,0,0.2);
}

body.light-theme .cult-mention {
  color: #6a3080;
  text-shadow: 0 0 6px rgba(106,48,128,0.2);
}

/* ── Settings panel light ── */
body.light-theme #settings-panel {
  background: rgba(240,235,224,0.97);
  border-color: rgba(138,94,26,0.25);
}
body.light-theme .settings-title {
  color: var(--accent);
  border-bottom-color: rgba(138,94,26,0.2);
}
body.light-theme .settings-label { color: var(--text-dim); }
body.light-theme .settings-btn {
  background: rgba(220,214,200,0.8);
  border-color: rgba(138,94,26,0.2);
  color: var(--text);
}
body.light-theme .settings-btn:hover,
body.light-theme .settings-btn.active {
  background: rgba(138,94,26,0.15);
  border-color: rgba(138,94,26,0.5);
  color: var(--accent);
}
body.light-theme input[type="range"] { accent-color: var(--accent); }

/* ── Settings button group (bottom-left) ── */
#settings-controls {
  position: fixed;
  bottom: 32px;
  left: 32px;
  z-index: 200;
}

/* ── Settings toggle button ── */
#settings-toggle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(200,164,106,0.3);
  background: rgba(14,19,32,0.85);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(200,164,106,0.8);
  transition: background 0.4s ease, border-color 0.4s ease, transform 0.2s ease, box-shadow 0.3s ease, color 0.4s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  user-select: none;
}

#settings-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(0,0,0,0.5);
  border-color: rgba(200,164,106,0.6);
  color: rgba(200,164,106,1);
}

#settings-toggle:active { transform: scale(0.95); }
#settings-toggle.active {
  border-color: rgba(200,164,106,0.7);
  color: rgba(200,164,106,1);
  box-shadow: 0 0 20px rgba(200,164,106,0.2);
}

body.light-theme #settings-toggle {
  background: rgba(230,224,210,0.92);
  border-color: rgba(138,94,26,0.35);
  box-shadow: 0 4px 20px rgba(100,80,40,0.2);
  color: rgba(138,94,26,0.8);
}
body.light-theme #settings-toggle:hover {
  border-color: rgba(138,94,26,0.65);
  box-shadow: 0 6px 28px rgba(100,80,40,0.3);
  color: rgba(138,94,26,1);
}
body.light-theme #settings-toggle.active {
  border-color: rgba(138,94,26,0.7);
  color: rgba(138,94,26,1);
}

/* ── Settings panel ── */
#settings-panel {
  position: fixed;
  bottom: 110px;
  left: 32px;
  z-index: 199;
  width: 300px;
  background: rgba(8,12,20,0.96);
  border: 1px solid rgba(200,164,106,0.2);
  border-radius: 8px;
  padding: 20px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  transform: translateY(12px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#settings-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.settings-title {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(200,164,106,0.15);
}

.settings-group {
  margin-bottom: 16px;
}

.settings-label {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
  display: block;
}

.settings-btn-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.settings-btn {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 0.1em;
  padding: 6px 10px;
  border-radius: 3px;
  border: 1px solid rgba(200,164,106,0.2);
  background: rgba(20,25,40,0.8);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.settings-btn:hover {
  background: rgba(200,164,106,0.08);
  border-color: rgba(200,164,106,0.4);
  color: var(--accent);
}

.settings-btn.active {
  background: rgba(200,164,106,0.12);
  border-color: rgba(200,164,106,0.5);
  color: var(--accent);
}

.settings-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
  cursor: pointer;
  height: 3px;
}

.settings-slider-val {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  color: var(--accent);
  min-width: 36px;
  text-align: right;
  letter-spacing: 0.05em;
}

/* ── Animations disabled class ── */
body.no-anim .reveal {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

body.no-anim .chapter-kanji,
body.no-anim .chapter-arc,
body.no-anim .chapter-num,
body.no-anim .chapter-subtitle {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

body.no-anim .scroll-hint { animation: none !important; opacity: 0.5 !important; }
body.no-anim .divider-sigil { animation: none !important; opacity: 0.7 !important; }
body.no-anim .moment-shock.visible { animation: none !important; }
body.no-anim .moment-resolve.visible { animation: none !important; }
body.no-anim .moment-anger.visible { animation: none !important; }
body.no-anim .scroll-chevron { animation: none !important; opacity: 0.5 !important; }

/* ── Theme toggle button ── */
#theme-toggle {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 200;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(200,164,106,0.3);
  background: rgba(14,19,32,0.85);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(200,164,106,0.8);
  transition: background 0.4s ease, border-color 0.4s ease, transform 0.2s ease, box-shadow 0.3s ease, color 0.4s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  user-select: none;
}

#theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(0,0,0,0.5);
  border-color: rgba(200,164,106,0.6);
  color: rgba(200,164,106,1);
}

#theme-toggle:active {
  transform: scale(0.95);
}

body.light-theme #theme-toggle {
  background: rgba(230,224,210,0.92);
  border-color: rgba(138,94,26,0.35);
  box-shadow: 0 4px 20px rgba(100,80,40,0.2);
  color: rgba(138,94,26,0.8);
}

body.light-theme #theme-toggle:hover {
  border-color: rgba(138,94,26,0.65);
  box-shadow: 0 6px 28px rgba(100,80,40,0.3);
  color: rgba(138,94,26,1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 19px;
  line-height: 1.85;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Ambient particles ── */
#canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

/* ── Progress bar ── */
#progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--krusch), var(--accent), var(--beatrice));
  width: 0%;
  z-index: 100;
  transition: width 0.1s linear;
}

/* ── Header ── */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 14px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(8,12,20,0.96);
  border-bottom: 1px solid rgba(200,164,106,0.1);
}

.header-arc {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.header-title {
  font-family: 'Cormorant SC', 'Cinzel', serif;
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--accent);
}

.header-pov {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--text-dim);
  transition: color 0.6s ease;
}

/* ── Chapter title block ── */
.chapter-title-block {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 40px;
}

.chapter-kanji {
  font-family: serif;
  font-size: 48px;
  color: rgba(200,164,106,0.25);
  letter-spacing: 0.4em;
  margin-bottom: 32px;
  animation: fadeSlideIn 2s ease forwards;
}

.chapter-arc {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 0.5em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 20px;
  animation: fadeSlideIn 2s ease 0.3s both;
}

.chapter-num {
  font-family: 'Cormorant SC', 'Cinzel Decorative', serif;
  font-size: clamp(28px, 5vw, 52px);
  color: var(--accent);
  line-height: 1.2;
  margin-bottom: 12px;
  animation: fadeSlideIn 2s ease 0.5s both;
  text-shadow: 0 0 60px rgba(200,164,106,0.3);
}

.chapter-subtitle {
  font-family: 'Cormorant Infant', 'EB Garamond', serif;
  font-style: italic;
  font-size: clamp(20px, 3vw, 32px);
  color: var(--text);
  margin-bottom: 60px;
  animation: fadeSlideIn 2s ease 0.8s both;
}

.scroll-hint {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.4em;
  color: var(--text-dim);
  text-transform: uppercase;
  animation: pulse 2.5s ease-in-out infinite;
}

/* ── Main content ── */
main {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 80px 40px 160px;
}

/* ── Paragraph reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Narration ── */
p.narr {
  margin-bottom: 1.3em;
  color: var(--text);
}

p.italic-narr {
  font-style: italic;
  color: #c8bcaa;
  margin-bottom: 1.3em;
}

p.thought {
  font-style: italic;
  color: #b0a898;
  padding-left: 20px;
  border-left: 2px solid rgba(200,164,106,0.3);
  margin: 1em 0 1.3em;
}

/* ── Dialogue ── */
.dialogue-block {
  margin: 0.4em 0 1.1em;
  position: relative;
}

.speaker-tag {
  display: none;
}

.dialogue-text {
  font-style: normal;
  color: #e0d8cc;
  display: block;
  padding-left: 4px;
}

.dialogue-text.emotional {
  font-style: italic;
}

.sp-ram { color: var(--ram); }
.sp-emilia { color: var(--emilia); }
.sp-bordeaux { color: var(--bordeaux); }
.sp-marcos { color: var(--marcos); }
.sp-fiore { color: var(--fiore); }
.sp-sakura { color: var(--sakura); }
.sp-felt { color: var(--felt); }
.sp-reinhard { color: var(--reinhard); }
.sp-official { color: #9aaabb; }
.sp-krusch { color: var(--krusch); }
.sp-tiga { color: var(--tiga); }
.sp-beatrice { color: var(--beatrice); }
.sp-subaru { color: var(--subaru); }
.sp-otto { color: #8cc878; }
.sp-garfiel { color: #d8b060; }

/* ── Chapter illustrations ── */
.chapter-illustration {
  margin: 2.4em auto;
  text-align: center;
}

.chapter-illustration img {
  display: block;
  width: min(100%, 720px);
  height: auto;
  margin: 0 auto;
  border-radius: 16px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
}

/* ── Character colors stripped: dialogue colour-neutral ── */
.dialogue-text { color: #e0d8cc !important; }
/* ── Section divider ── */
.section-divider {
  text-align: center;
  padding: 50px 0;
  position: relative;
}

.divider-sigil {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  color: var(--accent);
  letter-spacing: 0.3em;
  display: inline-block;
  animation: sigil-pulse 3s ease-in-out infinite;
}

.divider-line {
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: 16px auto;
  width: 60%;
  opacity: 0.4;
}

/* ── Dramatic moments ── */
.moment,
.dragon-eye-reveal,
.return-block {
  --moment-accent: var(--accent);
  --moment-bg: rgba(15, 19, 32, 0.72);
  --moment-border: rgba(200, 164, 106, 0.22);
  position: relative;
  margin: 2.2em auto;
  padding: 24px 28px 24px 32px;
  max-width: 780px;
  border: 1px solid var(--moment-border);
  border-left: 4px solid var(--moment-accent);
  border-radius: 14px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--moment-accent) 14%, transparent), transparent 42%),
    var(--moment-bg);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  text-align: left;
}

.moment::before,
.dragon-eye-reveal::before,
.return-block::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.055), transparent 55%);
  opacity: 1;
  pointer-events: none;
}

.moment::after,
.dragon-eye-reveal::after,
.return-block::after {
  content: '';
  position: absolute;
  top: 18px;
  right: 20px;
  width: 34px;
  height: 2px;
  border-radius: 99px;
  background: var(--moment-accent);
  opacity: 0.45;
}

.moment-label { display: none; }

.moment-text,
.dragon-eye-text,
.return-text {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--text);
  font-family: inherit;
  font-size: 1em;
  line-height: 1.78;
  letter-spacing: 0.01em;
  text-shadow: none;
}

.moment-text + .moment-text,
.moment-text[style*="margin-top"] {
  margin-top: 0.85em !important;
}

.moment-shock { --moment-accent: #7a9cc8; --moment-bg: rgba(12, 22, 38, 0.76); --moment-border: rgba(122,156,200,0.28); }
.moment-anger { --moment-accent: #d06a6a; --moment-bg: rgba(36, 17, 17, 0.74); --moment-border: rgba(208,106,106,0.26); }
.moment-resolve { --moment-accent: #c8a46a; --moment-bg: rgba(32, 27, 17, 0.74); --moment-border: rgba(200,164,106,0.32); }
.moment-heavy { --moment-accent: #8a9ab0; --moment-bg: rgba(14, 17, 28, 0.78); --moment-border: rgba(138,154,176,0.25); }
.moment-warmth { --moment-accent: #e87aaa; --moment-bg: rgba(34, 18, 27, 0.72); --moment-border: rgba(232,122,170,0.25); }
.moment-krusch { --moment-accent: #5aaa7a; --moment-bg: rgba(10, 28, 18, 0.74); --moment-border: rgba(90,170,122,0.27); }
.moment-battle { --moment-accent: #d4a030; --moment-bg: rgba(35, 24, 7, 0.76); --moment-border: rgba(212,160,48,0.30); }

.moment-shock .moment-text,
.moment-anger .moment-text,
.moment-resolve .moment-text,
.moment-heavy .moment-text,
.moment-warmth .moment-text,
.moment-krusch .moment-text,
.moment-battle .moment-text {
  color: var(--text);
  font-style: normal;
}

/* ── Dragon Eye reveal ── */
.dragon-eye-reveal {
  --moment-accent: #d6ad3f;
  --moment-bg: rgba(26, 22, 12, 0.80);
  --moment-border: rgba(214, 173, 63, 0.35);
}

.dragon-eye-glyph {
  display: none;
}

.dragon-eye-text {
  color: #f1dfb2;
  font-style: normal;
}

/* ── Return from death animation ── */
.return-block {
  --moment-accent: #9d77df;
  --moment-bg: rgba(18, 14, 34, 0.82);
  --moment-border: rgba(157, 119, 223, 0.34);
  padding-top: 28px;
}

.return-vortex,
.return-ring {
  display: none;
}

.return-kanji {
  position: relative;
  z-index: 1;
  margin-bottom: 10px;
  color: rgba(205, 184, 244, 0.75);
  font-size: 30px;
  letter-spacing: 0.16em;
  text-shadow: none;
}

.return-label {
  position: relative;
  z-index: 1;
  margin-bottom: 14px;
  color: rgba(205, 184, 244, 0.72);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-shadow: none;
}

.return-text {
  color: var(--text);
}

/* ── Garfiel inner monologue ── */
.inner-fire {
  position: relative;
  margin: 1.8em auto;
  padding: 18px 24px 18px 28px;
  max-width: 760px;
  border-left: 4px solid var(--garfiel, var(--accent));
  border-radius: 0 12px 12px 0;
  background: rgba(212, 160, 64, 0.08);
  color: var(--text);
  font-size: 1em;
  line-height: 1.85;
  font-style: normal;
}

body.light-theme .moment,
body.light-theme .dragon-eye-reveal,
body.light-theme .return-block {
  --moment-bg: rgba(255, 252, 244, 0.78);
  --moment-border: color-mix(in srgb, var(--moment-accent) 38%, rgba(138,94,26,0.22));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--moment-accent) 12%, transparent), transparent 42%),
    var(--moment-bg);
  box-shadow: 0 10px 26px rgba(90, 70, 40, 0.12);
}

body.light-theme .moment-text,
body.light-theme .dragon-eye-text,
body.light-theme .return-text,
body.light-theme .moment-shock .moment-text,
body.light-theme .moment-anger .moment-text,
body.light-theme .moment-resolve .moment-text,
body.light-theme .moment-heavy .moment-text,
body.light-theme .moment-warmth .moment-text,
body.light-theme .moment-krusch .moment-text,
body.light-theme .moment-battle .moment-text {
  color: #1a1610;
}

body.light-theme .dragon-eye-text { color: #3c2b05; }
body.light-theme .return-kanji,
body.light-theme .return-label { color: rgba(76, 43, 132, 0.72); text-shadow: none; }
body.light-theme .inner-fire { color: #2a2010; background: rgba(212, 160, 64, 0.12); border-left-color: var(--accent); }

.moment-shock.visible,
.moment-resolve.visible,
.moment-anger.visible,
.moment-krusch.visible,
.moment-battle.visible,
.dragon-eye-glyph,
.return-kanji {
  animation: none !important;
}


body.plain-moments .moment,
body.plain-moments .dragon-eye-reveal,
body.plain-moments .return-block,
body.plain-moments .inner-fire {
  margin: 1em 0;
  padding: 0;
  max-width: none;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  overflow: visible;
  text-align: inherit;
}

body.plain-moments .moment::before,
body.plain-moments .moment::after,
body.plain-moments .dragon-eye-reveal::before,
body.plain-moments .dragon-eye-reveal::after,
body.plain-moments .return-block::before,
body.plain-moments .return-block::after,
body.plain-moments .dragon-eye-glyph,
body.plain-moments .return-vortex,
body.plain-moments .return-ring,
body.plain-moments .return-kanji,
body.plain-moments .return-label {
  display: none !important;
}

body.plain-moments .moment-text,
body.plain-moments .dragon-eye-text,
body.plain-moments .return-text {
  color: inherit;
  font: inherit;
  line-height: inherit;
  letter-spacing: inherit;
}

/* ── POV section headers ── */
.pov-header {
  display: none;
}
.pov-name {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.pov-subtitle {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 15px;
  color: rgba(200,164,106,0.5);
}

/* ── Scene label ── */
.scene-label {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: center;
  padding: 24px 0 8px;
  opacity: 0.6;
}

/* ── Navigation buttons ── */
.nav-buttons {
  position: relative;
  z-index: 10;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 60px 40px 100px;
  max-width: 760px;
  margin: 0 auto;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  padding: 14px 28px;
  border: 1px solid rgba(200,164,106,0.25);
  border-radius: 3px;
  background: rgba(8,12,20,0.7);
  transition: all 0.35s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.nav-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(200,164,106,0.06), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.nav-btn:hover::before {
  transform: translateX(100%);
}

.nav-btn:hover {
  color: var(--accent);
  border-color: rgba(200,164,106,0.55);
  box-shadow: 0 0 20px rgba(200,164,106,0.1);
  transform: translateY(-1px);
}

.nav-btn-prev { border-color: rgba(90,170,122,0.25); }
.nav-btn-prev:hover { color: var(--krusch); border-color: rgba(90,170,122,0.5); box-shadow: 0 0 20px rgba(90,170,122,0.1); }

.nav-btn-toc { border-color: rgba(200,164,106,0.25); }
.nav-btn-toc:hover { color: var(--accent); border-color: rgba(200,164,106,0.5); }

.nav-btn-next { border-color: rgba(170,100,220,0.25); }
.nav-btn-next:hover { color: var(--beatrice); border-color: rgba(170,100,220,0.5); box-shadow: 0 0 20px rgba(170,100,220,0.1); }

.nav-icon {
  font-size: 14px;
  opacity: 0.7;
}

/* ── Animations ── */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes sigil-pulse {
  0%, 100% { opacity: 0.4; letter-spacing: 0.3em; }
  50% { opacity: 0.9; letter-spacing: 0.45em; }
}

@keyframes shock-flare {
  0% { box-shadow: inset 0 0 40px rgba(80,120,200,0.05), 0 0 30px rgba(80,120,200,0.08); }
  50% { box-shadow: inset 0 0 80px rgba(80,120,200,0.15), 0 0 60px rgba(80,120,200,0.2); }
  100% { box-shadow: inset 0 0 40px rgba(80,120,200,0.05), 0 0 30px rgba(80,120,200,0.08); }
}

.moment-shock.visible { animation: shock-flare 4s ease-in-out infinite; }

@keyframes resolve-glow {
  0%, 100% { box-shadow: inset 0 0 50px rgba(200,164,106,0.06), 0 0 40px rgba(200,164,106,0.12); }
  50% { box-shadow: inset 0 0 80px rgba(200,164,106,0.12), 0 0 70px rgba(200,164,106,0.22); }
}
.moment-resolve.visible { animation: resolve-glow 3.5s ease-in-out infinite; }

@keyframes anger-pulse {
  0%, 100% { box-shadow: inset 0 0 40px rgba(200,60,60,0.05), 0 0 30px rgba(200,60,60,0.08); }
  50% { box-shadow: inset 0 0 60px rgba(200,60,60,0.12), 0 0 50px rgba(200,60,60,0.15); }
}
.moment-anger.visible { animation: anger-pulse 2.5s ease-in-out infinite; }

@keyframes krusch-glow {
  0%, 100% { box-shadow: inset 0 0 40px rgba(90,170,122,0.05), 0 0 30px rgba(90,170,122,0.08); }
  50% { box-shadow: inset 0 0 70px rgba(90,170,122,0.12), 0 0 50px rgba(90,170,122,0.15); }
}
.moment-krusch.visible { animation: krusch-glow 3s ease-in-out infinite; }

@keyframes eye-pulse {
  0%, 100% { filter: drop-shadow(0 0 14px rgba(255,200,40,0.6)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 30px rgba(255,220,60,0.95)) drop-shadow(0 0 50px rgba(200,140,0,0.5)); transform: scale(1.06); }
}

@keyframes return-glow {
  0%, 100% { text-shadow: 0 0 30px rgba(160,80,220,0.7), 0 0 60px rgba(80,40,140,0.4); }
  50% { text-shadow: 0 0 50px rgba(180,100,255,1), 0 0 90px rgba(100,50,180,0.7), 0 0 4px #fff; }
}

@keyframes ring-expand {
  0%   { width: 60px; height: 60px; opacity: 0.8; border-color: rgba(160,80,220,0.7); }
  100% { width: 320px; height: 320px; opacity: 0; border-color: rgba(80,20,140,0); }
}

/* ── Scroll indicator ── */
.scroll-down {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.scroll-chevron {
  width: 16px;
  height: 16px;
  border-right: 1px solid rgba(200,164,106,0.5);
  border-bottom: 1px solid rgba(200,164,106,0.5);
  transform: rotate(45deg);
  animation: bounce 1.5s ease-in-out infinite;
}
@keyframes bounce {
  0%,100% { transform: rotate(45deg) translateY(0); opacity: 0.4; }
  50% { transform: rotate(45deg) translateY(6px); opacity: 0.9; }
}

/* ── Witch cult / Dragon ── */
.cult-mention {
  color: var(--witch);
  font-style: normal;
  text-shadow: 0 0 8px rgba(144,64,160,0.3);
}

.dragon-mention {
  color: #d4a020;
  text-shadow: 0 0 8px rgba(200,150,0,0.3);
}

/* ── Footnote-style location ── */
.location-tag {
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.4em;
  color: rgba(200,164,106,0.35);
  padding: 8px 0 30px;
  text-transform: uppercase;
}

/* Responsive */
@media (max-width: 600px) {
  main { padding: 60px 20px 100px; }
  header { padding: 12px 20px; }
  .header-arc { display: none; }
  body { font-size: 17px; }
  .nav-buttons { padding: 40px 20px 80px; gap: 12px; }
  .nav-btn { padding: 12px 18px; font-size: 10px; }
  .chapter-kanji { font-size: 28px; letter-spacing: 0.25em; margin-bottom: 20px; }
  .moment,
  .dragon-eye-reveal,
  .return-block {
    margin: 1.7em 0;
    padding: 20px 20px 20px 24px;
    border-radius: 12px;
  }
  .moment-text,
  .dragon-eye-text,
  .return-text,
  .inner-fire {
    line-height: 1.72;
  }
}

/* ===== 10-16.html ===== */
:root {
  --bg: #080c14;
  --bg2: #0e1320;
  --bg3: #13192e;
  --text: #ddd4c0;
  --text-dim: #8a8070;
  --accent: #c8a46a;
  --accent2: #7a9cc8;
  --divider: #2a3050;
  --ram: #e87aaa;
  --emilia: #aac8ec;
  --bordeaux: #d04040;
  --marcos: #8a9ab0;
  --fiore: #f0c060;
  --sakura: #c08ad0;
  --felt: #e8a050;
  --reinhard: #5090d8;
  --witch: #9040a0;
  --narrator: #ddd4c0;
  --krusch: #5aaa7a;
  --tiga: #d4a060;
  --beatrice: #b08adc;
  --subaru: #90b8e0;
}

/* ── Light theme overrides ── */
body.light-theme {
  --bg: #f0ebe0;
  --bg2: #e8e2d4;
  --bg3: #ddd7c8;
  --text: #1a1610;
  --text-dim: #6a5e4a;
  --accent: #8a5e1a;
  --accent2: #2a5888;
  --divider: #c8bca0;
}

body.light-theme header {
  background: rgba(240,235,224,0.97);
  border-bottom-color: rgba(138,94,26,0.15);
}

body.light-theme p.italic-narr {
  color: #3a3020;
}

body.light-theme p.thought {
  color: #4a3e2a;
  border-left-color: rgba(138,94,26,0.4);
}

body.light-theme .inner-fire {
  color: #5a3a10;
  border-left-color: var(--accent);
}

body.light-theme .moment-resolve {
  background: rgba(240,235,220,0.7);
  border-color: rgba(138,94,26,0.35);
}
body.light-theme .moment-resolve .moment-text { color: #2a1e08; }

body.light-theme .moment-shock {
  background: rgba(220,230,245,0.6);
  border-color: rgba(60,100,180,0.3);
}
body.light-theme .moment-shock .moment-text { color: #1a2a3a; }

body.light-theme .moment-anger {
  background: rgba(245,225,220,0.6);
  border-color: rgba(180,60,60,0.3);
}
body.light-theme .moment-anger .moment-text { color: #2a0808; }

body.light-theme .moment-heavy {
  background: rgba(220,225,235,0.6);
  border-color: rgba(80,90,120,0.3);
}
body.light-theme .moment-heavy .moment-text { color: #1a1e2a; }

body.light-theme .moment-warmth {
  background: rgba(245,235,240,0.6);
  border-color: rgba(200,100,140,0.3);
}
body.light-theme .moment-warmth .moment-text { color: #2a1020; }

body.light-theme .moment-krusch {
  background: rgba(220,240,230,0.6);
  border-color: rgba(60,140,90,0.3);
}
body.light-theme .moment-krusch .moment-text { color: #0a2a18; }

body.light-theme .dragon-eye-reveal {
  background: rgba(245,240,220,0.9);
  border-color: rgba(160,120,20,0.4);
}

body.light-theme .dragon-eye-text {
  color: #7a5000;
  text-shadow: 0 0 8px rgba(160,100,0,0.2);
}

body.light-theme .return-block {
  background: rgba(230,225,245,0.85);
  border-color: rgba(100,60,180,0.3);
}

body.light-theme .return-kanji {
  color: rgba(100,60,180,0.85);
  text-shadow: 0 0 20px rgba(100,60,180,0.4);
}

body.light-theme .return-label {
  color: rgba(100,60,180,0.6);
}

body.light-theme .return-text {
  color: #2a1a4a;
}

body.light-theme .nav-btn {
  background: rgba(230,224,210,0.8);
  border-color: rgba(138,94,26,0.25);
  color: var(--text-dim);
}

body.light-theme .nav-btn:hover {
  background: rgba(215,208,192,0.95);
}

body.light-theme .chapter-kanji {
  color: rgba(138,94,26,0.65);
}

body.light-theme .location-tag {
  color: rgba(138,94,26,0.7);
}

body.light-theme .scroll-hint,
body.light-theme .chapter-arc {
  color: #8a7a60;
}

body.light-theme .chapter-subtitle {
  color: #2a2010;
}

body.light-theme .scroll-chevron {
  border-right-color: rgba(100,70,20,0.5);
  border-bottom-color: rgba(100,70,20,0.5);
}

body.light-theme .divider-line {
  background: linear-gradient(90deg, transparent, rgba(138,94,26,0.5), transparent);
}

body.light-theme .divider-sigil {
  color: rgba(138,94,26,0.8);
}

body.light-theme #canvas {
  opacity: 0.12;
}

/* Dialogue text — override the hardcoded !important */
body.light-theme .dialogue-text {
  color: #1a1610 !important;
}

/* Narration colours */
body.light-theme p.narr {
  color: #1a1610;
}

body.light-theme p.italic-narr {
  color: #3a3020;
}

body.light-theme p.thought {
  color: #4a3e2a;
  border-left-color: rgba(138,94,26,0.4);
}

/* Scene / pov labels */
body.light-theme .scene-label,
body.light-theme .pov-name {
  color: #8a7a60;
}

body.light-theme .pov-subtitle {
  color: rgba(138,94,26,0.55);
}

/* Dragon & cult inline mentions */
body.light-theme .dragon-mention {
  color: #8a5a00;
  text-shadow: 0 0 6px rgba(138,90,0,0.2);
}

body.light-theme .cult-mention {
  color: #6a3080;
  text-shadow: 0 0 6px rgba(106,48,128,0.2);
}

/* ── Settings panel light ── */
body.light-theme #settings-panel {
  background: rgba(240,235,224,0.97);
  border-color: rgba(138,94,26,0.25);
}
body.light-theme .settings-title {
  color: var(--accent);
  border-bottom-color: rgba(138,94,26,0.2);
}
body.light-theme .settings-label { color: var(--text-dim); }
body.light-theme .settings-btn {
  background: rgba(220,214,200,0.8);
  border-color: rgba(138,94,26,0.2);
  color: var(--text);
}
body.light-theme .settings-btn:hover,
body.light-theme .settings-btn.active {
  background: rgba(138,94,26,0.15);
  border-color: rgba(138,94,26,0.5);
  color: var(--accent);
}
body.light-theme input[type="range"] { accent-color: var(--accent); }

/* ── Settings button group (bottom-left) ── */
#settings-controls {
  position: fixed;
  bottom: 32px;
  left: 32px;
  z-index: 200;
}

/* ── Settings toggle button ── */
#settings-toggle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(200,164,106,0.3);
  background: rgba(14,19,32,0.85);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(200,164,106,0.8);
  transition: background 0.4s ease, border-color 0.4s ease, transform 0.2s ease, box-shadow 0.3s ease, color 0.4s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  user-select: none;
}

#settings-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(0,0,0,0.5);
  border-color: rgba(200,164,106,0.6);
  color: rgba(200,164,106,1);
}

#settings-toggle:active { transform: scale(0.95); }
#settings-toggle.active {
  border-color: rgba(200,164,106,0.7);
  color: rgba(200,164,106,1);
  box-shadow: 0 0 20px rgba(200,164,106,0.2);
}

body.light-theme #settings-toggle {
  background: rgba(230,224,210,0.92);
  border-color: rgba(138,94,26,0.35);
  box-shadow: 0 4px 20px rgba(100,80,40,0.2);
  color: rgba(138,94,26,0.8);
}
body.light-theme #settings-toggle:hover {
  border-color: rgba(138,94,26,0.65);
  box-shadow: 0 6px 28px rgba(100,80,40,0.3);
  color: rgba(138,94,26,1);
}
body.light-theme #settings-toggle.active {
  border-color: rgba(138,94,26,0.7);
  color: rgba(138,94,26,1);
}

/* ── Settings panel ── */
#settings-panel {
  position: fixed;
  bottom: 110px;
  left: 32px;
  z-index: 199;
  width: 300px;
  background: rgba(8,12,20,0.96);
  border: 1px solid rgba(200,164,106,0.2);
  border-radius: 8px;
  padding: 20px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  transform: translateY(12px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#settings-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.settings-title {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(200,164,106,0.15);
}

.settings-group {
  margin-bottom: 16px;
}

.settings-label {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
  display: block;
}

.settings-btn-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.settings-btn {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 0.1em;
  padding: 6px 10px;
  border-radius: 3px;
  border: 1px solid rgba(200,164,106,0.2);
  background: rgba(20,25,40,0.8);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.settings-btn:hover {
  background: rgba(200,164,106,0.08);
  border-color: rgba(200,164,106,0.4);
  color: var(--accent);
}

.settings-btn.active {
  background: rgba(200,164,106,0.12);
  border-color: rgba(200,164,106,0.5);
  color: var(--accent);
}

.settings-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
  cursor: pointer;
  height: 3px;
}

.settings-slider-val {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  color: var(--accent);
  min-width: 36px;
  text-align: right;
  letter-spacing: 0.05em;
}

/* ── Animations disabled class ── */
body.no-anim .reveal {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

body.no-anim .chapter-kanji,
body.no-anim .chapter-arc,
body.no-anim .chapter-num,
body.no-anim .chapter-subtitle {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

body.no-anim .scroll-hint { animation: none !important; opacity: 0.5 !important; }
body.no-anim .divider-sigil { animation: none !important; opacity: 0.7 !important; }
body.no-anim .moment-shock.visible { animation: none !important; }
body.no-anim .moment-resolve.visible { animation: none !important; }
body.no-anim .moment-anger.visible { animation: none !important; }
body.no-anim .scroll-chevron { animation: none !important; opacity: 0.5 !important; }

/* ── Theme toggle button ── */
#theme-toggle {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 200;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(200,164,106,0.3);
  background: rgba(14,19,32,0.85);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(200,164,106,0.8);
  transition: background 0.4s ease, border-color 0.4s ease, transform 0.2s ease, box-shadow 0.3s ease, color 0.4s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  user-select: none;
}

#theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(0,0,0,0.5);
  border-color: rgba(200,164,106,0.6);
  color: rgba(200,164,106,1);
}

#theme-toggle:active {
  transform: scale(0.95);
}

body.light-theme #theme-toggle {
  background: rgba(230,224,210,0.92);
  border-color: rgba(138,94,26,0.35);
  box-shadow: 0 4px 20px rgba(100,80,40,0.2);
  color: rgba(138,94,26,0.8);
}

body.light-theme #theme-toggle:hover {
  border-color: rgba(138,94,26,0.65);
  box-shadow: 0 6px 28px rgba(100,80,40,0.3);
  color: rgba(138,94,26,1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 19px;
  line-height: 1.85;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Ambient particles ── */
#canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

/* ── Progress bar ── */
#progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--krusch), var(--accent), var(--beatrice));
  width: 0%;
  z-index: 100;
  transition: width 0.1s linear;
}

/* ── Header ── */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 14px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(8,12,20,0.96);
  border-bottom: 1px solid rgba(200,164,106,0.1);
}

.header-arc {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.header-title {
  font-family: 'Cormorant SC', 'Cinzel', serif;
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--accent);
}

.header-pov {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--text-dim);
  transition: color 0.6s ease;
}

/* ── Chapter title block ── */
.chapter-title-block {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 40px;
}

.chapter-kanji {
  font-family: serif;
  font-size: 48px;
  color: rgba(200,164,106,0.25);
  letter-spacing: 0.4em;
  margin-bottom: 32px;
  animation: fadeSlideIn 2s ease forwards;
}

.chapter-arc {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 0.5em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 20px;
  animation: fadeSlideIn 2s ease 0.3s both;
}

.chapter-num {
  font-family: 'Cormorant SC', 'Cinzel Decorative', serif;
  font-size: clamp(28px, 5vw, 52px);
  color: var(--accent);
  line-height: 1.2;
  margin-bottom: 12px;
  animation: fadeSlideIn 2s ease 0.5s both;
  text-shadow: 0 0 60px rgba(200,164,106,0.3);
}

.chapter-subtitle {
  font-family: 'Cormorant Infant', 'EB Garamond', serif;
  font-style: italic;
  font-size: clamp(20px, 3vw, 32px);
  color: var(--text);
  margin-bottom: 60px;
  animation: fadeSlideIn 2s ease 0.8s both;
}

.scroll-hint {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.4em;
  color: var(--text-dim);
  text-transform: uppercase;
  animation: pulse 2.5s ease-in-out infinite;
}

/* ── Main content ── */
main {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 80px 40px 160px;
}

/* ── Paragraph reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Narration ── */
p.narr {
  margin-bottom: 1.3em;
  color: var(--text);
}

p.italic-narr {
  font-style: italic;
  color: #c8bcaa;
  margin-bottom: 1.3em;
}

p.thought {
  font-style: italic;
  color: #b0a898;
  padding-left: 20px;
  border-left: 2px solid rgba(200,164,106,0.3);
  margin: 1em 0 1.3em;
}

/* ── Dialogue ── */
.dialogue-block {
  margin: 0.4em 0 1.1em;
  position: relative;
}

.speaker-tag {
  display: none;
}

.dialogue-text {
  font-style: normal;
  color: #e0d8cc;
  display: block;
  padding-left: 4px;
}

.dialogue-text.emotional {
  font-style: italic;
}

.sp-ram { color: var(--ram); }
.sp-emilia { color: var(--emilia); }
.sp-bordeaux { color: var(--bordeaux); }
.sp-marcos { color: var(--marcos); }
.sp-fiore { color: var(--fiore); }
.sp-sakura { color: var(--sakura); }
.sp-felt { color: var(--felt); }
.sp-reinhard { color: var(--reinhard); }
.sp-official { color: #9aaabb; }
.sp-krusch { color: var(--krusch); }
.sp-tiga { color: var(--tiga); }
.sp-beatrice { color: var(--beatrice); }
.sp-subaru { color: var(--subaru); }
.sp-otto { color: #8cc878; }
.sp-garfiel { color: #d8b060; }
.sp-rem { color: #8ac8e8; }
.sp-petra { color: #e8b0c8; }
.sp-meili { color: #c8a0e8; }


/* ── Character colors stripped: dialogue colour-neutral ── */
.dialogue-text { color: #e0d8cc !important; }
/* ── Section divider ── */
.section-divider {
  text-align: center;
  padding: 50px 0;
  position: relative;
}

.divider-sigil {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  color: var(--accent);
  letter-spacing: 0.3em;
  display: inline-block;
  animation: sigil-pulse 3s ease-in-out infinite;
}

.divider-line {
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: 16px auto;
  width: 60%;
  opacity: 0.4;
}

/* ── Dramatic moments ── */
.moment,
.dragon-eye-reveal,
.return-block {
  --moment-accent: var(--accent);
  --moment-bg: rgba(15, 19, 32, 0.72);
  --moment-border: rgba(200, 164, 106, 0.22);
  position: relative;
  margin: 2.2em auto;
  padding: 24px 28px 24px 32px;
  max-width: 780px;
  border: 1px solid var(--moment-border);
  border-left: 4px solid var(--moment-accent);
  border-radius: 14px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--moment-accent) 14%, transparent), transparent 42%),
    var(--moment-bg);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  text-align: left;
}

.moment::before,
.dragon-eye-reveal::before,
.return-block::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.055), transparent 55%);
  opacity: 1;
  pointer-events: none;
}

.moment::after,
.dragon-eye-reveal::after,
.return-block::after {
  content: '';
  position: absolute;
  top: 18px;
  right: 20px;
  width: 34px;
  height: 2px;
  border-radius: 99px;
  background: var(--moment-accent);
  opacity: 0.45;
}

.moment-label { display: none; }

.moment-text,
.dragon-eye-text,
.return-text {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--text);
  font-family: inherit;
  font-size: 1em;
  line-height: 1.78;
  letter-spacing: 0.01em;
  text-shadow: none;
}

.moment-text + .moment-text,
.moment-text[style*="margin-top"] {
  margin-top: 0.85em !important;
}

.moment-shock { --moment-accent: #7a9cc8; --moment-bg: rgba(12, 22, 38, 0.76); --moment-border: rgba(122,156,200,0.28); }
.moment-anger { --moment-accent: #d06a6a; --moment-bg: rgba(36, 17, 17, 0.74); --moment-border: rgba(208,106,106,0.26); }
.moment-resolve { --moment-accent: #c8a46a; --moment-bg: rgba(32, 27, 17, 0.74); --moment-border: rgba(200,164,106,0.32); }
.moment-heavy { --moment-accent: #8a9ab0; --moment-bg: rgba(14, 17, 28, 0.78); --moment-border: rgba(138,154,176,0.25); }
.moment-warmth { --moment-accent: #e87aaa; --moment-bg: rgba(34, 18, 27, 0.72); --moment-border: rgba(232,122,170,0.25); }
.moment-krusch { --moment-accent: #5aaa7a; --moment-bg: rgba(10, 28, 18, 0.74); --moment-border: rgba(90,170,122,0.27); }
.moment-battle { --moment-accent: #d4a030; --moment-bg: rgba(35, 24, 7, 0.76); --moment-border: rgba(212,160,48,0.30); }

.moment-shock .moment-text,
.moment-anger .moment-text,
.moment-resolve .moment-text,
.moment-heavy .moment-text,
.moment-warmth .moment-text,
.moment-krusch .moment-text,
.moment-battle .moment-text {
  color: var(--text);
  font-style: normal;
}

/* ── Dragon Eye reveal ── */
.dragon-eye-reveal {
  --moment-accent: #d6ad3f;
  --moment-bg: rgba(26, 22, 12, 0.80);
  --moment-border: rgba(214, 173, 63, 0.35);
}

.dragon-eye-glyph {
  display: none;
}

.dragon-eye-text {
  color: #f1dfb2;
  font-style: normal;
}

/* ── Return from death animation ── */
.return-block {
  --moment-accent: #9d77df;
  --moment-bg: rgba(18, 14, 34, 0.82);
  --moment-border: rgba(157, 119, 223, 0.34);
  padding-top: 28px;
}

.return-vortex,
.return-ring {
  display: none;
}

.return-kanji {
  position: relative;
  z-index: 1;
  margin-bottom: 10px;
  color: rgba(205, 184, 244, 0.75);
  font-size: 30px;
  letter-spacing: 0.16em;
  text-shadow: none;
}

.return-label {
  position: relative;
  z-index: 1;
  margin-bottom: 14px;
  color: rgba(205, 184, 244, 0.72);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-shadow: none;
}

.return-text {
  color: var(--text);
}

/* ── Garfiel inner monologue ── */
.inner-fire {
  position: relative;
  margin: 1.8em auto;
  padding: 18px 24px 18px 28px;
  max-width: 760px;
  border-left: 4px solid var(--garfiel, var(--accent));
  border-radius: 0 12px 12px 0;
  background: rgba(212, 160, 64, 0.08);
  color: var(--text);
  font-size: 1em;
  line-height: 1.85;
  font-style: normal;
}

body.light-theme .moment,
body.light-theme .dragon-eye-reveal,
body.light-theme .return-block {
  --moment-bg: rgba(255, 252, 244, 0.78);
  --moment-border: color-mix(in srgb, var(--moment-accent) 38%, rgba(138,94,26,0.22));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--moment-accent) 12%, transparent), transparent 42%),
    var(--moment-bg);
  box-shadow: 0 10px 26px rgba(90, 70, 40, 0.12);
}

body.light-theme .moment-text,
body.light-theme .dragon-eye-text,
body.light-theme .return-text,
body.light-theme .moment-shock .moment-text,
body.light-theme .moment-anger .moment-text,
body.light-theme .moment-resolve .moment-text,
body.light-theme .moment-heavy .moment-text,
body.light-theme .moment-warmth .moment-text,
body.light-theme .moment-krusch .moment-text,
body.light-theme .moment-battle .moment-text {
  color: #1a1610;
}

body.light-theme .dragon-eye-text { color: #3c2b05; }
body.light-theme .return-kanji,
body.light-theme .return-label { color: rgba(76, 43, 132, 0.72); text-shadow: none; }
body.light-theme .inner-fire { color: #2a2010; background: rgba(212, 160, 64, 0.12); border-left-color: var(--accent); }

.moment-shock.visible,
.moment-resolve.visible,
.moment-anger.visible,
.moment-krusch.visible,
.moment-battle.visible,
.dragon-eye-glyph,
.return-kanji {
  animation: none !important;
}


body.plain-moments .moment,
body.plain-moments .dragon-eye-reveal,
body.plain-moments .return-block,
body.plain-moments .inner-fire {
  margin: 1em 0;
  padding: 0;
  max-width: none;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  overflow: visible;
  text-align: inherit;
}

body.plain-moments .moment::before,
body.plain-moments .moment::after,
body.plain-moments .dragon-eye-reveal::before,
body.plain-moments .dragon-eye-reveal::after,
body.plain-moments .return-block::before,
body.plain-moments .return-block::after,
body.plain-moments .dragon-eye-glyph,
body.plain-moments .return-vortex,
body.plain-moments .return-ring,
body.plain-moments .return-kanji,
body.plain-moments .return-label {
  display: none !important;
}

body.plain-moments .moment-text,
body.plain-moments .dragon-eye-text,
body.plain-moments .return-text {
  color: inherit;
  font: inherit;
  line-height: inherit;
  letter-spacing: inherit;
}

/* ── POV section headers ── */
.pov-header {
  display: none;
}
.pov-name {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.pov-subtitle {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 15px;
  color: rgba(200,164,106,0.5);
}

/* ── Scene label ── */
.scene-label {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: center;
  padding: 24px 0 8px;
  opacity: 0.6;
}

/* ── Navigation buttons ── */
.nav-buttons {
  position: relative;
  z-index: 10;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 60px 40px 100px;
  max-width: 760px;
  margin: 0 auto;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  padding: 14px 28px;
  border: 1px solid rgba(200,164,106,0.25);
  border-radius: 3px;
  background: rgba(8,12,20,0.7);
  transition: all 0.35s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.nav-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(200,164,106,0.06), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.nav-btn:hover::before {
  transform: translateX(100%);
}

.nav-btn:hover {
  color: var(--accent);
  border-color: rgba(200,164,106,0.55);
  box-shadow: 0 0 20px rgba(200,164,106,0.1);
  transform: translateY(-1px);
}

.nav-btn-prev { border-color: rgba(90,170,122,0.25); }
.nav-btn-prev:hover { color: var(--krusch); border-color: rgba(90,170,122,0.5); box-shadow: 0 0 20px rgba(90,170,122,0.1); }

.nav-btn-toc { border-color: rgba(200,164,106,0.25); }
.nav-btn-toc:hover { color: var(--accent); border-color: rgba(200,164,106,0.5); }

.nav-btn-next { border-color: rgba(170,100,220,0.25); }
.nav-btn-next:hover { color: var(--beatrice); border-color: rgba(170,100,220,0.5); box-shadow: 0 0 20px rgba(170,100,220,0.1); }

.nav-icon {
  font-size: 14px;
  opacity: 0.7;
}

/* ── Animations ── */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes sigil-pulse {
  0%, 100% { opacity: 0.4; letter-spacing: 0.3em; }
  50% { opacity: 0.9; letter-spacing: 0.45em; }
}

@keyframes shock-flare {
  0% { box-shadow: inset 0 0 40px rgba(80,120,200,0.05), 0 0 30px rgba(80,120,200,0.08); }
  50% { box-shadow: inset 0 0 80px rgba(80,120,200,0.15), 0 0 60px rgba(80,120,200,0.2); }
  100% { box-shadow: inset 0 0 40px rgba(80,120,200,0.05), 0 0 30px rgba(80,120,200,0.08); }
}

.moment-shock.visible { animation: shock-flare 4s ease-in-out infinite; }

@keyframes resolve-glow {
  0%, 100% { box-shadow: inset 0 0 50px rgba(200,164,106,0.06), 0 0 40px rgba(200,164,106,0.12); }
  50% { box-shadow: inset 0 0 80px rgba(200,164,106,0.12), 0 0 70px rgba(200,164,106,0.22); }
}
.moment-resolve.visible { animation: resolve-glow 3.5s ease-in-out infinite; }

@keyframes anger-pulse {
  0%, 100% { box-shadow: inset 0 0 40px rgba(200,60,60,0.05), 0 0 30px rgba(200,60,60,0.08); }
  50% { box-shadow: inset 0 0 60px rgba(200,60,60,0.12), 0 0 50px rgba(200,60,60,0.15); }
}
.moment-anger.visible { animation: anger-pulse 2.5s ease-in-out infinite; }

@keyframes krusch-glow {
  0%, 100% { box-shadow: inset 0 0 40px rgba(90,170,122,0.05), 0 0 30px rgba(90,170,122,0.08); }
  50% { box-shadow: inset 0 0 70px rgba(90,170,122,0.12), 0 0 50px rgba(90,170,122,0.15); }
}
.moment-krusch.visible { animation: krusch-glow 3s ease-in-out infinite; }

@keyframes eye-pulse {
  0%, 100% { filter: drop-shadow(0 0 14px rgba(255,200,40,0.6)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 30px rgba(255,220,60,0.95)) drop-shadow(0 0 50px rgba(200,140,0,0.5)); transform: scale(1.06); }
}

@keyframes return-glow {
  0%, 100% { text-shadow: 0 0 30px rgba(160,80,220,0.7), 0 0 60px rgba(80,40,140,0.4); }
  50% { text-shadow: 0 0 50px rgba(180,100,255,1), 0 0 90px rgba(100,50,180,0.7), 0 0 4px #fff; }
}

@keyframes ring-expand {
  0%   { width: 60px; height: 60px; opacity: 0.8; border-color: rgba(160,80,220,0.7); }
  100% { width: 320px; height: 320px; opacity: 0; border-color: rgba(80,20,140,0); }
}

/* ── Scroll indicator ── */
.scroll-down {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.scroll-chevron {
  width: 16px;
  height: 16px;
  border-right: 1px solid rgba(200,164,106,0.5);
  border-bottom: 1px solid rgba(200,164,106,0.5);
  transform: rotate(45deg);
  animation: bounce 1.5s ease-in-out infinite;
}
@keyframes bounce {
  0%,100% { transform: rotate(45deg) translateY(0); opacity: 0.4; }
  50% { transform: rotate(45deg) translateY(6px); opacity: 0.9; }
}

/* ── Witch cult / Dragon ── */
.cult-mention {
  color: var(--witch);
  font-style: normal;
  text-shadow: 0 0 8px rgba(144,64,160,0.3);
}

.dragon-mention {
  color: #d4a020;
  text-shadow: 0 0 8px rgba(200,150,0,0.3);
}

/* ── Footnote-style location ── */
.location-tag {
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.4em;
  color: rgba(200,164,106,0.35);
  padding: 8px 0 30px;
  text-transform: uppercase;
}

/* Responsive */
@media (max-width: 600px) {
  main { padding: 60px 20px 100px; }
  header { padding: 12px 20px; }
  .header-arc { display: none; }
  body { font-size: 17px; }
  .nav-buttons { padding: 40px 20px 80px; gap: 12px; }
  .nav-btn { padding: 12px 18px; font-size: 10px; }
  .chapter-kanji { font-size: 28px; letter-spacing: 0.25em; margin-bottom: 20px; }
  .moment,
  .dragon-eye-reveal,
  .return-block {
    margin: 1.7em 0;
    padding: 20px 20px 20px 24px;
    border-radius: 12px;
  }
  .moment-text,
  .dragon-eye-text,
  .return-text,
  .inner-fire {
    line-height: 1.72;
  }
}

/* ===== 10-17.html ===== */
:root {
  --bg: #080c14;
  --bg2: #0e1320;
  --bg3: #13192e;
  --text: #ddd4c0;
  --text-dim: #8a8070;
  --accent: #c8a46a;
  --accent2: #7a9cc8;
  --divider: #2a3050;
  --ram: #e87aaa;
  --emilia: #aac8ec;
  --bordeaux: #d04040;
  --marcos: #8a9ab0;
  --fiore: #f0c060;
  --sakura: #c08ad0;
  --felt: #e8a050;
  --reinhard: #5090d8;
  --witch: #9040a0;
  --narrator: #ddd4c0;
}

/* ── Light theme overrides ── */
body.light-theme {
  --bg: #f0ebe0;
  --bg2: #e8e2d4;
  --bg3: #ddd7c8;
  --text: #1a1610;
  --text-dim: #6a5e4a;
  --accent: #8a5e1a;
  --accent2: #2a5888;
  --divider: #c8bca0;
}

body.light-theme header {
  background: rgba(240,235,224,0.97);
  border-bottom-color: rgba(138,94,26,0.15);
}

body.light-theme p.italic-narr {
  color: #3a3020;
}

body.light-theme p.thought {
  color: #4a3e2a;
  border-left-color: rgba(138,94,26,0.4);
}

body.light-theme .inner-fire {
  color: #5a3a10;
  border-left-color: var(--accent);
}

body.light-theme .moment-resolve {
  background: rgba(240,235,220,0.7);
  border-color: rgba(138,94,26,0.35);
}
body.light-theme .moment-resolve .moment-text { color: #2a1e08; }

body.light-theme .moment-shock {
  background: rgba(220,230,245,0.6);
  border-color: rgba(60,100,180,0.3);
}
body.light-theme .moment-shock .moment-text { color: #1a2a3a; }

body.light-theme .moment-anger {
  background: rgba(245,225,220,0.6);
  border-color: rgba(180,60,60,0.3);
}
body.light-theme .moment-anger .moment-text { color: #2a0808; }

body.light-theme .moment-heavy {
  background: rgba(220,225,235,0.6);
  border-color: rgba(80,90,120,0.3);
}
body.light-theme .moment-heavy .moment-text { color: #1a1e2a; }

body.light-theme .moment-warmth {
  background: rgba(245,235,240,0.6);
  border-color: rgba(200,100,140,0.3);
}
body.light-theme .moment-warmth .moment-text { color: #2a1020; }

body.light-theme .nav-btn {
  background: rgba(230,224,210,0.8);
  border-color: rgba(138,94,26,0.25);
  color: var(--text-dim);
}

body.light-theme .nav-btn:hover {
  background: rgba(215,208,192,0.95);
}

body.light-theme .chapter-kanji {
  color: rgba(138,94,26,0.65);
}

body.light-theme .scroll-hint,
body.light-theme .chapter-arc {
  color: #8a7a60;
}

body.light-theme .chapter-subtitle {
  color: #2a2010;
}

body.light-theme .scroll-chevron {
  border-right-color: rgba(100,70,20,0.5);
  border-bottom-color: rgba(100,70,20,0.5);
}

body.light-theme .divider-line {
  background: linear-gradient(90deg, transparent, rgba(138,94,26,0.5), transparent);
}

body.light-theme .divider-sigil {
  color: rgba(138,94,26,0.8);
}

body.light-theme #canvas {
  opacity: 0.12;
}

body.light-theme .dialogue-text {
  color: #1a1610 !important;
}

body.light-theme p.narr {
  color: #1a1610;
}

body.light-theme .scene-label,
body.light-theme .pov-name {
  color: #8a7a60;
}

body.light-theme .pov-subtitle {
  color: rgba(138,94,26,0.55);
}

/* ── Settings panel light ── */
body.light-theme #settings-panel {
  background: rgba(240,235,224,0.97);
  border-color: rgba(138,94,26,0.25);
}
body.light-theme .settings-title {
  color: var(--accent);
  border-bottom-color: rgba(138,94,26,0.2);
}
body.light-theme .settings-label { color: var(--text-dim); }
body.light-theme .settings-btn {
  background: rgba(220,214,200,0.8);
  border-color: rgba(138,94,26,0.2);
  color: var(--text);
}
body.light-theme .settings-btn:hover,
body.light-theme .settings-btn.active {
  background: rgba(138,94,26,0.15);
  border-color: rgba(138,94,26,0.5);
  color: var(--accent);
}
body.light-theme input[type="range"] { accent-color: var(--accent); }

/* ── Settings button group (bottom-left) ── */
#settings-controls {
  position: fixed;
  bottom: 32px;
  left: 32px;
  z-index: 200;
}

/* ── Settings toggle button ── */
#settings-toggle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(200,164,106,0.3);
  background: rgba(14,19,32,0.85);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(200,164,106,0.8);
  transition: background 0.4s ease, border-color 0.4s ease, transform 0.2s ease, box-shadow 0.3s ease, color 0.4s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  user-select: none;
}

#settings-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(0,0,0,0.5);
  border-color: rgba(200,164,106,0.6);
  color: rgba(200,164,106,1);
}

#settings-toggle:active { transform: scale(0.95); }
#settings-toggle.active {
  border-color: rgba(200,164,106,0.7);
  color: rgba(200,164,106,1);
  box-shadow: 0 0 20px rgba(200,164,106,0.2);
}

body.light-theme #settings-toggle {
  background: rgba(230,224,210,0.92);
  border-color: rgba(138,94,26,0.35);
  box-shadow: 0 4px 20px rgba(100,80,40,0.2);
  color: rgba(138,94,26,0.8);
}
body.light-theme #settings-toggle:hover {
  border-color: rgba(138,94,26,0.65);
  box-shadow: 0 6px 28px rgba(100,80,40,0.3);
  color: rgba(138,94,26,1);
}
body.light-theme #settings-toggle.active {
  border-color: rgba(138,94,26,0.7);
  color: rgba(138,94,26,1);
}

/* ── Settings panel ── */
#settings-panel {
  position: fixed;
  bottom: 110px;
  left: 32px;
  z-index: 199;
  width: 300px;
  background: rgba(8,12,20,0.96);
  border: 1px solid rgba(200,164,106,0.2);
  border-radius: 8px;
  padding: 20px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  transform: translateY(12px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#settings-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.settings-title {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(200,164,106,0.15);
}

.settings-group {
  margin-bottom: 16px;
}

.settings-label {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
  display: block;
}

.settings-btn-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.settings-btn {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 0.1em;
  padding: 6px 10px;
  border-radius: 3px;
  border: 1px solid rgba(200,164,106,0.2);
  background: rgba(20,25,40,0.8);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.settings-btn:hover {
  background: rgba(200,164,106,0.08);
  border-color: rgba(200,164,106,0.4);
  color: var(--accent);
}

.settings-btn.active {
  background: rgba(200,164,106,0.12);
  border-color: rgba(200,164,106,0.5);
  color: var(--accent);
}

.settings-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
  cursor: pointer;
  height: 3px;
}

.settings-slider-val {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  color: var(--accent);
  min-width: 36px;
  text-align: right;
  letter-spacing: 0.05em;
}

/* ── Animations disabled class ── */
body.no-anim .reveal {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

body.no-anim .chapter-kanji,
body.no-anim .chapter-arc,
body.no-anim .chapter-num,
body.no-anim .chapter-subtitle {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

body.no-anim .scroll-hint { animation: none !important; opacity: 0.5 !important; }
body.no-anim .divider-sigil { animation: none !important; opacity: 0.7 !important; }
body.no-anim .moment-shock.visible { animation: none !important; }
body.no-anim .moment-resolve.visible { animation: none !important; }
body.no-anim .moment-anger.visible { animation: none !important; }
body.no-anim .scroll-chevron { animation: none !important; opacity: 0.5 !important; }

/* ── Theme toggle button ── */
#theme-toggle {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 200;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(200,164,106,0.3);
  background: rgba(14,19,32,0.85);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(200,164,106,0.8);
  transition: background 0.4s ease, border-color 0.4s ease, transform 0.2s ease, box-shadow 0.3s ease, color 0.4s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  user-select: none;
}

#theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(0,0,0,0.5);
  border-color: rgba(200,164,106,0.6);
  color: rgba(200,164,106,1);
}

#theme-toggle:active {
  transform: scale(0.95);
}

body.light-theme #theme-toggle {
  background: rgba(230,224,210,0.92);
  border-color: rgba(138,94,26,0.35);
  box-shadow: 0 4px 20px rgba(100,80,40,0.2);
  color: rgba(138,94,26,0.8);
}

body.light-theme #theme-toggle:hover {
  border-color: rgba(138,94,26,0.65);
  box-shadow: 0 6px 28px rgba(100,80,40,0.3);
  color: rgba(138,94,26,1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 19px;
  line-height: 1.85;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Ambient particles ── */
#canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

/* ── Progress bar ── */
#progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--ram), var(--accent), var(--reinhard));
  width: 0%;
  z-index: 100;
  transition: width 0.1s linear;
}

/* ── Header ── */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 14px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(8,12,20,0.96);
  border-bottom: 1px solid rgba(200,164,106,0.1);
}

.header-arc {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.header-title {
  font-family: 'Cormorant SC', 'Cinzel', serif;
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--accent);
}

.header-pov {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--text-dim);
  transition: color 0.6s ease;
}

/* ── Chapter title block ── */
.chapter-title-block {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 40px;
}

.chapter-kanji {
  font-family: serif;
  font-size: 48px;
  color: rgba(200,164,106,0.25);
  letter-spacing: 0.4em;
  margin-bottom: 32px;
  animation: fadeSlideIn 2s ease forwards;
}

.chapter-arc {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 0.5em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 20px;
  animation: fadeSlideIn 2s ease 0.3s both;
}

.chapter-num {
  font-family: 'Cormorant SC', 'Cinzel Decorative', serif;
  font-size: clamp(28px, 5vw, 52px);
  color: var(--accent);
  line-height: 1.2;
  margin-bottom: 12px;
  animation: fadeSlideIn 2s ease 0.5s both;
  text-shadow: 0 0 60px rgba(200,164,106,0.3);
}

.chapter-subtitle {
  font-family: 'Cormorant Infant', 'EB Garamond', serif;
  font-style: italic;
  font-size: clamp(20px, 3vw, 32px);
  color: var(--text);
  margin-bottom: 60px;
  animation: fadeSlideIn 2s ease 0.8s both;
}

.scroll-hint {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.4em;
  color: var(--text-dim);
  text-transform: uppercase;
  animation: pulse 2.5s ease-in-out infinite;
}

/* ── Main content ── */
main {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 80px 40px 160px;
}

/* ── Paragraph reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Narration ── */
p.narr {
  margin-bottom: 1.3em;
  color: var(--text);
}

p.italic-narr {
  font-style: italic;
  color: #c8bcaa;
  margin-bottom: 1.3em;
}

p.thought {
  font-style: italic;
  color: #b0a898;
  padding-left: 20px;
  border-left: 2px solid rgba(200,164,106,0.3);
  margin: 1em 0 1.3em;
}

/* ── Dialogue ── */
.dialogue-block {
  margin: 0.4em 0 1.1em;
  position: relative;
}

.speaker-tag {
  display: none;
}

.dialogue-text {
  font-style: normal;
  color: #e0d8cc;
  display: block;
  padding-left: 4px;
}

.dialogue-text.emotional {
  font-style: italic;
}

.sp-ram { color: var(--ram); }
.sp-emilia { color: var(--emilia); }
.sp-bordeaux { color: var(--bordeaux); }
.sp-marcos { color: var(--marcos); }
.sp-fiore { color: var(--fiore); }
.sp-sakura { color: var(--sakura); }
.sp-felt { color: var(--felt); }
.sp-reinhard { color: var(--reinhard); }
.sp-official { color: #9aaabb; }

/* ── Section divider ── */
.section-divider {
  text-align: center;
  padding: 50px 0;
  position: relative;
}

.divider-sigil {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  color: var(--accent);
  letter-spacing: 0.3em;
  display: inline-block;
  animation: sigil-pulse 3s ease-in-out infinite;
}

.divider-line {
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: 16px auto;
  width: 60%;
  opacity: 0.4;
}

/* ── Dramatic moments ── */
.moment,
.dragon-eye-reveal,
.return-block {
  --moment-accent: var(--accent);
  --moment-bg: rgba(15, 19, 32, 0.72);
  --moment-border: rgba(200, 164, 106, 0.22);
  position: relative;
  margin: 2.2em auto;
  padding: 24px 28px 24px 32px;
  max-width: 780px;
  border: 1px solid var(--moment-border);
  border-left: 4px solid var(--moment-accent);
  border-radius: 14px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--moment-accent) 14%, transparent), transparent 42%),
    var(--moment-bg);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  text-align: left;
}

.moment::before,
.dragon-eye-reveal::before,
.return-block::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.055), transparent 55%);
  opacity: 1;
  pointer-events: none;
}

.moment::after,
.dragon-eye-reveal::after,
.return-block::after {
  content: '';
  position: absolute;
  top: 18px;
  right: 20px;
  width: 34px;
  height: 2px;
  border-radius: 99px;
  background: var(--moment-accent);
  opacity: 0.45;
}

.moment-label { display: none; }

.moment-text,
.dragon-eye-text,
.return-text {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--text);
  font-family: inherit;
  font-size: 1em;
  line-height: 1.78;
  letter-spacing: 0.01em;
  text-shadow: none;
}

.moment-text + .moment-text,
.moment-text[style*="margin-top"] {
  margin-top: 0.85em !important;
}

.moment-shock { --moment-accent: #7a9cc8; --moment-bg: rgba(12, 22, 38, 0.76); --moment-border: rgba(122,156,200,0.28); }
.moment-anger { --moment-accent: #d06a6a; --moment-bg: rgba(36, 17, 17, 0.74); --moment-border: rgba(208,106,106,0.26); }
.moment-resolve { --moment-accent: #c8a46a; --moment-bg: rgba(32, 27, 17, 0.74); --moment-border: rgba(200,164,106,0.32); }
.moment-heavy { --moment-accent: #8a9ab0; --moment-bg: rgba(14, 17, 28, 0.78); --moment-border: rgba(138,154,176,0.25); }
.moment-warmth { --moment-accent: #e87aaa; --moment-bg: rgba(34, 18, 27, 0.72); --moment-border: rgba(232,122,170,0.25); }
.moment-krusch { --moment-accent: #5aaa7a; --moment-bg: rgba(10, 28, 18, 0.74); --moment-border: rgba(90,170,122,0.27); }
.moment-battle { --moment-accent: #d4a030; --moment-bg: rgba(35, 24, 7, 0.76); --moment-border: rgba(212,160,48,0.30); }

.moment-shock .moment-text,
.moment-anger .moment-text,
.moment-resolve .moment-text,
.moment-heavy .moment-text,
.moment-warmth .moment-text,
.moment-krusch .moment-text,
.moment-battle .moment-text {
  color: var(--text);
  font-style: normal;
}

/* ── Dragon Eye reveal ── */
.dragon-eye-reveal {
  --moment-accent: #d6ad3f;
  --moment-bg: rgba(26, 22, 12, 0.80);
  --moment-border: rgba(214, 173, 63, 0.35);
}

.dragon-eye-glyph {
  display: none;
}

.dragon-eye-text {
  color: #f1dfb2;
  font-style: normal;
}

/* ── Return from death animation ── */
.return-block {
  --moment-accent: #9d77df;
  --moment-bg: rgba(18, 14, 34, 0.82);
  --moment-border: rgba(157, 119, 223, 0.34);
  padding-top: 28px;
}

.return-vortex,
.return-ring {
  display: none;
}

.return-kanji {
  position: relative;
  z-index: 1;
  margin-bottom: 10px;
  color: rgba(205, 184, 244, 0.75);
  font-size: 30px;
  letter-spacing: 0.16em;
  text-shadow: none;
}

.return-label {
  position: relative;
  z-index: 1;
  margin-bottom: 14px;
  color: rgba(205, 184, 244, 0.72);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-shadow: none;
}

.return-text {
  color: var(--text);
}

/* ── Garfiel inner monologue ── */
.inner-fire {
  position: relative;
  margin: 1.8em auto;
  padding: 18px 24px 18px 28px;
  max-width: 760px;
  border-left: 4px solid var(--garfiel, var(--accent));
  border-radius: 0 12px 12px 0;
  background: rgba(212, 160, 64, 0.08);
  color: var(--text);
  font-size: 1em;
  line-height: 1.85;
  font-style: normal;
}

body.light-theme .moment,
body.light-theme .dragon-eye-reveal,
body.light-theme .return-block {
  --moment-bg: rgba(255, 252, 244, 0.78);
  --moment-border: color-mix(in srgb, var(--moment-accent) 38%, rgba(138,94,26,0.22));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--moment-accent) 12%, transparent), transparent 42%),
    var(--moment-bg);
  box-shadow: 0 10px 26px rgba(90, 70, 40, 0.12);
}

body.light-theme .moment-text,
body.light-theme .dragon-eye-text,
body.light-theme .return-text,
body.light-theme .moment-shock .moment-text,
body.light-theme .moment-anger .moment-text,
body.light-theme .moment-resolve .moment-text,
body.light-theme .moment-heavy .moment-text,
body.light-theme .moment-warmth .moment-text,
body.light-theme .moment-krusch .moment-text,
body.light-theme .moment-battle .moment-text {
  color: #1a1610;
}

body.light-theme .dragon-eye-text { color: #3c2b05; }
body.light-theme .return-kanji,
body.light-theme .return-label { color: rgba(76, 43, 132, 0.72); text-shadow: none; }
body.light-theme .inner-fire { color: #2a2010; background: rgba(212, 160, 64, 0.12); border-left-color: var(--accent); }

.moment-shock.visible,
.moment-resolve.visible,
.moment-anger.visible,
.moment-krusch.visible,
.moment-battle.visible,
.dragon-eye-glyph,
.return-kanji {
  animation: none !important;
}


body.plain-moments .moment,
body.plain-moments .dragon-eye-reveal,
body.plain-moments .return-block,
body.plain-moments .inner-fire {
  margin: 1em 0;
  padding: 0;
  max-width: none;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  overflow: visible;
  text-align: inherit;
}

body.plain-moments .moment::before,
body.plain-moments .moment::after,
body.plain-moments .dragon-eye-reveal::before,
body.plain-moments .dragon-eye-reveal::after,
body.plain-moments .return-block::before,
body.plain-moments .return-block::after,
body.plain-moments .dragon-eye-glyph,
body.plain-moments .return-vortex,
body.plain-moments .return-ring,
body.plain-moments .return-kanji,
body.plain-moments .return-label {
  display: none !important;
}

body.plain-moments .moment-text,
body.plain-moments .dragon-eye-text,
body.plain-moments .return-text {
  color: inherit;
  font: inherit;
  line-height: inherit;
  letter-spacing: inherit;
}

/* ── POV section headers ── */
.pov-header {
  display: none;
}
.pov-name {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.pov-subtitle {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 15px;
  color: rgba(200,164,106,0.5);
}

/* ── Scene label ── */
.scene-label {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: center;
  padding: 24px 0 8px;
  opacity: 0.6;
}

/* ── Navigation buttons ── */
.nav-buttons {
  position: relative;
  z-index: 10;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 60px 40px 100px;
  max-width: 760px;
  margin: 0 auto;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  padding: 14px 28px;
  border: 1px solid rgba(200,164,106,0.25);
  border-radius: 3px;
  background: rgba(8,12,20,0.7);
  transition: all 0.35s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.nav-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(200,164,106,0.06), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.nav-btn:hover::before {
  transform: translateX(100%);
}

.nav-btn:hover {
  color: var(--accent);
  border-color: rgba(200,164,106,0.55);
  box-shadow: 0 0 20px rgba(200,164,106,0.1);
  transform: translateY(-1px);
}

.nav-btn-prev { border-color: rgba(90,170,122,0.25); }
.nav-btn-prev:hover { color: var(--krusch); border-color: rgba(90,170,122,0.5); box-shadow: 0 0 20px rgba(90,170,122,0.1); }

.nav-btn-toc { border-color: rgba(200,164,106,0.25); }
.nav-btn-toc:hover { color: var(--accent); border-color: rgba(200,164,106,0.5); }

.nav-btn-next { border-color: rgba(170,100,220,0.25); }
.nav-btn-next:hover { color: var(--beatrice); border-color: rgba(170,100,220,0.5); box-shadow: 0 0 20px rgba(170,100,220,0.1); }

.nav-icon {
  font-size: 14px;
  opacity: 0.7;
}

/* ── Animations ── */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes sigil-pulse {
  0%, 100% { opacity: 0.4; letter-spacing: 0.3em; }
  50% { opacity: 0.9; letter-spacing: 0.45em; }
}

@keyframes shock-flare {
  0% { box-shadow: inset 0 0 40px rgba(80,120,200,0.05), 0 0 30px rgba(80,120,200,0.08); }
  50% { box-shadow: inset 0 0 80px rgba(80,120,200,0.15), 0 0 60px rgba(80,120,200,0.2); }
  100% { box-shadow: inset 0 0 40px rgba(80,120,200,0.05), 0 0 30px rgba(80,120,200,0.08); }
}

.moment-shock.visible { animation: shock-flare 4s ease-in-out infinite; }

@keyframes resolve-glow {
  0%, 100% { box-shadow: inset 0 0 50px rgba(200,164,106,0.06), 0 0 40px rgba(200,164,106,0.12); }
  50% { box-shadow: inset 0 0 80px rgba(200,164,106,0.12), 0 0 70px rgba(200,164,106,0.22); }
}
.moment-resolve.visible { animation: resolve-glow 3.5s ease-in-out infinite; }

@keyframes anger-pulse {
  0%, 100% { box-shadow: inset 0 0 40px rgba(200,60,60,0.05), 0 0 30px rgba(200,60,60,0.08); }
  50% { box-shadow: inset 0 0 60px rgba(200,60,60,0.12), 0 0 50px rgba(200,60,60,0.15); }
}
.moment-anger.visible { animation: anger-pulse 2.5s ease-in-out infinite; }

/* ── Scroll indicator ── */
.scroll-down {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.scroll-chevron {
  width: 16px;
  height: 16px;
  border-right: 1px solid rgba(200,164,106,0.5);
  border-bottom: 1px solid rgba(200,164,106,0.5);
  transform: rotate(45deg);
  animation: bounce 1.5s ease-in-out infinite;
}
@keyframes bounce {
  0%,100% { transform: rotate(45deg) translateY(0); opacity: 0.4; }
  50% { transform: rotate(45deg) translateY(6px); opacity: 0.9; }
}

/* ── Witch cult warning — for the name mention ── */
.cult-mention {
  color: var(--witch);
  font-style: normal;
  text-shadow: 0 0 8px rgba(144,64,160,0.3);
}

/* ── Quote marker ── */
.em-dash { color: var(--text-dim); }

/* ── Footnote-style location ── */
.location-tag {
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.4em;
  color: rgba(200,164,106,0.35);
  padding: 8px 0 30px;
  text-transform: uppercase;
}

/* Responsive */
@media (max-width: 600px) {
  main { padding: 60px 20px 100px; }
  header { padding: 12px 20px; }
  .header-arc { display: none; }
  body { font-size: 17px; }
  .nav-buttons { padding: 40px 20px 80px; gap: 12px; }
  .nav-btn { padding: 12px 18px; font-size: 10px; }
  .chapter-kanji { font-size: 28px; letter-spacing: 0.25em; margin-bottom: 20px; }
  .moment,
  .dragon-eye-reveal,
  .return-block {
    margin: 1.7em 0;
    padding: 20px 20px 20px 24px;
    border-radius: 12px;
  }
  .moment-text,
  .dragon-eye-text,
  .return-text,
  .inner-fire {
    line-height: 1.72;
  }
}

/* ===== 10-18.html ===== */
:root {
  --bg: #080c14;
  --bg2: #0e1320;
  --bg3: #13192e;
  --text: #ddd4c0;
  --text-dim: #8a8070;
  --accent: #c8a46a;
  --accent2: #7a9cc8;
  --divider: #2a3050;
  --ram: #e87aaa;
  --emilia: #aac8ec;
  --bordeaux: #d04040;
  --marcos: #8a9ab0;
  --fiore: #f0c060;
  --sakura: #c08ad0;
  --felt: #e8a050;
  --reinhard: #5090d8;
  --witch: #9040a0;
  --narrator: #ddd4c0;
  --garfiel: #d4a030;
  --otto: #70b870;
  --petra: #e8905a;
  --rem: #7ab0e0;
  --meiili: #d07ab0;
  --wilhelm: #c8c8c8;
}

/* ── Light theme overrides ── */
body.light-theme {
  --bg: #f0ebe0;
  --bg2: #e8e2d4;
  --bg3: #ddd7c8;
  --text: #1a1610;
  --text-dim: #6a5e4a;
  --accent: #8a5e1a;
  --accent2: #2a5888;
  --divider: #c8bca0;
}

body.light-theme header {
  background: rgba(240,235,224,0.97);
  border-bottom-color: rgba(138,94,26,0.15);
}

body.light-theme p.italic-narr { color: #3a3020; }
body.light-theme p.thought { color: #4a3e2a; border-left-color: rgba(138,94,26,0.4); }
body.light-theme .inner-fire { color: #5a3a10; border-left-color: var(--accent); }

body.light-theme .moment-resolve {
  background: rgba(240,235,220,0.7);
  border-color: rgba(138,94,26,0.35);
}
body.light-theme .moment-resolve .moment-text { color: #2a1e08; }

body.light-theme .moment-shock {
  background: rgba(220,230,245,0.6);
  border-color: rgba(60,100,180,0.3);
}
body.light-theme .moment-shock .moment-text { color: #1a2a3a; }

body.light-theme .moment-anger {
  background: rgba(245,225,220,0.6);
  border-color: rgba(180,60,60,0.3);
}
body.light-theme .moment-anger .moment-text { color: #2a0808; }

body.light-theme .moment-heavy {
  background: rgba(220,225,235,0.6);
  border-color: rgba(80,90,120,0.3);
}
body.light-theme .moment-heavy .moment-text { color: #1a1e2a; }

body.light-theme .moment-warmth {
  background: rgba(245,235,240,0.6);
  border-color: rgba(200,100,140,0.3);
}
body.light-theme .moment-warmth .moment-text { color: #2a1020; }

body.light-theme .nav-btn {
  background: rgba(230,224,210,0.8);
  border-color: rgba(138,94,26,0.25);
  color: var(--text-dim);
}

body.light-theme .nav-btn:hover { background: rgba(215,208,192,0.95); }
body.light-theme .chapter-kanji { color: rgba(138,94,26,0.65); }
body.light-theme .scroll-hint,
body.light-theme .chapter-arc { color: #8a7a60; }
body.light-theme .chapter-subtitle { color: #2a2010; }
body.light-theme .scroll-chevron {
  border-right-color: rgba(100,70,20,0.5);
  border-bottom-color: rgba(100,70,20,0.5);
}
body.light-theme .divider-line {
  background: linear-gradient(90deg, transparent, rgba(138,94,26,0.5), transparent);
}
body.light-theme .divider-sigil { color: rgba(138,94,26,0.8); }
body.light-theme #canvas { opacity: 0.12; }
body.light-theme .dialogue-text { color: #1a1610 !important; }
body.light-theme p.narr { color: #1a1610; }
body.light-theme .scene-label,
body.light-theme .pov-name { color: #8a7a60; }
body.light-theme .pov-subtitle { color: rgba(138,94,26,0.55); }

/* ── Settings panel light ── */
body.light-theme #settings-panel {
  background: rgba(240,235,224,0.97);
  border-color: rgba(138,94,26,0.25);
}
body.light-theme .settings-title {
  color: var(--accent);
  border-bottom-color: rgba(138,94,26,0.2);
}
body.light-theme .settings-label { color: var(--text-dim); }
body.light-theme .settings-btn {
  background: rgba(220,214,200,0.8);
  border-color: rgba(138,94,26,0.2);
  color: var(--text);
}
body.light-theme .settings-btn:hover,
body.light-theme .settings-btn.active {
  background: rgba(138,94,26,0.15);
  border-color: rgba(138,94,26,0.5);
  color: var(--accent);
}
body.light-theme input[type="range"] { accent-color: var(--accent); }

/* ── Fixed button group (theme toggle, bottom-right) ── */
#fixed-controls {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

/* ── Settings button group (bottom-left) ── */
#settings-controls {
  position: fixed;
  bottom: 32px;
  left: 32px;
  z-index: 200;
}

/* ── Theme toggle button ── */
#theme-toggle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(200,164,106,0.3);
  background: rgba(14,19,32,0.85);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(200,164,106,0.8);
  transition: background 0.4s ease, border-color 0.4s ease, transform 0.2s ease, box-shadow 0.3s ease, color 0.4s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  user-select: none;
}

#theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(0,0,0,0.5);
  border-color: rgba(200,164,106,0.6);
  color: rgba(200,164,106,1);
}

#theme-toggle:active { transform: scale(0.95); }

body.light-theme #theme-toggle {
  background: rgba(230,224,210,0.92);
  border-color: rgba(138,94,26,0.35);
  box-shadow: 0 4px 20px rgba(100,80,40,0.2);
  color: rgba(138,94,26,0.8);
}
body.light-theme #theme-toggle:hover {
  border-color: rgba(138,94,26,0.65);
  box-shadow: 0 6px 28px rgba(100,80,40,0.3);
  color: rgba(138,94,26,1);
}

/* ── Settings toggle button ── */
#settings-toggle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(200,164,106,0.3);
  background: rgba(14,19,32,0.85);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(200,164,106,0.8);
  transition: background 0.4s ease, border-color 0.4s ease, transform 0.2s ease, box-shadow 0.3s ease, color 0.4s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  user-select: none;
}

#settings-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(0,0,0,0.5);
  border-color: rgba(200,164,106,0.6);
  color: rgba(200,164,106,1);
}

#settings-toggle:active { transform: scale(0.95); }
#settings-toggle.active {
  border-color: rgba(200,164,106,0.7);
  color: rgba(200,164,106,1);
  box-shadow: 0 0 20px rgba(200,164,106,0.2);
}

body.light-theme #settings-toggle {
  background: rgba(230,224,210,0.92);
  border-color: rgba(138,94,26,0.35);
  box-shadow: 0 4px 20px rgba(100,80,40,0.2);
  color: rgba(138,94,26,0.8);
}
body.light-theme #settings-toggle:hover {
  border-color: rgba(138,94,26,0.65);
  box-shadow: 0 6px 28px rgba(100,80,40,0.3);
  color: rgba(138,94,26,1);
}
body.light-theme #settings-toggle.active {
  border-color: rgba(138,94,26,0.7);
  color: rgba(138,94,26,1);
}

/* ── Settings panel ── */
#settings-panel {
  position: fixed;
  bottom: 110px;
  left: 32px;
  z-index: 199;
  width: 300px;
  background: rgba(8,12,20,0.96);
  border: 1px solid rgba(200,164,106,0.2);
  border-radius: 8px;
  padding: 20px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  transform: translateY(12px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#settings-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.settings-title {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(200,164,106,0.15);
}

.settings-group {
  margin-bottom: 16px;
}

.settings-label {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
  display: block;
}

.settings-btn-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.settings-btn {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 0.1em;
  padding: 6px 10px;
  border-radius: 3px;
  border: 1px solid rgba(200,164,106,0.2);
  background: rgba(20,25,40,0.8);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.settings-btn:hover {
  background: rgba(200,164,106,0.08);
  border-color: rgba(200,164,106,0.4);
  color: var(--accent);
}

.settings-btn.active {
  background: rgba(200,164,106,0.12);
  border-color: rgba(200,164,106,0.5);
  color: var(--accent);
}

.settings-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
  cursor: pointer;
  height: 3px;
}

.settings-slider-val {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  color: var(--accent);
  min-width: 36px;
  text-align: right;
  letter-spacing: 0.05em;
}

/* ── Animations disabled class ── */
body.no-anim .reveal {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

body.no-anim .chapter-kanji,
body.no-anim .chapter-arc,
body.no-anim .chapter-num,
body.no-anim .chapter-subtitle {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

body.no-anim .scroll-hint { animation: none !important; opacity: 0.5 !important; }
body.no-anim .divider-sigil { animation: none !important; opacity: 0.7 !important; }
body.no-anim .moment-shock.visible { animation: none !important; }
body.no-anim .moment-resolve.visible { animation: none !important; }
body.no-anim .moment-anger.visible { animation: none !important; }
body.no-anim .scroll-chevron { animation: none !important; opacity: 0.5 !important; }

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 19px;
  line-height: 1.85;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Ambient particles ── */
#canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

/* ── Progress bar ── */
#progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--garfiel), var(--accent), var(--reinhard));
  width: 0%;
  z-index: 100;
  transition: width 0.1s linear;
}

/* ── Header ── */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 14px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(8,12,20,0.96);
  border-bottom: 1px solid rgba(200,164,106,0.1);
}

.header-arc {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.header-title {
  font-family: 'Cormorant SC', 'Cinzel', serif;
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--accent);
}

.header-pov {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--text-dim);
  transition: color 0.6s ease;
}

/* ── Chapter title block ── */
.chapter-title-block {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 40px;
}

.chapter-kanji {
  font-family: serif;
  font-size: 48px;
  color: rgba(200,164,106,0.25);
  letter-spacing: 0.4em;
  margin-bottom: 32px;
  animation: fadeSlideIn 2s ease forwards;
}

.chapter-arc {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 0.5em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 20px;
  animation: fadeSlideIn 2s ease 0.3s both;
}

.chapter-num {
  font-family: 'Cormorant SC', 'Cinzel Decorative', serif;
  font-size: clamp(28px, 5vw, 52px);
  color: var(--accent);
  line-height: 1.2;
  margin-bottom: 12px;
  animation: fadeSlideIn 2s ease 0.5s both;
  text-shadow: 0 0 60px rgba(200,164,106,0.3);
}

.chapter-subtitle {
  font-family: 'Cormorant Infant', 'EB Garamond', serif;
  font-style: italic;
  font-size: clamp(20px, 3vw, 32px);
  color: var(--text);
  margin-bottom: 60px;
  animation: fadeSlideIn 2s ease 0.8s both;
}

.scroll-hint {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.4em;
  color: var(--text-dim);
  text-transform: uppercase;
  animation: pulse 2.5s ease-in-out infinite;
}

/* ── Main content ── */
main {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 80px 40px 160px;
  transition: max-width 0.3s ease;
}

/* ── Paragraph reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Narration ── */
p.narr { margin-bottom: 1.3em; color: var(--text); }
p.italic-narr { font-style: italic; color: #c8bcaa; margin-bottom: 1.3em; }
p.thought {
  font-style: italic;
  color: #b0a898;
  padding-left: 20px;
  border-left: 2px solid rgba(200,164,106,0.3);
  margin: 1em 0 1.3em;
}

/* ── Dialogue ── */
.dialogue-block { margin: 0.4em 0 1.1em; position: relative; }
.speaker-tag { display: none; }
.dialogue-text { font-style: normal; color: #e0d8cc; display: block; padding-left: 4px; }
.dialogue-text.emotional { font-style: italic; }

/* Speaker tag colors kept for potential future use, but not applied to dialogue text */
.speaker-tag.sp-ram     { color: var(--ram); }
.speaker-tag.sp-emilia  { color: var(--emilia); }
.speaker-tag.sp-bordeaux{ color: var(--bordeaux); }
.speaker-tag.sp-marcos  { color: var(--marcos); }
.speaker-tag.sp-fiore   { color: var(--fiore); }
.speaker-tag.sp-sakura  { color: var(--sakura); }
.speaker-tag.sp-felt    { color: var(--felt); }
.speaker-tag.sp-reinhard{ color: var(--reinhard); }
.speaker-tag.sp-official{ color: #9aaabb; }
.speaker-tag.sp-garfiel { color: var(--garfiel); }
.speaker-tag.sp-otto    { color: var(--otto); }
.speaker-tag.sp-petra   { color: var(--petra); }
.speaker-tag.sp-rem     { color: var(--rem); }
.speaker-tag.sp-meiili  { color: var(--meiili); }
.speaker-tag.sp-wilhelm { color: var(--wilhelm); }

/* Dialogue text uses default color regardless of speaker */
.dialogue-text.sp-ram,
.dialogue-text.sp-emilia,
.dialogue-text.sp-bordeaux,
.dialogue-text.sp-marcos,
.dialogue-text.sp-fiore,
.dialogue-text.sp-sakura,
.dialogue-text.sp-felt,
.dialogue-text.sp-reinhard,
.dialogue-text.sp-official,
.dialogue-text.sp-garfiel,
.dialogue-text.sp-otto,
.dialogue-text.sp-petra,
.dialogue-text.sp-rem,
.dialogue-text.sp-meiili,
.dialogue-text.sp-wilhelm { color: #e0d8cc; }


/* ── Chapter illustrations ── */
.chapter-illustration {
  margin: 2.4em auto;
  text-align: center;
}

.chapter-illustration img {
  display: block;
  width: min(100%, 720px);
  height: auto;
  margin: 0 auto;
  border-radius: 16px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
}

/* ── Section divider ── */
.section-divider { text-align: center; padding: 50px 0; position: relative; }

.divider-sigil {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  color: var(--accent);
  letter-spacing: 0.3em;
  display: inline-block;
  animation: sigil-pulse 3s ease-in-out infinite;
}

.divider-line {
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: 16px auto;
  width: 60%;
  opacity: 0.4;
}

/* ── Dramatic moments ── */
.moment,
.dragon-eye-reveal,
.return-block {
  --moment-accent: var(--accent);
  --moment-bg: rgba(15, 19, 32, 0.72);
  --moment-border: rgba(200, 164, 106, 0.22);
  position: relative;
  margin: 2.2em auto;
  padding: 24px 28px 24px 32px;
  max-width: 780px;
  border: 1px solid var(--moment-border);
  border-left: 4px solid var(--moment-accent);
  border-radius: 14px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--moment-accent) 14%, transparent), transparent 42%),
    var(--moment-bg);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  text-align: left;
}

.moment::before,
.dragon-eye-reveal::before,
.return-block::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.055), transparent 55%);
  opacity: 1;
  pointer-events: none;
}

.moment::after,
.dragon-eye-reveal::after,
.return-block::after {
  content: '';
  position: absolute;
  top: 18px;
  right: 20px;
  width: 34px;
  height: 2px;
  border-radius: 99px;
  background: var(--moment-accent);
  opacity: 0.45;
}

.moment-label { display: none; }

.moment-text,
.dragon-eye-text,
.return-text {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--text);
  font-family: inherit;
  font-size: 1em;
  line-height: 1.78;
  letter-spacing: 0.01em;
  text-shadow: none;
}

.moment-text + .moment-text,
.moment-text[style*="margin-top"] {
  margin-top: 0.85em !important;
}

.moment-shock { --moment-accent: #7a9cc8; --moment-bg: rgba(12, 22, 38, 0.76); --moment-border: rgba(122,156,200,0.28); }
.moment-anger { --moment-accent: #d06a6a; --moment-bg: rgba(36, 17, 17, 0.74); --moment-border: rgba(208,106,106,0.26); }
.moment-resolve { --moment-accent: #c8a46a; --moment-bg: rgba(32, 27, 17, 0.74); --moment-border: rgba(200,164,106,0.32); }
.moment-heavy { --moment-accent: #8a9ab0; --moment-bg: rgba(14, 17, 28, 0.78); --moment-border: rgba(138,154,176,0.25); }
.moment-warmth { --moment-accent: #e87aaa; --moment-bg: rgba(34, 18, 27, 0.72); --moment-border: rgba(232,122,170,0.25); }
.moment-krusch { --moment-accent: #5aaa7a; --moment-bg: rgba(10, 28, 18, 0.74); --moment-border: rgba(90,170,122,0.27); }
.moment-battle { --moment-accent: #d4a030; --moment-bg: rgba(35, 24, 7, 0.76); --moment-border: rgba(212,160,48,0.30); }

.moment-shock .moment-text,
.moment-anger .moment-text,
.moment-resolve .moment-text,
.moment-heavy .moment-text,
.moment-warmth .moment-text,
.moment-krusch .moment-text,
.moment-battle .moment-text {
  color: var(--text);
  font-style: normal;
}

/* ── Dragon Eye reveal ── */
.dragon-eye-reveal {
  --moment-accent: #d6ad3f;
  --moment-bg: rgba(26, 22, 12, 0.80);
  --moment-border: rgba(214, 173, 63, 0.35);
}

.dragon-eye-glyph {
  display: none;
}

.dragon-eye-text {
  color: #f1dfb2;
  font-style: normal;
}

/* ── Return from death animation ── */
.return-block {
  --moment-accent: #9d77df;
  --moment-bg: rgba(18, 14, 34, 0.82);
  --moment-border: rgba(157, 119, 223, 0.34);
  padding-top: 28px;
}

.return-vortex,
.return-ring {
  display: none;
}

.return-kanji {
  position: relative;
  z-index: 1;
  margin-bottom: 10px;
  color: rgba(205, 184, 244, 0.75);
  font-size: 30px;
  letter-spacing: 0.16em;
  text-shadow: none;
}

.return-label {
  position: relative;
  z-index: 1;
  margin-bottom: 14px;
  color: rgba(205, 184, 244, 0.72);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-shadow: none;
}

.return-text {
  color: var(--text);
}

/* ── Garfiel inner monologue ── */
.inner-fire {
  position: relative;
  margin: 1.8em auto;
  padding: 18px 24px 18px 28px;
  max-width: 760px;
  border-left: 4px solid var(--garfiel, var(--accent));
  border-radius: 0 12px 12px 0;
  background: rgba(212, 160, 64, 0.08);
  color: var(--text);
  font-size: 1em;
  line-height: 1.85;
  font-style: normal;
}

body.light-theme .moment,
body.light-theme .dragon-eye-reveal,
body.light-theme .return-block {
  --moment-bg: rgba(255, 252, 244, 0.78);
  --moment-border: color-mix(in srgb, var(--moment-accent) 38%, rgba(138,94,26,0.22));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--moment-accent) 12%, transparent), transparent 42%),
    var(--moment-bg);
  box-shadow: 0 10px 26px rgba(90, 70, 40, 0.12);
}

body.light-theme .moment-text,
body.light-theme .dragon-eye-text,
body.light-theme .return-text,
body.light-theme .moment-shock .moment-text,
body.light-theme .moment-anger .moment-text,
body.light-theme .moment-resolve .moment-text,
body.light-theme .moment-heavy .moment-text,
body.light-theme .moment-warmth .moment-text,
body.light-theme .moment-krusch .moment-text,
body.light-theme .moment-battle .moment-text {
  color: #1a1610;
}

body.light-theme .dragon-eye-text { color: #3c2b05; }
body.light-theme .return-kanji,
body.light-theme .return-label { color: rgba(76, 43, 132, 0.72); text-shadow: none; }
body.light-theme .inner-fire { color: #2a2010; background: rgba(212, 160, 64, 0.12); border-left-color: var(--accent); }

.moment-shock.visible,
.moment-resolve.visible,
.moment-anger.visible,
.moment-krusch.visible,
.moment-battle.visible,
.dragon-eye-glyph,
.return-kanji {
  animation: none !important;
}


body.plain-moments .moment,
body.plain-moments .dragon-eye-reveal,
body.plain-moments .return-block,
body.plain-moments .inner-fire {
  margin: 1em 0;
  padding: 0;
  max-width: none;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  overflow: visible;
  text-align: inherit;
}

body.plain-moments .moment::before,
body.plain-moments .moment::after,
body.plain-moments .dragon-eye-reveal::before,
body.plain-moments .dragon-eye-reveal::after,
body.plain-moments .return-block::before,
body.plain-moments .return-block::after,
body.plain-moments .dragon-eye-glyph,
body.plain-moments .return-vortex,
body.plain-moments .return-ring,
body.plain-moments .return-kanji,
body.plain-moments .return-label {
  display: none !important;
}

body.plain-moments .moment-text,
body.plain-moments .dragon-eye-text,
body.plain-moments .return-text {
  color: inherit;
  font: inherit;
  line-height: inherit;
  letter-spacing: inherit;
}

/* ── POV section headers ── */
.pov-header { display: none; }
.pov-name {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.pov-subtitle {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 15px;
  color: rgba(200,164,106,0.5);
}

/* ── Scene label ── */
.scene-label {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: center;
  padding: 24px 0 8px;
  opacity: 0.6;
}

/* ── Navigation buttons ── */
.nav-buttons {
  position: relative;
  z-index: 10;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 60px 40px 100px;
  max-width: 760px;
  margin: 0 auto;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  padding: 14px 28px;
  border: 1px solid rgba(200,164,106,0.25);
  border-radius: 3px;
  background: rgba(8,12,20,0.7);
  transition: all 0.35s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.nav-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(200,164,106,0.06), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.nav-btn:hover::before { transform: translateX(100%); }

.nav-btn:hover {
  color: var(--accent);
  border-color: rgba(200,164,106,0.55);
  box-shadow: 0 0 20px rgba(200,164,106,0.1);
  transform: translateY(-1px);
}

.nav-btn-prev { border-color: rgba(90,170,122,0.25); }
.nav-btn-prev:hover { color: #5aaa7a; border-color: rgba(90,170,122,0.5); box-shadow: 0 0 20px rgba(90,170,122,0.1); }

.nav-btn-toc { border-color: rgba(200,164,106,0.25); }
.nav-btn-toc:hover { color: var(--accent); border-color: rgba(200,164,106,0.5); }

.nav-btn-next { border-color: rgba(170,100,220,0.25); }
.nav-btn-next:hover { color: #aa64dc; border-color: rgba(170,100,220,0.5); box-shadow: 0 0 20px rgba(170,100,220,0.1); }

.nav-icon { font-size: 14px; opacity: 0.7; }

/* ── Animations ── */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes sigil-pulse {
  0%, 100% { opacity: 0.4; letter-spacing: 0.3em; }
  50% { opacity: 0.9; letter-spacing: 0.45em; }
}

@keyframes shock-flare {
  0% { box-shadow: inset 0 0 40px rgba(80,120,200,0.05), 0 0 30px rgba(80,120,200,0.08); }
  50% { box-shadow: inset 0 0 80px rgba(80,120,200,0.15), 0 0 60px rgba(80,120,200,0.2); }
  100% { box-shadow: inset 0 0 40px rgba(80,120,200,0.05), 0 0 30px rgba(80,120,200,0.08); }
}
.moment-shock.visible { animation: shock-flare 4s ease-in-out infinite; }

@keyframes resolve-glow {
  0%, 100% { box-shadow: inset 0 0 50px rgba(200,164,106,0.06), 0 0 40px rgba(200,164,106,0.12); }
  50% { box-shadow: inset 0 0 80px rgba(200,164,106,0.12), 0 0 70px rgba(200,164,106,0.22); }
}
.moment-resolve.visible { animation: resolve-glow 3.5s ease-in-out infinite; }

@keyframes anger-pulse {
  0%, 100% { box-shadow: inset 0 0 40px rgba(200,60,60,0.05), 0 0 30px rgba(200,60,60,0.08); }
  50% { box-shadow: inset 0 0 60px rgba(200,60,60,0.12), 0 0 50px rgba(200,60,60,0.15); }
}
.moment-anger.visible { animation: anger-pulse 2.5s ease-in-out infinite; }

@keyframes battle-glow {
  0%, 100% { box-shadow: inset 0 0 50px rgba(212,160,48,0.07), 0 0 35px rgba(212,160,48,0.12); }
  50% { box-shadow: inset 0 0 80px rgba(212,160,48,0.16), 0 0 60px rgba(212,160,48,0.22); }
}
.moment-battle.visible { animation: battle-glow 3s ease-in-out infinite; }

/* ── Scroll indicator ── */
.scroll-down {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.scroll-chevron {
  width: 16px;
  height: 16px;
  border-right: 1px solid rgba(200,164,106,0.5);
  border-bottom: 1px solid rgba(200,164,106,0.5);
  transform: rotate(45deg);
  animation: bounce 1.5s ease-in-out infinite;
}
@keyframes bounce {
  0%,100% { transform: rotate(45deg) translateY(0); opacity: 0.4; }
  50% { transform: rotate(45deg) translateY(6px); opacity: 0.9; }
}

/* ── Witch cult name ── */
.cult-mention {
  color: var(--witch);
  font-style: normal;
  text-shadow: 0 0 8px rgba(144,64,160,0.3);
}

/* ── Footnote-style location ── */
.location-tag {
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.4em;
  color: rgba(200,164,106,0.35);
  padding: 8px 0 30px;
  text-transform: uppercase;
}

/* ── Dragon Sword highlight ── */
.dragon-sword {
  color: #4a8fd4;
  font-style: italic;
  text-shadow: 0 0 10px rgba(74,143,212,0.3);
}
body.light-theme .dragon-sword {
  color: #1a5fa0;
  text-shadow: 0 0 8px rgba(26,95,160,0.2);
}

/* Responsive */
@media (max-width: 600px) {
  main { padding: 60px 20px 100px; }
  header { padding: 12px 20px; }
  .header-arc { display: none; }
  body { font-size: 17px; }
  .nav-buttons { padding: 40px 20px 80px; gap: 12px; }
  .nav-btn { padding: 12px 18px; font-size: 10px; }
  .chapter-kanji { font-size: 28px; letter-spacing: 0.25em; margin-bottom: 20px; }
  .moment,
  .dragon-eye-reveal,
  .return-block {
    margin: 1.7em 0;
    padding: 20px 20px 20px 24px;
    border-radius: 12px;
  }
  .moment-text,
  .dragon-eye-text,
  .return-text,
  .inner-fire {
    line-height: 1.72;
  }
  #settings-panel { width: calc(100vw - 32px); left: 16px; }
  #fixed-controls { right: 16px; bottom: 20px; }
  #settings-controls { left: 16px; bottom: 20px; }
}

/* ===== 10-20.html ===== */
:root {
  --bg: #080c14;
  --bg2: #0e1320;
  --bg3: #13192e;
  --text: #ddd4c0;
  --text-dim: #8a8070;
  --accent: #c8a46a;
  --accent2: #7a9cc8;
  --divider: #2a3050;
  --ram: #e87aaa;
  --emilia: #aac8ec;
  --bordeaux: #d04040;
  --marcos: #8a9ab0;
  --fiore: #f0c060;
  --sakura: #c08ad0;
  --felt: #e8a050;
  --reinhard: #5090d8;
  --witch: #9040a0;
  --narrator: #ddd4c0;
  --krusch: #5aaa7a;
  --tiga: #d4a060;
  --beatrice: #b08adc;
  --subaru: #90b8e0;
}

/* ── Light theme overrides ── */
body.light-theme {
  --bg: #f0ebe0;
  --bg2: #e8e2d4;
  --bg3: #ddd7c8;
  --text: #1a1610;
  --text-dim: #6a5e4a;
  --accent: #8a5e1a;
  --accent2: #2a5888;
  --divider: #c8bca0;
}

body.light-theme header {
  background: rgba(240,235,224,0.97);
  border-bottom-color: rgba(138,94,26,0.15);
}

body.light-theme p.italic-narr {
  color: #3a3020;
}

body.light-theme p.thought {
  color: #4a3e2a;
  border-left-color: rgba(138,94,26,0.4);
}

body.light-theme .inner-fire {
  color: #5a3a10;
  border-left-color: var(--accent);
}

body.light-theme .moment-resolve {
  background: rgba(240,235,220,0.7);
  border-color: rgba(138,94,26,0.35);
}
body.light-theme .moment-resolve .moment-text { color: #2a1e08; }

body.light-theme .moment-shock {
  background: rgba(220,230,245,0.6);
  border-color: rgba(60,100,180,0.3);
}
body.light-theme .moment-shock .moment-text { color: #1a2a3a; }

body.light-theme .moment-anger {
  background: rgba(245,225,220,0.6);
  border-color: rgba(180,60,60,0.3);
}
body.light-theme .moment-anger .moment-text { color: #2a0808; }

body.light-theme .moment-heavy {
  background: rgba(220,225,235,0.6);
  border-color: rgba(80,90,120,0.3);
}
body.light-theme .moment-heavy .moment-text { color: #1a1e2a; }

body.light-theme .moment-warmth {
  background: rgba(245,235,240,0.6);
  border-color: rgba(200,100,140,0.3);
}
body.light-theme .moment-warmth .moment-text { color: #2a1020; }

body.light-theme .moment-krusch {
  background: rgba(220,240,230,0.6);
  border-color: rgba(60,140,90,0.3);
}
body.light-theme .moment-krusch .moment-text { color: #0a2a18; }

body.light-theme .dragon-eye-reveal {
  background: rgba(245,240,220,0.9);
  border-color: rgba(160,120,20,0.4);
}

body.light-theme .dragon-eye-text {
  color: #7a5000;
  text-shadow: 0 0 8px rgba(160,100,0,0.2);
}

body.light-theme .return-block {
  background: rgba(230,225,245,0.85);
  border-color: rgba(100,60,180,0.3);
}

body.light-theme .return-kanji {
  color: rgba(100,60,180,0.85);
  text-shadow: 0 0 20px rgba(100,60,180,0.4);
}

body.light-theme .return-label {
  color: rgba(100,60,180,0.6);
}

body.light-theme .return-text {
  color: #2a1a4a;
}

body.light-theme .nav-btn {
  background: rgba(230,224,210,0.8);
  border-color: rgba(138,94,26,0.25);
  color: var(--text-dim);
}

body.light-theme .nav-btn:hover {
  background: rgba(215,208,192,0.95);
}

body.light-theme .chapter-kanji {
  color: rgba(138,94,26,0.65);
}

body.light-theme .location-tag {
  color: rgba(138,94,26,0.7);
}

body.light-theme .scroll-hint,
body.light-theme .chapter-arc {
  color: #8a7a60;
}

body.light-theme .chapter-subtitle {
  color: #2a2010;
}

body.light-theme .scroll-chevron {
  border-right-color: rgba(100,70,20,0.5);
  border-bottom-color: rgba(100,70,20,0.5);
}

body.light-theme .divider-line {
  background: linear-gradient(90deg, transparent, rgba(138,94,26,0.5), transparent);
}

body.light-theme .divider-sigil {
  color: rgba(138,94,26,0.8);
}

body.light-theme #canvas {
  opacity: 0.12;
}

/* Dialogue text — override the hardcoded !important */
body.light-theme .dialogue-text {
  color: #1a1610 !important;
}

/* Narration colours */
body.light-theme p.narr {
  color: #1a1610;
}

body.light-theme p.italic-narr {
  color: #3a3020;
}

body.light-theme p.thought {
  color: #4a3e2a;
  border-left-color: rgba(138,94,26,0.4);
}

/* Scene / pov labels */
body.light-theme .scene-label,
body.light-theme .pov-name {
  color: #8a7a60;
}

body.light-theme .pov-subtitle {
  color: rgba(138,94,26,0.55);
}

/* Dragon & cult inline mentions */
body.light-theme .dragon-mention {
  color: #8a5a00;
  text-shadow: 0 0 6px rgba(138,90,0,0.2);
}

body.light-theme .cult-mention {
  color: #6a3080;
  text-shadow: 0 0 6px rgba(106,48,128,0.2);
}

/* ── Settings panel light ── */
body.light-theme #settings-panel {
  background: rgba(240,235,224,0.97);
  border-color: rgba(138,94,26,0.25);
}
body.light-theme .settings-title {
  color: var(--accent);
  border-bottom-color: rgba(138,94,26,0.2);
}
body.light-theme .settings-label { color: var(--text-dim); }
body.light-theme .settings-btn {
  background: rgba(220,214,200,0.8);
  border-color: rgba(138,94,26,0.2);
  color: var(--text);
}
body.light-theme .settings-btn:hover,
body.light-theme .settings-btn.active {
  background: rgba(138,94,26,0.15);
  border-color: rgba(138,94,26,0.5);
  color: var(--accent);
}
body.light-theme input[type="range"] { accent-color: var(--accent); }

/* ── Settings button group (bottom-left) ── */
#settings-controls {
  position: fixed;
  bottom: 32px;
  left: 32px;
  z-index: 200;
}

/* ── Settings toggle button ── */
#settings-toggle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(200,164,106,0.3);
  background: rgba(14,19,32,0.85);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(200,164,106,0.8);
  transition: background 0.4s ease, border-color 0.4s ease, transform 0.2s ease, box-shadow 0.3s ease, color 0.4s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  user-select: none;
}

#settings-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(0,0,0,0.5);
  border-color: rgba(200,164,106,0.6);
  color: rgba(200,164,106,1);
}

#settings-toggle:active { transform: scale(0.95); }
#settings-toggle.active {
  border-color: rgba(200,164,106,0.7);
  color: rgba(200,164,106,1);
  box-shadow: 0 0 20px rgba(200,164,106,0.2);
}

body.light-theme #settings-toggle {
  background: rgba(230,224,210,0.92);
  border-color: rgba(138,94,26,0.35);
  box-shadow: 0 4px 20px rgba(100,80,40,0.2);
  color: rgba(138,94,26,0.8);
}
body.light-theme #settings-toggle:hover {
  border-color: rgba(138,94,26,0.65);
  box-shadow: 0 6px 28px rgba(100,80,40,0.3);
  color: rgba(138,94,26,1);
}
body.light-theme #settings-toggle.active {
  border-color: rgba(138,94,26,0.7);
  color: rgba(138,94,26,1);
}

/* ── Settings panel ── */
#settings-panel {
  position: fixed;
  bottom: 110px;
  left: 32px;
  z-index: 199;
  width: 300px;
  background: rgba(8,12,20,0.96);
  border: 1px solid rgba(200,164,106,0.2);
  border-radius: 8px;
  padding: 20px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  transform: translateY(12px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#settings-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.settings-title {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(200,164,106,0.15);
}

.settings-group {
  margin-bottom: 16px;
}

.settings-label {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
  display: block;
}

.settings-btn-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.settings-btn {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 0.1em;
  padding: 6px 10px;
  border-radius: 3px;
  border: 1px solid rgba(200,164,106,0.2);
  background: rgba(20,25,40,0.8);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.settings-btn:hover {
  background: rgba(200,164,106,0.08);
  border-color: rgba(200,164,106,0.4);
  color: var(--accent);
}

.settings-btn.active {
  background: rgba(200,164,106,0.12);
  border-color: rgba(200,164,106,0.5);
  color: var(--accent);
}

.settings-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
  cursor: pointer;
  height: 3px;
}

.settings-slider-val {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  color: var(--accent);
  min-width: 36px;
  text-align: right;
  letter-spacing: 0.05em;
}

/* ── Animations disabled class ── */
body.no-anim .reveal {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

body.no-anim .chapter-kanji,
body.no-anim .chapter-arc,
body.no-anim .chapter-num,
body.no-anim .chapter-subtitle {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

body.no-anim .scroll-hint { animation: none !important; opacity: 0.5 !important; }
body.no-anim .divider-sigil { animation: none !important; opacity: 0.7 !important; }
body.no-anim .moment-shock.visible { animation: none !important; }
body.no-anim .moment-resolve.visible { animation: none !important; }
body.no-anim .moment-anger.visible { animation: none !important; }
body.no-anim .scroll-chevron { animation: none !important; opacity: 0.5 !important; }

/* ── Theme toggle button ── */
#theme-toggle {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 200;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(200,164,106,0.3);
  background: rgba(14,19,32,0.85);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(200,164,106,0.8);
  transition: background 0.4s ease, border-color 0.4s ease, transform 0.2s ease, box-shadow 0.3s ease, color 0.4s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  user-select: none;
}

#theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(0,0,0,0.5);
  border-color: rgba(200,164,106,0.6);
  color: rgba(200,164,106,1);
}

#theme-toggle:active {
  transform: scale(0.95);
}

body.light-theme #theme-toggle {
  background: rgba(230,224,210,0.92);
  border-color: rgba(138,94,26,0.35);
  box-shadow: 0 4px 20px rgba(100,80,40,0.2);
  color: rgba(138,94,26,0.8);
}

body.light-theme #theme-toggle:hover {
  border-color: rgba(138,94,26,0.65);
  box-shadow: 0 6px 28px rgba(100,80,40,0.3);
  color: rgba(138,94,26,1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 19px;
  line-height: 1.85;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Ambient particles ── */
#canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

/* ── Progress bar ── */
#progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--krusch), var(--accent), var(--beatrice));
  width: 0%;
  z-index: 100;
  transition: width 0.1s linear;
}

/* ── Header ── */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 14px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(8,12,20,0.96);
  border-bottom: 1px solid rgba(200,164,106,0.1);
}

.header-arc {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.header-title {
  font-family: 'Cormorant SC', 'Cinzel', serif;
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--accent);
}

.header-pov {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--text-dim);
  transition: color 0.6s ease;
}

/* ── Chapter title block ── */
.chapter-title-block {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 40px;
}

.chapter-kanji {
  font-family: serif;
  font-size: 48px;
  color: rgba(200,164,106,0.25);
  letter-spacing: 0.4em;
  margin-bottom: 32px;
  animation: fadeSlideIn 2s ease forwards;
}

.chapter-arc {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 0.5em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 20px;
  animation: fadeSlideIn 2s ease 0.3s both;
}

.chapter-num {
  font-family: 'Cormorant SC', 'Cinzel Decorative', serif;
  font-size: clamp(28px, 5vw, 52px);
  color: var(--accent);
  line-height: 1.2;
  margin-bottom: 12px;
  animation: fadeSlideIn 2s ease 0.5s both;
  text-shadow: 0 0 60px rgba(200,164,106,0.3);
}

.chapter-subtitle {
  font-family: 'Cormorant Infant', 'EB Garamond', serif;
  font-style: italic;
  font-size: clamp(20px, 3vw, 32px);
  color: var(--text);
  margin-bottom: 60px;
  animation: fadeSlideIn 2s ease 0.8s both;
}

.scroll-hint {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.4em;
  color: var(--text-dim);
  text-transform: uppercase;
  animation: pulse 2.5s ease-in-out infinite;
}

/* ── Main content ── */
main {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 80px 40px 160px;
}

/* ── Paragraph reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Narration ── */
p.narr {
  margin-bottom: 1.3em;
  color: var(--text);
}

p.italic-narr {
  font-style: italic;
  color: #c8bcaa;
  margin-bottom: 1.3em;
}

p.thought {
  font-style: italic;
  color: #b0a898;
  padding-left: 20px;
  border-left: 2px solid rgba(200,164,106,0.3);
  margin: 1em 0 1.3em;
}

/* ── Dialogue ── */
.dialogue-block {
  margin: 0.4em 0 1.1em;
  position: relative;
}

.speaker-tag {
  display: none;
}

.dialogue-text {
  font-style: normal;
  color: #e0d8cc;
  display: block;
  padding-left: 4px;
}

.dialogue-text.emotional {
  font-style: italic;
}

.sp-ram { color: var(--ram); }
.sp-emilia { color: var(--emilia); }
.sp-bordeaux { color: var(--bordeaux); }
.sp-marcos { color: var(--marcos); }
.sp-fiore { color: var(--fiore); }
.sp-sakura { color: var(--sakura); }
.sp-felt { color: var(--felt); }
.sp-reinhard { color: var(--reinhard); }
.sp-official { color: #9aaabb; }
.sp-krusch { color: var(--krusch); }
.sp-tiga { color: var(--tiga); }
.sp-beatrice { color: var(--beatrice); }
.sp-subaru { color: var(--subaru); }
.sp-otto { color: #8cc878; }
.sp-garfiel { color: #d8b060; }
.sp-rem { color: #8ac8e8; }
.sp-petra { color: #e8b0c8; }
.sp-meili { color: #c8a0e8; }

/* ── Chapter illustrations ── */
.chapter-illustration {
  margin: 2.4em auto;
  text-align: center;
}

.chapter-illustration img {
  display: block;
  width: min(100%, 720px);
  height: auto;
  margin: 0 auto;
  border-radius: 16px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
}

/* ── Character colors stripped: dialogue colour-neutral ── */
.dialogue-text { color: #e0d8cc !important; }
/* ── Section divider ── */
.section-divider {
  text-align: center;
  padding: 50px 0;
  position: relative;
}

.divider-sigil {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  color: var(--accent);
  letter-spacing: 0.3em;
  display: inline-block;
  animation: sigil-pulse 3s ease-in-out infinite;
}

.divider-line {
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: 16px auto;
  width: 60%;
  opacity: 0.4;
}

/* ── Dramatic moments ── */
.moment,
.dragon-eye-reveal,
.return-block {
  --moment-accent: var(--accent);
  --moment-bg: rgba(15, 19, 32, 0.72);
  --moment-border: rgba(200, 164, 106, 0.22);
  position: relative;
  margin: 2.2em auto;
  padding: 24px 28px 24px 32px;
  max-width: 780px;
  border: 1px solid var(--moment-border);
  border-left: 4px solid var(--moment-accent);
  border-radius: 14px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--moment-accent) 14%, transparent), transparent 42%),
    var(--moment-bg);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  text-align: left;
}

.moment::before,
.dragon-eye-reveal::before,
.return-block::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.055), transparent 55%);
  opacity: 1;
  pointer-events: none;
}

.moment::after,
.dragon-eye-reveal::after,
.return-block::after {
  content: '';
  position: absolute;
  top: 18px;
  right: 20px;
  width: 34px;
  height: 2px;
  border-radius: 99px;
  background: var(--moment-accent);
  opacity: 0.45;
}

.moment-label { display: none; }

.moment-text,
.dragon-eye-text,
.return-text {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--text);
  font-family: inherit;
  font-size: 1em;
  line-height: 1.78;
  letter-spacing: 0.01em;
  text-shadow: none;
}

.moment-text + .moment-text,
.moment-text[style*="margin-top"] {
  margin-top: 0.85em !important;
}

.moment-shock { --moment-accent: #7a9cc8; --moment-bg: rgba(12, 22, 38, 0.76); --moment-border: rgba(122,156,200,0.28); }
.moment-anger { --moment-accent: #d06a6a; --moment-bg: rgba(36, 17, 17, 0.74); --moment-border: rgba(208,106,106,0.26); }
.moment-resolve { --moment-accent: #c8a46a; --moment-bg: rgba(32, 27, 17, 0.74); --moment-border: rgba(200,164,106,0.32); }
.moment-heavy { --moment-accent: #8a9ab0; --moment-bg: rgba(14, 17, 28, 0.78); --moment-border: rgba(138,154,176,0.25); }
.moment-warmth { --moment-accent: #e87aaa; --moment-bg: rgba(34, 18, 27, 0.72); --moment-border: rgba(232,122,170,0.25); }
.moment-krusch { --moment-accent: #5aaa7a; --moment-bg: rgba(10, 28, 18, 0.74); --moment-border: rgba(90,170,122,0.27); }
.moment-battle { --moment-accent: #d4a030; --moment-bg: rgba(35, 24, 7, 0.76); --moment-border: rgba(212,160,48,0.30); }

.moment-shock .moment-text,
.moment-anger .moment-text,
.moment-resolve .moment-text,
.moment-heavy .moment-text,
.moment-warmth .moment-text,
.moment-krusch .moment-text,
.moment-battle .moment-text {
  color: var(--text);
  font-style: normal;
}

/* ── Dragon Eye reveal ── */
.dragon-eye-reveal {
  --moment-accent: #d6ad3f;
  --moment-bg: rgba(26, 22, 12, 0.80);
  --moment-border: rgba(214, 173, 63, 0.35);
}

.dragon-eye-glyph {
  display: none;
}

.dragon-eye-text {
  color: #f1dfb2;
  font-style: normal;
}

/* ── Return from death animation ── */
.return-block {
  --moment-accent: #9d77df;
  --moment-bg: rgba(18, 14, 34, 0.82);
  --moment-border: rgba(157, 119, 223, 0.34);
  padding-top: 28px;
}

.return-vortex,
.return-ring {
  display: none;
}

.return-kanji {
  position: relative;
  z-index: 1;
  margin-bottom: 10px;
  color: rgba(205, 184, 244, 0.75);
  font-size: 30px;
  letter-spacing: 0.16em;
  text-shadow: none;
}

.return-label {
  position: relative;
  z-index: 1;
  margin-bottom: 14px;
  color: rgba(205, 184, 244, 0.72);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-shadow: none;
}

.return-text {
  color: var(--text);
}

/* ── Garfiel inner monologue ── */
.inner-fire {
  position: relative;
  margin: 1.8em auto;
  padding: 18px 24px 18px 28px;
  max-width: 760px;
  border-left: 4px solid var(--garfiel, var(--accent));
  border-radius: 0 12px 12px 0;
  background: rgba(212, 160, 64, 0.08);
  color: var(--text);
  font-size: 1em;
  line-height: 1.85;
  font-style: normal;
}

body.light-theme .moment,
body.light-theme .dragon-eye-reveal,
body.light-theme .return-block {
  --moment-bg: rgba(255, 252, 244, 0.78);
  --moment-border: color-mix(in srgb, var(--moment-accent) 38%, rgba(138,94,26,0.22));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--moment-accent) 12%, transparent), transparent 42%),
    var(--moment-bg);
  box-shadow: 0 10px 26px rgba(90, 70, 40, 0.12);
}

body.light-theme .moment-text,
body.light-theme .dragon-eye-text,
body.light-theme .return-text,
body.light-theme .moment-shock .moment-text,
body.light-theme .moment-anger .moment-text,
body.light-theme .moment-resolve .moment-text,
body.light-theme .moment-heavy .moment-text,
body.light-theme .moment-warmth .moment-text,
body.light-theme .moment-krusch .moment-text,
body.light-theme .moment-battle .moment-text {
  color: #1a1610;
}

body.light-theme .dragon-eye-text { color: #3c2b05; }
body.light-theme .return-kanji,
body.light-theme .return-label { color: rgba(76, 43, 132, 0.72); text-shadow: none; }
body.light-theme .inner-fire { color: #2a2010; background: rgba(212, 160, 64, 0.12); border-left-color: var(--accent); }

.moment-shock.visible,
.moment-resolve.visible,
.moment-anger.visible,
.moment-krusch.visible,
.moment-battle.visible,
.dragon-eye-glyph,
.return-kanji {
  animation: none !important;
}


body.plain-moments .moment,
body.plain-moments .dragon-eye-reveal,
body.plain-moments .return-block,
body.plain-moments .inner-fire {
  margin: 1em 0;
  padding: 0;
  max-width: none;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  overflow: visible;
  text-align: inherit;
}

body.plain-moments .moment::before,
body.plain-moments .moment::after,
body.plain-moments .dragon-eye-reveal::before,
body.plain-moments .dragon-eye-reveal::after,
body.plain-moments .return-block::before,
body.plain-moments .return-block::after,
body.plain-moments .dragon-eye-glyph,
body.plain-moments .return-vortex,
body.plain-moments .return-ring,
body.plain-moments .return-kanji,
body.plain-moments .return-label {
  display: none !important;
}

body.plain-moments .moment-text,
body.plain-moments .dragon-eye-text,
body.plain-moments .return-text {
  color: inherit;
  font: inherit;
  line-height: inherit;
  letter-spacing: inherit;
}

/* ── POV section headers ── */
.pov-header {
  display: none;
}
.pov-name {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.pov-subtitle {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 15px;
  color: rgba(200,164,106,0.5);
}

/* ── Scene label ── */
.scene-label {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: center;
  padding: 24px 0 8px;
  opacity: 0.6;
}

/* ── Navigation buttons ── */
.nav-buttons {
  position: relative;
  z-index: 10;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 60px 40px 100px;
  max-width: 760px;
  margin: 0 auto;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  padding: 14px 28px;
  border: 1px solid rgba(200,164,106,0.25);
  border-radius: 3px;
  background: rgba(8,12,20,0.7);
  transition: all 0.35s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.nav-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(200,164,106,0.06), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.nav-btn:hover::before {
  transform: translateX(100%);
}

.nav-btn:hover {
  color: var(--accent);
  border-color: rgba(200,164,106,0.55);
  box-shadow: 0 0 20px rgba(200,164,106,0.1);
  transform: translateY(-1px);
}

.nav-btn-prev { border-color: rgba(90,170,122,0.25); }
.nav-btn-prev:hover { color: var(--krusch); border-color: rgba(90,170,122,0.5); box-shadow: 0 0 20px rgba(90,170,122,0.1); }

.nav-btn-toc { border-color: rgba(200,164,106,0.25); }
.nav-btn-toc:hover { color: var(--accent); border-color: rgba(200,164,106,0.5); }

.nav-btn-next { border-color: rgba(170,100,220,0.25); }
.nav-btn-next:hover { color: var(--beatrice); border-color: rgba(170,100,220,0.5); box-shadow: 0 0 20px rgba(170,100,220,0.1); }

.nav-icon {
  font-size: 14px;
  opacity: 0.7;
}

/* ── Animations ── */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes sigil-pulse {
  0%, 100% { opacity: 0.4; letter-spacing: 0.3em; }
  50% { opacity: 0.9; letter-spacing: 0.45em; }
}

@keyframes shock-flare {
  0% { box-shadow: inset 0 0 40px rgba(80,120,200,0.05), 0 0 30px rgba(80,120,200,0.08); }
  50% { box-shadow: inset 0 0 80px rgba(80,120,200,0.15), 0 0 60px rgba(80,120,200,0.2); }
  100% { box-shadow: inset 0 0 40px rgba(80,120,200,0.05), 0 0 30px rgba(80,120,200,0.08); }
}

.moment-shock.visible { animation: shock-flare 4s ease-in-out infinite; }

@keyframes resolve-glow {
  0%, 100% { box-shadow: inset 0 0 50px rgba(200,164,106,0.06), 0 0 40px rgba(200,164,106,0.12); }
  50% { box-shadow: inset 0 0 80px rgba(200,164,106,0.12), 0 0 70px rgba(200,164,106,0.22); }
}
.moment-resolve.visible { animation: resolve-glow 3.5s ease-in-out infinite; }

@keyframes anger-pulse {
  0%, 100% { box-shadow: inset 0 0 40px rgba(200,60,60,0.05), 0 0 30px rgba(200,60,60,0.08); }
  50% { box-shadow: inset 0 0 60px rgba(200,60,60,0.12), 0 0 50px rgba(200,60,60,0.15); }
}
.moment-anger.visible { animation: anger-pulse 2.5s ease-in-out infinite; }

@keyframes krusch-glow {
  0%, 100% { box-shadow: inset 0 0 40px rgba(90,170,122,0.05), 0 0 30px rgba(90,170,122,0.08); }
  50% { box-shadow: inset 0 0 70px rgba(90,170,122,0.12), 0 0 50px rgba(90,170,122,0.15); }
}
.moment-krusch.visible { animation: krusch-glow 3s ease-in-out infinite; }

@keyframes eye-pulse {
  0%, 100% { filter: drop-shadow(0 0 14px rgba(255,200,40,0.6)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 30px rgba(255,220,60,0.95)) drop-shadow(0 0 50px rgba(200,140,0,0.5)); transform: scale(1.06); }
}

@keyframes return-glow {
  0%, 100% { text-shadow: 0 0 30px rgba(160,80,220,0.7), 0 0 60px rgba(80,40,140,0.4); }
  50% { text-shadow: 0 0 50px rgba(180,100,255,1), 0 0 90px rgba(100,50,180,0.7), 0 0 4px #fff; }
}

@keyframes ring-expand {
  0%   { width: 60px; height: 60px; opacity: 0.8; border-color: rgba(160,80,220,0.7); }
  100% { width: 320px; height: 320px; opacity: 0; border-color: rgba(80,20,140,0); }
}

/* ── Scroll indicator ── */
.scroll-down {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.scroll-chevron {
  width: 16px;
  height: 16px;
  border-right: 1px solid rgba(200,164,106,0.5);
  border-bottom: 1px solid rgba(200,164,106,0.5);
  transform: rotate(45deg);
  animation: bounce 1.5s ease-in-out infinite;
}
@keyframes bounce {
  0%,100% { transform: rotate(45deg) translateY(0); opacity: 0.4; }
  50% { transform: rotate(45deg) translateY(6px); opacity: 0.9; }
}

/* ── Witch cult / Dragon ── */
.cult-mention {
  color: var(--witch);
  font-style: normal;
  text-shadow: 0 0 8px rgba(144,64,160,0.3);
}

.dragon-mention {
  color: #d4a020;
  text-shadow: 0 0 8px rgba(200,150,0,0.3);
}

/* ── Footnote-style location ── */
.location-tag {
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.4em;
  color: rgba(200,164,106,0.35);
  padding: 8px 0 30px;
  text-transform: uppercase;
}

/* Responsive */
@media (max-width: 600px) {
  main { padding: 60px 20px 100px; }
  header { padding: 12px 20px; }
  .header-arc { display: none; }
  body { font-size: 17px; }
  .nav-buttons { padding: 40px 20px 80px; gap: 12px; }
  .nav-btn { padding: 12px 18px; font-size: 10px; }
  .chapter-kanji { font-size: 28px; letter-spacing: 0.25em; margin-bottom: 20px; }
  .moment,
  .dragon-eye-reveal,
  .return-block {
    margin: 1.7em 0;
    padding: 20px 20px 20px 24px;
    border-radius: 12px;
  }
  .moment-text,
  .dragon-eye-text,
  .return-text,
  .inner-fire {
    line-height: 1.72;
  }
}

.jp-minute{margin:28px 0;padding:14px 16px;border-left:3px solid var(--accent2);background:rgba(120,140,180,.08);border-radius:8px;}
.jp-minute-toggle{all:unset;cursor:pointer;display:flex;justify-content:space-between;gap:12px;width:100%;font-family:"Nunito",sans-serif;font-weight:600;color:var(--accent2);}
.jp-minute-content{margin-top:10px;overflow:hidden;max-height:0;opacity:0;transition:max-height .38s ease,opacity .28s ease;}
.jp-minute.open .jp-minute-content{opacity:1;}
.jp-minute-arrow{transition:transform .22s ease;}
.jp-minute.open .jp-minute-arrow{transform:rotate(180deg);}

.battle-beat{position:relative;padding-left:14px;border-left:2px solid rgba(210,90,70,.35);}
.battle-beat::before{content:"";position:absolute;left:-5px;top:0.8em;width:7px;height:7px;border-radius:50%;background:rgba(240,120,90,.55);box-shadow:0 0 12px rgba(240,120,90,.35);}
.battle-beat .moment-text{letter-spacing:.01em;}
.battle-spark{background:linear-gradient(90deg,rgba(210,90,70,.12),transparent 70%);border-radius:6px;padding:2px 6px;animation:sparkPulse 2.8s ease-in-out infinite;}
@keyframes sparkPulse{0%,100%{box-shadow:none;}50%{box-shadow:0 0 10px rgba(210,90,70,.22);}}
body.no-anim .battle-spark{animation:none;}

/* ===== 10-21.html ===== */
:root {
  --bg: #080c14;
  --bg2: #0e1320;
  --bg3: #13192e;
  --text: #ddd4c0;
  --text-dim: #8a8070;
  --accent: #c8a46a;
  --accent2: #7a9cc8;
  --divider: #2a3050;
  --ram: #e87aaa;
  --emilia: #aac8ec;
  --bordeaux: #d04040;
  --marcos: #8a9ab0;
  --fiore: #f0c060;
  --sakura: #c08ad0;
  --felt: #e8a050;
  --reinhard: #5090d8;
  --witch: #9040a0;
  --narrator: #ddd4c0;
  --krusch: #5aaa7a;
  --tiga: #d4a060;
  --beatrice: #b08adc;
  --subaru: #90b8e0;
}

/* ── Light theme overrides ── */
body.light-theme {
  --bg: #f0ebe0;
  --bg2: #e8e2d4;
  --bg3: #ddd7c8;
  --text: #1a1610;
  --text-dim: #6a5e4a;
  --accent: #8a5e1a;
  --accent2: #2a5888;
  --divider: #c8bca0;
}

body.light-theme header {
  background: rgba(240,235,224,0.97);
  border-bottom-color: rgba(138,94,26,0.15);
}

body.light-theme p.italic-narr {
  color: #3a3020;
}

body.light-theme p.thought {
  color: #4a3e2a;
  border-left-color: rgba(138,94,26,0.4);
}

body.light-theme .inner-fire {
  color: #5a3a10;
  border-left-color: var(--accent);
}

body.light-theme .moment-resolve {
  background: rgba(240,235,220,0.7);
  border-color: rgba(138,94,26,0.35);
}
body.light-theme .moment-resolve .moment-text { color: #2a1e08; }

body.light-theme .moment-shock {
  background: rgba(220,230,245,0.6);
  border-color: rgba(60,100,180,0.3);
}
body.light-theme .moment-shock .moment-text { color: #1a2a3a; }

body.light-theme .moment-anger {
  background: rgba(245,225,220,0.6);
  border-color: rgba(180,60,60,0.3);
}
body.light-theme .moment-anger .moment-text { color: #2a0808; }

body.light-theme .moment-heavy {
  background: rgba(220,225,235,0.6);
  border-color: rgba(80,90,120,0.3);
}
body.light-theme .moment-heavy .moment-text { color: #1a1e2a; }

body.light-theme .moment-warmth {
  background: rgba(245,235,240,0.6);
  border-color: rgba(200,100,140,0.3);
}
body.light-theme .moment-warmth .moment-text { color: #2a1020; }

body.light-theme .moment-krusch {
  background: rgba(220,240,230,0.6);
  border-color: rgba(60,140,90,0.3);
}
body.light-theme .moment-krusch .moment-text { color: #0a2a18; }

body.light-theme .dragon-eye-reveal {
  background: rgba(245,240,220,0.9);
  border-color: rgba(160,120,20,0.4);
}

body.light-theme .dragon-eye-text {
  color: #7a5000;
  text-shadow: 0 0 8px rgba(160,100,0,0.2);
}

body.light-theme .return-block {
  background: rgba(230,225,245,0.85);
  border-color: rgba(100,60,180,0.3);
}

body.light-theme .return-kanji {
  color: rgba(100,60,180,0.85);
  text-shadow: 0 0 20px rgba(100,60,180,0.4);
}

body.light-theme .return-label {
  color: rgba(100,60,180,0.6);
}

body.light-theme .return-text {
  color: #2a1a4a;
}

body.light-theme .nav-btn {
  background: rgba(230,224,210,0.8);
  border-color: rgba(138,94,26,0.25);
  color: var(--text-dim);
}

body.light-theme .nav-btn:hover {
  background: rgba(215,208,192,0.95);
}

body.light-theme .chapter-kanji {
  color: rgba(138,94,26,0.65);
}

body.light-theme .location-tag {
  color: rgba(138,94,26,0.7);
}

body.light-theme .scroll-hint,
body.light-theme .chapter-arc {
  color: #8a7a60;
}

body.light-theme .chapter-subtitle {
  color: #2a2010;
}

body.light-theme .scroll-chevron {
  border-right-color: rgba(100,70,20,0.5);
  border-bottom-color: rgba(100,70,20,0.5);
}

body.light-theme .divider-line {
  background: linear-gradient(90deg, transparent, rgba(138,94,26,0.5), transparent);
}

body.light-theme .divider-sigil {
  display: inline-block;
  text-align: center;
  color: rgba(138,94,26,0.8);
}

body.light-theme #canvas {
  opacity: 0.12;
}

/* Dialogue text — override the hardcoded !important */
body.light-theme .dialogue-text {
  color: #1a1610 !important;
}

/* Narration colours */
body.light-theme p.narr {
  color: #1a1610;
}

body.light-theme p.italic-narr {
  color: #3a3020;
}

body.light-theme p.thought {
  color: #4a3e2a;
  border-left-color: rgba(138,94,26,0.4);
}

/* Scene / pov labels */
body.light-theme .scene-label,
body.light-theme .pov-name {
  color: #8a7a60;
}

body.light-theme .pov-subtitle {
  color: rgba(138,94,26,0.55);
}

/* Dragon & cult inline mentions */
body.light-theme .dragon-mention {
  color: #8a5a00;
  text-shadow: 0 0 6px rgba(138,90,0,0.2);
}

body.light-theme .cult-mention {
  color: #6a3080;
  text-shadow: 0 0 6px rgba(106,48,128,0.2);
}


.archbishop-sloth { color: #9d77df; text-shadow: 0 0 8px rgba(157,119,223,0.28); }
.archbishop-lust { color: #e87aaa; text-shadow: 0 0 8px rgba(232,122,170,0.28); }
.org-six-tongues { color: #d4a840; letter-spacing: 0.02em; text-shadow: 0 0 8px rgba(212,168,64,0.25); }

body.light-theme .archbishop-sloth { color: #6f3fc0; }
body.light-theme .archbishop-lust { color: #c04880; }
body.light-theme .org-six-tongues { color: #8a5e1a; }

/* ── Settings panel light ── */
body.light-theme #settings-panel {
  background: rgba(240,235,224,0.97);
  border-color: rgba(138,94,26,0.25);
}
body.light-theme .settings-title {
  color: var(--accent);
  border-bottom-color: rgba(138,94,26,0.2);
}
body.light-theme .settings-label { color: var(--text-dim); }
body.light-theme .settings-btn {
  background: rgba(220,214,200,0.8);
  border-color: rgba(138,94,26,0.2);
  color: var(--text);
}
body.light-theme .settings-btn:hover,
body.light-theme .settings-btn.active {
  background: rgba(138,94,26,0.15);
  border-color: rgba(138,94,26,0.5);
  color: var(--accent);
}
body.light-theme input[type="range"] { accent-color: var(--accent); }

/* ── Settings button group (bottom-left) ── */
#settings-controls {
  position: fixed;
  bottom: 32px;
  left: 32px;
  z-index: 200;
}

/* ── Settings toggle button ── */
#settings-toggle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(200,164,106,0.3);
  background: rgba(14,19,32,0.85);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(200,164,106,0.8);
  transition: background 0.4s ease, border-color 0.4s ease, transform 0.2s ease, box-shadow 0.3s ease, color 0.4s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  user-select: none;
}

#settings-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(0,0,0,0.5);
  border-color: rgba(200,164,106,0.6);
  color: rgba(200,164,106,1);
}

#settings-toggle:active { transform: scale(0.95); }
#settings-toggle.active {
  border-color: rgba(200,164,106,0.7);
  color: rgba(200,164,106,1);
  box-shadow: 0 0 20px rgba(200,164,106,0.2);
}

body.light-theme #settings-toggle {
  background: rgba(230,224,210,0.92);
  border-color: rgba(138,94,26,0.35);
  box-shadow: 0 4px 20px rgba(100,80,40,0.2);
  color: rgba(138,94,26,0.8);
}
body.light-theme #settings-toggle:hover {
  border-color: rgba(138,94,26,0.65);
  box-shadow: 0 6px 28px rgba(100,80,40,0.3);
  color: rgba(138,94,26,1);
}
body.light-theme #settings-toggle.active {
  border-color: rgba(138,94,26,0.7);
  color: rgba(138,94,26,1);
}

/* ── Settings panel ── */
#settings-panel {
  position: fixed;
  bottom: 110px;
  left: 32px;
  z-index: 199;
  width: 300px;
  background: rgba(8,12,20,0.96);
  border: 1px solid rgba(200,164,106,0.2);
  border-radius: 8px;
  padding: 20px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  transform: translateY(12px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#settings-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.settings-title {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(200,164,106,0.15);
}

.settings-group {
  margin-bottom: 16px;
}

.settings-label {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
  display: block;
}

.settings-btn-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.settings-btn {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 0.1em;
  padding: 6px 10px;
  border-radius: 3px;
  border: 1px solid rgba(200,164,106,0.2);
  background: rgba(20,25,40,0.8);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.settings-btn:hover {
  background: rgba(200,164,106,0.08);
  border-color: rgba(200,164,106,0.4);
  color: var(--accent);
}

.settings-btn.active {
  background: rgba(200,164,106,0.12);
  border-color: rgba(200,164,106,0.5);
  color: var(--accent);
}

.settings-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
  cursor: pointer;
  height: 3px;
}

.settings-slider-val {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  color: var(--accent);
  min-width: 36px;
  text-align: right;
  letter-spacing: 0.05em;
}

/* ── Animations disabled class ── */
body.no-anim .reveal {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

body.no-anim .chapter-kanji,
body.no-anim .chapter-arc,
body.no-anim .chapter-num,
body.no-anim .chapter-subtitle {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

body.no-anim .scroll-hint { animation: none !important; opacity: 0.5 !important; }
body.no-anim .divider-sigil {
  display: inline-block;
  text-align: center; animation: none !important; opacity: 0.7 !important; }
body.no-anim .moment-shock.visible { animation: none !important; }
body.no-anim .moment-resolve.visible { animation: none !important; }
body.no-anim .moment-anger.visible { animation: none !important; }
body.no-anim .scroll-chevron { animation: none !important; opacity: 0.5 !important; }

/* ── Theme toggle button ── */
#theme-toggle {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 200;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(200,164,106,0.3);
  background: rgba(14,19,32,0.85);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(200,164,106,0.8);
  transition: background 0.4s ease, border-color 0.4s ease, transform 0.2s ease, box-shadow 0.3s ease, color 0.4s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  user-select: none;
}

#theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(0,0,0,0.5);
  border-color: rgba(200,164,106,0.6);
  color: rgba(200,164,106,1);
}

#theme-toggle:active {
  transform: scale(0.95);
}

body.light-theme #theme-toggle {
  background: rgba(230,224,210,0.92);
  border-color: rgba(138,94,26,0.35);
  box-shadow: 0 4px 20px rgba(100,80,40,0.2);
  color: rgba(138,94,26,0.8);
}

body.light-theme #theme-toggle:hover {
  border-color: rgba(138,94,26,0.65);
  box-shadow: 0 6px 28px rgba(100,80,40,0.3);
  color: rgba(138,94,26,1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 19px;
  line-height: 1.85;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Ambient particles ── */
#canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

/* ── Progress bar ── */
#progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--krusch), var(--accent), var(--beatrice));
  width: 0%;
  z-index: 100;
  transition: width 0.1s linear;
}

/* ── Header ── */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 14px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(8,12,20,0.96);
  border-bottom: 1px solid rgba(200,164,106,0.1);
}

.header-arc {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.header-title {
  font-family: 'Cormorant SC', 'Cinzel', serif;
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--accent);
}

.header-pov {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--text-dim);
  transition: color 0.6s ease;
}

/* ── Chapter title block ── */
.chapter-title-block {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 40px;
}

.chapter-kanji {
  font-family: serif;
  font-size: 48px;
  color: rgba(200,164,106,0.25);
  letter-spacing: 0.4em;
  margin-bottom: 32px;
  animation: fadeSlideIn 2s ease forwards;
}

.chapter-arc {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 0.5em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 20px;
  animation: fadeSlideIn 2s ease 0.3s both;
}

.chapter-num {
  font-family: 'Cormorant SC', 'Cinzel Decorative', serif;
  font-size: clamp(28px, 5vw, 52px);
  color: var(--accent);
  line-height: 1.2;
  margin-bottom: 12px;
  animation: fadeSlideIn 2s ease 0.5s both;
  text-shadow: 0 0 60px rgba(200,164,106,0.3);
}

.chapter-subtitle {
  font-family: 'Cormorant Infant', 'EB Garamond', serif;
  font-style: italic;
  font-size: clamp(20px, 3vw, 32px);
  color: var(--text);
  margin-bottom: 60px;
  animation: fadeSlideIn 2s ease 0.8s both;
}

.scroll-hint {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.4em;
  color: var(--text-dim);
  text-transform: uppercase;
  animation: pulse 2.5s ease-in-out infinite;
}

/* ── Main content ── */
main {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 80px 40px 160px;
}

/* ── Paragraph reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Narration ── */
p.narr {
  margin-bottom: 1.3em;
  color: var(--text);
}

p.italic-narr {
  font-style: italic;
  color: #c8bcaa;
  margin-bottom: 1.3em;
}

p.thought {
  font-style: italic;
  color: #b0a898;
  padding-left: 20px;
  border-left: 2px solid rgba(200,164,106,0.3);
  margin: 1em 0 1.3em;
}

/* ── Dialogue ── */
.dialogue-block {
  margin: 0.4em 0 1.1em;
  position: relative;
}

.speaker-tag {
  display: none;
}

.dialogue-text {
  font-style: normal;
  color: #e0d8cc;
  display: block;
  padding-left: 4px;
}

.dialogue-text.emotional {
  font-style: italic;
}

.sp-ram { color: var(--ram); }
.sp-emilia { color: var(--emilia); }
.sp-bordeaux { color: var(--bordeaux); }
.sp-marcos { color: var(--marcos); }
.sp-fiore { color: var(--fiore); }
.sp-sakura { color: var(--sakura); }
.sp-felt { color: var(--felt); }
.sp-reinhard { color: var(--reinhard); }
.sp-official { color: #9aaabb; }
.sp-krusch { color: var(--krusch); }
.sp-tiga { color: var(--tiga); }
.sp-beatrice { color: var(--beatrice); }
.sp-subaru { color: var(--subaru); }
.sp-otto { color: #8cc878; }
.sp-garfiel { color: #d8b060; }
.sp-rem { color: #8ac8e8; }
.sp-petra { color: #e8b0c8; }
.sp-meili { color: #c8a0e8; }


/* ── Character colors stripped: dialogue colour-neutral ── */
.dialogue-text { color: #e0d8cc !important; }
/* ── Section divider ── */
.section-divider {
  text-align: center;
  padding: 50px 0;
  position: relative;
}

.divider-sigil {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  color: var(--accent);
  letter-spacing: 0.3em;
  display: inline-block;
  animation: sigil-pulse 3s ease-in-out infinite;
}

.divider-line {
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: 16px auto;
  width: 60%;
  opacity: 0.4;
}

/* ── Dramatic moments ── */
.moment,
.dragon-eye-reveal,
.return-block {
  --moment-accent: var(--accent);
  --moment-bg: rgba(15, 19, 32, 0.72);
  --moment-border: rgba(200, 164, 106, 0.22);
  position: relative;
  margin: 2.2em auto;
  padding: 24px 28px 24px 32px;
  max-width: 780px;
  border: 1px solid var(--moment-border);
  border-left: 4px solid var(--moment-accent);
  border-radius: 14px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--moment-accent) 14%, transparent), transparent 42%),
    var(--moment-bg);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  text-align: left;
}

.moment::before,
.dragon-eye-reveal::before,
.return-block::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.055), transparent 55%);
  opacity: 1;
  pointer-events: none;
}

.moment::after,
.dragon-eye-reveal::after,
.return-block::after {
  content: '';
  position: absolute;
  top: 18px;
  right: 20px;
  width: 34px;
  height: 2px;
  border-radius: 99px;
  background: var(--moment-accent);
  opacity: 0.45;
}

.moment-label { display: none; }

.moment-text,
.dragon-eye-text,
.return-text {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--text);
  font-family: inherit;
  font-size: 1em;
  line-height: 1.78;
  letter-spacing: 0.01em;
  text-shadow: none;
}

.moment-text + .moment-text,
.moment-text[style*="margin-top"] {
  margin-top: 0.85em !important;
}

.moment-shock { --moment-accent: #7a9cc8; --moment-bg: rgba(12, 22, 38, 0.76); --moment-border: rgba(122,156,200,0.28); }
.moment-anger { --moment-accent: #d06a6a; --moment-bg: rgba(36, 17, 17, 0.74); --moment-border: rgba(208,106,106,0.26); }
.moment-resolve { --moment-accent: #c8a46a; --moment-bg: rgba(32, 27, 17, 0.74); --moment-border: rgba(200,164,106,0.32); }
.moment-heavy { --moment-accent: #8a9ab0; --moment-bg: rgba(14, 17, 28, 0.78); --moment-border: rgba(138,154,176,0.25); }
.moment-warmth { --moment-accent: #e87aaa; --moment-bg: rgba(34, 18, 27, 0.72); --moment-border: rgba(232,122,170,0.25); }
.moment-krusch { --moment-accent: #5aaa7a; --moment-bg: rgba(10, 28, 18, 0.74); --moment-border: rgba(90,170,122,0.27); }
.moment-battle { --moment-accent: #d4a030; --moment-bg: rgba(35, 24, 7, 0.76); --moment-border: rgba(212,160,48,0.30); }

.moment-shock .moment-text,
.moment-anger .moment-text,
.moment-resolve .moment-text,
.moment-heavy .moment-text,
.moment-warmth .moment-text,
.moment-krusch .moment-text,
.moment-battle .moment-text {
  color: var(--text);
  font-style: normal;
}

/* ── Dragon Eye reveal ── */
.dragon-eye-reveal {
  --moment-accent: #d6ad3f;
  --moment-bg: rgba(26, 22, 12, 0.80);
  --moment-border: rgba(214, 173, 63, 0.35);
}

.dragon-eye-glyph {
  display: none;
}

.dragon-eye-text {
  color: #f1dfb2;
  font-style: normal;
}

/* ── Return from death animation ── */
.return-block {
  --moment-accent: #9d77df;
  --moment-bg: rgba(18, 14, 34, 0.82);
  --moment-border: rgba(157, 119, 223, 0.34);
  padding-top: 28px;
}

.return-vortex,
.return-ring {
  display: none;
}

.return-kanji {
  position: relative;
  z-index: 1;
  margin-bottom: 10px;
  color: rgba(205, 184, 244, 0.75);
  font-size: 30px;
  letter-spacing: 0.16em;
  text-shadow: none;
}

.return-label {
  position: relative;
  z-index: 1;
  margin-bottom: 14px;
  color: rgba(205, 184, 244, 0.72);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-shadow: none;
}

.return-text {
  color: var(--text);
}

/* ── Garfiel inner monologue ── */
.inner-fire {
  position: relative;
  margin: 1.8em auto;
  padding: 18px 24px 18px 28px;
  max-width: 760px;
  border-left: 4px solid var(--garfiel, var(--accent));
  border-radius: 0 12px 12px 0;
  background: rgba(212, 160, 64, 0.08);
  color: var(--text);
  font-size: 1em;
  line-height: 1.85;
  font-style: normal;
}

body.light-theme .moment,
body.light-theme .dragon-eye-reveal,
body.light-theme .return-block {
  --moment-bg: rgba(255, 252, 244, 0.78);
  --moment-border: color-mix(in srgb, var(--moment-accent) 38%, rgba(138,94,26,0.22));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--moment-accent) 12%, transparent), transparent 42%),
    var(--moment-bg);
  box-shadow: 0 10px 26px rgba(90, 70, 40, 0.12);
}

body.light-theme .moment-text,
body.light-theme .dragon-eye-text,
body.light-theme .return-text,
body.light-theme .moment-shock .moment-text,
body.light-theme .moment-anger .moment-text,
body.light-theme .moment-resolve .moment-text,
body.light-theme .moment-heavy .moment-text,
body.light-theme .moment-warmth .moment-text,
body.light-theme .moment-krusch .moment-text,
body.light-theme .moment-battle .moment-text {
  color: #1a1610;
}

body.light-theme .dragon-eye-text { color: #3c2b05; }
body.light-theme .return-kanji,
body.light-theme .return-label { color: rgba(76, 43, 132, 0.72); text-shadow: none; }
body.light-theme .inner-fire { color: #2a2010; background: rgba(212, 160, 64, 0.12); border-left-color: var(--accent); }

.moment-shock.visible,
.moment-resolve.visible,
.moment-anger.visible,
.moment-krusch.visible,
.moment-battle.visible,
.dragon-eye-glyph,
.return-kanji {
  animation: none !important;
}


body.plain-moments .moment,
body.plain-moments .dragon-eye-reveal,
body.plain-moments .return-block,
body.plain-moments .inner-fire {
  margin: 1em 0;
  padding: 0;
  max-width: none;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  overflow: visible;
  text-align: inherit;
}

body.plain-moments .moment::before,
body.plain-moments .moment::after,
body.plain-moments .dragon-eye-reveal::before,
body.plain-moments .dragon-eye-reveal::after,
body.plain-moments .return-block::before,
body.plain-moments .return-block::after,
body.plain-moments .dragon-eye-glyph,
body.plain-moments .return-vortex,
body.plain-moments .return-ring,
body.plain-moments .return-kanji,
body.plain-moments .return-label {
  display: none !important;
}

body.plain-moments .moment-text,
body.plain-moments .dragon-eye-text,
body.plain-moments .return-text {
  color: inherit;
  font: inherit;
  line-height: inherit;
  letter-spacing: inherit;
}

/* ── POV section headers ── */
.pov-header {
  display: none;
}
.pov-name {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.pov-subtitle {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 15px;
  color: rgba(200,164,106,0.5);
}

/* ── Scene label ── */
.scene-label {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: center;
  padding: 24px 0 8px;
  opacity: 0.6;
}

/* ── Navigation buttons ── */
.nav-buttons {
  position: relative;
  z-index: 10;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 60px 40px 100px;
  max-width: 760px;
  margin: 0 auto;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  padding: 14px 28px;
  border: 1px solid rgba(200,164,106,0.25);
  border-radius: 3px;
  background: rgba(8,12,20,0.7);
  transition: all 0.35s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.nav-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(200,164,106,0.06), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.nav-btn:hover::before {
  transform: translateX(100%);
}

.nav-btn:hover {
  color: var(--accent);
  border-color: rgba(200,164,106,0.55);
  box-shadow: 0 0 20px rgba(200,164,106,0.1);
  transform: translateY(-1px);
}

.nav-btn-prev { border-color: rgba(90,170,122,0.25); }
.nav-btn-prev:hover { color: var(--krusch); border-color: rgba(90,170,122,0.5); box-shadow: 0 0 20px rgba(90,170,122,0.1); }

.nav-btn-toc { border-color: rgba(200,164,106,0.25); }
.nav-btn-toc:hover { color: var(--accent); border-color: rgba(200,164,106,0.5); }

.nav-btn-next { border-color: rgba(170,100,220,0.25); }
.nav-btn-next:hover { color: var(--beatrice); border-color: rgba(170,100,220,0.5); box-shadow: 0 0 20px rgba(170,100,220,0.1); }

.nav-icon {
  font-size: 14px;
  opacity: 0.7;
}

/* ── Animations ── */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes sigil-pulse {
  0%, 100% { opacity: 0.4; letter-spacing: 0.3em; }
  50% { opacity: 0.9; letter-spacing: 0.45em; }
}

@keyframes shock-flare {
  0% { box-shadow: inset 0 0 40px rgba(80,120,200,0.05), 0 0 30px rgba(80,120,200,0.08); }
  50% { box-shadow: inset 0 0 80px rgba(80,120,200,0.15), 0 0 60px rgba(80,120,200,0.2); }
  100% { box-shadow: inset 0 0 40px rgba(80,120,200,0.05), 0 0 30px rgba(80,120,200,0.08); }
}

.moment-shock.visible { animation: shock-flare 4s ease-in-out infinite; }

@keyframes resolve-glow {
  0%, 100% { box-shadow: inset 0 0 50px rgba(200,164,106,0.06), 0 0 40px rgba(200,164,106,0.12); }
  50% { box-shadow: inset 0 0 80px rgba(200,164,106,0.12), 0 0 70px rgba(200,164,106,0.22); }
}
.moment-resolve.visible { animation: resolve-glow 3.5s ease-in-out infinite; }

@keyframes anger-pulse {
  0%, 100% { box-shadow: inset 0 0 40px rgba(200,60,60,0.05), 0 0 30px rgba(200,60,60,0.08); }
  50% { box-shadow: inset 0 0 60px rgba(200,60,60,0.12), 0 0 50px rgba(200,60,60,0.15); }
}
.moment-anger.visible { animation: anger-pulse 2.5s ease-in-out infinite; }

@keyframes krusch-glow {
  0%, 100% { box-shadow: inset 0 0 40px rgba(90,170,122,0.05), 0 0 30px rgba(90,170,122,0.08); }
  50% { box-shadow: inset 0 0 70px rgba(90,170,122,0.12), 0 0 50px rgba(90,170,122,0.15); }
}
.moment-krusch.visible { animation: krusch-glow 3s ease-in-out infinite; }

@keyframes eye-pulse {
  0%, 100% { filter: drop-shadow(0 0 14px rgba(255,200,40,0.6)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 30px rgba(255,220,60,0.95)) drop-shadow(0 0 50px rgba(200,140,0,0.5)); transform: scale(1.06); }
}

@keyframes return-glow {
  0%, 100% { text-shadow: 0 0 30px rgba(160,80,220,0.7), 0 0 60px rgba(80,40,140,0.4); }
  50% { text-shadow: 0 0 50px rgba(180,100,255,1), 0 0 90px rgba(100,50,180,0.7), 0 0 4px #fff; }
}

@keyframes ring-expand {
  0%   { width: 60px; height: 60px; opacity: 0.8; border-color: rgba(160,80,220,0.7); }
  100% { width: 320px; height: 320px; opacity: 0; border-color: rgba(80,20,140,0); }
}

/* ── Scroll indicator ── */
.scroll-down {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.scroll-chevron {
  width: 16px;
  height: 16px;
  border-right: 1px solid rgba(200,164,106,0.5);
  border-bottom: 1px solid rgba(200,164,106,0.5);
  transform: rotate(45deg);
  animation: bounce 1.5s ease-in-out infinite;
}
@keyframes bounce {
  0%,100% { transform: rotate(45deg) translateY(0); opacity: 0.4; }
  50% { transform: rotate(45deg) translateY(6px); opacity: 0.9; }
}

/* ── Witch cult / Dragon ── */
.cult-mention {
  color: var(--witch);
  font-style: normal;
  text-shadow: 0 0 8px rgba(144,64,160,0.3);
}

.dragon-mention {
  color: #d4a020;
  text-shadow: 0 0 8px rgba(200,150,0,0.3);
}

/* ── Footnote-style location ── */
.location-tag {
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.4em;
  color: rgba(200,164,106,0.35);
  padding: 8px 0 30px;
  text-transform: uppercase;
}

/* Responsive */
@media (max-width: 600px) {
  main { padding: 60px 20px 100px; }
  header { padding: 12px 20px; }
  .header-arc { display: none; }
  body { font-size: 17px; }
  .nav-buttons { padding: 40px 20px 80px; gap: 12px; }
  .nav-btn { padding: 12px 18px; font-size: 10px; }
  .chapter-kanji { font-size: 28px; letter-spacing: 0.25em; margin-bottom: 20px; }
  .moment,
  .dragon-eye-reveal,
  .return-block {
    margin: 1.7em 0;
    padding: 20px 20px 20px 24px;
    border-radius: 12px;
  }
  .moment-text,
  .dragon-eye-text,
  .return-text,
  .inner-fire {
    line-height: 1.72;
  }
}

.jp-minute{margin:28px 0;padding:14px 16px;border-left:3px solid var(--accent2);background:rgba(120,140,180,.08);border-radius:8px;}
.jp-minute-toggle{all:unset;cursor:pointer;display:flex;justify-content:space-between;gap:12px;width:100%;font-family:"Nunito",sans-serif;font-weight:600;color:var(--accent2);}
.jp-minute-content{margin-top:10px;overflow:hidden;max-height:0;opacity:0;transition:max-height .38s ease,opacity .28s ease;}
.jp-minute.open .jp-minute-content{opacity:1;}
.jp-minute-arrow{transition:transform .22s ease;}
.jp-minute.open .jp-minute-arrow{transform:rotate(180deg);}

.battle-beat{position:relative;padding-left:14px;border-left:2px solid rgba(210,90,70,.35);}
.battle-beat::before{content:"";position:absolute;left:-5px;top:0.8em;width:7px;height:7px;border-radius:50%;background:rgba(240,120,90,.55);box-shadow:0 0 12px rgba(240,120,90,.35);}
.battle-beat .moment-text{letter-spacing:.01em;}
.battle-spark{background:linear-gradient(90deg,rgba(210,90,70,.12),transparent 70%);border-radius:6px;padding:2px 6px;animation:sparkPulse 2.8s ease-in-out infinite;}
@keyframes sparkPulse{0%,100%{box-shadow:none;}50%{box-shadow:0 0 10px rgba(210,90,70,.22);}}
body.no-anim .battle-spark{animation:none;}

/* ===== 10-22.html ===== */
:root {
  --bg: #080c14;
  --bg2: #0e1320;
  --bg3: #13192e;
  --text: #ddd4c0;
  --text-dim: #8a8070;
  --accent: #c8a46a;
  --accent2: #7a9cc8;
  --divider: #2a3050;
  --ram: #e87aaa;
  --emilia: #aac8ec;
  --bordeaux: #d04040;
  --marcos: #8a9ab0;
  --fiore: #f0c060;
  --sakura: #c08ad0;
  --felt: #e8a050;
  --reinhard: #5090d8;
  --witch: #9040a0;
  --narrator: #ddd4c0;
  --krusch: #5aaa7a;
  --tiga: #d4a060;
  --beatrice: #b08adc;
  --subaru: #90b8e0;
}

/* ── Light theme overrides ── */
body.light-theme {
  --bg: #f0ebe0;
  --bg2: #e8e2d4;
  --bg3: #ddd7c8;
  --text: #1a1610;
  --text-dim: #6a5e4a;
  --accent: #8a5e1a;
  --accent2: #2a5888;
  --divider: #c8bca0;
}

body.light-theme header {
  background: rgba(240,235,224,0.97);
  border-bottom-color: rgba(138,94,26,0.15);
}

body.light-theme p.italic-narr {
  color: #3a3020;
}

body.light-theme p.thought {
  color: #4a3e2a;
  border-left-color: rgba(138,94,26,0.4);
}

body.light-theme .inner-fire {
  color: #5a3a10;
  border-left-color: var(--accent);
}

body.light-theme .moment-resolve {
  background: rgba(240,235,220,0.7);
  border-color: rgba(138,94,26,0.35);
}
body.light-theme .moment-resolve .moment-text { color: #2a1e08; }

body.light-theme .moment-shock {
  background: rgba(220,230,245,0.6);
  border-color: rgba(60,100,180,0.3);
}
body.light-theme .moment-shock .moment-text { color: #1a2a3a; }

body.light-theme .moment-anger {
  background: rgba(245,225,220,0.6);
  border-color: rgba(180,60,60,0.3);
}
body.light-theme .moment-anger .moment-text { color: #2a0808; }

body.light-theme .moment-heavy {
  background: rgba(220,225,235,0.6);
  border-color: rgba(80,90,120,0.3);
}
body.light-theme .moment-heavy .moment-text { color: #1a1e2a; }

body.light-theme .moment-warmth {
  background: rgba(245,235,240,0.6);
  border-color: rgba(200,100,140,0.3);
}
body.light-theme .moment-warmth .moment-text { color: #2a1020; }

body.light-theme .moment-krusch {
  background: rgba(220,240,230,0.6);
  border-color: rgba(60,140,90,0.3);
}
body.light-theme .moment-krusch .moment-text { color: #0a2a18; }

body.light-theme .dragon-eye-reveal {
  background: rgba(245,240,220,0.9);
  border-color: rgba(160,120,20,0.4);
}

body.light-theme .dragon-eye-text {
  color: #7a5000;
  text-shadow: 0 0 8px rgba(160,100,0,0.2);
}

body.light-theme .return-block {
  background: rgba(230,225,245,0.85);
  border-color: rgba(100,60,180,0.3);
}

body.light-theme .return-kanji {
  color: rgba(100,60,180,0.85);
  text-shadow: 0 0 20px rgba(100,60,180,0.4);
}

body.light-theme .return-label {
  color: rgba(100,60,180,0.6);
}

body.light-theme .return-text {
  color: #2a1a4a;
}

body.light-theme .nav-btn {
  background: rgba(230,224,210,0.8);
  border-color: rgba(138,94,26,0.25);
  color: var(--text-dim);
}

body.light-theme .nav-btn:hover {
  background: rgba(215,208,192,0.95);
}

body.light-theme .chapter-kanji {
  color: rgba(138,94,26,0.65);
}

body.light-theme .location-tag {
  color: rgba(138,94,26,0.7);
}

body.light-theme .scroll-hint,
body.light-theme .chapter-arc {
  color: #8a7a60;
}

body.light-theme .chapter-subtitle {
  color: #2a2010;
}

body.light-theme .scroll-chevron {
  border-right-color: rgba(100,70,20,0.5);
  border-bottom-color: rgba(100,70,20,0.5);
}

body.light-theme .divider-line {
  background: linear-gradient(90deg, transparent, rgba(138,94,26,0.5), transparent);
}

body.light-theme .divider-sigil {
  display: inline-block;
  text-align: center;
  color: rgba(138,94,26,0.8);
}

body.light-theme #canvas {
  opacity: 0.12;
}

/* Dialogue text — override the hardcoded !important */
body.light-theme .dialogue-text {
  color: #1a1610 !important;
}

/* Narration colours */
body.light-theme p.narr {
  color: #1a1610;
}

body.light-theme p.italic-narr {
  color: #3a3020;
}

body.light-theme p.thought {
  color: #4a3e2a;
  border-left-color: rgba(138,94,26,0.4);
}

/* Scene / pov labels */
body.light-theme .scene-label,
body.light-theme .pov-name {
  color: #8a7a60;
}

body.light-theme .pov-subtitle {
  color: rgba(138,94,26,0.55);
}

/* Dragon & cult inline mentions */
body.light-theme .dragon-mention {
  color: #8a5a00;
  text-shadow: 0 0 6px rgba(138,90,0,0.2);
}

body.light-theme .cult-mention {
  color: #6a3080;
  text-shadow: 0 0 6px rgba(106,48,128,0.2);
}


.archbishop-sloth { color: #9d77df; text-shadow: 0 0 8px rgba(157,119,223,0.28); }
.archbishop-lust { color: #e87aaa; text-shadow: 0 0 8px rgba(232,122,170,0.28); }
.org-six-tongues { color: #d4a840; letter-spacing: 0.02em; text-shadow: 0 0 8px rgba(212,168,64,0.25); }

body.light-theme .archbishop-sloth { color: #6f3fc0; }
body.light-theme .archbishop-lust { color: #c04880; }
body.light-theme .org-six-tongues { color: #8a5e1a; }

/* ── Settings panel light ── */
body.light-theme #settings-panel {
  background: rgba(240,235,224,0.97);
  border-color: rgba(138,94,26,0.25);
}
body.light-theme .settings-title {
  color: var(--accent);
  border-bottom-color: rgba(138,94,26,0.2);
}
body.light-theme .settings-label { color: var(--text-dim); }
body.light-theme .settings-btn {
  background: rgba(220,214,200,0.8);
  border-color: rgba(138,94,26,0.2);
  color: var(--text);
}
body.light-theme .settings-btn:hover,
body.light-theme .settings-btn.active {
  background: rgba(138,94,26,0.15);
  border-color: rgba(138,94,26,0.5);
  color: var(--accent);
}
body.light-theme input[type="range"] { accent-color: var(--accent); }

/* ── Settings button group (bottom-left) ── */
#settings-controls {
  position: fixed;
  bottom: 32px;
  left: 32px;
  z-index: 200;
}

/* ── Settings toggle button ── */
#settings-toggle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(200,164,106,0.3);
  background: rgba(14,19,32,0.85);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(200,164,106,0.8);
  transition: background 0.4s ease, border-color 0.4s ease, transform 0.2s ease, box-shadow 0.3s ease, color 0.4s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  user-select: none;
}

#settings-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(0,0,0,0.5);
  border-color: rgba(200,164,106,0.6);
  color: rgba(200,164,106,1);
}

#settings-toggle:active { transform: scale(0.95); }
#settings-toggle.active {
  border-color: rgba(200,164,106,0.7);
  color: rgba(200,164,106,1);
  box-shadow: 0 0 20px rgba(200,164,106,0.2);
}

body.light-theme #settings-toggle {
  background: rgba(230,224,210,0.92);
  border-color: rgba(138,94,26,0.35);
  box-shadow: 0 4px 20px rgba(100,80,40,0.2);
  color: rgba(138,94,26,0.8);
}
body.light-theme #settings-toggle:hover {
  border-color: rgba(138,94,26,0.65);
  box-shadow: 0 6px 28px rgba(100,80,40,0.3);
  color: rgba(138,94,26,1);
}
body.light-theme #settings-toggle.active {
  border-color: rgba(138,94,26,0.7);
  color: rgba(138,94,26,1);
}

/* ── Settings panel ── */
#settings-panel {
  position: fixed;
  bottom: 110px;
  left: 32px;
  z-index: 199;
  width: 300px;
  background: rgba(8,12,20,0.96);
  border: 1px solid rgba(200,164,106,0.2);
  border-radius: 8px;
  padding: 20px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  transform: translateY(12px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#settings-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.settings-title {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(200,164,106,0.15);
}

.settings-group {
  margin-bottom: 16px;
}

.settings-label {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
  display: block;
}

.settings-btn-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.settings-btn {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 0.1em;
  padding: 6px 10px;
  border-radius: 3px;
  border: 1px solid rgba(200,164,106,0.2);
  background: rgba(20,25,40,0.8);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.settings-btn:hover {
  background: rgba(200,164,106,0.08);
  border-color: rgba(200,164,106,0.4);
  color: var(--accent);
}

.settings-btn.active {
  background: rgba(200,164,106,0.12);
  border-color: rgba(200,164,106,0.5);
  color: var(--accent);
}

.settings-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
  cursor: pointer;
  height: 3px;
}

.settings-slider-val {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  color: var(--accent);
  min-width: 36px;
  text-align: right;
  letter-spacing: 0.05em;
}

/* ── Animations disabled class ── */
body.no-anim .reveal {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

body.no-anim .chapter-kanji,
body.no-anim .chapter-arc,
body.no-anim .chapter-num,
body.no-anim .chapter-subtitle {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

body.no-anim .scroll-hint { animation: none !important; opacity: 0.5 !important; }
body.no-anim .divider-sigil {
  display: inline-block;
  text-align: center; animation: none !important; opacity: 0.7 !important; }
body.no-anim .moment-shock.visible { animation: none !important; }
body.no-anim .moment-resolve.visible { animation: none !important; }
body.no-anim .moment-anger.visible { animation: none !important; }
body.no-anim .scroll-chevron { animation: none !important; opacity: 0.5 !important; }

/* ── Theme toggle button ── */
#theme-toggle {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 200;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(200,164,106,0.3);
  background: rgba(14,19,32,0.85);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(200,164,106,0.8);
  transition: background 0.4s ease, border-color 0.4s ease, transform 0.2s ease, box-shadow 0.3s ease, color 0.4s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  user-select: none;
}

#theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(0,0,0,0.5);
  border-color: rgba(200,164,106,0.6);
  color: rgba(200,164,106,1);
}

#theme-toggle:active {
  transform: scale(0.95);
}

body.light-theme #theme-toggle {
  background: rgba(230,224,210,0.92);
  border-color: rgba(138,94,26,0.35);
  box-shadow: 0 4px 20px rgba(100,80,40,0.2);
  color: rgba(138,94,26,0.8);
}

body.light-theme #theme-toggle:hover {
  border-color: rgba(138,94,26,0.65);
  box-shadow: 0 6px 28px rgba(100,80,40,0.3);
  color: rgba(138,94,26,1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 19px;
  line-height: 1.85;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Ambient particles ── */
#canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

/* ── Progress bar ── */
#progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--krusch), var(--accent), var(--beatrice));
  width: 0%;
  z-index: 100;
  transition: width 0.1s linear;
}

/* ── Header ── */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 14px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(8,12,20,0.96);
  border-bottom: 1px solid rgba(200,164,106,0.1);
}

.header-arc {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.header-title {
  font-family: 'Cormorant SC', 'Cinzel', serif;
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--accent);
}

.header-pov {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--text-dim);
  transition: color 0.6s ease;
}

/* ── Chapter title block ── */
.chapter-title-block {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 40px;
}

.chapter-kanji {
  font-family: serif;
  font-size: 48px;
  color: rgba(200,164,106,0.25);
  letter-spacing: 0.4em;
  margin-bottom: 32px;
  animation: fadeSlideIn 2s ease forwards;
}

.chapter-arc {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 0.5em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 20px;
  animation: fadeSlideIn 2s ease 0.3s both;
}

.chapter-num {
  font-family: 'Cormorant SC', 'Cinzel Decorative', serif;
  font-size: clamp(28px, 5vw, 52px);
  color: var(--accent);
  line-height: 1.2;
  margin-bottom: 12px;
  animation: fadeSlideIn 2s ease 0.5s both;
  text-shadow: 0 0 60px rgba(200,164,106,0.3);
}

.chapter-subtitle {
  font-family: 'Cormorant Infant', 'EB Garamond', serif;
  font-style: italic;
  font-size: clamp(20px, 3vw, 32px);
  color: var(--text);
  margin-bottom: 60px;
  animation: fadeSlideIn 2s ease 0.8s both;
}

.scroll-hint {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.4em;
  color: var(--text-dim);
  text-transform: uppercase;
  animation: pulse 2.5s ease-in-out infinite;
}

/* ── Main content ── */
main {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 80px 40px 160px;
}

/* ── Paragraph reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Narration ── */
p.narr {
  margin-bottom: 1.3em;
  color: var(--text);
}

p.italic-narr {
  font-style: italic;
  color: #c8bcaa;
  margin-bottom: 1.3em;
}

p.thought {
  font-style: italic;
  color: #b0a898;
  padding-left: 20px;
  border-left: 2px solid rgba(200,164,106,0.3);
  margin: 1em 0 1.3em;
}

/* ── Dialogue ── */
.dialogue-block {
  margin: 0.4em 0 1.1em;
  position: relative;
}

.speaker-tag {
  display: none;
}

.dialogue-text {
  font-style: normal;
  color: #e0d8cc;
  display: block;
  padding-left: 4px;
}

.dialogue-text.emotional {
  font-style: italic;
}

.sp-ram { color: var(--ram); }
.sp-emilia { color: var(--emilia); }
.sp-bordeaux { color: var(--bordeaux); }
.sp-marcos { color: var(--marcos); }
.sp-fiore { color: var(--fiore); }
.sp-sakura { color: var(--sakura); }
.sp-felt { color: var(--felt); }
.sp-reinhard { color: var(--reinhard); }
.sp-official { color: #9aaabb; }
.sp-krusch { color: var(--krusch); }
.sp-tiga { color: var(--tiga); }
.sp-beatrice { color: var(--beatrice); }
.sp-subaru { color: var(--subaru); }
.sp-otto { color: #8cc878; }
.sp-garfiel { color: #d8b060; }
.sp-rem { color: #8ac8e8; }
.sp-petra { color: #e8b0c8; }
.sp-meili { color: #c8a0e8; }


/* ── Character colors stripped: dialogue colour-neutral ── */
.dialogue-text { color: #e0d8cc !important; }
/* ── Section divider ── */
.section-divider {
  text-align: center;
  padding: 50px 0;
  position: relative;
}

.divider-sigil {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  color: var(--accent);
  letter-spacing: 0.3em;
  display: inline-block;
  animation: sigil-pulse 3s ease-in-out infinite;
}

.divider-line {
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: 16px auto;
  width: 60%;
  opacity: 0.4;
}

/* ── Dramatic moments ── */
.moment,
.dragon-eye-reveal,
.return-block {
  --moment-accent: var(--accent);
  --moment-bg: rgba(15, 19, 32, 0.72);
  --moment-border: rgba(200, 164, 106, 0.22);
  position: relative;
  margin: 2.2em auto;
  padding: 24px 28px 24px 32px;
  max-width: 780px;
  border: 1px solid var(--moment-border);
  border-left: 4px solid var(--moment-accent);
  border-radius: 14px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--moment-accent) 14%, transparent), transparent 42%),
    var(--moment-bg);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  text-align: left;
}

.moment::before,
.dragon-eye-reveal::before,
.return-block::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.055), transparent 55%);
  opacity: 1;
  pointer-events: none;
}

.moment::after,
.dragon-eye-reveal::after,
.return-block::after {
  content: '';
  position: absolute;
  top: 18px;
  right: 20px;
  width: 34px;
  height: 2px;
  border-radius: 99px;
  background: var(--moment-accent);
  opacity: 0.45;
}

.moment-label { display: none; }

.moment-text,
.dragon-eye-text,
.return-text {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--text);
  font-family: inherit;
  font-size: 1em;
  line-height: 1.78;
  letter-spacing: 0.01em;
  text-shadow: none;
}

.moment-text + .moment-text,
.moment-text[style*="margin-top"] {
  margin-top: 0.85em !important;
}

.moment-shock { --moment-accent: #7a9cc8; --moment-bg: rgba(12, 22, 38, 0.76); --moment-border: rgba(122,156,200,0.28); }
.moment-anger { --moment-accent: #d06a6a; --moment-bg: rgba(36, 17, 17, 0.74); --moment-border: rgba(208,106,106,0.26); }
.moment-resolve { --moment-accent: #c8a46a; --moment-bg: rgba(32, 27, 17, 0.74); --moment-border: rgba(200,164,106,0.32); }
.moment-heavy { --moment-accent: #8a9ab0; --moment-bg: rgba(14, 17, 28, 0.78); --moment-border: rgba(138,154,176,0.25); }
.moment-warmth { --moment-accent: #e87aaa; --moment-bg: rgba(34, 18, 27, 0.72); --moment-border: rgba(232,122,170,0.25); }
.moment-krusch { --moment-accent: #5aaa7a; --moment-bg: rgba(10, 28, 18, 0.74); --moment-border: rgba(90,170,122,0.27); }
.moment-battle { --moment-accent: #d4a030; --moment-bg: rgba(35, 24, 7, 0.76); --moment-border: rgba(212,160,48,0.30); }

.moment-shock .moment-text,
.moment-anger .moment-text,
.moment-resolve .moment-text,
.moment-heavy .moment-text,
.moment-warmth .moment-text,
.moment-krusch .moment-text,
.moment-battle .moment-text {
  color: var(--text);
  font-style: normal;
}

/* ── Dragon Eye reveal ── */
.dragon-eye-reveal {
  --moment-accent: #d6ad3f;
  --moment-bg: rgba(26, 22, 12, 0.80);
  --moment-border: rgba(214, 173, 63, 0.35);
}

.dragon-eye-glyph {
  display: none;
}

.dragon-eye-text {
  color: #f1dfb2;
  font-style: normal;
}

/* ── Return from death animation ── */
.return-block {
  --moment-accent: #9d77df;
  --moment-bg: rgba(18, 14, 34, 0.82);
  --moment-border: rgba(157, 119, 223, 0.34);
  padding-top: 28px;
}

.return-vortex,
.return-ring {
  display: none;
}

.return-kanji {
  position: relative;
  z-index: 1;
  margin-bottom: 10px;
  color: rgba(205, 184, 244, 0.75);
  font-size: 30px;
  letter-spacing: 0.16em;
  text-shadow: none;
}

.return-label {
  position: relative;
  z-index: 1;
  margin-bottom: 14px;
  color: rgba(205, 184, 244, 0.72);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-shadow: none;
}

.return-text {
  color: var(--text);
}

/* ── Garfiel inner monologue ── */
.inner-fire {
  position: relative;
  margin: 1.8em auto;
  padding: 18px 24px 18px 28px;
  max-width: 760px;
  border-left: 4px solid var(--garfiel, var(--accent));
  border-radius: 0 12px 12px 0;
  background: rgba(212, 160, 64, 0.08);
  color: var(--text);
  font-size: 1em;
  line-height: 1.85;
  font-style: normal;
}

body.light-theme .moment,
body.light-theme .dragon-eye-reveal,
body.light-theme .return-block {
  --moment-bg: rgba(255, 252, 244, 0.78);
  --moment-border: color-mix(in srgb, var(--moment-accent) 38%, rgba(138,94,26,0.22));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--moment-accent) 12%, transparent), transparent 42%),
    var(--moment-bg);
  box-shadow: 0 10px 26px rgba(90, 70, 40, 0.12);
}

body.light-theme .moment-text,
body.light-theme .dragon-eye-text,
body.light-theme .return-text,
body.light-theme .moment-shock .moment-text,
body.light-theme .moment-anger .moment-text,
body.light-theme .moment-resolve .moment-text,
body.light-theme .moment-heavy .moment-text,
body.light-theme .moment-warmth .moment-text,
body.light-theme .moment-krusch .moment-text,
body.light-theme .moment-battle .moment-text {
  color: #1a1610;
}

body.light-theme .dragon-eye-text { color: #3c2b05; }
body.light-theme .return-kanji,
body.light-theme .return-label { color: rgba(76, 43, 132, 0.72); text-shadow: none; }
body.light-theme .inner-fire { color: #2a2010; background: rgba(212, 160, 64, 0.12); border-left-color: var(--accent); }

.moment-shock.visible,
.moment-resolve.visible,
.moment-anger.visible,
.moment-krusch.visible,
.moment-battle.visible,
.dragon-eye-glyph,
.return-kanji {
  animation: none !important;
}


body.plain-moments .moment,
body.plain-moments .dragon-eye-reveal,
body.plain-moments .return-block,
body.plain-moments .inner-fire {
  margin: 1em 0;
  padding: 0;
  max-width: none;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  overflow: visible;
  text-align: inherit;
}

body.plain-moments .moment::before,
body.plain-moments .moment::after,
body.plain-moments .dragon-eye-reveal::before,
body.plain-moments .dragon-eye-reveal::after,
body.plain-moments .return-block::before,
body.plain-moments .return-block::after,
body.plain-moments .dragon-eye-glyph,
body.plain-moments .return-vortex,
body.plain-moments .return-ring,
body.plain-moments .return-kanji,
body.plain-moments .return-label {
  display: none !important;
}

body.plain-moments .moment-text,
body.plain-moments .dragon-eye-text,
body.plain-moments .return-text {
  color: inherit;
  font: inherit;
  line-height: inherit;
  letter-spacing: inherit;
}

/* ── POV section headers ── */
.pov-header {
  display: none;
}
.pov-name {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.pov-subtitle {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 15px;
  color: rgba(200,164,106,0.5);
}

/* ── Scene label ── */
.scene-label {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: center;
  padding: 24px 0 8px;
  opacity: 0.6;
}

/* ── Navigation buttons ── */
.nav-buttons {
  position: relative;
  z-index: 10;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 60px 40px 100px;
  max-width: 760px;
  margin: 0 auto;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  padding: 14px 28px;
  border: 1px solid rgba(200,164,106,0.25);
  border-radius: 3px;
  background: rgba(8,12,20,0.7);
  transition: all 0.35s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.nav-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(200,164,106,0.06), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.nav-btn:hover::before {
  transform: translateX(100%);
}

.nav-btn:hover {
  color: var(--accent);
  border-color: rgba(200,164,106,0.55);
  box-shadow: 0 0 20px rgba(200,164,106,0.1);
  transform: translateY(-1px);
}

.nav-btn-prev { border-color: rgba(90,170,122,0.25); }
.nav-btn-prev:hover { color: var(--krusch); border-color: rgba(90,170,122,0.5); box-shadow: 0 0 20px rgba(90,170,122,0.1); }

.nav-btn-toc { border-color: rgba(200,164,106,0.25); }
.nav-btn-toc:hover { color: var(--accent); border-color: rgba(200,164,106,0.5); }

.nav-btn-next { border-color: rgba(170,100,220,0.25); }
.nav-btn-next:hover { color: var(--beatrice); border-color: rgba(170,100,220,0.5); box-shadow: 0 0 20px rgba(170,100,220,0.1); }

.nav-icon {
  font-size: 14px;
  opacity: 0.7;
}

/* ── Animations ── */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes sigil-pulse {
  0%, 100% { opacity: 0.4; letter-spacing: 0.3em; }
  50% { opacity: 0.9; letter-spacing: 0.45em; }
}

@keyframes shock-flare {
  0% { box-shadow: inset 0 0 40px rgba(80,120,200,0.05), 0 0 30px rgba(80,120,200,0.08); }
  50% { box-shadow: inset 0 0 80px rgba(80,120,200,0.15), 0 0 60px rgba(80,120,200,0.2); }
  100% { box-shadow: inset 0 0 40px rgba(80,120,200,0.05), 0 0 30px rgba(80,120,200,0.08); }
}

.moment-shock.visible { animation: shock-flare 4s ease-in-out infinite; }

@keyframes resolve-glow {
  0%, 100% { box-shadow: inset 0 0 50px rgba(200,164,106,0.06), 0 0 40px rgba(200,164,106,0.12); }
  50% { box-shadow: inset 0 0 80px rgba(200,164,106,0.12), 0 0 70px rgba(200,164,106,0.22); }
}
.moment-resolve.visible { animation: resolve-glow 3.5s ease-in-out infinite; }

@keyframes anger-pulse {
  0%, 100% { box-shadow: inset 0 0 40px rgba(200,60,60,0.05), 0 0 30px rgba(200,60,60,0.08); }
  50% { box-shadow: inset 0 0 60px rgba(200,60,60,0.12), 0 0 50px rgba(200,60,60,0.15); }
}
.moment-anger.visible { animation: anger-pulse 2.5s ease-in-out infinite; }

@keyframes krusch-glow {
  0%, 100% { box-shadow: inset 0 0 40px rgba(90,170,122,0.05), 0 0 30px rgba(90,170,122,0.08); }
  50% { box-shadow: inset 0 0 70px rgba(90,170,122,0.12), 0 0 50px rgba(90,170,122,0.15); }
}
.moment-krusch.visible { animation: krusch-glow 3s ease-in-out infinite; }

@keyframes eye-pulse {
  0%, 100% { filter: drop-shadow(0 0 14px rgba(255,200,40,0.6)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 30px rgba(255,220,60,0.95)) drop-shadow(0 0 50px rgba(200,140,0,0.5)); transform: scale(1.06); }
}

@keyframes return-glow {
  0%, 100% { text-shadow: 0 0 30px rgba(160,80,220,0.7), 0 0 60px rgba(80,40,140,0.4); }
  50% { text-shadow: 0 0 50px rgba(180,100,255,1), 0 0 90px rgba(100,50,180,0.7), 0 0 4px #fff; }
}

@keyframes ring-expand {
  0%   { width: 60px; height: 60px; opacity: 0.8; border-color: rgba(160,80,220,0.7); }
  100% { width: 320px; height: 320px; opacity: 0; border-color: rgba(80,20,140,0); }
}

/* ── Scroll indicator ── */
.scroll-down {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.scroll-chevron {
  width: 16px;
  height: 16px;
  border-right: 1px solid rgba(200,164,106,0.5);
  border-bottom: 1px solid rgba(200,164,106,0.5);
  transform: rotate(45deg);
  animation: bounce 1.5s ease-in-out infinite;
}
@keyframes bounce {
  0%,100% { transform: rotate(45deg) translateY(0); opacity: 0.4; }
  50% { transform: rotate(45deg) translateY(6px); opacity: 0.9; }
}

/* ── Witch cult / Dragon ── */
.cult-mention {
  color: var(--witch);
  font-style: normal;
  text-shadow: 0 0 8px rgba(144,64,160,0.3);
}

.dragon-mention {
  color: #d4a020;
  text-shadow: 0 0 8px rgba(200,150,0,0.3);
}

/* ── Footnote-style location ── */
.location-tag {
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.4em;
  color: rgba(200,164,106,0.35);
  padding: 8px 0 30px;
  text-transform: uppercase;
}

/* Responsive */
@media (max-width: 600px) {
  main { padding: 60px 20px 100px; }
  header { padding: 12px 20px; }
  .header-arc { display: none; }
  body { font-size: 17px; }
  .nav-buttons { padding: 40px 20px 80px; gap: 12px; }
  .nav-btn { padding: 12px 18px; font-size: 10px; }
  .chapter-kanji { font-size: 28px; letter-spacing: 0.25em; margin-bottom: 20px; }
  .moment,
  .dragon-eye-reveal,
  .return-block {
    margin: 1.7em 0;
    padding: 20px 20px 20px 24px;
    border-radius: 12px;
  }
  .moment-text,
  .dragon-eye-text,
  .return-text,
  .inner-fire {
    line-height: 1.72;
  }
}

.jp-minute{margin:28px 0;padding:14px 16px;border-left:3px solid var(--accent2);background:rgba(120,140,180,.08);border-radius:8px;}
.jp-minute-toggle{all:unset;cursor:pointer;display:flex;justify-content:space-between;gap:12px;width:100%;font-family:"Nunito",sans-serif;font-weight:600;color:var(--accent2);}
.jp-minute-content{margin-top:10px;overflow:hidden;max-height:0;opacity:0;transition:max-height .38s ease,opacity .28s ease;}
.jp-minute.open .jp-minute-content{opacity:1;}
.jp-minute-arrow{transition:transform .22s ease;}
.jp-minute.open .jp-minute-arrow{transform:rotate(180deg);}

.battle-beat{position:relative;padding-left:14px;border-left:2px solid rgba(210,90,70,.35);}
.battle-beat::before{content:"";position:absolute;left:-5px;top:0.8em;width:7px;height:7px;border-radius:50%;background:rgba(240,120,90,.55);box-shadow:0 0 12px rgba(240,120,90,.35);}
.battle-beat .moment-text{letter-spacing:.01em;}
.battle-spark{background:linear-gradient(90deg,rgba(210,90,70,.12),transparent 70%);border-radius:6px;padding:2px 6px;animation:sparkPulse 2.8s ease-in-out infinite;}
@keyframes sparkPulse{0%,100%{box-shadow:none;}50%{box-shadow:0 0 10px rgba(210,90,70,.22);}}
body.no-anim .battle-spark{animation:none;}

.archbishop-gluttony { color: #c8a070; text-shadow: 0 0 8px rgba(200,160,112,0.28); }
.blue-snake { color: #6eb6d8; text-shadow: 0 0 8px rgba(110,182,216,0.25); }
.black-dog { color: #9098aa; text-shadow: 0 0 8px rgba(144,152,170,0.22); }
.white-sheep { color: #e8e0d2; text-shadow: 0 0 8px rgba(232,224,210,0.22); }
body.light-theme .archbishop-gluttony { color: #8a6040; }
body.light-theme .blue-snake { color: #246a88; }
body.light-theme .black-dog { color: #4c5464; }
body.light-theme .white-sheep { color: #7a6a58; }

/* ===== 10-23.html ===== */
:root {
  --bg: #080c14;
  --bg2: #0e1320;
  --bg3: #13192e;
  --text: #ddd4c0;
  --text-dim: #8a8070;
  --accent: #c8a46a;
  --accent2: #7a9cc8;
  --divider: #2a3050;
  --ram: #e87aaa;
  --emilia: #aac8ec;
  --bordeaux: #d04040;
  --marcos: #8a9ab0;
  --fiore: #f0c060;
  --sakura: #c08ad0;
  --felt: #e8a050;
  --reinhard: #5090d8;
  --witch: #9040a0;
  --narrator: #ddd4c0;
  --krusch: #5aaa7a;
  --tiga: #d4a060;
  --beatrice: #b08adc;
  --subaru: #90b8e0;
}

/* ── Light theme overrides ── */
body.light-theme {
  --bg: #f0ebe0;
  --bg2: #e8e2d4;
  --bg3: #ddd7c8;
  --text: #1a1610;
  --text-dim: #6a5e4a;
  --accent: #8a5e1a;
  --accent2: #2a5888;
  --divider: #c8bca0;
}

body.light-theme header {
  background: rgba(240,235,224,0.97);
  border-bottom-color: rgba(138,94,26,0.15);
}

body.light-theme p.italic-narr {
  color: #3a3020;
}

body.light-theme p.thought {
  color: #4a3e2a;
  border-left-color: rgba(138,94,26,0.4);
}

body.light-theme .inner-fire {
  color: #5a3a10;
  border-left-color: var(--accent);
}

body.light-theme .moment-resolve {
  background: rgba(240,235,220,0.7);
  border-color: rgba(138,94,26,0.35);
}
body.light-theme .moment-resolve .moment-text { color: #2a1e08; }

body.light-theme .moment-shock {
  background: rgba(220,230,245,0.6);
  border-color: rgba(60,100,180,0.3);
}
body.light-theme .moment-shock .moment-text { color: #1a2a3a; }

body.light-theme .moment-anger {
  background: rgba(245,225,220,0.6);
  border-color: rgba(180,60,60,0.3);
}
body.light-theme .moment-anger .moment-text { color: #2a0808; }

body.light-theme .moment-heavy {
  background: rgba(220,225,235,0.6);
  border-color: rgba(80,90,120,0.3);
}
body.light-theme .moment-heavy .moment-text { color: #1a1e2a; }

body.light-theme .moment-warmth {
  background: rgba(245,235,240,0.6);
  border-color: rgba(200,100,140,0.3);
}
body.light-theme .moment-warmth .moment-text { color: #2a1020; }

body.light-theme .moment-krusch {
  background: rgba(220,240,230,0.6);
  border-color: rgba(60,140,90,0.3);
}
body.light-theme .moment-krusch .moment-text { color: #0a2a18; }

body.light-theme .dragon-eye-reveal {
  background: rgba(245,240,220,0.9);
  border-color: rgba(160,120,20,0.4);
}

body.light-theme .dragon-eye-text {
  color: #7a5000;
  text-shadow: 0 0 8px rgba(160,100,0,0.2);
}

body.light-theme .return-block {
  background: rgba(230,225,245,0.85);
  border-color: rgba(100,60,180,0.3);
}

body.light-theme .return-kanji {
  color: rgba(100,60,180,0.85);
  text-shadow: 0 0 20px rgba(100,60,180,0.4);
}

body.light-theme .return-label {
  color: rgba(100,60,180,0.6);
}

body.light-theme .return-text {
  color: #2a1a4a;
}

body.light-theme .nav-btn {
  background: rgba(230,224,210,0.8);
  border-color: rgba(138,94,26,0.25);
  color: var(--text-dim);
}

body.light-theme .nav-btn:hover {
  background: rgba(215,208,192,0.95);
}

body.light-theme .chapter-kanji {
  color: rgba(138,94,26,0.65);
}

body.light-theme .location-tag {
  color: rgba(138,94,26,0.7);
}

body.light-theme .scroll-hint,
body.light-theme .chapter-arc {
  color: #8a7a60;
}

body.light-theme .chapter-subtitle {
  color: #2a2010;
}

body.light-theme .scroll-chevron {
  border-right-color: rgba(100,70,20,0.5);
  border-bottom-color: rgba(100,70,20,0.5);
}

body.light-theme .divider-line {
  background: linear-gradient(90deg, transparent, rgba(138,94,26,0.5), transparent);
}

body.light-theme .divider-sigil {
  display: inline-block;
  text-align: center;
  color: rgba(138,94,26,0.8);
}

body.light-theme #canvas {
  opacity: 0.12;
}

/* Dialogue text — override the hardcoded !important */
body.light-theme .dialogue-text {
  color: #1a1610 !important;
}

/* Narration colours */
body.light-theme p.narr {
  color: #1a1610;
}

body.light-theme p.italic-narr {
  color: #3a3020;
}

body.light-theme p.thought {
  color: #4a3e2a;
  border-left-color: rgba(138,94,26,0.4);
}

/* Scene / pov labels */
body.light-theme .scene-label,
body.light-theme .pov-name {
  color: #8a7a60;
}

body.light-theme .pov-subtitle {
  color: rgba(138,94,26,0.55);
}

/* Dragon & cult inline mentions */
body.light-theme .dragon-mention {
  color: #8a5a00;
  text-shadow: 0 0 6px rgba(138,90,0,0.2);
}

body.light-theme .cult-mention {
  color: #6a3080;
  text-shadow: 0 0 6px rgba(106,48,128,0.2);
}


.archbishop-sloth { color: #9d77df; text-shadow: 0 0 8px rgba(157,119,223,0.28); }
.org-six-tongues { color: #d4a840; letter-spacing: 0.02em; text-shadow: 0 0 8px rgba(212,168,64,0.25); }

body.light-theme .archbishop-sloth { color: #6f3fc0; }
body.light-theme .org-six-tongues { color: #8a5e1a; }

/* ── Settings panel light ── */
body.light-theme #settings-panel {
  background: rgba(240,235,224,0.97);
  border-color: rgba(138,94,26,0.25);
}
body.light-theme .settings-title {
  color: var(--accent);
  border-bottom-color: rgba(138,94,26,0.2);
}
body.light-theme .settings-label { color: var(--text-dim); }
body.light-theme .settings-btn {
  background: rgba(220,214,200,0.8);
  border-color: rgba(138,94,26,0.2);
  color: var(--text);
}
body.light-theme .settings-btn:hover,
body.light-theme .settings-btn.active {
  background: rgba(138,94,26,0.15);
  border-color: rgba(138,94,26,0.5);
  color: var(--accent);
}
body.light-theme input[type="range"] { accent-color: var(--accent); }

/* ── Settings button group (bottom-left) ── */
#settings-controls {
  position: fixed;
  bottom: 32px;
  left: 32px;
  z-index: 200;
}

/* ── Settings toggle button ── */
#settings-toggle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(200,164,106,0.3);
  background: rgba(14,19,32,0.85);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(200,164,106,0.8);
  transition: background 0.4s ease, border-color 0.4s ease, transform 0.2s ease, box-shadow 0.3s ease, color 0.4s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  user-select: none;
}

#settings-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(0,0,0,0.5);
  border-color: rgba(200,164,106,0.6);
  color: rgba(200,164,106,1);
}

#settings-toggle:active { transform: scale(0.95); }
#settings-toggle.active {
  border-color: rgba(200,164,106,0.7);
  color: rgba(200,164,106,1);
  box-shadow: 0 0 20px rgba(200,164,106,0.2);
}

body.light-theme #settings-toggle {
  background: rgba(230,224,210,0.92);
  border-color: rgba(138,94,26,0.35);
  box-shadow: 0 4px 20px rgba(100,80,40,0.2);
  color: rgba(138,94,26,0.8);
}
body.light-theme #settings-toggle:hover {
  border-color: rgba(138,94,26,0.65);
  box-shadow: 0 6px 28px rgba(100,80,40,0.3);
  color: rgba(138,94,26,1);
}
body.light-theme #settings-toggle.active {
  border-color: rgba(138,94,26,0.7);
  color: rgba(138,94,26,1);
}

/* ── Settings panel ── */
#settings-panel {
  position: fixed;
  bottom: 110px;
  left: 32px;
  z-index: 199;
  width: 300px;
  background: rgba(8,12,20,0.96);
  border: 1px solid rgba(200,164,106,0.2);
  border-radius: 8px;
  padding: 20px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  transform: translateY(12px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#settings-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.settings-title {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(200,164,106,0.15);
}

.settings-group {
  margin-bottom: 16px;
}

.settings-label {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
  display: block;
}

.settings-btn-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.settings-btn {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 0.1em;
  padding: 6px 10px;
  border-radius: 3px;
  border: 1px solid rgba(200,164,106,0.2);
  background: rgba(20,25,40,0.8);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.settings-btn:hover {
  background: rgba(200,164,106,0.08);
  border-color: rgba(200,164,106,0.4);
  color: var(--accent);
}

.settings-btn.active {
  background: rgba(200,164,106,0.12);
  border-color: rgba(200,164,106,0.5);
  color: var(--accent);
}

.settings-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
  cursor: pointer;
  height: 3px;
}

.settings-slider-val {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  color: var(--accent);
  min-width: 36px;
  text-align: right;
  letter-spacing: 0.05em;
}

/* ── Animations disabled class ── */
body.no-anim .reveal {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

body.no-anim .chapter-kanji,
body.no-anim .chapter-arc,
body.no-anim .chapter-num,
body.no-anim .chapter-subtitle {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

body.no-anim .scroll-hint { animation: none !important; opacity: 0.5 !important; }
body.no-anim .divider-sigil {
  display: inline-block;
  text-align: center; animation: none !important; opacity: 0.7 !important; }
body.no-anim .moment-shock.visible { animation: none !important; }
body.no-anim .moment-resolve.visible { animation: none !important; }
body.no-anim .moment-anger.visible { animation: none !important; }
body.no-anim .scroll-chevron { animation: none !important; opacity: 0.5 !important; }

/* ── Theme toggle button ── */
#theme-toggle {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 200;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(200,164,106,0.3);
  background: rgba(14,19,32,0.85);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(200,164,106,0.8);
  transition: background 0.4s ease, border-color 0.4s ease, transform 0.2s ease, box-shadow 0.3s ease, color 0.4s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  user-select: none;
}

#theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(0,0,0,0.5);
  border-color: rgba(200,164,106,0.6);
  color: rgba(200,164,106,1);
}

#theme-toggle:active {
  transform: scale(0.95);
}

body.light-theme #theme-toggle {
  background: rgba(230,224,210,0.92);
  border-color: rgba(138,94,26,0.35);
  box-shadow: 0 4px 20px rgba(100,80,40,0.2);
  color: rgba(138,94,26,0.8);
}

body.light-theme #theme-toggle:hover {
  border-color: rgba(138,94,26,0.65);
  box-shadow: 0 6px 28px rgba(100,80,40,0.3);
  color: rgba(138,94,26,1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 19px;
  line-height: 1.85;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Ambient particles ── */
#canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

/* ── Progress bar ── */
#progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--krusch), var(--accent), var(--beatrice));
  width: 0%;
  z-index: 100;
  transition: width 0.1s linear;
}

/* ── Header ── */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 14px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(8,12,20,0.96);
  border-bottom: 1px solid rgba(200,164,106,0.1);
}

.header-arc {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.header-title {
  font-family: 'Cormorant SC', 'Cinzel', serif;
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--accent);
}

.header-pov {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--text-dim);
  transition: color 0.6s ease;
}

/* ── Chapter title block ── */
.chapter-title-block {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 40px;
}

.chapter-kanji {
  font-family: serif;
  font-size: 48px;
  color: rgba(200,164,106,0.25);
  letter-spacing: 0.4em;
  margin-bottom: 32px;
  animation: fadeSlideIn 2s ease forwards;
}

.chapter-arc {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 0.5em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 20px;
  animation: fadeSlideIn 2s ease 0.3s both;
}

.chapter-num {
  font-family: 'Cormorant SC', 'Cinzel Decorative', serif;
  font-size: clamp(28px, 5vw, 52px);
  color: var(--accent);
  line-height: 1.2;
  margin-bottom: 12px;
  animation: fadeSlideIn 2s ease 0.5s both;
  text-shadow: 0 0 60px rgba(200,164,106,0.3);
}

.chapter-subtitle {
  font-family: 'Cormorant Infant', 'EB Garamond', serif;
  font-style: italic;
  font-size: clamp(20px, 3vw, 32px);
  color: var(--text);
  margin-bottom: 60px;
  animation: fadeSlideIn 2s ease 0.8s both;
}

.scroll-hint {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.4em;
  color: var(--text-dim);
  text-transform: uppercase;
  animation: pulse 2.5s ease-in-out infinite;
}

/* ── Main content ── */
main {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 80px 40px 160px;
}

/* ── Paragraph reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Narration ── */
p.narr {
  margin-bottom: 1.3em;
  color: var(--text);
}

p.italic-narr {
  font-style: italic;
  color: #c8bcaa;
  margin-bottom: 1.3em;
}

p.thought {
  font-style: italic;
  color: #b0a898;
  padding-left: 20px;
  border-left: 2px solid rgba(200,164,106,0.3);
  margin: 1em 0 1.3em;
}

/* ── Dialogue ── */
.dialogue-block {
  margin: 0.4em 0 1.1em;
  position: relative;
}

.speaker-tag {
  display: none;
}

.dialogue-text {
  font-style: normal;
  color: #e0d8cc;
  display: block;
  padding-left: 4px;
}

.dialogue-text.emotional {
  font-style: italic;
}

.sp-ram { color: var(--ram); }
.sp-emilia { color: var(--emilia); }
.sp-bordeaux { color: var(--bordeaux); }
.sp-marcos { color: var(--marcos); }
.sp-fiore { color: var(--fiore); }
.sp-sakura { color: var(--sakura); }
.sp-felt { color: var(--felt); }
.sp-reinhard { color: var(--reinhard); }
.sp-official { color: #9aaabb; }
.sp-krusch { color: var(--krusch); }
.sp-tiga { color: var(--tiga); }
.sp-beatrice { color: var(--beatrice); }
.sp-subaru { color: var(--subaru); }
.sp-otto { color: #8cc878; }
.sp-garfiel { color: #d8b060; }
.sp-rem { color: #8ac8e8; }
.sp-petra { color: #e8b0c8; }
.sp-meili { color: #c8a0e8; }


/* ── Character colors stripped: dialogue colour-neutral ── */
.dialogue-text { color: #e0d8cc !important; }
/* ── Section divider ── */
.section-divider {
  text-align: center;
  padding: 50px 0;
  position: relative;
}

.divider-sigil {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  color: var(--accent);
  letter-spacing: 0.3em;
  display: inline-block;
  animation: sigil-pulse 3s ease-in-out infinite;
}

.divider-line {
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: 16px auto;
  width: 60%;
  opacity: 0.4;
}

/* ── Dramatic moments ── */
.moment,
.dragon-eye-reveal,
.return-block {
  --moment-accent: var(--accent);
  --moment-bg: rgba(15, 19, 32, 0.72);
  --moment-border: rgba(200, 164, 106, 0.22);
  position: relative;
  margin: 2.2em auto;
  padding: 24px 28px 24px 32px;
  max-width: 780px;
  border: 1px solid var(--moment-border);
  border-left: 4px solid var(--moment-accent);
  border-radius: 14px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--moment-accent) 14%, transparent), transparent 42%),
    var(--moment-bg);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  text-align: left;
}

.moment::before,
.dragon-eye-reveal::before,
.return-block::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.055), transparent 55%);
  opacity: 1;
  pointer-events: none;
}

.moment::after,
.dragon-eye-reveal::after,
.return-block::after {
  content: '';
  position: absolute;
  top: 18px;
  right: 20px;
  width: 34px;
  height: 2px;
  border-radius: 99px;
  background: var(--moment-accent);
  opacity: 0.45;
}

.moment-label { display: none; }

.moment-text,
.dragon-eye-text,
.return-text {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--text);
  font-family: inherit;
  font-size: 1em;
  line-height: 1.78;
  letter-spacing: 0.01em;
  text-shadow: none;
}

.moment-text + .moment-text,
.moment-text[style*="margin-top"] {
  margin-top: 0.85em !important;
}

.moment-shock { --moment-accent: #7a9cc8; --moment-bg: rgba(12, 22, 38, 0.76); --moment-border: rgba(122,156,200,0.28); }
.moment-anger { --moment-accent: #d06a6a; --moment-bg: rgba(36, 17, 17, 0.74); --moment-border: rgba(208,106,106,0.26); }
.moment-resolve { --moment-accent: #c8a46a; --moment-bg: rgba(32, 27, 17, 0.74); --moment-border: rgba(200,164,106,0.32); }
.moment-heavy { --moment-accent: #8a9ab0; --moment-bg: rgba(14, 17, 28, 0.78); --moment-border: rgba(138,154,176,0.25); }
.moment-warmth { --moment-accent: #e87aaa; --moment-bg: rgba(34, 18, 27, 0.72); --moment-border: rgba(232,122,170,0.25); }
.moment-krusch { --moment-accent: #5aaa7a; --moment-bg: rgba(10, 28, 18, 0.74); --moment-border: rgba(90,170,122,0.27); }
.moment-battle { --moment-accent: #d4a030; --moment-bg: rgba(35, 24, 7, 0.76); --moment-border: rgba(212,160,48,0.30); }

.moment-shock .moment-text,
.moment-anger .moment-text,
.moment-resolve .moment-text,
.moment-heavy .moment-text,
.moment-warmth .moment-text,
.moment-krusch .moment-text,
.moment-battle .moment-text {
  color: var(--text);
  font-style: normal;
}

/* ── Dragon Eye reveal ── */
.dragon-eye-reveal {
  --moment-accent: #d6ad3f;
  --moment-bg: rgba(26, 22, 12, 0.80);
  --moment-border: rgba(214, 173, 63, 0.35);
}

.dragon-eye-glyph {
  display: none;
}

.dragon-eye-text {
  color: #f1dfb2;
  font-style: normal;
}

/* ── Return from death animation ── */
.return-block {
  --moment-accent: #9d77df;
  --moment-bg: rgba(18, 14, 34, 0.82);
  --moment-border: rgba(157, 119, 223, 0.34);
  padding-top: 28px;
}

.return-vortex,
.return-ring {
  display: none;
}

.return-kanji {
  position: relative;
  z-index: 1;
  margin-bottom: 10px;
  color: rgba(205, 184, 244, 0.75);
  font-size: 30px;
  letter-spacing: 0.16em;
  text-shadow: none;
}

.return-label {
  position: relative;
  z-index: 1;
  margin-bottom: 14px;
  color: rgba(205, 184, 244, 0.72);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-shadow: none;
}

.return-text {
  color: var(--text);
}

/* ── Garfiel inner monologue ── */
.inner-fire {
  position: relative;
  margin: 1.8em auto;
  padding: 18px 24px 18px 28px;
  max-width: 760px;
  border-left: 4px solid var(--garfiel, var(--accent));
  border-radius: 0 12px 12px 0;
  background: rgba(212, 160, 64, 0.08);
  color: var(--text);
  font-size: 1em;
  line-height: 1.85;
  font-style: normal;
}

body.light-theme .moment,
body.light-theme .dragon-eye-reveal,
body.light-theme .return-block {
  --moment-bg: rgba(255, 252, 244, 0.78);
  --moment-border: color-mix(in srgb, var(--moment-accent) 38%, rgba(138,94,26,0.22));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--moment-accent) 12%, transparent), transparent 42%),
    var(--moment-bg);
  box-shadow: 0 10px 26px rgba(90, 70, 40, 0.12);
}

body.light-theme .moment-text,
body.light-theme .dragon-eye-text,
body.light-theme .return-text,
body.light-theme .moment-shock .moment-text,
body.light-theme .moment-anger .moment-text,
body.light-theme .moment-resolve .moment-text,
body.light-theme .moment-heavy .moment-text,
body.light-theme .moment-warmth .moment-text,
body.light-theme .moment-krusch .moment-text,
body.light-theme .moment-battle .moment-text {
  color: #1a1610;
}

body.light-theme .dragon-eye-text { color: #3c2b05; }
body.light-theme .return-kanji,
body.light-theme .return-label { color: rgba(76, 43, 132, 0.72); text-shadow: none; }
body.light-theme .inner-fire { color: #2a2010; background: rgba(212, 160, 64, 0.12); border-left-color: var(--accent); }

.moment-shock.visible,
.moment-resolve.visible,
.moment-anger.visible,
.moment-krusch.visible,
.moment-battle.visible,
.dragon-eye-glyph,
.return-kanji {
  animation: none !important;
}


body.plain-moments .moment,
body.plain-moments .dragon-eye-reveal,
body.plain-moments .return-block,
body.plain-moments .inner-fire {
  margin: 1em 0;
  padding: 0;
  max-width: none;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  overflow: visible;
  text-align: inherit;
}

body.plain-moments .moment::before,
body.plain-moments .moment::after,
body.plain-moments .dragon-eye-reveal::before,
body.plain-moments .dragon-eye-reveal::after,
body.plain-moments .return-block::before,
body.plain-moments .return-block::after,
body.plain-moments .dragon-eye-glyph,
body.plain-moments .return-vortex,
body.plain-moments .return-ring,
body.plain-moments .return-kanji,
body.plain-moments .return-label {
  display: none !important;
}

body.plain-moments .moment-text,
body.plain-moments .dragon-eye-text,
body.plain-moments .return-text {
  color: inherit;
  font: inherit;
  line-height: inherit;
  letter-spacing: inherit;
}

/* ── POV section headers ── */
.pov-header {
  display: none;
}
.pov-name {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.pov-subtitle {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 15px;
  color: rgba(200,164,106,0.5);
}

/* ── Scene label ── */
.scene-label {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: center;
  padding: 24px 0 8px;
  opacity: 0.6;
}

/* ── Navigation buttons ── */
.nav-buttons {
  position: relative;
  z-index: 10;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 60px 40px 100px;
  max-width: 760px;
  margin: 0 auto;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  padding: 14px 28px;
  border: 1px solid rgba(200,164,106,0.25);
  border-radius: 3px;
  background: rgba(8,12,20,0.7);
  transition: all 0.35s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.nav-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(200,164,106,0.06), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.nav-btn:hover::before {
  transform: translateX(100%);
}

.nav-btn:hover {
  color: var(--accent);
  border-color: rgba(200,164,106,0.55);
  box-shadow: 0 0 20px rgba(200,164,106,0.1);
  transform: translateY(-1px);
}

.nav-btn-prev { border-color: rgba(90,170,122,0.25); }
.nav-btn-prev:hover { color: var(--krusch); border-color: rgba(90,170,122,0.5); box-shadow: 0 0 20px rgba(90,170,122,0.1); }

.nav-btn-toc { border-color: rgba(200,164,106,0.25); }
.nav-btn-toc:hover { color: var(--accent); border-color: rgba(200,164,106,0.5); }

.nav-btn-next { border-color: rgba(170,100,220,0.25); }
.nav-btn-next:hover { color: var(--beatrice); border-color: rgba(170,100,220,0.5); box-shadow: 0 0 20px rgba(170,100,220,0.1); }

.nav-icon {
  font-size: 14px;
  opacity: 0.7;
}

/* ── Animations ── */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes sigil-pulse {
  0%, 100% { opacity: 0.4; letter-spacing: 0.3em; }
  50% { opacity: 0.9; letter-spacing: 0.45em; }
}

@keyframes shock-flare {
  0% { box-shadow: inset 0 0 40px rgba(80,120,200,0.05), 0 0 30px rgba(80,120,200,0.08); }
  50% { box-shadow: inset 0 0 80px rgba(80,120,200,0.15), 0 0 60px rgba(80,120,200,0.2); }
  100% { box-shadow: inset 0 0 40px rgba(80,120,200,0.05), 0 0 30px rgba(80,120,200,0.08); }
}

.moment-shock.visible { animation: shock-flare 4s ease-in-out infinite; }

@keyframes resolve-glow {
  0%, 100% { box-shadow: inset 0 0 50px rgba(200,164,106,0.06), 0 0 40px rgba(200,164,106,0.12); }
  50% { box-shadow: inset 0 0 80px rgba(200,164,106,0.12), 0 0 70px rgba(200,164,106,0.22); }
}
.moment-resolve.visible { animation: resolve-glow 3.5s ease-in-out infinite; }

@keyframes anger-pulse {
  0%, 100% { box-shadow: inset 0 0 40px rgba(200,60,60,0.05), 0 0 30px rgba(200,60,60,0.08); }
  50% { box-shadow: inset 0 0 60px rgba(200,60,60,0.12), 0 0 50px rgba(200,60,60,0.15); }
}
.moment-anger.visible { animation: anger-pulse 2.5s ease-in-out infinite; }

@keyframes krusch-glow {
  0%, 100% { box-shadow: inset 0 0 40px rgba(90,170,122,0.05), 0 0 30px rgba(90,170,122,0.08); }
  50% { box-shadow: inset 0 0 70px rgba(90,170,122,0.12), 0 0 50px rgba(90,170,122,0.15); }
}
.moment-krusch.visible { animation: krusch-glow 3s ease-in-out infinite; }

@keyframes eye-pulse {
  0%, 100% { filter: drop-shadow(0 0 14px rgba(255,200,40,0.6)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 30px rgba(255,220,60,0.95)) drop-shadow(0 0 50px rgba(200,140,0,0.5)); transform: scale(1.06); }
}

@keyframes return-glow {
  0%, 100% { text-shadow: 0 0 30px rgba(160,80,220,0.7), 0 0 60px rgba(80,40,140,0.4); }
  50% { text-shadow: 0 0 50px rgba(180,100,255,1), 0 0 90px rgba(100,50,180,0.7), 0 0 4px #fff; }
}

@keyframes ring-expand {
  0%   { width: 60px; height: 60px; opacity: 0.8; border-color: rgba(160,80,220,0.7); }
  100% { width: 320px; height: 320px; opacity: 0; border-color: rgba(80,20,140,0); }
}

/* ── Scroll indicator ── */
.scroll-down {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.scroll-chevron {
  width: 16px;
  height: 16px;
  border-right: 1px solid rgba(200,164,106,0.5);
  border-bottom: 1px solid rgba(200,164,106,0.5);
  transform: rotate(45deg);
  animation: bounce 1.5s ease-in-out infinite;
}
@keyframes bounce {
  0%,100% { transform: rotate(45deg) translateY(0); opacity: 0.4; }
  50% { transform: rotate(45deg) translateY(6px); opacity: 0.9; }
}

/* ── Witch cult / Dragon ── */
.cult-mention {
  color: var(--witch);
  font-style: normal;
  text-shadow: 0 0 8px rgba(144,64,160,0.3);
}

.dragon-mention {
  color: #d4a020;
  text-shadow: 0 0 8px rgba(200,150,0,0.3);
}

/* ── Footnote-style location ── */
.location-tag {
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.4em;
  color: rgba(200,164,106,0.35);
  padding: 8px 0 30px;
  text-transform: uppercase;
}

/* Responsive */
@media (max-width: 600px) {
  main { padding: 60px 20px 100px; }
  header { padding: 12px 20px; }
  .header-arc { display: none; }
  body { font-size: 17px; }
  .nav-buttons { padding: 40px 20px 80px; gap: 12px; }
  .nav-btn { padding: 12px 18px; font-size: 10px; }
  .chapter-kanji { font-size: 28px; letter-spacing: 0.25em; margin-bottom: 20px; }
  .moment,
  .dragon-eye-reveal,
  .return-block {
    margin: 1.7em 0;
    padding: 20px 20px 20px 24px;
    border-radius: 12px;
  }
  .moment-text,
  .dragon-eye-text,
  .return-text,
  .inner-fire {
    line-height: 1.72;
  }
}

.jp-minute{margin:28px 0;padding:14px 16px;border-left:3px solid var(--accent2);background:rgba(120,140,180,.08);border-radius:8px;}
.jp-minute-toggle{all:unset;cursor:pointer;display:flex;justify-content:space-between;gap:12px;width:100%;font-family:"Nunito",sans-serif;font-weight:600;color:var(--accent2);}
.jp-minute-content{margin-top:10px;overflow:hidden;max-height:0;opacity:0;transition:max-height .38s ease,opacity .28s ease;}
.jp-minute.open .jp-minute-content{opacity:1;}
.jp-minute-arrow{transition:transform .22s ease;}
.jp-minute.open .jp-minute-arrow{transform:rotate(180deg);}

.battle-beat{position:relative;padding-left:14px;border-left:2px solid rgba(210,90,70,.35);}
.battle-beat::before{content:"";position:absolute;left:-5px;top:0.8em;width:7px;height:7px;border-radius:50%;background:rgba(240,120,90,.55);box-shadow:0 0 12px rgba(240,120,90,.35);}
.battle-beat .moment-text{letter-spacing:.01em;}
.battle-spark{background:linear-gradient(90deg,rgba(210,90,70,.12),transparent 70%);border-radius:6px;padding:2px 6px;animation:sparkPulse 2.8s ease-in-out infinite;}
@keyframes sparkPulse{0%,100%{box-shadow:none;}50%{box-shadow:0 0 10px rgba(210,90,70,.22);}}
body.no-anim .battle-spark{animation:none;}

.archbishop-gluttony { color: #c8a070; text-shadow: 0 0 8px rgba(200,160,112,0.28); }
body.light-theme .archbishop-gluttony { color: #8a6040; }

/* ===== 10-24.html ===== */
:root {
  --bg: #080c14;
  --bg2: #0e1320;
  --bg3: #13192e;
  --text: #ddd4c0;
  --text-dim: #8a8070;
  --accent: #c8a46a;
  --accent2: #7a9cc8;
  --divider: #2a3050;
  --ram: #e87aaa;
  --emilia: #aac8ec;
  --bordeaux: #d04040;
  --marcos: #8a9ab0;
  --fiore: #f0c060;
  --sakura: #c08ad0;
  --felt: #e8a050;
  --reinhard: #5090d8;
  --witch: #9040a0;
  --narrator: #ddd4c0;
  --krusch: #5aaa7a;
  --tiga: #d4a060;
  --beatrice: #b08adc;
  --subaru: #90b8e0;
}

/* ── Light theme overrides ── */
body.light-theme {
  --bg: #f0ebe0;
  --bg2: #e8e2d4;
  --bg3: #ddd7c8;
  --text: #1a1610;
  --text-dim: #6a5e4a;
  --accent: #8a5e1a;
  --accent2: #2a5888;
  --divider: #c8bca0;
}

body.light-theme header {
  background: rgba(240,235,224,0.97);
  border-bottom-color: rgba(138,94,26,0.15);
}

body.light-theme p.italic-narr {
  color: #3a3020;
}

body.light-theme p.thought {
  color: #4a3e2a;
  border-left-color: rgba(138,94,26,0.4);
}

body.light-theme .inner-fire {
  color: #5a3a10;
  border-left-color: var(--accent);
}

body.light-theme .moment-resolve {
  background: rgba(240,235,220,0.7);
  border-color: rgba(138,94,26,0.35);
}
body.light-theme .moment-resolve .moment-text { color: #2a1e08; }

body.light-theme .moment-shock {
  background: rgba(220,230,245,0.6);
  border-color: rgba(60,100,180,0.3);
}
body.light-theme .moment-shock .moment-text { color: #1a2a3a; }

body.light-theme .moment-anger {
  background: rgba(245,225,220,0.6);
  border-color: rgba(180,60,60,0.3);
}
body.light-theme .moment-anger .moment-text { color: #2a0808; }

body.light-theme .moment-heavy {
  background: rgba(220,225,235,0.6);
  border-color: rgba(80,90,120,0.3);
}
body.light-theme .moment-heavy .moment-text { color: #1a1e2a; }

body.light-theme .moment-warmth {
  background: rgba(245,235,240,0.6);
  border-color: rgba(200,100,140,0.3);
}
body.light-theme .moment-warmth .moment-text { color: #2a1020; }

body.light-theme .moment-krusch {
  background: rgba(220,240,230,0.6);
  border-color: rgba(60,140,90,0.3);
}
body.light-theme .moment-krusch .moment-text { color: #0a2a18; }

body.light-theme .dragon-eye-reveal {
  background: rgba(245,240,220,0.9);
  border-color: rgba(160,120,20,0.4);
}

body.light-theme .dragon-eye-text {
  color: #7a5000;
  text-shadow: 0 0 8px rgba(160,100,0,0.2);
}

body.light-theme .return-block {
  background: rgba(230,225,245,0.85);
  border-color: rgba(100,60,180,0.3);
}

body.light-theme .return-kanji {
  color: rgba(100,60,180,0.85);
  text-shadow: 0 0 20px rgba(100,60,180,0.4);
}

body.light-theme .return-label {
  color: rgba(100,60,180,0.6);
}

body.light-theme .return-text {
  color: #2a1a4a;
}

body.light-theme .nav-btn {
  background: rgba(230,224,210,0.8);
  border-color: rgba(138,94,26,0.25);
  color: var(--text-dim);
}

body.light-theme .nav-btn:hover {
  background: rgba(215,208,192,0.95);
}

body.light-theme .chapter-kanji {
  color: rgba(138,94,26,0.65);
}

body.light-theme .location-tag {
  color: rgba(138,94,26,0.7);
}

body.light-theme .scroll-hint,
body.light-theme .chapter-arc {
  color: #8a7a60;
}

body.light-theme .chapter-subtitle {
  color: #2a2010;
}

body.light-theme .scroll-chevron {
  border-right-color: rgba(100,70,20,0.5);
  border-bottom-color: rgba(100,70,20,0.5);
}

body.light-theme .divider-line {
  background: linear-gradient(90deg, transparent, rgba(138,94,26,0.5), transparent);
}

body.light-theme .divider-sigil {
  display: inline-block;
  text-align: center;
  color: rgba(138,94,26,0.8);
}

body.light-theme #canvas {
  opacity: 0.12;
}

/* Dialogue text — override the hardcoded !important */
body.light-theme .dialogue-text {
  color: #1a1610 !important;
}

/* Narration colours */
body.light-theme p.narr {
  color: #1a1610;
}

body.light-theme p.italic-narr {
  color: #3a3020;
}

body.light-theme p.thought {
  color: #4a3e2a;
  border-left-color: rgba(138,94,26,0.4);
}

/* Scene / pov labels */
body.light-theme .scene-label,
body.light-theme .pov-name {
  color: #8a7a60;
}

body.light-theme .pov-subtitle {
  color: rgba(138,94,26,0.55);
}

/* Dragon & cult inline mentions */
body.light-theme .dragon-mention {
  color: #8a5a00;
  text-shadow: 0 0 6px rgba(138,90,0,0.2);
}

body.light-theme .cult-mention {
  color: #6a3080;
  text-shadow: 0 0 6px rgba(106,48,128,0.2);
}


.archbishop-sloth { color: #9d77df; text-shadow: 0 0 8px rgba(157,119,223,0.28); }
.org-six-tongues { color: #d4a840; letter-spacing: 0.02em; text-shadow: 0 0 8px rgba(212,168,64,0.25); }

body.light-theme .archbishop-sloth { color: #6f3fc0; }
body.light-theme .org-six-tongues { color: #8a5e1a; }

/* ── Settings panel light ── */
body.light-theme #settings-panel {
  background: rgba(240,235,224,0.97);
  border-color: rgba(138,94,26,0.25);
}
body.light-theme .settings-title {
  color: var(--accent);
  border-bottom-color: rgba(138,94,26,0.2);
}
body.light-theme .settings-label { color: var(--text-dim); }
body.light-theme .settings-btn {
  background: rgba(220,214,200,0.8);
  border-color: rgba(138,94,26,0.2);
  color: var(--text);
}
body.light-theme .settings-btn:hover,
body.light-theme .settings-btn.active {
  background: rgba(138,94,26,0.15);
  border-color: rgba(138,94,26,0.5);
  color: var(--accent);
}
body.light-theme input[type="range"] { accent-color: var(--accent); }

/* ── Settings button group (bottom-left) ── */
#settings-controls {
  position: fixed;
  bottom: 32px;
  left: 32px;
  z-index: 200;
}

/* ── Settings toggle button ── */
#settings-toggle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(200,164,106,0.3);
  background: rgba(14,19,32,0.85);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(200,164,106,0.8);
  transition: background 0.4s ease, border-color 0.4s ease, transform 0.2s ease, box-shadow 0.3s ease, color 0.4s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  user-select: none;
}

#settings-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(0,0,0,0.5);
  border-color: rgba(200,164,106,0.6);
  color: rgba(200,164,106,1);
}

#settings-toggle:active { transform: scale(0.95); }
#settings-toggle.active {
  border-color: rgba(200,164,106,0.7);
  color: rgba(200,164,106,1);
  box-shadow: 0 0 20px rgba(200,164,106,0.2);
}

body.light-theme #settings-toggle {
  background: rgba(230,224,210,0.92);
  border-color: rgba(138,94,26,0.35);
  box-shadow: 0 4px 20px rgba(100,80,40,0.2);
  color: rgba(138,94,26,0.8);
}
body.light-theme #settings-toggle:hover {
  border-color: rgba(138,94,26,0.65);
  box-shadow: 0 6px 28px rgba(100,80,40,0.3);
  color: rgba(138,94,26,1);
}
body.light-theme #settings-toggle.active {
  border-color: rgba(138,94,26,0.7);
  color: rgba(138,94,26,1);
}

/* ── Settings panel ── */
#settings-panel {
  position: fixed;
  bottom: 110px;
  left: 32px;
  z-index: 199;
  width: 300px;
  background: rgba(8,12,20,0.96);
  border: 1px solid rgba(200,164,106,0.2);
  border-radius: 8px;
  padding: 20px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  transform: translateY(12px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#settings-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.settings-title {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(200,164,106,0.15);
}

.settings-group {
  margin-bottom: 16px;
}

.settings-label {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
  display: block;
}

.settings-btn-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.settings-btn {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 0.1em;
  padding: 6px 10px;
  border-radius: 3px;
  border: 1px solid rgba(200,164,106,0.2);
  background: rgba(20,25,40,0.8);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.settings-btn:hover {
  background: rgba(200,164,106,0.08);
  border-color: rgba(200,164,106,0.4);
  color: var(--accent);
}

.settings-btn.active {
  background: rgba(200,164,106,0.12);
  border-color: rgba(200,164,106,0.5);
  color: var(--accent);
}

.settings-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
  cursor: pointer;
  height: 3px;
}

.settings-slider-val {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  color: var(--accent);
  min-width: 36px;
  text-align: right;
  letter-spacing: 0.05em;
}

/* ── Animations disabled class ── */
body.no-anim .reveal {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

body.no-anim .chapter-kanji,
body.no-anim .chapter-arc,
body.no-anim .chapter-num,
body.no-anim .chapter-subtitle {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

body.no-anim .scroll-hint { animation: none !important; opacity: 0.5 !important; }
body.no-anim .divider-sigil {
  display: inline-block;
  text-align: center; animation: none !important; opacity: 0.7 !important; }
body.no-anim .moment-shock.visible { animation: none !important; }
body.no-anim .moment-resolve.visible { animation: none !important; }
body.no-anim .moment-anger.visible { animation: none !important; }
body.no-anim .scroll-chevron { animation: none !important; opacity: 0.5 !important; }

/* ── Theme toggle button ── */
#theme-toggle {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 200;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(200,164,106,0.3);
  background: rgba(14,19,32,0.85);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(200,164,106,0.8);
  transition: background 0.4s ease, border-color 0.4s ease, transform 0.2s ease, box-shadow 0.3s ease, color 0.4s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  user-select: none;
}

#theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(0,0,0,0.5);
  border-color: rgba(200,164,106,0.6);
  color: rgba(200,164,106,1);
}

#theme-toggle:active {
  transform: scale(0.95);
}

body.light-theme #theme-toggle {
  background: rgba(230,224,210,0.92);
  border-color: rgba(138,94,26,0.35);
  box-shadow: 0 4px 20px rgba(100,80,40,0.2);
  color: rgba(138,94,26,0.8);
}

body.light-theme #theme-toggle:hover {
  border-color: rgba(138,94,26,0.65);
  box-shadow: 0 6px 28px rgba(100,80,40,0.3);
  color: rgba(138,94,26,1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 19px;
  line-height: 1.85;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Ambient particles ── */
#canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

/* ── Progress bar ── */
#progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--krusch), var(--accent), var(--beatrice));
  width: 0%;
  z-index: 100;
  transition: width 0.1s linear;
}

/* ── Header ── */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 14px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(8,12,20,0.96);
  border-bottom: 1px solid rgba(200,164,106,0.1);
}

.header-arc {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.header-title {
  font-family: 'Cormorant SC', 'Cinzel', serif;
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--accent);
}

.header-pov {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--text-dim);
  transition: color 0.6s ease;
}

/* ── Chapter title block ── */
.chapter-title-block {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 40px;
}

.chapter-kanji {
  font-family: serif;
  font-size: 48px;
  color: rgba(200,164,106,0.25);
  letter-spacing: 0.4em;
  margin-bottom: 32px;
  animation: fadeSlideIn 2s ease forwards;
}

.chapter-arc {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 0.5em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 20px;
  animation: fadeSlideIn 2s ease 0.3s both;
}

.chapter-num {
  font-family: 'Cormorant SC', 'Cinzel Decorative', serif;
  font-size: clamp(28px, 5vw, 52px);
  color: var(--accent);
  line-height: 1.2;
  margin-bottom: 12px;
  animation: fadeSlideIn 2s ease 0.5s both;
  text-shadow: 0 0 60px rgba(200,164,106,0.3);
}

.chapter-subtitle {
  font-family: 'Cormorant Infant', 'EB Garamond', serif;
  font-style: italic;
  font-size: clamp(20px, 3vw, 32px);
  color: var(--text);
  margin-bottom: 60px;
  animation: fadeSlideIn 2s ease 0.8s both;
}

.scroll-hint {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.4em;
  color: var(--text-dim);
  text-transform: uppercase;
  animation: pulse 2.5s ease-in-out infinite;
}

/* ── Main content ── */
main {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 80px 40px 160px;
}

/* ── Paragraph reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Narration ── */
p.narr {
  margin-bottom: 1.3em;
  color: var(--text);
}

p.italic-narr {
  font-style: italic;
  color: #c8bcaa;
  margin-bottom: 1.3em;
}

p.thought {
  font-style: italic;
  color: #b0a898;
  padding-left: 20px;
  border-left: 2px solid rgba(200,164,106,0.3);
  margin: 1em 0 1.3em;
}

/* ── Dialogue ── */
.dialogue-block {
  margin: 0.4em 0 1.1em;
  position: relative;
}

.speaker-tag {
  display: none;
}

.dialogue-text {
  font-style: normal;
  color: #e0d8cc;
  display: block;
  padding-left: 4px;
}

.dialogue-text.emotional {
  font-style: italic;
}

.sp-ram { color: var(--ram); }
.sp-emilia { color: var(--emilia); }
.sp-bordeaux { color: var(--bordeaux); }
.sp-marcos { color: var(--marcos); }
.sp-fiore { color: var(--fiore); }
.sp-sakura { color: var(--sakura); }
.sp-felt { color: var(--felt); }
.sp-reinhard { color: var(--reinhard); }
.sp-official { color: #9aaabb; }
.sp-krusch { color: var(--krusch); }
.sp-tiga { color: var(--tiga); }
.sp-beatrice { color: var(--beatrice); }
.sp-subaru { color: var(--subaru); }
.sp-otto { color: #8cc878; }
.sp-garfiel { color: #d8b060; }
.sp-rem { color: #8ac8e8; }
.sp-petra { color: #e8b0c8; }
.sp-meili { color: #c8a0e8; }

/* ── Chapter illustrations ── */
.chapter-illustration {
  margin: 2.4em auto;
  text-align: center;
}

.chapter-illustration img {
  display: block;
  width: min(100%, 720px);
  height: auto;
  margin: 0 auto;
  border-radius: 16px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
}

/* ── Character colors stripped: dialogue colour-neutral ── */
.dialogue-text { color: #e0d8cc !important; }
/* ── Section divider ── */
.section-divider {
  text-align: center;
  padding: 50px 0;
  position: relative;
}

.divider-sigil {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  color: var(--accent);
  letter-spacing: 0.3em;
  display: inline-block;
  animation: sigil-pulse 3s ease-in-out infinite;
}

.divider-line {
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: 16px auto;
  width: 60%;
  opacity: 0.4;
}

/* ── Dramatic moments ── */
.moment,
.dragon-eye-reveal,
.return-block {
  --moment-accent: var(--accent);
  --moment-bg: rgba(15, 19, 32, 0.72);
  --moment-border: rgba(200, 164, 106, 0.22);
  position: relative;
  margin: 2.2em auto;
  padding: 24px 28px 24px 32px;
  max-width: 780px;
  border: 1px solid var(--moment-border);
  border-left: 4px solid var(--moment-accent);
  border-radius: 14px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--moment-accent) 14%, transparent), transparent 42%),
    var(--moment-bg);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  text-align: left;
}

.moment::before,
.dragon-eye-reveal::before,
.return-block::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.055), transparent 55%);
  opacity: 1;
  pointer-events: none;
}

.moment::after,
.dragon-eye-reveal::after,
.return-block::after {
  content: '';
  position: absolute;
  top: 18px;
  right: 20px;
  width: 34px;
  height: 2px;
  border-radius: 99px;
  background: var(--moment-accent);
  opacity: 0.45;
}

.moment-label { display: none; }

.moment-text,
.dragon-eye-text,
.return-text {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--text);
  font-family: inherit;
  font-size: 1em;
  line-height: 1.78;
  letter-spacing: 0.01em;
  text-shadow: none;
}

.moment-text + .moment-text,
.moment-text[style*="margin-top"] {
  margin-top: 0.85em !important;
}

.moment-shock { --moment-accent: #7a9cc8; --moment-bg: rgba(12, 22, 38, 0.76); --moment-border: rgba(122,156,200,0.28); }
.moment-anger { --moment-accent: #d06a6a; --moment-bg: rgba(36, 17, 17, 0.74); --moment-border: rgba(208,106,106,0.26); }
.moment-resolve { --moment-accent: #c8a46a; --moment-bg: rgba(32, 27, 17, 0.74); --moment-border: rgba(200,164,106,0.32); }
.moment-heavy { --moment-accent: #8a9ab0; --moment-bg: rgba(14, 17, 28, 0.78); --moment-border: rgba(138,154,176,0.25); }
.moment-warmth { --moment-accent: #e87aaa; --moment-bg: rgba(34, 18, 27, 0.72); --moment-border: rgba(232,122,170,0.25); }
.moment-krusch { --moment-accent: #5aaa7a; --moment-bg: rgba(10, 28, 18, 0.74); --moment-border: rgba(90,170,122,0.27); }
.moment-battle { --moment-accent: #d4a030; --moment-bg: rgba(35, 24, 7, 0.76); --moment-border: rgba(212,160,48,0.30); }

.moment-shock .moment-text,
.moment-anger .moment-text,
.moment-resolve .moment-text,
.moment-heavy .moment-text,
.moment-warmth .moment-text,
.moment-krusch .moment-text,
.moment-battle .moment-text {
  color: var(--text);
  font-style: normal;
}

/* ── Dragon Eye reveal ── */
.dragon-eye-reveal {
  --moment-accent: #d6ad3f;
  --moment-bg: rgba(26, 22, 12, 0.80);
  --moment-border: rgba(214, 173, 63, 0.35);
}

.dragon-eye-glyph {
  display: none;
}

.dragon-eye-text {
  color: #f1dfb2;
  font-style: normal;
}

/* ── Return from death animation ── */
.return-block {
  --moment-accent: #9d77df;
  --moment-bg: rgba(18, 14, 34, 0.82);
  --moment-border: rgba(157, 119, 223, 0.34);
  padding-top: 28px;
}

.return-vortex,
.return-ring {
  display: none;
}

.return-kanji {
  position: relative;
  z-index: 1;
  margin-bottom: 10px;
  color: rgba(205, 184, 244, 0.75);
  font-size: 30px;
  letter-spacing: 0.16em;
  text-shadow: none;
}

.return-label {
  position: relative;
  z-index: 1;
  margin-bottom: 14px;
  color: rgba(205, 184, 244, 0.72);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-shadow: none;
}

.return-text {
  color: var(--text);
}

/* ── Garfiel inner monologue ── */
.inner-fire {
  position: relative;
  margin: 1.8em auto;
  padding: 18px 24px 18px 28px;
  max-width: 760px;
  border-left: 4px solid var(--garfiel, var(--accent));
  border-radius: 0 12px 12px 0;
  background: rgba(212, 160, 64, 0.08);
  color: var(--text);
  font-size: 1em;
  line-height: 1.85;
  font-style: normal;
}

body.light-theme .moment,
body.light-theme .dragon-eye-reveal,
body.light-theme .return-block {
  --moment-bg: rgba(255, 252, 244, 0.78);
  --moment-border: color-mix(in srgb, var(--moment-accent) 38%, rgba(138,94,26,0.22));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--moment-accent) 12%, transparent), transparent 42%),
    var(--moment-bg);
  box-shadow: 0 10px 26px rgba(90, 70, 40, 0.12);
}

body.light-theme .moment-text,
body.light-theme .dragon-eye-text,
body.light-theme .return-text,
body.light-theme .moment-shock .moment-text,
body.light-theme .moment-anger .moment-text,
body.light-theme .moment-resolve .moment-text,
body.light-theme .moment-heavy .moment-text,
body.light-theme .moment-warmth .moment-text,
body.light-theme .moment-krusch .moment-text,
body.light-theme .moment-battle .moment-text {
  color: #1a1610;
}

body.light-theme .dragon-eye-text { color: #3c2b05; }
body.light-theme .return-kanji,
body.light-theme .return-label { color: rgba(76, 43, 132, 0.72); text-shadow: none; }
body.light-theme .inner-fire { color: #2a2010; background: rgba(212, 160, 64, 0.12); border-left-color: var(--accent); }

.moment-shock.visible,
.moment-resolve.visible,
.moment-anger.visible,
.moment-krusch.visible,
.moment-battle.visible,
.dragon-eye-glyph,
.return-kanji {
  animation: none !important;
}


body.plain-moments .moment,
body.plain-moments .dragon-eye-reveal,
body.plain-moments .return-block,
body.plain-moments .inner-fire {
  margin: 1em 0;
  padding: 0;
  max-width: none;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  overflow: visible;
  text-align: inherit;
}

body.plain-moments .moment::before,
body.plain-moments .moment::after,
body.plain-moments .dragon-eye-reveal::before,
body.plain-moments .dragon-eye-reveal::after,
body.plain-moments .return-block::before,
body.plain-moments .return-block::after,
body.plain-moments .dragon-eye-glyph,
body.plain-moments .return-vortex,
body.plain-moments .return-ring,
body.plain-moments .return-kanji,
body.plain-moments .return-label {
  display: none !important;
}

body.plain-moments .moment-text,
body.plain-moments .dragon-eye-text,
body.plain-moments .return-text {
  color: inherit;
  font: inherit;
  line-height: inherit;
  letter-spacing: inherit;
}

/* ── POV section headers ── */
.pov-header {
  display: none;
}
.pov-name {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.pov-subtitle {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 15px;
  color: rgba(200,164,106,0.5);
}

/* ── Scene label ── */
.scene-label {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: center;
  padding: 24px 0 8px;
  opacity: 0.6;
}

/* ── Navigation buttons ── */
.nav-buttons {
  position: relative;
  z-index: 10;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 60px 40px 100px;
  max-width: 760px;
  margin: 0 auto;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  padding: 14px 28px;
  border: 1px solid rgba(200,164,106,0.25);
  border-radius: 3px;
  background: rgba(8,12,20,0.7);
  transition: all 0.35s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.nav-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(200,164,106,0.06), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.nav-btn:hover::before {
  transform: translateX(100%);
}

.nav-btn:hover {
  color: var(--accent);
  border-color: rgba(200,164,106,0.55);
  box-shadow: 0 0 20px rgba(200,164,106,0.1);
  transform: translateY(-1px);
}

.nav-btn-prev { border-color: rgba(90,170,122,0.25); }
.nav-btn-prev:hover { color: var(--krusch); border-color: rgba(90,170,122,0.5); box-shadow: 0 0 20px rgba(90,170,122,0.1); }

.nav-btn-toc { border-color: rgba(200,164,106,0.25); }
.nav-btn-toc:hover { color: var(--accent); border-color: rgba(200,164,106,0.5); }

.nav-btn-next { border-color: rgba(170,100,220,0.25); }
.nav-btn-next:hover { color: var(--beatrice); border-color: rgba(170,100,220,0.5); box-shadow: 0 0 20px rgba(170,100,220,0.1); }

.nav-icon {
  font-size: 14px;
  opacity: 0.7;
}

/* ── Animations ── */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes sigil-pulse {
  0%, 100% { opacity: 0.4; letter-spacing: 0.3em; }
  50% { opacity: 0.9; letter-spacing: 0.45em; }
}

@keyframes shock-flare {
  0% { box-shadow: inset 0 0 40px rgba(80,120,200,0.05), 0 0 30px rgba(80,120,200,0.08); }
  50% { box-shadow: inset 0 0 80px rgba(80,120,200,0.15), 0 0 60px rgba(80,120,200,0.2); }
  100% { box-shadow: inset 0 0 40px rgba(80,120,200,0.05), 0 0 30px rgba(80,120,200,0.08); }
}

.moment-shock.visible { animation: shock-flare 4s ease-in-out infinite; }

@keyframes resolve-glow {
  0%, 100% { box-shadow: inset 0 0 50px rgba(200,164,106,0.06), 0 0 40px rgba(200,164,106,0.12); }
  50% { box-shadow: inset 0 0 80px rgba(200,164,106,0.12), 0 0 70px rgba(200,164,106,0.22); }
}
.moment-resolve.visible { animation: resolve-glow 3.5s ease-in-out infinite; }

@keyframes anger-pulse {
  0%, 100% { box-shadow: inset 0 0 40px rgba(200,60,60,0.05), 0 0 30px rgba(200,60,60,0.08); }
  50% { box-shadow: inset 0 0 60px rgba(200,60,60,0.12), 0 0 50px rgba(200,60,60,0.15); }
}
.moment-anger.visible { animation: anger-pulse 2.5s ease-in-out infinite; }

@keyframes krusch-glow {
  0%, 100% { box-shadow: inset 0 0 40px rgba(90,170,122,0.05), 0 0 30px rgba(90,170,122,0.08); }
  50% { box-shadow: inset 0 0 70px rgba(90,170,122,0.12), 0 0 50px rgba(90,170,122,0.15); }
}
.moment-krusch.visible { animation: krusch-glow 3s ease-in-out infinite; }

@keyframes eye-pulse {
  0%, 100% { filter: drop-shadow(0 0 14px rgba(255,200,40,0.6)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 30px rgba(255,220,60,0.95)) drop-shadow(0 0 50px rgba(200,140,0,0.5)); transform: scale(1.06); }
}

@keyframes return-glow {
  0%, 100% { text-shadow: 0 0 30px rgba(160,80,220,0.7), 0 0 60px rgba(80,40,140,0.4); }
  50% { text-shadow: 0 0 50px rgba(180,100,255,1), 0 0 90px rgba(100,50,180,0.7), 0 0 4px #fff; }
}

@keyframes ring-expand {
  0%   { width: 60px; height: 60px; opacity: 0.8; border-color: rgba(160,80,220,0.7); }
  100% { width: 320px; height: 320px; opacity: 0; border-color: rgba(80,20,140,0); }
}

/* ── Scroll indicator ── */
.scroll-down {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.scroll-chevron {
  width: 16px;
  height: 16px;
  border-right: 1px solid rgba(200,164,106,0.5);
  border-bottom: 1px solid rgba(200,164,106,0.5);
  transform: rotate(45deg);
  animation: bounce 1.5s ease-in-out infinite;
}
@keyframes bounce {
  0%,100% { transform: rotate(45deg) translateY(0); opacity: 0.4; }
  50% { transform: rotate(45deg) translateY(6px); opacity: 0.9; }
}

/* ── Witch cult / Dragon ── */
.cult-mention {
  color: var(--witch);
  font-style: normal;
  text-shadow: 0 0 8px rgba(144,64,160,0.3);
}

.dragon-mention {
  color: #d4a020;
  text-shadow: 0 0 8px rgba(200,150,0,0.3);
}

/* ── Footnote-style location ── */
.location-tag {
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.4em;
  color: rgba(200,164,106,0.35);
  padding: 8px 0 30px;
  text-transform: uppercase;
}

/* Responsive */
@media (max-width: 600px) {
  main { padding: 60px 20px 100px; }
  header { padding: 12px 20px; }
  .header-arc { display: none; }
  body { font-size: 17px; }
  .nav-buttons { padding: 40px 20px 80px; gap: 12px; }
  .nav-btn { padding: 12px 18px; font-size: 10px; }
  .chapter-kanji { font-size: 28px; letter-spacing: 0.25em; margin-bottom: 20px; }
  .moment,
  .dragon-eye-reveal,
  .return-block {
    margin: 1.7em 0;
    padding: 20px 20px 20px 24px;
    border-radius: 12px;
  }
  .moment-text,
  .dragon-eye-text,
  .return-text,
  .inner-fire {
    line-height: 1.72;
  }
}

.jp-minute{margin:28px 0;padding:14px 16px;border-left:3px solid var(--accent2);background:rgba(120,140,180,.08);border-radius:8px;}
.jp-minute-toggle{all:unset;cursor:pointer;display:flex;justify-content:space-between;gap:12px;width:100%;font-family:"Nunito",sans-serif;font-weight:600;color:var(--accent2);}
.jp-minute-content{margin-top:10px;overflow:hidden;max-height:0;opacity:0;transition:max-height .38s ease,opacity .28s ease;}
.jp-minute.open .jp-minute-content{opacity:1;}
.jp-minute-arrow{transition:transform .22s ease;}
.jp-minute.open .jp-minute-arrow{transform:rotate(180deg);}

.battle-beat{position:relative;padding-left:14px;border-left:2px solid rgba(210,90,70,.35);}
.battle-beat::before{content:"";position:absolute;left:-5px;top:0.8em;width:7px;height:7px;border-radius:50%;background:rgba(240,120,90,.55);box-shadow:0 0 12px rgba(240,120,90,.35);}
.battle-beat .moment-text{letter-spacing:.01em;}
.battle-spark{background:linear-gradient(90deg,rgba(210,90,70,.12),transparent 70%);border-radius:6px;padding:2px 6px;animation:sparkPulse 2.8s ease-in-out infinite;}
@keyframes sparkPulse{0%,100%{box-shadow:none;}50%{box-shadow:0 0 10px rgba(210,90,70,.22);}}
body.no-anim .battle-spark{animation:none;}

.archbishop-gluttony { color: #c8a070; text-shadow: 0 0 8px rgba(200,160,112,0.28); }
body.light-theme .archbishop-gluttony { color: #8a6040; }

/* ===== index.html ===== */
:root {
  --bg: #080c14;
  --bg2: #0e1320;
  --bg3: #13192e;
  --text: #ddd4c0;
  --text-dim: #8a8070;
  --accent: #c8a46a;
  --accent2: #7a9cc8;
  --divider: #2a3050;
  --ram: #e87aaa;
  --emilia: #aac8ec;
  --bordeaux: #d04040;
  --marcos: #8a9ab0;
  --fiore: #f0c060;
  --sakura: #c08ad0;
  --felt: #e8a050;
  --reinhard: #5090d8;
  --witch: #9040a0;
  --lion: #d4a840;
  --ice: #90c0e0;
}

/* ── Light theme overrides ── */
body.light-theme {
  --bg: #f0ebe0;
  --bg2: #e8e2d4;
  --bg3: #ddd7c8;
  --text: #1a1610;
  --text-dim: #6a5e4a;
  --accent: #8a5e1a;
  --accent2: #2a5888;
  --divider: #c8bca0;
}

body.light-theme header {
  background: rgba(240,235,224,0.97);
  border-bottom-color: rgba(138,94,26,0.15);
}

body.light-theme .synopsis-block {
  background: rgba(232,226,212,0.85);
  border-color: rgba(138,94,26,0.2);
  box-shadow: 0 0 50px rgba(138,94,26,0.04);
}

body.light-theme .synopsis-text {
  color: #3a3020;
}

body.light-theme .chapter-card {
  background: rgba(220,214,200,0.7);
  border-color: rgba(180,168,140,0.7);
}

body.light-theme .chapter-card.available {
  border-color: rgba(138,94,26,0.3);
}

body.light-theme .chapter-card.available:hover {
  background: rgba(208,200,184,0.9);
  border-color: rgba(138,94,26,0.55);
  box-shadow: 0 0 30px rgba(138,94,26,0.08);
}

body.light-theme .card-num {
  background: rgba(240,235,224,0.5);
  border-right-color: rgba(180,168,140,0.7);
}

body.light-theme .chapter-card.available .card-num {
  border-right-color: rgba(138,94,26,0.2);
}

body.light-theme .card-title {
  color: #4a3e2a;
}

body.light-theme .chapter-card.available .card-title {
  color: #1a1610;
}

body.light-theme .chapter-card.available:hover .card-title {
  color: #0a0800;
}

body.light-theme .status-locked {
  color: rgba(100,90,70,0.55);
}

body.light-theme .arc-quote {
  color: #3a3020;
  border-left-color: rgba(138,94,26,0.5);
}

body.light-theme p.italic-narr {
  color: #3a3020;
}

body.light-theme #canvas {
  opacity: 0.12;
}

/* Кандзи на титульном экране */
body.light-theme .arc-kanji {
  color: rgba(100,70,20,0.45);
}

/* Метка «Об арке» */
body.light-theme .synopsis-label {
  color: rgba(100,70,20,0.7);
}

/* «Тома 44 · 45 · 46 · XX» */
body.light-theme .volume-tag {
  color: rgba(100,70,20,0.55);
}

/* Подзаголовок арки */
body.light-theme .arc-label {
  color: #7a6a50;
}

body.light-theme .arc-num {
  text-shadow: 0 0 60px rgba(100,70,20,0.25);
}

/* Dim-надписи */
body.light-theme .scroll-hint,
body.light-theme .header-arc,
body.light-theme .header-pov,
body.light-theme .phase-label,
body.light-theme .characters-label {
  color: #8a7a60;
}

/* Разделитель */
body.light-theme .divider-line {
  background: linear-gradient(90deg, transparent, rgba(138,94,26,0.5), transparent);
}

body.light-theme .divider-sigil {
  color: rgba(138,94,26,0.8);
}

/* Шеврон прокрутки */
body.light-theme .scroll-chevron {
  border-right-color: rgba(100,70,20,0.5);
  border-bottom-color: rgba(100,70,20,0.5);
}

/* Подпись в конце страницы */
body.light-theme .arc-end-mark .label {
  color: #8a7a60;
}

/* Статус «Читать» */
body.light-theme .status-available {
  color: rgba(138,94,26,0.75);
}

/* Стрелка на карточке */
body.light-theme .card-arrow {
  color: rgba(138,94,26,0.5);
}

/* Иконка замка */
body.light-theme .card-lock {
  color: rgba(120,100,70,0.45);
}


/* ── Settings panel light ── */
body.light-theme #settings-panel {
  background: rgba(240,235,224,0.97);
  border-color: rgba(138,94,26,0.25);
}
body.light-theme .settings-title {
  color: var(--accent);
  border-bottom-color: rgba(138,94,26,0.2);
}
body.light-theme .settings-label { color: var(--text-dim); }
body.light-theme .settings-btn {
  background: rgba(220,214,200,0.8);
  border-color: rgba(138,94,26,0.2);
  color: var(--text);
}
body.light-theme .settings-btn:hover,
body.light-theme .settings-btn.active {
  background: rgba(138,94,26,0.15);
  border-color: rgba(138,94,26,0.5);
  color: var(--accent);
}
body.light-theme input[type="range"] { accent-color: var(--accent); }

/* ── Settings button group (bottom-left) ── */
#settings-controls {
  position: fixed;
  bottom: 32px;
  left: 32px;
  z-index: 200;
}

/* ── Theme toggle button ── */
#theme-toggle {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 200;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(200,164,106,0.3);
  background: rgba(14,19,32,0.85);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(200,164,106,0.8);
  transition: background 0.4s ease, border-color 0.4s ease, transform 0.2s ease, box-shadow 0.3s ease, color 0.4s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  user-select: none;
}

#theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(0,0,0,0.5);
  border-color: rgba(200,164,106,0.6);
  color: rgba(200,164,106,1);
}

#theme-toggle:active {
  transform: scale(0.95);
}

body.light-theme #theme-toggle {
  background: rgba(230,224,210,0.92);
  border-color: rgba(138,94,26,0.35);
  box-shadow: 0 4px 20px rgba(100,80,40,0.2);
  color: rgba(138,94,26,0.8);
}

body.light-theme #theme-toggle:hover {
  border-color: rgba(138,94,26,0.65);
  box-shadow: 0 6px 28px rgba(100,80,40,0.3);
  color: rgba(138,94,26,1);
}

/* ── Settings toggle button ── */
#settings-toggle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(200,164,106,0.3);
  background: rgba(14,19,32,0.85);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(200,164,106,0.8);
  transition: background 0.4s ease, border-color 0.4s ease, transform 0.2s ease, box-shadow 0.3s ease, color 0.4s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  user-select: none;
}

#settings-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(0,0,0,0.5);
  border-color: rgba(200,164,106,0.6);
  color: rgba(200,164,106,1);
}

#settings-toggle:active { transform: scale(0.95); }
#settings-toggle.active {
  border-color: rgba(200,164,106,0.7);
  color: rgba(200,164,106,1);
  box-shadow: 0 0 20px rgba(200,164,106,0.2);
}

body.light-theme #settings-toggle {
  background: rgba(230,224,210,0.92);
  border-color: rgba(138,94,26,0.35);
  box-shadow: 0 4px 20px rgba(100,80,40,0.2);
  color: rgba(138,94,26,0.8);
}
body.light-theme #settings-toggle:hover {
  border-color: rgba(138,94,26,0.65);
  box-shadow: 0 6px 28px rgba(100,80,40,0.3);
  color: rgba(138,94,26,1);
}
body.light-theme #settings-toggle.active {
  border-color: rgba(138,94,26,0.7);
  color: rgba(138,94,26,1);
}

/* ── Settings panel ── */
#settings-panel {
  position: fixed;
  bottom: 110px;
  left: 32px;
  z-index: 199;
  width: 300px;
  background: rgba(8,12,20,0.96);
  border: 1px solid rgba(200,164,106,0.2);
  border-radius: 8px;
  padding: 20px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  transform: translateY(12px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#settings-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.settings-title {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(200,164,106,0.15);
}

.settings-group { margin-bottom: 16px; }

.settings-label {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
  display: block;
}

.settings-btn-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.settings-btn {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 0.1em;
  padding: 6px 10px;
  border-radius: 3px;
  border: 1px solid rgba(200,164,106,0.2);
  background: rgba(20,25,40,0.8);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.settings-btn:hover {
  background: rgba(200,164,106,0.08);
  border-color: rgba(200,164,106,0.4);
  color: var(--accent);
}

.settings-btn.active {
  background: rgba(200,164,106,0.12);
  border-color: rgba(200,164,106,0.5);
  color: var(--accent);
}

.settings-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
  cursor: pointer;
  height: 3px;
}

.settings-slider-val {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  color: var(--accent);
  min-width: 36px;
  text-align: right;
  letter-spacing: 0.05em;
}

/* ── Animations disabled class ── */
body.no-anim .reveal {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

body.no-anim .arc-kanji,
body.no-anim .arc-label,
body.no-anim .arc-num,
body.no-anim .arc-title,
body.no-anim .arc-tagline,
body.no-anim .scroll-hint,
body.no-anim .divider-sigil,
body.no-anim .scroll-chevron {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  --reader-font: 'EB Garamond', Georgia, serif;
  background: var(--bg);
  color: var(--text);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 19px;
  line-height: 1.85;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Ambient particles ── */
#canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

/* ── Progress bar ── */
#progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--lion), var(--accent), var(--ice));
  width: 0%;
  z-index: 100;
  transition: width 0.1s linear;
}

/* ── Header ── */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 14px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(8,12,20,0.96);
  border-bottom: 1px solid rgba(200,164,106,0.1);
}

.header-arc {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.header-title {
  font-family: 'Cormorant SC', 'Cinzel', serif;
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--accent);
}

.header-pov {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--text-dim);
}

/* ── Title block ── */
.arc-title-block {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 40px;
}

.arc-kanji {
  font-family: serif;
  font-size: 52px;
  color: rgba(212,168,64,0.2);
  letter-spacing: 0.5em;
  margin-bottom: 36px;
  animation: fadeSlideIn 2s ease forwards;
}

.arc-label {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 0.5em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 20px;
  animation: fadeSlideIn 2s ease 0.3s both;
}

.arc-num {
  font-family: 'Cormorant SC', 'Cinzel Decorative', serif;
  font-size: clamp(26px, 4.5vw, 48px);
  color: var(--accent);
  line-height: 1.2;
  margin-bottom: 16px;
  animation: fadeSlideIn 2s ease 0.5s both;
  text-shadow: 0 0 60px rgba(212,168,64,0.4);
}

.arc-title {
  font-family: 'Cormorant Infant', 'EB Garamond', serif;
  font-style: italic;
  font-size: clamp(22px, 3.5vw, 38px);
  color: var(--text);
  margin-bottom: 28px;
  animation: fadeSlideIn 2s ease 0.8s both;
}

.arc-tagline {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 15px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  margin-bottom: 70px;
  animation: fadeSlideIn 2s ease 1.1s both;
}

.scroll-hint {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.4em;
  color: var(--text-dim);
  text-transform: uppercase;
  animation: pulse 2.5s ease-in-out infinite;
}

.scroll-down {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.scroll-chevron {
  width: 16px;
  height: 16px;
  border-right: 1px solid rgba(212,168,64,0.5);
  border-bottom: 1px solid rgba(212,168,64,0.5);
  transform: rotate(45deg);
  animation: bounce 1.5s ease-in-out infinite;
}

/* ── Main content ── */
main {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: 80px 40px 160px;
}

/* ── Reveal ── */
.reveal {
  opacity: 0 !important;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  will-change: opacity, transform;
}
.reveal.visible {
  opacity: var(--reveal-opacity, 1) !important;
  transform: translateY(0);
}

/* ── Section divider ── */
.section-divider {
  text-align: center;
  padding: 50px 0;
  position: relative;
}
.divider-sigil {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  color: var(--accent);
  letter-spacing: 0.3em;
  display: inline-block;
  animation: sigil-pulse 3s ease-in-out infinite;
}
.divider-line {
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: 16px auto;
  width: 60%;
  opacity: 0.4;
}

/* ── Arc synopsis ── */
.synopsis-block {
  position: relative;
  border: 1px solid rgba(212,168,64,0.2);
  background: rgba(15,18,30,0.7);
  border-radius: 4px;
  padding: 36px 40px;
  margin: 40px 0;
  box-shadow: 0 0 50px rgba(212,168,64,0.04);
}

.synopsis-label {
  font-family: var(--reader-font);
  font-size: 10px;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: rgba(212,168,64,0.5);
  margin-bottom: 20px;
}

.synopsis-text {
  font-style: italic;
  color: #ccc4b0;
  line-height: 2;
}

/* ── Phase header ── */
.phase-header {
  margin: 70px 0 30px;
  text-align: center;
}

.phase-label {
  font-family: var(--reader-font);
  font-size: 10px;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.phase-name {
  font-family: var(--reader-font);
  font-size: 20px;
  letter-spacing: 0.2em;
  color: var(--accent);
}

/* ── Chapter cards ── */
.chapters-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 30px;
}

.chapter-card {
  position: relative;
  display: flex;
  align-items: stretch;
  border: 1px solid rgba(42,48,80,0.8);
  border-radius: 3px;
  overflow: hidden;
  background: rgba(14,19,32,0.6);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  text-decoration: none;
  color: inherit;
  cursor: default;
}

.chapter-card.available {
  cursor: pointer;
  border-color: rgba(200,164,106,0.2);
}

.chapter-card.available:hover {
  border-color: rgba(200,164,106,0.5);
  background: rgba(20,26,44,0.8);
  box-shadow: 0 0 30px rgba(200,164,106,0.08);
}

.chapter-card.available:hover .card-arrow {
  opacity: 1;
  transform: translateX(4px);
}

.card-num {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 0 20px;
  font-family: var(--reader-font);
  font-size: 11px;
  color: var(--text-dim);
  border-right: 1px solid rgba(42,48,80,0.8);
  background: rgba(8,12,20,0.4);
  letter-spacing: 0.05em;
}

.chapter-card.available .card-num {
  color: var(--accent);
  border-right-color: rgba(200,164,106,0.15);
}

.card-body {
  flex: 1;
  padding: 20px 24px;
}

.card-title {
  font-family: var(--reader-font);
  font-size: 18px;
  font-style: italic;
  color: #c8c0b0;
  line-height: 1.3;
  transition: color 0.3s ease;
}

.chapter-card.available .card-title {
  color: var(--text);
}

.chapter-card.available:hover .card-title {
  color: #f0e8d8;
}

.card-status {
  margin-top: 6px;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
}

.status-available {
  color: rgba(200,164,106,0.6);
}

.status-locked {
  color: rgba(100,100,120,0.5);
}

.card-arrow {
  display: flex;
  align-items: center;
  padding: 0 20px 0 8px;
  color: rgba(200,164,106,0.4);
  font-size: 14px;
  opacity: 0;
  transform: translateX(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Lock icon */
.card-lock {
  display: flex;
  align-items: center;
  padding: 0 20px 0 8px;
  color: rgba(80,90,110,0.4);
  font-size: 13px;
}

/* ── Phase ribbon ── */
.phase-ribbon {
  display: inline-block;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 2px;
  margin-bottom: 14px;
}

.ribbon-one {
  color: rgba(144,192,224,0.8);
  border: 1px solid rgba(144,192,224,0.2);
  background: rgba(144,192,224,0.04);
}

.ribbon-two {
  color: rgba(212,168,64,0.8);
  border: 1px solid rgba(212,168,64,0.2);
  background: rgba(212,168,64,0.04);
}

/* ── Character strip ── */
.characters-section {
  margin: 60px 0 40px;
}

.characters-label {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 28px;
}

.characters-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.char-tag {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 15px;
  padding: 5px 14px;
  border-radius: 2px;
  border: 1px solid;
  opacity: 0.85;
}

.char-emilia  { color: var(--emilia);   border-color: rgba(170,200,236,0.2); background: rgba(170,200,236,0.04); }
.char-subaru  { color: var(--accent2);  border-color: rgba(122,156,200,0.2); background: rgba(122,156,200,0.04); }
.char-ram     { color: var(--ram);      border-color: rgba(232,122,170,0.2); background: rgba(232,122,170,0.04); }
.char-beatrice{ color: var(--sakura);   border-color: rgba(192,138,208,0.2); background: rgba(192,138,208,0.04); }
.char-crush   { color: var(--lion);     border-color: rgba(212,168,64,0.2);  background: rgba(212,168,64,0.04);  }
.char-felt    { color: var(--felt);     border-color: rgba(232,160,80,0.2);  background: rgba(232,160,80,0.04);  }
.char-reinhard{ color: var(--reinhard); border-color: rgba(80,144,216,0.2);  background: rgba(80,144,216,0.04);  }
.char-fiore   { color: var(--fiore);    border-color: rgba(240,192,96,0.2);  background: rgba(240,192,96,0.04);  }
.char-otto    { color: #90b080;         border-color: rgba(144,176,128,0.2); background: rgba(144,176,128,0.04); }
.char-garfiel { color: #e07840;         border-color: rgba(224,120,64,0.2);  background: rgba(224,120,64,0.04);  }

/* ── Volume tag ── */
.volume-tag {
  text-align: center;
  font-family: var(--reader-font);
  font-size: 10px;
  letter-spacing: 0.4em;
  color: rgba(200,164,106,0.35);
  padding: 8px 0 24px;
  text-transform: uppercase;
}

/* ── Intro prose ── */
p.narr {
  margin-bottom: 1.3em;
  color: var(--text);
}

p.italic-narr {
  font-style: italic;
  color: #c8bcaa;
  margin-bottom: 1.3em;
}

body.justify-text .synopsis-text,
body.justify-text p.narr,
body.justify-text p.italic-narr,
body.justify-text .arc-quote {
  text-align: justify;
  text-align-last: left;
  hyphens: auto;
}

/* ── Footer mark ── */
.arc-end-mark {
  text-align: center;
  padding: 60px 0 80px;
  opacity: 0.4;
}

.arc-end-mark .kanji {
  font-family: serif;
  font-size: 32px;
  color: var(--accent);
  display: block;
  margin-bottom: 12px;
}

.arc-end-mark .label {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.5em;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* ── Animations ── */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50%       { opacity: 0.7; }
}
@keyframes sigil-pulse {
  0%, 100% { opacity: 0.4; letter-spacing: 0.3em; }
  50%       { opacity: 0.9; letter-spacing: 0.45em; }
}
@keyframes bounce {
  0%,100% { transform: rotate(45deg) translateY(0); opacity: 0.4; }
  50%      { transform: rotate(45deg) translateY(6px); opacity: 0.9; }
}

/* ── Highlight quote ── */
.arc-quote {
  position: relative;
  border-left: 2px solid rgba(212,168,64,0.4);
  padding: 4px 0 4px 24px;
  margin: 2em 0;
  font-style: italic;
  color: #d4c8a8;
  font-size: 20px;
  line-height: 2;
}

/* Responsive */
@media (max-width: 600px) {
  main { padding: 60px 20px 100px; }
  header { padding: 12px 20px; }
  .header-arc { display: none; }
  body { font-size: 17px; }
  .synopsis-block { padding: 28px 24px; }
  .card-num { min-width: 56px; padding: 0 14px; }
  .nav-buttons { padding: 40px 20px 80px; gap: 12px; }
  .nav-btn { padding: 12px 18px; font-size: 10px; }
  .arc-kanji { font-size: 28px; letter-spacing: 0.25em; margin-bottom: 20px; }
  #settings-panel { width: calc(100vw - 32px); left: 16px; }
  #settings-controls { left: 16px; bottom: 20px; }
  #theme-toggle { right: 16px; bottom: 20px; }
}

/* ── TOC compatibility guard ──
   Some generated indexes may still have the temporary card-content/card-subtitle
   markup. Keep those cards visually identical to the original card-body layout. */
#index-main .chapter-card .card-content,
#main-content .chapter-card .card-content {
  flex: 1;
  padding: 20px 24px;
}

#index-main .chapter-card.available .card-content .card-title,
#main-content .chapter-card.available .card-content .card-title {
  display: none;
}

#index-main .chapter-card .card-subtitle,
#main-content .chapter-card .card-subtitle {
  display: block;
  font-family: var(--reader-font);
  font-size: 18px;
  font-style: italic;
  color: var(--text);
  line-height: 1.3;
  transition: color 0.3s ease;
}

#index-main .chapter-card.available:hover .card-subtitle,
#main-content .chapter-card.available:hover .card-subtitle {
  color: #f0e8d8;
}

body.light-theme #index-main .chapter-card .card-subtitle,
body.light-theme #main-content .chapter-card .card-subtitle {
  color: #1a1610;
}

body.light-theme #index-main .chapter-card.available:hover .card-subtitle,
body.light-theme #main-content .chapter-card.available:hover .card-subtitle {
  color: #0a0800;
}
