/* ==========================================================================
   The November Chapter - Antique Fairy Tale Book CSS Stylesheet
   Warm Library Ambiance, Morocco Leather, Gilded Brass & 3D Unlocking
   ========================================================================== */

:root {
  /* Antiquarian & Fairytale Typography */
  --font-decorative: 'Cinzel Decorative', 'Cinzel', Georgia, serif;
  --font-serif: 'Cinzel', Georgia, serif;
  --font-poetic: 'Cormorant Garamond', Georgia, serif;
  --font-calligraphy: 'Parisienne', cursive;
  --font-ui: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Warm Antique Library Color Palette (No Cold Blue) */
  --color-study-dark: #0d0806;
  --color-study-mid: #180e0a;
  --color-study-warm: #26160f;
  --color-study-wood: #3d2217;

  /* Antique Morocco Leather */
  --color-leather-dark: #1b070b;
  --color-leather-base: #2a0b12;
  --color-leather-mid: #3d101a;
  --color-leather-light: #521824;

  /* Antique Gilded Gold & Brass */
  --color-gold-bright: #fef08a;
  --color-gold-warm: #facc15;
  --color-gold-amber: #f59e0b;
  --color-gold-antique: #d97706;
  --color-gold-bronze: #92400e;
  --color-gold-shadow: #451a03;

  /* Aged Parchment Paper */
  --color-parchment-bright: #fefbf3;
  --color-parchment-base: #f6ecdc;
  --color-parchment-mid: #ede0c8;
  --color-parchment-dark: #dfcbb0;
  --color-ink-deep: #2a160d;
  --color-ink-sepia: #4a2818;

  /* Glows & Lighting */
  --glow-candlelight: rgba(245, 158, 11, 0.25);
  --glow-amber: rgba(251, 191, 36, 0.35);
  --glow-gold: rgba(254, 240, 138, 0.5);

  --shadow-tome: 
    0 25px 60px -15px rgba(0, 0, 0, 0.95),
    0 10px 30px rgba(0, 0, 0, 0.8),
    0 0 45px rgba(245, 158, 11, 0.12);
}

/* Base Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background-color: var(--color-study-dark);
  background-image: 
    radial-gradient(circle at 50% 20%, #2f1911 0%, #1a0d08 45%, #0d0806 85%),
    radial-gradient(circle at 15% 85%, #23120b 0%, transparent 60%),
    radial-gradient(circle at 85% 75%, #2a150d 0%, transparent 60%),
    linear-gradient(180deg, #120b08 0%, #060403 100%);
  color: #fef9c3;
  font-family: var(--font-poetic);
  position: relative;
  user-select: none;
}

/* Particle Canvas Layers (Warm Golden Fairy Dust & Embers) */
#fairydust-canvas,
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#fairydust-canvas {
  z-index: 1;
}

#confetti-canvas {
  z-index: 2500;
}

/* Warm Candlelight Atmospheric Illumination */
.candlelight-wrapper {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.candle-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.65;
  animation: candleFlicker 6s infinite alternate ease-in-out;
}

.candle-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.28) 0%, transparent 70%);
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
}

.candle-2 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(217, 119, 6, 0.2) 0%, transparent 70%);
  bottom: 5%;
  left: -80px;
  animation-delay: -2s;
}

.candle-3 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.18) 0%, transparent 70%);
  bottom: 10%;
  right: -80px;
  animation-delay: -4s;
}

@keyframes candleFlicker {
  0% { transform: scale(1) translateY(0); opacity: 0.55; }
  50% { transform: scale(1.08) translateY(-10px); opacity: 0.72; }
  100% { transform: scale(0.96) translateY(6px); opacity: 0.58; }
}

/* Antiquarian Navigation Header (Hidden for end-users, only visible if ?dev=true) */
.top-nav {
  display: none;
  position: relative;
  z-index: 100;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

body.dev-mode .top-nav {
  display: flex;
}

.brand-crest {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 1.1rem;
  background: rgba(30, 16, 11, 0.65);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 9999px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(254, 240, 138, 0.2);
}

.crest-icon {
  font-size: 1.15rem;
}

.crest-text {
  font-family: var(--font-serif);
  font-size: 0.88rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-gold-bright);
}

.nav-controls {
  display: flex;
  gap: 0.75rem;
}

.control-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(30, 16, 11, 0.65);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fef08a;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-family: var(--font-ui);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.control-btn:hover {
  background: rgba(55, 28, 18, 0.85);
  border-color: var(--color-gold-warm);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.25);
}

.preview-btn {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.25), rgba(69, 26, 3, 0.5));
  border-color: rgba(251, 191, 36, 0.5);
}

.preview-btn.active {
  background: linear-gradient(135deg, #d97706, #78350f);
  color: #fff;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
}

/* Fairytale Main Stage */
.fairytale-stage {
  position: relative;
  z-index: 10;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem 3.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Hero Header / Title */
.book-header {
  text-align: center;
  margin-bottom: 0.65rem;
  max-width: 680px;
}

.archival-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.85rem;
  background: rgba(45, 23, 14, 0.5);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 9999px;
  font-family: var(--font-serif);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-gold-bright);
  margin-bottom: 0.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.badge-gem {
  color: var(--color-gold-warm);
  font-size: 0.7rem;
}

.book-main-title {
  font-family: var(--font-decorative);
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, #fffbeb 0%, #fef08a 40%, #fbbf24 75%, #b45309 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 3px 15px rgba(245, 158, 11, 0.3);
  margin-bottom: 0.25rem;
  line-height: 1.15;
}

.mobile-only-break {
  display: none;
}

@media (max-width: 600px) {
  .mobile-only-break {
    display: block;
  }
}

.book-subtitle {
  font-family: var(--font-poetic);
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  color: #fef3c7;
  opacity: 0.88;
  line-height: 1.45;
  font-style: italic;
}

/* Clockwork Brass Chronometer Plaque (Countdown) */
.clockwork-plaque {
  width: 100%;
  max-width: 520px;
  margin-bottom: 1.1rem;
  position: relative;
}

.plaque-frame {
  position: relative;
  background: linear-gradient(145deg, #1c100b 0%, #26160e 50%, #150b07 100%);
  border: 2px solid #b45309;
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  box-shadow: 
    0 12px 30px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(254, 240, 138, 0.25),
    inset 0 0 15px rgba(0, 0, 0, 0.6),
    0 0 25px rgba(217, 119, 6, 0.15);
}

.plaque-corner {
  position: absolute;
  width: 10px;
  height: 10px;
  border: 2px solid var(--color-gold-warm);
}

.plaque-corner-tl { top: 4px; left: 4px; border-right: none; border-bottom: none; }
.plaque-corner-tr { top: 4px; right: 4px; border-left: none; border-bottom: none; }
.plaque-corner-bl { bottom: 4px; left: 4px; border-right: none; border-top: none; }
.plaque-corner-br { bottom: 4px; right: 4px; border-left: none; border-top: none; }

.plaque-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.plaque-lock-icon {
  font-size: 0.9rem;
}

.plaque-status-text {
  font-family: var(--font-serif);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-gold-bright);
}

/* Dials Grid */
.dials-grid {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.dial-cell {
  background: radial-gradient(circle at 50% 30%, #2d1810 0%, #160a06 100%);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 6px;
  padding: 0.45rem 0.7rem;
  min-width: 58px;
  text-align: center;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.8), 0 2px 8px rgba(0, 0, 0, 0.5);
}

.dial-number {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  color: #fffbeb;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
  margin-bottom: 0.15rem;
}

.dial-label {
  font-family: var(--font-ui);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #d97706;
}

.dial-divider {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--color-gold-warm);
  opacity: 0.7;
}

/* Progress Track */
.plaque-progress-wrap {
  margin-top: 0.55rem;
}

.plaque-progress-track {
  width: 100%;
  height: 4px;
  background: rgba(10, 5, 3, 0.8);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.plaque-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #92400e 0%, #f59e0b 50%, #fef08a 100%);
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
  transition: width 0.6s ease;
}

/* ==========================================================================
   3D FAIRY TALE BOOK SHOWCASE & BUCKLE ARCHITECTURE
   ========================================================================== */

.book-arena {
  position: relative;
  isolation: isolate;
  z-index: 10;
  perspective: 1600px;
  perspective-origin: 50% 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 500px;
  padding: 0.5rem 0;
}

/* Pedestal Shadow beneath the Tome */
.book-pedestal-shadow {
  position: absolute;
  width: min(380px, 86vw);
  height: 45px;
  bottom: 10px;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.5) 45%, transparent 75%);
  border-radius: 50%;
  filter: blur(12px);
  pointer-events: none;
  z-index: 1;
}

/* The 3D Book Container */
.fairy-book {
  position: relative;
  width: min(340px, 82vw);
  height: min(470px, 58vh);
  transform-style: preserve-3d;
  transition: transform 1.3s cubic-bezier(0.25, 1, 0.5, 1), width 1.3s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 5;
  transform: rotateX(5deg) rotateY(-4deg);
}

.fairy-book.book-opened {
  transform: rotateX(0deg) rotateY(0deg) translateX(50%);
}

.fairy-book.instant-open,
.fairy-book.instant-open *,
.fairy-book.instant-open *::before,
.fairy-book.instant-open *::after {
  transition: none !important;
}

/* Book Base / Page Block Thickness (Gilded Deckled Page Edges) */
.book-pages-block {
  position: absolute;
  inset: 0;
  border-radius: 6px 14px 14px 6px;
  background: linear-gradient(135deg, #18090d 0%, #260f15 100%);
  box-shadow: var(--shadow-tome);
  z-index: 2;
}

.gilded-edges-right {
  position: absolute;
  top: 12px;
  bottom: 12px;
  right: -20px;
  width: 22px;
  background: repeating-linear-gradient(
    90deg,
    #78350f 0px,
    #b45309 1px,
    #fef08a 2px,
    #d97706 3px,
    #78350f 4px
  );
  border-radius: 0 4px 4px 0;
  box-shadow: 
    inset 4px 0 8px rgba(0, 0, 0, 0.7),
    0 4px 15px rgba(0, 0, 0, 0.6);
  transform: skewY(1deg);
}

.gilded-edges-top {
  position: absolute;
  top: -14px;
  left: 32px;
  right: 6px;
  height: 15px;
  background: repeating-linear-gradient(
    0deg,
    #78350f 0px,
    #b45309 1px,
    #fef08a 2px,
    #d97706 3px,
    #78350f 4px
  );
  border-radius: 4px 4px 0 0;
  box-shadow: inset 0 4px 6px rgba(0, 0, 0, 0.6);
}

.gilded-edges-bottom {
  position: absolute;
  bottom: -14px;
  left: 32px;
  right: 6px;
  height: 15px;
  background: repeating-linear-gradient(
    180deg,
    #78350f 0px,
    #b45309 1px,
    #fef08a 2px,
    #d97706 3px,
    #78350f 4px
  );
  border-radius: 0 0 4px 4px;
  box-shadow: inset 0 -4px 6px rgba(0, 0, 0, 0.6);
}

/* Book Spine (Left 3D Edge with Embossed Ribs - Authentic Morocco Leather) */
.book-spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -28px;
  width: 34px;
  background: linear-gradient(90deg, #140508 0%, #2a0b12 35%, #42131d 75%, #1b070b 100%);
  border-radius: 12px 0 0 12px;
  box-shadow: 
    inset -3px 0 6px rgba(0, 0, 0, 0.7),
    inset 2px 0 4px rgba(254, 240, 138, 0.25),
    -6px 0 20px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: flex-start;
  padding-left: 6px;
  z-index: 25;
  cursor: default;
  pointer-events: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.spine-rib {
  width: 28px;
  height: 8px;
  background: linear-gradient(180deg, rgba(254, 240, 138, 0.4) 0%, #78350f 50%, #1a060a 100%);
  border-top: 1px solid rgba(254, 240, 138, 0.4);
  border-bottom: 1px solid rgba(0, 0, 0, 0.8);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
  border-radius: 2px;
}

.spine-title {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  font-family: var(--font-serif);
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  color: var(--color-gold-bright);
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.6), 0 1px 2px rgba(0, 0, 0, 0.9);
  opacity: 0.95;
  font-weight: 600;
  white-space: nowrap;
  width: 14px;
  text-align: center;
}

.fairy-book.book-opened .book-spine {
  left: -18px;
  width: 36px;
  padding-left: 0;
  align-items: center;
  border-radius: 0;
}

.fairy-book.book-opened .spine-title {
  display: none !important;
}

.fairy-book.book-opened .spine-rib {
  width: 100%;
}

/* ==========================================================================
   INSIDE RIGHT PAGE (THE BASE INSIDE THE BOOK)
   ========================================================================== */

.book-page-right {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, #fcf7eb 0%, #f6ecdc 70%, #ebd7b8 100%);
  border-radius: 4px 14px 14px 4px;
  box-shadow: inset 8px 0 16px rgba(0, 0, 0, 0.15), 0 12px 30px rgba(0, 0, 0, 0.7);
  padding: 1.4rem 1.2rem;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

/* ==========================================================================
   BOOK FRONT COVER (3D HINGE ON THE LEFT, FLIPS 180 DEG)
   ========================================================================== */

.book-cover-front {
  position: absolute;
  inset: 0;
  border-radius: 4px 14px 14px 4px;
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform 1.4s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 20;
}

.fairy-book.book-opened .book-cover-front {
  transform: rotateY(-180deg);
}

/* Outer Face (Leather Front Cover) */
.cover-face-front {
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, #3d101a 0%, #2a0b12 40%, #1a060a 100%);
  border-radius: 4px 14px 14px 4px;
  box-shadow: 
    inset 0 0 20px rgba(0, 0, 0, 0.85),
    inset 2px 2px 4px rgba(254, 240, 138, 0.2),
    0 12px 30px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.6rem 1.4rem;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: rotateY(0deg);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

/* Inside Back Face (Left Page: Illuminated Manuscript) */
.cover-face-back {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, #fcf7eb 0%, #f6ecdc 70%, #ebd7b8 100%);
  border-radius: 14px 4px 4px 14px;
  box-shadow: inset -8px 0 16px rgba(0, 0, 0, 0.15), 0 10px 25px rgba(0, 0, 0, 0.5);
  border-left: 1px solid rgba(120, 53, 15, 0.25);
  padding: 1.6rem 1.4rem;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: rotateY(180deg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Antique Leather Grain Overlay */
.leather-texture {
  position: absolute;
  inset: 0;
  opacity: 0.45;
  background-image: 
    radial-gradient(#140508 15%, transparent 16%),
    radial-gradient(#4a1520 15%, transparent 16%);
  background-size: 8px 8px;
  background-position: 0 0, 4px 4px;
  pointer-events: none;
}

/* Ornate Corner Metal Brackets - Clockwise Ritual (Option B) */
.corner-filigree {
  position: absolute;
  width: 54px;
  height: 54px;
  pointer-events: auto;
  cursor: pointer;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.85));
  z-index: 35;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), filter 0.25s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.corner-filigree::before {
  content: '';
  position: absolute;
  inset: -12px;
  pointer-events: auto;
}

.corner-tl { top: 6px; left: 6px; }
.corner-tr { top: 6px; right: 6px; transform: scaleX(-1); }
.corner-bl { bottom: 6px; left: 6px; transform: scaleY(-1); }
.corner-br { bottom: 6px; right: 6px; transform: scale(-1); }

/* Corner Glow Effect when tapped in clockwise ritual */
.corner-filigree.corner-glow {
  filter: drop-shadow(0 0 12px rgba(254, 240, 138, 0.95)) drop-shadow(0 0 22px rgba(56, 189, 248, 0.85));
}
.corner-tl.corner-glow { transform: scale(1.15); }
.corner-tr.corner-glow { transform: scaleX(-1) scale(1.15); }
.corner-bl.corner-glow { transform: scaleY(-1) scale(1.15); }
.corner-br.corner-glow { transform: scale(-1) scale(1.15); }

/* Gilded Perimeter Border */
.cover-gilded-frame {
  position: absolute;
  inset: 12px;
  border: 2px solid rgba(245, 158, 11, 0.75);
  border-radius: 6px;
  box-shadow: 
    inset 0 0 0 1px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(0, 0, 0, 0.8),
    inset 0 0 10px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.frame-inner-border {
  position: absolute;
  inset: 4px;
  border: 1px dashed rgba(254, 240, 138, 0.55);
  border-radius: 4px;
}

/* Central Gold-Foil Tooling */
.cover-centerpiece {
  position: relative;
  z-index: 6;
  text-align: center;
  max-width: 74%;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateX(-24px);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.cover-centerpiece * {
  user-select: none;
  -webkit-user-select: none;
}

.cover-archival-tag {
  font-family: var(--font-serif);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  color: var(--color-gold-bright);
  opacity: 0.9;
  margin-bottom: 0.5rem;
}

/* Ornate Antique Cameo with Intaglio Relief */
.cover-medallion.patronus-cameo {
  width: 92px;
  height: 126px;
  border-radius: 46px 46px 14px 14px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.85rem;
  background: #090e17;
  border: 2px solid #fef08a;
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.85),
    inset 0 0 10px rgba(0, 0, 0, 0.9),
    0 0 22px rgba(56, 189, 248, 0.35);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
  z-index: 5;
}

.cover-medallion.patronus-cameo:hover {
  transform: scale(1.04);
  box-shadow: 
    0 12px 30px rgba(0, 0, 0, 0.95),
    0 0 30px rgba(103, 232, 249, 0.6);
}

.cameo-inner-frame {
  position: absolute;
  inset: 2px;
  border-radius: 44px 44px 12px 12px;
  overflow: hidden;
  background: #050a12;
}

.cameo-art-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1), filter 1.2s ease;
}

.cameo-art-forest {
  object-position: center 28%;
  transform: scale(1.25);
  opacity: 1;
  z-index: 1;
  filter: contrast(1.08) brightness(1.02);
}

.cameo-art-patronus {
  object-position: center 25%;
  opacity: 0;
  transform: scale(1.15);
  z-index: 2;
  filter: contrast(1.15) brightness(1.05);
  pointer-events: none;
}

.cameo-flash-surge {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(254, 240, 138, 0.95) 0%, rgba(103, 232, 249, 0.85) 45%, transparent 80%);
  z-index: 10;
  opacity: 0;
  mix-blend-mode: screen;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.cover-medallion.patronus-revealed .cameo-art-forest {
  opacity: 0;
  transform: scale(1.4) blur(4px);
}

.cover-medallion.patronus-revealed .cameo-art-patronus {
  opacity: 1;
  transform: scale(1.04);
}

.cover-medallion.patronus-revealed {
  box-shadow: 
    0 0 28px rgba(103, 232, 249, 0.8),
    0 0 50px rgba(56, 189, 248, 0.4),
    inset 0 0 10px rgba(0, 0, 0, 0.9) !important;
}

.cover-medallion.patronus-cameo:hover .cameo-art-forest {
  transform: scale(1.28);
}

.cover-medallion.patronus-cameo:hover .cameo-art-patronus {
  transform: scale(1.06);
}

.cameo-art-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 38%, transparent 45%, rgba(5, 10, 18, 0.55) 78%, rgba(5, 10, 18, 0.92) 100%);
  pointer-events: none;
}

.cameo-patronus-glow {
  position: absolute;
  top: 15%;
  left: 15%;
  right: 15%;
  height: 45%;
  background: radial-gradient(circle, rgba(103, 232, 249, 0.35) 0%, rgba(56, 189, 248, 0.15) 50%, transparent 70%);
  pointer-events: none;
  filter: blur(5px);
  animation: doeGlowPulse 3.5s ease-in-out infinite alternate;
}

@keyframes doeGlowPulse {
  0% { opacity: 0.35; transform: scale(0.9); }
  100% { opacity: 0.9; transform: scale(1.15); }
}

.cameo-gilded-rim {
  position: absolute;
  inset: 0;
  border-radius: 46px 46px 14px 14px;
  border: 1px solid rgba(254, 240, 138, 0.65);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

.cameo-star-top {
  position: absolute;
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.62rem;
  color: #fef08a;
  text-shadow: 0 0 5px #fbbf24;
  pointer-events: none;
  z-index: 3;
}

.cameo-star-bottom {
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.58rem;
  color: #fef08a;
  text-shadow: 0 0 5px #fbbf24;
  pointer-events: none;
  z-index: 3;
}

.cover-tome-title {
  font-family: var(--font-decorative);
  font-size: clamp(1.4rem, 2.8vw, 1.85rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  background: linear-gradient(180deg, #fffbeb 0%, #fef08a 35%, #fbbf24 70%, #b45309 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 3px 12px rgba(245, 158, 11, 0.35);
  margin-bottom: 0.3rem;
  line-height: 1.15;
}

.cover-divider-flourish {
  font-size: 0.78rem;
  color: var(--color-gold-warm);
  letter-spacing: 0.2em;
  opacity: 0.8;
  margin-bottom: 0.35rem;
}

.cover-subtitle-foil {
  font-family: var(--font-serif);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fde68a;
  margin-bottom: 0.45rem;
}

.cover-edition-mark {
  font-family: var(--font-poetic);
  font-size: 0.76rem;
  font-style: italic;
  color: #f59e0b;
  opacity: 0.85;
}

.cover-divider-flourish {
  font-size: 0.85rem;
  color: var(--color-gold-warm);
  letter-spacing: 0.2em;
  opacity: 0.8;
  margin-bottom: 0.45rem;
}

.cover-subtitle-foil {
  font-family: var(--font-serif);
  font-size: 0.92rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fde68a;
  margin-bottom: 0.6rem;
}

.cover-edition-mark {
  font-family: var(--font-poetic);
  font-size: 0.84rem;
  font-style: italic;
  color: #f59e0b;
  opacity: 0.85;
}

/* ==========================================================================
   MAGICAL BUCKLE / CLASP ASSEMBLY
   Locks the Book Shut on the Right Edge
   ========================================================================== */

.magical-buckle-assembly {
  position: absolute;
  top: 50%;
  right: -32px;
  transform: translateY(-50%) translateZ(30px);
  z-index: 70;
  display: flex;
  align-items: center;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.6s ease;
  cursor: pointer;
}

.fairy-book.book-opened .magical-buckle-assembly,
.fairy-book.easter-egg-active .magical-buckle-assembly {
  opacity: 0;
  pointer-events: none;
}

.fairy-book.book-opened .magical-buckle-assembly {
  transform: translateY(-50%) translateX(60px) translateZ(0px);
}

/* Leather Strap Wrapping from the Back */
.buckle-strap {
  position: relative;
  width: 48px;
  height: 64px;
  background: linear-gradient(180deg, #2b0b13 0%, #3e121c 50%, #1e070c 100%);
  border-radius: 4px 0 0 4px;
  box-shadow: 
    inset 0 1px 3px rgba(254, 240, 138, 0.3),
    0 4px 10px rgba(0, 0, 0, 0.7);
  margin-right: -8px;
  z-index: 1;
}

.strap-stitch-top {
  position: absolute;
  top: 5px;
  left: 0;
  right: 0;
  height: 1px;
  border-top: 1px dashed rgba(254, 240, 138, 0.5);
}

.strap-stitch-bottom {
  position: absolute;
  bottom: 5px;
  left: 0;
  right: 0;
  height: 1px;
  border-top: 1px dashed rgba(254, 240, 138, 0.5);
}

.strap-rivet {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fef08a 0%, #b45309 80%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  left: 12px;
}

.rivet-1 { top: 16px; }
.rivet-2 { bottom: 16px; }

/* The Clasp Button (Interactive Trigger) */
.buckle-clasp-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  outline: none;
}

/* Sculpted Antique Brass Buckle Plate */
.buckle-plate {
  position: relative;
  width: 88px;
  height: 98px;
  background: linear-gradient(145deg, #d97706 0%, #f59e0b 25%, #b45309 60%, #78350f 100%);
  border-radius: 12px;
  border: 2px solid #fef08a;
  box-shadow: 
    0 10px 25px rgba(0, 0, 0, 0.85),
    inset 0 2px 4px rgba(255, 255, 255, 0.5),
    inset 0 -2px 6px rgba(0, 0, 0, 0.6),
    0 0 25px rgba(245, 158, 11, 0.4);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.4rem;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
  z-index: 2;
}

.buckle-clasp-btn:hover .buckle-plate {
  transform: scale(1.05);
  box-shadow: 
    0 12px 30px rgba(0, 0, 0, 0.9),
    0 0 35px rgba(251, 191, 36, 0.6);
}

.buckle-clasp-btn:active .buckle-plate {
  transform: scale(0.97);
}

/* Jiggle / Resist Animation when clicked early */
.buckle-clasp-btn.buckle-jiggle .buckle-plate {
  animation: buckleRattle 0.55s ease;
}

@keyframes buckleRattle {
  0% { transform: scale(1) rotate(0deg); }
  15% { transform: scale(1.06) rotate(-8deg) translateX(-4px); }
  30% { transform: scale(1.06) rotate(7deg) translateX(4px); }
  45% { transform: scale(1.04) rotate(-5deg) translateX(-3px); }
  60% { transform: scale(1.02) rotate(4deg) translateX(2px); }
  80% { transform: scale(1.01) rotate(-1deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.buckle-scrollwork-top {
  font-size: 0.72rem;
  color: #fef08a;
  letter-spacing: 0.1em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Center Lock Mechanism */
.buckle-lock-core {
  position: relative;
  width: 46px;
  height: 48px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lock-shackle {
  position: absolute;
  top: -8px;
  width: 26px;
  height: 20px;
  border: 4px solid #fef08a;
  border-bottom: none;
  border-radius: 14px 14px 0 0;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6);
}

.fairy-book.book-opened .lock-shackle {
  transform: translateY(-10px) rotate(-35deg);
}

.lock-gem-housing {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: radial-gradient(circle, #3d1406 0%, #170701 100%);
  border: 1.5px solid #fbbf24;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.9);
}

.runic-gem {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: radial-gradient(circle at 35% 35%, #fef08a 0%, #f59e0b 50%, #92400e 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.7);
  animation: gemPulse 2.8s infinite ease-in-out;
}

@keyframes gemPulse {
  0% { box-shadow: 0 0 6px rgba(245, 158, 11, 0.5); }
  50% { box-shadow: 0 0 16px rgba(254, 240, 138, 0.9), 0 0 25px rgba(245, 158, 11, 0.7); }
  100% { box-shadow: 0 0 6px rgba(245, 158, 11, 0.5); }
}

.gem-rune {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  font-weight: 900;
  color: #451a03;
}

.gem-keyhole {
  position: absolute;
  bottom: 4px;
  width: 3px;
  height: 5px;
  background: #000;
  border-radius: 1px 1px 2px 2px;
  opacity: 0.6;
}

.buckle-inscription {
  text-align: center;
  line-height: 1.1;
  pointer-events: none;
}

.inscription-date {
  display: block;
  font-family: var(--font-serif);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #fffbeb;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}

.inscription-sub {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  color: #fef08a;
  opacity: 0.88;
  pointer-events: none;
}

.buckle-scrollwork-top,
.buckle-glow-ring {
  pointer-events: none;
}

/* ==========================================================================
   WHIMSICAL DANCING FAIRIES, STARS & CRESCENT MOON (BOOK TAP)
   ========================================================================== */

.critters-stage {
  position: absolute;
  inset: -15px;
  pointer-events: none;
  z-index: 45;
  overflow: visible;
  transform-style: preserve-3d;
  transform: translateZ(40px);
}

.critters-group {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
  overflow: visible;
  transform-style: preserve-3d;
}

/* Ultra-Tiny Split-Second Magical Digits (9, 3, 4 Swarm) */
.critter-digit {
  position: absolute;
  top: -8px;
  left: -8px;
  width: 16px;
  height: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  user-select: none;
  will-change: transform, opacity;
  z-index: 55;
  animation: digitSplitSecondFlash 0.7s cubic-bezier(0.12, 0.9, 0.28, 1) forwards;
}

.digit-glyph {
  font-family: var(--font-decorative), 'Cinzel', Georgia, serif;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  color: #fef08a;
  text-shadow: 
    0 0 3px #fef08a,
    0 0 8px #f59e0b,
    0 0 14px rgba(245, 158, 11, 0.8);
  position: relative;
  z-index: 2;
  user-select: none;
}

/* Distinct Vivid Text Colors - Pure CSS Color & Text-Shadow (Zero background-clip box bugs) */
.critter-digit.digit-9 .digit-glyph {
  color: #fef08a;
  text-shadow: 0 0 3px #fef08a, 0 0 8px #f59e0b, 0 0 14px rgba(245, 158, 11, 0.85);
}

.critter-digit.digit-3 .digit-glyph {
  color: #fef08a;
  text-shadow: 0 0 3px #fef08a, 0 0 8px #f59e0b, 0 0 14px rgba(245, 158, 11, 0.85);
}

.critter-digit.digit-4 .digit-glyph {
  color: #bae6fd;
  text-shadow: 0 0 3px #bae6fd, 0 0 8px #38bdf8, 0 0 14px rgba(56, 189, 248, 0.85);
}

.digit-sparkle {
  position: absolute;
  top: -3px;
  right: -3px;
  font-size: 0.45rem;
  color: #fffbeb;
  text-shadow: 0 0 4px #fef08a;
  z-index: 3;
}

/* Split-Second Flash Animation - Disappears Gracefully in ~0.9s */
@keyframes digitSplitSecondFlash {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.25);
  }
  16% {
    opacity: 1;
    transform: translate(calc(var(--dx) * 0.35), calc(var(--dy) * 0.35)) scale(1.18) rotate(var(--rot, 0deg));
  }
  50% {
    opacity: 0.95;
    transform: translate(calc(var(--dx) * 0.72), calc(var(--dy) * 0.72)) scale(1) rotate(calc(var(--rot, 0deg) * 1.3));
  }
  75% {
    opacity: 0.65;
    transform: translate(calc(var(--dx) * 0.9), calc(var(--dy) * 0.9)) scale(0.8) rotate(calc(var(--rot, 0deg) * 1.6));
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(0.2) rotate(calc(var(--rot, 0deg) * 2));
  }
}

/* ==========================================================================
   Atmospheric Parchment Aura & Ethereal Mist Overlay
   ========================================================================== */
.always-easter-egg {
  position: absolute;
  inset: 0;
  border-radius: 4px 14px 14px 4px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 1.2s;
  background: radial-gradient(circle at 50% 45%, rgba(10, 18, 32, 0.88) 0%, rgba(5, 10, 20, 0.96) 85%);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.always-easter-egg.active {
  opacity: 1;
  visibility: visible;
}

.always-easter-egg.fading {
  opacity: 0;
  transition: opacity 1.4s cubic-bezier(0.25, 1, 0.5, 1), visibility 1.4s;
}

.always-smoke-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  filter: blur(2.5px);
  will-change: transform, opacity;
}

.always-mist-aura {
  position: absolute;
  inset: 15px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(103, 232, 249, 0.25) 0%, rgba(56, 189, 248, 0.1) 45%, transparent 75%);
  filter: blur(20px);
  animation: patronusMistBreathe 3.5s ease-in-out infinite alternate;
  z-index: 2;
}

.always-script-text {
  font-family: 'Great Vibes', 'Marck Script', 'Parisienne', cursive, serif;
  font-size: clamp(2.3rem, 7.5vw, 3.5rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  padding: 0 1rem;
  box-sizing: border-box;
  max-width: 90%;
  color: #f8fafc;
  letter-spacing: 0.03em;
  text-shadow: 
    0 0 10px rgba(255, 255, 255, 0.95),
    0 0 22px rgba(103, 232, 249, 0.9),
    0 0 38px rgba(56, 189, 248, 0.75),
    0 0 55px rgba(14, 165, 233, 0.5);
  position: relative;
  z-index: 20;
  opacity: 0;
  transform: translateY(32px) scale(0.82);
  filter: blur(28px) brightness(2.2);
}

.always-easter-egg.active .always-script-text {
  animation: smokeMaterialize 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards,
             smokeFloatHover 3s ease-in-out 1.5s infinite alternate;
}

.always-easter-egg.fading .always-script-text {
  animation: smokeEvaporate 1.4s cubic-bezier(0.25, 1, 0.5, 1) forwards !important;
}

@keyframes smokeMaterialize {
  0% {
    opacity: 0;
    transform: translateY(32px) scale(0.82) rotate(-1deg);
    filter: blur(28px) brightness(2.2);
    letter-spacing: 0.28em;
  }
  45% {
    opacity: 0.75;
    filter: blur(10px) brightness(1.5);
    letter-spacing: 0.12em;
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
    filter: blur(0px) brightness(1);
    letter-spacing: 0.03em;
  }
}

@keyframes smokeFloatHover {
  0% {
    transform: translateY(0) scale(1);
    filter: blur(0px) brightness(1);
    text-shadow: 
      0 0 10px rgba(255, 255, 255, 0.95),
      0 0 24px rgba(103, 232, 249, 0.9),
      0 0 42px rgba(56, 189, 248, 0.75);
  }
  100% {
    transform: translateY(-6px) scale(1.03);
    filter: blur(0.5px) brightness(1.1);
    text-shadow: 
      0 0 16px rgba(255, 255, 255, 1),
      0 0 32px rgba(103, 232, 249, 0.98),
      0 0 52px rgba(56, 189, 248, 0.85);
  }
}

@keyframes smokeEvaporate {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0px) brightness(1);
    letter-spacing: 0.03em;
  }
  30% {
    opacity: 0.85;
    filter: blur(8px) brightness(1.6);
    letter-spacing: 0.12em;
  }
  100% {
    opacity: 0;
    transform: translateY(-44px) scale(1.25) rotate(1deg);
    filter: blur(32px) brightness(2.4);
    letter-spacing: 0.32em;
  }
}

.always-sparks {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #e0f2fe;
  letter-spacing: 0.4em;
  text-shadow: 0 0 10px #7dd3fc, 0 0 20px #38bdf8;
  opacity: 0;
  position: relative;
  z-index: 2;
}

.always-easter-egg.active .always-sparks {
  animation: sparksMaterialize 1.5s ease-out forwards,
             floatSubtle 2.5s ease-in-out 1.5s infinite;
}

.always-easter-egg.fading .always-sparks {
  animation: sparksEvaporate 1.2s ease-in forwards !important;
}

@keyframes sparksMaterialize {
  0% { opacity: 0; transform: translateY(16px) scale(0.6); filter: blur(10px); }
  100% { opacity: 0.85; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes sparksEvaporate {
  0% { opacity: 0.85; transform: translateY(0) scale(1); filter: blur(0); }
  100% { opacity: 0; transform: translateY(-24px) scale(1.3); filter: blur(14px); }
}

@keyframes patronusMistBreathe {
  0% { transform: scale(0.85); opacity: 0.45; }
  100% { transform: scale(1.15); opacity: 0.9; }
}

/* Twinkling Shooting Stars */
.critter-star {
  position: absolute;
  top: -10px;
  left: -10px;
  pointer-events: none;
  font-size: 16px;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(253, 224, 71, 0.85));
  will-change: transform, opacity;
  animation: starTwinkleGlide 0.72s cubic-bezier(0.18, 0.9, 0.3, 1) forwards;
}

@keyframes starTwinkleGlide {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.2) rotate(0deg);
  }
  25% {
    opacity: 1;
    transform: translate(var(--tx, 20px), var(--ty, -25px)) scale(1.25) rotate(var(--rot, 45deg));
  }
  70% {
    opacity: 0.85;
    transform: translate(calc(var(--tx, 20px) * 1.6), calc(var(--ty, -25px) * 1.6)) scale(0.9) rotate(calc(var(--rot, 45deg) * 1.5));
  }
  100% {
    opacity: 0;
    transform: translate(calc(var(--tx, 20px) * 2.2), calc(var(--ty, -25px) * 2.2)) scale(0.1) rotate(calc(var(--rot, 45deg) * 2));
  }
}

/* Whimsical Fairy Dust & Sparkles */
.critter-sparkle {
  position: absolute;
  top: -8px;
  left: -8px;
  pointer-events: none;
  font-size: 15px;
  line-height: 1;
  will-change: transform, opacity;
  animation: critterSparkleBurst 2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes critterSparkleBurst {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.2);
  }
  25% {
    opacity: 1;
    transform: translate(var(--tx, 15px), var(--ty, -20px)) scale(1.25) rotate(var(--rot, 25deg));
  }
  70% {
    opacity: 0.8;
    transform: translate(calc(var(--tx, 15px) * 1.55), calc(var(--ty, -20px) * 1.55)) scale(0.88);
  }
  100% {
    opacity: 0;
    transform: translate(calc(var(--tx, 15px) * 2.1), calc(var(--ty, -20px) * 2.1)) scale(0.1) rotate(calc(var(--rot, 25deg) * 2));
  }
}

/* ==========================================================================
   INSIDE SPREAD CONTENT (LEFT MANUSCRIPT & RIGHT VIDEO PORTAL)
   ========================================================================== */

.parchment-border {
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(180, 83, 9, 0.35);
  border-radius: 4px;
  pointer-events: none;
}

/* Illuminated Left Manuscript (Back of Front Cover) */
.manuscript-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.page-header-mark {
  font-family: var(--font-serif);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #78350f;
  text-align: center;
  margin-bottom: 0.5rem;
}

.illuminated-text {
  position: relative;
}

.drop-cap {
  float: left;
  font-family: var(--font-decorative);
  font-size: 2.8rem;
  line-height: 0.8;
  padding-right: 0.35rem;
  padding-top: 0.1rem;
  color: #881337;
  text-shadow: 1px 1px 0 #b45309;
}

.manuscript-para {
  font-family: var(--font-poetic);
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--color-ink-deep);
  text-align: justify;
}

.manuscript-verse {
  font-family: var(--font-poetic);
  font-style: italic;
  font-size: 0.96rem;
  line-height: 1.4;
  color: #78350f;
  text-align: center;
  margin: 0.5rem 0;
  padding: 0.35rem 0;
  border-top: 1px dashed rgba(180, 83, 9, 0.3);
  border-bottom: 1px dashed rgba(180, 83, 9, 0.3);
}

.manuscript-filigree {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: #b45309;
  font-size: 0.78rem;
}

.fleur-line {
  width: 35px;
  height: 1px;
  background: rgba(180, 83, 9, 0.4);
}

.page-footer-date {
  font-family: var(--font-serif);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-align: center;
  color: #92400e;
  opacity: 0.85;
}

/* Right Page (Living Portal / Video Frame) */
.silk-bookmark {
  position: absolute;
  top: -8px;
  right: 22px;
  width: 18px;
  height: 110px;
  background: linear-gradient(90deg, #701a2d 0%, #9f1239 50%, #4c0519 100%);
  border-radius: 0 0 3px 3px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  z-index: 5;
}

.silk-bookmark::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 8px;
  background: #facc15;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.video-portal-card {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
}

.portal-ornament {
  font-family: var(--font-serif);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #78350f;
  margin-bottom: 0.4rem;
}

/* Miniature Framed Video Stage on the Page */
.page-video-frame {
  position: relative;
  width: 100%;
  max-width: 185px;
  aspect-ratio: 9 / 16;
  max-height: 250px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 
    0 10px 22px rgba(0, 0, 0, 0.4),
    inset 0 0 10px rgba(0, 0, 0, 0.6);
  border: 2px solid #b45309;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-video-frame:hover {
  transform: scale(1.03);
  box-shadow: 
    0 14px 28px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(245, 158, 11, 0.4);
}

.portal-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.portal-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(24, 10, 6, 0.45);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  transition: background 0.25s ease;
}

.page-video-frame:hover .portal-play-overlay {
  background: rgba(24, 10, 6, 0.25);
}

.golden-play-orb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle, #fef08a 0%, #f59e0b 60%, #b45309 100%);
  border: 2px solid #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6), 0 0 18px rgba(254, 240, 138, 0.8);
  transition: transform 0.25s ease;
}

.page-video-frame:hover .golden-play-orb {
  transform: scale(1.1);
}

.orb-icon {
  font-size: 1.1rem;
  color: #451a03;
  margin-left: 2px;
}

.orb-caption {
  font-family: var(--font-serif);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: #fffbeb;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

/* Tome Action Button */
.tome-action-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #b45309 0%, #78350f 100%);
  color: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 9999px;
  padding: 0.5rem 1.15rem;
  font-family: var(--font-serif);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: 0.5rem;
  overflow: hidden;
}

.tome-action-btn:hover {
  background: linear-gradient(135deg, #d97706 0%, #92400e 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.45);
}

.btn-play-icon {
  font-size: 0.82rem;
  color: #fef08a;
}

/* Navigation Tabs when Tome is Opened (Desktop & Mobile) */
.book-opened-nav,
.mobile-turn-page-btn,
.mobile-back-page-btn {
  display: none;
}

body.tome-opened .book-opened-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
  z-index: 40;
  animation: fadeInDown 0.4s ease;
}

.book-tab-btn {
  background: rgba(28, 12, 16, 0.94);
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 9999px;
  padding: 0.4rem 1rem;
  color: #fef08a;
  font-family: var(--font-serif);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.book-tab-btn:hover {
  border-color: #fef08a;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.75), 0 0 12px rgba(245, 158, 11, 0.3);
}

.book-tab-btn.active {
  background: linear-gradient(135deg, #b45309 0%, #78350f 100%);
  border-color: #fef08a;
  color: #fffbeb;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.5);
  transform: translateY(-1px);
  font-weight: 700;
}

.tab-btn-cover {
  background: linear-gradient(135deg, rgba(69, 10, 22, 0.95) 0%, rgba(35, 6, 12, 0.95) 100%);
  border-color: rgba(244, 63, 94, 0.45);
  color: #fed7aa;
}

.tab-btn-cover:hover {
  background: linear-gradient(135deg, rgba(136, 19, 55, 0.95) 0%, rgba(69, 10, 22, 0.95) 100%);
  border-color: #fca5a5;
  color: #fff;
  box-shadow: 0 4px 15px rgba(225, 29, 72, 0.4);
}

/* ==========================================================================
   ANCIENT ILLUMINATED PARCHMENT SCROLL (COMEDIC REJECTION MODAL)
   ========================================================================== */

.parchment-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(10, 5, 2, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.parchment-modal-overlay.instant-open {
  transition: none !important;
}

.parchment-modal-overlay.instant-open .parchment-scroll-card {
  animation: none !important;
}

.parchment-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.parchment-scroll-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: scrollUnroll 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scrollPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.parchment-scroll-card.scroll-card-pulse {
  animation: scrollPulse 0.28s ease !important;
}

@keyframes scrollUnroll {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.scroll-wood-roller {
  width: 104%;
  height: 18px;
  background: linear-gradient(90deg, #451a03 0%, #78350f 30%, #b45309 50%, #78350f 70%, #451a03 100%);
  border-radius: 9px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.75);
  position: relative;
  z-index: 2;
}

.scroll-body {
  width: 100%;
  background: #faf2dc;
  border-left: 6px solid #d97706;
  border-right: 6px solid #d97706;
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.95),
    inset 0 0 25px rgba(180, 83, 9, 0.2);
  padding: 1.4rem 1.8rem 1.8rem;
  text-align: center;
  position: relative;
  z-index: 3;
  border-radius: 2px;
}

.wax-seal-stamp {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #be123c 0%, #881337 60%, #4c0519 100%);
  border: 2px solid #fde68a;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.35);
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0.1rem auto 0.75rem;
  position: relative;
  z-index: 5;
}

.seal-icon {
  font-size: 1.65rem;
}

.scroll-flourish {
  color: #b45309;
  letter-spacing: 0.25em;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.scroll-title {
  font-family: var(--font-decorative);
  font-size: clamp(1.15rem, 4.8vw, 1.45rem);
  color: #451a03;
  margin-bottom: 0.75rem;
  line-height: 1.25;
  text-wrap: balance;
}

.scroll-message {
  font-family: var(--font-poetic);
  font-size: 1.15rem;
  line-height: 1.55;
  color: #2b1409;
  margin-bottom: 1.4rem;
}

/* Alchemical Gauge */
.alchemical-gauge {
  background: rgba(180, 83, 9, 0.08);
  border: 1px solid rgba(180, 83, 9, 0.25);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  margin-bottom: 1.4rem;
}

.gauge-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-serif);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: #78350f;
  margin-bottom: 0.5rem;
}

.gauge-val {
  font-weight: 700;
  color: #991b1b;
}

.gauge-track {
  width: 100%;
  height: 7px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 999px;
  overflow: hidden;
}

.gauge-fill {
  height: 100%;
  background: linear-gradient(90deg, #d97706, #dc2626);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.gauge-fill.maxed-out {
  background: linear-gradient(90deg, #f59e0b, #ef4444, #ec4899, #f59e0b);
  background-size: 200% 100%;
  animation: gaugeSurge 1.4s linear infinite;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.8), 0 0 4px rgba(245, 158, 11, 0.9);
}

@keyframes gaugeSurge {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.scroll-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.attempts-pill {
  font-family: var(--font-ui);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  color: #78350f;
}

.scroll-auto-dismiss-wrap {
  width: 100%;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.2rem;
  cursor: pointer;
}

.auto-dismiss-hint {
  font-family: var(--font-poetic);
  font-size: 0.84rem;
  font-style: italic;
  color: #78350f;
  opacity: 0.88;
  letter-spacing: 0.02em;
}

.auto-dismiss-track {
  width: 100%;
  height: 3px;
  background: rgba(180, 83, 9, 0.2);
  border-radius: 999px;
  overflow: hidden;
}

.auto-dismiss-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #d97706, #b45309);
  border-radius: 999px;
  transform-origin: left center;
}

.parchment-modal-overlay.active .auto-dismiss-bar {
  animation: dismissCountdown 3.8s linear forwards;
}

@keyframes dismissCountdown {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* ==========================================================================
   TRUE FULLSCREEN CINEMATIC VIDEO THEATER
   Warm Luxury Theater & Single-Decoder Ambient Glow
   ========================================================================== */

.theater-modal {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: #060403;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.theater-modal.instant-open {
  transition: none !important;
}

.theater-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.theater-ambient-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
}

.ambient-canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(50px) saturate(1.8) brightness(0.5);
  transform: scale(1.12);
  will-change: transform, filter;
  pointer-events: none;
}

.ambient-darkness-scrim {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(13, 8, 6, 0.2) 0%, rgba(6, 4, 3, 0.88) 100%);
}

.theater-pixiedust-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 15;
}

.theater-stage {
  position: relative;
  z-index: 10;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.25rem 1rem;
}

/* Central Video Frame (9:16 vertical full height) */
.fullscreen-video-frame {
  position: relative;
  z-index: 10;
  height: 86vh;
  height: 86dvh;
  aspect-ratio: 9 / 16;
  max-width: 95vw;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.95),
    0 0 35px rgba(245, 158, 11, 0.35),
    0 0 0 2px rgba(254, 240, 138, 0.4);
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.birthday-video-player {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Bottom HUD Actions */
.theater-hud-bottom {
  width: 100%;
  max-width: 600px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  transition: opacity 0.4s ease, transform 0.4s ease;
  z-index: 20;
}

.hud-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(24, 12, 8, 0.85);
  border: 1px solid rgba(245, 158, 11, 0.5);
  border-radius: 9999px;
  padding: 0.55rem 1.25rem;
  color: #fef08a;
  font-family: var(--font-serif);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: all 0.25s ease;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

.hud-action-btn:hover {
  background: rgba(55, 26, 16, 0.95);
  border-color: var(--color-gold-warm);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.45);
}

.hud-action-btn.return-book-btn {
  background: rgba(45, 20, 14, 0.85);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fef08a;
}

.hud-action-btn.return-book-btn:hover {
  background: rgba(75, 32, 20, 0.95);
  border-color: var(--color-gold-warm);
  color: #fff;
}

.theater-stage.hud-hidden .theater-hud-top,
.theater-stage.hud-hidden .theater-hud-bottom {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
}

.theater-stage.hud-hidden .theater-hud-bottom {
  transform: translateY(10px);
}

/* Toast Note */
.toast-note {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: rgba(26, 12, 7, 0.95);
  border: 1px solid var(--color-gold-warm);
  border-radius: 9999px;
  padding: 0.55rem 1.4rem;
  color: #fffbeb;
  font-family: var(--font-serif);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.85), 0 0 20px rgba(245, 158, 11, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 9999;
}

.toast-note.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   RESPONSIVE OPTIMIZATIONS
   ========================================================================== */

@media (max-width: 768px) {
  body.dev-mode .top-nav {
    display: flex;
    padding: 0.6rem 0.8rem;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }
  
  .brand-crest {
    padding: 0.35rem 0.85rem;
  }

  .crest-text {
    font-size: 0.8rem;
  }

  .nav-controls {
    gap: 0.4rem;
  }

  .control-btn {
    padding: 0.35rem 0.65rem;
    font-size: 0.74rem;
  }

  .fairytale-stage {
    padding: 0.5rem 0.6rem 2.5rem;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .book-main-title {
    font-size: clamp(1.4rem, 6.2vw, 2.1rem);
  }

  .book-subtitle {
    font-size: 0.86rem;
    padding: 0 0.5rem;
  }

  .clockwork-plaque {
    width: min(340px, 92vw);
    max-width: 92vw;
  }

  .plaque-frame {
    padding: 0.55rem 0.5rem;
  }

  .plaque-status-text {
    font-size: 0.55rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
  }

  .dials-grid {
    gap: 0.18rem;
  }

  .dial-cell {
    min-width: 44px;
    padding: 0.35rem 0.25rem;
  }

  .dial-number {
    font-size: 1.1rem;
  }

  .dial-label {
    font-size: 0.52rem;
  }

  /* Gracefully collapse countdown plaque when tome is opened to save 200px of vertical space */
  body.tome-opened .clockwork-plaque,
  .fairytale-stage.stage-book-opened .clockwork-plaque {
    max-height: 0 !important;
    opacity: 0 !important;
    margin: 0 auto !important;
    padding: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
    border: none !important;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  body.tome-opened .book-subtitle {
    margin-bottom: 0.25rem !important;
    font-size: 0.8rem !important;
  }

  body.tome-opened .book-header {
    margin-bottom: 0.2rem !important;
  }

  .book-arena {
    min-height: 480px;
    padding: 0;
    perspective: 1200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .book-pedestal-shadow {
    width: min(340px, 88vw);
    height: 38px;
    bottom: 5px;
  }

  /* Closed Book on Mobile: Majestic, Centered & Properly Sized */
  .fairy-book {
    width: min(315px, 86vw);
    height: min(475px, 62vh);
    transform: rotateX(4deg) rotateY(-2deg);
    margin: 0 auto;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), width 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  }

  /* Refined Antique Seal Clasp on Mobile */
  .magical-buckle-assembly {
    right: 4px;
    transform: translateY(-50%) translateZ(30px) scale(0.68);
    transform-origin: center right;
  }

  /* Mobile Storybook Page Tabs (Leather Ribbon floating above book when opened) */
  body.tome-opened .mobile-book-tabs {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.65rem;
    z-index: 40;
    animation: fadeInDown 0.4s ease;
  }

  .book-tab-btn {
    background: rgba(28, 12, 16, 0.94);
    border: 1px solid rgba(245, 158, 11, 0.45);
    border-radius: 9999px;
    padding: 0.34rem 0.72rem;
    color: #fef08a;
    font-family: var(--font-serif);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  }

  .book-tab-btn.active {
    background: linear-gradient(135deg, #b45309 0%, #78350f 100%);
    border-color: #fef08a;
    color: #fffbeb;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.5);
    transform: translateY(-1px);
    font-weight: 700;
  }

  /* Open Book on Mobile: Full-Width Luxurious Single Page View (Story or Video) */
  .fairy-book.book-opened {
    width: min(320px, 88vw) !important;
    height: min(475px, 62vh) !important;
    transform: rotateX(0deg) rotateY(0deg) !important;
    margin: 0 auto !important;
  }

  .fairy-book.book-opened .magical-buckle-assembly {
    display: none !important;
  }

  .fairy-book.book-opened .book-spine {
    display: none !important;
  }

  .fairy-book.book-opened .gilded-edges-right {
    display: none !important;
  }

  .fairy-book.book-opened .silk-bookmark {
    display: none !important;
  }

  /* Page 1 (The Story): Full Width, Rich Illuminated Manuscript */
  .fairy-book.book-opened .book-cover-front {
    position: absolute;
    inset: 0;
    transform: none !important;
    border-radius: 8px 14px 14px 8px;
    z-index: 20;
    pointer-events: none;
  }

  .fairy-book.book-opened .cover-face-front {
    display: none !important;
  }

  .fairy-book.book-opened .cover-face-back {
    position: absolute;
    inset: 0;
    transform: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    border-radius: 8px 14px 14px 8px;
    padding: 1.3rem 1.15rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: inset 0 0 25px rgba(180, 83, 9, 0.15), 0 12px 35px rgba(0, 0, 0, 0.8);
    transition: opacity 0.3s ease, transform 0.4s ease;
    overflow: hidden;
  }

  /* Page 2 (The Video Portal): Full Width, Framed Cinema Stage */
  .fairy-book.book-opened .book-page-right {
    position: absolute;
    inset: 0;
    border-radius: 8px 14px 14px 8px;
    padding: 1.3rem 1.15rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    box-shadow: inset 0 0 25px rgba(180, 83, 9, 0.15), 0 12px 35px rgba(0, 0, 0, 0.8);
    opacity: 0;
    pointer-events: none;
    z-index: 10;
    transition: opacity 0.3s ease, transform 0.4s ease;
    overflow: hidden;
  }

  /* Active Page Switching State on Mobile */
  .fairy-book.book-opened.mobile-show-video .cover-face-back {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: scale(0.95) !important;
    z-index: 10 !important;
  }

  .fairy-book.book-opened.mobile-show-video .book-page-right {
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: scale(1) !important;
    z-index: 25 !important;
  }

  /* Page Turn Action Buttons */
  .mobile-turn-page-btn,
  .mobile-back-page-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.15) 0%, rgba(180, 83, 9, 0.28) 100%);
    border: 1px solid rgba(217, 119, 6, 0.5);
    border-radius: 9999px;
    padding: 0.46rem 1rem;
    color: #78350f;
    font-family: var(--font-serif);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    margin-top: 0.45rem;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    transition: all 0.25s ease;
  }

  .mobile-turn-page-btn:hover,
  .mobile-back-page-btn:hover {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.25) 0%, rgba(180, 83, 9, 0.4) 100%);
    border-color: #b45309;
    color: #451a03;
    transform: translateY(-1px);
  }

  .mobile-turn-page-btn:active,
  .mobile-back-page-btn:active {
    transform: scale(0.98);
  }

  .btn-turn-arrow {
    color: #b45309;
    font-size: 0.85rem;
  }

  /* Left Page Layout on Mobile (The Story: 100% Fully Visible, No Cutoff) */
  .fairy-book.book-opened .page-header-mark {
    font-size: 0.74rem;
    letter-spacing: 0.16em;
    margin-bottom: 0.4rem;
  }

  .fairy-book.book-opened .drop-cap {
    font-size: 2.8rem;
    line-height: 0.8;
    padding-right: 0.4rem;
  }

  .fairy-book.book-opened .manuscript-para {
    font-size: 0.94rem;
    line-height: 1.46;
    text-align: justify;
  }

  .fairy-book.book-opened .manuscript-verse {
    font-size: 0.92rem;
    line-height: 1.38;
    margin: 0.45rem 0;
    padding: 0.28rem 0;
  }

  .fairy-book.book-opened .manuscript-filigree {
    font-size: 0.74rem;
    margin: 0.25rem 0;
  }

  .fairy-book.book-opened .fleur-line {
    width: 25px;
  }

  .fairy-book.book-opened .page-footer-date {
    font-size: 0.65rem;
    letter-spacing: 0.1em;
  }

  /* Right Page Layout on Mobile (The Video Portal) */
  .fairy-book.book-opened .portal-ornament {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    margin-bottom: 0.35rem;
  }

  .fairy-book.book-opened .page-video-frame {
    width: 100%;
    max-width: 175px;
    aspect-ratio: 9 / 16;
    max-height: 235px;
  }

  .fairy-book.book-opened .tome-action-btn {
    padding: 0.52rem 1.1rem;
    font-size: 0.76rem;
    margin-top: 0.4rem;
  }

  /* Responsive Scroll Rejection Modal on Mobile */
  .parchment-modal-overlay {
    padding: 0.8rem;
  }

  .scroll-body {
    padding: 1.8rem 1.1rem 1.3rem;
  }

  .scroll-title {
    font-size: 1.25rem;
    line-height: 1.2;
  }

  .scroll-message {
    font-size: 0.96rem;
    line-height: 1.4;
  }

  .curiosity-card {
    padding: 0.55rem 0.75rem;
  }

  .fullscreen-video-frame {
    height: 84vh;
    height: 84dvh;
  }

  .theater-stage {
    padding: 0.6rem 0.5rem 0.8rem;
    gap: 0.65rem;
  }
}
