/*
 * ===================================================================
 * MIMII — A WORLD OF HER OWN (VERSION 2.0 INTERACTIVE UPGRADE)
 * Master Design System & Style Architecture (style.css)
 * ===================================================================
 */

@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;600;700&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;0,700;1,400&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,700;1,400&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* --- CSS Variables & Design Tokens --- */
:root {
  --color-cream: #FFF8F0;
  --color-pastel-pink: #F6DDE8;
  --color-blush-rose: #EAB8C9;
  --color-deep-rose: #D397AD;
  --color-pale-yellow: #F5E5A8;
  --color-daisy-gold: #E8CA5C;
  --color-sage: #D4E1CE;
  --color-dusty-mauve: #8B687D;
  --color-dark-brown: #493C40;
  --color-soft-white: #FFFFFF;

  --font-serif: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-handwritten: 'Caveat', cursive, serif;

  --shadow-subtle: 0 4px 18px rgba(73, 60, 64, 0.05);
  --shadow-card: 0 10px 30px rgba(73, 60, 64, 0.08);
  --shadow-hover: 0 16px 40px rgba(139, 104, 125, 0.16);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-pill: 9999px;

  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Base & Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-cream);
  color: var(--color-dark-brown);
  line-height: 1.65;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* Subtle Film Grain Overlay */
.film-grain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 999;
  background-image: url('../assets/textures/grain.svg');
  opacity: 0.45;
  mix-blend-mode: multiply;
}

/* Fullscreen Floating Petals Canvas */
#petalCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 10;
}

/* Top Reading Progress Bar */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3.5px;
  width: 0%;
  background: linear-gradient(90deg, var(--color-pale-yellow), var(--color-blush-rose), var(--color-deep-rose));
  z-index: 1000;
  transition: width 0.15s ease-out;
}

/* --- Floating Quick Controls --- */
.floating-audio-widget {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 800;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 248, 240, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(234, 184, 201, 0.6);
  box-shadow: var(--shadow-card);
  transition: var(--transition-smooth);
}

.floating-audio-widget:hover {
  transform: translateY(-2px);
  border-color: var(--color-blush-rose);
  box-shadow: var(--shadow-hover);
}

.audio-btn {
  background: var(--color-pastel-pink);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-dark-brown);
  font-size: 16px;
  transition: var(--transition-smooth);
}

.audio-btn:hover {
  background: var(--color-blush-rose);
  transform: scale(1.08);
}

.audio-btn.playing {
  background: var(--color-blush-rose);
  color: #fff;
  animation: pulseAudio 2s infinite ease-in-out;
}

@keyframes pulseAudio {
  0%, 100% { box-shadow: 0 0 0 0 rgba(234, 184, 201, 0.6); }
  50% { box-shadow: 0 0 0 8px rgba(234, 184, 201, 0); }
}

.audio-info {
  display: flex;
  flex-direction: column;
}

.audio-title {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-dark-brown);
  letter-spacing: 0.3px;
}

.audio-waves {
  display: flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 10px;
  margin-top: 2px;
}

.audio-waves span {
  width: 2px;
  height: 3px;
  background: var(--color-dusty-mauve);
  border-radius: 1px;
  transition: height 0.2s ease;
}

.audio-waves.active span:nth-child(1) { animation: wave 0.8s infinite 0.1s ease-in-out; }
.audio-waves.active span:nth-child(2) { animation: wave 0.8s infinite 0.3s ease-in-out; }
.audio-waves.active span:nth-child(3) { animation: wave 0.8s infinite 0.2s ease-in-out; }
.audio-waves.active span:nth-child(4) { animation: wave 0.8s infinite 0.4s ease-in-out; }

@keyframes wave {
  0%, 100% { height: 3px; }
  50% { height: 10px; }
}

/* Floating Secret Hunt Counter Pill */
.floating-secrets-badge {
  position: fixed;
  top: 16px;
  left: 24px;
  z-index: 850;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-blush-rose);
  box-shadow: var(--shadow-card);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--color-dark-brown);
  cursor: pointer;
  transition: var(--transition-bounce);
}

.floating-secrets-badge:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: var(--shadow-hover);
  background: #FFF8F0;
}

.floating-secrets-badge.all-found {
  background: linear-gradient(135deg, #F5E5A8 0%, #EAB8C9 100%);
  border-color: var(--color-daisy-gold);
  animation: glowGold 2s infinite ease-in-out;
}

@keyframes glowGold {
  0%, 100% { box-shadow: 0 0 12px rgba(232, 202, 92, 0.5); }
  50% { box-shadow: 0 0 24px rgba(232, 202, 92, 0.8); }
}

/* Scroll To Top Button */
.scroll-top-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 248, 240, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(234, 184, 201, 0.7);
  color: var(--color-dark-brown);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-card);
  z-index: 800;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: var(--transition-smooth);
}

.scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top-btn:hover {
  background: var(--color-blush-rose);
  color: #fff;
  transform: translateY(-3px);
}

/* --- Common Layout & Section Styling --- */
.scene-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}

.scene-header {
  text-align: center;
  margin-bottom: 56px;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.scene-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--color-dusty-mauve);
  background: rgba(246, 221, 232, 0.55);
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  margin-bottom: 16px;
  border: 1px solid rgba(234, 184, 201, 0.4);
}

.scene-title {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 400;
  letter-spacing: -0.5px;
  line-height: 1.2;
  color: var(--color-dark-brown);
  margin-bottom: 16px;
}

.scene-subtitle {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  color: var(--color-dusty-mauve);
  font-weight: 300;
  line-height: 1.7;
}

/* Scroll Triggered Animations */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1), transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--color-blush-rose) 0%, var(--color-deep-rose) 100%);
  color: #FFFFFF;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 1.2px;
  padding: 16px 36px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(211, 151, 173, 0.45);
  transition: var(--transition-bounce);
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 14px 36px rgba(211, 151, 173, 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--color-blush-rose);
  color: var(--color-dark-brown);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.8px;
  padding: 12px 28px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition-bounce);
  box-shadow: var(--shadow-subtle);
}

.btn-secondary:hover {
  background: var(--color-pastel-pink);
  transform: translateY(-2px);
  border-color: var(--color-deep-rose);
}

.btn-primary-sm {
  background: var(--color-blush-rose);
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-primary-sm:hover {
  background: var(--color-deep-rose);
}

/* ===================================================================
 * SCENE 01: THE PREPARATION (LOADER)
 * =================================================================== */
#scenePreparation {
  position: fixed;
  inset: 0;
  background-color: var(--color-cream);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

#scenePreparation.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.loader-icons {
  position: relative;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-daisy {
  width: 72px;
  height: 72px;
  animation: rotateDaisy 12s linear infinite;
}

.loader-bow {
  position: absolute;
  top: -8px;
  right: -4px;
  width: 38px;
  height: 38px;
  animation: pulseBow 2.2s ease-in-out infinite;
}

@keyframes rotateDaisy {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulseBow {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.12) rotate(6deg); }
}

.loader-text {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  color: var(--color-dark-brown);
  letter-spacing: 0.5px;
  min-height: 2rem;
}

.loader-progress-track {
  width: 180px;
  height: 4px;
  background: rgba(234, 184, 201, 0.3);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

#loaderProgressBar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--color-pale-yellow), var(--color-blush-rose));
  border-radius: var(--radius-pill);
  transition: width 0.15s ease-out;
}

/* ===================================================================
 * SCENE 02: THE ENTRANCE & MAGICAL GARDEN DOOR (FEATURE A)
 * =================================================================== */
#sceneEntrance {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: radial-gradient(circle at 50% 30%, #FFFFFF 0%, var(--color-pastel-pink) 45%, var(--color-cream) 100%);
  overflow: hidden;
  text-align: center;
  padding: 60px 24px;
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.8s ease;
}

#sceneEntrance.zoom-exit {
  transform: scale(1.15);
  opacity: 0.05;
  pointer-events: none;
}

.entrance-skip-btn {
  position: absolute;
  top: 28px;
  right: 28px;
  background: none;
  border: 1px solid rgba(139, 104, 125, 0.3);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--color-dusty-mauve);
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: var(--transition-smooth);
  z-index: 20;
}

.entrance-skip-btn:hover {
  background: var(--color-pastel-pink);
  border-color: var(--color-blush-rose);
  color: var(--color-dark-brown);
}

.entrance-body {
  max-width: 820px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  z-index: 5;
}

.entrance-phrase {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 300;
  line-height: 1.35;
  color: var(--color-dark-brown);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1.4s ease, transform 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.entrance-phrase.visible {
  opacity: 1;
  transform: translateY(0);
}

.entrance-phrase.highlight-phrase {
  font-style: italic;
  font-weight: 600;
  color: var(--color-dusty-mauve);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
}

/* 3D Magical Garden Door */
.garden-door-wrapper {
  margin-top: 16px;
  perspective: 1000px;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1.2s ease, transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.garden-door-wrapper.visible {
  opacity: 1;
  transform: translateY(0);
}

.garden-door-frame {
  width: 200px;
  height: 280px;
  background: #FFF8F0;
  border: 5px solid #EAB8C9;
  border-radius: 100px 100px 8px 8px;
  position: relative;
  box-shadow: 0 16px 40px rgba(73, 60, 64, 0.15);
  overflow: visible;
}

.door-jasmine-vine {
  position: absolute;
  top: -15px;
  left: -15px;
  right: -15px;
  height: 60px;
  background-image: radial-gradient(circle, #D4E1CE 60%, transparent 70%);
  background-size: 20px 20px;
  border-radius: 120px 120px 0 0;
  pointer-events: none;
}

.door-gilded-daisy {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 38px;
  height: 38px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 10;
  animation: shimmerDaisy 2s infinite ease-in-out;
}

@keyframes shimmerDaisy {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.15) rotate(10deg); filter: drop-shadow(0 0 6px #F5E5A8); }
}

.garden-door-panel {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #FFFFFF 0%, #F6DDE8 100%);
  border-radius: 95px 95px 4px 4px;
  transform-origin: left center;
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  cursor: pointer;
  box-shadow: inset 0 0 15px rgba(234, 184, 201, 0.4);
}

.garden-door-panel.door-opened {
  transform: rotateY(-85deg);
}

.door-handle {
  position: absolute;
  top: 130px;
  right: 18px;
  width: 14px;
  height: 32px;
  background: #E8CA5C;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: transform 0.3s ease;
}

.door-handle.handle-turn {
  transform: rotate(35deg);
}

.door-prompt-text {
  font-family: var(--font-handwritten);
  font-size: 1.25rem;
  color: var(--color-dusty-mauve);
}

/* ===================================================================
 * SCENE 03: THE BIRTHDAY REVEAL & INTERACTIVE CAKE (FEATURE H)
 * =================================================================== */
#sceneBirthday {
  padding: 100px 24px;
  position: relative;
  background: radial-gradient(circle at 50% 50%, rgba(245, 229, 168, 0.35) 0%, rgba(255, 248, 240, 0) 70%);
}

.birthday-card-main {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(234, 184, 201, 0.45);
  border-radius: var(--radius-lg);
  padding: clamp(40px, 6vw, 72px) clamp(20px, 4vw, 56px);
  text-align: center;
  box-shadow: var(--shadow-card);
  position: relative;
}

.birthday-name-hero {
  font-family: var(--font-serif);
  font-size: clamp(3.5rem, 11vw, 7.5rem);
  font-weight: 600;
  letter-spacing: 6px;
  color: var(--color-dark-brown);
  line-height: 1;
  margin-bottom: 20px;
}

.birthday-subheading {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.2rem, 2.8vw, 1.7rem);
  color: var(--color-dusty-mauve);
  max-width: 680px;
  margin: 0 auto 28px;
}

.birthday-milestone-pill {
  display: inline-block;
  background: linear-gradient(135deg, var(--color-pale-yellow) 0%, var(--color-pastel-pink) 100%);
  color: var(--color-dark-brown);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  padding: 10px 28px;
  border-radius: var(--radius-pill);
  margin-bottom: 32px;
}

/* Interactive 16-Candle Birthday Cake */
.birthday-cake-wrapper {
  margin-top: 48px;
  padding: 36px 20px;
  background: rgba(255, 248, 240, 0.7);
  border-radius: var(--radius-md);
  border: 1px solid rgba(234, 184, 201, 0.4);
}

.cake-stand-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.cake-candles-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 48px;
  margin-bottom: 2px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 360px;
}

.cake-candle {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  position: relative;
}

.candle-flame {
  width: 8px;
  height: 14px;
  background: radial-gradient(circle, #FFF8F0 20%, #E8CA5C 60%, #EAB8C9 100%);
  border-radius: 50% 50% 20% 20%;
  box-shadow: 0 0 10px rgba(232, 202, 92, 0.8);
  animation: flickerFlame 0.8s infinite alternate ease-in-out;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

@keyframes flickerFlame {
  0% { transform: scale(1) rotate(-2deg); }
  100% { transform: scale(1.15) rotate(3deg); }
}

.cake-candle.blown-out .candle-flame {
  opacity: 0;
  transform: scale(0.2) translateY(-6px);
  pointer-events: none;
}

.candle-wick {
  width: 2px;
  height: 4px;
  background: #493C40;
}

.candle-stick {
  width: 6px;
  height: 24px;
  border-radius: 2px;
}

.cake-tier-top {
  width: 220px;
  height: 45px;
  background: #FFF8F0;
  border: 2px solid #EAB8C9;
  border-radius: 12px;
  box-shadow: inset 0 4px 6px rgba(234, 184, 201, 0.3);
}

.cake-tier-base {
  width: 300px;
  height: 60px;
  background: #F6DDE8;
  border: 2px solid #EAB8C9;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(73, 60, 64, 0.1);
}

.cake-wish-card {
  margin-top: 24px;
  padding: 24px;
  background: #FFFFFF;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-daisy-gold);
  display: none;
  animation: fadeInSecret 0.8s ease forwards;
}

.cake-wish-card.revealed {
  display: block;
}

/* ===================================================================
 * SCENE 04: EDITORIAL PHOTO GALLERY & LIGHTBOX (FEATURE B)
 * =================================================================== */
#sceneEditorial {
  padding: 100px 24px;
}

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

.photo-frame {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  padding: 14px 14px 22px;
  box-shadow: var(--shadow-card);
  position: relative;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: 1px solid rgba(246, 221, 232, 0.7);
}

.photo-frame:hover {
  transform: translateY(-6px) rotate(0.6deg);
  box-shadow: var(--shadow-hover);
  border-color: var(--color-blush-rose);
}

.tape-decoration {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 22px;
  background-image: url('../assets/images/tape.svg');
  background-size: contain;
  background-repeat: no-repeat;
  z-index: 5;
}

/* Golden Paperclip for Secret 2 */
.golden-paperclip-secret {
  position: absolute;
  top: 6px;
  right: 12px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  z-index: 10;
  transition: transform 0.3s ease;
  animation: pulseClip 2s infinite ease-in-out;
}

@keyframes pulseClip {
  0%, 100% { transform: rotate(15deg) scale(1); }
  50% { transform: rotate(15deg) scale(1.2); }
}

.photo-inner {
  position: relative;
  width: 100%;
  padding-bottom: 125%;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background-color: var(--color-pastel-pink);
}

.photo-inner img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-overlay {
  position: absolute;
  inset: 0;
  background: rgba(73, 60, 64, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.photo-frame:hover .photo-overlay {
  opacity: 1;
}

.view-tag {
  background: rgba(255, 255, 255, 0.92);
  color: var(--color-dark-brown);
  font-size: 0.8rem;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
}

.editorial-meta {
  padding-top: 14px;
}

.photo-tag {
  font-size: 0.7rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-dusty-mauve);
  font-weight: 600;
}

.photo-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--color-dark-brown);
  margin: 4px 0;
}

.photo-caption {
  font-family: var(--font-handwritten);
  font-size: 1.15rem;
  color: var(--color-dusty-mauve);
}

/* Lightbox Modal Upgraded */
.lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(48, 38, 54, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 3500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.lightbox-modal.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-dialog {
  max-width: 680px;
  width: 100%;
  background: #FFFFFF;
  border-radius: var(--radius-md);
  padding: 28px 24px;
  position: relative;
  text-align: center;
  box-shadow: 0 30px 70px rgba(0,0,0,0.5);
}

.lightbox-img-frame {
  width: 100%;
  max-height: 52vh;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--color-pastel-pink);
  margin-bottom: 16px;
}

.lightbox-img-frame img {
  width: 100%;
  height: 100%;
  max-height: 52vh;
  object-fit: contain;
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--color-blush-rose);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-dark-brown);
  transition: var(--transition-bounce);
  z-index: 10;
}

.lightbox-nav-btn:hover {
  background: var(--color-blush-rose);
  color: #fff;
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev-btn { left: -22px; }
.lightbox-next-btn { right: -22px; }

.lightbox-counter-pill {
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  color: var(--color-dusty-mauve);
  margin-bottom: 6px;
}

/* ===================================================================
 * FEATURE I: THE NICKNAME MACHINE
 * =================================================================== */
#sceneNicknames {
  padding: 80px 24px;
  background: linear-gradient(180deg, var(--color-cream) 0%, rgba(246, 221, 232, 0.3) 100%);
}

.nickname-pills-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.nickname-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--accent-color, #EAB8C9);
  background: #FFFFFF;
  color: var(--color-dark-brown);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-subtle);
  transition: var(--transition-bounce);
}

.nickname-pill-btn:hover,
.nickname-pill-btn.active {
  background: var(--accent-color, #EAB8C9);
  color: #493C40;
  transform: translateY(-3px) scale(1.05);
  box-shadow: var(--shadow-hover);
}

.nickname-display-box {
  max-width: 640px;
  margin: 0 auto;
}

.nickname-card-inner {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  padding: 32px 28px;
  border: 1px solid rgba(234, 184, 201, 0.4);
  border-top: 4px solid var(--color-blush-rose);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.nickname-card-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--color-dark-brown);
  margin: 12px 0 8px;
}

.nickname-card-text {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #55444a;
}

/* ===================================================================
 * SCENE 05: THE LITTLE THINGS I NOTICE
 * =================================================================== */
#sceneLittleThings {
  padding: 100px 24px;
  background: linear-gradient(180deg, var(--color-cream) 0%, rgba(246, 221, 232, 0.25) 50%, var(--color-cream) 100%);
}

.highlight-quote-banner {
  max-width: 820px;
  margin: 0 auto 56px;
  padding: 32px 40px;
  background: #FFFFFF;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--color-blush-rose);
  box-shadow: var(--shadow-subtle);
  text-align: center;
}

.highlight-quote-banner p {
  font-family: var(--font-handwritten);
  font-size: clamp(1.4rem, 3.2vw, 2rem);
  color: var(--color-dark-brown);
}

.things-category-block {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-lg);
  padding: 36px clamp(18px, 4vw, 44px);
  border: 1px solid rgba(234, 184, 201, 0.4);
  box-shadow: var(--shadow-card);
  margin-bottom: 40px;
}

.category-title-header {
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(234, 184, 201, 0.4);
  padding-bottom: 14px;
}

.category-title-header h3 {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  color: var(--color-dark-brown);
}

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

.detail-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  background: rgba(255, 248, 240, 0.6);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(234, 184, 201, 0.3);
  position: relative;
  transition: var(--transition-smooth);
}

.detail-card:hover {
  background: #FFFFFF;
  transform: translateY(-2px);
  border-color: var(--color-blush-rose);
}

/* Secret 3 Bow Trigger */
.secret-bow-trigger {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  animation: pulseBow 2s infinite ease-in-out;
}

/* ===================================================================
 * FEATURE J: SCRATCH-TO-REVEAL CARDS
 * =================================================================== */
#sceneScratchCards {
  padding: 100px 24px;
  background: radial-gradient(circle at 50% 50%, #FFFFFF 0%, var(--color-cream) 100%);
}

.scratch-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 32px;
  max-width: 880px;
  margin: 0 auto;
}

.scratch-card-wrapper {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  border: 1px solid rgba(234, 184, 201, 0.6);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  position: relative;
  height: 230px;
}

.scratch-underlay {
  position: absolute;
  inset: 0;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: #FFF8F0;
  z-index: 1;
}

.scratch-stamp {
  font-size: 0.7rem;
  letter-spacing: 2px;
  color: var(--color-deep-rose);
  font-weight: 700;
  margin-bottom: 8px;
}

.scratch-text {
  font-family: var(--font-handwritten);
  font-size: 1.35rem;
  color: var(--color-dark-brown);
  line-height: 1.45;
}

.scratch-author {
  font-size: 0.82rem;
  color: var(--color-dusty-mauve);
  margin-top: 8px;
}

.scratch-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  cursor: crosshair;
  touch-action: none;
}

.scratch-card-footer {
  position: absolute;
  bottom: 8px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 5;
  pointer-events: auto;
}

.scratch-card-title {
  font-size: 0.72rem;
  color: var(--color-dusty-mauve);
  font-weight: 600;
}

.btn-scratch-shortcut {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--color-blush-rose);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  cursor: pointer;
}

/* ===================================================================
 * SCENE 06: OUR LITTLE UNIVERSE (SCRAPBOOK)
 * =================================================================== */
#sceneUniverse {
  padding: 100px 24px;
}

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

.memory-card {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  padding: 32px 24px 24px;
  box-shadow: var(--shadow-card);
  position: relative;
  border: 1px solid rgba(234, 184, 201, 0.35);
  transition: var(--transition-smooth);
}

.memory-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.scrapbook-tape {
  position: absolute;
  top: -10px;
  left: 24px;
  width: 64px;
  height: 18px;
  border-radius: 2px;
  opacity: 0.85;
}

.secret-wax-stamp-btn {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  margin-left: 8px;
}

/* ===================================================================
 * FEATURE K: PULL THE RIBBON & MOOD SURPRISES
 * =================================================================== */
#sceneInteractiveSurprises {
  padding: 100px 24px;
  background: linear-gradient(180deg, var(--color-cream) 0%, rgba(246, 221, 232, 0.35) 100%);
}

.interactive-duo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 36px;
  max-width: 960px;
  margin: 0 auto;
}

/* Ribbon Note */
.pull-ribbon-card {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  border: 1px solid rgba(234, 184, 201, 0.5);
  box-shadow: var(--shadow-card);
  padding: 32px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.ribbon-closed-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.pink-ribbon-visual {
  width: 90px;
  height: 90px;
  cursor: pointer;
  transition: transform 0.3s ease;
  animation: pulseBow 2.5s infinite ease-in-out;
}

.pink-ribbon-visual:hover {
  transform: scale(1.15) rotate(6deg);
}

.unfolded-note-area {
  display: none;
  animation: fadeInSecret 0.6s ease forwards;
}

.pull-ribbon-card.unwrapped .ribbon-closed-view { display: none; }
.pull-ribbon-card.unwrapped .unfolded-note-area { display: block; }

.unfolded-note-area p {
  font-size: 0.98rem;
  line-height: 1.7;
  color: #493C40;
  margin-bottom: 14px;
}

/* Mood Surprises */
.mood-surprises-card {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  border: 1px solid rgba(234, 184, 201, 0.5);
  box-shadow: var(--shadow-card);
  padding: 32px 24px;
  text-align: center;
}

.mood-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 18px 0;
}

.mood-pill-btn {
  background: #FFF8F0;
  border: 1px solid var(--color-blush-rose);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-bounce);
}

.mood-pill-btn:hover,
.mood-pill-btn.active {
  background: var(--color-blush-rose);
  color: #fff;
  transform: translateY(-2px);
}

.mood-display-card {
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mood-card-inner {
  padding: 16px;
  background: #FFF8F0;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--color-deep-rose);
}

/* ===================================================================
 * SCENE 07: THINGS YOU DO WITHOUT REALISING & KEEPSAKE DRAWER
 * =================================================================== */
#sceneThingsYouDo {
  padding: 100px 24px;
}

.things-card-wrapper {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(234, 184, 201, 0.5);
  box-shadow: var(--shadow-card);
  padding: clamp(32px, 5vw, 60px) clamp(20px, 4vw, 56px);
}

.things-item {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 18px;
  background: rgba(255, 248, 240, 0.7);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--color-blush-rose);
  margin-bottom: 20px;
}

/* Secret 5 Keepsake Drawer */
.keepsake-drawer-box {
  margin-top: 40px;
  padding: 24px;
  background: #FAF0EA;
  border: 2px solid #EAB8C9;
  border-radius: var(--radius-md);
  text-align: center;
  position: relative;
}

.drawer-pull-handle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #E8CA5C;
  color: #493C40;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.drawer-interior {
  display: none;
  margin-top: 18px;
  padding: 18px;
  background: #FFFFFF;
  border-radius: var(--radius-sm);
  animation: fadeInSecret 0.5s ease forwards;
}

.keepsake-drawer-box.drawer-open .drawer-interior {
  display: block;
}

/* ===================================================================
 * FEATURE M: OPTIONAL PHOTO PUZZLE
 * =================================================================== */
#scenePhotoPuzzle {
  padding: 100px 24px;
  background: linear-gradient(180deg, var(--color-cream) 0%, rgba(246, 221, 232, 0.3) 100%);
}

.puzzle-board-wrapper {
  max-width: 340px;
  margin: 0 auto;
  background: #FFFFFF;
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid rgba(234, 184, 201, 0.6);
  box-shadow: var(--shadow-card);
  text-align: center;
  transition: box-shadow 0.8s ease, border-color 0.8s ease;
}

.puzzle-board-wrapper.puzzle-complete {
  border-color: var(--color-blush-rose);
  box-shadow: 0 18px 50px rgba(234, 184, 201, 0.55);
}

.puzzle-board-wrapper [hidden] {
  display: none !important;
}

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

.puzzle-header-buttons {
  display: inline-flex;
  gap: 6px;
}

.puzzle-btn-shortcut {
  background: linear-gradient(135deg, #FFF8F0 0%, #F6DDE8 55%, #EAB8C9 100%);
  color: var(--color-dark-brown);
  border: 1px solid var(--color-blush-rose);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.puzzle-btn-shortcut:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(234, 184, 201, 0.55);
}

/* The board takes the shape of her photo (set inline from content.js) */
.puzzle-grid-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 4px;
  width: 100%;
  aspect-ratio: 1;
  background: #F6DDE8;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: gap 0.7s ease, padding 0.7s ease, background 0.7s ease;
}

.puzzle-tile {
  background-color: #FFF8F0;
  background-repeat: no-repeat;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.15s ease, border-radius 0.7s ease;
}

.puzzle-tile:hover {
  transform: scale(0.97);
}

.puzzle-tile-empty {
  background: rgba(246, 221, 232, 0.4) !important;
  cursor: default;
}

/* Solved: the pieces melt together into one complete photograph */
.puzzle-grid-board.is-solved {
  gap: 0;
  padding: 0;
  background: transparent;
  overflow: hidden;
}

.puzzle-grid-board.is-solved .puzzle-tile {
  border-radius: 0;
  pointer-events: none;
}

.puzzle-grid-board.is-solved .puzzle-tile:hover {
  transform: none;
}

.puzzle-tile-final {
  animation: puzzleFinalPiece 0.9s ease both;
}

@keyframes puzzleFinalPiece {
  from { opacity: 0; filter: brightness(1.4); }
  to   { opacity: 1; filter: brightness(1); }
}

.puzzle-hint-tip {
  font-size: 0.8rem;
  color: var(--color-dusty-mauve);
  margin-top: 12px;
  font-style: italic;
}

.puzzle-success-msg {
  font-family: var(--font-handwritten);
  font-size: 1.2rem;
  line-height: 1.4;
  color: var(--color-dusty-mauve);
  margin-top: 14px;
  animation: puzzleFinalPiece 1s ease 0.4s both;
}

/* ===================================================================
 * SCENE 08: AN OPEN LETTER (3D ENVELOPE)
 * =================================================================== */
#sceneLetter {
  padding: 100px 24px;
  text-align: center;
}

.envelope-3d-box {
  width: min(360px, 100%);
  max-width: 100%;
  height: 240px;
  position: relative;
  cursor: pointer;
  perspective: 800px;
  margin: 0 auto;
}

.envelope-base {
  width: 100%;
  height: 100%;
  background: #FFF8F0;
  border: 1px solid var(--color-blush-rose);
  border-radius: 10px;
  position: relative;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.envelope-flap-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: min(180px, 45vw) solid transparent;
  border-right: min(180px, 45vw) solid transparent;
  border-top: 130px solid #FAF0EA;
  transform-origin: top center;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 4;
}

.envelope-3d-box.opened .envelope-flap-top {
  transform: rotateX(180deg);
  z-index: 1;
}

.wax-seal {
  position: absolute;
  top: 110px;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 54px;
  height: 54px;
  background: radial-gradient(circle, var(--color-deep-rose) 0%, #A96881 100%);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: #FFFFFF;
  z-index: 6;
  cursor: pointer;
}

.letter-modal {
  position: fixed;
  inset: 0;
  background: rgba(73, 60, 64, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.letter-modal.open {
  opacity: 1;
  visibility: visible;
}

.letter-paper {
  background: #FFFFFF;
  width: min(720px, 94vw);
  max-height: 85vh;
  overflow-y: auto;
  border-radius: var(--radius-md);
  padding: clamp(32px, 6vw, 64px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  position: relative;
  border: 1px solid rgba(234, 184, 201, 0.6);
}

.letter-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--color-blush-rose);
  background: var(--color-cream);
  font-size: 18px;
  cursor: pointer;
}

/* ===================================================================
 * FEATURE E: THE BLOOMING WISH GARDEN (12 DAISIES)
 * =================================================================== */
#sceneWishGarden {
  padding: 100px 24px;
  background: linear-gradient(180deg, var(--color-cream) 0%, rgba(212, 225, 206, 0.4) 100%);
}

.wish-garden-counter {
  text-align: center;
  margin-bottom: 32px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--color-dusty-mauve);
}

.wish-garden-soil {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(130px, 100%), 1fr));
  gap: 24px;
  max-width: 960px;
  margin: 0 auto;
}

.garden-daisy-flower {
  background: rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-md);
  padding: 20px 10px;
  text-align: center;
  cursor: pointer;
  border: 1px solid rgba(234, 184, 201, 0.4);
  position: relative;
  transition: var(--transition-bounce);
}

.garden-daisy-flower:hover {
  transform: translateY(-8px) scale(1.05);
  border-color: var(--color-daisy-gold);
  background: #FFFFFF;
}

.flower-head img {
  width: 54px;
  height: 54px;
  transition: transform 0.4s ease;
}

.garden-daisy-flower:hover .flower-head img {
  transform: rotate(20deg) scale(1.15);
}

.flower-theme-tag {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--color-dusty-mauve);
  margin-top: 10px;
}

.flower-ribbon-check {
  display: none;
  position: absolute;
  top: 8px;
  right: 8px;
  color: #E8CA5C;
  font-weight: bold;
}

.garden-daisy-flower.bloomed .flower-ribbon-check {
  display: block;
}

/* ===================================================================
 * FEATURE N: FINAL SURPRISE SUSPENSE
 * =================================================================== */
#sceneSuspenseSurprise {
  padding: 80px 24px;
  text-align: center;
  background: radial-gradient(circle at 50% 50%, #FFFFFF 0%, var(--color-cream) 100%);
}

.suspense-box {
  max-width: 680px;
  margin: 0 auto;
  padding: 44px 28px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(234, 184, 201, 0.5);
}

.suspense-lead {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 3.5vw, 2.2rem);
  color: var(--color-dusty-mauve);
  font-style: italic;
  margin-bottom: 12px;
}

.suspense-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: var(--color-dark-brown);
  margin-bottom: 28px;
}

/* ===================================================================
 * SCENE 12: THE FINAL WORLD & CONSTELLATION (FEATURE F)
 * =================================================================== */
#sceneFinal {
  padding: 120px 24px 100px;
  min-height: 100vh;
  position: relative;
  background: linear-gradient(180deg, var(--color-cream) 0%, #FBE5D6 40%, #F6DDE8 75%, #F5E5A8 100%);
  transition: background 1.5s ease;
}

#sceneFinal.twilight-mode {
  background: linear-gradient(180deg, #302636 0%, #4D3C52 40%, #75556B 75%, #352636 100%);
  color: #FFF8F0;
}

#sceneFinal.twilight-mode .scene-title,
#sceneFinal.twilight-mode .final-message-line,
#sceneFinal.twilight-mode .final-closing-statement {
  color: #FFF8F0;
}

#sceneFinal.twilight-mode .final-card-wrapper {
  background: rgba(48, 38, 54, 0.85);
  border-color: rgba(234, 184, 201, 0.3);
}

/* Memory Constellation Sky (Feature F) */
.constellation-sky-wrapper {
  margin: 48px auto;
  max-width: 800px;
  text-align: center;
}

.constellation-sky {
  width: 100%;
  height: 320px;
  background: radial-gradient(circle at 50% 50%, #302636 0%, #1A141E 100%);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(234, 184, 201, 0.4);
  position: relative;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0,0,0,0.3);
}

.constellation-lines-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.constellation-line {
  fill: none;
  stroke: rgba(245, 229, 168, 0.4);
  stroke-width: 1.5;
  stroke-dasharray: 4, 4;
}

.constellation-star {
  position: absolute;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.constellation-star .star-dot {
  display: block;
  width: 14px;
  height: 14px;
  background: #FFFFFF;
  border-radius: 50%;
  box-shadow: 0 0 10px #FFF8F0, 0 0 20px #E8CA5C;
  pointer-events: none;
  animation: twinkleStar 2s infinite alternate ease-in-out;
}

@keyframes twinkleStar {
  0%   { transform: scale(0.85); opacity: 0.7; }
  100% { transform: scale(1.2);  opacity: 1; }
}

.constellation-star.alpha-star-secret .star-dot {
  background: #F5E5A8;
  box-shadow: 0 0 16px #E8CA5C, 0 0 30px #EAB8C9;
}

.constellation-star:hover .star-dot,
.constellation-star:focus-visible .star-dot {
  transform: scale(1.4);
}

.constellation-star.active .star-dot {
  animation: none;
  transform: scale(1.5);
  opacity: 1;
  box-shadow: 0 0 0 5px rgba(245, 229, 168, 0.35), 0 0 24px #F5E5A8, 0 0 40px #EAB8C9;
}

.constellation-detail-card {
  margin-top: 18px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-daisy-gold);
  display: none;
  color: #493C40;
}

.constellation-detail-card.visible {
  display: block;
}

/* Secret 8 Corner Charm */
.footer-corner-charm {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  opacity: 0.85;
  animation: pulseBow 2s infinite ease-in-out;
}

/* ===================================================================
 * UNIVERSAL MODAL STYLING
 * =================================================================== */
.universal-modal {
  position: fixed;
  inset: 0;
  background: rgba(48, 38, 54, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.universal-modal.open {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 36px clamp(20px, 4vw, 40px);
  max-width: 580px;
  width: 100%;
  position: relative;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(234, 184, 201, 0.6);
  max-height: 85vh;
  overflow-y: auto;
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--color-blush-rose);
  background: var(--color-cream);
  font-size: 16px;
  cursor: pointer;
}

/* Secret modal formatting */
.secret-found-modal,
.hunt-overview-modal,
.bonus-letter-modal {
  text-align: center;
}

.secret-sparkle-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.secret-tag {
  font-size: 0.72rem;
  letter-spacing: 2px;
  font-weight: 700;
  color: var(--color-deep-rose);
}

.secret-title {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  color: var(--color-dark-brown);
  margin: 6px 0;
}

.secret-location {
  font-size: 0.85rem;
  color: var(--color-dusty-mauve);
  font-style: italic;
}

.secret-divider, .bonus-divider {
  width: 50px;
  height: 2px;
  background: var(--color-blush-rose);
  margin: 16px auto;
}

.secret-message {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  line-height: 1.6;
  color: #493C40;
  margin-bottom: 24px;
}

.hunt-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0;
  text-align: left;
}

.hunt-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: #FFF8F0;
  border: 1px solid rgba(234, 184, 201, 0.3);
}

.hunt-item.found {
  border-color: var(--color-blush-rose);
  background: #FFFFFF;
}

.hunt-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-reset-hunt {
  background: none;
  border: none;
  color: var(--color-dusty-mauve);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
}

/* ===================================================================
 * RESPONSIVENESS & REDUCED MOTION
 * =================================================================== */
@media (max-width: 768px) {
  .floating-secrets-badge {
    top: 10px;
    left: 12px;
    padding: 6px 12px;
    font-size: 0.75rem;
  }
  .floating-audio-widget {
    bottom: 14px;
    left: 12px;
    padding: 6px 12px;
  }
  .scroll-top-btn {
    bottom: 14px;
    right: 12px;
  }
  .lightbox-prev-btn { left: 4px; }
  .lightbox-next-btn { right: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }
  #petalCanvas {
    display: none !important;
  }
}


/* A photo that fails to load simply fades out (never use inline visibility: it would override closed modals) */
img.img-missing { opacity: 0; }


/* ---- Finger-friendly tap areas (invisible; the look stays the same) ---- */
.cake-candle::after {
  content: '';
  position: absolute;
  top: -8px; bottom: -4px; left: -6px; right: -6px;
}

.golden-paperclip-secret::after,
.secret-bow-trigger::after,
.footer-corner-charm::after {
  content: '';
  position: absolute;
  inset: -10px;
}

.secret-wax-stamp-btn { position: relative; }
.secret-wax-stamp-btn::after {
  content: '';
  position: absolute;
  inset: -12px;
}

.door-handle::after {
  content: '';
  position: absolute;
  inset: -14px;
}

/* Corner charm sits left of the scroll-up button so the two never overlap */
.footer-corner-charm {
  right: 84px;
}

/* Keep the opened star memory clear of the floating music pill / scroll-up button on phones */
.constellation-detail-card { scroll-margin-bottom: 110px; }
