/**
 * THE KINGDOM OF MOUKI
 * Sections CSS - Layout Structures & Alternating Rhythms for All 8 Realms
 */

/* ==========================================================================
   TWO-STATE KINGDOM ARCHITECTURE: ENTRANCE VS KINGDOM INTERIOR
   ========================================================================== */
body.state-entrance,
html:has(body.state-entrance) {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden !important;
  touch-action: none;
}

body.state-entrance #kingdom-interior {
  display: none !important;
}

body.state-entrance .navigation-wand-container {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body.state-kingdom {
  min-height: 100vh;
  overflow-y: auto;
  background: 
    linear-gradient(180deg, rgba(250, 246, 255, 0.92) 0%, rgba(255, 240, 245, 0.88) 50%, rgba(238, 219, 255, 0.92) 100%),
    url('../images/entrance/castle-interior.png') center top / cover no-repeat fixed;
  background-attachment: fixed;
}

body.state-kingdom .kingdom-entrance-stage {
  display: none;
}

body.state-kingdom #kingdom-interior {
  display: block;
  animation: kingdomFadeIn 700ms cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes kingdomFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   1. GLOBAL REALM SECTION SPACING & RHYTHM
   ========================================================================== */
.realm-section {
  padding-block: clamp(var(--space-12), 8vw, var(--space-20));
  position: relative;
  width: 100%;
  overflow-x: clip; /* Cleanly bounds any decorative blur without breaking scroll */
  transition: background-color var(--transition-normal);
}

/* Alternating Background Rhythm */
.realm-section:nth-child(odd) {
  background-color: var(--color-cloud-lavender);
}

.realm-section:nth-child(even) {
  background-color: var(--color-blush-silk);
}

/* Bottom clearance for floating navigation wand */
.realm-section:last-of-type {
  padding-bottom: clamp(var(--space-20), 14vw, var(--space-24));
}

/* ==========================================================================
   2. SECTION 1: ROYAL WELCOME / GRAND CASTLE ENTRANCE (STATE A)
   ========================================================================== */
.kingdom-entrance-stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 50;
  overflow: hidden;
  background-color: #2b1736;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: opacity 800ms ease, transform 800ms ease;
}

/* Shared aspect-ratio castle canvas (1672:941) */
.castle-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  aspect-ratio: 1672 / 941;
  width: max(100vw, calc(100vh * (1672 / 941)));
  height: max(100vh, calc(100vw * (941 / 1672)));
  pointer-events: none;
  transition: transform 1200ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 800ms ease;
}

/* Layered artwork within canvas */
.castle-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
}

.castle-layer-interior {
  z-index: 1;
}

.castle-layer-exterior {
  z-index: 2;
}

/* Interactive door portal frame (anchored to archway coordinates: 733px, 470px on 1672x941 canvas) */
.portal-gates-frame {
  position: absolute;
  left: 43.8397%;
  top: 49.9469%;
  width: 12.3206%;
  height: 26.0361%;
  z-index: 3;
  perspective: 1200px;
  transform-style: preserve-3d;
}

.door-panel {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 850ms cubic-bezier(0.25, 1, 0.4, 1);
  will-change: transform;
}

.door-panel .door-img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.door-left {
  left: 0;
  transform-origin: left center;
}

.door-right {
  right: 0;
  transform-origin: right center;
}

/* 3D Door Rotation States */
.portal-gates-frame.doors-closed .door-left {
  transform: rotateY(0deg);
}
.portal-gates-frame.doors-closed .door-right {
  transform: rotateY(0deg);
}

.portal-gates-frame.doors-slightly-open .door-left {
  transform: rotateY(-22deg);
}
.portal-gates-frame.doors-slightly-open .door-right {
  transform: rotateY(22deg);
}

.portal-gates-frame.doors-fully-open .door-left {
  transform: rotateY(-82deg);
}
.portal-gates-frame.doors-fully-open .door-right {
  transform: rotateY(82deg);
}

/* Ambient Stardust on Canvas */
.castle-sparkles-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.castle-sparkle {
  position: absolute;
  font-size: 1.25rem;
  opacity: 0.8;
  animation: floatSparkle 3s ease-in-out infinite alternate;
}

.sparkle-1 { top: 22%; left: 32%; animation-delay: 0s; font-size: 1.5rem; }
.sparkle-2 { top: 15%; right: 28%; animation-delay: 0.8s; font-size: 1.2rem; }
.sparkle-3 { top: 40%; left: 20%; animation-delay: 1.6s; font-size: 1.1rem; }
.sparkle-4 { top: 35%; right: 22%; animation-delay: 2.2s; font-size: 1.4rem; }
.sparkle-5 { top: 58%; left: 36%; animation-delay: 1.2s; font-size: 1.3rem; }

@keyframes floatSparkle {
  0% { transform: translateY(0) scale(0.9); opacity: 0.5; }
  50% { transform: translateY(-8px) scale(1.15); opacity: 0.95; filter: drop-shadow(0 0 6px rgba(255, 245, 204, 0.8)); }
  100% { transform: translateY(0) scale(0.9); opacity: 0.5; }
}

/* ==========================================================================
   ENTRANCE PROCLAMATION: TRANSLUCENT FLOATING GLASS PANEL
   ========================================================================== */
.entrance-proclamation-card {
  box-sizing: border-box;
  position: absolute;
  bottom: clamp(10px, 1.8vh, 18px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  width: calc(100% - 32px); /* 16px safe margins on both sides */
  max-width: 560px;
  padding: 10px 18px 12px;
  background: linear-gradient(135deg, rgba(255, 240, 248, 0.45) 0%, rgba(238, 219, 255, 0.4) 50%, rgba(255, 245, 250, 0.45) 100%);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(232, 197, 71, 0.55);
  border-radius: var(--radius-xl);
  box-shadow: 
    0 8px 24px rgba(43, 23, 54, 0.22),
    0 0 16px rgba(255, 245, 204, 0.18),
    inset 0 1px 1px rgba(255, 255, 255, 0.6);
  text-align: center;
  transition: opacity 400ms ease, transform 400ms ease;
  pointer-events: auto;
}

/* Subtle magical sparkle accents on panel corners */
.entrance-proclamation-card::before,
.entrance-proclamation-card::after {
  content: '✨';
  position: absolute;
  font-size: 0.75rem;
  opacity: 0.75;
  pointer-events: none;
  animation: stardustTwinkle 3.5s ease-in-out infinite alternate;
}

.entrance-proclamation-card::before {
  top: 6px;
  left: 10px;
}

.entrance-proclamation-card::after {
  top: 6px;
  right: 10px;
  animation-delay: 1.5s;
}

.entrance-proclamation-card .welcome-crest {
  display: none;
}

.entrance-proclamation-card .royal-badge {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  max-width: 100%;
  white-space: normal;
  text-align: center;
  flex-wrap: wrap;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 2px 10px;
  margin-bottom: 3px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(232, 197, 71, 0.45);
  border-radius: var(--radius-pill);
  color: var(--color-velvet-plum);
}

.entrance-proclamation-card .welcome-title {
  box-sizing: border-box;
  font-family: var(--font-royal-title);
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  font-weight: 700;
  color: var(--color-velvet-plum);
  margin: 1px 0 3px;
  line-height: 1.18;
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.7);
  white-space: normal;
  overflow-wrap: break-word;
  word-wrap: break-word;
  max-width: 100%;
}

.entrance-proclamation-card .welcome-description {
  box-sizing: border-box;
  font-size: clamp(0.68rem, 1.4vw, 0.78rem);
  color: #38274a;
  margin: 0 auto 8px;
  line-height: 1.32;
  max-width: 100%;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
  white-space: normal;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.entrance-proclamation-card .welcome-actions {
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  width: 100%;
}

.entrance-proclamation-card .btn-royal-enter {
  box-sizing: border-box;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  font-size: clamp(0.8rem, 1.6vw, 0.92rem);
  padding: 7px 22px;
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 16px rgba(232, 197, 71, 0.45), 0 2px 8px rgba(61, 44, 77, 0.2);
}

/* Transition Zoom on Enter */
.kingdom-entrance-stage.entering-transition .castle-canvas {
  transform: translate(-50%, -50%) scale(2.4);
  opacity: 0;
  transition: transform 1000ms cubic-bezier(0.25, 1, 0.5, 1), opacity 800ms ease 300ms;
}

.kingdom-entrance-stage.entering-transition .entrance-proclamation-card {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 400ms ease, transform 400ms ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .entrance-proclamation-card {
    width: calc(100% - 28px); /* 14px safe margin on both sides */
    max-width: 480px;
    padding: 8px 14px 10px;
    bottom: 10px;
  }
  .entrance-proclamation-card .welcome-title {
    font-size: 1.08rem;
  }
  .entrance-proclamation-card .welcome-description {
    font-size: 0.72rem;
    margin-bottom: 6px;
    line-height: 1.25;
  }
  .entrance-proclamation-card .btn-royal-enter {
    font-size: 0.82rem;
    padding: 6px 18px;
  }
}

@media (max-width: 420px) {
  .entrance-proclamation-card {
    width: calc(100% - 24px); /* 12px safe margin on both sides */
    max-width: 360px;
    padding: 6px 10px 6px;
    bottom: 6px;
  }
  .entrance-proclamation-card .royal-badge {
    font-size: 0.62rem;
    padding: 1px 8px;
    margin-bottom: 1px;
  }
  .entrance-proclamation-card .welcome-title {
    font-size: 0.92rem;
    margin: 0 0 2px;
  }
  .entrance-proclamation-card .welcome-description {
    font-size: 0.64rem;
    margin-bottom: 4px;
    line-height: 1.2;
  }
  .entrance-proclamation-card .btn-royal-enter {
    font-size: 0.74rem;
    padding: 4px 14px;
    gap: 6px;
  }
}

@media (max-width: 340px) {
  .entrance-proclamation-card {
    width: calc(100% - 24px);
    padding: 4px 8px 5px;
    bottom: 4px;
  }
  .entrance-proclamation-card .welcome-title {
    font-size: 0.86rem;
  }
  .entrance-proclamation-card .welcome-description {
    font-size: 0.6rem;
    line-height: 1.18;
  }
  .entrance-proclamation-card .btn-royal-enter {
    font-size: 0.7rem;
    padding: 3px 10px;
  }
}

/* Royal Top Bar for Kingdom Interior */
.royal-top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1.5px solid rgba(232, 197, 71, 0.4);
  box-shadow: 0 4px 16px rgba(61, 44, 77, 0.08);
  padding-block: var(--space-2);
}

.royal-top-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.royal-top-title {
  font-family: var(--font-royal-title);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-velvet-plum);
  letter-spacing: 0.04em;
}

.btn-exit-kingdom {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--color-champagne-gold);
  background: linear-gradient(135deg, #FFF0F5 0%, #FAF6FF 100%);
  color: var(--color-velvet-plum);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-exit-kingdom:hover,
.btn-exit-kingdom:focus-visible {
  background: linear-gradient(135deg, #FFE4E8 0%, #EEDBFF 100%);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(61, 44, 77, 0.12);
}

.welcome-proclamation .welcome-crest {
  margin-inline: auto;
  margin-bottom: var(--space-3);
  width: 54px;
  height: 54px;
  filter: drop-shadow(0 4px 10px rgba(232, 197, 71, 0.45));
}

.welcome-proclamation .welcome-title {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-3);
  color: var(--color-velvet-plum);
}

.welcome-proclamation .welcome-description {
  font-size: var(--text-base);
  color: var(--color-velvet-plum);
  line-height: var(--leading-normal);
  max-width: 520px;
  margin-inline: auto;
  margin-bottom: var(--space-6);
  font-weight: 500;
}

.welcome-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* ==========================================================================
   3. SECTION 2: PRINCESS MOUKI PROFILE
   ========================================================================== */
.profile-section {
  background: radial-gradient(circle at 80% 20%, rgba(216, 180, 248, 0.2) 0%, rgba(255, 240, 245, 1) 75%);
}

.profile-card-container {
  max-width: 1040px;
  margin-inline: auto;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: clamp(var(--space-6), 4vw, var(--space-10));
  align-items: center;
}

@media (max-width: 860px) {
  .profile-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-8);
  }
}

/* ==========================================================================
   4. SECTION 3: MOUKI FUNLAND (6 THEMED AMUSEMENT LANDS)
   ========================================================================== */
.funland-section {
  position: relative;
  background: radial-gradient(ellipse at center top, rgba(255, 240, 245, 0.4) 0%, rgba(250, 246, 255, 0) 70%);
}

.funland-intro-card {
  max-width: 780px;
  margin: 0 auto var(--space-8);
  padding: var(--space-5) var(--space-6);
  text-align: center;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 240, 245, 0.9) 100%);
  border: 1.5px solid var(--border-gold-subtle);
  border-radius: var(--radius-xl, 18px);
  box-shadow: 0 8px 24px rgba(61, 44, 77, 0.06);
}

.funland-intro-text {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-velvet-plum);
  line-height: var(--leading-relaxed);
  margin: 0;
}

/* 6 Lands Responsive Grid */
.funland-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6);
  width: 100%;
  box-sizing: border-box;
}

/* Individual Themed Land Card */
.funland-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.94);
  border: 1.5px solid var(--border-gold-subtle);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(61, 44, 77, 0.08);
  cursor: pointer;
  padding: 0;
  margin: 0;
  text-align: left;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s, border-color 0.28s;
  box-sizing: border-box;
}

.funland-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 36px rgba(61, 44, 77, 0.16), 0 0 24px rgba(232, 197, 71, 0.28);
  border-color: var(--color-champagne-gold);
}

.funland-card:focus-visible {
  outline: 2px solid var(--color-champagne-gold);
  outline-offset: 3px;
}

/* Poster Preview Container */
.land-poster-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-cloud-lavender) 0%, var(--color-blush-silk) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Land 6 Portrait Reel Variant */
.funland-card--portrait .land-poster-wrap {
  aspect-ratio: 9 / 16;
  max-height: 480px;
}

.land-poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.funland-card:hover .land-poster-img {
  transform: scale(1.03);
}

/* Floating Poster Overlays */
.land-poster-badge-top-left {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-gold-subtle);
  border-radius: 999px;
  padding: 3px 10px;
  font-family: var(--font-royal);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-velvet-plum);
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(61, 44, 77, 0.15);
}

.land-poster-badge-top-right {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(61, 44, 77, 0.82);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(232, 197, 71, 0.5);
  border-radius: 999px;
  padding: 3px 9px;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-champagne-gold-light);
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Floating Central Play Trigger */
.land-play-trigger {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  z-index: 3;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border: 2px solid var(--color-champagne-gold);
  color: var(--color-velvet-plum);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(61, 44, 77, 0.25), 0 0 16px rgba(232, 197, 71, 0.35);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background 0.25s, box-shadow 0.25s;
  pointer-events: none;
}

.land-play-icon {
  font-size: 1.25rem;
  margin-left: 3px;
  color: var(--color-velvet-plum);
  transition: color 0.2s ease;
}

.funland-card:hover .land-play-trigger {
  transform: translate(-50%, -50%) scale(1.12);
  background: var(--color-champagne-gold-light);
  box-shadow: 0 12px 30px rgba(61, 44, 77, 0.35), 0 0 24px rgba(232, 197, 71, 0.5);
}

/* Land Card Caption & Information */
.land-card-caption {
  padding: var(--space-4);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 240, 245, 0.92) 100%);
  border-top: 1px solid rgba(232, 197, 71, 0.35);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1 1 auto;
  box-sizing: border-box;
}

.land-card-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
}

.land-card-title {
  font-family: var(--font-royal);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-velvet-plum);
  margin: 0;
  letter-spacing: 0.5px;
}

.land-card-tagline {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--color-dusk-lavender);
  margin: 0;
  line-height: var(--leading-normal);
}

.land-card-footer {
  margin-top: auto;
  padding-top: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px dashed rgba(232, 197, 71, 0.3);
}

.land-card-aspect-badge {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.land-card-aspect-badge--landscape {
  background: rgba(216, 180, 248, 0.25);
  border: 1px solid rgba(216, 180, 248, 0.5);
  color: var(--color-velvet-plum);
}

.land-card-aspect-badge--portrait {
  background: var(--color-champagne-gold-light);
  border: 1px solid rgba(232, 197, 71, 0.6);
  color: var(--color-champagne-gold-dark);
}

.land-card-watch-link {
  font-family: var(--font-royal);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-champagne-gold-dark);
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Responsive Grid Breakpoints */
@media (max-width: 992px) {
  .funland-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-5);
  }
}

@media (max-width: 600px) {
  .funland-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .funland-intro-card {
    padding: var(--space-4);
    margin-bottom: var(--space-6);
  }

  .funland-card--portrait .land-poster-wrap {
    max-height: 420px;
  }
}

@media (max-width: 375px) {
  .land-card-title {
    font-size: 0.95rem;
  }

  .land-card-caption {
    padding: var(--space-3);
  }
}

@media (max-width: 320px) {
  .land-card-title {
    font-size: 0.9rem;
  }

  .land-poster-badge-top-left {
    font-size: 0.65rem;
    padding: 2px 7px;
  }
}

/* ==========================================================================
   5. SECTION 4: MUSEUM OF MOUKI ("A TREASURY OF BEAUTIFUL MEMORIES")
   ========================================================================== */
.museum-section {
  position: relative;
  background: radial-gradient(ellipse at top center, rgba(255, 245, 204, 0.2) 0%, rgba(250, 246, 255, 0) 70%);
}

.museum-intro-card {
  max-width: 760px;
  margin: 0 auto var(--space-8);
  padding: var(--space-5) var(--space-6);
  text-align: center;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 240, 245, 0.88) 100%);
  border: 1.5px solid var(--border-gold-subtle);
  border-radius: var(--radius-xl, 18px);
  box-shadow: 0 8px 24px rgba(61, 44, 77, 0.06);
}

.museum-intro-text {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-velvet-plum);
  line-height: var(--leading-relaxed);
  margin: 0;
}

/* Storybook Chapters */
.storybook-chapters {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.storybook-chapter {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* Chapter Header */
.chapter-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.chapter-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-royal);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--color-champagne-gold-dark);
  background: var(--color-champagne-gold-light);
  border: 1px solid rgba(232, 197, 71, 0.6);
  padding: 4px 14px;
  border-radius: 999px;
}

.chapter-title {
  font-family: var(--font-royal);
  font-size: clamp(1.4rem, 1.2rem + 1vw, 2.1rem);
  font-weight: 700;
  color: var(--color-velvet-plum);
  letter-spacing: 0.5px;
  margin: 0;
}

.chapter-flourish {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  max-width: 320px;
  margin-top: 2px;
}

.chapter-flourish-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 197, 71, 0.6), transparent);
}

.chapter-flourish-pip {
  color: var(--color-champagne-gold);
  font-size: 0.8rem;
}

/* Responsive Mosaic Chapter Grid */
.museum-chapter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-6);
  width: 100%;
  box-sizing: border-box;
}

/* Museum Card Frame */
.museum-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.94);
  border: 1.5px solid var(--border-gold-subtle);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(61, 44, 77, 0.08);
  cursor: pointer;
  padding: 0;
  margin: 0;
  text-align: left;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s, border-color 0.28s;
  box-sizing: border-box;
}

.museum-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 32px rgba(61, 44, 77, 0.16), 0 0 20px rgba(232, 197, 71, 0.25);
  border-color: var(--color-champagne-gold);
}

.museum-card:focus-visible {
  outline: 2px solid var(--color-champagne-gold);
  outline-offset: 3px;
}

/* Image Wrappers and Aspect Ratios */
.museum-card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-cloud-lavender) 0%, var(--color-blush-silk) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.museum-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  display: block;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.museum-card:hover .museum-card-img {
  transform: scale(1.03);
}

/* Featured 2-Column Panoramic Cards (Treasures #21 and #22) */
.panoramic-card {
  grid-column: span 2;
}

.panoramic-card .museum-card-img-wrap {
  aspect-ratio: 16 / 9;
}

.panoramic-card .museum-card-img {
  object-position: center center;
}

/* Card Caption Bar */
.museum-card-caption {
  padding: var(--space-3) var(--space-4);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 240, 245, 0.92) 100%);
  border-top: 1px solid rgba(232, 197, 71, 0.35);
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-sizing: border-box;
}

.museum-card-top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.museum-card-treasure-num {
  font-family: var(--font-royal);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-velvet-plum);
  letter-spacing: 0.5px;
}

.museum-card-badge {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.museum-card-badge--portrait {
  background: rgba(216, 180, 248, 0.25);
  border: 1px solid rgba(216, 180, 248, 0.5);
  color: var(--color-velvet-plum);
}

.museum-card-badge--panoramic {
  background: var(--color-champagne-gold-light);
  border: 1px solid rgba(232, 197, 71, 0.6);
  color: var(--color-champagne-gold-dark);
}

.museum-card-date {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--color-dusk-lavender);
  font-weight: 500;
  margin: 0;
}

/* Epilogue Ribbon */
.museum-epilogue-ribbon {
  margin-top: var(--space-8);
  padding: var(--space-6) var(--space-5);
  text-align: center;
  background: linear-gradient(135deg, rgba(255, 245, 204, 0.65) 0%, rgba(255, 240, 245, 0.85) 50%, rgba(238, 219, 255, 0.65) 100%);
  border: 1.5px solid var(--border-gold-subtle);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(61, 44, 77, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  box-sizing: border-box;
}

.epilogue-icon {
  font-size: 2rem;
  line-height: 1;
}

.epilogue-quote {
  font-family: var(--font-accent);
  font-size: clamp(1.4rem, 1.2rem + 1vw, 2.1rem);
  font-weight: 700;
  color: var(--color-velvet-plum);
  line-height: 1.4;
  margin: 0;
  max-width: 720px;
}

.epilogue-dedication {
  font-family: var(--font-royal);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-champagne-gold-dark);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 0;
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .museum-chapter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-5);
  }
}

@media (max-width: 768px) {
  .museum-chapter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
  }

  .panoramic-card {
    grid-column: span 2;
  }
}

@media (max-width: 600px) {
  .museum-chapter-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .panoramic-card {
    grid-column: span 1;
  }

  .museum-intro-card {
    padding: var(--space-4);
    margin-bottom: var(--space-6);
  }

  .museum-epilogue-ribbon {
    padding: var(--space-5) var(--space-3);
  }
}

@media (max-width: 375px) {
  .chapter-title {
    font-size: 1.35rem;
  }

  .museum-card-caption {
    padding: var(--space-2) var(--space-3);
  }
}

@media (max-width: 320px) {
  .chapter-badge {
    font-size: 0.65rem;
    padding: 3px 8px;
    letter-spacing: 0.5px;
  }

  .chapter-title {
    font-size: 1.2rem;
  }
}

/* ==========================================================================
   6. SECTION 5: EIGHT BIRTHDAY GIFTS
   ========================================================================== */
.gifts-section {
  position: relative;
  overflow: visible;
}

.gifts-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(var(--space-4), 2.5vw, var(--space-6));
  margin-top: var(--space-8);
}

@media (max-width: 1024px) {
  .gifts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .gifts-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}

/* --- Royal Gift Card --- */
.royal-gift-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(var(--space-5), 3vw, var(--space-6)) var(--space-4);
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 245, 248, 0.88) 50%, rgba(250, 246, 255, 0.94) 100%);
  border: 1.5px solid var(--border-gold-subtle);
  border-radius: var(--radius-xl);
  box-shadow: 0 8px 24px rgba(61, 44, 77, 0.08), 0 2px 8px rgba(232, 197, 71, 0.12);
  cursor: pointer;
  user-select: none;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease, border-color 0.3s ease;
}

.royal-gift-card:hover {
  transform: translateY(-6px);
  border-color: var(--color-champagne-gold);
  box-shadow: 0 16px 36px rgba(61, 44, 77, 0.14), 0 0 24px rgba(232, 197, 71, 0.25);
}

.royal-gift-card:active {
  transform: translateY(-2px) scale(0.99);
}

.royal-gift-card:focus-visible {
  outline: 3px solid var(--color-champagne-gold);
  outline-offset: 3px;
}

/* Gift Card Ribbon */
.gift-card-ribbon {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-fairy-rose), var(--color-champagne-gold), var(--color-enchanted-lilac));
}

.gift-card-badge {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-champagne-gold-dark);
  background: rgba(232, 197, 71, 0.16);
  border: 1px solid rgba(232, 197, 71, 0.35);
  border-radius: var(--radius-full);
  padding: 2px 10px;
  margin-bottom: var(--space-3);
}

.gift-card-visual {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 240, 245, 0.95) 0%, rgba(238, 219, 255, 0.8) 100%);
  border: 1.5px solid rgba(232, 197, 71, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
  box-shadow: 0 4px 12px rgba(61, 44, 77, 0.08);
  transition: transform 0.4s ease;
}

.royal-gift-card:hover .gift-card-visual {
  transform: scale(1.1) rotate(4deg);
}

.gift-icon-svg {
  font-size: 2.2rem;
  line-height: 1;
}

.gift-card-title {
  font-family: var(--font-royal);
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  color: var(--color-velvet-plum);
  font-weight: 700;
  margin-bottom: var(--space-2);
  line-height: var(--leading-tight);
}

.gift-card-desc {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-dusk-lavender);
  line-height: var(--leading-snug);
  margin-bottom: var(--space-4);
  flex-grow: 1;
}

.gift-card-action {
  margin-top: auto;
}

.gift-action-pill {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-velvet-plum);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border-gold-subtle);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  box-shadow: 0 2px 6px rgba(61, 44, 77, 0.06);
  transition: all 0.25s ease;
}

.royal-gift-card:hover .gift-action-pill {
  background: var(--color-champagne-gold);
  color: var(--color-velvet-plum);
  border-color: var(--color-champagne-gold-dark);
  box-shadow: 0 4px 12px rgba(232, 197, 71, 0.4);
}

/* ==========================================================================
   GIFT MODAL DIALOG
   ========================================================================== */
.gift-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(var(--space-3), 3vw, var(--space-6));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.gift-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.gift-modal[hidden] {
  display: none !important;
}

.gift-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 18, 45, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.gift-modal-card {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 680px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 245, 248, 0.96) 50%, rgba(250, 246, 255, 0.98) 100%);
  border: 2px solid var(--border-gold-subtle);
  border-radius: var(--radius-2xl, 24px);
  box-shadow: 0 24px 60px rgba(30, 15, 50, 0.3), 0 0 40px rgba(232, 197, 71, 0.2);
  overflow: hidden;
  transform: scale(0.94) translateY(12px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.gift-modal.is-open .gift-modal-card {
  transform: none;
}

.gift-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid rgba(232, 197, 71, 0.25);
  background: rgba(255, 255, 255, 0.7);
}

.gift-modal-badge-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.gift-modal-icon {
  font-size: 1.4rem;
}

.gift-modal-badge {
  font-family: var(--font-royal);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--color-velvet-plum);
}

.gift-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(61, 44, 77, 0.15);
  background: rgba(255, 255, 255, 0.8);
  color: var(--color-velvet-plum);
  font-size: 1.4rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.gift-modal-close:hover {
  background: var(--color-fairy-rose-light);
  color: var(--color-velvet-plum);
  transform: rotate(90deg);
}

.gift-modal-close:focus-visible {
  outline: 2px solid var(--color-champagne-gold);
  outline-offset: 2px;
}

.gift-modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: clamp(var(--space-4), 3vw, var(--space-6));
  -webkit-overflow-scrolling: touch;
}

.gift-modal-footer {
  padding: var(--space-3) var(--space-6);
  border-top: 1px solid rgba(232, 197, 71, 0.2);
  background: rgba(255, 255, 255, 0.6);
  display: flex;
  justify-content: center;
}

.btn-modal-back {
  background: transparent;
  border: 1px solid var(--border-gold-subtle);
  color: var(--color-dusk-lavender);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-modal-back:hover {
  background: rgba(232, 197, 71, 0.15);
  color: var(--color-velvet-plum);
  border-color: var(--color-champagne-gold);
}

/* ==========================================================================
   STAGE 1: A SPECIAL COMPLIMENT (ROYAL PARCHMENT)
   ========================================================================== */
.gift-letter-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.royal-wax-seal {
  position: relative;
  z-index: 2;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle, #e83e8c 0%, #b0195a 70%, #7d0a3d 100%);
  color: var(--color-pure-white);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(125, 10, 61, 0.35), inset 0 2px 4px rgba(255, 255, 255, 0.4);
  margin-bottom: -24px;
}

.gift-parchment-sheet {
  width: 100%;
  background: linear-gradient(180deg, #fdfbf7 0%, #f7f1e5 100%);
  border: 1.5px solid #e2d3b8;
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-6) var(--space-6);
  box-shadow: inset 0 0 20px rgba(181, 150, 100, 0.1), 0 8px 24px rgba(61, 44, 77, 0.08);
  position: relative;
}

.gift-parchment-heading {
  font-family: var(--font-royal);
  font-size: clamp(1.15rem, 1.4vw, 1.35rem);
  color: #5c3c1e;
  text-align: center;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px dashed #d5c29e;
}

.gift-parchment-body {
  font-family: var(--font-body);
  font-size: clamp(0.95rem, 1.1vw, 1.05rem);
  line-height: 1.8;
  color: #3b2818;
  white-space: pre-line;
  margin-bottom: var(--space-6);
  text-align: justify;
}

.gift-parchment-signature {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: var(--font-royal);
  font-size: var(--text-sm);
  color: #7d5530;
  padding-top: var(--space-4);
  border-top: 1px dashed #d5c29e;
}

.gift-parchment-signature strong {
  font-size: var(--text-base);
  color: #4a2f15;
  margin-top: 2px;
}

/* ==========================================================================
   STAGE 2: A VIRTUAL HUG
   ========================================================================== */
.gift-hug-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.virtual-hug-avatar-container {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 230, 240, 0.9) 0%, rgba(240, 220, 255, 0.7) 100%);
  border: 2px solid var(--border-rose-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-6);
  box-shadow: 0 8px 24px rgba(255, 182, 193, 0.35);
  transition: transform 0.3s ease;
}

.virtual-hug-avatar-container.is-hugging {
  animation: hugPulse 0.6s ease infinite alternate;
}

@keyframes hugPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.12) rotate(2deg); }
}

.hug-emoji-characters {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.hug-emoji-char {
  font-size: 3.5rem;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.virtual-hug-avatar-container.is-hugging .hug-emoji--left {
  transform: translateX(12px) rotate(-10deg);
}

.virtual-hug-avatar-container.is-hugging .hug-emoji--right {
  transform: translateX(-12px) rotate(10deg);
}

.hug-particles-field {
  position: absolute;
  inset: -20px;
  pointer-events: none;
  overflow: visible;
}

.floating-hug-heart {
  position: absolute;
  font-size: 1.5rem;
  animation: floatHeartUp 1.8s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
  opacity: 1;
}

@keyframes floatHeartUp {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.5);
  }
  20% {
    opacity: 1;
    transform: translateY(-20px) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translateY(-100px) scale(0.8) rotate(20deg);
  }
}

.btn-send-hug {
  background: linear-gradient(135deg, #ff758c 0%, #ff7eb3 100%);
  color: #ffffff;
  border: none;
  padding: 12px 28px;
  font-family: var(--font-royal);
  font-size: var(--text-base);
  font-weight: 700;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255, 117, 140, 0.4);
  transition: all 0.3s ease;
  margin-bottom: var(--space-6);
}

.btn-send-hug:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 10px 28px rgba(255, 117, 140, 0.55);
}

.btn-send-hug:active {
  transform: scale(0.98);
}

.gift-hug-message-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.9);
  border: 1.5px solid var(--border-rose-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: 0 4px 16px rgba(61, 44, 77, 0.06);
}

.gift-hug-text {
  font-family: var(--font-body);
  font-size: clamp(0.95rem, 1.1vw, 1.05rem);
  line-height: 1.7;
  color: var(--color-velvet-plum);
  text-align: center;
}

/* ==========================================================================
   STAGE 3: CHOCOLATE TREAT (KITKAT UNWRAP)
   ========================================================================== */
.gift-chocolate-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.chocolate-pack-wrapper {
  position: relative;
  width: 220px;
  height: 140px;
  background: #2b1407;
  border-radius: 10px;
  margin-bottom: var(--space-6);
  box-shadow: 0 10px 30px rgba(43, 20, 7, 0.35);
  overflow: hidden;
  user-select: none;
}

.chocolate-bars-inner {
  position: absolute;
  inset: 10px;
  display: flex;
  gap: 8px;
  background: #3c1c0a;
  padding: 8px;
  border-radius: 6px;
}

.kitkat-finger {
  flex: 1;
  background: linear-gradient(180deg, #5c2f14 0%, #3e1e0a 100%);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 1px 1px 2px rgba(255, 255, 255, 0.2), inset -1px -1px 2px rgba(0, 0, 0, 0.5);
}

.kitkat-finger span {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  color: #8b5533;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.chocolate-foil-cover {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #d31826 0%, #a00e19 60%, #e63946 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  padding: var(--space-3);
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s ease;
  z-index: 2;
  cursor: pointer;
}

.chocolate-pack-wrapper.is-unwrapped .chocolate-foil-cover {
  transform: translateY(-110%) rotate(-6deg);
  opacity: 0;
  pointer-events: none;
}

.foil-brand {
  font-family: var(--font-royal);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.8);
  padding: 2px 10px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.foil-hint {
  font-size: 0.75rem;
  opacity: 0.9;
}

.btn-unwrap-choco {
  background: linear-gradient(135deg, #d31826 0%, #a00e19 100%);
  color: #ffffff;
  border: none;
  padding: 10px 24px;
  font-family: var(--font-royal);
  font-size: var(--text-sm);
  font-weight: 700;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(160, 14, 25, 0.35);
  transition: all 0.25s ease;
  margin-bottom: var(--space-6);
}

.btn-unwrap-choco:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(160, 14, 25, 0.5);
}

.gift-chocolate-message-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.92);
  border: 1.5px solid rgba(160, 14, 25, 0.2);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: 0 4px 16px rgba(61, 44, 77, 0.06);
}

.gift-chocolate-text {
  font-family: var(--font-body);
  font-size: clamp(0.95rem, 1.1vw, 1.05rem);
  line-height: 1.7;
  color: var(--color-velvet-plum);
}

/* ==========================================================================
   STAGE 4: FUNNY ROAST
   ========================================================================== */
.gift-roast-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.roast-warning-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-royal);
  font-size: var(--text-sm);
  font-weight: 800;
  letter-spacing: 1px;
  color: #d9381e;
  background: rgba(255, 87, 34, 0.12);
  border: 1.5px solid rgba(255, 87, 34, 0.35);
  border-radius: var(--radius-full);
  padding: 6px 16px;
  margin-bottom: var(--space-6);
  animation: pulseBadge 1.5s ease-in-out infinite alternate;
}

@keyframes pulseBadge {
  0% { transform: scale(1); }
  100% { transform: scale(1.04); }
}

.roast-box {
  width: 100%;
}

.roast-card-front {
  background: linear-gradient(135deg, rgba(255, 240, 235, 0.95) 0%, rgba(255, 230, 225, 0.9) 100%);
  border: 2px dashed rgba(217, 56, 30, 0.4);
  border-radius: var(--radius-xl);
  padding: var(--space-8) var(--space-6);
  box-shadow: 0 8px 24px rgba(217, 56, 30, 0.1);
}

.roast-preamble {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 600;
  color: #7a2012;
  margin-bottom: var(--space-6);
  line-height: var(--leading-snug);
}

.btn-reveal-roast {
  background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
  color: #ffffff;
  border: none;
  padding: 12px 28px;
  font-family: var(--font-royal);
  font-size: var(--text-base);
  font-weight: 700;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255, 65, 108, 0.35);
  transition: all 0.3s ease;
}

.btn-reveal-roast:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 10px 28px rgba(255, 65, 108, 0.5);
}

.roast-card-revealed {
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid var(--border-gold-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: 0 10px 30px rgba(61, 44, 77, 0.08);
  animation: fadeIn 0.4s ease;
}

.roast-sike-banner {
  font-family: var(--font-royal);
  font-size: clamp(1.15rem, 1.4vw, 1.35rem);
  font-weight: 800;
  color: #27ae60;
  background: rgba(46, 204, 113, 0.12);
  border: 1px solid rgba(46, 204, 113, 0.3);
  border-radius: var(--radius-full);
  padding: 8px 20px;
  display: inline-block;
  margin-bottom: var(--space-6);
}

.roast-quote {
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.15vw, 1.1rem);
  line-height: 1.8;
  color: var(--color-velvet-plum);
  font-style: italic;
  margin: 0;
}

/* ==========================================================================
   STAGE 5: FAVOURITE MEMORY (ROYAL SCROLL)
   ========================================================================== */
.gift-memory-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.memory-scroll-container {
  width: 100%;
  background: linear-gradient(180deg, #fefbf3 0%, #f9f2e3 100%);
  border: 2px solid #dfc79b;
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: inset 0 0 30px rgba(181, 150, 100, 0.15), 0 8px 24px rgba(61, 44, 77, 0.08);
  position: relative;
}

.scroll-ribbon-header,
.scroll-ribbon-footer {
  text-align: center;
  font-family: var(--font-royal);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 1px;
  color: #6d4c2b;
  padding: 6px 16px;
  background: rgba(223, 199, 155, 0.25);
  border-radius: var(--radius-full);
}

.scroll-ribbon-header {
  margin-bottom: var(--space-5);
  border-bottom: 1.5px solid #dfc79b;
}

.scroll-ribbon-footer {
  margin-top: var(--space-5);
  border-top: 1.5px solid #dfc79b;
}

.memory-scroll-body {
  max-height: 55vh;
  overflow-y: auto;
  padding-right: var(--space-3);
}

.gift-memory-text,
.memory-para {
  font-family: var(--font-body);
  font-size: clamp(0.95rem, 1.1vw, 1.05rem);
  line-height: 1.8;
  color: #3b2818;
  white-space: pre-line;
  text-align: justify;
}

.memory-para:last-child {
  margin-bottom: 0;
  font-weight: 700;
  text-align: center;
  color: #7a3e14;
}

/* ==========================================================================
   STAGE 6: PRINCESS MOUKI'S MAGICAL CLAW MACHINE
   ========================================================================== */
.gift-claw-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.claw-machine-cabinet {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(180deg, #442255 0%, #2b1238 100%);
  border: 3px solid var(--color-champagne-gold);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(35, 15, 50, 0.4), inset 0 0 16px rgba(232, 197, 71, 0.2);
}

.claw-marquee {
  background: linear-gradient(90deg, #ff6b81, #ffa502, #70a1ff, #ff6b81);
  background-size: 300% 100%;
  animation: marqueeShift 6s linear infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: 8px var(--space-3);
}

@keyframes marqueeShift {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

.marquee-title {
  font-family: var(--font-royal);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.marquee-bulb {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 8px #ffffff;
}

/* Glass Chamber */
.claw-glass-chamber {
  position: relative;
  height: 240px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(200, 220, 255, 0.15) 100%);
  border-bottom: 2px solid rgba(232, 197, 71, 0.4);
  overflow: hidden;
}

.claw-track {
  position: absolute;
  top: 8px;
  left: 20px;
  right: 20px;
  height: 8px;
  background: #1a0a24;
  border-radius: 4px;
  border: 1px solid rgba(232, 197, 71, 0.3);
}

.claw-trolley {
  position: absolute;
  top: -4px;
  width: 24px;
  height: 16px;
  background: var(--color-champagne-gold);
  border-radius: 3px;
  transform: translateX(-50%);
  transition: left 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 5;
}

.claw-wire {
  position: absolute;
  top: 14px;
  left: 50%;
  width: 2px;
  height: 20px;
  background: #cccccc;
  transform: translateX(-50%);
  transition: height 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.claw-head {
  position: absolute;
  top: 14px;
  left: 50%;
  width: 28px;
  height: 20px;
  transform: translateX(-50%) translateY(20px);
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.claw-finger {
  position: absolute;
  bottom: 0;
  width: 4px;
  height: 14px;
  background: var(--color-champagne-gold);
  border-radius: 2px;
  transition: transform 0.3s ease;
}

.claw-finger-left {
  left: 4px;
  transform-origin: top left;
  transform: rotate(-10deg);
}

.claw-finger-right {
  right: 4px;
  transform-origin: top right;
  transform: rotate(10deg);
}

.claw-head.is-gripping .claw-finger-left {
  transform: rotate(20deg);
}

.claw-head.is-gripping .claw-finger-right {
  transform: rotate(-20deg);
}

/* Prize Chute */
.claw-chute {
  position: absolute;
  bottom: 0;
  left: 10px;
  width: 48px;
  height: 52px;
  background: #110519;
  border: 2px solid var(--color-champagne-gold);
  border-radius: 6px 6px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.chute-label {
  font-family: var(--font-royal);
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--color-champagne-gold);
  letter-spacing: 1px;
}

/* Prize Pit */
.claw-prize-pit {
  position: absolute;
  bottom: 8px;
  left: 65px;
  right: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  z-index: 1;
}

.prize-capsule {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(255, 200, 220, 0.8) 100%);
  border: 1.5px solid rgba(232, 197, 71, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.prize-icon {
  font-size: 1.15rem;
}

/* Controls Panel */
.claw-controls-panel {
  background: #1f0b2a;
  padding: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.claw-direction-buttons {
  display: flex;
  gap: var(--space-2);
}

.claw-btn {
  background: #3c1950;
  color: #ffffff;
  border: 1.5px solid var(--border-gold-subtle);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  font-size: var(--text-xs);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.claw-btn:hover {
  background: var(--color-champagne-gold);
  color: var(--color-velvet-plum);
}

.claw-btn-grab {
  background: linear-gradient(135deg, #ff4757 0%, #ff6b81 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-full);
  padding: 10px 20px;
  font-family: var(--font-royal);
  font-size: var(--text-sm);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255, 71, 87, 0.4);
  transition: all 0.25s ease;
}

.claw-btn-grab:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(255, 71, 87, 0.6);
}

.claw-btn-grab:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Claw Won Modal Overlay */
.claw-won-overlay {
  position: absolute;
  inset: 0;
  background: rgba(20, 8, 30, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  padding: var(--space-4);
  animation: fadeIn 0.3s ease;
}

.claw-won-overlay[hidden] {
  display: none !important;
}

.claw-won-card {
  background: linear-gradient(150deg, #ffffff 0%, #fff2f6 100%);
  border: 2px solid var(--color-champagne-gold);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  text-align: center;
  max-width: 320px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.won-icon {
  font-size: 3rem;
  margin-bottom: var(--space-2);
}

.won-title {
  font-family: var(--font-royal);
  font-size: 1.25rem;
  color: var(--color-velvet-plum);
  margin-bottom: var(--space-2);
}

.won-desc {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-dusk-lavender);
  line-height: var(--leading-snug);
  margin-bottom: var(--space-4);
}

/* Special Grand Prize Reveal Styling */
.capsule--grand {
  background: radial-gradient(circle, #FFF5CC 0%, #F5D061 60%, #C99700 100%) !important;
  border-color: #E8C547 !important;
  box-shadow: 0 0 10px rgba(232, 197, 71, 0.7), 0 2px 6px rgba(0, 0, 0, 0.2) !important;
  animation: grandCapsuleGlow 1.8s ease-in-out infinite alternate;
}

@keyframes grandCapsuleGlow {
  from { transform: scale(1); filter: drop-shadow(0 0 2px #E8C547); }
  to { transform: scale(1.08); filter: drop-shadow(0 0 6px #E8C547); }
}

.won-card--grand {
  border: 2.5px solid var(--color-champagne-gold, #E8C547);
  background: linear-gradient(155deg, #FFFFFF 0%, #FFF5F8 50%, #FFF9E6 100%);
  box-shadow: 0 16px 44px rgba(45, 18, 55, 0.45), 0 0 32px rgba(232, 197, 71, 0.4);
  max-width: 340px;
}

.grand-prize-visual-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-2);
}

.grand-prize-sparkles {
  font-size: 1.15rem;
  line-height: 1;
  margin-bottom: 6px;
  letter-spacing: 4px;
  animation: grandSparkleFloat 1.2s ease-in-out infinite alternate;
}

@keyframes grandSparkleFloat {
  from { transform: translateY(0); opacity: 0.8; }
  to { transform: translateY(-4px); opacity: 1; }
}

.grand-prize-gif {
  width: 140px;
  height: 140px;
  max-width: 100%;
  object-fit: contain;
  border-radius: var(--radius-lg, 16px);
  border: 2.5px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 24px rgba(244, 63, 94, 0.25), 0 0 20px rgba(232, 197, 71, 0.4);
  animation: grandPrizePop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes grandPrizePop {
  0% {
    transform: scale(0.65) rotate(-3deg);
    opacity: 0;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

.grand-prize-badge {
  margin-top: 8px;
  display: inline-block;
  font-family: var(--font-royal);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #8C650A;
  background: linear-gradient(135deg, #FFF5CC, #FFE4A0);
  border: 1px solid rgba(232, 197, 71, 0.6);
  border-radius: var(--radius-pill);
  padding: 2px 10px;
}

.grand-won-badge {
  font-family: var(--font-royal);
  font-size: 1.05rem;
  font-weight: 700;
  color: #8C1D40;
  letter-spacing: 0.5px;
  display: inline-block;
}

.grand-won-cute {
  font-family: var(--font-accent, 'Dancing Script', cursive);
  font-size: 1.55rem;
  font-weight: 700;
  color: #E11D48;
  display: inline-block;
  margin-top: 2px;
}

.grand-confetti-particle {
  position: absolute;
  top: -10px;
  font-size: 1.25rem;
  line-height: 1;
  pointer-events: none;
  user-select: none;
  z-index: 25;
  animation: grandConfettiFall 2s ease-in forwards;
}

@keyframes grandConfettiFall {
  0% {
    transform: translateY(0) rotate(0deg) scale(0.8);
    opacity: 1;
  }
  100% {
    transform: translateY(320px) rotate(360deg) scale(1.1);
    opacity: 0;
  }
}

.claw-collection-tracker {
  margin-top: var(--space-4);
  font-family: var(--font-royal);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--color-velvet-plum);
  background: rgba(232, 197, 71, 0.15);
  border: 1px solid var(--border-gold-subtle);
  border-radius: var(--radius-full);
  padding: 4px 14px;
}

/* ==========================================================================
   STAGE 7: THE ROYAL AWARD & PRINTABLE CERTIFICATE
   ========================================================================== */
.gift-award-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.award-tab-buttons {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  background: rgba(61, 44, 77, 0.06);
  padding: 4px;
  border-radius: var(--radius-full);
}

.award-tab {
  background: transparent;
  border: none;
  padding: 8px 18px;
  font-family: var(--font-royal);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-dusk-lavender);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.25s ease;
}

.award-tab.active {
  background: var(--color-pure-white);
  color: var(--color-velvet-plum);
  box-shadow: 0 2px 8px rgba(61, 44, 77, 0.1);
}

.award-view-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.award-view-panel[hidden] {
  display: none !important;
}

/* 1. Royal Trophy Card */
.royal-trophy-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: 480px;
  background: linear-gradient(150deg, #ffffff 0%, #fffaf0 100%);
  border: 2px solid var(--color-champagne-gold);
  border-radius: var(--radius-xl);
  padding: var(--space-8) var(--space-6);
  box-shadow: 0 16px 40px rgba(61, 44, 77, 0.12), 0 0 30px rgba(232, 197, 71, 0.25);
}

.trophy-sparkle-halo {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 197, 71, 0.3) 0%, transparent 70%);
  top: 30px;
  pointer-events: none;
}

.trophy-giant-emoji {
  font-size: 5rem;
  line-height: 1;
  display: inline-block;
  filter: drop-shadow(0 8px 16px rgba(232, 197, 71, 0.4));
  margin-bottom: var(--space-4);
  animation: floatTrophy 3s ease-in-out infinite alternate;
}

@keyframes floatTrophy {
  0% { transform: translateY(0); }
  100% { transform: translateY(-8px); }
}

.trophy-plaque {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.trophy-title {
  font-family: var(--font-royal);
  font-size: clamp(1.2rem, 1.4vw, 1.4rem);
  color: var(--color-champagne-gold-dark);
  font-weight: 800;
  margin-bottom: 2px;
}

.trophy-subtitle {
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  font-weight: 700;
  color: var(--color-dusk-lavender);
  margin-bottom: var(--space-3);
}

.trophy-divider {
  width: 60px;
  height: 2px;
  background: var(--color-champagne-gold);
  margin-bottom: var(--space-4);
}

.trophy-recipient {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-velvet-plum);
  margin-bottom: var(--space-3);
}

.trophy-citation {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-style: italic;
  line-height: var(--leading-normal);
  color: #554466;
  margin-bottom: var(--space-4);
}

.trophy-date {
  font-size: var(--text-xs);
  color: var(--color-dusk-lavender);
  font-weight: 600;
}

/* 2. Personalised Royal Certificate */
.printable-certificate-container {
  width: 100%;
  max-width: 580px;
  background: #ffffff;
  padding: var(--space-3);
  box-shadow: 0 10px 30px rgba(61, 44, 77, 0.1);
  margin-bottom: var(--space-4);
}

.cert-gold-border {
  border: 4px double #c59b27;
  padding: var(--space-4);
}

.cert-inner-frame {
  border: 1px solid rgba(197, 155, 39, 0.5);
  padding: var(--space-6) var(--space-4);
  text-align: center;
  background: linear-gradient(180deg, #fffdf8 0%, #fefcf3 100%);
}

.cert-royal-crown {
  font-size: 2.2rem;
  margin-bottom: var(--space-2);
}

.cert-order-name {
  font-family: var(--font-royal);
  font-size: 0.75rem;
  letter-spacing: 2px;
  color: #a57c1b;
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.cert-title {
  font-family: var(--font-royal);
  font-size: clamp(1.05rem, 1.25vw, 1.25rem);
  color: #3b2818;
  font-weight: 800;
  margin-bottom: var(--space-4);
  line-height: var(--leading-tight);
}

.cert-proclamation {
  font-size: 0.8rem;
  font-style: italic;
  color: #6d5540;
  margin-bottom: var(--space-2);
}

.cert-recipient-name {
  font-family: var(--font-royal);
  font-size: clamp(1.4rem, 1.8vw, 1.8rem);
  color: #a57c1b;
  margin-bottom: var(--space-3);
  text-shadow: 0 1px 2px rgba(165, 124, 27, 0.2);
}

.cert-declaration {
  font-family: var(--font-body);
  font-size: 0.85rem;
  line-height: 1.6;
  color: #4a3828;
  margin-bottom: var(--space-6);
}

.cert-seal-row {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-top: var(--space-4);
  border-top: 1px dashed rgba(197, 155, 39, 0.4);
}

.cert-seal-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-royal);
  font-size: 0.65rem;
  font-weight: 800;
  color: #a57c1b;
  letter-spacing: 1px;
}

.seal-icon {
  font-size: 1.4rem;
  margin-bottom: 2px;
}

.cert-signatures {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sig-line {
  border-top: 1px solid #6d5540;
  padding-top: 4px;
  width: 140px;
}

.sig-title {
  font-size: 0.7rem;
  color: #6d5540;
  font-weight: 600;
}

.cert-actions {
  display: flex;
  justify-content: center;
}

.btn-print-cert {
  background: linear-gradient(135deg, #a57c1b 0%, #c59b27 100%);
  color: #ffffff;
  border: none;
  padding: 10px 24px;
  font-family: var(--font-royal);
  font-size: var(--text-sm);
  font-weight: 700;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(165, 124, 27, 0.35);
  transition: all 0.25s ease;
}

.btn-print-cert:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(165, 124, 27, 0.5);
}

/* ==========================================================================
   STAGE 8: BIRTHDAY MEMORY BOX (VIDEO PLAYER)
   ========================================================================== */
.gift-memory-box-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.memory-box-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  text-align: center;
}

.memory-box-icon {
  font-size: 1.5rem;
}

.memory-box-header h3 {
  font-family: var(--font-royal);
  font-size: clamp(1.05rem, 1.2vw, 1.25rem);
  color: var(--color-velvet-plum);
  margin: 0;
}

.memory-box-temporary-banner {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  background: rgba(232, 197, 71, 0.15);
  border: 1.5px solid var(--border-gold-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
}

.notice-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.notice-text {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
  color: var(--color-velvet-plum);
}

.notice-text strong {
  display: block;
  font-weight: 700;
  color: var(--color-champagne-gold-dark);
  margin-bottom: 2px;
}

.memory-box-player-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 340px;
  background: #000000;
  border: 2px solid var(--border-gold-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-video-fs-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md, 8px);
  background: rgba(30, 18, 45, 0.72);
  border: 1px solid rgba(232, 197, 71, 0.6);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.btn-video-fs-toggle:hover {
  background: rgba(232, 197, 71, 0.35);
  border-color: var(--color-champagne-gold, #e8c547);
  transform: scale(1.08);
}

.btn-video-fs-toggle:focus-visible {
  outline: 2px solid var(--color-champagne-gold, #e8c547);
  outline-offset: 2px;
}

.birthday-video-player {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Fullscreen Display Rules (Native & Vendor-Prefixed) */
.birthday-video-player:fullscreen,
.birthday-video-player:-webkit-full-screen,
.birthday-video-player:-moz-full-screen,
.birthday-video-player:-ms-fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  object-fit: contain !important;
  background: #000000 !important;
}

.memory-box-player-wrapper:fullscreen,
.memory-box-player-wrapper:-webkit-full-screen,
.memory-box-player-wrapper:-moz-full-screen,
.memory-box-player-wrapper:-ms-fullscreen,
.memory-box-player-wrapper.is-fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  border: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
  background: #000000 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 10000 !important;
}

.memory-box-player-wrapper:fullscreen .birthday-video-player,
.memory-box-player-wrapper:-webkit-full-screen .birthday-video-player,
.memory-box-player-wrapper.is-fullscreen .birthday-video-player {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
}

.gift-modal.is-video-fullscreen .gift-modal-card {
  overflow: visible !important;
}

.memory-box-subtitle {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-dusk-lavender);
  text-align: center;
  margin-top: -8px;
  margin-bottom: var(--space-4);
  max-width: 480px;
}

.video-playback-error {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: rgba(225, 29, 72, 0.1);
  border: 1px solid rgba(225, 29, 72, 0.3);
  border-radius: var(--radius-md);
  color: #8C1D40;
  font-size: var(--text-xs);
  text-align: center;
  margin-top: var(--space-2);
}

.memory-box-doc-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.7);
  border: 1px dashed rgba(61, 44, 77, 0.2);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  text-align: center;
}

.doc-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-dusk-lavender);
  margin-right: var(--space-2);
}

.memory-box-doc-card code {
  font-family: monospace;
  font-size: var(--text-xs);
  background: rgba(61, 44, 77, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--color-velvet-plum);
}

.doc-hint {
  font-size: var(--text-xs);
  color: var(--color-dusk-lavender);
  margin: var(--space-1) 0 0;
}

/* ==========================================================================
   PRINT STYLES FOR ROYAL CERTIFICATE
   ========================================================================== */
@media print {
  body * {
    visibility: hidden;
  }
  
  #printable-cert,
  #printable-cert * {
    visibility: visible;
  }

  #birthday-gift-dialog,
  #birthday-gift-dialog .gift-modal-card,
  #birthday-gift-dialog .gift-modal-body,
  #birthday-gift-dialog .gift-stage-view,
  #birthday-gift-dialog .gift-award-stage,
  #award-cert-view {
    position: static !important;
    display: block !important;
    visibility: visible !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
  }

  #printable-cert {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    box-shadow: none !important;
    border: none !important;
    padding: 20mm !important;
    box-sizing: border-box !important;
  }

  .cert-gold-border {
    height: 100% !important;
    box-sizing: border-box !important;
  }

  .cert-inner-frame {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-around !important;
    box-sizing: border-box !important;
  }

  .gift-modal-header,
  .gift-modal-footer,
  .gift-modal-backdrop,
  .award-tab-buttons,
  .cert-actions {
    display: none !important;
  }
}

/* ==========================================================================
   REDUCED MOTION SUPPORT
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .royal-gift-card,
  .gift-card-visual,
  .virtual-hug-avatar-container,
  .chocolate-foil-cover,
  .roast-warning-badge,
  .trophy-giant-emoji,
  .claw-marquee,
  .claw-trolley,
  .claw-wire,
  .claw-head,
  .capsule--grand,
  .grand-prize-sparkles,
  .grand-prize-gif,
  .grand-confetti-particle {
    animation: none !important;
    transition: none !important;
  }
}

/* ==========================================================================
   7. SECTION 6: LITTLE HUG JAR (365-DAY MESSAGE EXPERIENCE)
   ========================================================================== */
.jar-section {
  position: relative;
  overflow: visible;
}

.jar-stage-container {
  max-width: 720px;
  margin-inline: auto;
  position: relative;
}

/* Glassmorphism Main Stage Card */
.jar-hero-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(var(--space-6), 4vw, var(--space-10));
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 240, 245, 0.88) 50%, rgba(250, 246, 255, 0.94) 100%);
  border: 1.5px solid var(--border-gold-subtle);
  border-radius: var(--radius-xl);
  box-shadow: 0 16px 45px rgba(61, 44, 77, 0.08), 0 4px 16px rgba(232, 197, 71, 0.15);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.jar-hero-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 55px rgba(61, 44, 77, 0.12), 0 6px 20px rgba(232, 197, 71, 0.22);
}

/* Ambient Floating Sparkles */
.jar-ambient-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.jar-sparkle-dot {
  position: absolute;
  user-select: none;
  font-size: 18px;
  animation: sparkleFloat 4s ease-in-out infinite alternate;
}

.jar-sparkle--1 { top: 12%; left: 15%; animation-delay: 0s; font-size: 22px; }
.jar-sparkle--2 { top: 22%; right: 18%; animation-delay: 1.2s; font-size: 20px; }
.jar-sparkle--3 { bottom: 35%; left: 12%; animation-delay: 2.1s; font-size: 18px; }
.jar-sparkle--4 { bottom: 25%; right: 14%; animation-delay: 0.7s; font-size: 20px; }

@keyframes sparkleFloat {
  0% { transform: translateY(0) scale(0.9) rotate(-6deg); opacity: 0.6; }
  50% { transform: translateY(-8px) scale(1.1) rotate(6deg); opacity: 1; }
  100% { transform: translateY(-16px) scale(0.95) rotate(-3deg); opacity: 0.7; }
}

/* SVG Jar Illustration */
.jar-visual-stage {
  position: relative;
  z-index: 2;
  margin-bottom: var(--space-6);
}

.jar-svg-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hug-jar-svg {
  width: 180px;
  height: 235px;
  filter: drop-shadow(0 12px 24px rgba(61, 44, 77, 0.15));
  animation: jarFloat 6s ease-in-out infinite;
  transform-origin: center center;
}

@keyframes jarFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.jar-floating-notes rect {
  animation: noteSway 5s ease-in-out infinite alternate;
  transform-origin: center center;
}

@keyframes noteSway {
  0% { transform: translateY(0) rotate(-2deg); }
  100% { transform: translateY(-4px) rotate(3deg); }
}

/* Status Section & Progress */
.jar-status-section {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.jar-status-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid var(--border-gold-subtle);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-velvet-plum);
  box-shadow: 0 4px 14px rgba(61, 44, 77, 0.05);
}

.jar-status-icon {
  font-size: 16px;
}

.jar-progress-bar-wrap {
  width: 100%;
  height: 10px;
  background: rgba(216, 180, 248, 0.25);
  border: 1px solid rgba(232, 197, 71, 0.35);
  border-radius: var(--radius-pill);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(61, 44, 77, 0.08);
}

.jar-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-fairy-rose) 0%, var(--color-enchanted-lilac) 50%, var(--color-champagne-gold) 100%);
  border-radius: var(--radius-pill);
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 10px rgba(232, 197, 71, 0.5);
}

.jar-progress-meta {
  margin: 0;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-dusk-lavender);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Action Buttons */
.jar-action-row {
  position: relative;
  z-index: 2;
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
}

.jar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-width: 190px;
  height: 50px;
  padding: 0 var(--space-6);
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-spring);
  box-sizing: border-box;
  text-decoration: none;
}

.jar-btn--primary {
  background: linear-gradient(135deg, var(--color-fairy-rose) 0%, #FF9EAA 50%, var(--color-enchanted-lilac) 100%);
  color: #FFFFFF;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 6px 20px rgba(255, 182, 193, 0.45), 0 2px 8px rgba(61, 44, 77, 0.1);
}

.jar-btn--primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 28px rgba(255, 182, 193, 0.6), 0 4px 12px rgba(232, 197, 71, 0.3);
}

.jar-btn--primary:active {
  transform: translateY(0) scale(0.98);
}

.jar-btn--secondary {
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-velvet-plum);
  border: 1.5px solid var(--border-gold-subtle);
  box-shadow: 0 4px 14px rgba(61, 44, 77, 0.06);
}

.jar-btn--secondary:hover {
  background: #FFFFFF;
  border-color: var(--color-champagne-gold);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(232, 197, 71, 0.25);
  color: var(--color-champagne-gold-dark);
}

.jar-btn-icon {
  font-size: 16px;
}

/* Sealed / Pre-launch State Modifiers */
.jar-hero--sealed .hug-jar-svg {
  filter: drop-shadow(0 8px 20px rgba(61, 44, 77, 0.12)) saturate(0.9);
}

/* Completed Archive State Modifiers */
.jar-hero--complete .jar-hero-card {
  border-color: var(--color-champagne-gold);
  box-shadow: 0 20px 60px rgba(232, 197, 71, 0.2), 0 0 35px rgba(255, 182, 193, 0.25);
}

/* ==========================================================================
   HUG JAR MODALS & DIALOGS (SHARED FOUNDATION)
   ========================================================================== */
.hug-modal {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
}

.hug-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.hug-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(45, 25, 60, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
}

.hug-modal-card {
  position: relative;
  z-index: 2205;
  width: 100%;
  max-width: 580px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, rgba(250, 246, 255, 0.98) 0%, rgba(255, 240, 245, 0.98) 100%);
  border: 1.5px solid var(--border-gold-subtle);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 60px rgba(61, 44, 77, 0.35), 0 0 35px rgba(232, 197, 71, 0.25);
  box-sizing: border-box;
  overflow: hidden;
  transform: scale(0.94) translateY(12px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.hug-modal.is-open .hug-modal-card {
  transform: scale(1) translateY(0);
}

/* Modal Header */
.hug-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid rgba(232, 197, 71, 0.25);
  background: rgba(255, 255, 255, 0.6);
}

.hug-modal-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-royal);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-velvet-plum);
  letter-spacing: 0.05em;
}

.hug-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border-gold-subtle);
  color: var(--color-velvet-plum);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.hug-modal-close:hover {
  background: var(--color-fairy-rose);
  color: #FFFFFF;
  border-color: var(--color-fairy-rose);
  transform: rotate(90deg);
}

/* Overlays: Loading & Error States */
.hug-state-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-8);
  text-align: center;
  min-height: 220px;
}

.hug-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(216, 180, 248, 0.3);
  border-top-color: var(--color-champagne-gold);
  border-right-color: var(--color-fairy-rose);
  border-radius: 50%;
  animation: hugSpin 0.9s linear infinite;
}

@keyframes hugSpin {
  to { transform: rotate(360deg); }
}

.hug-state-text {
  margin: 0;
  font-size: var(--text-base);
  color: var(--color-velvet-plum);
  font-weight: 600;
}

.hug-error-icon {
  font-size: 36px;
}

.hug-retry-btn {
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-pill);
  background: var(--color-fairy-rose);
  color: #FFFFFF;
  border: none;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 182, 193, 0.4);
}

/* ==========================================================================
   TODAY'S NOTE MODAL (PARCHMENT CARD EXPERIENCE)
   ========================================================================== */
.hug-note-body {
  padding: var(--space-6);
  overflow-y: auto;
}

.hug-parchment-stage {
  background: linear-gradient(135deg, #FFFDF8 0%, #FFF8FA 100%);
  border: 1.5px solid rgba(232, 197, 71, 0.4);
  border-radius: var(--radius-lg);
  padding: clamp(var(--space-5), 3.5vw, var(--space-8));
  box-shadow: inset 0 0 25px rgba(232, 197, 71, 0.08), 0 6px 18px rgba(61, 44, 77, 0.06);
  position: relative;
}

.hug-note-day-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: 1px dashed rgba(232, 197, 71, 0.35);
}

.hug-day-pill {
  font-family: var(--font-royal);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-champagne-gold-dark);
  background: rgba(232, 197, 71, 0.15);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
}

.hug-date-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-dusk-lavender);
}

.hug-note-quote-wrap {
  position: relative;
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-4);
}

.hug-quote-mark {
  font-family: var(--font-royal);
  font-size: 36px;
  line-height: 1;
  color: var(--color-fairy-rose);
  opacity: 0.6;
  user-select: none;
}

.hug-quote-mark--end {
  display: block;
  text-align: right;
  margin-top: -12px;
}

.hug-note-message {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(var(--text-base), 2.2vw, var(--text-lg));
  line-height: 1.65;
  color: var(--color-velvet-plum);
  font-weight: 500;
  text-align: center;
  word-break: break-word;
}

.hug-note-footer-seal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  font-size: var(--text-xs);
  color: var(--color-dusk-lavender);
  font-weight: 600;
}

.hug-seal-icon {
  font-size: 14px;
}

.hug-modal-footer {
  display: flex;
  justify-content: center;
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid rgba(232, 197, 71, 0.25);
  background: rgba(255, 255, 255, 0.6);
}

.hug-btn-done {
  padding: var(--space-2) var(--space-6);
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--color-fairy-rose) 0%, var(--color-enchanted-lilac) 100%);
  color: #FFFFFF;
  border: none;
  font-weight: 700;
  font-size: var(--text-sm);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255, 182, 193, 0.4);
  transition: transform var(--transition-fast);
}

.hug-btn-done:hover {
  transform: translateY(-1px);
}

/* ==========================================================================
   ARCHIVE DRAWER / MODAL
   ========================================================================== */
.hug-archive-card {
  max-width: 680px;
}

.hug-archive-body {
  padding: var(--space-5);
  overflow-y: auto;
  max-height: 60vh;
}

.hug-archive-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.hug-archive-card-item {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(216, 180, 248, 0.4);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  box-shadow: 0 4px 12px rgba(61, 44, 77, 0.04);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
  cursor: pointer;
}

.hug-archive-card-item:focus-visible {
  outline: 2px solid var(--color-champagne-gold);
  outline-offset: 2px;
}

.hug-archive-card-item:hover {
  transform: translateY(-2px);
  border-color: var(--color-champagne-gold);
  box-shadow: 0 6px 16px rgba(232, 197, 71, 0.15);
}

.hug-archive-card-item--today {
  border: 1.5px solid var(--color-champagne-gold);
  background: linear-gradient(135deg, #FFFDF8 0%, #FFF5F7 100%);
  box-shadow: 0 6px 18px rgba(232, 197, 71, 0.22);
}

.hug-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.hug-card-day-badge {
  font-family: var(--font-royal);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-champagne-gold-dark);
  background: rgba(232, 197, 71, 0.15);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.hug-card-today-badge {
  font-size: 11px;
  font-weight: 700;
  color: #FFFFFF;
  background: var(--color-fairy-rose);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.hug-card-date {
  font-size: var(--text-xs);
  color: var(--color-dusk-lavender);
  margin-left: auto;
}

.hug-card-text {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--color-velvet-plum);
}

/* Empty Archive State */
.hug-archive-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-4);
  text-align: center;
  gap: var(--space-3);
}

.hug-empty-icon {
  font-size: 40px;
}

.hug-empty-heading {
  margin: 0;
  font-family: var(--font-royal);
  font-size: var(--text-lg);
  color: var(--color-velvet-plum);
}

.hug-empty-text {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-dusk-lavender);
  max-width: 380px;
  line-height: 1.6;
}

/* Archive Pagination Footer */
.hug-archive-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid rgba(232, 197, 71, 0.25);
  background: rgba(255, 255, 255, 0.7);
}

.hug-pagination-controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.hug-page-btn {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-gold-subtle);
  color: var(--color-velvet-plum);
  font-size: var(--text-xs);
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.hug-page-btn:hover:not(:disabled) {
  background: var(--color-fairy-rose);
  color: #FFFFFF;
  border-color: var(--color-fairy-rose);
}

.hug-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.hug-page-indicator {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-velvet-plum);
}

/* ==========================================================================
   RESPONSIVE DESIGN OVERRIDES
   ========================================================================== */
@media (max-width: 600px) {
  .hug-modal-card {
    max-height: 96vh;
    border-radius: var(--radius-lg);
  }

  .jar-btn {
    width: 100%;
    min-width: unset;
  }

  .hug-note-body,
  .hug-archive-body {
    padding: var(--space-4);
  }

  .hug-modal-header {
    padding: var(--space-3) var(--space-4);
  }
}

/* Accessibility Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .hug-jar-svg,
  .jar-sparkle-dot,
  .jar-floating-notes rect,
  .jar-hero-card,
  .jar-btn {
    animation: none !important;
    transition: none !important;
  }

  .hug-modal,
  .hug-modal-card {
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   8. SECTION 7: LETTERS FOR MOUKI (3 ENVELOPES & ROYAL SCRIPTORIUM)
   ========================================================================== */

/* Section Container */
.letters-section {
  position: relative;
  background: radial-gradient(circle at 50% 20%, rgba(255, 245, 220, 0.35) 0%, rgba(250, 246, 255, 0.6) 50%, rgba(255, 240, 245, 0.4) 100%);
  overflow: hidden;
}

/* 3-Column Envelope Grid */
.letters-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(var(--space-4), 3vw, var(--space-8));
  max-width: 1120px;
  margin-inline: auto;
  align-items: stretch;
}

@media (max-width: 960px) {
  .letters-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-6);
  }
}

@media (max-width: 680px) {
  .letters-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
    margin-inline: auto;
  }
}

/* --------------------------------------------------------------------------
   Envelope Cards (.royal-envelope-card)
   -------------------------------------------------------------------------- */
.royal-envelope-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-xl, 24px);
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid var(--border-gold-subtle);
  box-shadow: 0 8px 24px rgba(61, 44, 77, 0.08), 0 2px 6px rgba(232, 197, 71, 0.1);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease, border-color 0.35s ease;
  user-select: none;
  -webkit-user-select: none;
}

.royal-envelope-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 18px 40px rgba(61, 44, 77, 0.14), 0 6px 18px rgba(232, 197, 71, 0.22);
}

.royal-envelope-card:focus-visible {
  outline: 3px solid var(--color-champagne-gold, #E8C547);
  outline-offset: 3px;
  transform: translateY(-4px);
}

.royal-envelope-card:active {
  transform: translateY(-2px);
}

/* Card Glow Effect */
.envelope-card-glow {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 140px;
  border-radius: 50%;
  filter: blur(36px);
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.royal-envelope-card:hover .envelope-card-glow {
  opacity: 0.85;
}

/* Envelope Visual Stage */
.envelope-card-visual {
  position: relative;
  width: 100%;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(245, 240, 250, 0.3) 100%);
  border-bottom: 1px solid rgba(232, 197, 71, 0.15);
  overflow: hidden;
}

/* Layered Paper Envelope Silhouette */
.envelope-card-pocket {
  position: absolute;
  bottom: 24px;
  width: 190px;
  height: 110px;
  border-radius: 4px;
  box-shadow: 0 6px 18px rgba(61, 44, 77, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.08);
  z-index: 1;
}

.envelope-card-flap {
  position: absolute;
  top: 46px;
  width: 190px;
  height: 70px;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  z-index: 2;
  filter: drop-shadow(0 3px 5px rgba(61, 44, 77, 0.12));
  transition: transform 0.3s ease;
}

.royal-envelope-card:hover .envelope-card-flap {
  transform: translateY(-2px);
}

/* Wax Seal Medallion */
.envelope-card-seal {
  position: absolute;
  top: 98px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.royal-envelope-card:hover .envelope-card-seal {
  transform: scale(1.12);
}

.envelope-card-seal .seal-icon {
  font-size: 1.35rem;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

/* --------------------------------------------------------------------------
   Envelope Themes (Gold, Lavender, Pink)
   -------------------------------------------------------------------------- */

/* Theme 1: Champagne Gold (Happy) */
.envelope-theme--gold {
  border-color: rgba(232, 197, 71, 0.5);
}

.envelope-theme--gold .envelope-card-glow {
  background: radial-gradient(circle, rgba(255, 230, 130, 0.8), transparent 70%);
}

.envelope-theme--gold .envelope-card-pocket {
  background: linear-gradient(135deg, #FFFDF5 0%, #FFF8E1 50%, #FAEDCB 100%);
  border-color: rgba(232, 197, 71, 0.3);
}

.envelope-theme--gold .envelope-card-flap {
  background: linear-gradient(180deg, #FFF9E6 0%, #FDF0C2 100%);
  border-top: 1px solid rgba(232, 197, 71, 0.4);
}

.seal--gold {
  background: radial-gradient(circle at 35% 35%, #FDE88E 0%, #D89823 70%, #996307 100%);
  box-shadow: 0 4px 14px rgba(216, 152, 35, 0.45), inset 0 2px 4px rgba(255, 255, 255, 0.65), inset 0 -2px 4px rgba(0, 0, 0, 0.3);
  border: 1.5px solid #C48716;
}

.envelope-theme--gold .envelope-badge {
  background: rgba(255, 245, 204, 0.9);
  color: #8C650A;
  border: 1px solid rgba(232, 197, 71, 0.45);
}

/* Theme 2: Cloud Lavender (Sad) */
.envelope-theme--lavender {
  border-color: rgba(216, 180, 248, 0.55);
}

.envelope-theme--lavender .envelope-card-glow {
  background: radial-gradient(circle, rgba(220, 190, 255, 0.8), transparent 70%);
}

.envelope-theme--lavender .envelope-card-pocket {
  background: linear-gradient(135deg, #FAF7FF 0%, #F3EAFF 50%, #E8D7FF 100%);
  border-color: rgba(216, 180, 248, 0.35);
}

.envelope-theme--lavender .envelope-card-flap {
  background: linear-gradient(180deg, #F9F4FF 0%, #EADBFF 100%);
  border-top: 1px solid rgba(216, 180, 248, 0.45);
}

.seal--lavender {
  background: radial-gradient(circle at 35% 35%, #EADBFF 0%, #AC70E6 70%, #5B258F 100%);
  box-shadow: 0 4px 14px rgba(172, 112, 230, 0.45), inset 0 2px 4px rgba(255, 255, 255, 0.65), inset 0 -2px 4px rgba(0, 0, 0, 0.3);
  border: 1.5px solid #8B4CC6;
}

.envelope-theme--lavender .envelope-badge {
  background: rgba(238, 222, 255, 0.9);
  color: #4C2675;
  border: 1px solid rgba(216, 180, 248, 0.5);
}

/* Theme 3: Blush Pink (Miss Me) */
.envelope-theme--pink {
  border-color: rgba(255, 182, 193, 0.6);
}

.envelope-theme--pink .envelope-card-glow {
  background: radial-gradient(circle, rgba(255, 195, 205, 0.8), transparent 70%);
}

.envelope-theme--pink .envelope-card-pocket {
  background: linear-gradient(135deg, #FFF9FA 0%, #FFF0F4 50%, #FFE0E7 100%);
  border-color: rgba(255, 182, 193, 0.4);
}

.envelope-theme--pink .envelope-card-flap {
  background: linear-gradient(180deg, #FFF5F7 0%, #FFD6E0 100%);
  border-top: 1px solid rgba(255, 182, 193, 0.5);
}

.seal--pink {
  background: radial-gradient(circle at 35% 35%, #FFD4DD 0%, #F43F5E 70%, #9F1239 100%);
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.45), inset 0 2px 4px rgba(255, 255, 255, 0.65), inset 0 -2px 4px rgba(0, 0, 0, 0.3);
  border: 1.5px solid #E11D48;
}

.envelope-theme--pink .envelope-badge {
  background: rgba(255, 228, 232, 0.9);
  color: #9F1239;
  border: 1px solid rgba(255, 182, 193, 0.55);
}

/* Card Content Details */
.envelope-card-content {
  padding: var(--space-4) var(--space-5) var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1 1 auto;
}

.envelope-badge {
  font-family: var(--font-royal);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-2);
}

.envelope-title {
  font-family: var(--font-royal);
  font-size: clamp(1.1rem, 2vw, 1.25rem);
  font-weight: 700;
  color: var(--color-velvet-plum);
  margin-bottom: var(--space-2);
  line-height: 1.3;
}

.envelope-desc {
  font-size: var(--text-sm);
  color: var(--color-dusk-lavender);
  line-height: 1.45;
  margin-bottom: var(--space-4);
  flex-grow: 1;
}

.envelope-action-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-velvet-plum);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(232, 197, 71, 0.35);
  box-shadow: 0 2px 6px rgba(61, 44, 77, 0.05);
  transition: all 0.25s ease;
}

.royal-envelope-card:hover .envelope-action-hint {
  background: linear-gradient(135deg, #FFF9E6, #FFF0F5);
  border-color: var(--color-champagne-gold);
  transform: scale(1.04);
}

.envelope-action-hint .hint-icon {
  font-size: 0.95rem;
  line-height: 1;
}

/* --------------------------------------------------------------------------
   Stationery Modal Dialog (#letters-stationery-dialog)
   -------------------------------------------------------------------------- */
.letters-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(var(--space-2), 2.5vw, var(--space-6));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.letters-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.letters-modal[hidden] {
  display: none !important;
}

.letters-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 15, 36, 0.76);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.letters-dialog-card {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 740px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 250, 245, 0.96) 50%, rgba(250, 246, 255, 0.98) 100%);
  border: 2px solid var(--border-gold-subtle);
  border-radius: var(--radius-xl, 24px);
  box-shadow: 0 24px 60px rgba(45, 25, 65, 0.35), 0 0 32px rgba(232, 197, 71, 0.2);
  overflow: hidden;
  transform: scale(0.96) translateY(12px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.letters-modal.is-open .letters-dialog-card {
  transform: scale(1) translateY(0);
}

.letters-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid rgba(232, 197, 71, 0.25);
  background: rgba(255, 255, 255, 0.75);
}

.letters-dialog-badge-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.letters-dialog-icon {
  font-size: 1.35rem;
}

.letters-dialog-badge {
  font-family: var(--font-royal);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--color-velvet-plum);
}

.letters-dialog-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(61, 44, 77, 0.15);
  background: rgba(255, 255, 255, 0.85);
  color: var(--color-velvet-plum);
  font-size: 1.4rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.letters-dialog-close:hover {
  background: var(--color-fairy-rose-light);
  transform: rotate(90deg);
}

.letters-dialog-close:focus-visible {
  outline: 2px solid var(--color-champagne-gold);
  outline-offset: 2px;
}

.letters-dialog-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: clamp(var(--space-4), 3vw, var(--space-6));
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Custom Royal Scrollbar for Letter Modal */
.letters-dialog-body::-webkit-scrollbar {
  width: 6px;
}

.letters-dialog-body::-webkit-scrollbar-track {
  background: rgba(232, 197, 71, 0.08);
}

.letters-dialog-body::-webkit-scrollbar-thumb {
  background: rgba(232, 197, 71, 0.4);
  border-radius: 3px;
}

.letters-dialog-body::-webkit-scrollbar-thumb:hover {
  background: var(--color-champagne-gold);
}

/* --------------------------------------------------------------------------
   Four-Stage 3D Envelope Opening Animation Choreography
   -------------------------------------------------------------------------- */
.envelope-animation-stage {
  position: relative;
  width: 100%;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  perspective: 1200px;
  padding: var(--space-6) 0;
  overflow: hidden;
}

.anim-envelope-wrap {
  position: relative;
  width: 310px;
  height: 200px;
  transform: translateY(24px) scale(0.92);
  opacity: 0.85;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.45s ease;
}

.anim-envelope-wrap.is-centered {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.anim-envelope-body {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  box-shadow: 0 12px 36px rgba(61, 44, 77, 0.22);
  transform-style: preserve-3d;
  background: #FFFDF8;
  border: 1px solid rgba(232, 197, 71, 0.35);
}

/* Back Liner */
.anim-envelope-liner {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background: linear-gradient(145deg, #FFF5E0, #F7E4BE);
  z-index: 1;
}

.stage--lavender .anim-envelope-liner {
  background: linear-gradient(145deg, #F5EBFF, #E7D5FA);
}

.stage--pink .anim-envelope-liner {
  background: linear-gradient(145deg, #FFF0F4, #FEDCE4);
}

/* Folded Letter Parchment Inside Pocket */
.anim-letter-paper {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 270px;
  height: 175px;
  background: #FFFEFA;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 2;
  transition: transform 0.65s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.65s ease;
}

.anim-letter-crease {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.08) 30%, rgba(0, 0, 0, 0.08) 70%, transparent);
}

/* Letter slides upward out of the pocket */
.anim-letter-paper.is-slid-out {
  transform: translateX(-50%) translateY(-95px);
  z-index: 5;
  box-shadow: 0 18px 36px rgba(61, 44, 77, 0.25);
}

/* Triangular Flap (Folds on top) */
.anim-envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 115px;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: linear-gradient(180deg, #FFF9EB 0%, #FAEDCE 100%);
  transform-origin: top center;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 4;
  filter: drop-shadow(0 4px 6px rgba(61, 44, 77, 0.14));
}

.stage--lavender .anim-envelope-flap {
  background: linear-gradient(180deg, #F8F3FF 0%, #EADBFF 100%);
}

.stage--pink .anim-envelope-flap {
  background: linear-gradient(180deg, #FFF5F7 0%, #FFDCE5 100%);
}

/* Flap flips 180 degrees backward */
.anim-envelope-flap.is-flipped {
  transform: rotateX(-180deg);
  z-index: 1;
}

/* Wax Seal on Flap */
.anim-envelope-seal {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  z-index: 6;
  background: radial-gradient(circle at 35% 35%, #FDE88E 0%, #D89823 70%, #996307 100%);
  box-shadow: 0 4px 14px rgba(216, 152, 35, 0.45), inset 0 2px 4px rgba(255, 255, 255, 0.65);
  border: 1.5px solid #C48716;
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.stage--lavender .anim-envelope-seal {
  background: radial-gradient(circle at 35% 35%, #EADBFF 0%, #AC70E6 70%, #5B258F 100%);
  box-shadow: 0 4px 14px rgba(172, 112, 230, 0.45), inset 0 2px 4px rgba(255, 255, 255, 0.65);
  border-color: #8B4CC6;
}

.stage--pink .anim-envelope-seal {
  background: radial-gradient(circle at 35% 35%, #FFD4DD 0%, #F43F5E 70%, #9F1239 100%);
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.45), inset 0 2px 4px rgba(255, 255, 255, 0.65);
  border-color: #E11D48;
}

.anim-envelope-seal.is-broken {
  transform: translateX(-50%) scale(1.2);
  opacity: 0;
  filter: blur(2px);
}

/* Front Pocket (Covers the lower paper) */
.anim-envelope-front {
  position: absolute;
  inset: 0;
  clip-path: polygon(0 0, 50% 55%, 100% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, #FFFDF8 0%, #FAF1DC 100%);
  border-radius: 6px;
  z-index: 3;
  box-shadow: inset 0 -2px 6px rgba(0, 0, 0, 0.05);
}

.stage--lavender .anim-envelope-front {
  background: linear-gradient(180deg, #FCFAFF 0%, #F0E4FD 100%);
}

.stage--pink .anim-envelope-front {
  background: linear-gradient(180deg, #FFFAFB 0%, #FDE4EB 100%);
}

/* Status Label Under Envelope */
.anim-status-label {
  margin-top: var(--space-6);
  font-family: var(--font-royal);
  font-size: 0.95rem;
  color: var(--color-velvet-plum);
  letter-spacing: 0.5px;
  animation: scriptoriumPulse 1.4s ease-in-out infinite alternate;
}

@keyframes scriptoriumPulse {
  from { opacity: 0.7; transform: translateY(0); }
  to { opacity: 1; transform: translateY(-2px); }
}

/* --------------------------------------------------------------------------
   Stationery Paper Layout (.royal-stationery-sheet)
   -------------------------------------------------------------------------- */
.royal-stationery-sheet {
  position: relative;
  width: 100%;
  max-width: 660px;
  padding: clamp(var(--space-6), 5vw, var(--space-10)) clamp(var(--space-5), 4vw, var(--space-8));
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(61, 44, 77, 0.08), 0 12px 36px rgba(61, 44, 77, 0.06), inset 0 0 60px rgba(210, 185, 155, 0.08);
  border: 1px solid rgba(215, 195, 170, 0.6);
  animation: stationeryUnfold 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  display: flex;
  flex-direction: column;
}

@keyframes stationeryUnfold {
  0% {
    opacity: 0;
    transform: scale(0.95) translateY(12px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Three Stationery Paper Themes */
.paper--ivory {
  background: linear-gradient(175deg, #FFFDF8 0%, #FAF5EB 50%, #F5EFE0 100%);
  border-color: rgba(225, 205, 175, 0.8);
}

.paper--lavender {
  background: linear-gradient(175deg, #FBF9FF 0%, #F5EFFF 50%, #EEE4FA 100%);
  border-color: rgba(216, 195, 240, 0.8);
}

.paper--blush {
  background: linear-gradient(175deg, #FFF9FA 0%, #FFF0F3 50%, #FFE4E8 100%);
  border-color: rgba(250, 205, 215, 0.8);
}

/* Floral Corner Accents */
.stationery-floral-corner {
  position: absolute;
  font-size: 1.15rem;
  line-height: 1;
  opacity: 0.75;
  pointer-events: none;
  user-select: none;
}

.corner--top-left { top: 12px; left: 12px; }
.corner--top-right { top: 12px; right: 12px; }
.corner--bottom-left { bottom: 12px; left: 12px; }
.corner--bottom-right { bottom: 12px; right: 12px; }

/* Stationery Header */
.stationery-header {
  text-align: center;
  margin-bottom: var(--space-4);
}

.stationery-royal-seal {
  font-size: 2.2rem;
  line-height: 1;
  margin-bottom: var(--space-2);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.stationery-title {
  font-family: var(--font-accent, 'Dancing Script', cursive);
  font-size: clamp(1.85rem, 3.8vw, 2.5rem);
  font-weight: 700;
  color: #2D221E;
  margin: 0;
  line-height: 1.25;
}

.stationery-divider {
  width: 90px;
  height: 2px;
  margin: var(--space-3) auto;
  background: linear-gradient(90deg, transparent, var(--color-champagne-gold, #E8C547), transparent);
}

.stationery-meta-label {
  font-family: var(--font-royal);
  font-size: 0.78rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-dusk-lavender);
}

/* Stationery Body & Exact Whitespace Preservation */
.stationery-body-wrapper {
  margin-top: var(--space-4);
  margin-bottom: var(--space-6);
  text-align: left;
}

.stationery-text {
  font-family: Georgia, 'Palatino Linotype', 'Book Antiqua', serif;
  font-size: clamp(1.02rem, 1.8vw, 1.12rem);
  line-height: 1.85;
  color: #2C2420;
  white-space: pre-wrap;
  word-break: break-word;
  letter-spacing: 0.15px;
}

/* Stationery Footer */
.stationery-footer {
  margin-top: auto;
  padding-top: var(--space-4);
  display: flex;
  justify-content: center;
  border-top: 1px dashed rgba(61, 44, 77, 0.15);
}

.btn-return-scriptorium {
  padding: 10px 24px;
  font-family: var(--font-royal);
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 245, 248, 0.9));
  border: 1.5px solid var(--border-gold-subtle);
  color: var(--color-velvet-plum);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(61, 44, 77, 0.08);
  transition: all 0.25s ease;
}

.btn-return-scriptorium:hover {
  background: var(--color-fairy-rose-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(61, 44, 77, 0.14);
}

.btn-return-scriptorium:focus-visible {
  outline: 2px solid var(--color-champagne-gold);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Loading, Locked, and Error States in Scriptorium
   -------------------------------------------------------------------------- */
.letters-loading-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  min-height: 280px;
  text-align: center;
}

.letters-loading-seal {
  font-size: 3rem;
  line-height: 1;
  animation: scriptoriumFloat 1.8s ease-in-out infinite alternate;
}

.letters-loading-text {
  font-family: var(--font-royal);
  font-size: 1rem;
  color: var(--color-velvet-plum);
}

@keyframes scriptoriumFloat {
  from { transform: translateY(0); }
  to { transform: translateY(-8px); }
}

.letters-locked-view,
.letters-error-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
  padding: var(--space-6);
  max-width: 460px;
  margin-inline: auto;
}

.letters-locked-icon,
.letters-error-icon {
  font-size: 2.8rem;
  line-height: 1;
}

.letters-locked-title,
.letters-error-title {
  font-family: var(--font-royal);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-velvet-plum);
  margin: 0;
}

.letters-locked-desc,
.letters-error-desc {
  font-size: var(--text-sm);
  color: var(--color-dusk-lavender);
  line-height: 1.5;
  margin: 0;
}

.letters-error-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.btn-retry-letter,
.btn-return-gates {
  padding: 8px 20px;
  font-family: var(--font-royal);
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  background: var(--color-champagne-gold);
  border: none;
  color: var(--color-velvet-plum);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-retry-letter:hover,
.btn-return-gates:hover {
  background: #D9B335;
  transform: translateY(-1px);
}

.btn-dismiss-error {
  padding: 8px 18px;
  font-family: var(--font-royal);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--color-velvet-plum);
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Reduced Motion Support
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .royal-envelope-card,
  .royal-envelope-card:hover,
  .envelope-card-seal,
  .envelope-card-flap,
  .letters-dialog-card,
  .anim-envelope-wrap,
  .anim-envelope-flap,
  .anim-envelope-seal,
  .anim-letter-paper,
  .royal-stationery-sheet {
    animation: none !important;
    transition: opacity 0.15s ease !important;
    transform: none !important;
  }

  .anim-envelope-flap.is-flipped {
    opacity: 0.1 !important;
    transform: none !important;
  }

  .anim-envelope-seal.is-broken {
    opacity: 0 !important;
    transform: none !important;
  }

  .anim-letter-paper.is-slid-out {
    transform: translateX(-50%) !important;
    opacity: 1 !important;
  }

  .letters-loading-seal,
  .anim-status-label {
    animation: none !important;
  }
}

/* ==========================================================================
   9. SECTION 8: GRAND BIRTHDAY FINALE
   ========================================================================== */
.finale-section {
  position: relative;
  overflow: hidden;
  text-align: center;
  background: radial-gradient(ellipse at 50% 30%, rgba(255, 228, 240, 0.9) 0%, rgba(245, 230, 255, 0.85) 45%, rgba(255, 245, 248, 1) 100%);
  padding-block: var(--space-8) clamp(110px, 14vh, 170px);
}

/* Ambient Ballroom Backdrop */
.finale-ambient-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

/* Ballroom Garland Fairy Lights */
.ballroom-garland-lights {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  height: 40px;
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  padding-inline: var(--space-4);
  border-top: 2px dashed rgba(232, 197, 71, 0.4);
}

.garland-bulb {
  width: 14px;
  height: 20px;
  border-radius: 50% 50% 35% 35%;
  animation: bulbGlow 2.5s ease-in-out infinite alternate;
}

.garland-bulb--pink {
  background: #ff758c;
  box-shadow: 0 0 14px #ff758c, 0 0 28px rgba(255, 117, 140, 0.6);
  animation-delay: 0.2s;
}

.garland-bulb--gold {
  background: #ffd700;
  box-shadow: 0 0 14px #ffd700, 0 0 28px rgba(255, 215, 0, 0.6);
  animation-delay: 0.6s;
}

.garland-bulb--lavender {
  background: #d8b4f8;
  box-shadow: 0 0 14px #d8b4f8, 0 0 28px rgba(216, 180, 248, 0.6);
  animation-delay: 1s;
}

.garland-bulb--rose {
  background: #ff9a9e;
  box-shadow: 0 0 14px #ff9a9e, 0 0 28px rgba(255, 154, 158, 0.6);
  animation-delay: 1.4s;
}

@keyframes bulbGlow {
  0% { opacity: 0.65; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1.1); }
}

/* Fireworks Canvas */
.finale-fireworks-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* Floating Balloons & Sparkles */
.finale-balloons-container,
.finale-sparkles-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.floating-balloon {
  position: absolute;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  animation: balloonFloatUp linear forwards;
  opacity: 0.9;
  filter: drop-shadow(0 6px 12px rgba(60, 20, 80, 0.15));
}

.floating-balloon::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 24px;
  background: rgba(180, 150, 200, 0.6);
}

@keyframes balloonFloatUp {
  0% {
    transform: translateY(105vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.95;
  }
  90% {
    opacity: 0.95;
  }
  100% {
    transform: translateY(-120px) rotate(15deg);
    opacity: 0;
  }
}

.celebration-confetti-particle {
  position: absolute;
  pointer-events: none;
  user-select: none;
  z-index: 20;
  animation: confettiDrop linear forwards;
}

@keyframes confettiDrop {
  0% {
    transform: translateY(-20px) rotate(0deg) scale(0.8);
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    transform: translateY(480px) rotate(720deg) scale(1);
    opacity: 0;
  }
}

/* Content Container */
.finale-content-container {
  position: relative;
  z-index: 3;
}

.finale-celebration-stage {
  max-width: 860px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  align-items: center;
}

/* ==========================================================================
   AUDIO PLAYER CONTROL BAR
   ========================================================================== */
.finale-audio-bar {
  width: 100%;
  max-width: 580px;
  background: rgba(255, 255, 255, 0.88);
  border: 1.5px solid var(--border-gold-subtle);
  border-radius: var(--radius-pill);
  padding: 8px 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  box-shadow: 0 8px 24px rgba(45, 20, 60, 0.08), 0 0 16px rgba(232, 197, 71, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.audio-track-info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.audio-music-icon {
  font-size: 1.2rem;
  animation: musicIconBounce 2s ease-in-out infinite;
}

@keyframes musicIconBounce {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.15) rotate(10deg); }
}

.audio-track-title {
  font-family: var(--font-royal);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-velvet-plum);
  letter-spacing: 0.3px;
}

.audio-controls-group {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.btn-finale-audio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #a57c1b 0%, #c59b27 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-family: var(--font-royal);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(165, 124, 27, 0.35);
  transition: all 0.25s ease;
}

.btn-finale-audio:hover {
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 6px 16px rgba(165, 124, 27, 0.5);
}

.btn-finale-audio.is-playing {
  background: linear-gradient(135deg, #ff6b8b 0%, #d84572 100%);
  box-shadow: 0 4px 12px rgba(216, 69, 114, 0.4);
}

.audio-volume-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-audio-mute {
  background: transparent;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  padding: 2px;
  line-height: 1;
  transition: transform 0.2s ease;
}

.btn-audio-mute:hover {
  transform: scale(1.15);
}

.audio-volume-slider {
  width: 65px;
  accent-color: var(--color-champagne-gold, #e8c547);
  cursor: pointer;
}

.audio-error-banner {
  width: 100%;
  padding: 6px var(--space-3);
  background: rgba(225, 29, 72, 0.1);
  border: 1px solid rgba(225, 29, 72, 0.3);
  border-radius: var(--radius-md);
  color: #8C1D40;
  font-size: var(--text-xs);
  text-align: center;
}

/* ==========================================================================
   CENTERPIECE: PRINCESS MOUKI & THE BIRTHDAY CAKE
   ========================================================================== */
.finale-centerpiece {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: var(--space-2);
}

/* Princess Mouki Avatar */
.mouki-avatar-wrap {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mouki-halo-glow {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translate(-50%, -10%);
  width: clamp(220px, 32vw, 320px);
  height: clamp(220px, 32vw, 320px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 230, 245, 0.95) 0%, rgba(232, 197, 71, 0.35) 45%, rgba(216, 180, 248, 0) 70%);
  pointer-events: none;
  z-index: -1;
  animation: haloPulse 4s ease-in-out infinite alternate;
}

@keyframes haloPulse {
  0% { transform: translate(-50%, -10%) scale(0.95); opacity: 0.7; }
  100% { transform: translate(-50%, -10%) scale(1.08); opacity: 1; }
}

.mouki-chibi-avatar {
  width: clamp(210px, 28vw, 290px);
  height: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 14px 28px rgba(50, 15, 65, 0.22));
  animation: moukiBreathing 4.2s ease-in-out infinite;
}

@keyframes moukiBreathing {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-9px);
  }
}

/* Speech Bubble */
.mouki-speech-bubble {
  position: absolute;
  top: 15px;
  left: calc(100% + 20px);
  width: max-content;
  max-width: 220px;
  background: #ffffff;
  border: 2px solid var(--border-gold-subtle);
  border-radius: var(--radius-lg, 16px);
  padding: 10px 16px;
  box-shadow: 0 8px 24px rgba(60, 20, 80, 0.12), 0 0 12px rgba(232, 197, 71, 0.35);
  font-family: var(--font-royal);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--color-velvet-plum);
  text-align: center;
  z-index: 5;
  animation: speechFloat 3s ease-in-out infinite alternate;
}

.mouki-speech-bubble::before {
  content: '';
  position: absolute;
  top: 24px;
  left: -11px;
  border-width: 7px 11px 7px 0;
  border-style: solid;
  border-color: transparent var(--border-gold-subtle) transparent transparent;
}

.mouki-speech-bubble::after {
  content: '';
  position: absolute;
  top: 25px;
  left: -9px;
  border-width: 6px 9px 6px 0;
  border-style: solid;
  border-color: transparent #ffffff transparent transparent;
}

@keyframes speechFloat {
  0% { transform: translateY(0); }
  100% { transform: translateY(-5px); }
}

/* Cake & Table Ensemble */
.cake-table-ensemble {
  position: relative;
  z-index: 6;
  width: 100%;
  max-width: 440px;
  margin-top: -55px; /* Overlaps gracefully in front of Mouki */
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Instruction Banner */
.cake-cut-instruction {
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid var(--border-rose-subtle, #ffccd5);
  border-radius: var(--radius-pill);
  padding: 6px 16px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: 12px;
  box-shadow: 0 4px 14px rgba(255, 117, 140, 0.2);
  animation: instructionPulse 2.2s ease-in-out infinite;
}

.instruction-text {
  font-family: var(--font-royal);
  font-size: 0.78rem;
  font-weight: 800;
  color: #8C1D40;
  letter-spacing: 0.4px;
}

@keyframes instructionPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(255, 117, 140, 0.2); }
  50% { transform: scale(1.04); box-shadow: 0 6px 20px rgba(255, 117, 140, 0.4); }
}

/* Cake Cutting Zone */
.cake-cutting-zone {
  position: relative;
  width: 290px;
  height: 200px;
  user-select: none;
  touch-action: none;
  cursor: crosshair;
}

.cake-cutting-zone:focus-visible {
  outline: 2px solid var(--color-champagne-gold);
  outline-offset: 4px;
  border-radius: var(--radius-lg);
}

/* Cutting Blade Sparkle Line Trail */
.cake-cut-blade-line {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #ffffff, #ffd700, #ff758c, transparent);
  box-shadow: 0 0 12px #ffd700, 0 0 24px #ff758c;
  z-index: 30;
  transform-origin: left center;
  transition: opacity 0.15s ease;
}

.cake-cutting-zone.is-swiping .cake-cut-blade-line {
  opacity: 1;
}

/* Cake Assembly & Halves */
.cake-assembly {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.cake-half {
  position: relative;
  width: 125px;
  height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  transition: transform 0.65s cubic-bezier(0.18, 0.9, 0.32, 1.25);
  will-change: transform;
}

.cake-half--left {
  transform-origin: bottom left;
  border-top-left-radius: 8px;
}

.cake-half--right {
  transform-origin: bottom right;
  border-top-right-radius: 8px;
}

/* Split Separation Animation */
.cake-assembly.is-cut .cake-half--left {
  transform: translateX(-24px) rotate(-3.5deg);
}

.cake-assembly.is-cut .cake-half--right {
  transform: translateX(24px) rotate(3.5deg);
}

/* Cake Tiers */
.cake-tier {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.cake-tier--top {
  height: 40px;
  width: 82px;
  background: linear-gradient(180deg, #fff0f5 0%, #ffccd8 100%);
  border: 1.5px solid rgba(232, 197, 71, 0.5);
}

.cake-half--left .cake-tier--top {
  border-top-left-radius: 12px;
  border-right: none;
}

.cake-half--right .cake-tier--top {
  border-top-right-radius: 12px;
  border-left: none;
}

.cake-tier--mid {
  height: 48px;
  width: 105px;
  background: linear-gradient(180deg, #f8e8ff 0%, #e2c4ff 100%);
  border: 1.5px solid rgba(232, 197, 71, 0.5);
}

.cake-half--left .cake-tier--mid {
  border-top-left-radius: 10px;
  border-right: none;
}

.cake-half--right .cake-tier--mid {
  border-top-right-radius: 10px;
  border-left: none;
}

.cake-tier--base {
  height: 56px;
  width: 125px;
  background: linear-gradient(180deg, #ffeef5 0%, #ffb6c1 100%);
  border: 1.5px solid rgba(232, 197, 71, 0.5);
}

.cake-half--left .cake-tier--base {
  border-top-left-radius: 8px;
  border-bottom-left-radius: 6px;
  border-right: none;
}

.cake-half--right .cake-tier--base {
  border-top-right-radius: 8px;
  border-bottom-right-radius: 6px;
  border-left: none;
}

/* Scalloped Frosting Drips */
.tier-frosting {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 12px;
  background: #ffffff;
  border-bottom: 2px solid rgba(232, 197, 71, 0.35);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 2px 4px rgba(60, 20, 80, 0.08);
}

/* Tier Topping Decorations */
.tier-decorations {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 4px;
  font-size: 0.95rem;
  line-height: 1;
}

.cake-strawberry {
  filter: drop-shadow(0 2px 4px rgba(200, 20, 60, 0.3));
}

.cake-pearl {
  font-size: 0.75rem;
}

/* Cut Interior Slice (Revealed upon splitting) */
.cut-interior-slice {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 16px;
  opacity: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  background: linear-gradient(90deg, #ffe0ec 0%, #fff5ea 50%, #ffe0ec 100%);
  transition: opacity 0.4s ease;
  z-index: 1;
}

.cake-half--left .cut-interior-slice {
  right: 0;
  border-left: 1px dashed rgba(232, 197, 71, 0.5);
}

.cake-half--right .cut-interior-slice {
  left: 0;
  border-right: 1px dashed rgba(232, 197, 71, 0.5);
}

.cake-assembly.is-cut .cut-interior-slice {
  opacity: 1;
}

.slice-sponge {
  height: 25%;
  background: #ffd699;
  border-radius: 2px;
}

.slice-cream {
  height: 15%;
  background: #ffffff;
  border-radius: 2px;
}

/* Candle & Glowing Flame */
.candle-wrapper {
  position: absolute;
  top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 4;
}

.candle-wrapper--left {
  right: 18px;
}

.candle-wrapper--right {
  left: 18px;
}

.candle-stick {
  width: 8px;
  height: 28px;
  background: repeating-linear-gradient(45deg, #ffd700, #ffd700 4px, #ffffff 4px, #ffffff 8px);
  border: 1px solid rgba(180, 140, 20, 0.5);
  border-radius: 3px 3px 0 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.candle-flame {
  width: 12px;
  height: 18px;
  background: radial-gradient(ellipse at bottom, #ffffff 0%, #ffff55 25%, #ff8800 65%, #ff2200 100%);
  border-radius: 50% 50% 35% 35%;
  box-shadow: 0 0 10px #ffbb00, 0 0 20px #ff5500;
  animation: candleFlicker 1.8s ease-in-out infinite alternate;
  transform-origin: bottom center;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.candle-glow {
  position: absolute;
  top: -8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 230, 100, 0.6) 0%, rgba(255, 150, 50, 0) 70%);
  pointer-events: none;
  animation: candleGlowPulse 1.8s ease-in-out infinite alternate;
}

@keyframes candleFlicker {
  0% { transform: scale(1) rotate(-2deg); }
  25% { transform: scale(1.08, 0.95) rotate(3deg); }
  50% { transform: scale(0.95, 1.05) rotate(-1deg); }
  75% { transform: scale(1.05, 1) rotate(2deg); }
  100% { transform: scale(1) rotate(-2deg); }
}

@keyframes candleGlowPulse {
  0% { opacity: 0.7; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1.15); }
}

/* Blow out candles when cake is cut */
.cake-assembly.is-cut .candle-flame {
  opacity: 0.15;
  transform: scale(0.4);
}

.cake-assembly.is-cut .candle-glow {
  opacity: 0;
}

/* Royal Dessert Table */
.royal-cake-table {
  position: relative;
  width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: -6px;
}

.table-platter {
  width: 270px;
  height: 16px;
  background: linear-gradient(180deg, #fff4cc 0%, #e8c547 40%, #a57c1b 100%);
  border-radius: 50%;
  border: 1.5px solid #d4af37;
  box-shadow: 0 4px 10px rgba(60, 20, 80, 0.25);
}

.table-runner {
  width: 290px;
  height: 6px;
  background: #ffffff;
  border-radius: 3px;
  border: 1px solid rgba(232, 197, 71, 0.4);
  margin-top: -2px;
}

.table-cloth {
  width: 310px;
  height: 24px;
  background: linear-gradient(180deg, #fdf8ff 0%, #eedeff 100%);
  border-bottom: 3px solid #d4af37;
  border-radius: 4px 4px 16px 16px;
  box-shadow: 0 6px 16px rgba(45, 15, 60, 0.15);
}

.table-legs {
  width: 220px;
  height: 12px;
  background: repeating-linear-gradient(90deg, #6d4c41 0%, #6d4c41 18px, transparent 18px, transparent 72px);
  opacity: 0.4;
  border-radius: 0 0 4px 4px;
}

/* ==========================================================================
   POST-CUT CELEBRATION BANNER
   ========================================================================== */
.finale-celebration-banner {
  width: 100%;
  max-width: 640px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 240, 248, 0.94) 50%, rgba(250, 242, 255, 0.96) 100%);
  border: 2px solid var(--color-champagne-gold, #e8c547);
  border-radius: var(--radius-2xl, 24px);
  padding: var(--space-6) var(--space-8);
  box-shadow: 0 20px 48px rgba(60, 20, 80, 0.2), 0 0 36px rgba(232, 197, 71, 0.4);
  text-align: center;
  animation: bannerCelebrationPop 0.7s cubic-bezier(0.18, 0.9, 0.32, 1.25) forwards;
}

.finale-celebration-banner[hidden] {
  display: none !important;
}

@keyframes bannerCelebrationPop {
  0% {
    transform: scale(0.7) translateY(30px);
    opacity: 0;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.celebration-badge {
  display: inline-block;
  font-family: var(--font-royal);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #8C650A;
  background: linear-gradient(135deg, #FFF5CC, #FFE4A0);
  border: 1px solid rgba(232, 197, 71, 0.6);
  border-radius: var(--radius-pill);
  padding: 4px 14px;
  margin-bottom: var(--space-3);
}

.celebration-birthday-message {
  font-family: var(--font-royal);
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  font-weight: 800;
  color: #8C1D40;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-2);
  text-shadow: 0 2px 8px rgba(255, 117, 140, 0.3);
}

.celebration-blessing {
  font-family: var(--font-body);
  font-size: clamp(0.9rem, 1.1vw, 1rem);
  line-height: 1.6;
  color: var(--color-velvet-plum);
  margin-bottom: var(--space-5);
}

.celebration-actions {
  display: flex;
  justify-content: center;
}

.btn-recut-cake {
  background: linear-gradient(135deg, #a57c1b 0%, #c59b27 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 10px 24px;
  font-family: var(--font-royal);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(165, 124, 27, 0.35);
  transition: all 0.25s ease;
}

.btn-recut-cake:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 24px rgba(165, 124, 27, 0.5);
}

/* ==========================================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================================== */
@media (min-width: 641px) and (max-width: 900px) {
  .mouki-speech-bubble {
    left: calc(100% + 12px);
    max-width: 185px;
    font-size: 0.76rem;
    padding: 8px 12px;
  }
}

@media (max-width: 640px) {
  .finale-audio-bar {
    flex-direction: column;
    border-radius: var(--radius-xl);
    padding: 12px var(--space-4);
  }

  .mouki-speech-bubble {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    margin: 0 auto 14px;
    max-width: 250px;
    font-size: 0.78rem;
    padding: 8px 14px;
  }

  .mouki-speech-bubble::before {
    top: auto;
    bottom: -11px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 11px 8px 0;
    border-color: var(--border-gold-subtle) transparent transparent;
  }

  .mouki-speech-bubble::after {
    top: auto;
    bottom: -9px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 9px 7px 0;
    border-color: #ffffff transparent transparent;
  }

  .cake-table-ensemble {
    margin-top: -40px;
  }

  .cake-cutting-zone {
    width: 250px;
    height: 180px;
  }

  .cake-half {
    width: 108px;
    height: 160px;
  }

  .cake-tier--top {
    width: 70px;
    height: 35px;
  }

  .cake-tier--mid {
    width: 90px;
    height: 42px;
  }

  .cake-tier--base {
    width: 108px;
    height: 50px;
  }

  .royal-cake-table {
    width: 270px;
  }

  .table-platter {
    width: 230px;
  }

  .table-cloth {
    width: 260px;
  }

  .finale-celebration-banner {
    padding: var(--space-4) var(--space-5);
  }
}

/* Reduced Motion Override */
@media (prefers-reduced-motion: reduce) {
  .mouki-chibi-avatar,
  .mouki-halo-glow,
  .mouki-speech-bubble,
  .candle-flame,
  .candle-glow,
  .audio-music-icon,
  .cake-cut-instruction,
  .garland-bulb {
    animation: none !important;
  }

  .cake-half,
  .finale-celebration-banner {
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   10. SITE FOOTER
   ========================================================================== */
.site-footer {
  text-align: center;
  padding-block: var(--space-8);
  border-top: 1px solid var(--border-gold-subtle);
  background-color: var(--color-cloud-lavender);
  font-size: var(--text-xs);
  color: var(--color-dusk-lavender);
}

