/* ==========================================================================
   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; }
}

/* 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.pos-tl { top: 4px; left: 4px; border-right: none; border-bottom: none; }
.plaque-corner.pos-tr { top: 4px; right: 4px; border-left: none; border-bottom: none; }
.plaque-corner.pos-bl { bottom: 4px; left: 4px; border-right: none; border-top: none; }
.plaque-corner.pos-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;
}

.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;
  will-change: transform, filter;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  contain: layout style paint;
}

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

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

.corner-filigree.accent-pulse {
  filter: drop-shadow(0 0 10px rgba(254, 240, 138, 0.95)) drop-shadow(0 0 18px rgba(245, 158, 11, 0.85));
}
.corner-filigree.pos-tl.accent-pulse { transform: scale(1.12) translateZ(5px); }
.corner-filigree.pos-tr.accent-pulse { transform: scaleX(-1) scale(1.12) translateZ(5px); }
.corner-filigree.pos-bl.accent-pulse { transform: scaleY(-1) scale(1.12) translateZ(5px); }
.corner-filigree.pos-br.accent-pulse { transform: scale(-1) scale(1.12) translateZ(5px); }

/* 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;
}

.cameo-orbit-anchor {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.85rem;
}

/* Ornate Antique Cameo with Intaglio Relief */
.cover-medallion {
  width: 92px;
  height: 126px;
  border-radius: 46px 46px 14px 14px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0;
  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: 6;
}

.cover-medallion: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-secondary {
  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.transfigured .cameo-art-forest {
  opacity: 0;
  transform: scale(1.4) blur(4px);
}

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

.cover-medallion.transfigured {
  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;
}

@keyframes harmonicAuraPulse {
  0%, 100% {
    box-shadow: 
      0 0 26px rgba(103, 232, 249, 0.8),
      0 0 48px rgba(56, 189, 248, 0.4),
      inset 0 0 10px rgba(0, 0, 0, 0.9) !important;
  }
  50% {
    box-shadow: 
      0 0 38px rgba(254, 240, 138, 0.95),
      0 0 65px rgba(103, 232, 249, 0.7),
      inset 0 0 12px rgba(0, 0, 0, 0.95) !important;
  }
}

.cover-medallion.harmonic-glow {
  animation: harmonicAuraPulse 3s ease-in-out infinite;
}

.astral-rings-system {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.astral-rings-system.active {
  opacity: 1;
  visibility: visible;
}

.astral-rings-system.dissolving {
  opacity: 0;
  filter: blur(6px);
  transition: opacity 1.1s cubic-bezier(0.4, 0, 0.2, 1), filter 1.1s cubic-bezier(0.4, 0, 0.2, 1);
}

.track-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  border: 1px solid rgba(254, 240, 138, 0.28);
  box-shadow: 0 0 10px rgba(103, 232, 249, 0.28), inset 0 0 8px rgba(103, 232, 249, 0.15);
  pointer-events: none;
}

.ring-1 {
  width: 160px;
  height: 94px;
  margin-left: -80px;
  margin-top: -47px;
}

.ring-2 {
  width: 172px;
  height: 86px;
  margin-left: -86px;
  margin-top: -43px;
}

.ring-3 {
  width: 164px;
  height: 98px;
  margin-left: -82px;
  margin-top: -49px;
}

.astral-orbit-system {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 12;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.astral-orbit-system.active {
  opacity: 1;
  visibility: visible;
}

.astral-orbit-system.dissolving {
  opacity: 0;
  filter: blur(8px);
  transition: opacity 1.1s cubic-bezier(0.4, 0, 0.2, 1), filter 1.1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Three Atomic Tracks */
.orbit-track {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.track-diag-1 {
  transform: rotateZ(-38deg);
}

.track-horizontal {
  transform: rotateZ(0deg);
}

.track-diag-2 {
  transform: rotateZ(38deg);
}

/* Node Carrier for Orbiting Digits */
.digit-node {
  position: absolute;
  width: 32px;
  height: 32px;
  margin-left: -16px;
  margin-top: -16px;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

/* DIGIT 9 on Diagonal 1 (-38deg) */
.digit-node-9 {
  animation: atomOrbit9 4.8s linear infinite;
}

@keyframes atomOrbit9 {
  /* Front half: sweeps in front over lower face of medallion */
  0% {
    transform: translate(-80px, 0px) scale(0.95);
    opacity: 1;
  }
  25% {
    transform: translate(0px, 47px) scale(1.2);
    opacity: 1;
  }
  50% {
    transform: translate(80px, 0px) scale(0.95);
    opacity: 1;
  }
  /* Back half: swings around back, hidden while behind medallion */
  60% {
    transform: translate(56px, -33px) scale(0.85);
    opacity: 0.8;
  }
  66% {
    opacity: 0; /* Fully hidden behind the solid emblem */
  }
  75% {
    transform: translate(0px, -47px) scale(0.75);
    opacity: 0;
  }
  84% {
    opacity: 0;
  }
  90% {
    transform: translate(-56px, -33px) scale(0.85);
    opacity: 0.8; /* Emerging from behind emblem */
  }
  100% {
    transform: translate(-80px, 0px) scale(0.95);
    opacity: 1;
  }
}

/* DIGIT 3 on Horizontal Middle (0deg) */
.digit-node-3 {
  animation: atomOrbit3 5.4s linear infinite;
}

@keyframes atomOrbit3 {
  /* Front half: sweeps in front across the waist of the medallion */
  0% {
    transform: translate(86px, 0px) scale(0.95);
    opacity: 1;
  }
  25% {
    transform: translate(0px, 43px) scale(1.2);
    opacity: 1;
  }
  50% {
    transform: translate(-86px, 0px) scale(0.95);
    opacity: 1;
  }
  /* Back half: loops behind the upper waist, hidden behind emblem */
  60% {
    transform: translate(-60px, -30px) scale(0.85);
    opacity: 0.8;
  }
  66% {
    opacity: 0; /* Fully hidden behind the solid emblem */
  }
  75% {
    transform: translate(0px, -43px) scale(0.75);
    opacity: 0;
  }
  84% {
    opacity: 0;
  }
  90% {
    transform: translate(60px, -30px) scale(0.85);
    opacity: 0.8; /* Emerging from behind emblem */
  }
  100% {
    transform: translate(86px, 0px) scale(0.95);
    opacity: 1;
  }
}

/* DIGIT 4 on Diagonal 2 (+38deg) */
.digit-node-4 {
  animation: atomOrbit4 5.0s linear infinite;
}

@keyframes atomOrbit4 {
  /* Front half: sweeps in front across the upper glow */
  0% {
    transform: translate(-82px, 0px) scale(0.95);
    opacity: 1;
  }
  25% {
    transform: translate(0px, -49px) scale(1.2);
    opacity: 1;
  }
  50% {
    transform: translate(82px, 0px) scale(0.95);
    opacity: 1;
  }
  /* Back half: loops behind lower body, hidden behind emblem */
  60% {
    transform: translate(57px, 34px) scale(0.85);
    opacity: 0.8;
  }
  66% {
    opacity: 0; /* Fully hidden behind the solid emblem */
  }
  75% {
    transform: translate(0px, 49px) scale(0.75);
    opacity: 0;
  }
  84% {
    opacity: 0;
  }
  90% {
    transform: translate(-57px, 34px) scale(0.85);
    opacity: 0.8; /* Emerging from behind emblem */
  }
  100% {
    transform: translate(-82px, 0px) scale(0.95);
    opacity: 1;
  }
}

/* Keep each numeral upright with counter-rotation */
.track-diag-1 .orbit-glyph {
  transform: rotateZ(38deg);
}
.track-horizontal .orbit-glyph {
  transform: rotateZ(0deg);
}
.track-diag-2 .orbit-glyph {
  transform: rotateZ(-38deg);
}

/* Individual Illuminated Glyphs (Crisp Glowing Electron Digits) */
.orbit-glyph {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-weight: 900;
  font-size: 22px;
  line-height: 1;
  color: #ffffff;
  text-shadow: 
    0 0 4px #ffffff,
    0 0 8px #fef08a,
    0 0 16px #38bdf8,
    0 0 24px rgba(56, 189, 248, 0.85);
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.9));
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}

.orbit-glyph::after {
  content: '✦';
  position: absolute;
  top: -5px;
  right: -7px;
  font-size: 8px;
  color: #67e8f9;
  filter: drop-shadow(0 0 4px #67e8f9);
  opacity: 0.85;
  animation: sparkDigitFlicker 1.2s ease-in-out infinite alternate;
}

@keyframes sparkDigitFlicker {
  from { opacity: 0.4; transform: scale(0.7) rotate(0deg); }
  to { opacity: 1; transform: scale(1.3) rotate(45deg); }
}

/* ==========================================================================
   FLURRY OF FLYING TRIPLETS (During Transformation Entrance)
   ========================================================================== */
.flying-triplets-swarm {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 15;
}

.triplet-burst-particle {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-weight: 700;
  font-size: 13px;
  color: #fef08a;
  background: linear-gradient(135deg, #ffffff 0%, #fef08a 45%, #fbbf24 80%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 6px rgba(254, 240, 138, 0.95)) drop-shadow(0 0 12px rgba(103, 232, 249, 0.85));
  animation: tripletFlyOut 1.4s cubic-bezier(0.12, 0.8, 0.3, 1) forwards;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.triplet-burst-particle span {
  display: inline-block;
}

@keyframes tripletFlyOut {
  0% {
    transform: translate(0, 0) scale(0.3) rotate(0deg);
    opacity: 0;
  }
  20% {
    opacity: 1;
    transform: translate(calc(var(--tx) * 0.32), calc(var(--ty) * 0.32)) scale(1.22) rotate(calc(var(--rot) * 0.3));
    filter: drop-shadow(0 0 10px #fef08a) drop-shadow(0 0 18px #67e8f9);
  }
  75% {
    opacity: 0.9;
    transform: translate(calc(var(--tx) * 0.86), calc(var(--ty) * 0.86)) scale(1.0) rotate(calc(var(--rot) * 0.85));
  }
  100% {
    opacity: 0;
    transform: translate(var(--tx), var(--ty)) scale(0.4) rotate(var(--rot));
    filter: blur(6px);
  }
}

/* Disperse / Dissolve Animation when minute ends */
.chrono-orbit-system.dissolving {
  animation: orbitDisperse 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes orbitDisperse {
  0% { transform: scale(1); opacity: 1; filter: none; }
  100% { transform: scale(1.6); opacity: 0; filter: blur(10px); }
}

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

.cover-medallion:hover .cameo-art-secondary {
  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-ambient-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: ambientPulse 3.5s ease-in-out infinite alternate;
}

@keyframes ambientPulse {
  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.88;
  padding: 4px 10px;
  margin: 0 auto;
  display: inline-block;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
  border-radius: 6px;
  touch-action: pan-y;
  position: relative;
  z-index: 15;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), 
              color 0.3s ease, 
              text-shadow 0.3s ease, 
              background 0.3s ease, 
              box-shadow 0.3s ease;
}

.cover-edition-mark.polishing {
  color: #fffbeb !important;
  opacity: 1 !important;
  transform: scale(1.08);
  background: rgba(251, 191, 36, 0.18);
  box-shadow: 0 0 15px rgba(251, 191, 36, 0.35), inset 0 0 10px rgba(254, 240, 138, 0.2);
  text-shadow: 
    0 0 10px rgba(254, 240, 138, 1),
    0 0 20px rgba(245, 158, 11, 0.95),
    0 0 35px rgba(251, 191, 36, 0.8) !important;
}

.cover-edition-mark.roll-highlight {
  color: #fef08a !important;
  opacity: 1 !important;
  text-shadow: 
    0 0 10px rgba(254, 240, 138, 0.95),
    0 0 22px rgba(245, 158, 11, 0.9),
    0 0 38px rgba(251, 191, 36, 0.85) !important;
  transform: scale(1.08);
  animation: rollGlowPulse 2s ease-in-out infinite alternate;
}

@keyframes rollGlowPulse {
  0% {
    text-shadow: 0 0 10px rgba(254, 240, 138, 0.95), 0 0 20px rgba(245, 158, 11, 0.8);
    transform: scale(1.06);
  }
  100% {
    text-shadow: 0 0 16px rgba(255, 255, 255, 1), 0 0 30px rgba(254, 240, 138, 1), 0 0 45px rgba(245, 158, 11, 0.9);
    transform: scale(1.1);
  }
}

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

.magical-buckle-assembly {
  position: absolute;
  top: 50%;
  right: -24px;
  transform: translateY(-50%) translateZ(35px);
  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;
  user-select: none;
}

.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);
}

.clasp-3d-box {
  position: relative;
  width: 120px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* 3D Side Fore-Edge Flange (Hugging gilded page block) */
.clasp-side-flange {
  position: absolute;
  right: -14px;
  top: 50%;
  transform: translateY(-50%) rotateY(78deg);
  transform-origin: left center;
  width: 22px;
  height: 108px;
  z-index: 2;
  filter: drop-shadow(4px 4px 8px rgba(0, 0, 0, 0.8));
  pointer-events: none;
}

/* Front Baroque Filigree Tongue Plate */
.buckle-clasp-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  width: 105px;
  height: 135px;
  z-index: 3;
  outline: none;
  filter: drop-shadow(-4px 8px 12px rgba(0, 0, 0, 0.95)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7));
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), filter 0.25s ease;
}

.buckle-clasp-btn:hover {
  transform: scale(1.04);
  filter: drop-shadow(-6px 12px 18px rgba(0, 0, 0, 0.98)) drop-shadow(0 0 20px rgba(254, 240, 138, 0.4));
}

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

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

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

.clasp-svg-element {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Center Lock Mechanism with Glowing Runic Jewel */
.buckle-lock-core.clasp-core-pin {
  position: absolute;
  left: 17px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.runic-gem.core-jewel {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fde047 0%, #ea580c 70%, #7c2d12 100%);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.8);
  animation: jewelAura 2.6s infinite ease-in-out;
}

@keyframes jewelAura {
  0%, 100% { transform: scale(0.9); opacity: 0.75; box-shadow: 0 0 6px rgba(245, 158, 11, 0.6); }
  50% { transform: scale(1.15); opacity: 1; box-shadow: 0 0 14px rgba(254, 240, 138, 0.95), 0 0 20px rgba(245, 158, 11, 0.7); }
}

.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;
  pointer-events: auto;
  cursor: pointer;
}

.always-easter-egg.fading {
  opacity: 0;
  pointer-events: none !important;
  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: mysticMistBreathe 3.5s ease-in-out infinite alternate;
  z-index: 2;
  pointer-events: none;
}

.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: 1.2rem 2rem;
  box-sizing: border-box;
  max-width: 92%;
  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);
  transition: opacity 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), 
              filter 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), 
              transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), 
              letter-spacing 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.always-script-text.morph-dissolving {
  opacity: 0 !important;
  filter: blur(20px) brightness(2.2) !important;
  transform: translateY(-8px) scale(0.92) !important;
  letter-spacing: 0.16em !important;
}

.always-script-text.morph-revealed {
  opacity: 1 !important;
  filter: blur(0px) brightness(1.25) !important;
  transform: translateY(0) scale(1.05) !important;
  letter-spacing: 0.04em !important;
  color: #ffffff !important;
  text-shadow: 
    0 0 12px rgba(255, 255, 255, 1),
    0 0 24px rgba(224, 231, 255, 0.95),
    0 0 42px rgba(165, 180, 252, 0.85),
    0 0 65px rgba(129, 140, 248, 0.6) !important;
}

.always-script-text:hover {
  filter: brightness(1.2);
}

.always-script-text:active {
  transform: scale(0.97);
}

.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 mysticMistBreathe {
  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) {
  .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 Grimoire Clasp on Mobile */
  .magical-buckle-assembly {
    right: -8px;
    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;
  }
}

/* =========================================================================
   DAILY CHRONO-RUNES BAR & BREADCRUMB PARCHMENT MODAL
   ========================================================================= */

.chrono-runes-wrap {
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px dashed rgba(217, 119, 6, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.chrono-runes-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-bottom: 0.45rem;
}

.runes-line {
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.4), transparent);
}

.runes-title {
  font-family: 'Cinzel', serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fbbf24;
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.chrono-runes-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 440px;
  padding: 0 0.15rem;
}

.chrono-rune-btn {
  background: linear-gradient(145deg, #24130a 0%, #170b06 100%);
  border: 1px solid rgba(217, 119, 6, 0.5);
  border-radius: 8px;
  padding: 0.3rem 0.55rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  cursor: pointer;
  position: relative;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 52px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.chrono-rune-btn:hover {
  transform: translateY(-2px);
  border-color: #f59e0b;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.rune-icon {
  font-size: 0.68rem;
  color: #d97706;
  transition: all 0.28s ease;
}

.rune-label {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fde68a;
  transition: all 0.28s ease;
}

.rune-status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #78350f;
  transition: all 0.3s ease;
}

.rune-track-connector {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(217, 119, 6, 0.25), rgba(245, 158, 11, 0.55), rgba(217, 119, 6, 0.25));
  margin: 0 0.2rem;
}

/* Rune States */
.chrono-rune-btn.locked {
  opacity: 0.45;
  border-color: rgba(120, 53, 15, 0.4);
  background: linear-gradient(145deg, #180d07 0%, #100704 100%);
}

.chrono-rune-btn.locked .rune-icon {
  color: #78350f;
}

.chrono-rune-btn.locked .rune-label {
  color: #a8a29e;
}

.chrono-rune-btn.locked:hover {
  opacity: 0.75;
  border-color: rgba(217, 119, 6, 0.6);
}

.chrono-rune-btn.unlocked {
  border-color: rgba(217, 119, 6, 0.75);
  box-shadow: 0 0 10px rgba(217, 119, 6, 0.2);
}

.chrono-rune-btn.unlocked .rune-icon {
  color: #fbbf24;
}

.chrono-rune-btn.unlocked .rune-status-dot {
  background: #eab308;
  box-shadow: 0 0 5px #eab308;
}

.chrono-rune-btn.active {
  border-color: #f59e0b;
  background: linear-gradient(145deg, #381b0d 0%, #200f07 100%);
  box-shadow: 
    0 0 16px rgba(245, 158, 11, 0.55),
    inset 0 0 8px rgba(254, 240, 138, 0.25);
  animation: runeBreathing 2.2s infinite alternate;
}

.chrono-rune-btn.active .rune-icon {
  color: #fef08a;
  text-shadow: 0 0 10px #f59e0b;
}

.chrono-rune-btn.active .rune-label {
  color: #fffbeb;
  text-shadow: 0 0 8px rgba(254, 240, 138, 0.6);
}

.chrono-rune-btn.active .rune-status-dot {
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}

@keyframes runeBreathing {
  0% {
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.4), inset 0 0 6px rgba(254, 240, 138, 0.2);
    border-color: #d97706;
  }
  100% {
    box-shadow: 0 0 22px rgba(245, 158, 11, 0.8), inset 0 0 12px rgba(254, 240, 138, 0.4);
    border-color: #fef08a;
  }
}

/* Parchment Modal Backdrop & Card */
.rune-parchment-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10, 5, 3, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 1rem;
}

.rune-parchment-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.rune-parchment-card {
  position: relative;
  background: radial-gradient(circle at 50% 25%, #fffbeb 0%, #fef3c7 65%, #fde68a 100%);
  border: 3px double #b45309;
  border-radius: 14px;
  box-shadow: 
    0 24px 60px rgba(0, 0, 0, 0.85),
    inset 0 0 35px rgba(180, 83, 9, 0.18),
    0 0 30px rgba(245, 158, 11, 0.35);
  max-width: 440px;
  width: 100%;
  padding: 1.6rem 1.4rem 1.3rem;
  transform: scale(0.92) translateY(12px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.rune-parchment-backdrop.open .rune-parchment-card {
  transform: scale(1) translateY(0);
}

.parchment-close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  background: rgba(120, 53, 15, 0.15);
  border: 1px solid rgba(180, 83, 9, 0.3);
  color: #78350f;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.parchment-close-btn:hover {
  background: rgba(180, 83, 9, 0.3);
  color: #451a03;
  transform: rotate(90deg);
}

.parchment-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding-bottom: 0.4rem;
}

.parchment-rune-badge {
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: 1.15rem;
  font-weight: 900;
  color: #78350f;
  background: rgba(245, 158, 11, 0.25);
  border: 1px solid rgba(180, 83, 9, 0.5);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.parchment-title-wrap {
  display: flex;
  flex-direction: column;
}

.parchment-title {
  font-family: 'Cinzel', serif;
  font-size: 1.08rem;
  font-weight: 800;
  color: #451a03;
  margin: 0;
  letter-spacing: 0.04em;
}

.parchment-date {
  font-family: 'Cinzel', serif;
  font-size: 0.68rem;
  color: #92400e;
  letter-spacing: 0.06em;
  margin-top: 0.1rem;
}

.parchment-seal-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #b45309;
  font-size: 0.7rem;
  margin: 0.6rem 0 0.8rem;
  width: 100%;
  border-bottom: 1px dashed rgba(180, 83, 9, 0.3);
  padding-bottom: 0.5rem;
}

.parchment-body {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Permanent Mariner's Map Legend / Compass Rose on Cover */
.cover-compass-legend {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0.3rem 0 0.4rem;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
  z-index: 8;
  opacity: 0.92;
  transition: opacity 0.3s ease;
}

.cover-compass-svg {
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 10px rgba(245, 158, 11, 0.3));
}

.compass-legend-caption {
  font-family: 'Cinzel', serif;
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #fbbf24;
  text-shadow: 0 0 6px rgba(245, 158, 11, 0.5);
  margin-top: 0.2rem;
  text-transform: uppercase;
  opacity: 0.85;
}

.compass-caption {
  font-family: 'Cinzel', serif;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #78350f;
  margin-top: 0.4rem;
  text-transform: uppercase;
}

.parchment-quote {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.16rem;
  font-style: italic;
  font-weight: 600;
  line-height: 1.55;
  color: #3f1803;
  text-align: center;
  margin: 0.4rem 0 0.8rem;
  padding: 0 0.5rem;
  quotes: "“" "”";
}

.parchment-footer {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 0.4rem;
}

.parchment-action-btn {
  background: linear-gradient(145deg, #92400e 0%, #78350f 100%);
  border: 1px solid #fef08a;
  color: #fffbeb;
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.45rem 1.25rem;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(120, 53, 15, 0.4);
  transition: all 0.22s ease;
}

.parchment-action-btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(145deg, #b45309 0%, #92400e 100%);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.5);
}

/* Mobile Adjustments for Runes */
@media (max-width: 480px) {
  .chrono-rune-btn {
    min-width: 44px;
    padding: 0.25rem 0.35rem;
  }

  .rune-label {
    font-size: 0.65rem;
  }

  .rune-icon {
    font-size: 0.6rem;
  }

  .runes-title {
    font-size: 0.54rem;
  }

  .rune-parchment-card {
    padding: 1.3rem 1.1rem 1.1rem;
  }

  .parchment-quote {
    font-size: 1.05rem;
    line-height: 1.45;
  }
}


/* ── Ritual Inscription ────────────────────────────────────────────────
   Shown when the corner ritual is solved before the Eve. A vignette dims
   the cover's own lettering while leaving the medallion lit, and the hint
   is set as an arc of gold around it -- where the eye already is. */
.ritual-inscription {
  position: absolute;
  inset: 0;
  border-radius: 4px 14px 14px 4px;
  pointer-events: none;
  z-index: 55;
  opacity: 0;
  transition: opacity 1.1s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.ritual-inscription.visible { opacity: 1; }
.ritual-inscription.fading  { opacity: 0; }

.ritual-inscription .insc-stage {
  position: absolute;
  width: 300px;
  height: 300px;
  transform: translate(-50%, -50%);
}

.ritual-inscription svg { width: 100%; height: 100%; overflow: visible; }

.ritual-inscription .insc-text {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 2.2px;
  fill: url(#inscriptionGold);
  text-transform: uppercase;
  paint-order: stroke fill;
  stroke: rgba(10, 6, 3, 0.9);
  stroke-width: 2.6px;
  stroke-linejoin: round;
}

.ritual-inscription .insc-lower {
  font-size: 11px;
  letter-spacing: 0.9px;
}

@media (max-width: 380px) {
  .ritual-inscription .insc-stage  { width: 260px; height: 260px; }
  .ritual-inscription .insc-text   { font-size: 14px; letter-spacing: 1.6px; }
  .ritual-inscription .insc-lower  { font-size: 10px; letter-spacing: 0.5px; }
}

/* While the inscription is shown, the tome's own lettering recedes so the
   arc has clean ground. Restored when it fades. */
.cover-face-front .cover-archival-tag,
.cover-face-front .cover-tome-title,
.cover-face-front .cover-divider-flourish,
.cover-face-front .cover-subtitle-foil {
  transition: opacity 0.9s ease;
}

.cover-face-front.inscribing .cover-archival-tag,
.cover-face-front.inscribing .cover-tome-title,
.cover-face-front.inscribing .cover-divider-flourish,
.cover-face-front.inscribing .cover-subtitle-foil {
  opacity: 0.05;
}
