/* S01E04 teaser poster — Abyssal Sovereign. Loaded after zoth-theme.css. */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  background: var(--bg, #050508);
  color: var(--text-body, #f1f5f9);
  font-family: var(--font-sans, "Figtree", system-ui, sans-serif);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
}

/* Competing atmosphere — theme fx + Azoth poster remain. Keep nodes for JS. */
#abyssal-canvas,
.abyssal-ambient-mesh,
.depth-gauge-hud {
  display: none !important;
}

.skip,
.skip-to-content {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--gold, #fbbf24);
  color: #050508;
  padding: 10px 18px;
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 8px;
  z-index: 10000;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip:focus,
.skip:focus-visible,
.skip-to-content:focus,
.skip-to-content:focus-visible {
  top: 16px;
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

main#main-content {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  position: relative;
  z-index: 1;
}

:root {
  --phi: 1.6180339887;
  --fib-8: 8px;
  --fib-13: 13px;
  --fib-21: 21px;
  --fib-34: 34px;
  --fib-55: 55px;
  --fib-89: 89px;
}

/* -------------------------------------------------------------------------- */
/* First viewport — Azoth split. Never object-fit:cover. Never Y ≈ 18%.       */
/* CTAs sit above the comic audio HUD (~108px).                               */
/* -------------------------------------------------------------------------- */

.ep-poster,
.saga-hero,
.azoth-poster {
  position: relative;
  width: 100%;
  min-height: calc(100svh - var(--zoth-header-h, 54px) - 108px);
  display: grid;
  grid-template-columns: minmax(18rem, 38rem) minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  padding: 0;
  overflow: hidden;
  background: var(--bg, #050508);
  box-sizing: border-box;
}

.ep-poster-copy,
.saga-hero-copy,
.azoth-poster-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 16px;
  max-width: 40rem;
  min-width: 0;
  padding: clamp(28px, 5vw, 64px) clamp(20px, 4vw, 48px) clamp(120px, 15vw, 168px);
}

.ep-poster .kicker,
.saga-kicker,
.azoth-poster .kicker {
  margin: 0;
  padding: 0;
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold, #fbbf24);
  font-weight: 700;
  background: none;
  border: 0;
  border-radius: 0;
  display: block;
}

html .ep-poster h1,
.ep-poster h1,
.saga-hero h1,
.azoth-poster h1 {
  font-family: var(--font-display, "Syne", sans-serif);
  font-size: clamp(3.2rem, 8vw, 6.4rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.92;
  margin: 0;
  max-width: none;
  white-space: nowrap;
  color: var(--text-primary, #fff6dc);
  background: none !important;
  -webkit-text-fill-color: var(--text-primary, #fff6dc) !important;
  text-shadow: none !important;
  overflow-wrap: normal;
  word-break: keep-all;
  hyphens: none;
}

.ep-poster .lede,
.azoth-poster .lede,
.saga-hero-lede,
.teaser-synopsis {
  margin: 0;
  max-width: 34rem;
  font-size: 1.06rem;
  line-height: 1.55;
  color: var(--text-subhead, var(--mute, #cbd5e1));
}

.ep-poster .lede strong,
.teaser-synopsis strong {
  color: var(--text-primary, #fff);
  font-weight: 700;
}

.ep-poster .lede code,
.teaser-synopsis code {
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.88em;
  color: var(--gold, #fbbf24);
}

.comic-ep-title {
  margin: 0;
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold, #fbbf24);
  background: none;
  border: 0;
  padding: 0;
  -webkit-text-fill-color: var(--gold, #fbbf24);
}

.ep-poster-actions,
.saga-actions,
.azoth-poster .cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
  margin-bottom: 12px;
  padding-bottom: 4px;
  position: relative;
  z-index: 3;
}

.ep-poster-actions .btn,
.saga-btn,
.azoth-poster .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 20px;
  border-radius: 999px;
  text-decoration: none;
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: 0;
  transition: transform 0.2s ease, filter 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.ep-poster-actions .btn:hover,
.saga-btn:hover,
.azoth-poster .btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.ep-poster-actions .btn-gold,
.saga-btn-gold,
.azoth-poster .btn-gold {
  background: var(--gold, #fbbf24) !important;
  color: #050508 !important;
  box-shadow: 0 8px 24px rgba(251, 191, 36, 0.28) !important;
  border: 0 !important;
}

.ep-poster-actions .btn-gold:hover,
.saga-btn-gold:hover {
  filter: brightness(1.08);
  color: #050508 !important;
}

.ep-poster-actions .btn-ghost,
.saga-btn-ghost,
.azoth-poster .btn-ghost {
  background: transparent !important;
  color: var(--text-primary, #fff) !important;
  border: 1.5px solid var(--line, rgba(255, 255, 255, 0.28)) !important;
  box-shadow: none !important;
}

.ep-poster-actions .btn-ghost:hover,
.saga-btn-ghost:hover {
  border-color: var(--gold, #fbbf24);
  color: var(--gold, #fbbf24) !important;
}

.ep-poster-figure,
.saga-hero-azoth,
.azoth-poster-figure {
  position: relative;
  z-index: 1;
  min-height: calc(100svh - var(--zoth-header-h, 54px) - 108px);
  min-width: 0;
  align-self: stretch;
  overflow: hidden;
  background: #050508;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.ep-poster-figure img,
.saga-hero-azoth img,
.azoth-poster-figure img {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain !important;
  object-position: center bottom !important;
  display: block;
  background: transparent;
}

.ep-poster-figure::after,
.ep-poster-figure::before,
.saga-hero-azoth::after,
.azoth-poster-figure::after {
  display: none !important;
  content: none !important;
  background: none !important;
}

.ep-poster-credit,
.saga-hero-credit,
.azoth-poster-credit {
  position: absolute;
  right: 24px;
  bottom: 28px;
  z-index: 2;
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold, #fbbf24);
  pointer-events: none;
}

/* -------------------------------------------------------------------------- */
/* Later stages — countdown, trailer, lore, dossier, timeline                 */
/* -------------------------------------------------------------------------- */

.abyssal-wrap,
.comic-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 20px 140px;
  width: 100%;
}

.abyssal-breadcrumb,
.ep-crumb {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.76rem;
  color: var(--muted, #94a3b8);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.abyssal-breadcrumb a,
.ep-crumb a {
  color: var(--cyan, #00f0ff);
  text-decoration: none;
}

.abyssal-breadcrumb a:hover,
.ep-crumb a:hover {
  color: var(--gold, #fbbf24);
  text-decoration: underline;
}

.abyssal-breadcrumb .sep {
  color: var(--muted, #64748b);
}

.abyssal-breadcrumb .current,
.ep-crumb [aria-current="page"] {
  color: var(--gold, #fbbf24);
  font-weight: 600;
}

#countdown,
#trailer-player,
#lore-terminal,
#dossier {
  scroll-margin-top: calc(var(--zoth-header-h, 54px) + 16px);
}

.abyssal-status-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
}

.abyssal-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--cyan, #00f0ff) 10%, transparent);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.12));
  color: var(--cyan, #00f0ff);
}

.abyssal-status-badge.live-glow {
  background: color-mix(in srgb, var(--cyan, #00f0ff) 12%, transparent);
  border-color: var(--cyan, #00f0ff);
  color: var(--cyan, #00f0ff);
}

.abyssal-status-badge.trench-depth {
  background: color-mix(in srgb, var(--violet, #a855f7) 14%, transparent);
  border-color: color-mix(in srgb, var(--violet, #a855f7) 40%, transparent);
  color: var(--text-subhead, #d8b4fe);
}

.abyssal-status-badge.finale-gold {
  background: color-mix(in srgb, var(--gold, #fbbf24) 12%, transparent);
  border-color: color-mix(in srgb, var(--gold, #fbbf24) 40%, transparent);
  color: var(--gold, #fbbf24);
}

.pulsing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan, #00f0ff);
  box-shadow: 0 0 10px var(--cyan, #00f0ff);
  animation: pulseDot 1.6s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(1.4); }
}

.teaser-lead {
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--text-subhead, #cbd5e1);
  max-width: 52rem;
  margin: 0 0 28px;
}

.abyssal-control-dock {
  background: var(--panel, var(--surface-card, rgba(10, 14, 28, 0.9)));
  border: 1px solid var(--border-card, var(--line, rgba(255, 255, 255, 0.12)));
  border-radius: 16px;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 40px;
}

.dock-left-actions,
.dock-right-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-abyss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: color-mix(in srgb, var(--text-primary, #fff) 6%, transparent);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.12));
  color: var(--text-primary, #f1f5f9);
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
  min-height: 44px;
}

.btn-abyss:hover {
  border-color: var(--cyan, #00f0ff);
  color: var(--text-primary, #fff);
  transform: translateY(-1px);
}

.btn-abyss.gold {
  background: var(--gold, #fbbf24);
  color: #050508;
  border-color: transparent;
}

.btn-abyss.gold:hover {
  filter: brightness(1.08);
  color: #050508;
}

.btn-abyss.cyan {
  background: var(--cyan, #00f0ff);
  color: #050508;
  border-color: transparent;
}

.btn-sound-toggle {
  background: color-mix(in srgb, var(--cyan, #00f0ff) 12%, transparent);
  border-color: var(--cyan, #00f0ff);
  color: var(--cyan, #00f0ff);
}

.btn-sound-toggle.playing {
  background: color-mix(in srgb, var(--green, #10b981) 18%, transparent);
  border-color: var(--green, #10b981);
  color: var(--green, #34d399);
}

.countdown-section {
  background: var(--panel, var(--surface-card, rgba(10, 14, 28, 0.94)));
  border: 1px solid var(--border-card, var(--line, rgba(255, 255, 255, 0.12)));
  border-radius: 24px;
  padding: clamp(24px, 4vw, 40px);
  margin-bottom: 48px;
}

.countdown-header {
  text-align: center;
  margin-bottom: 28px;
}

.countdown-heading {
  font-family: var(--font-display, "Syne", sans-serif);
  font-size: clamp(1.6rem, 3.2vw, 2.3rem);
  font-weight: 800;
  color: var(--text-primary, #fff);
  margin: 0 0 8px;
  background: none;
  -webkit-text-fill-color: var(--text-primary, #fff);
}

.countdown-sub {
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.82rem;
  color: var(--cyan, #00f0ff);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.countdown-note {
  color: var(--muted, #94a3b8);
  font-size: 0.9rem;
  margin: 8px auto 0;
  max-width: 600px;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(130px, 100%), 1fr));
  gap: 16px;
  max-width: 860px;
  margin: 0 auto 32px;
}

.countdown-card {
  background: var(--bg-2, var(--panel, rgba(7, 18, 42, 0.85)));
  border: 1px solid var(--line, rgba(0, 240, 255, 0.2));
  border-radius: 16px;
  padding: 20px 14px;
  text-align: center;
}

.countdown-digit {
  font-family: var(--font-display, "Syne", sans-serif);
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 900;
  line-height: 1;
  color: var(--text-primary, #fff);
  margin-bottom: 8px;
}

.countdown-digit.millis {
  color: var(--cyan, #00f0ff);
}

.countdown-label {
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted, #94a3b8);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.countdown-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.notify-box {
  max-width: 600px;
  margin: 24px auto 0;
  background: color-mix(in srgb, var(--bg, #020611) 75%, transparent);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  border-radius: 14px;
  padding: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.notify-input {
  flex: 1;
  min-width: min(220px, 100%);
  background: color-mix(in srgb, var(--text-primary, #fff) 5%, transparent);
  border: 1px solid var(--border-card, var(--line, rgba(255, 255, 255, 0.16)));
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-primary, #fff);
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.85rem;
  outline: none;
  min-height: 44px;
}

.notify-input:focus {
  border-color: var(--cyan, #00f0ff);
}

.notify-msg {
  width: 100%;
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.75rem;
  margin-top: 6px;
  color: var(--green, #10b981);
  display: none;
}

.cinema-preview-section,
.lore-terminal-section,
.dossier-section,
.timeline-section {
  margin-bottom: 56px;
}

.section-title-wrap {
  margin-bottom: 24px;
}

.section-title {
  font-family: var(--font-display, "Syne", sans-serif);
  font-size: clamp(1.7rem, 3.5vw, 2.5rem);
  font-weight: 800;
  color: var(--text-primary, #fff);
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  -webkit-text-fill-color: var(--text-primary, #fff);
}

.section-desc {
  font-size: 1rem;
  color: var(--muted, #94a3b8);
  margin: 0;
}

.cinematic-frame {
  position: relative;
  background: var(--bg, #01040a);
  border: 1px solid var(--border-card, var(--line, rgba(0, 240, 255, 0.3)));
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 24px;
}

.cinema-viewport-ratio {
  position: relative;
  width: 100%;
  aspect-ratio: 2.39 / 1;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

@media (max-width: 640px) {
  .cinema-viewport-ratio {
    aspect-ratio: 16 / 9;
  }
}

.cinema-poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}

#cinema-sim-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.teaser-video {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cinema-hud-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(14px, 2.5vw, 24px);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.75) 0%, transparent 35%, transparent 65%, rgba(0, 0, 0, 0.9) 100%);
  pointer-events: none;
}

.cinema-hud-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: auto;
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.75rem;
  font-weight: 700;
}

.cinema-hud-live {
  color: var(--cyan, #00f0ff);
  display: flex;
  align-items: center;
  gap: 8px;
}

.cinema-hud-ratio {
  color: var(--gold, #fbbf24);
}

.cinema-hud-center {
  align-self: center;
  pointer-events: auto;
}

.cinema-play-hero-btn {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--cyan, #00f0ff) 20%, transparent);
  border: 2px solid var(--cyan, #00f0ff);
  color: #ffffff;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding-left: 5px;
}

.cinema-play-hero-btn:hover {
  background: var(--cyan, #00f0ff);
  color: #050508;
}

.cinema-play-hero-btn.is-playing {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
  color: #fff;
  padding-left: 0;
}

.cinema-hud-bottom {
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: auto;
}

.cinema-progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
}

.cinema-progress-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan, #00f0ff), var(--gold, #fbbf24));
  border-radius: 3px;
}

.cinema-hud-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.78rem;
  color: #cbd5e1;
}

.cinema-hud-btn-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

.cinema-icon-btn {
  background: none;
  border: none;
  color: #cbd5e1;
  font-size: 1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  min-height: 36px;
  min-width: 36px;
}

.cinema-icon-btn:hover {
  color: var(--cyan, #00f0ff);
  background: rgba(255, 255, 255, 0.1);
}

.teaser-chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 16px;
}

.teaser-chapter-card {
  background: var(--panel, var(--bg-2, #07122a));
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.teaser-chapter-card:hover,
.teaser-chapter-card.active {
  border-color: var(--cyan, #00f0ff);
  transform: translateY(-2px);
}

.chapter-time-tag {
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gold, #fbbf24);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}

.chapter-scene {
  color: var(--cyan, #00f0ff);
}

.chapter-title {
  font-family: var(--font-display, "Syne", sans-serif);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary, #fff);
  margin: 0 0 6px;
}

.chapter-desc {
  font-size: 0.8rem;
  color: var(--muted, #94a3b8);
  margin: 0;
  line-height: 1.4;
}

.lore-terminal-section {
  background: var(--panel, var(--bg-2, #07122a));
  border: 1px solid var(--border-card, var(--line, rgba(255, 255, 255, 0.12)));
  border-radius: 24px;
  padding: clamp(24px, 4vw, 40px);
}

.lore-tabs-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  -webkit-overflow-scrolling: touch;
}

.lore-tab-btn {
  background: color-mix(in srgb, var(--text-primary, #fff) 4%, transparent);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  color: var(--muted, #94a3b8);
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  min-height: 44px;
}

.lore-tab-btn:hover {
  color: var(--text-primary, #fff);
  border-color: color-mix(in srgb, var(--cyan, #00f0ff) 40%, transparent);
}

.lore-tab-btn.active {
  background: color-mix(in srgb, var(--cyan, #00f0ff) 15%, transparent);
  border-color: var(--cyan, #00f0ff);
  color: var(--cyan, #00f0ff);
}

.lore-content-panel {
  background: var(--bg, #02050f);
  border: 1px solid var(--line, rgba(0, 240, 255, 0.15));
  border-radius: 16px;
  padding: 24px;
  position: relative;
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  min-height: 220px;
}

.lore-header-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  color: var(--muted, #64748b);
  font-size: 0.72rem;
  border-bottom: 1px dashed var(--line, rgba(255, 255, 255, 0.1));
  padding-bottom: 8px;
  gap: 8px;
  flex-wrap: wrap;
}

.lore-sec-level {
  color: var(--rose, #ef4444);
}

.lore-lead {
  color: var(--gold, #fbbf24);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 12px;
  font-family: var(--font-display, "Syne", sans-serif);
}

.lore-body-text {
  color: var(--text-subhead, #cbd5e1);
  font-size: 0.88rem;
  line-height: 1.7;
  margin-bottom: 18px;
  font-family: var(--font-sans, "Figtree", sans-serif);
}

.lore-panel-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.lore-hash {
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.72rem;
  color: var(--muted, #64748b);
  max-width: 100%;
  overflow-x: auto;
  word-break: break-all;
}

.decrypt-btn {
  background: color-mix(in srgb, var(--gold, #fbbf24) 15%, transparent);
  border: 1px solid var(--gold, #fbbf24);
  color: var(--gold, #fbbf24);
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  min-height: 44px;
}

.decrypt-btn:hover {
  background: var(--gold, #fbbf24);
  color: #050508;
}

.dossier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 20px;
}

.dossier-card {
  background: var(--panel, var(--surface-card, #07122a));
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  border-radius: 18px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.dossier-card:hover {
  border-color: var(--cyan, #00f0ff);
  transform: translateY(-4px);
}

.dossier-card.highlight {
  border-color: color-mix(in srgb, var(--gold, #fbbf24) 40%, transparent);
}

.dossier-avatar-wrap {
  width: 70px;
  height: 70px;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid var(--cyan, #00f0ff);
  margin-bottom: 16px;
}

.dossier-avatar-wrap.gold {
  border-color: var(--gold, #fbbf24);
}

.dossier-avatar-wrap.violet {
  border-color: var(--violet, #a855f7);
}

.dossier-avatar-wrap.teal {
  border-color: var(--cyan, #06b6d4);
}

.dossier-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dossier-title {
  font-family: var(--font-display, "Syne", sans-serif);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary, #fff);
  margin: 0 0 4px;
}

.dossier-role {
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.72rem;
  color: var(--cyan, #00f0ff);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.dossier-desc {
  font-size: 0.88rem;
  color: var(--muted, #94a3b8);
  line-height: 1.55;
  margin: 0 0 18px;
}

.dossier-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.7rem;
  color: var(--text-subhead, #cbd5e1);
  background: color-mix(in srgb, var(--bg, #000) 40%, transparent);
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.stat-val {
  color: var(--gold, #fbbf24);
  font-weight: 700;
}

.timeline-section {
  background: var(--panel, var(--bg-2, #07122a));
  border: 1px solid var(--border-card, var(--line, rgba(255, 255, 255, 0.12)));
  border-radius: 24px;
  padding: clamp(24px, 4vw, 40px);
}

.timeline-track {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 20px;
}

.timeline-node {
  background: var(--bg, #020612);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
}

.timeline-node:hover {
  border-color: var(--cyan, #00f0ff);
}

.timeline-node.current-finale {
  border-color: var(--gold, #fbbf24);
}

.node-ep-badge {
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold, #fbbf24);
  margin-bottom: 8px;
}

.node-title {
  font-family: var(--font-display, "Syne", sans-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary, #fff);
  margin: 0 0 8px;
}

.node-summary {
  font-size: 0.82rem;
  color: var(--muted, #94a3b8);
  margin: 0 0 16px;
}

.timeline-node .btn-abyss {
  font-size: 0.75rem;
  padding: 8px 14px;
  align-self: flex-start;
}

.premiere-soon {
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.75rem;
  color: var(--gold, #fbbf24);
  font-weight: 700;
}

.ep-foot-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--line, rgba(255, 255, 255, 0.08));
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  min-height: 44px;
  padding: 12px 24px;
}

.btn-off {
  background: color-mix(in srgb, var(--text-primary, #fff) 6%, transparent);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  color: var(--text-subhead, #cbd5e1);
}

.btn-off:hover {
  border-color: var(--cyan, #00f0ff);
  color: var(--text-primary, #fff);
}

.btn-on {
  background: var(--gold, #fbbf24);
  border: 1px solid var(--gold, #fbbf24);
  color: #050508;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* -------------------------------------------------------------------------- */
/* S01E04 Finale Reader Components (Panels, Sonar, Dossiers, Soundboard)       */
/* -------------------------------------------------------------------------- */

:root {
  --comic-gold: var(--gold, #fbbf24);
  --comic-cyan: var(--cyan, #00f0ff);
  --comic-purple: var(--violet, #a855f7);
  --comic-emerald: var(--green, #10b981);
  --comic-line: var(--line, rgba(255, 255, 255, 0.12));
  --comic-border: var(--border-card, rgba(0, 240, 255, 0.22));
}

.comic-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
  border: 1px solid currentColor;
}

.ep-nav-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.ep-tab-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  min-height: 44px;
  background: var(--panel, var(--surface-card, rgba(15, 22, 41, 0.72)));
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  color: var(--muted, #94a3b8);
  text-decoration: none;
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.82rem;
  font-weight: 600;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.ep-tab-btn:hover {
  border-color: var(--cyan, #00f0ff);
  color: var(--text-primary, #fff);
  transform: translateY(-2px);
}

.ep-tab-btn.active {
  background: color-mix(in srgb, var(--cyan, #00f0ff) 12%, transparent);
  border-color: var(--cyan, #00f0ff);
  color: var(--text-primary, #fff);
}

.badge-finale {
  background: var(--gold, #fbbf24);
  color: #050508;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 800;
  margin-left: 4px;
}

.comic-control-dock {
  background: var(--panel, rgba(10, 14, 28, 0.9));
  border: 1px solid var(--border-card, var(--comic-border));
  border-radius: 16px;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 36px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.dock-mode-toggle {
  display: flex;
  gap: 6px;
  background: color-mix(in srgb, var(--bg, #000) 50%, transparent);
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
}

.mode-btn {
  background: none;
  border: none;
  color: var(--muted, #94a3b8);
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mode-btn.active {
  background: var(--gold, #fbbf24);
  color: #050508;
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.4);
}

.dock-audio-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.character-roster-section,
.hadal-visualizer-section,
.soundboard-card {
  background: var(--panel, var(--bg-2, #0a0e1c));
  border: 1px solid var(--border-card, var(--comic-border));
  border-radius: 24px;
  padding: clamp(24px, 4vw, 36px);
  margin-bottom: 48px;
}

.section-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
  gap: 20px;
}

.char-card {
  background: var(--bg-2, var(--surface-card, #0f1629));
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  transition: border-color 0.25s ease, transform 0.25s ease;
  position: relative;
  overflow: hidden;
}

.char-card:hover {
  transform: translateY(-4px);
}

.char-card.azoth:hover { border-color: var(--gold, #fbbf24); }
.char-card.leviathan:hover { border-color: var(--violet, #a855f7); }
.char-card.kraken:hover { border-color: var(--cyan, #00f0ff); }
.char-card.antigravity:hover { border-color: #38bdf8; }

.char-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.char-avatar {
  width: 58px;
  height: 58px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid var(--line, rgba(255, 255, 255, 0.1));
}

.char-meta h3 {
  font-family: var(--font-display, "Syne", sans-serif);
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0 0 2px;
  color: var(--text-primary, #fff);
}

.char-role-badge {
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
}

.badge-azoth { background: color-mix(in srgb, var(--gold, #fbbf24) 15%, transparent); color: var(--gold, #fbbf24); border: 1px solid color-mix(in srgb, var(--gold, #fbbf24) 30%, transparent); }
.badge-leviathan { background: color-mix(in srgb, var(--violet, #a855f7) 18%, transparent); color: #d8b4fe; border: 1px solid color-mix(in srgb, var(--violet, #a855f7) 40%, transparent); }
.badge-kraken { background: color-mix(in srgb, var(--cyan, #00f0ff) 15%, transparent); color: var(--cyan, #00f0ff); border: 1px solid color-mix(in srgb, var(--cyan, #00f0ff) 30%, transparent); }
.badge-antigravity { background: color-mix(in srgb, #38bdf8 15%, transparent); color: #38bdf8; border: 1px solid color-mix(in srgb, #38bdf8 30%, transparent); }

.char-desc {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-subhead, #cbd5e1);
  margin: 0;
}

.char-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: auto;
}

.btn-bio-inspect {
  flex: 1;
  background: color-mix(in srgb, var(--text-primary, #fff) 6%, transparent);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.15));
  color: var(--text-primary, #fff);
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 8px 12px;
  min-height: 40px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-bio-inspect:hover {
  background: var(--gold, #fbbf24);
  color: #050508;
  border-color: var(--gold, #fbbf24);
}

.btn-bio-voice {
  background: color-mix(in srgb, var(--cyan, #00f0ff) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--cyan, #00f0ff) 30%, transparent);
  color: var(--cyan, #00f0ff);
  font-size: 0.85rem;
  padding: 8px 12px;
  min-height: 40px;
  min-width: 44px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-bio-voice:hover,
.btn-bio-voice.playing {
  background: var(--cyan, #00f0ff);
  color: #050508;
}

/* Sonar Visualizer Grid */
.sonar-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
  align-items: start;
}

.sonar-canvas-wrap {
  background: #020307;
  border: 1px solid var(--line, rgba(0, 240, 255, 0.2));
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

#sonarCanvas {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
}

.sonar-diagnostics {
  background: var(--bg-2, #030611);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hadal-telemetry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.hadal-telemetry-card {
  background: color-mix(in srgb, var(--bg, #000) 40%, transparent);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  border-radius: 10px;
  padding: 10px 12px;
}

.hadal-telemetry-label {
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.68rem;
  color: var(--muted, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.hadal-telemetry-value {
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--cyan, #00f0ff);
}

.ast-ctrl-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.btn-ast-action {
  background: var(--gold, #fbbf24);
  color: #050508;
  border: none;
  padding: 10px 18px;
  min-height: 44px;
  border-radius: 10px;
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.btn-ast-action:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

/* Soundboard Grid */
.soundboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 14px;
  margin-top: 18px;
  margin-bottom: 24px;
}

.btn-sfx-drop {
  background: var(--bg-2, rgba(5, 7, 15, 0.85));
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  padding: 14px 18px;
  color: var(--text-body, #f1f5f9);
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.84rem;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 48px;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.btn-sfx-drop:hover {
  border-color: var(--gold, #fbbf24);
  background: color-mix(in srgb, var(--gold, #fbbf24) 12%, transparent);
  transform: translateY(-2px);
}

.btn-sfx-drop.playing {
  border-color: var(--cyan, #00f0ff);
  background: color-mix(in srgb, var(--cyan, #00f0ff) 15%, transparent);
}

.sfx-name {
  font-family: var(--font-display, "Syne", sans-serif);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary, #fff);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sfx-caption {
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.7rem;
  color: var(--muted, #94a3b8);
}

.soundboard-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  background: color-mix(in srgb, var(--bg, #000) 40%, transparent);
  padding: 14px 20px;
  border-radius: 14px;
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
}

.vu-meter-strip {
  display: flex;
  gap: 4px;
  align-items: flex-end;
  height: 24px;
}

.vu-bar {
  width: 4px;
  height: 4px;
  background: var(--cyan, #00f0ff);
  border-radius: 2px;
}

.vu-meter-strip.active .vu-bar:nth-child(1) { height: 12px; }
.vu-meter-strip.active .vu-bar:nth-child(2) { height: 20px; background: var(--green, #10b981); }
.vu-meter-strip.active .vu-bar:nth-child(3) { height: 16px; }
.vu-meter-strip.active .vu-bar:nth-child(4) { height: 24px; background: var(--gold, #fbbf24); }
.vu-meter-strip.active .vu-bar:nth-child(5) { height: 8px; }
.vu-meter-strip.active .vu-bar:nth-child(6) { height: 18px; background: var(--violet, #a855f7); }

/* Panel Cards */
.panel-card {
  background: var(--panel, var(--bg-2, #0a0e1c));
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 48px;
  transition: border-color 0.3s ease;
}

.panel-card:hover {
  border-color: var(--border-card, var(--comic-border));
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 0;
}

.panel-media-wrap {
  position: relative;
  background: var(--bg, #020306);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.panel-img {
  width: 100%;
  height: auto;
  max-height: 860px;
  object-fit: cover;
  display: block;
}

.panel-video {
  width: 100%;
  height: auto;
  max-height: 860px;
  object-fit: cover;
  display: none;
  background: #000;
}

body.view-video .panel-img {
  display: none;
}

body.view-video .panel-video {
  display: block;
}

.panel-info {
  padding: clamp(24px, 3.5vw, 36px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--panel, var(--bg-2, #0a0e1c));
}

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

.panel-tag {
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold, #fbbf24);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.panel-telemetry-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.telemetry-badge {
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--cyan, #00f0ff) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--cyan, #00f0ff) 25%, transparent);
  color: var(--cyan, #00f0ff);
}

.telemetry-badge strong {
  color: #ffffff;
}

.panel-title {
  font-family: var(--font-display, "Syne", sans-serif);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary, #fff);
  margin: 0 0 12px;
  line-height: 1.25;
  background: none;
  -webkit-text-fill-color: var(--text-primary, #fff);
}

.panel-script {
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--text-subhead, #cbd5e1);
  margin: 0 0 24px;
  border-left: 3px solid var(--cyan, #00f0ff);
  padding-left: 14px;
}

.panel-audio-ctrl {
  background: color-mix(in srgb, var(--bg, #000) 40%, transparent);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  border-radius: 14px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: auto;
  flex-wrap: wrap;
}

.play-panel-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gold, #fbbf24);
  color: #050508;
  border: none;
  padding: 10px 20px;
  border-radius: 999px;
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
  white-space: nowrap;
  min-height: 40px;
}

.play-panel-btn:hover {
  background: #fff;
  filter: none;
  transform: translateY(-2px);
}

.trailer-box {
  background: var(--panel, var(--bg-2, #0a0e1c));
  border: 1px solid var(--border-card, var(--comic-border));
  border-radius: 24px;
  padding: clamp(20px, 4vw, 32px);
  margin: 48px 0;
}

/* Modal */
.bio-modal-backdrop {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--bg, #02040a) 85%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.bio-modal-backdrop.is-open {
  display: flex;
  opacity: 1;
}

.bio-modal-content {
  background: var(--panel, var(--bg-2, #0a0e1c));
  border: 1px solid var(--border-card, var(--comic-border));
  border-radius: 24px;
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: clamp(20px, 4vw, 32px);
  position: relative;
}

.bio-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: color-mix(in srgb, var(--text-primary, #fff) 8%, transparent);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.15));
  color: var(--text-primary, #fff);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.bio-modal-close:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
}

.bio-modal-hero {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.bio-modal-avatar {
  width: 90px;
  height: 90px;
  border-radius: 18px;
  object-fit: cover;
  border: 2px solid var(--cyan, #00f0ff);
}

.bio-modal-title-area h2 {
  font-family: var(--font-display, "Syne", sans-serif);
  font-size: 1.8rem;
  font-weight: 900;
  margin: 0 0 6px;
  color: var(--text-primary, #fff);
  background: none;
  -webkit-text-fill-color: var(--text-primary, #fff);
}

.bio-axiom-quote {
  font-style: italic;
  color: var(--gold, #fbbf24);
  background: color-mix(in srgb, var(--gold, #fbbf24) 8%, transparent);
  border-left: 3px solid var(--gold, #fbbf24);
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.bio-specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(130px, 100%), 1fr));
  gap: 10px;
  margin: 20px 0;
}

.bio-spec-box {
  background: color-mix(in srgb, var(--bg, #000) 40%, transparent);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  border-radius: 10px;
  padding: 10px 12px;
}

.bio-spec-label {
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.65rem;
  color: var(--muted, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bio-spec-val {
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--cyan, #00f0ff);
  margin-top: 4px;
}

.live-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--panel, var(--bg-2, #0a0e1c));
  border: 1px solid var(--gold, #fbbf24);
  color: var(--text-primary, #fff);
  padding: 12px 20px;
  border-radius: 12px;
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.82rem;
  z-index: 100000;
  display: none;
}

/* -------------------------------------------------------------------------- */
/* Footer — full-bleed columns                                                */
/* -------------------------------------------------------------------------- */

footer.site {
  width: 100%;
  max-width: none;
  margin: 0;
  box-sizing: border-box;
  border-top: 1px solid var(--line, rgba(247, 244, 238, 0.1));
  padding: 48px clamp(20px, 4vw, 48px) 36px;
  background: var(--bg, #050508);
  color: var(--mute, var(--muted, #a8a4c2));
}

body.has-comic-audio-player footer.site {
  padding-bottom: 140px;
}

footer.site .foot-grid {
  display: grid;
  grid-template-columns: 1.618fr 1fr 1fr 1fr;
  gap: 34px;
  width: 100%;
  max-width: none;
}

footer.site .foot-brand {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

footer.site .foot-brand img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
}

footer.site .foot-brand strong {
  display: block;
  font-family: var(--font-display, "Syne", sans-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary, #fff);
}

footer.site .foot-brand .kicker {
  display: block;
  margin: 4px 0 0;
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold, #fbbf24);
  font-weight: 700;
}

footer.site .foot-brand p {
  color: var(--mute, var(--muted, #94a3b8));
  margin: 8px 0 0;
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 22rem;
}

footer.site .foot-col h3 {
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold, #fbbf24);
  margin: 0 0 14px;
  font-weight: 700;
}

footer.site .foot-col a {
  display: block;
  text-decoration: none;
  color: var(--text-subhead, #cbd5e1);
  font-size: 0.94rem;
  padding: 5px 0;
}

footer.site .foot-col a:hover {
  color: var(--gold, #fbbf24);
}

footer.site .foot-end {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line, rgba(247, 244, 238, 0.1));
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.76rem;
  color: var(--mute, var(--muted, #94a3b8));
}

/* -------------------------------------------------------------------------- */
/* Light — dark ink on pale ground. Poster h1 stays #111827.                  */
/* -------------------------------------------------------------------------- */

html[data-theme="light"] body {
  background: #f7f9fc !important;
  color: #1f2937 !important;
}

html[data-theme="light"] h1 {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  background: none !important;
}

html[data-theme="light"] .ep-poster,
html[data-theme="light"] .saga-hero,
html[data-theme="light"] .azoth-poster {
  background: #f7f9fc !important;
}

html[data-theme="light"] .ep-poster h1,
html[data-theme="light"] .saga-hero h1,
html[data-theme="light"] .azoth-poster h1 {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  background: none !important;
  text-shadow: none !important;
}

html[data-theme="light"] .ep-poster .lede,
html[data-theme="light"] .teaser-synopsis,
html[data-theme="light"] .teaser-lead {
  color: #374151 !important;
}

html[data-theme="light"] .ep-poster .lede strong,
html[data-theme="light"] .teaser-synopsis strong {
  color: #111827 !important;
}

html[data-theme="light"] .ep-poster .kicker,
html[data-theme="light"] .saga-kicker,
html[data-theme="light"] .ep-poster-credit,
html[data-theme="light"] .comic-ep-title,
html[data-theme="light"] .ep-poster .lede code,
html[data-theme="light"] .teaser-synopsis code {
  color: #92400e !important;
  -webkit-text-fill-color: #92400e !important;
}

html[data-theme="light"] .ep-poster-figure,
html[data-theme="light"] .saga-hero-azoth,
html[data-theme="light"] .azoth-poster-figure {
  background: #0b1220;
}

html[data-theme="light"] .ep-poster-actions .btn-ghost,
html[data-theme="light"] .saga-btn-ghost {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  border: 1.5px solid rgba(17, 24, 39, 0.28) !important;
  background: #ffffff !important;
}

html[data-theme="light"] .abyssal-breadcrumb,
html[data-theme="light"] .ep-crumb {
  color: #4b5563;
}

html[data-theme="light"] .abyssal-breadcrumb a,
html[data-theme="light"] .ep-crumb a {
  color: #1d4ed8;
}

html[data-theme="light"] .abyssal-breadcrumb .current,
html[data-theme="light"] .ep-crumb [aria-current="page"] {
  color: #92400e;
}

html[data-theme="light"] .abyssal-status-badge {
  background: #ffffff;
  border-color: rgba(17, 24, 39, 0.12);
  color: #374151;
}

html[data-theme="light"] .abyssal-status-badge.live-glow {
  color: #0e7490;
  border-color: #67e8f9;
  background: #ecfeff;
}

html[data-theme="light"] .abyssal-status-badge.finale-gold {
  color: #92400e;
  background: #fffbeb;
}

html[data-theme="light"] .abyssal-control-dock,
html[data-theme="light"] .countdown-section,
html[data-theme="light"] .countdown-card,
html[data-theme="light"] .lore-terminal-section,
html[data-theme="light"] .lore-content-panel,
html[data-theme="light"] .teaser-chapter-card,
html[data-theme="light"] .dossier-card,
html[data-theme="light"] .timeline-section,
html[data-theme="light"] .timeline-node,
html[data-theme="light"] .notify-box {
  background: #ffffff !important;
  border-color: rgba(17, 24, 39, 0.12) !important;
  color: #1f2937;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.04);
}

html[data-theme="light"] .countdown-heading,
html[data-theme="light"] .section-title,
html[data-theme="light"] .chapter-title,
html[data-theme="light"] .dossier-title,
html[data-theme="light"] .node-title,
html[data-theme="light"] .countdown-digit {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
}

html[data-theme="light"] .countdown-digit.millis {
  color: #0e7490 !important;
  -webkit-text-fill-color: #0e7490 !important;
}

html[data-theme="light"] .countdown-note,
html[data-theme="light"] .section-desc,
html[data-theme="light"] .chapter-desc,
html[data-theme="light"] .dossier-desc,
html[data-theme="light"] .node-summary,
html[data-theme="light"] .lore-body-text,
html[data-theme="light"] .countdown-label,
html[data-theme="light"] .btn-off,
html[data-theme="light"] .btn-abyss {
  color: #374151;
}

html[data-theme="light"] .btn-abyss {
  background: #f9fafb;
  border-color: rgba(17, 24, 39, 0.16);
}

html[data-theme="light"] .btn-abyss.gold,
html[data-theme="light"] .btn-on {
  background: #fbbf24;
  color: #050508;
  border-color: #fbbf24;
}

html[data-theme="light"] .btn-abyss.cyan {
  background: #06b6d4;
  color: #050508;
}

html[data-theme="light"] .notify-input {
  background: #f9fafb;
  color: #111827;
  border-color: rgba(17, 24, 39, 0.16);
}

html[data-theme="light"] .lore-tab-btn {
  background: #ffffff;
  border-color: rgba(17, 24, 39, 0.12);
  color: #4b5563;
}

html[data-theme="light"] .lore-tab-btn.active {
  background: #ecfeff;
  border-color: #06b6d4;
  color: #0e7490;
}

html[data-theme="light"] .lore-lead,
html[data-theme="light"] .node-ep-badge,
html[data-theme="light"] .stat-val,
html[data-theme="light"] .premiere-soon {
  color: #92400e;
}

html[data-theme="light"] .dossier-stats {
  background: #f3f4f6;
  border-color: rgba(17, 24, 39, 0.08);
  color: #374151;
}

html[data-theme="light"] .character-roster-section,
html[data-theme="light"] .hadal-visualizer-section,
html[data-theme="light"] .sonar-diagnostics,
html[data-theme="light"] .soundboard-card,
html[data-theme="light"] .panel-card,
html[data-theme="light"] .panel-info,
html[data-theme="light"] .trailer-box,
html[data-theme="light"] .char-card,
html[data-theme="light"] .bio-modal-content,
html[data-theme="light"] .bio-spec-box,
html[data-theme="light"] .hadal-telemetry-card {
  background: #ffffff !important;
  border-color: rgba(17, 24, 39, 0.12) !important;
  color: #1f2937;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.04);
}

html[data-theme="light"] .char-meta h3,
html[data-theme="light"] .panel-title,
html[data-theme="light"] .bio-modal-title-area h2,
html[data-theme="light"] .sfx-name,
html[data-theme="light"] .telemetry-badge strong {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
}

html[data-theme="light"] .char-desc,
html[data-theme="light"] .panel-script,
html[data-theme="light"] .sfx-caption,
html[data-theme="light"] .hadal-telemetry-label,
html[data-theme="light"] .bio-spec-label {
  color: #374151 !important;
}

html[data-theme="light"] .ep-tab-btn {
  background: #ffffff;
  border-color: rgba(17, 24, 39, 0.12);
  color: #4b5563;
}

html[data-theme="light"] .ep-tab-btn.active {
  background: #ecfeff;
  border-color: #06b6d4;
  color: #0e7490;
}

html[data-theme="light"] .btn-sfx-drop {
  background: #f9fafb;
  border-color: rgba(17, 24, 39, 0.12);
  color: #111827;
}

html[data-theme="light"] .sonar-canvas-wrap,
html[data-theme="light"] .panel-media-wrap {
  background: #0b1220;
}

html[data-theme="light"] footer.site {
  background: #f7f9fc !important;
  color: #374151;
  border-top-color: rgba(17, 24, 39, 0.1);
}

html[data-theme="light"] footer.site .foot-brand strong {
  color: #111827;
}

html[data-theme="light"] footer.site .foot-col a,
html[data-theme="light"] footer.site .foot-brand p,
html[data-theme="light"] footer.site .foot-end {
  color: #374151;
}

html[data-theme="light"] footer.site .foot-col a:hover,
html[data-theme="light"] footer.site .foot-brand .kicker,
html[data-theme="light"] footer.site .foot-col h3 {
  color: #92400e;
}

html[data-theme="light"] .ep-foot-nav {
  border-top-color: rgba(17, 24, 39, 0.1);
}

html[data-theme="light"] .cinematic-frame,
html[data-theme="light"] .cinema-viewport-ratio {
  background: #0b1220;
}

/* -------------------------------------------------------------------------- */
/* Gold / matrix                                                              */
/* -------------------------------------------------------------------------- */

html[data-theme="gold"] .ep-poster,
html[data-theme="gold"] .saga-hero,
html[data-theme="gold"] .azoth-poster,
html[data-theme="gold"] footer.site,
html[data-theme="gold"] body {
  background: #0c0802;
}

html[data-theme="gold"] .ep-poster-figure,
html[data-theme="gold"] .saga-hero-azoth,
html[data-theme="gold"] .azoth-poster-figure {
  background: #0c0802;
}

html[data-theme="matrix"] .ep-poster .kicker,
html[data-theme="matrix"] .saga-kicker,
html[data-theme="matrix"] .ep-poster-credit,
html[data-theme="matrix"] .comic-ep-title,
html[data-theme="matrix"] .countdown-sub,
html[data-theme="matrix"] .node-ep-badge {
  color: #34d399;
}

html[data-theme="matrix"] .ep-poster h1 {
  color: #d1fae5;
  -webkit-text-fill-color: #d1fae5;
}

/* -------------------------------------------------------------------------- */
/* Motion                                                                     */
/* -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  #abyssal-canvas {
    display: none !important;
  }
}

/* -------------------------------------------------------------------------- */
/* Mobile — portrait first, copy below. Pad CTAs above the audio HUD.         */
/* -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
  .ep-poster,
  .saga-hero,
  .azoth-poster {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: calc(100svh - var(--zoth-header-h, 54px));
    align-items: start;
    align-content: start;
  }

  .ep-poster-figure,
  .saga-hero-azoth,
  .azoth-poster-figure {
    order: -1;
    min-height: 38vh;
    height: min(38vh, 340px);
    max-height: 360px;
    flex: 0 0 auto;
    margin: 0;
  }

  .ep-poster-copy,
  .saga-hero-copy,
  .azoth-poster-copy {
    flex: 1 0 auto;
    justify-content: flex-start;
    padding: 16px 20px calc(28px + 176px + env(safe-area-inset-bottom, 0px));
    gap: 12px;
    max-width: none;
  }

  .ep-poster h1,
  .saga-hero h1,
  .azoth-poster h1 {
    font-size: clamp(2.6rem, 14vw, 4.2rem);
    max-width: none;
  }

  .ep-poster .lede,
  .teaser-synopsis {
    font-size: 1rem;
  }

  .ep-poster-credit,
  .saga-hero-credit {
    right: 16px;
    bottom: 12px;
  }

  footer.site .foot-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px 21px;
  }
}

@media (max-width: 960px) {
  .panel-grid {
    grid-template-columns: 1fr;
  }
  .sonar-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .abyssal-wrap,
  .comic-wrap {
    padding: 24px 13px 140px;
  }

  .abyssal-control-dock,
  .comic-control-dock {
    flex-direction: column;
    align-items: stretch;
    padding: 13px;
  }

  .character-roster-section,
  .hadal-visualizer-section,
  .soundboard-card,
  .trailer-box {
    padding: 20px 16px;
  }

  .panel-info {
    padding: 20px 16px;
  }

  .panel-audio-ctrl {
    padding: 12px;
    flex-direction: column;
    align-items: stretch;
  }

  .soundboard-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .hadal-telemetry-grid {
    grid-template-columns: 1fr;
  }

  .lore-tab-btn {
    flex-shrink: 0;
  }

  .lore-content-panel {
    padding: 21px 13px;
  }

  footer.site .foot-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .ep-poster-copy,
  .saga-hero-copy,
  .azoth-poster-copy {
    padding-bottom: calc(28px + 188px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 640px) {
  .ep-poster-figure,
  .saga-hero-azoth,
  .azoth-poster-figure {
    height: min(32svh, 240px);
    min-height: 188px;
    max-height: 248px;
  }

  .ep-poster-copy,
  .saga-hero-copy,
  .azoth-poster-copy {
    padding: 12px 20px calc(24px + 188px + env(safe-area-inset-bottom, 0px));
    gap: 8px;
  }

  .ep-poster h1,
  .saga-hero h1,
  .azoth-poster h1 {
    font-size: clamp(2.3rem, 14vw, 3.1rem);
  }
}

@media (max-width: 480px) {
  .character-grid {
    grid-template-columns: 1fr;
  }

  .soundboard-grid {
    grid-template-columns: 1fr;
  }

  .ep-nav-tabs {
    flex-direction: column;
  }

  .ep-tab-btn {
    width: 100%;
    justify-content: center;
  }

  .btn-bio-inspect,
  .btn-bio-voice {
    min-height: 44px;
  }
}

/* ========================================================================== */
/* AZOTH S01E04: DYNAMIC MANGA / WEBTOON READER FX & STAGE STYLES            */
/* ========================================================================== */

/* Sticky Reading Progress Top Bar */
.reading-progress-dock {
  position: fixed;
  top: var(--zoth-header-h, 54px);
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  z-index: 998;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.reading-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan, #00f0ff), var(--violet, #a855f7), var(--gold, #fbbf24));
  box-shadow: 0 0 10px var(--cyan, #00f0ff);
  transition: width 0.1s linear;
}

.reading-hud-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.72rem;
  color: var(--muted, #94a3b8);
}

.reading-hud-bar strong {
  color: var(--gold, #fbbf24);
}

/* Reader Mode Toggle Buttons */
.dock-mode-toggle {
  display: inline-flex;
  background: color-mix(in srgb, var(--panel, #0a0e1c) 90%, transparent);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.15));
  border-radius: 999px;
  padding: 3px;
  gap: 4px;
}

.mode-btn {
  background: transparent;
  border: 0;
  color: var(--muted, #94a3b8);
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mode-btn:hover {
  color: var(--text-primary, #fff);
}

.mode-btn.active,
.mode-btn[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--cyan, #00f0ff), var(--violet, #a855f7));
  color: #050508;
  box-shadow: 0 2px 12px rgba(0, 240, 255, 0.35);
}

/* Floating Vertical Mini-Map Rail */
.panel-rail-nav {
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 990;
  padding: 10px 6px;
  background: rgba(5, 5, 8, 0.75);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.12));
  border-radius: 999px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.rail-dot-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 1.5px solid transparent;
  padding: 0;
  cursor: pointer;
  position: relative;
  transition: all 0.25s ease;
}

.rail-dot-btn:hover,
.rail-dot-btn:focus-visible {
  background: var(--cyan, #00f0ff);
  transform: scale(1.3);
}

.rail-dot-btn.active {
  background: var(--gold, #fbbf24);
  box-shadow: 0 0 10px var(--gold, #fbbf24);
  transform: scale(1.4);
  border-color: #fff;
}

.rail-dot-tooltip {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: #0a0e1c;
  border: 1px solid var(--line, rgba(255, 255, 255, 0.18));
  color: #fff;
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.68rem;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.rail-dot-btn:hover .rail-dot-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(-4px);
}

@media (max-width: 1024px) {
  .panel-rail-nav {
    display: none;
  }
}

/* 3D Parallax Tilt Card FX */
.panel-card {
  perspective: 1200px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
  scroll-margin-top: calc(var(--zoth-header-h, 54px) + 24px);
}

.panel-card.active-reading {
  border-color: var(--cyan, #00f0ff) !important;
  box-shadow: 0 12px 40px rgba(0, 240, 255, 0.15) !important;
}

.panel-media-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  transform-style: preserve-3d;
  transition: transform 0.15s ease-out;
  cursor: grab;
}

.panel-media-wrap:active {
  cursor: grabbing;
}

.tilt-glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at var(--glare-x, 50%) var(--glare-y, 50%), rgba(255, 255, 255, 0.25) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.25s ease;
  mix-blend-mode: overlay;
  z-index: 5;
}

.panel-media-wrap:hover .tilt-glare {
  opacity: 1;
}

/* Holographic SFX Callouts */
.sfx-callout-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.sfx-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(10, 14, 28, 0.75);
  border: 1px solid var(--line, rgba(0, 240, 255, 0.25));
  color: var(--cyan, #00f0ff);
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.sfx-chip:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--cyan, #00f0ff);
  color: #fff;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 16px rgba(0, 240, 255, 0.3);
}

.sfx-chip.sfx-gold {
  border-color: rgba(251, 191, 36, 0.3);
  color: var(--gold, #fbbf24);
}

.sfx-chip.sfx-gold:hover {
  background: rgba(251, 191, 36, 0.18);
  border-color: var(--gold, #fbbf24);
  box-shadow: 0 4px 16px rgba(251, 191, 36, 0.35);
}

.sfx-chip.sfx-purple {
  border-color: rgba(168, 85, 247, 0.3);
  color: var(--violet, #a855f7);
}

.sfx-chip.sfx-purple:hover {
  background: rgba(168, 85, 247, 0.2);
  border-color: var(--violet, #a855f7);
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.35);
}

.sfx-burst {
  animation: sfxShockwave 0.5s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes sfxShockwave {
  0% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.18); filter: brightness(1.8) drop-shadow(0 0 12px var(--cyan, #00f0ff)); }
  100% { transform: scale(1); filter: brightness(1); }
}

/* Glowing Cyberpunk Dialogue Balloons */
.dialogue-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}

.dialog-balloon {
  display: flex;
  gap: 12px;
  background: rgba(7, 18, 42, 0.7);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.12));
  border-left: 3px solid var(--cyan, #00f0ff);
  border-radius: 12px;
  padding: 12px 16px;
  transition: all 0.2s ease;
  position: relative;
}

.dialog-balloon:hover {
  background: rgba(7, 18, 42, 0.95);
  border-color: var(--cyan, #00f0ff);
  box-shadow: 0 4px 20px rgba(0, 240, 255, 0.12);
}

.dialog-balloon.speaker-azoth {
  border-left-color: var(--gold, #fbbf24);
}

.dialog-balloon.speaker-leviathan {
  border-left-color: var(--violet, #a855f7);
}

.dialog-balloon.speaker-kraken {
  border-left-color: var(--cyan, #00f0ff);
}

.dialog-balloon.speaker-antigravity {
  border-left-color: #34d399;
}

.dialog-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid var(--line, rgba(255, 255, 255, 0.2));
}

.dialog-body {
  flex: 1;
  min-width: 0;
}

.dialog-speaker-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.dialog-speaker-name {
  font-family: var(--font-display, "Syne", sans-serif);
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-primary, #fff);
}

.dialog-role-tag {
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.64rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dialog-text {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-subhead, #cbd5e1);
  margin: 0;
  font-style: italic;
}

.dialog-text strong {
  color: var(--text-primary, #fff);
  font-style: normal;
}

.dialog-voice-btn {
  background: transparent;
  border: 0;
  color: var(--muted, #94a3b8);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 0.82rem;
  transition: all 0.2s ease;
  align-self: flex-start;
}

.dialog-voice-btn:hover {
  color: var(--gold, #fbbf24);
  background: rgba(251, 191, 36, 0.15);
}

/* Panel Actions Bar */
.panel-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line, rgba(255, 255, 255, 0.08));
}

.btn-snapshot-card {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.15));
  color: var(--text-primary, #fff);
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-snapshot-card:hover {
  background: rgba(251, 191, 36, 0.15);
  border-color: var(--gold, #fbbf24);
  color: var(--gold, #fbbf24);
}

/* CINEMATIC STAGE FOCUS MODE */
body.view-stage .panel-card {
  display: none !important;
}

body.view-stage .panel-card.stage-active {
  display: block !important;
  animation: stageFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes stageFadeIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.stage-controller-deck {
  display: none;
  background: var(--panel, rgba(10, 14, 28, 0.95));
  border: 1px solid var(--line, rgba(255, 255, 255, 0.15));
  border-radius: 20px;
  padding: 16px 24px;
  margin-bottom: 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

body.view-stage .stage-controller-deck {
  display: block;
}

.stage-deck-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.stage-nav-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stage-nav-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.15));
  color: #fff;
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.stage-nav-btn:hover:not(:disabled) {
  background: var(--cyan, #00f0ff);
  color: #050508;
  border-color: var(--cyan, #00f0ff);
}

.stage-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.stage-filmstrip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.stage-thumb {
  width: 90px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.6;
  transition: all 0.2s ease;
}

.stage-thumb:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.stage-thumb.active {
  opacity: 1;
  border-color: var(--gold, #fbbf24);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.4);
}

.stage-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stage-thumb-label {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.58rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 1px 4px;
  border-radius: 3px;
}

/* 1-CLICK QUOTE SNAPSHOT CARD MODAL */
.snapshot-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 4, 8, 0.85);
  backdrop-filter: blur(16px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.snapshot-modal-backdrop.is-open {
  display: flex;
  opacity: 1;
}

.snapshot-modal-box {
  background: #070a14;
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 20px;
  max-width: 640px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(251, 191, 36, 0.15);
  padding: 24px;
  position: relative;
  transform: translateY(12px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.snapshot-modal-backdrop.is-open .snapshot-modal-box {
  transform: translateY(0) scale(1);
}

.snapshot-card-preview {
  background: linear-gradient(145deg, #0a0f24, #04060d);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.snapshot-card-preview::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 80% 20%, rgba(0, 240, 255, 0.08), transparent 50%),
              radial-gradient(circle at 20% 80%, rgba(251, 191, 36, 0.08), transparent 50%);
  pointer-events: none;
}

.snapshot-brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 10px;
}

.snapshot-quote-text {
  font-family: var(--font-display, "Syne", serif);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.5;
  color: #fff;
  margin: 0 0 16px;
}

.snapshot-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.72rem;
  color: var(--muted, #94a3b8);
}

.snapshot-actions-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

/* ========================================================================== */
/* THEME HARMONY OVERRIDES (Solar Light, Matrix CRT, Hermetic Gold)          */
/* ========================================================================== */

/* Solar Light Theme Overrides */
html[data-theme="light"] body {
  background: #f7f9fc !important;
  color: #0f172a !important;
}

html[data-theme="light"] .ep-poster,
html[data-theme="light"] .saga-hero,
html[data-theme="light"] .azoth-poster {
  background: #f1f5f9 !important;
}

html[data-theme="light"] .ep-poster h1,
html[data-theme="light"] .saga-hero h1,
html[data-theme="light"] .azoth-poster h1 {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}

html[data-theme="light"] .ep-poster .lede,
html[data-theme="light"] .teaser-synopsis {
  color: #334155 !important;
}

html[data-theme="light"] .panel-card {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.1) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06) !important;
}

html[data-theme="light"] .panel-card.active-reading {
  border-color: #0284c7 !important;
  box-shadow: 0 8px 30px rgba(2, 132, 199, 0.15) !important;
}

html[data-theme="light"] .panel-title,
html[data-theme="light"] .section-title,
html[data-theme="light"] .char-card h3 {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}

html[data-theme="light"] .panel-script,
html[data-theme="light"] .char-desc {
  color: #334155 !important;
}

html[data-theme="light"] .dialog-balloon {
  background: #f8fafc !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
}

html[data-theme="light"] .dialog-speaker-name {
  color: #0f172a !important;
}

html[data-theme="light"] .dialog-text {
  color: #1e293b !important;
}

html[data-theme="light"] .sfx-chip {
  background: #e2e8f0 !important;
  color: #0369a1 !important;
  border-color: rgba(3, 105, 161, 0.3) !important;
}

html[data-theme="light"] .comic-control-dock,
html[data-theme="light"] .character-roster-section,
html[data-theme="light"] .hadal-visualizer-section,
html[data-theme="light"] .soundboard-card,
html[data-theme="light"] .trailer-box,
html[data-theme="light"] .stage-controller-deck {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
}

html[data-theme="light"] .telemetry-badge,
html[data-theme="light"] .hadal-telemetry-card {
  background: #f1f5f9 !important;
  border-color: rgba(15, 23, 42, 0.1) !important;
  color: #0f172a !important;
}

html[data-theme="light"] .hadal-telemetry-value {
  color: #0f172a !important;
}

html[data-theme="light"] .btn-sfx-drop {
  background: #f8fafc !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
}

html[data-theme="light"] .btn-sfx-drop:hover {
  background: #e0f2fe !important;
  border-color: #0284c7 !important;
}

html[data-theme="light"] .sfx-name {
  color: #0f172a !important;
}

html[data-theme="light"] .sfx-caption {
  color: #475569 !important;
}

html[data-theme="light"] .dock-mode-toggle {
  background: #e2e8f0 !important;
  border-color: rgba(15, 23, 42, 0.15) !important;
}

html[data-theme="light"] .mode-btn {
  color: #475569 !important;
}

html[data-theme="light"] .mode-btn.active {
  color: #ffffff !important;
  background: linear-gradient(135deg, #0284c7, #7c3aed) !important;
}

/* Matrix Theme Overrides */
html[data-theme="matrix"] body {
  background: #020b05 !important;
  color: #bbf7d0 !important;
  font-family: var(--font-theme-mono, "Share Tech Mono", monospace) !important;
}

html[data-theme="matrix"] .panel-card,
html[data-theme="matrix"] .comic-control-dock,
html[data-theme="matrix"] .character-roster-section,
html[data-theme="matrix"] .hadal-visualizer-section,
html[data-theme="matrix"] .soundboard-card {
  background: rgba(2, 20, 10, 0.92) !important;
  border-color: rgba(0, 255, 102, 0.3) !important;
}

html[data-theme="matrix"] .panel-title,
html[data-theme="matrix"] .section-title,
html[data-theme="matrix"] h1,
html[data-theme="matrix"] h2,
html[data-theme="matrix"] h3 {
  color: #00ff66 !important;
  text-shadow: 0 0 10px rgba(0, 255, 102, 0.5) !important;
  -webkit-text-fill-color: #00ff66 !important;
}

html[data-theme="matrix"] .dialog-balloon {
  background: rgba(0, 30, 15, 0.8) !important;
  border-color: rgba(0, 255, 102, 0.35) !important;
  border-left-color: #00ff66 !important;
}

html[data-theme="matrix"] .sfx-chip {
  background: rgba(0, 40, 20, 0.9) !important;
  color: #00ff66 !important;
  border-color: #00ff66 !important;
}

/* Hermetic Gold Theme Overrides */
html[data-theme="gold"] body {
  background: #090602 !important;
  color: #fef3c7 !important;
}

html[data-theme="gold"] .panel-card,
html[data-theme="gold"] .comic-control-dock,
html[data-theme="gold"] .character-roster-section,
html[data-theme="gold"] .soundboard-card {
  background: rgba(18, 12, 4, 0.92) !important;
  border-color: rgba(251, 191, 36, 0.35) !important;
}

html[data-theme="gold"] .panel-card.active-reading {
  border-color: #fbbf24 !important;
  box-shadow: 0 12px 40px rgba(251, 191, 36, 0.2) !important;
}

html[data-theme="gold"] .panel-title,
html[data-theme="gold"] .section-title,
html[data-theme="gold"] h1,
html[data-theme="gold"] h2,
html[data-theme="gold"] h3 {
  color: #fbbf24 !important;
  text-shadow: 0 0 14px rgba(251, 191, 36, 0.4) !important;
  -webkit-text-fill-color: #fbbf24 !important;
}
