/* ==========================================================================
   ROMANTIC APOLOGY WEBSITE - DESIGN SYSTEM & STYLES
   Theme: Kawaii Cute Romantic Pastel with Modern Glassmorphism & 3D CSS
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-gradient: radial-gradient(circle at 10% 20%, #ffeaf0 0%, #fff3f5 35%, #fffaf5 70%, #f7eff9 100%);
  --primary-pink: #ff6584;
  --primary-pink-hover: #ff476f;
  --soft-pink: #ffd6e0;
  --cream-white: #fffdfa;
  --paper-cream: #fcf9f2;
  --paper-border: #f0e6d6;
  --paper-line: rgba(220, 205, 185, 0.4);
  --rose-gold: #c98a7c;
  --gold-accent: #d4a373;
  --lavender: #e2d9f3;
  --peach: #ffb5a7;
  --strawberry: #e63946;
  --text-main: #3d3436;
  --text-muted: #7d6e73;
  --text-romantic: #4a2d34;
  
  /* Shadows & Glow */
  --shadow-soft: 0 10px 30px rgba(255, 101, 132, 0.12), 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-elevated: 0 20px 45px rgba(224, 98, 128, 0.2), 0 6px 15px rgba(0, 0, 0, 0.06);
  --shadow-card: 0 15px 35px rgba(61, 52, 54, 0.12), 0 3px 10px rgba(0, 0, 0, 0.04);
  --shadow-book: 0 25px 60px rgba(60, 40, 45, 0.28), 0 5px 15px rgba(0, 0, 0, 0.08);
  --glow-pink: 0 0 25px rgba(255, 101, 132, 0.45);

  /* Typography */
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-cute: 'Gaegu', cursive, sans-serif;
  --font-script: 'Caveat', cursive, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  
  /* Transitions */
  --tr-fast: 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  --tr-medium: 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  --tr-slow: 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

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

html, body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  font-family: var(--font-main);
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.6;
}

/* Ambient Canvas */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
}

/* Floating Controls (Music, Sound, Customization) */
.floating-controls {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  display: flex;
  gap: 0.6rem;
  z-index: 10000;
  pointer-events: auto;
}

.control-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 214, 224, 0.85);
  border-radius: 999px;
  color: var(--text-romantic);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-main);
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  box-shadow: 0 4px 15px rgba(255, 101, 132, 0.12);
  transition: all var(--tr-fast);
}

.control-btn:hover {
  background: #ffffff;
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 20px rgba(255, 101, 132, 0.22);
}

.control-btn.accent {
  background: linear-gradient(135deg, #fff0f3, #ffe3ea);
  border-color: var(--primary-pink);
  color: var(--primary-pink);
}

.music-wave {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.music-wave i {
  width: 2.5px;
  height: 4px;
  background: var(--primary-pink);
  border-radius: 1px;
  transition: height 0.2s ease;
}

.music-playing .music-wave i:nth-child(1) { animation: waveAnim 0.7s infinite alternate ease-in-out; }
.music-playing .music-wave i:nth-child(2) { animation: waveAnim 0.5s infinite alternate ease-in-out 0.2s; }
.music-playing .music-wave i:nth-child(3) { animation: waveAnim 0.8s infinite alternate ease-in-out 0.1s; }
.music-playing .music-wave i:nth-child(4) { animation: waveAnim 0.6s infinite alternate ease-in-out 0.3s; }

@keyframes waveAnim {
  0% { height: 3px; }
  100% { height: 12px; }
}

/* ==========================================================================
   APP SCREENS CONTAINER
   ========================================================================== */
#app {
  position: relative;
  width: 100%;
  min-height: 100vh;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem 1rem;
}

.screen {
  display: none;
  width: 100%;
  max-width: 960px;
  margin: auto;
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ==========================================================================
   STAGE 1: THE MAGICAL WELCOME SCREEN
   ========================================================================== */
#screen-welcome {
  max-width: 1060px;
}

.welcome-stage-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  width: 100%;
  position: relative;
}

.welcome-card-wrapper {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 2px solid rgba(255, 214, 224, 0.75);
  border-radius: 36px;
  box-shadow: var(--shadow-elevated);
  padding: 3rem 2.2rem;
  max-width: 580px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* Mascot Bear Illustration */
.floating-mascot-container {
  position: relative;
  width: 130px;
  height: 120px;
  margin-bottom: 1rem;
}

.mascot-bounce {
  position: relative;
  width: 100%;
  height: 100%;
  animation: floatBounce 3s ease-in-out infinite;
}

@keyframes floatBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-10px) scale(1.02); }
}

.mascot-bear {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto;
}

.bear-ear {
  position: absolute;
  top: 5px;
  width: 28px;
  height: 28px;
  background: #ffc2cd;
  border-radius: 50%;
  border: 3px solid #ff9ebb;
}
.bear-ear.left { left: 8px; }
.bear-ear.right { right: 8px; }

.bear-head {
  position: absolute;
  top: 15px;
  left: 5px;
  width: 90px;
  height: 80px;
  background: #ffd6df;
  border-radius: 50% 50% 46% 46%;
  box-shadow: inset 0 -4px 8px rgba(255, 140, 166, 0.25);
}

.bear-eye {
  position: absolute;
  top: 30px;
  width: 11px;
  height: 12px;
  background: #3d2328;
  border-radius: 50%;
}
.bear-eye.left { left: 24px; }
.bear-eye.right { right: 24px; }

.eye-shine {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 4px;
  height: 4px;
  background: #ffffff;
  border-radius: 50%;
}

.bear-blush {
  position: absolute;
  top: 42px;
  width: 16px;
  height: 9px;
  background: #ff7f9d;
  border-radius: 50%;
  opacity: 0.75;
  animation: blushPulse 2s infinite alternate;
}
.bear-blush.left { left: 14px; }
.bear-blush.right { right: 14px; }

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

.bear-snout {
  position: absolute;
  top: 36px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 20px;
  background: #ffffff;
  border-radius: 50%;
}

.bear-nose {
  width: 8px;
  height: 6px;
  background: #4a2831;
  border-radius: 4px;
  margin: 3px auto 1px;
}

.bear-mouth {
  width: 8px;
  height: 4px;
  border-bottom: 2px solid #4a2831;
  border-radius: 0 0 5px 5px;
  margin: 0 auto;
}

.bear-body {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 35px;
}

.bear-hand {
  position: absolute;
  top: -5px;
  width: 20px;
  height: 20px;
  background: #ffb8c7;
  border-radius: 50%;
  z-index: 2;
}
.bear-hand.left { left: 8px; }
.bear-hand.right { right: 8px; }

.bear-held-heart {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.8rem;
  z-index: 3;
  animation: heartThrob 1.2s infinite ease-in-out;
}

@keyframes heartThrob {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.22); }
}

/* Floating sparkles around mascot */
.floating-sparkle {
  position: absolute;
  pointer-events: none;
  animation: sparkleTwinkle 2s infinite alternate ease-in-out;
}
.sp-1 { top: -5px; left: -10px; font-size: 1.2rem; animation-delay: 0.2s; }
.sp-2 { top: 10px; right: -15px; font-size: 1.3rem; animation-delay: 0.8s; }
.sp-3 { bottom: 15px; left: -15px; font-size: 1.1rem; animation-delay: 0.5s; }
.sp-4 { bottom: -5px; right: -5px; font-size: 1.2rem; animation-delay: 1.1s; }

@keyframes sparkleTwinkle {
  0% { transform: scale(0.7) rotate(0deg); opacity: 0.5; }
  100% { transform: scale(1.2) rotate(15deg); opacity: 1; }
}

/* Welcome Typography */
.welcome-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff0f3;
  color: var(--primary-pink);
  padding: 0.35rem 0.95rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
  border: 1px solid rgba(255, 101, 132, 0.25);
}

.badge-dot {
  width: 7px;
  height: 7px;
  background: var(--primary-pink);
  border-radius: 50%;
  animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.welcome-title {
  font-size: 2.3rem;
  font-weight: 800;
  color: var(--text-romantic);
  margin-bottom: 0.6rem;
  line-height: 1.2;
}

.highlight-name {
  color: var(--primary-pink);
  position: relative;
  display: inline-block;
  font-family: var(--font-script);
  font-size: 2.8rem;
  font-weight: 700;
}

.welcome-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 440px;
  margin: 0 auto 1.5rem;
  font-weight: 400;
}

/* ==========================================================================
   AUTOMATIC BLOOMING LILIES (Left & Right Flank Botanical Animation)
   ========================================================================== */

.welcome-flank-lily {
  flex: 0 0 170px;
  width: 170px;
  height: 350px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  pointer-events: none;
  user-select: none;
  z-index: 2;
  filter: drop-shadow(0 10px 22px rgba(255, 107, 139, 0.22));
}

.welcome-flank-lily .flank-lily-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Mirror the right flank lily so both gracefully bow & curve towards the center card */
.welcome-flank-lily.flank-right .flank-lily-svg {
  transform: scaleX(-1);
}

/* Organic botanical breeze sway */
.welcome-flank-lily.flank-left {
  animation: lilyStemSwayLeft 7.2s ease-in-out infinite;
  transform-origin: 50% 95%;
}

.welcome-flank-lily.flank-right {
  animation: lilyStemSwayRight 7.2s ease-in-out infinite;
  transform-origin: 50% 95%;
}

@keyframes lilyStemSwayLeft {
  0%, 100% {
    transform: rotate(0deg) translateY(0);
  }
  30% {
    transform: rotate(2.5deg) translateY(-3px);
  }
  70% {
    transform: rotate(-1.5deg) translateY(2px);
  }
}

@keyframes lilyStemSwayRight {
  0%, 100% {
    transform: rotate(0deg) translateY(0);
  }
  30% {
    transform: rotate(-2.5deg) translateY(-3px);
  }
  70% {
    transform: rotate(1.5deg) translateY(2px);
  }
}

/* Botanical Petals Base Setup */
.flank-lily-svg .petal-item {
  transform-origin: 100px 110px;
  transform-box: view-box;
  will-change: transform;
}

/* Left Flank Lily: Normal Cycle Timing (8.4s) */
.welcome-flank-lily.flank-left .petal-item,
.welcome-flank-lily.flank-left .lily-stamens-group,
.welcome-flank-lily.flank-left .lily-bloom-glow,
.welcome-flank-lily.flank-left .lily-bloom-sparkles {
  animation-duration: 8.4s;
  animation-iteration-count: infinite;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Right Flank Lily: 4.2s Offset (Alternating Bloom Waltz) */
.welcome-flank-lily.flank-right .petal-item,
.welcome-flank-lily.flank-right .lily-stamens-group,
.welcome-flank-lily.flank-right .lily-bloom-glow,
.welcome-flank-lily.flank-right .lily-bloom-sparkles {
  animation-duration: 8.4s;
  animation-delay: -4.2s;
  animation-iteration-count: infinite;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Individual Petal Bloom Animations */
.p-outer-1 { animation-name: lilyBloomOuter1; }
.p-outer-2 { animation-name: lilyBloomOuter2; }
.p-outer-3 { animation-name: lilyBloomOuter3; }

.p-inner-1 { animation-name: lilyBloomInner1; }
.p-inner-2 { animation-name: lilyBloomInner2; }
.p-inner-3 { animation-name: lilyBloomInner3; }

.lily-stamens-group {
  transform-origin: 100px 110px;
  transform-box: view-box;
  animation-name: lilyBloomStamens;
  will-change: transform, opacity;
}

.lily-bloom-glow {
  transform-origin: 100px 110px;
  transform-box: view-box;
  animation-name: lilyBloomGlow;
  will-change: transform, opacity;
}

.lily-bloom-sparkles {
  transform-origin: 100px 70px;
  transform-box: view-box;
  animation-name: lilyBloomSparkles;
  will-change: opacity, transform;
}

.sp-dot:nth-child(1) { animation: spDotPulse 2.8s ease-in-out infinite; }
.sp-dot:nth-child(2) { animation: spDotPulse 2.8s ease-in-out infinite 0.9s; }
.sp-dot:nth-child(3) { animation: spDotPulse 2.8s ease-in-out infinite 1.8s; }

@keyframes spDotPulse {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.3); }
}

/* --- KEYFRAMES: OUTER PETALS --- */

/* Outer Petal 1: Top Petal */
@keyframes lilyBloomOuter1 {
  0%, 12%, 88%, 100% {
    transform: rotate(-2deg) scale(0.72, 0.94);
  }
  42%, 70% {
    transform: rotate(0deg) scale(1.05, 1.02);
  }
  56% {
    transform: rotate(0deg) scale(1.09, 1.05);
  }
}

/* Outer Petal 2: Lower-Right Petal */
@keyframes lilyBloomOuter2 {
  0%, 12%, 88%, 100% {
    transform: rotate(4deg) scale(0.68, 0.90);
  }
  42%, 70% {
    transform: rotate(120deg) scale(1.04, 1.02);
  }
  56% {
    transform: rotate(122deg) scale(1.08, 1.05);
  }
}

/* Outer Petal 3: Lower-Left Petal */
@keyframes lilyBloomOuter3 {
  0%, 12%, 88%, 100% {
    transform: rotate(-5deg) scale(0.68, 0.90);
  }
  42%, 70% {
    transform: rotate(-120deg) scale(1.04, 1.02);
  }
  56% {
    transform: rotate(-122deg) scale(1.08, 1.05);
  }
}

/* --- KEYFRAMES: INNER PETALS --- */

/* Inner Petal 1: Upper-Right Petal */
@keyframes lilyBloomInner1 {
  0%, 12%, 88%, 100% {
    transform: rotate(2deg) scale(0.62, 0.86);
  }
  42%, 70% {
    transform: rotate(60deg) scale(0.98, 0.98);
  }
  56% {
    transform: rotate(61deg) scale(1.02, 1.02);
  }
}

/* Inner Petal 2: Bottom-Center Petal */
@keyframes lilyBloomInner2 {
  0%, 12%, 88%, 100% {
    transform: rotate(0deg) scale(0.60, 0.84);
  }
  42%, 70% {
    transform: rotate(180deg) scale(0.98, 0.98);
  }
  56% {
    transform: rotate(180deg) scale(1.02, 1.02);
  }
}

/* Inner Petal 3: Upper-Left Petal */
@keyframes lilyBloomInner3 {
  0%, 12%, 88%, 100% {
    transform: rotate(-3deg) scale(0.62, 0.86);
  }
  42%, 70% {
    transform: rotate(-60deg) scale(0.98, 0.98);
  }
  56% {
    transform: rotate(-61deg) scale(1.02, 1.02);
  }
}

/* --- KEYFRAMES: STAMENS & POLLEN --- */
@keyframes lilyBloomStamens {
  0%, 12%, 88%, 100% {
    transform: scale(0.12);
    opacity: 0;
  }
  24% {
    opacity: 0.3;
  }
  42%, 70% {
    transform: scale(1);
    opacity: 1;
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.6));
  }
  56% {
    transform: scale(1.06);
    opacity: 1;
    filter: drop-shadow(0 0 9px rgba(255, 215, 0, 0.9));
  }
}

/* --- KEYFRAMES: GOLDEN AURA GLOW --- */
@keyframes lilyBloomGlow {
  0%, 12%, 88%, 100% {
    transform: scale(0.2);
    opacity: 0.08;
  }
  42%, 70% {
    transform: scale(1.2);
    opacity: 0.85;
  }
  56% {
    transform: scale(1.35);
    opacity: 0.98;
  }
}

/* --- KEYFRAMES: SPARKLES --- */
@keyframes lilyBloomSparkles {
  0%, 12%, 88%, 100% {
    opacity: 0;
    transform: scale(0.3);
  }
  42%, 70% {
    opacity: 1;
    transform: scale(1);
  }
  56% {
    opacity: 1;
    transform: scale(1.15);
  }
}

/* Responsive adjustment for flank lilies */
@media (max-width: 960px) {
  .welcome-stage-container {
    gap: 0.8rem;
  }
  .welcome-flank-lily {
    flex: 0 0 130px;
    width: 130px;
    height: 300px;
  }
}

@media (max-width: 768px) {
  .welcome-stage-container {
    position: relative;
    width: 100%;
    justify-content: center;
  }
  .welcome-card-wrapper {
    position: relative;
    z-index: 2;
    width: 100%;
  }
  .welcome-flank-lily {
    position: absolute;
    bottom: -15px;
    width: 105px;
    height: 240px;
    opacity: 0.72;
    z-index: 1;
    pointer-events: none;
  }
  .welcome-flank-lily.flank-left {
    left: -20px;
  }
  .welcome-flank-lily.flank-right {
    right: -20px;
  }
}

/* ==========================================================================
   BOOK MINI LILY (Chapter III Promises page)
   ========================================================================== */
.book-mini-lily-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  background: rgba(255, 240, 245, 0.5);
  border: 1px dashed #ffccd8;
  border-radius: 12px;
  padding: 0.5rem 0.8rem;
  margin: 0.6rem 0;
  cursor: pointer;
  transition: background 0.3s ease;
}

.book-mini-lily-wrapper:hover {
  background: rgba(255, 235, 242, 0.8);
}

.b-lily-flower {
  position: relative;
  width: 32px;
  height: 32px;
  transform-style: preserve-3d;
}

.b-petal {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 22px;
  margin-top: -20px;
  margin-left: -5px;
  transform-origin: 50% 90%;
  border-radius: 50% 50% 20% 20%;
  background: linear-gradient(180deg, #ffffff 0%, #ff809b 60%, #d83a73 100%);
  transform: rotateZ(var(--angle)) scale(0.65);
  transition: transform 0.9s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.b-lily-flower.is-bloomed .b-petal {
  transform: rotateZ(var(--angle)) scale(1.1) translateY(-2px);
}

.b-center-stamen {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  background: #ffd166;
  border-radius: 50%;
  box-shadow: 0 0 6px #ffa200;
}

.book-lily-caption {
  font-family: var(--font-cute);
  font-size: 1rem;
  color: var(--primary-pink);
  font-weight: 700;
}

/* Cute Interactive 3D Envelope */
.envelope-container {
  width: 220px;
  height: 150px;
  margin: 0.5rem auto 2rem;
  cursor: pointer;
  perspective: 800px;
}

.envelope {
  position: relative;
  width: 100%;
  height: 100%;
  background: #ffe3ea;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(255, 101, 132, 0.18);
  border: 2px solid #ffccd8;
  overflow: visible;
  transition: transform var(--tr-medium);
}

.envelope:hover {
  transform: translateY(-6px) scale(1.03);
}

.envelope-pocket {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 108px 85px 108px;
  border-color: transparent transparent #ffd0dc transparent;
  border-radius: 0 0 12px 12px;
  z-index: 3;
}

.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 75px 108px 0 108px;
  border-color: #ffb8c9 transparent transparent transparent;
  transform-origin: top center;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 4;
}

.envelope:hover .envelope-flap {
  transform: rotateX(170deg);
  z-index: 1;
}

.envelope-letter-preview {
  position: absolute;
  top: 15px;
  left: 15px;
  right: 15px;
  height: 95px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.5rem;
  font-family: var(--font-cute);
  font-size: 1.15rem;
  color: var(--text-romantic);
  font-weight: 700;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.envelope:hover .envelope-letter-preview {
  transform: translateY(-40px);
}

.letter-stamp {
  font-size: 1.5rem;
  margin-bottom: 2px;
}

.envelope-seal {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  background: var(--primary-pink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  box-shadow: 0 3px 10px rgba(255, 71, 111, 0.35);
  z-index: 5;
  transition: opacity 0.4s ease;
}

.envelope:hover .envelope-seal {
  opacity: 0;
}

/* Primary Button Styling */
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: linear-gradient(135deg, #ff758c 0%, #ff5e62 100%);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 0.95rem 2.4rem;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-main);
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(255, 94, 98, 0.35);
  transition: all var(--tr-fast);
}

.primary-btn:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 12px 30px rgba(255, 94, 98, 0.45);
}

.primary-btn:active {
  transform: translateY(1px) scale(0.98);
}

.primary-btn.pulse-glow {
  animation: pulseGlowBtn 2.2s infinite;
}

@keyframes pulseGlowBtn {
  0%, 100% {
    box-shadow: 0 8px 24px rgba(255, 94, 98, 0.35);
  }
  50% {
    box-shadow: 0 10px 35px rgba(255, 94, 98, 0.6), 0 0 20px rgba(255, 138, 160, 0.4);
  }
}

.secondary-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-romantic);
  border: 1.5px solid var(--soft-pink);
  border-radius: 999px;
  padding: 0.85rem 1.8rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-main);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  transition: all var(--tr-fast);
}

.secondary-btn:hover:not(:disabled) {
  background: #ffffff;
  border-color: var(--primary-pink);
  color: var(--primary-pink);
  transform: translateY(-2px);
}

.secondary-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.text-link-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-family: var(--font-main);
  text-decoration: underline;
  cursor: pointer;
  transition: color var(--tr-fast);
}

.text-link-btn:hover {
  color: var(--primary-pink);
}

.welcome-hint {
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==========================================================================
   STAGE 2: THE APPRECIATION CARDS JOURNEY
   ========================================================================== */
#screen-cards {
  max-width: 680px;
}

.cards-header {
  width: 100%;
  text-align: center;
  margin-bottom: 1.5rem;
}

/* Romantic Stepper Progress Bar */
.progress-container {
  position: relative;
  width: 100%;
  max-width: 440px;
  margin: 0 auto 1.2rem;
  padding: 0.5rem 0;
}

.progress-bar-track {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 6px;
  background: #ffe3ea;
  border-radius: 999px;
  transform: translateY(-50%);
  z-index: 1;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff9ebb, #ff6584);
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-stepper {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
}

.step-dot {
  width: 24px;
  height: 24px;
  background: white;
  border: 2px solid #ffccd8;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--primary-pink);
  font-weight: 700;
  transition: all var(--tr-fast);
  cursor: pointer;
}

.step-dot.active {
  background: var(--primary-pink);
  color: white;
  border-color: var(--primary-pink);
  transform: scale(1.25);
  box-shadow: 0 0 12px rgba(255, 101, 132, 0.5);
}

.step-dot.completed {
  background: #ffccd8;
  border-color: var(--primary-pink);
  color: var(--text-romantic);
}

.journey-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.counter-badge {
  background: #fff0f3;
  color: var(--primary-pink);
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.journey-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-romantic);
}

/* The Polaroid Card */
.card-stage {
  perspective: 1200px;
  width: 100%;
  display: flex;
  justify-content: center;
  min-height: 480px;
  margin-bottom: 1.5rem;
}

.polaroid-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  padding: 1.25rem 1.25rem 1.8rem;
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(235, 220, 225, 0.8);
  transition: transform 0.4s ease, opacity 0.3s ease;
  transform-style: preserve-3d;
  will-change: transform;
}

.polaroid-card.animating-out-left {
  animation: slideOutLeft 0.35s forwards cubic-bezier(0.4, 0, 1, 1);
}

.polaroid-card.animating-out-right {
  animation: slideOutRight 0.35s forwards cubic-bezier(0.4, 0, 1, 1);
}

.polaroid-card.animating-in {
  animation: slideInPop 0.45s forwards cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideOutLeft {
  0% { transform: translateX(0) rotate(0deg) scale(1); opacity: 1; }
  100% { transform: translateX(-80px) rotate(-10deg) scale(0.9); opacity: 0; }
}

@keyframes slideOutRight {
  0% { transform: translateX(0) rotate(0deg) scale(1); opacity: 1; }
  100% { transform: translateX(80px) rotate(10deg) scale(0.9); opacity: 0; }
}

@keyframes slideInPop {
  0% { transform: scale(0.85) translateY(30px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Washi Tape Effect */
.washi-tape {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 26px;
  background: rgba(255, 192, 203, 0.7);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  border-left: 2px dashed rgba(255, 255, 255, 0.5);
  border-right: 2px dashed rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(2px);
  z-index: 10;
}

.card-badge-sticker {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: #fff0f5;
  color: var(--primary-pink);
  font-family: var(--font-cute);
  font-size: 1.15rem;
  font-weight: 700;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px dashed var(--primary-pink);
  transform: rotate(5deg);
  z-index: 5;
}

/* Photo Frame inside Polaroid */
.polaroid-photo-frame {
  position: relative;
  width: 100%;
  height: 290px;
  border-radius: 12px;
  overflow: hidden;
  background: #fdf5f7;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.06);
}

.polaroid-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
  display: block;
}

.polaroid-card:hover .polaroid-photo-frame img {
  transform: scale(1.04);
}

/* Photo light shimmer */
.photo-shimmer {
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: skewX(-25deg);
  pointer-events: none;
  animation: photoShimmerAnim 6s infinite ease-in-out;
}

@keyframes photoShimmerAnim {
  0%, 75% { left: -100%; }
  100% { left: 180%; }
}

/* Floating Love Reaction Button on Photo */
.love-reaction-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.92);
  border: none;
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary-pink);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: transform var(--tr-fast);
  z-index: 6;
}

.love-reaction-btn:hover {
  transform: scale(1.12);
}

.love-reaction-btn:active {
  transform: scale(0.92);
}

/* Caption Section */
.polaroid-caption-area {
  padding-top: 1.2rem;
  text-align: center;
}

.card-caption-title {
  font-family: var(--font-script);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--text-romantic);
  line-height: 1.1;
  margin-bottom: 0.4rem;
}

.card-caption-text {
  font-size: 1.02rem;
  color: var(--text-main);
  line-height: 1.5;
  margin-bottom: 0.8rem;
  min-height: 50px;
}

.card-tagline {
  font-family: var(--font-cute);
  font-size: 1.1rem;
  color: var(--primary-pink);
  font-weight: 700;
}

/* Floating Heart Spawned by Reaction */
.floating-heart-particle {
  position: absolute;
  pointer-events: none;
  font-size: 1.5rem;
  z-index: 99;
  animation: floatHeartUp 1.2s forwards cubic-bezier(0.2, 0.8, 0.3, 1);
}

@keyframes floatHeartUp {
  0% { transform: translateY(0) scale(0.6); opacity: 1; }
  100% { transform: translateY(-80px) scale(1.4) rotate(15deg); opacity: 0; }
}

/* Card Navigation */
.cards-nav {
  display: flex;
  gap: 1rem;
  width: 100%;
  max-width: 420px;
  justify-content: space-between;
}

.card-skip-hint {
  margin-top: 1rem;
}

/* ==========================================================================
   STAGE 3: THE 3D FLIPPING APOLOGY BOOK
   ========================================================================== */
#screen-book {
  max-width: 920px;
}

.book-header {
  text-align: center;
  margin-bottom: 1.8rem;
}

.cute-pill-tag {
  display: inline-block;
  background: #fff0f3;
  color: var(--primary-pink);
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.book-main-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--text-romantic);
}

.book-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* 3D BOOK STAGE & WRAPPER */
.book-perspective-wrapper {
  perspective: 2200px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem 0 2rem;
}

/* The Book itself is a 2-page spread container */
.book {
  position: relative;
  width: 720px;
  height: 480px;
  transition: transform 0.6s ease;
  transform-style: preserve-3d;
  box-shadow: var(--shadow-book);
  border-radius: 8px 18px 18px 8px;
}

/* When on cover (sheet 1 closed), center the book aesthetically */
.book.state-closed-front {
  transform: translateX(-25%);
}

.book.state-open {
  transform: translateX(0%);
}

.book.state-closed-back {
  transform: translateX(25%);
}

/* Each Sheet is a physical leaf of the book */
.sheet {
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform 0.9s cubic-bezier(0.25, 1, 0.4, 1);
  cursor: pointer;
}

.sheet.flipped {
  transform: rotateY(-180deg);
}

/* Pages: Front & Back Faces */
.page {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  box-sizing: border-box;
}

.face-front {
  z-index: 2;
  transform: rotateY(0deg);
}

.face-back {
  z-index: 1;
  transform: rotateY(180deg);
}

/* Cover Styling */
.cover-page {
  background: linear-gradient(135deg, #e7738b 0%, #d85773 100%);
  color: #fff9fa;
  border-radius: 0 16px 16px 0;
  box-shadow: inset 5px 0 15px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cover-page.back-cover {
  border-radius: 16px 0 0 16px;
  background: linear-gradient(135deg, #d85773 0%, #c44360 100%);
  box-shadow: inset -5px 0 15px rgba(0, 0, 0, 0.25);
}

.cover-emboss-border {
  position: relative;
  width: 88%;
  height: 90%;
  border: 2px solid rgba(255, 230, 235, 0.7);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.15);
}

.cover-stamp {
  font-size: 3.5rem;
  margin-bottom: 0.8rem;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
  animation: heartThrob 2s infinite ease-in-out;
}

.cover-title {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.25;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cover-subtitle {
  font-family: var(--font-cute);
  font-size: 1.5rem;
  opacity: 0.95;
}

.cover-subtitle .highlight-name {
  color: #fff1b8;
  font-size: 1.9rem;
}

.cover-divider {
  display: flex;
  gap: 0.6rem;
  color: rgba(255, 240, 245, 0.85);
  font-size: 0.9rem;
  margin: 1rem 0;
}

.cover-instruction {
  font-size: 0.82rem;
  opacity: 0.85;
  background: rgba(255, 255, 255, 0.18);
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
}

.back-cover-stamp {
  text-align: center;
  color: #fff0f3;
  font-family: var(--font-script);
  font-size: 1.5rem;
}

.back-cover-stamp span {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

/* Paper Page Styling */
.page-paper {
  background: var(--paper-cream);
  color: var(--text-romantic);
  box-shadow: inset 10px 0 20px rgba(0, 0, 0, 0.04);
}

/* Left page in spread (when face-back is showing on the left) */
.face-back.page-paper {
  border-radius: 12px 0 0 12px;
  box-shadow: inset -10px 0 20px rgba(0, 0, 0, 0.04);
}

/* Right page in spread (when face-front is showing on the right) */
.face-front.page-paper {
  border-radius: 0 12px 12px 0;
  box-shadow: inset 10px 0 20px rgba(0, 0, 0, 0.04);
}

.paper-texture {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 50% 50%, rgba(240, 230, 215, 0.2) 0%, transparent 80%),
    repeating-linear-gradient(transparent, transparent 27px, var(--paper-line) 28px);
  pointer-events: none;
  opacity: 0.65;
}

.page-inner {
  position: relative;
  height: 100%;
  padding: 2.2rem 2rem 1.8rem;
  display: flex;
  flex-direction: column;
  z-index: 2;
  overflow-y: auto;
}

.page-inner.center-content {
  align-items: center;
  justify-content: center;
  text-align: center;
}

.page-header-mark {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-pink);
  margin-bottom: 0.6rem;
}

.page-heading {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  color: var(--text-romantic);
  margin-bottom: 1rem;
  line-height: 1.25;
}

.handwritten-body {
  font-family: var(--font-script);
  font-size: 1.35rem;
  line-height: 1.6;
  color: #3b282c;
  flex: 1;
}

.handwritten-body p {
  margin-bottom: 0.8rem;
}

.page-footer-mark {
  margin-top: auto;
  text-align: center;
  font-size: 0.85rem;
  color: var(--rose-gold);
  font-family: var(--font-serif);
}

/* Cute Illustrated Box inside Page 2 */
.cute-illustrated-box {
  background: rgba(255, 240, 245, 0.6);
  border: 1px dashed #ffb8c9;
  border-radius: 12px;
  padding: 0.45rem 0.6rem;
  margin: 0.5rem 0;
  display: flex;
  justify-content: center;
}

.mini-cute-polaroid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  background: white;
  padding: 0.35rem 0.35rem 0.5rem;
  border-radius: 8px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
  font-family: var(--font-cute);
  font-size: 0.9rem;
  color: var(--text-romantic);
}

.mini-cute-polaroid img {
  width: 130px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
}

.sub-thought {
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--text-romantic);
}

/* Promises list on Page 3 */
.promises-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.promise-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.7);
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  font-size: 0.88rem;
  border-left: 3px solid var(--primary-pink);
}

.promise-item input {
  display: none;
}

.promise-check {
  color: var(--primary-pink);
  font-weight: 800;
  font-size: 0.95rem;
}

.forgiveness-box {
  background: #fff3f6;
  border: 2px dashed #ff9ebb;
  border-radius: 14px;
  padding: 1.1rem;
  text-align: center;
  margin-top: 0.4rem;
}

.forgive-question {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--text-romantic);
  margin-bottom: 0.8rem;
}

.decision-buttons {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.8rem;
  min-height: 52px;
}

.forgive-yes-btn {
  background: linear-gradient(135deg, #ff6584, #ff3366);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-main);
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 51, 102, 0.35);
  transition: all var(--tr-fast);
  z-index: 5;
}

.forgive-yes-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(255, 51, 102, 0.5);
}

/* The Playful Runaway "No" Button! */
.forgive-no-btn {
  background: #ffffff;
  color: #7d6e73;
  border: 1.5px solid #ffccd8;
  border-radius: 999px;
  padding: 0.65rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-main);
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
  user-select: none;
}

/* Page 4: Final Love Note */
.heart-wreath {
  font-size: 1.7rem;
  margin-bottom: 0.3rem;
}

.final-love-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0.5rem 0 1rem;
  padding: 0.8rem 1rem;
  background: rgba(255, 245, 248, 0.65);
  border: 1px dashed rgba(255, 107, 138, 0.4);
  border-radius: 12px;
  max-width: 92%;
  box-shadow: 0 2px 10px rgba(255, 107, 138, 0.06);
}

.final-highlight-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary-pink);
  line-height: 1.45;
  margin: 0 0 0.5rem 0;
  text-align: center;
}

.final-love-words {
  font-family: var(--font-script);
  font-size: 1.4rem;
  color: var(--text-romantic);
  line-height: 1.4;
  margin: 0;
  text-align: center;
}

.cute-signature-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-cute);
  font-size: 1.25rem;
  margin-top: 0.2rem;
}

.signature-date {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.signature-name {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--primary-pink);
}

/* Book Controls Bar */
.book-controls-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
}

.page-indicator {
  font-family: var(--font-cute);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-romantic);
  background: rgba(255, 255, 255, 0.85);
  padding: 0.3rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--soft-pink);
}

/* Fold glow during animation */
.page-fold-glow {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 25px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.08), transparent);
  pointer-events: none;
}

/* ==========================================================================
   MODALS (Celebration & Customizer)
   ========================================================================== */
.modal-dialog {
  border: none;
  background: transparent;
  padding: 0;
  margin: auto;
  border-radius: 28px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
  z-index: 100000;
}

.modal-dialog:not([open]):not(.is-open) {
  display: none !important;
}

.modal-dialog::backdrop {
  background: rgba(45, 25, 35, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-dialog[open],
.modal-dialog.is-open {
  display: flex !important;
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(45, 25, 35, 0.55) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  z-index: 100000 !important;
  overflow-y: auto !important;
  padding: 1rem !important;
  box-sizing: border-box !important;
}

.modal-dialog[open] .modal-card,
.modal-dialog.is-open .modal-card {
  max-width: 540px;
  width: 100%;
  margin: auto;
  animation: modalPopIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPopIn {
  0% { transform: scale(0.88); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.modal-card {
  background: #ffffff;
  border-radius: 28px;
  padding: 2.2rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
}

/* Celebration Modal Specifics */
.celebration-card {
  text-align: center;
  border: 3px solid #ffccd8;
  background: radial-gradient(circle at 50% 10%, #fff0f5 0%, #ffffff 80%);
}

.celebration-mascot {
  margin-bottom: 0.8rem;
}

.teddy-happy {
  position: relative;
  display: inline-block;
  font-size: 3.5rem;
  animation: teddyDance 0.8s infinite alternate ease-in-out;
}

@keyframes teddyDance {
  0% { transform: translateY(0) rotate(-6deg); }
  100% { transform: translateY(-12px) rotate(6deg); }
}

.flying-hearts {
  position: absolute;
  top: -10px;
  right: -25px;
  font-size: 1.5rem;
}

.celebration-title {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  color: var(--primary-pink);
  margin-bottom: 0.6rem;
}

.celebration-msg {
  color: var(--text-main);
  font-size: 1rem;
  margin-bottom: 1.2rem;
}

.hug-coupon {
  margin: 1.2rem 0;
}

.coupon-border {
  border: 2px dashed #ff758c;
  background: #fff5f7;
  border-radius: 14px;
  padding: 0.9rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.coupon-title {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  font-weight: 800;
  color: var(--rose-gold);
}

.coupon-val {
  font-family: var(--font-cute);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-pink);
}

.coupon-validity {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.celebration-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1.2rem;
}

/* Customizer Modal Form */
.customizer-card {
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.modal-header h3 {
  font-size: 1.35rem;
  color: var(--text-romantic);
}

.close-x-btn {
  background: #f5edf0;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  color: var(--text-muted);
}

.customizer-body {
  overflow-y: auto;
  padding-right: 0.5rem;
}

.customizer-intro {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-group {
  margin-bottom: 1rem;
  flex: 1;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-romantic);
  margin-bottom: 0.35rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid #ffccd8;
  border-radius: 10px;
  font-family: var(--font-main);
  font-size: 0.95rem;
  background: #fffdfd;
  color: var(--text-main);
  outline: none;
  transition: border-color var(--tr-fast);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary-pink);
  box-shadow: 0 0 0 3px rgba(255, 101, 132, 0.15);
}

.card-edit-item {
  background: #fff5f7;
  border: 1px solid #ffd0dc;
  border-radius: 12px;
  padding: 0.8rem;
  margin-bottom: 0.8rem;
}

.card-edit-item-header {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-pink);
  margin-bottom: 0.4rem;
}

.music-customize-box {
  background: #fff5f7;
  border: 1px dashed var(--primary-pink);
  border-radius: 12px;
  padding: 0.9rem;
  margin-top: 0.8rem;
}

.music-current-badge {
  display: inline-block;
  background: #ffffff;
  color: var(--primary-pink);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(255, 101, 132, 0.15);
}

/* JSON Storage Info Banner */
.json-storage-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  background: linear-gradient(135deg, #fff2f5, #ffeaf0);
  border: 1.5px solid #ffccd8;
  border-radius: 12px;
  padding: 0.75rem 0.95rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 6px rgba(255, 101, 132, 0.08);
}

.json-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.json-banner-text {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-romantic);
}

.json-banner-text code {
  background: white;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  color: var(--primary-pink);
  font-weight: 700;
  border: 1px solid #ffccd8;
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid #f0e0e5;
}

.modal-footer-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
}

/* Toast notification popup */
.toast-notification {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(45, 25, 35, 0.92);
  color: white;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

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

.destructive {
  color: #c94444;
}

/* ==========================================================================
   RESPONSIVE DESIGN (Tablets & Mobile Phones)
   ========================================================================== */
@media (max-width: 768px) {
  .welcome-card-wrapper {
    padding: 2.2rem 1.4rem;
    border-radius: 28px;
  }

  .welcome-title {
    font-size: 1.85rem;
  }

  .highlight-name {
    font-size: 2.2rem;
  }

  .envelope-container {
    transform: scale(0.9);
    margin: 0 auto 1.2rem;
  }

  .polaroid-photo-frame {
    height: 240px;
  }

  .floating-controls {
    top: 0.75rem;
    right: 0.75rem;
    gap: 0.4rem;
    z-index: 10000;
  }

  .control-btn {
    padding: 0.45rem 0.75rem;
    font-size: 0.8rem;
  }

  .control-btn .ctrl-label {
    display: none;
  }

  #btn-customize .ctrl-label {
    display: inline-block;
    font-size: 0.78rem;
  }

  /* 3D Book on Mobile Screen: Seamless Scaling */
  .book-perspective-wrapper {
    perspective: 1600px;
    width: 100%;
    height: 380px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: visible;
  }

  .book {
    transform-origin: center center;
    transform: scale(calc((100vw - 32px) / 740));
  }

  .book.state-closed-front {
    transform: scale(calc((100vw - 32px) / 740)) translateX(-25%);
  }

  .book.state-open {
    transform: scale(calc((100vw - 32px) / 740)) translateX(0%);
  }

  .book.state-closed-back {
    transform: scale(calc((100vw - 32px) / 740)) translateX(25%);
  }
}

/* ==========================================================================
   FLOATING MUSIC PLAYER DOCK (cardigan by Taylor Swift)
   ========================================================================== */
.music-dock {
  position: fixed;
  bottom: 1.25rem;
  left: 1.25rem;
  width: 240px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(255, 182, 193, 0.85);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(255, 101, 132, 0.22);
  z-index: 9999;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.music-dock.minimized .music-dock-frame {
  height: 0;
  display: none;
}

.music-dock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  background: linear-gradient(135deg, #fff0f3, #ffe3ea);
  border-bottom: 1px solid rgba(255, 214, 224, 0.6);
  cursor: pointer;
}

.music-dock-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--primary-pink);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.music-dock-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-romantic);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.dock-minimize-btn {
  background: none;
  border: none;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 0.3rem;
  line-height: 1;
}

.music-dock-frame {
  width: 240px;
  height: 135px;
  background: #000;
}

.music-dock-frame iframe {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
}

@media (max-width: 768px) {
  .music-dock {
    bottom: 0.75rem;
    left: 0.75rem;
    width: 180px;
  }
  .music-dock-frame {
    width: 180px;
    height: 101px;
  }
}

/* ==========================================================================
   ROMANTIC LOCK SCREEN & BLUR OVERLAY
   ========================================================================== */
.lock-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(circle at center, rgba(255, 245, 248, 0.82) 0%, rgba(255, 230, 238, 0.88) 100%);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0.8s ease, transform 0.8s ease;
  opacity: 1;
  visibility: visible;
}

.lock-overlay.unlocked {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(1.05);
}

.lock-card {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid rgba(255, 182, 193, 0.7);
  border-radius: 28px;
  box-shadow: 0 25px 60px rgba(255, 101, 132, 0.22), 0 4px 20px rgba(0, 0, 0, 0.05);
  padding: 2.75rem 2.25rem 2.25rem;
  text-align: center;
  position: relative;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: lockCardEntrance 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes lockCardEntrance {
  0% {
    opacity: 0;
    transform: scale(0.88) translateY(24px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.lock-icon-wrapper {
  position: relative;
  width: 76px;
  height: 76px;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #fff0f3 0%, #ffe3ea 100%);
  border: 2px solid rgba(255, 101, 132, 0.3);
  box-shadow: 0 10px 25px rgba(255, 101, 132, 0.22);
}

.lock-icon {
  font-size: 2.2rem;
  display: inline-block;
  transition: transform 0.3s ease;
}

.lock-pulse-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(255, 101, 132, 0.45);
  animation: lockPulse 2.2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes lockPulse {
  0% { transform: scale(0.95); opacity: 0.9; }
  50% { transform: scale(1.22); opacity: 0; }
  100% { transform: scale(0.95); opacity: 0; }
}

.lock-badge {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  background: rgba(255, 101, 132, 0.12);
  color: var(--primary-pink);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}

.lock-title {
  font-family: var(--font-handwriting);
  font-size: 2.3rem;
  color: var(--text-romantic);
  margin: 0 0 0.4rem;
  line-height: 1.1;
}

.lock-question {
  font-family: var(--font-main);
  font-size: 1.15rem;
  font-weight: 700;
  color: #495057;
  margin: 0 0 1.5rem;
  padding: 0 0.5rem;
  line-height: 1.45;
}

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

.lock-input-group {
  width: 100%;
  position: relative;
}

.lock-date-picker {
  width: 100%;
  padding: 0.9rem 1.25rem;
  border: 2px solid rgba(255, 182, 193, 0.8);
  border-radius: 18px;
  font-size: 1.15rem;
  font-family: var(--font-main);
  color: var(--text-romantic);
  background: #ffffff;
  outline: none;
  text-align: center;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
}

.lock-date-picker:focus {
  border-color: var(--primary-pink);
  box-shadow: 0 0 0 4px rgba(255, 101, 132, 0.2);
}

.lock-submit-btn {
  width: 100%;
  margin-top: 1rem;
  padding: 0.95rem;
  font-size: 1.1rem;
  border-radius: 18px;
  cursor: pointer;
}

.lock-error-text {
  min-height: 1.4rem;
  margin: 0.5rem 0 0.2rem;
  font-size: 0.88rem;
  color: #e03131;
  font-weight: 600;
  line-height: 1.3;
}

.lock-shake {
  animation: lockShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes lockShake {
  10%, 90% { transform: translate3d(-3px, 0, 0); }
  20%, 80% { transform: translate3d(5px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-7px, 0, 0); }
  40%, 60% { transform: translate3d(7px, 0, 0); }
}

.lock-hint-btn {
  background: none;
  border: none;
  color: #adb5bd;
  font-size: 0.85rem;
  margin-top: 0.9rem;
  cursor: pointer;
  padding: 0.25rem 0.6rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.lock-hint-btn:hover {
  color: var(--primary-pink);
  background: rgba(255, 101, 132, 0.08);
}

.lock-hint-text {
  font-size: 0.88rem;
  color: #868e96;
  margin-top: 0.5rem;
  font-style: italic;
  background: rgba(255, 240, 245, 0.8);
  padding: 0.6rem 0.9rem;
  border-radius: 12px;
  border: 1px dashed rgba(255, 182, 193, 0.8);
}

.lock-hint-text.hidden {
  display: none;
}
