/* ==========================================================================
   WEIHNACHTEN LIVE – Interaktive Weihnachtsgeschichte (v1.2.0)
   UI & CI: Warmes Bethlehem-Nachtblau, Öllampen-Gold & Pergament-Bilderbuch
   Perfekt optimiert für iPad (Landscape) UND Smartphone (Mobile Bottom-Tabs)
   ========================================================================== */

:root {
  --bg-night-deep: #0a101f;
  --bg-night-mid: #121c33;
  --bg-night-warm: #1c2438;
  --gold-bright: #f5d076;
  --gold-main: #dfaa42;
  --gold-deep: #b57d1e;
  --gold-glow: rgba(235, 182, 78, 0.35);
  --parchment-light: #fdf9ef;
  --parchment-warm: #f3e8cf;
  --parchment-muted: #d8c8a8;
  --leather-dark: #231710;
  --leather-border: #4a321f;
  --text-light: #fcf7eb;
  --text-soft: #d7ccb4;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --mob-nav-h: 68px;
}

/* On Tablets / iPads in Landscape, use 100% edge-to-edge fullscreen without top status-bar gap */
@media (min-width: 821px) and (min-height: 521px) {
  :root {
    --safe-top: 0px;
    --safe-bottom: 0px;
  }
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior-x: none;
  overscroll-behavior-y: none;
  background-color: var(--bg-night-deep);
  color: var(--text-light);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   0. ANIMATED 3D BOOK OPENING INTRO OVERLAY
   ========================================================================== */

.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 45%, rgba(26, 36, 62, 0.96) 0%, rgba(8, 12, 24, 0.99) 100%);
  transition: opacity 0.65s ease, transform 0.65s ease;
  cursor: pointer;
}

.intro-overlay.fade-out {
  opacity: 0;
  transform: scale(1.18);
  pointer-events: none;
}

.intro-book-scene {
  position: relative;
  perspective: 2000px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.intro-light-burst {
  position: absolute;
  width: min(520px, 90vw);
  height: min(520px, 90vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 218, 128, 0.55) 0%, rgba(223, 170, 66, 0.18) 45%, transparent 72%);
  transform: scale(0.5);
  opacity: 0.3;
  transition: transform 1.8s ease, opacity 1.8s ease;
  pointer-events: none;
}

.intro-book {
  position: relative;
  width: clamp(230px, 34vw, 390px);
  aspect-ratio: 3 / 4;
  transform-style: preserve-3d;
  transition: transform 1.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.intro-book.opening {
  transform: translateX(32%) rotateX(8deg) scale(1.06);
}

.intro-book.opening ~ .intro-light-burst,
.intro-book-scene:has(.intro-book.opening) .intro-light-burst {
  transform: scale(1.45);
  opacity: 1;
}

.intro-book-base {
  position: absolute;
  inset: 0;
  border-radius: 6px 16px 16px 6px;
  background: #2b1b10;
  padding: 10px 12px 10px 6px;
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.85),
    inset -4px 0 10px rgba(255, 236, 190, 0.3);
}

.intro-inside-page {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 4px 12px 12px 4px;
  overflow: hidden;
  background: var(--parchment-light);
  border: 2px solid rgba(223, 170, 66, 0.65);
}

.intro-inside-page img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% center;
}

.intro-page-golden-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 45%, rgba(255, 224, 140, 0.38) 0%, transparent 70%);
}

.intro-book-cover {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform 1.65s cubic-bezier(0.4, 0.0, 0.2, 1);
  z-index: 4;
}

.intro-book.opening .intro-book-cover {
  transform: rotateY(-158deg);
}

.cover-front,
.cover-inside {
  position: absolute;
  inset: 0;
  border-radius: 6px 16px 16px 6px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.cover-front {
  transform: rotateY(0deg) translateZ(2px);
  background: radial-gradient(circle at 50% 35%, #3d2414 0%, #1d1008 85%);
  border: 2px solid rgba(245, 208, 118, 0.55);
  box-shadow:
    inset 0 0 30px rgba(0, 0, 0, 0.7),
    10px 18px 40px rgba(0, 0, 0, 0.65);
  padding: 16px;
  display: flex;
}

.cover-ornament-border {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  border: 1.5px solid rgba(245, 208, 118, 0.52);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  box-shadow: inset 0 0 0 4px rgba(245, 208, 118, 0.12);
}

.cover-star-emblem {
  width: 58px;
  height: 58px;
  filter: drop-shadow(0 0 18px rgba(245, 208, 118, 0.85));
}

.cover-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--gold-bright);
}

.cover-title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 2.5vw, 2.25rem);
  font-weight: 700;
  line-height: 1.08;
  color: var(--parchment-light);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
}

.cover-divider {
  color: var(--gold-main);
  letter-spacing: 0.3em;
  font-size: 0.8rem;
}

.cover-sub {
  font-size: 0.76rem;
  color: var(--parchment-warm);
  opacity: 0.85;
}

.cover-inside {
  transform: rotateY(180deg) translateZ(2px);
  background: linear-gradient(135deg, #2a1a0f 0%, #1d120a 100%);
  padding: 10px 6px 10px 12px;
  border-radius: 16px 6px 6px 16px;
}

.cover-inside-parchment {
  width: 100%;
  height: 100%;
  border-radius: 10px 4px 4px 10px;
  background: linear-gradient(90deg, #e8d9b8 0%, #faf2df 85%, #d6c39c 100%);
  border: 1px solid rgba(181, 125, 30, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  text-align: center;
}

.inside-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  color: #3a2615;
  line-height: 1.45;
}

body.intro-playing .anim-stagger-1,
body.intro-playing .anim-stagger-2,
body.intro-playing .anim-stagger-3 {
  opacity: 0;
  transform: translateY(14px) scale(0.985);
}

.anim-stagger-1,
.anim-stagger-2,
.anim-stagger-3 {
  transition: opacity 0.65s ease, transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

body.intro-complete .anim-stagger-1 { transition-delay: 0.05s; }
body.intro-complete .anim-stagger-2 { transition-delay: 0.14s; }
body.intro-complete .anim-stagger-3 { transition-delay: 0.24s; }

/* ==========================================================================
   ATMOSPHERIC BACKGROUND (Starfield & Bethlehem Glow)
   ========================================================================== */

#starfield-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.bethlehem-sky-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 65% 45% at 50% 8%, rgba(236, 184, 82, 0.16) 0%, transparent 70%),
    radial-gradient(ellipse 80% 55% at 50% 42%, rgba(44, 62, 102, 0.45) 0%, transparent 75%),
    linear-gradient(180deg, #090f1d 0%, #121c34 52%, #191a29 100%);
}

/* ==========================================================================
   VIEWS CONTAINER
   ========================================================================== */

.app-view {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  z-index: 2;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.app-view.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ==========================================================================
   1. STARTSEITE (One-Screen iPad Landscape Layout)
   ========================================================================== */

#view-home {
  display: grid;
  grid-template-rows: auto minmax(0, 1.38fr) minmax(0, 0.92fr);
  gap: clamp(8px, 1.4vh, 16px);
  padding:
    calc(var(--safe-top) + clamp(8px, 1.4vh, 16px))
    calc(var(--safe-right) + clamp(16px, 2.6vw, 36px))
    calc(var(--safe-bottom) + clamp(10px, 1.6vh, 18px))
    calc(var(--safe-left) + clamp(16px, 2.6vw, 36px));
}

.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-star {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 10px rgba(245, 208, 118, 0.65));
  animation: starPulse 4s ease-in-out infinite;
}

@keyframes starPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 9px rgba(245, 208, 118, 0.55)); }
  50% { transform: scale(1.09); filter: drop-shadow(0 0 16px rgba(255, 226, 150, 0.9)); }
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-kicker {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  letter-spacing: 0.12em;
  color: var(--gold-bright);
  line-height: 1.05;
}

.brand-sub {
  font-size: clamp(0.72rem, 0.95vw, 0.85rem);
  color: var(--text-soft);
  letter-spacing: 0.03em;
}

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

.pill-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.81rem;
  font-weight: 500;
  color: var(--parchment-warm);
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.09) 0%,
    rgba(255, 248, 230, 0.03) 55%,
    rgba(245, 208, 118, 0.05) 100%
  );
  border: 1px solid rgba(255, 248, 230, 0.20);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow:
    inset 0 1px 0.5px rgba(255, 255, 255, 0.28),
    0 4px 14px rgba(0, 0, 0, 0.24);
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}

.pill-btn:hover, .pill-btn:active {
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.14) 0%,
    rgba(245, 208, 118, 0.09) 100%
  );
  border-color: rgba(255, 248, 230, 0.34);
  transform: translateY(-1px);
}

.pill-btn.active {
  background: linear-gradient(
    165deg,
    rgba(255, 248, 224, 0.14) 0%,
    rgba(243, 200, 102, 0.08) 55%,
    rgba(212, 148, 42, 0.11) 100%
  );
  border-color: rgba(245, 208, 118, 0.34);
  color: #fffaf0;
  box-shadow:
    inset 0 1px 0.5px rgba(255, 255, 255, 0.34),
    0 4px 14px rgba(0, 0, 0, 0.26);
}

.pill-btn.subtle {
  opacity: 0.82;
}

.pill-btn.offline-pill.ready {
  background: linear-gradient(
    165deg,
    rgba(190, 250, 215, 0.12) 0%,
    rgba(58, 168, 108, 0.08) 100%
  );
  border-color: rgba(130, 230, 175, 0.32);
  color: #dfffe9;
  box-shadow:
    inset 0 1px 0.5px rgba(255, 255, 255, 0.28),
    0 4px 14px rgba(0, 0, 0, 0.24);
}

/* ==========================================================================
   UPPER STAGE: PROMINENT STORYBOOK HERO
   ========================================================================== */

.hero-stage {
  min-height: 0;
  display: flex;
}

.storybook-hero-card {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 22px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  align-items: center;
  background: #1a1410;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(245, 208, 118, 0.32),
    inset 0 0 40px rgba(0, 0, 0, 0.5);
}

.hero-visual-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  transform-origin: 65% 45%;
  animation: heroBreath 22s ease-in-out infinite alternate;
  filter: saturate(1.06) contrast(1.03);
}

@keyframes heroBreath {
  0% { transform: scale(1.01) translate(0, 0); }
  100% { transform: scale(1.13) translate(-2%, -1.2%); }
}

.hero-candle-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 62% 54%, rgba(255, 198, 92, 0.24) 0%, transparent 55%);
  mix-blend-mode: screen;
  animation: candleFlicker 5s ease-in-out infinite alternate;
}

@keyframes candleFlicker {
  0% { opacity: 0.75; transform: scale(0.98); }
  50% { opacity: 1; transform: scale(1.03); }
  100% { opacity: 0.82; transform: scale(1); }
}

.hero-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(11, 16, 30, 0.93) 0%, rgba(14, 19, 34, 0.80) 46%, rgba(15, 18, 28, 0.28) 78%, rgba(12, 15, 24, 0.55) 100%),
    linear-gradient(180deg, rgba(10, 14, 26, 0.35) 0%, rgba(10, 14, 26, 0.1) 50%, rgba(10, 14, 26, 0.65) 100%);
}

.hero-book-border {
  position: absolute;
  inset: 10px;
  border-radius: 15px;
  border: 1px solid rgba(245, 208, 118, 0.28);
  pointer-events: none;
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  padding: clamp(18px, 3vh, 34px) clamp(22px, 3.2vw, 42px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(8px, 1.4vh, 14px);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 5px 13px;
  border-radius: 999px;
  background: rgba(245, 208, 118, 0.15);
  border: 1px solid rgba(245, 208, 118, 0.42);
  color: var(--gold-bright);
  font-size: clamp(0.72rem, 0.95vw, 0.84rem);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 8px var(--gold-bright);
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 3.7vw, 3.25rem);
  font-weight: 700;
  line-height: 1.04;
  color: var(--parchment-light);
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.65);
}

.hero-lead {
  font-size: clamp(0.88rem, 1.2vw, 1.06rem);
  line-height: 1.45;
  color: var(--parchment-warm);
  max-width: 54ch;
  opacity: 0.92;
}

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: clamp(4px, 0.8vh, 10px);
}

.hero-play-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 13px;
  padding: clamp(9px, 1.4vh, 13px) clamp(16px, 1.9vw, 23px);
  border-radius: 999px;
  text-align: left;
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  transition: transform 0.24s ease, box-shadow 0.24s ease, background 0.24s ease, border-color 0.24s ease;
}

/* Subtle Liquid Glass Specular Sheen */
.hero-play-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    170deg,
    rgba(255, 255, 255, 0.16) 0%,
    rgba(255, 255, 255, 0.03) 40%,
    rgba(255, 255, 255, 0) 60%
  );
  pointer-events: none;
}

.hero-play-btn.primary {
  background: linear-gradient(
    145deg,
    rgba(245, 210, 128, 0.20) 0%,
    rgba(218, 162, 62, 0.13) 52%,
    rgba(185, 125, 28, 0.18) 100%
  );
  color: var(--parchment-light);
  border: 1px solid rgba(245, 208, 118, 0.38);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.42),
    inset 0 -1px 2px rgba(212, 148, 42, 0.18),
    0 10px 26px rgba(0, 0, 0, 0.38);
}

.hero-play-btn.primary:hover, .hero-play-btn.primary:active {
  transform: translateY(-1.5px);
  background: linear-gradient(
    145deg,
    rgba(245, 210, 128, 0.28) 0%,
    rgba(218, 162, 62, 0.18) 52%,
    rgba(185, 125, 28, 0.24) 100%
  );
  border-color: rgba(245, 208, 118, 0.56);
  box-shadow:
    inset 0 1px 1.5px rgba(255, 255, 255, 0.52),
    0 12px 30px rgba(0, 0, 0, 0.45);
}

.hero-play-btn.secondary {
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(16, 22, 38, 0.32) 55%,
    rgba(245, 208, 118, 0.06) 100%
  );
  color: var(--parchment-warm);
  border: 1px solid rgba(255, 248, 230, 0.22);
  box-shadow:
    inset 0 1px 0.5px rgba(255, 255, 255, 0.30),
    0 8px 22px rgba(0, 0, 0, 0.34);
}

.hero-play-btn.secondary:hover, .hero-play-btn.secondary:active {
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.13) 0%,
    rgba(16, 22, 38, 0.36) 55%,
    rgba(245, 208, 118, 0.12) 100%
  );
  border-color: rgba(245, 208, 118, 0.38);
  transform: translateY(-1.5px);
}

.play-circle {
  position: relative;
  z-index: 1;
  width: clamp(38px, 4.4vh, 44px);
  height: clamp(38px, 4.4vh, 44px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero-play-btn.primary .play-circle {
  background: radial-gradient(
    circle at 32% 24%,
    rgba(255, 250, 235, 0.34) 0%,
    rgba(245, 208, 118, 0.22) 50%,
    rgba(195, 132, 32, 0.24) 100%
  );
  color: #fffaf0;
  border: 1px solid rgba(255, 248, 225, 0.46);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.52),
    0 4px 12px rgba(0, 0, 0, 0.28);
}

.hero-play-btn.secondary .play-circle {
  background: radial-gradient(
    circle at 32% 24%,
    rgba(255, 255, 255, 0.18) 0%,
    rgba(245, 208, 118, 0.10) 100%
  );
  color: var(--gold-bright);
  border: 1px solid rgba(255, 248, 230, 0.28);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.38),
    0 4px 10px rgba(0, 0, 0, 0.24);
}

.play-circle svg {
  width: 20px;
  height: 20px;
  margin-left: 2px;
}

.btn-copy {
  display: flex;
  flex-direction: column;
}

.btn-main {
  font-weight: 700;
  font-size: clamp(0.92rem, 1.2vw, 1.06rem);
  line-height: 1.15;
}

.btn-lang {
  font-size: clamp(0.74rem, 0.95vw, 0.82rem);
  opacity: 0.85;
  font-weight: 500;
}

.hero-scenes-preview {
  position: relative;
  z-index: 3;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-right: 24px;
  cursor: pointer;
}

.preview-card {
  width: clamp(150px, 18vw, 230px);
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--parchment-warm);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6);
  transition: transform 0.35s ease;
}

.preview-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-card.c1 {
  transform: rotate(-6deg) translate(-18px, 12px);
}
.preview-card.c2 {
  transform: rotate(3deg) translate(14px, -16px);
  z-index: 2;
}
.preview-card.c3 {
  transform: rotate(-2deg) translate(-6px, -38px);
  z-index: 3;
}

.hero-scenes-preview:hover .preview-card.c1 {
  transform: rotate(-9deg) translate(-26px, 8px) scale(1.03);
}
.hero-scenes-preview:hover .preview-card.c2 {
  transform: rotate(5deg) translate(22px, -20px) scale(1.04);
}
.hero-scenes-preview:hover .preview-card.c3 {
  transform: rotate(0deg) translate(-4px, -42px) scale(1.06);
}

.preview-caption {
  margin-top: -24px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(15, 22, 38, 0.85);
  border: 1px solid rgba(245, 208, 118, 0.4);
  color: var(--gold-bright);
  font-size: 0.75rem;
  font-weight: 600;
}

/* ==========================================================================
   LOWER STAGE: 5 CHARACTER STATIONS
   ========================================================================== */

.stations-section {
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(6px, 1vh, 12px);
}

.stations-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
}

.stations-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stations-ornament {
  color: var(--gold-main);
  font-size: 0.9rem;
}

.stations-title {
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 1.7vw, 1.5rem);
  font-weight: 700;
  color: var(--parchment-light);
}

.stations-subtitle {
  font-size: clamp(0.74rem, 0.95vw, 0.85rem);
  color: var(--text-soft);
}

.stations-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(10px, 1.4vw, 18px);
}

.station-card {
  position: relative;
  height: 100%;
  min-height: 0;
  border-radius: 18px;
  padding: clamp(8px, 1.1vh, 12px);
  background: linear-gradient(180deg, rgba(30, 39, 64, 0.82) 0%, rgba(17, 23, 39, 0.95) 100%);
  border: 1px solid rgba(235, 190, 98, 0.28);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.42);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
  overflow: hidden;
}

.station-card:hover, .station-card:active {
  transform: translateY(-4px);
  border-color: var(--gold-bright);
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.58),
    0 0 20px rgba(235, 182, 78, 0.22);
}

.station-arch-wrap {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  border-radius: 999px 999px 12px 12px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 214, 128, 0.42) 0%, rgba(196, 132, 45, 0.18) 55%, rgba(18, 24, 42, 0.95) 100%);
  border: 1.5px solid rgba(245, 208, 118, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
}

.station-arch-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 45%, var(--char-accent, #dfaa42) 0%, transparent 70%);
  opacity: 0.28;
  pointer-events: none;
}

.station-char-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 14%;
  transition: transform 0.4s ease;
}

.station-card:hover .station-char-img {
  transform: scale(1.06);
}

.station-play-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 30% 24%,
    rgba(255, 250, 235, 0.28) 0%,
    rgba(16, 22, 38, 0.42) 60%,
    rgba(245, 208, 118, 0.22) 100%
  );
  color: var(--gold-bright);
  border: 1px solid rgba(255, 248, 225, 0.38);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.42),
    0 4px 12px rgba(0, 0, 0, 0.45);
}

.station-card-info {
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.station-num-tag {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold-bright);
  font-weight: 700;
}

.station-char-name {
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 1.9vw, 1.75rem);
  font-weight: 700;
  color: var(--parchment-light);
  line-height: 1.08;
  letter-spacing: 0.01em;
}

.station-char-role {
  font-size: clamp(0.74rem, 0.92vw, 0.84rem);
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   2. FULLSCREEN STORYBOOK PLAYER (100% EDGE-TO-EDGE + FLOATING LIQUID GLASS UI)
   ========================================================================== */

#view-story {
  position: fixed;
  inset: 0;
  padding: 0;
  display: block;
  overflow: hidden;
  background: #0c0a08;
}

.fs-topbar {
  position: absolute;
  top: calc(var(--safe-top) + 16px);
  left: calc(var(--safe-left) + 24px);
  right: calc(var(--safe-right) + 24px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 20;
  pointer-events: none;
}

.fs-topbar > * {
  pointer-events: auto;
}

.fs-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.10) 0%,
    rgba(12, 18, 32, 0.28) 55%,
    rgba(245, 208, 118, 0.08) 100%
  );
  border: 1px solid rgba(255, 250, 238, 0.28);
  backdrop-filter: blur(16px) saturate(145%);
  -webkit-backdrop-filter: blur(16px) saturate(145%);
  color: #fffdf7;
  font-weight: 600;
  font-size: 0.86rem;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.42),
    0 8px 22px rgba(0, 0, 0, 0.38);
  transition: all 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.fs-back-btn:hover, .fs-back-btn:active {
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.18) 0%,
    rgba(12, 18, 32, 0.34) 55%,
    rgba(245, 208, 118, 0.16) 100%
  );
  border-color: rgba(255, 252, 240, 0.48);
  transform: translateY(-1px);
}

.story-chapter-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 20px;
  border-radius: 999px;
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(12, 18, 32, 0.30) 55%,
    rgba(245, 208, 118, 0.06) 100%
  );
  border: 1px solid rgba(255, 250, 238, 0.26);
  backdrop-filter: blur(16px) saturate(145%);
  -webkit-backdrop-filter: blur(16px) saturate(145%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.38),
    0 8px 24px rgba(0, 0, 0, 0.38);
  font-size: 0.9rem;
  color: var(--parchment-warm);
  min-width: 0;
}

.story-chapter-pill strong {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--gold-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pill-sep {
  opacity: 0.45;
}

.story-lang-switch {
  display: inline-flex;
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(12, 18, 32, 0.30) 100%
  );
  border: 1px solid rgba(255, 250, 238, 0.26);
  backdrop-filter: blur(16px) saturate(145%);
  -webkit-backdrop-filter: blur(16px) saturate(145%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.38),
    0 8px 20px rgba(0, 0, 0, 0.36);
  border-radius: 999px;
  padding: 3px;
}

.lang-chip {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--parchment-warm);
  transition: all 0.2s ease;
}

.lang-chip.active {
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.24) 0%,
    rgba(245, 208, 118, 0.22) 100%
  );
  color: #fffdf7;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.52),
    0 4px 12px rgba(0, 0, 0, 0.28);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.book-outer-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.open-book-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  aspect-ratio: auto;
  padding: 0;
  border-radius: 0;
  background: #0c0a08;
  box-shadow: none;
  display: block;
}

.book-paper-stack {
  display: none;
}

.book-viewport {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
  overflow: hidden;
  background: #14110e;
  z-index: 2;
}

.scene-layer.current {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
}

.scene-layer.current.hidden-during-turn {
  opacity: 0;
}

.scene-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform;
}

.scene-img.kb-paused {
  animation-play-state: paused !important;
}

/* Expressive Ken Burns Camera Movements (all start at exact identity 0% so 3D page turn never jumps!) */
.kb-scene-1 {
  transform-origin: 68% 46%;
  animation: kbScene1 24s ease-in-out infinite alternate;
}
.kb-scene-2 {
  transform-origin: 65% 38%;
  animation: kbScene2 24s ease-in-out infinite alternate;
}
.kb-scene-3 {
  transform-origin: 78% 28%;
  animation: kbScene3 24s ease-in-out infinite alternate;
}
.kb-scene-4 {
  transform-origin: 62% 45%;
  animation: kbScene4 24s ease-in-out infinite alternate;
}
.kb-scene-5 {
  transform-origin: 52% 58%;
  animation: kbScene5 24s ease-in-out infinite alternate;
}
.kb-scene-6 {
  transform-origin: 68% 26%;
  animation: kbScene6 24s ease-in-out infinite alternate;
}
.kb-scene-7 {
  transform-origin: 82% 22%;
  animation: kbScene7 24s ease-in-out infinite alternate;
}

@keyframes kbScene1 {
  0% { transform: scale(1) translate3d(0%, 0%, 0); }
  100% { transform: scale(1.15) translate3d(1.6%, -1.4%, 0); }
}
@keyframes kbScene2 {
  0% { transform: scale(1) translate3d(0%, 0%, 0); }
  100% { transform: scale(1.14) translate3d(-1.8%, 1.0%, 0); }
}
@keyframes kbScene3 {
  0% { transform: scale(1) translate3d(0%, 0%, 0); }
  100% { transform: scale(1.15) translate3d(2.0%, -1.5%, 0); }
}
@keyframes kbScene4 {
  0% { transform: scale(1) translate3d(0%, 0%, 0); }
  100% { transform: scale(1.14) translate3d(1.8%, -1.2%, 0); }
}
@keyframes kbScene5 {
  0% { transform: scale(1) translate3d(0%, 0%, 0); }
  100% { transform: scale(1.16) translate3d(0%, -1.8%, 0); }
}
@keyframes kbScene6 {
  0% { transform: scale(1) translate3d(0%, 0%, 0); }
  100% { transform: scale(1.15) translate3d(1.8%, -1.5%, 0); }
}
@keyframes kbScene7 {
  0% { transform: scale(1) translate3d(0%, 0%, 0); }
  100% { transform: scale(1.15) translate3d(-1.8%, 1.2%, 0); }
}

/* ==========================================================================
   BULLETPROOF 4-HALF 3D PAGE-TURN SYSTEM (NO FILTER ON 3D ELEMENTS!)
   ========================================================================== */

.book-turn-underlay {
  position: absolute;
  inset: 0;
  display: flex;
  z-index: 2;
  visibility: hidden;
  pointer-events: none;
}

.book-turn-underlay.active {
  visibility: visible;
}

.underlay-half {
  position: relative;
  width: 50%;
  height: 100%;
  overflow: hidden;
}

.underlay-half.left-side img {
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 100%;
  object-fit: cover;
}

.underlay-half.right-side img {
  position: absolute;
  top: 0;
  left: -100%;
  width: 200%;
  height: 100%;
  object-fit: cover;
}

/* Moving Cast Shadow underneath the turning leaf */
.page-turn-cast-shadow {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 22%;
  left: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.65) 0%, transparent 75%);
  opacity: 0;
  pointer-events: none;
}

.page-turn-cast-shadow.shadow-forward {
  animation: castShadowForward 1.15s ease-in-out forwards;
}

.page-turn-cast-shadow.shadow-backward {
  animation: castShadowBackward 1.15s ease-in-out forwards;
}

@keyframes castShadowForward {
  0% { left: 72%; opacity: 0; }
  45% { left: 42%; opacity: 0.85; }
  100% { left: 8%; opacity: 0; }
}

@keyframes castShadowBackward {
  0% { left: 8%; opacity: 0; }
  45% { left: 42%; opacity: 0.85; }
  100% { left: 72%; opacity: 0; }
}

/* Pure 3D Spine-Hinged Stage:
   - .page-front is hinged on the RIGHT of the spine (left: 50%, transform-origin: left center, rotates 0deg <-> -90deg)
   - .page-back is hinged on the LEFT of the spine (left: 0%, transform-origin: right center, rotates +90deg <-> 0deg)
   Neither face ever rotates past 90°, so WebKit backface-culling can NEVER hide a page or expose mismatched halves! */
.page-flip-3d-stage {
  position: absolute;
  inset: 0;
  perspective: 2500px;
  -webkit-perspective: 2500px;
  z-index: 5;
  visibility: hidden;
  pointer-events: none;
}

.page-flip-3d-stage.active {
  visibility: visible;
}

.page-flip-leaf {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}

.page-face {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
  background: #1d150e;
  will-change: transform, opacity;
}

.page-front {
  left: 50%;
  transform-origin: left center;
  transform: rotateY(0deg);
}

.page-back {
  left: 0%;
  transform-origin: right center;
  transform: rotateY(90deg);
  opacity: 0;
}

/* Forward Page Turn (Right page lifts 0° -> -90°, then Left page folds down +90° -> 0°) */
.page-flip-leaf.flip-forward .page-front {
  animation: pageFrontForward 1.15s cubic-bezier(0.645, 0.045, 0.355, 1.000) forwards;
}

.page-flip-leaf.flip-forward .page-back {
  animation: pageBackForward 1.15s cubic-bezier(0.645, 0.045, 0.355, 1.000) forwards;
}

/* Backward Page Turn (Left page lifts 0° -> +90°, then Right page folds down -90° -> 0°) */
.page-flip-leaf.flip-backward .page-back {
  animation: pageBackBackward 1.15s cubic-bezier(0.645, 0.045, 0.355, 1.000) forwards;
}

.page-flip-leaf.flip-backward .page-front {
  animation: pageFrontBackward 1.15s cubic-bezier(0.645, 0.045, 0.355, 1.000) forwards;
}

@keyframes pageFrontForward {
  0% { transform: rotateY(0deg); opacity: 1; }
  49.9% { transform: rotateY(-90deg); opacity: 1; }
  50%, 100% { transform: rotateY(-90deg); opacity: 0; }
}

@keyframes pageBackForward {
  0%, 49.9% { transform: rotateY(90deg); opacity: 0; }
  50% { transform: rotateY(90deg); opacity: 1; }
  100% { transform: rotateY(0deg); opacity: 1; }
}

@keyframes pageBackBackward {
  0% { transform: rotateY(0deg); opacity: 1; }
  49.9% { transform: rotateY(90deg); opacity: 1; }
  50%, 100% { transform: rotateY(90deg); opacity: 0; }
}

@keyframes pageFrontBackward {
  0%, 49.9% { transform: rotateY(-90deg); opacity: 0; }
  50% { transform: rotateY(-90deg); opacity: 1; }
  100% { transform: rotateY(0deg); opacity: 1; }
}

.page-half-clip {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.page-half-clip.right-half img {
  position: absolute;
  top: 0;
  left: -100%;
  width: 200%;
  height: 100%;
  object-fit: cover;
}

.page-half-clip.left-half img {
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 100%;
  object-fit: cover;
}

.page-curl-gradient {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.page-curl-gradient.front-grad {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.38) 0%, transparent 24%, rgba(255, 240, 200, 0.22) 88%, rgba(0, 0, 0, 0.32) 100%);
}

.page-curl-gradient.back-grad {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.28) 0%, rgba(255, 244, 214, 0.24) 14%, transparent 50%, rgba(0, 0, 0, 0.45) 100%);
}

/* ==========================================================================
   4. 3D MULTI-PLANE DEPTH, VOLUMETRIC LIGHT RAYS & SUBTLE DUST MOTES
   ========================================================================== */

/* 3D Diorama Tilt on the active scene layer (controlled by pointer or gentle autonomous float) */
.book-viewport {
  --tilt-rx: 0deg;
  --tilt-ry: 0deg;
  --shift-x: 0px;
  --shift-y: 0px;
  perspective: 1400px;
}

.scene-layer.current {
  transform: rotateX(var(--tilt-rx)) rotateY(var(--tilt-ry)) scale(1.022);
  transform-style: preserve-3d;
  transition: transform 0.25s ease-out;
}

/* Foreground Plane 1: Volumetric Sunbeams / Lantern Rays moving in counter-parallax */
.scene-3d-light-rays {
  position: absolute;
  inset: -12%;
  z-index: 6;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.46;
  background:
    repeating-linear-gradient(
      118deg,
      rgba(255, 236, 185, 0.0) 0%,
      rgba(255, 236, 185, 0.08) 7%,
      rgba(255, 245, 215, 0.16) 11%,
      rgba(255, 236, 185, 0.04) 16%,
      rgba(255, 236, 185, 0.0) 26%
    ),
    radial-gradient(ellipse at 65% 22%, rgba(255, 232, 168, 0.22) 0%, transparent 65%);
  filter: blur(12px);
  transform: translate3d(calc(var(--shift-x) * -1.4), calc(var(--shift-y) * -1.2), 0);
  animation: raysFloat3D 18s ease-in-out infinite alternate;
}

@keyframes raysFloat3D {
  0% { transform: translate3d(calc(var(--shift-x) * -1.4 - 1.5%), calc(var(--shift-y) * -1.2 - 1%), 0) rotate(-1.5deg) scale(1.02); }
  100% { transform: translate3d(calc(var(--shift-x) * -1.4 + 2.0%), calc(var(--shift-y) * -1.2 + 1%), 0) rotate(1.5deg) scale(1.08); }
}

/* Foreground Plane 2: 3D Depth-of-Field Framing Vignette (creates spatial diorama box depth) */
.scene-3d-depth-vignette {
  position: absolute;
  inset: -4%;
  z-index: 6;
  pointer-events: none;
  background: radial-gradient(
    ellipse at calc(50% + var(--shift-x) * 0.5) calc(50% + var(--shift-y) * 0.5),
    transparent 54%,
    rgba(8, 10, 18, 0.36) 84%,
    rgba(6, 8, 14, 0.68) 100%
  );
  transform: translate3d(calc(var(--shift-x) * 0.8), calc(var(--shift-y) * 0.8), 0);
  transition: transform 0.2s ease-out;
}

.scene-atmosphere-glow {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  mix-blend-mode: screen;
  background: radial-gradient(circle at 50% 48%, rgba(255, 215, 118, 0.20) 0%, transparent 65%);
  animation: candleFlicker 4.5s ease-in-out infinite alternate;
  transition: background 1s ease;
}

.scene-atmosphere-glow[data-mode="angel-light"] {
  background: radial-gradient(circle at 38% 35%, rgba(255, 240, 175, 0.36) 0%, transparent 62%);
}
.scene-atmosphere-glow[data-mode="manger-radiance"] {
  background: radial-gradient(circle at 52% 62%, rgba(255, 214, 115, 0.36) 0%, transparent 58%);
}
.scene-atmosphere-glow[data-mode="star-choir"] {
  background: radial-gradient(circle at 72% 24%, rgba(255, 246, 195, 0.36) 0%, transparent 60%);
}

.book-particles-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 6;
  pointer-events: none;
}

.book-center-crease {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 44px;
  transform: translateX(-50%);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 0, 0, 0.32) 38%,
    rgba(0, 0, 0, 0.62) 50%,
    rgba(255, 245, 220, 0.12) 56%,
    transparent 100%
  );
  z-index: 7;
  pointer-events: none;
}

.book-inner-border {
  position: absolute;
  inset: 0;
  border-radius: 0;
  border: none;
  box-shadow: inset 0 0 55px rgba(0, 0, 0, 0.45);
  z-index: 7;
  pointer-events: none;
}

.scene-caption-banner {
  position: absolute;
  bottom: calc(var(--safe-bottom) + 92px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 22px;
  border-radius: 999px;
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(12, 18, 32, 0.34) 55%,
    rgba(245, 208, 118, 0.06) 100%
  );
  border: 1px solid rgba(255, 250, 238, 0.28);
  backdrop-filter: blur(16px) saturate(145%);
  -webkit-backdrop-filter: blur(16px) saturate(145%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.38),
    0 10px 28px rgba(0, 0, 0, 0.48);
  max-width: 90%;
}

.caption-num {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--gold-bright);
  padding-right: 10px;
  border-right: 1px solid rgba(245, 208, 118, 0.35);
}

.caption-text {
  font-family: var(--font-serif);
  font-size: clamp(0.95rem, 1.45vw, 1.28rem);
  color: var(--parchment-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Big Center Play Overlay (Subtle & Transparent Liquid Glass Style) */
.big-play-overlay {
  position: absolute;
  inset: 0;
  z-index: 9;
  background: radial-gradient(circle at 50% 50%, rgba(10, 14, 24, 0.14) 0%, rgba(10, 14, 24, 0.32) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.giant-play-btn {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
  padding: clamp(18px, 2.8vh, 26px) clamp(26px, 3.6vw, 42px);
  border-radius: 30px;
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.10) 0%,
    rgba(16, 22, 38, 0.24) 55%,
    rgba(245, 208, 118, 0.08) 100%
  );
  border: 1px solid rgba(255, 250, 238, 0.28);
  backdrop-filter: blur(16px) saturate(145%);
  -webkit-backdrop-filter: blur(16px) saturate(145%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.42),
    inset 0 -1px 3px rgba(245, 208, 118, 0.14),
    0 18px 42px rgba(0, 0, 0, 0.45);
  transition: transform 0.26s ease, box-shadow 0.26s ease, border-color 0.26s ease, background 0.26s ease;
  text-align: center;
}

/* Subtle Liquid Glass Specular Sheen */
.giant-play-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    168deg,
    rgba(255, 255, 255, 0.18) 0%,
    rgba(255, 255, 255, 0.03) 38%,
    rgba(255, 255, 255, 0) 55%
  );
  pointer-events: none;
}

.giant-play-btn:hover, .giant-play-btn:active {
  transform: translateY(-2px) scale(1.02);
  border-color: rgba(255, 252, 240, 0.46);
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(16, 22, 38, 0.28) 55%,
    rgba(245, 208, 118, 0.14) 100%
  );
}

/* Even More Transparent Liquid Glass on Individual Character Stations! */
.char-giant-btn {
  width: 100%;
  max-width: 430px;
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.06) 0%,
    rgba(12, 18, 32, 0.16) 55%,
    rgba(245, 208, 118, 0.05) 100%
  );
  border: 1px solid rgba(255, 250, 238, 0.22);
  backdrop-filter: blur(12px) saturate(135%);
  -webkit-backdrop-filter: blur(12px) saturate(135%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.34),
    0 14px 36px rgba(0, 0, 0, 0.38);
}

.giant-play-icon {
  position: relative;
  z-index: 1;
  width: clamp(64px, 8vh, 82px);
  height: clamp(64px, 8vh, 82px);
  border-radius: 50%;
  background: radial-gradient(
    circle at 32% 22%,
    rgba(255, 255, 255, 0.36) 0%,
    rgba(255, 235, 175, 0.22) 42%,
    rgba(218, 152, 38, 0.20) 100%
  );
  border: 1px solid rgba(255, 252, 240, 0.48);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  color: #fffdf7;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 1.5px 2px rgba(255, 255, 255, 0.58),
    inset 0 -2px 4px rgba(180, 115, 20, 0.22),
    0 8px 22px rgba(0, 0, 0, 0.35);
}

.char-giant-btn .giant-play-icon {
  background: radial-gradient(
    circle at 32% 22%,
    rgba(255, 255, 255, 0.24) 0%,
    rgba(255, 235, 175, 0.14) 50%,
    rgba(218, 152, 38, 0.14) 100%
  );
  border-color: rgba(255, 252, 240, 0.38);
}

.giant-play-icon svg {
  width: 38px;
  height: 38px;
  margin-left: 4px;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.45));
}

.giant-play-rings {
  position: absolute;
  top: clamp(16px, 2.5vh, 24px);
  width: clamp(70px, 8.5vh, 88px);
  height: clamp(70px, 8.5vh, 88px);
  border-radius: 50%;
  border: 1px solid rgba(255, 248, 225, 0.36);
  animation: ringRipple 2.6s ease-out infinite;
  pointer-events: none;
}

@keyframes ringRipple {
  0% { transform: scale(0.95); opacity: 0.85; }
  100% { transform: scale(1.48); opacity: 0; }
}

.giant-play-label {
  position: relative;
  z-index: 1;
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 2.2vw, 1.85rem);
  font-weight: 700;
  color: #fffdf7;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.65);
}

.giant-play-sub {
  position: relative;
  z-index: 1;
  font-size: clamp(0.78rem, 1vw, 0.88rem);
  color: #fff5d6;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.65);
  opacity: 0.95;
}

/* ==========================================================================
   FLOATING BOTTOM TIMELINE & SYNCHRONIZED SCRUB BAR (SUBTLE LIQUID GLASS)
   ========================================================================== */

.fs-bottombar {
  position: absolute;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 16px);
  transform: translateX(-50%);
  width: min(calc(100% - 48px), 1080px);
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 9px 18px;
  border-radius: 24px;
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(12, 18, 32, 0.28) 55%,
    rgba(245, 208, 118, 0.06) 100%
  );
  border: 1px solid rgba(255, 250, 238, 0.26);
  backdrop-filter: blur(16px) saturate(145%);
  -webkit-backdrop-filter: blur(16px) saturate(145%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.38),
    inset 0 -1px 2px rgba(245, 208, 118, 0.12),
    0 14px 36px rgba(0, 0, 0, 0.44);
}

.timeline-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ctrl-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fffdf7;
  background: radial-gradient(
    circle at 32% 24%,
    rgba(255, 255, 255, 0.18) 0%,
    rgba(12, 18, 32, 0.28) 60%,
    rgba(245, 208, 118, 0.10) 100%
  );
  border: 1px solid rgba(255, 250, 238, 0.30);
  backdrop-filter: blur(14px) saturate(145%);
  -webkit-backdrop-filter: blur(14px) saturate(145%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.42),
    0 4px 12px rgba(0, 0, 0, 0.28);
  transition: all 0.2s ease;
}

.ctrl-icon-btn:hover, .ctrl-icon-btn:active {
  background: radial-gradient(
    circle at 32% 24%,
    rgba(255, 255, 255, 0.28) 0%,
    rgba(245, 208, 118, 0.20) 100%
  );
  border-color: rgba(255, 252, 240, 0.52);
  transform: scale(1.05);
  color: #fff;
}

.ctrl-play-toggle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(
    circle at 32% 22%,
    rgba(255, 255, 255, 0.34) 0%,
    rgba(255, 235, 175, 0.22) 45%,
    rgba(218, 152, 38, 0.20) 100%
  );
  border: 1px solid rgba(255, 252, 240, 0.46);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  color: #fffdf7;
  box-shadow:
    inset 0 1.5px 1.5px rgba(255, 255, 255, 0.56),
    inset 0 -1.5px 3px rgba(175, 110, 15, 0.22),
    0 6px 16px rgba(0, 0, 0, 0.36);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.ctrl-play-toggle svg {
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.42));
}

.ctrl-play-toggle:hover, .ctrl-play-toggle:active {
  transform: scale(1.07);
}

.story-progress-area {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.scene-dots-row {
  display: flex;
  width: 100%;
  gap: 3px;
}

.scene-dot-btn {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 250, 238, 0.16);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text-soft);
  font-size: 0.72rem;
  overflow: hidden;
  transition: all 0.2s ease;
}

.scene-dot-btn.passed {
  border-color: rgba(245, 208, 118, 0.32);
  color: var(--parchment-warm);
  background: rgba(245, 208, 118, 0.08);
}

.scene-dot-btn.active {
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.20) 0%,
    rgba(245, 208, 118, 0.22) 100%
  );
  border-color: rgba(255, 252, 240, 0.48);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.42);
  color: var(--parchment-light);
  font-weight: 600;
}

.dot-num {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(245, 208, 118, 0.2);
  color: var(--gold-bright);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  flex-shrink: 0;
}

.scene-dot-btn.active .dot-num {
  background: var(--gold-bright);
  color: #1a1105;
}

.dot-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-scrub-wrap {
  position: relative;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  cursor: pointer;
}

.audio-scrub-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.scrub-chapter-tick {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: rgba(245, 208, 118, 0.75);
  border-radius: 2px;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
}

.audio-scrub-fill {
  position: relative;
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #d4942a, #f7d47c);
  transition: width 0.12s linear;
  z-index: 1;
}

.scrub-playhead-dot {
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff9e6;
  border: 2px solid var(--gold-main);
  box-shadow: 0 0 10px rgba(245, 208, 118, 0.9);
}

.audio-time-display {
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  color: var(--parchment-warm);
  min-width: 78px;
  text-align: right;
}

/* ==========================================================================
   3. FULLSCREEN CHARACTER STATION:
      Image across ENTIRE Background + Person & Play Button overlaid!
   ========================================================================== */

#view-character {
  --tilt-rx: 0deg;
  --tilt-ry: 0deg;
  --shift-x: 0px;
  --shift-y: 0px;
  perspective: 1400px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding:
    calc(var(--safe-top) + 16px)
    calc(var(--safe-right) + 32px)
    calc(var(--safe-bottom) + 28px)
    calc(var(--safe-left) + 32px);
  overflow: hidden;
}

/* Fullscreen Background Image Layer with 3D Multi-Plane Depth */
.char-fullbg-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
  background: #0a101f;
  perspective: 1400px;
}

.char-3d-bg-plane {
  position: absolute;
  inset: -6%;
  width: 112%;
  height: 112%;
  transform: rotateX(var(--tilt-rx)) rotateY(var(--tilt-ry)) translate3d(calc(var(--shift-x) * -0.65), calc(var(--shift-y) * -0.65), 0) scale(1.04);
  transform-style: preserve-3d;
  transition: transform 0.22s ease-out;
}

.char-fullbg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  animation: charBgBreath 24s ease-in-out infinite alternate;
  filter: blur(6.5px) brightness(0.56) saturate(1.10);
  /* Slow 5.0s fade-back to Bokeh when narration ends or pauses */
  transition: filter 5.0s cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
  will-change: filter, transform;
}

/* RACK FOCUS: Delayed (2.0s) and slow (5.8s) focus shift bringing the background scene forward! */
#view-character.is-narrating:not(.is-paused):not(.is-ending-soon) .char-fullbg-img {
  filter: blur(0px) brightness(0.95) saturate(1.16);
  transition: filter 5.8s cubic-bezier(0.45, 0.05, 0.25, 1) 2.0s;
}

@keyframes charBgBreath {
  0% { transform: scale(1) translate3d(0%, 0%, 0); }
  50% { transform: scale(1.12) translate3d(1.4%, -1.4%, 0); }
  100% { transform: scale(1.08) translate3d(-1.4%, 1.0%, 0); }
}

/* Station-Specific Atmospheric Light & Nature Animations (.char-atmo-fx) */
.char-atmo-fx {
  position: absolute;
  inset: -8%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: screen;
  transition: opacity 4.8s cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
}

#view-character.is-narrating:not(.is-paused):not(.is-ending-soon) .char-atmo-fx {
  opacity: 0.96;
  transition: opacity 5.5s cubic-bezier(0.45, 0.05, 0.25, 1) 2.0s;
}

/* 1. Der Hirte: Warm flickering campfire at the bottom + celestial angel glow at top-right */
#view-character[data-atmo-mode="campfire"] .char-atmo-fx {
  background:
    radial-gradient(ellipse 68% 42% at 38% 96%, rgba(255, 132, 34, 0.52) 0%, rgba(235, 88, 18, 0.22) 48%, transparent 78%),
    radial-gradient(ellipse 52% 42% at 74% 18%, rgba(255, 244, 198, 0.36) 0%, rgba(245, 208, 118, 0.14) 52%, transparent 80%);
  animation: atmoCampfireFlicker 3.2s ease-in-out infinite alternate;
}

@keyframes atmoCampfireFlicker {
  0% { transform: scale(1) translate3d(0, 0, 0); filter: brightness(0.92); }
  35% { transform: scale(1.03, 1.05) translate3d(-6px, -4px, 0); filter: brightness(1.12); }
  70% { transform: scale(0.99, 1.02) translate3d(5px, -2px, 0); filter: brightness(0.96); }
  100% { transform: scale(1.04, 1.06) translate3d(-3px, -6px, 0); filter: brightness(1.18); }
}

/* 2. Josef: Gently swaying warm Bethlehem lantern cone illuminating the doorway */
#view-character[data-atmo-mode="lantern"] .char-atmo-fx {
  transform-origin: 58% 8%;
  background:
    radial-gradient(ellipse 46% 58% at 62% 38%, rgba(255, 202, 92, 0.42) 0%, rgba(235, 148, 42, 0.18) 52%, transparent 80%),
    radial-gradient(circle at 58% 14%, rgba(255, 238, 178, 0.45) 0%, transparent 35%);
  animation: atmoLanternSway 6.5s ease-in-out infinite alternate;
}

@keyframes atmoLanternSway {
  0% { transform: rotate(-3.2deg) scale(1); filter: brightness(0.95); }
  50% { transform: rotate(0.8deg) scale(1.03); filter: brightness(1.08); }
  100% { transform: rotate(3.4deg) scale(1.01); filter: brightness(0.98); }
}

/* 3. Maria: Shimmering celestial angel light beam streaming from above */
#view-character[data-atmo-mode="angelbeam"] .char-atmo-fx {
  background:
    linear-gradient(125deg, rgba(255, 248, 222, 0.36) 0%, rgba(185, 218, 255, 0.18) 34%, transparent 66%),
    radial-gradient(ellipse 55% 48% at 32% 24%, rgba(255, 246, 210, 0.42) 0%, transparent 72%);
  animation: atmoAngelBeam 5.5s ease-in-out infinite alternate;
}

@keyframes atmoAngelBeam {
  0% { transform: translate3d(-10px, -6px, 0) scale(1); opacity: 0.72; }
  100% { transform: translate3d(12px, 8px, 0) scale(1.06); opacity: 1; }
}

/* 4. Das Jesuskind: Peaceful warm golden manger heartbeat glow from the crib */
#view-character[data-atmo-mode="manger"] .char-atmo-fx {
  background:
    radial-gradient(ellipse 58% 48% at 50% 60%, rgba(255, 216, 102, 0.48) 0%, rgba(238, 162, 52, 0.22) 48%, transparent 78%);
  animation: atmoMangerPulse 4.4s ease-in-out infinite alternate;
}

@keyframes atmoMangerPulse {
  0% { transform: scale(0.96); filter: brightness(0.92); }
  100% { transform: scale(1.08); filter: brightness(1.16); }
}

/* 5. Die Weisen: Radiant Star of Bethlehem rays & cosmic shimmer */
#view-character[data-atmo-mode="starlight"] .char-atmo-fx {
  background:
    radial-gradient(ellipse 56% 45% at 72% 18%, rgba(255, 248, 220, 0.46) 0%, rgba(242, 200, 112, 0.20) 44%, transparent 76%),
    conic-gradient(from 195deg at 72% 16%, transparent 0deg, rgba(255, 248, 218, 0.24) 18deg, transparent 38deg, rgba(255, 244, 200, 0.18) 54deg, transparent 80deg);
  animation: atmoStarShimmer 6s ease-in-out infinite alternate;
}

@keyframes atmoStarShimmer {
  0% { transform: scale(0.98) rotate(-1.5deg); filter: brightness(0.94); }
  100% { transform: scale(1.05) rotate(1.5deg); filter: brightness(1.18); }
}

/* Middle 3D Plane: Volumetric Light Shafts moving in counter-parallax */
.char-3d-light-rays {
  position: absolute;
  inset: -14%;
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.48;
  background:
    repeating-linear-gradient(
      116deg,
      rgba(255, 236, 185, 0.0) 0%,
      rgba(255, 236, 185, 0.08) 7%,
      rgba(255, 246, 215, 0.17) 11%,
      rgba(255, 236, 185, 0.04) 16%,
      rgba(255, 236, 185, 0.0) 26%
    ),
    radial-gradient(ellipse at 62% 24%, rgba(255, 232, 168, 0.24) 0%, transparent 65%);
  filter: blur(13px);
  transform: translate3d(calc(var(--shift-x) * -1.4), calc(var(--shift-y) * -1.2), 0);
  animation: raysFloat3D 18s ease-in-out infinite alternate;
}

/* Foreground 3D Depth-of-Field Vignette */
.char-3d-depth-vignette {
  position: absolute;
  inset: -5%;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    ellipse at calc(50% + var(--shift-x) * 0.5) calc(45% + var(--shift-y) * 0.5),
    transparent 48%,
    rgba(8, 11, 20, 0.35) 82%,
    rgba(5, 8, 15, 0.72) 100%
  );
  transform: translate3d(calc(var(--shift-x) * 0.85), calc(var(--shift-y) * 0.85), 0);
  transition: transform 0.2s ease-out;
}

.char-fullbg-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(10, 15, 28, 0.25) 0%, rgba(8, 12, 24, 0.78) 100%),
    linear-gradient(180deg, rgba(8, 12, 24, 0.58) 0%, rgba(8, 12, 24, 0.22) 40%, rgba(8, 12, 24, 0.86) 100%);
  transition: opacity 4.8s cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
}

/* When narrating, slowly lighten vignette so the full sharp background scene shines brightly */
#view-character.is-narrating:not(.is-paused):not(.is-ending-soon) .char-fullbg-vignette {
  opacity: 0.34;
  transition: opacity 5.5s cubic-bezier(0.45, 0.05, 0.25, 1) 2.0s;
}

#view-character.is-narrating:not(.is-paused):not(.is-ending-soon) .char-3d-light-rays {
  opacity: 0.72;
}

.char-particles-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.char-topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.teacher-lock-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.teacher-lock-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px 6px 8px;
  border-radius: 999px;
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.22) 0%,
    rgba(16, 22, 38, 0.42) 55%,
    rgba(245, 208, 118, 0.14) 100%
  );
  border: 1px solid rgba(255, 252, 240, 0.44);
  backdrop-filter: blur(22px) saturate(185%);
  -webkit-backdrop-filter: blur(22px) saturate(185%);
  box-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, 0.68),
    0 8px 22px rgba(0, 0, 0, 0.42);
  color: #fffdf7;
  font-size: 0.84rem;
  font-weight: 600;
  user-select: none;
  touch-action: none;
}

.teacher-lock-btn.holding {
  border-color: rgba(255, 255, 255, 0.82);
  color: var(--gold-bright);
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.34) 0%,
    rgba(245, 208, 118, 0.26) 100%
  );
}

.lock-ring-svg {
  position: relative;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lock-ring-svg svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.lock-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 3;
}

.lock-ring-progress {
  fill: none;
  stroke: var(--gold-bright);
  stroke-width: 3.2;
  stroke-linecap: round;
}

.lock-icon {
  font-size: 0.85rem;
}

.teacher-lock-hint {
  padding: 7px 14px;
  border-radius: 10px;
  background: rgba(22, 16, 10, 0.94);
  border: 1px solid var(--gold-main);
  color: var(--parchment-light);
  font-size: 0.8rem;
  opacity: 0;
  transform: translateX(-8px);
  pointer-events: none;
  transition: all 0.25s ease;
}

.teacher-lock-hint.visible {
  opacity: 1;
  transform: translateX(0);
}

.char-station-badge {
  padding: 7px 18px;
  border-radius: 999px;
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.20) 0%,
    rgba(16, 22, 38, 0.42) 55%,
    rgba(245, 208, 118, 0.14) 100%
  );
  border: 1px solid rgba(255, 252, 240, 0.44);
  backdrop-filter: blur(22px) saturate(185%);
  -webkit-backdrop-filter: blur(22px) saturate(185%);
  box-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, 0.65),
    0 8px 22px rgba(0, 0, 0, 0.42);
  color: var(--gold-bright);
  font-size: 0.86rem;
  font-weight: 600;
}

/* Large Free-Standing Cutout Krippenfigur in Middle 3D Plane (Entwurf A)
   Note: 60fps parallax (--shift-x / --shift-y) stays on the wrapper, while the slow Rack-Focus
   fade-out & fade-in lives on .char-stage-figure-img so parallax updates never interrupt it! */
.char-stage-figure-wrap {
  position: absolute;
  left: 50%;
  top: calc(var(--safe-top) + 12px);
  width: min(86vw, 760px);
  height: clamp(360px, 84dvh, 860px);
  transform: translate3d(calc(-50% + var(--shift-x) * 0.28), calc(var(--shift-y) * 0.28), 0);
  transition: transform 0.22s ease-out;
  z-index: 3;
  pointer-events: none;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.char-stage-figure-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center top;
  opacity: 1;
  transform: translateY(0) scale(1);
  transform-origin: center 62%;
  filter: blur(0px) brightness(1) drop-shadow(0 18px 36px rgba(0, 0, 0, 0.58));
  /* Slow 5.2s fade-IN when returning to foreground (Pause / End of story) */
  transition:
    opacity 5.2s cubic-bezier(0.4, 0, 0.2, 1) 0.25s,
    filter 5.2s cubic-bezier(0.4, 0, 0.2, 1) 0.25s,
    transform 5.2s cubic-bezier(0.4, 0, 0.2, 1) 0.25s;
  will-change: opacity, filter, transform;
  user-select: none;
  -webkit-user-drag: none;
}

/* RACK FOCUS: Delayed by 2.2s, then slowly fades back over 5.8s so the background scene comes forward! */
#view-character.is-narrating:not(.is-paused):not(.is-ending-soon) .char-stage-figure-img {
  opacity: 0.14;
  transform: translateY(26px) scale(0.85);
  filter: blur(4px) brightness(0.76) drop-shadow(0 18px 36px rgba(0, 0, 0, 0.25));
  transition:
    opacity 5.8s cubic-bezier(0.45, 0.05, 0.25, 1) 2.2s,
    filter 5.8s cubic-bezier(0.45, 0.05, 0.25, 1) 2.2s,
    transform 5.8s cubic-bezier(0.45, 0.05, 0.25, 1) 2.2s;
}

/* Soft dark readability scrim over the lower half of the figure behind Title & Quote */
.char-stage-text-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 1;
  transition: opacity 4.8s cubic-bezier(0.4, 0, 0.2, 1) 0.25s;
  background: radial-gradient(
    ellipse 52% 38% at 50% 66%,
    rgba(6, 9, 16, 0.68) 0%,
    rgba(6, 9, 16, 0.38) 52%,
    transparent 85%
  );
}

#view-character.is-narrating:not(.is-paused):not(.is-ending-soon) .char-stage-text-scrim {
  opacity: 0;
  transition: opacity 5.2s cubic-bezier(0.45, 0.05, 0.25, 1) 2.0s;
}

/* Centered Overlay on top of the Fullscreen Background & Lower Figure */
.char-overlay-center {
  position: relative;
  z-index: 4;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
  padding-top: clamp(165px, 37dvh, 360px);
  padding-bottom: clamp(6px, 1.8dvh, 20px);
  gap: clamp(14px, 2.2vh, 24px);
  max-width: 780px;
  margin: 0 auto;
  width: 100%;
}

.char-overlay-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 1;
  filter: blur(0px);
  transform: translate3d(calc(var(--shift-x) * 0.55), calc(var(--shift-y) * 0.55), 0);
  /* Slow 4.6s fade-IN when returning */
  transition:
    opacity 4.6s cubic-bezier(0.4, 0, 0.2, 1) 0.35s,
    filter 4.6s cubic-bezier(0.4, 0, 0.2, 1) 0.35s,
    transform 0.22s ease-out;
}

/* FREE STAGE: Delayed by 1.8s, then slowly fades out over 4.8s so the scene is 100% unobstructed */
#view-character.is-narrating:not(.is-paused):not(.is-ending-soon) .char-overlay-hero {
  opacity: 0;
  filter: blur(3px);
  pointer-events: none;
  transition:
    opacity 4.8s cubic-bezier(0.45, 0.05, 0.25, 1) 1.8s,
    filter 4.8s cubic-bezier(0.45, 0.05, 0.25, 1) 1.8s,
    transform 0.22s ease-out;
}

.char-eyebrow {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold-bright);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85);
}

.char-main-name {
  font-family: var(--font-serif);
  font-size: clamp(3.1rem, 6.2vw, 5.2rem);
  font-weight: 700;
  line-height: 1.02;
  color: var(--parchment-light);
  text-shadow: 0 4px 26px rgba(0, 0, 0, 0.92);
}

.char-main-subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.1rem, 1.8vw, 1.5rem);
  line-height: 1.38;
  color: var(--parchment-warm);
  max-width: 46ch;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.92);
}

.char-play-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.char-giant-btn {
  width: 100%;
  max-width: 440px;
}

/* ==========================================================================
   FLUID / DYNAMIC CHARACTER TAB-SWITCH ENTRANCE CHOREOGRAPHY (.char-enter-anim)
   Triggered whenever the user opens a character or switches tabs on Mobile/iPad
   ========================================================================== */
#view-character.char-enter-anim .char-fullbg-img {
  animation: charSwitchBgIn 0.68s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

#view-character.char-enter-anim .char-stage-figure-img {
  animation: charSwitchFigureIn 0.62s cubic-bezier(0.22, 1, 0.36, 1) 0.03s both;
}

#view-character.char-enter-anim .char-station-badge {
  animation: charSwitchBadgeIn 0.48s cubic-bezier(0.22, 1, 0.36, 1) 0.02s both;
}

#view-character.char-enter-anim .char-eyebrow {
  animation: charSwitchTextUp 0.50s cubic-bezier(0.22, 1, 0.36, 1) 0.07s both;
}

#view-character.char-enter-anim .char-main-name {
  animation: charSwitchTitleUp 0.56s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

#view-character.char-enter-anim .char-main-subtitle {
  animation: charSwitchTextUp 0.56s cubic-bezier(0.22, 1, 0.36, 1) 0.18s both;
}

#view-character.char-enter-anim .char-play-zone {
  animation: charSwitchBtnUp 0.58s cubic-bezier(0.22, 1, 0.36, 1) 0.23s both;
}

@keyframes charSwitchBgIn {
  0% {
    opacity: 0.25;
    transform: scale(1.07);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes charSwitchFigureIn {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.90);
    filter: blur(5px) brightness(1.16) drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0px) brightness(1) drop-shadow(0 18px 36px rgba(0, 0, 0, 0.58));
  }
}

@keyframes charSwitchBadgeIn {
  0% {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes charSwitchTextUp {
  0% {
    opacity: 0;
    transform: translateY(15px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes charSwitchTitleUp {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.95);
    filter: blur(3px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0px);
  }
}

@keyframes charSwitchBtnUp {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Active Playing State Panel (Extra Transparent Liquid Glass on Character Station) */
.char-playing-panel {
  width: 100%;
  max-width: 500px;
  padding: 20px 26px;
  border-radius: 28px;
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(12, 18, 32, 0.28) 55%,
    rgba(245, 208, 118, 0.08) 100%
  );
  border: 1px solid rgba(255, 250, 238, 0.28);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.36),
    0 18px 42px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: box-shadow 0.6s ease, border-color 0.6s ease;
}

#view-character.is-narrating:not(.is-paused) .char-playing-panel {
  animation: charPlayerVoiceGlow 3.2s ease-in-out infinite alternate;
}

@keyframes charPlayerVoiceGlow {
  0% {
    border-color: rgba(255, 248, 224, 0.26);
    box-shadow:
      inset 0 1px 1px rgba(255, 255, 255, 0.36),
      0 16px 38px rgba(0, 0, 0, 0.45),
      0 0 18px rgba(245, 208, 118, 0.12);
  }
  100% {
    border-color: rgba(255, 238, 185, 0.52);
    box-shadow:
      inset 0 1px 2px rgba(255, 255, 255, 0.48),
      0 18px 44px rgba(0, 0, 0, 0.48),
      0 0 34px rgba(245, 208, 118, 0.28);
  }
}

.soundwave-bars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
}

.soundwave-bars span {
  width: 5px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f7d47c, #d18d22);
  animation: waveBounce 1.1s ease-in-out infinite;
}

.soundwave-bars span:nth-child(2) { animation-delay: 0.15s; }
.soundwave-bars span:nth-child(3) { animation-delay: 0.3s; }
.soundwave-bars span:nth-child(4) { animation-delay: 0.1s; }
.soundwave-bars span:nth-child(5) { animation-delay: 0.4s; }
.soundwave-bars span:nth-child(6) { animation-delay: 0.2s; }
.soundwave-bars span:nth-child(7) { animation-delay: 0.35s; }
.soundwave-bars span:nth-child(8) { animation-delay: 0.12s; }
.soundwave-bars span:nth-child(9) { animation-delay: 0.28s; }

.soundwave-bars.paused span {
  animation-play-state: paused;
  height: 8px !important;
}

@keyframes waveBounce {
  0%, 100% { height: 10px; opacity: 0.65; }
  50% { height: 32px; opacity: 1; }
}

.char-playing-status {
  text-align: center;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--gold-bright);
}

.char-progress-bar-wrap {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
  cursor: pointer;
}

.char-progress-bar-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #d18d22, #f7d47c);
  transition: width 0.15s linear;
}

.char-playing-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.char-time-label {
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-soft);
}

.char-ctrl-btns {
  display: flex;
  gap: 10px;
}

.char-mini-btn {
  padding: 8px 18px;
  border-radius: 999px;
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.10) 0%,
    rgba(255, 245, 220, 0.04) 50%,
    rgba(245, 208, 118, 0.08) 100%
  );
  border: 1px solid rgba(255, 250, 238, 0.26);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  box-shadow:
    inset 0 1px 0.5px rgba(255, 255, 255, 0.38),
    0 4px 12px rgba(0, 0, 0, 0.28);
  color: #fffdf7;
  font-size: 0.84rem;
  font-weight: 600;
  transition: all 0.22s ease;
}

.char-mini-btn:hover, .char-mini-btn:active {
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.18) 0%,
    rgba(245, 208, 118, 0.16) 100%
  );
  border-color: rgba(255, 252, 240, 0.45);
  transform: translateY(-1px);
}

/* ==========================================================================
   4. MOBILE BOTTOM NAVIGATION BAR (Hidden on iPad/Desktop, Active on Mobile)
   ========================================================================== */

.mobile-bottom-nav {
  display: none;
}

/* ==========================================================================
   5. MODALS
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(6, 10, 20, 0.78);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.28s ease;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: 88dvh;
  overflow-y: auto;
  border-radius: 24px;
  padding: 26px 28px;
  background: linear-gradient(180deg, #18233c 0%, #101729 100%);
  border: 1.5px solid rgba(245, 208, 118, 0.45);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-card.wide {
  max-width: 820px;
}

.modal-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--parchment-warm);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-kicker {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold-bright);
}

.modal-header h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  color: var(--parchment-light);
  margin: 4px 0 8px;
}

.modal-header p {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-soft);
}

.ios-install-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.ios-step-card {
  position: relative;
  padding: 16px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(245, 208, 118, 0.25);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.step-num {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gold-main);
  color: #1a1105;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ios-step-card h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--gold-bright);
}

.ios-step-card p {
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--parchment-warm);
}

.anim-bounce-up {
  animation: bounceUp 1.8s ease-in-out infinite;
}

@keyframes bounceUp {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.tc-table-wrap {
  overflow-x: auto;
}

.tc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.tc-table th, .tc-table td {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(245, 208, 118, 0.16);
  text-align: left;
}

.tc-table th {
  color: var(--gold-bright);
  font-weight: 600;
}

.tc-scene-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tc-thumb {
  width: 48px;
  height: 28px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid rgba(245, 208, 118, 0.4);
}

.tc-input {
  width: 90px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(245, 208, 118, 0.4);
  background: rgba(10, 15, 28, 0.85);
  color: var(--parchment-light);
  font-family: inherit;
  font-size: 0.88rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
}

.modal-footer.split {
  justify-content: space-between;
}

/* ==========================================================================
   6. SMARTPHONE / MOBILE OPTIMIZATION (<= 820px)
      - Storybook as default start view
      - Fixed Bottom Navigation Bar with Story + 5 Character Tabs
   ========================================================================== */

@media (max-width: 820px), (max-width: 960px) and (max-height: 520px) {
  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(var(--mob-nav-h) + var(--safe-bottom));
    padding: 6px 6px calc(6px + var(--safe-bottom));
    background: rgba(10, 15, 28, 0.95);
    border-top: 1px solid rgba(245, 208, 118, 0.35);
    backdrop-filter: blur(16px);
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
    z-index: 40;
    box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.65);
  }

  /* Hide the top-left Back button on Mobile when already on the Mobile Start View (Storybook standby) */
  body:not(.mobile-story-landscape) #btn-close-story {
    display: none !important;
  }

  /* When Mobile Fullscreen Landscape Story Mode is active, hide the bottom bar */
  body.mobile-story-landscape .mobile-bottom-nav {
    display: none !important;
  }

  .mob-tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border-radius: 12px;
    padding: 4px 2px;
    color: var(--text-soft);
    transition: all 0.2s ease;
  }

  .mob-tab-btn.active {
    background: rgba(245, 208, 118, 0.18);
    color: var(--gold-bright);
  }

  .mob-tab-icon {
    font-size: 1.25rem;
    line-height: 1;
  }

  .mob-tab-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    overflow: hidden;
    border: 1.5px solid rgba(245, 208, 118, 0.45);
  }

  .mob-tab-btn.active .mob-tab-avatar {
    border-color: var(--gold-bright);
    box-shadow: 0 0 8px rgba(245, 208, 118, 0.6);
  }

  .mob-tab-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
  }

  .mob-tab-label {
    font-size: 0.65rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  /* Adjust Views on Mobile to leave room for the Bottom Navigation Bar */
  #view-story {
    padding: 0;
  }

  #view-character {
    padding:
      calc(var(--safe-top) + 12px)
      14px
      calc(var(--mob-nav-h) + var(--safe-bottom) + 14px)
      14px;
  }

  #view-home {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding:
      calc(var(--safe-top) + 12px)
      14px
      calc(var(--mob-nav-h) + var(--safe-bottom) + 18px)
      14px;
    gap: 14px;
  }

  .home-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  #music-label {
    display: none;
  }

  .storybook-hero-card {
    grid-template-columns: 1fr;
    min-height: 300px;
  }

  .hero-scenes-preview {
    display: none;
  }

  .hero-content {
    padding: 18px;
  }

  .hero-cta-group {
    flex-direction: column;
    gap: 10px;
  }

  .hero-play-btn {
    width: 100%;
  }

  .stations-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .stations-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    flex: none;
  }

  .station-card {
    height: 170px;
  }

  /* Story View Mobile Adaptations */
  .fs-topbar {
    top: calc(var(--safe-top) + 10px);
    left: 12px;
    right: 12px;
    gap: 6px;
  }

  .back-btn-label {
    display: none;
  }

  .fs-back-btn {
    padding: 7px 11px;
  }

  .story-chapter-pill {
    padding: 5px 12px;
    font-size: 0.78rem;
    flex: 1;
    justify-content: center;
  }

  .story-chapter-pill strong {
    font-size: 0.92rem;
  }

  .open-book-frame {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    padding: 0;
    border-radius: 0;
  }

  .scene-caption-banner {
    bottom: calc(var(--mob-nav-h) + var(--safe-bottom) + 74px);
    padding: 5px 12px;
    gap: 8px;
  }

  .caption-text {
    font-size: 0.78rem;
  }

  .giant-play-btn {
    padding: 16px 22px;
    border-radius: 20px;
    gap: 6px;
  }

  .giant-play-icon {
    width: 56px;
    height: 56px;
  }

  .giant-play-icon svg {
    width: 30px;
    height: 30px;
  }

  .giant-play-rings {
    top: 12px;
    width: 62px;
    height: 62px;
  }

  .giant-play-label {
    font-size: 1.15rem;
  }

  .giant-play-sub {
    font-size: 0.72rem;
  }

  .fs-bottombar {
    bottom: calc(var(--mob-nav-h) + var(--safe-bottom) + 10px);
    width: calc(100% - 20px);
    grid-template-columns: auto 1fr;
    gap: 10px;
    padding: 8px 12px;
  }

  .audio-time-display {
    display: none;
  }

  .dot-label {
    display: none;
  }

  .scene-dot-btn {
    justify-content: center;
    padding: 3px 2px;
  }

  /* Character Fullscreen Mobile Adaptations (Entwurf A: Large Cutout + Bokeh Stage) */
  .char-station-badge {
    font-size: 0.72rem;
    padding: 5px 11px;
    max-width: 62vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .char-stage-figure-wrap {
    top: calc(var(--safe-top) + 42px);
    width: min(96vw, 460px);
    height: clamp(290px, 60dvh, 520px);
  }

  .char-stage-text-scrim {
    background: radial-gradient(
      ellipse 68% 42% at 50% 68%,
      rgba(6, 9, 16, 0.74) 0%,
      rgba(6, 9, 16, 0.44) 55%,
      transparent 88%
    );
  }

  .char-overlay-center {
    justify-content: flex-end;
    padding-top: clamp(150px, 31dvh, 270px);
    padding-bottom: 6px;
    gap: 12px;
  }

  .char-eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.11em;
  }

  .char-main-name {
    font-size: clamp(2.35rem, 9vw, 2.85rem);
  }

  .char-main-subtitle {
    font-size: 0.96rem;
    line-height: 1.34;
    padding: 0 6px;
  }

  .char-playing-panel {
    padding: 14px 18px;
    gap: 10px;
    border-radius: 22px;
  }

  .ios-install-steps {
    grid-template-columns: 1fr;
  }

  /* ========================================================================
     MOBILE LANDSCAPE STORYBOOK MODE (Triggered on «Weihnachtsgeschichte starten»)
     - Rotates 90° immediately when phone is held in Portrait
     - Stays in Landscape when user rotates the phone sideways into Landscape!
     ======================================================================== */
  body.mobile-story-landscape #btn-close-story {
    display: inline-flex !important;
    padding: 5px 12px;
    font-size: 0.78rem;
  }

  body.mobile-story-landscape .back-btn-label {
    display: inline !important;
  }

  body.mobile-story-landscape .fs-topbar {
    gap: 8px;
  }

  body.mobile-story-landscape .story-chapter-pill {
    padding: 4px 12px;
    font-size: 0.76rem;
    flex: 0 1 auto;
  }

  body.mobile-story-landscape .story-chapter-pill strong {
    font-size: 0.92rem;
  }

  body.mobile-story-landscape .lang-chip {
    padding: 4px 10px;
    font-size: 0.74rem;
  }

  body.mobile-story-landscape .open-book-frame {
    width: 100%;
    height: 100%;
    max-width: 100%;
    aspect-ratio: auto;
    padding: 0;
    border-radius: 0;
  }

  body.mobile-story-landscape .fs-topbar {
    top: 8px;
    left: 14px;
    right: 14px;
  }

  body.mobile-story-landscape .scene-caption-banner {
    bottom: 64px;
  }

  body.mobile-story-landscape .fs-bottombar {
    bottom: 8px;
    width: calc(100% - 28px);
    padding: 5px 12px;
    gap: 10px;
  }

  body.mobile-story-landscape .ctrl-play-btn {
    width: 34px;
    height: 34px;
  }

  body.mobile-story-landscape .ctrl-icon-btn {
    width: 28px;
    height: 28px;
  }

  body.mobile-story-landscape .story-timeline-col {
    gap: 4px;
  }
}

/* 1) Phone held upright in Portrait:
   - Rotate #view-story 90° clockwise to fill screen in Landscape
   - Frame #view-character with portrait-composed background scenes + gentle Storytelling Camera Pan during narration */
@media (max-width: 820px) and (orientation: portrait) {
  body.mobile-story-landscape #view-story {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 100dvh;
    height: 100vw;
    transform: translate(-50%, -50%) rotate(90deg);
    transform-origin: center center;
    padding: 0;
    z-index: 55;
  }

  #view-character .char-fullbg-img {
    object-fit: cover;
    object-position: 50% 22%;
  }

  #view-character.is-narrating:not(.is-paused):not(.char-enter-anim) .char-fullbg-img {
    animation: charBgMobilePan 18s ease-in-out infinite alternate;
  }
}

@keyframes charBgMobilePan {
  0% {
    object-position: 18% 22%;
    transform: scale(1.01);
  }
  50% {
    object-position: 50% 20%;
    transform: scale(1.04);
  }
  100% {
    object-position: 82% 22%;
    transform: scale(1.01);
  }
}

/* 2) Phone physically turned sideways into Landscape: keep #view-story in Landscape (transform: none) + compact #view-character */
@media (max-width: 960px) and (max-height: 520px) and (orientation: landscape) {
  body.mobile-story-landscape #view-story {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    transform: none;
    padding: 0;
    z-index: 55;
  }

  #view-character .char-stage-figure-wrap {
    top: calc(var(--safe-top) + 8px);
    width: min(76vw, 440px);
    height: 80dvh;
  }

  #view-character .char-overlay-center {
    padding-top: clamp(70px, 24dvh, 130px);
    padding-bottom: 2px;
    gap: 6px;
  }

  #view-character .char-main-name {
    font-size: 2.05rem;
  }

  #view-character .char-main-subtitle {
    font-size: 0.85rem;
    line-height: 1.25;
  }

  #view-character .giant-play-btn {
    padding: 10px 18px;
    gap: 4px;
  }

  #view-character .giant-play-icon {
    width: 42px;
    height: 42px;
  }
}
