/* ==========================================================================
   ROMANTIC & ELEGANT BIRTHDAY DESIGN SYSTEM - EXO BLACK, PINK & WHITE EDITION
   ========================================================================== */

/* Design Tokens */
:root {
  /* Color Palette */
  --bg-deep-velvet: #080808; /* Pure Deep Black */
  --bg-charcoal-rose: #000000; /* Absolute Black */
  --color-primary: #ff758f; /* Sweet Rose Pink */
  --color-primary-rgb: 255, 117, 143;
  --color-secondary: #ff4d6d; /* Romantic Pink */
  --color-secondary-rgb: 255, 77, 109;
  --color-accent: #ffffff; /* High-contrast Pure White */
  --color-accent-rgb: 255, 255, 255;
  --color-text-light: #ffffff; /* Pure White */
  --color-text-muted: #ffccd5; /* Soft Blush White */
  
  /* Fonts */
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Transitions */
  --transition-smooth: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-fast: all 0.25s ease;
  
  /* Shadows */
  --shadow-pink: 0 8px 32px rgba(255, 77, 109, 0.25);
  --shadow-white: 0 8px 32px rgba(255, 255, 255, 0.15);
  --shadow-dark: 0 10px 40px rgba(0, 0, 0, 0.8);
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-charcoal-rose);
  color: var(--color-text-light);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Global Hidden Utility Class */
.hidden {
  display: none !important;
}

/* Background Canvas for Particle Effects */
#animation-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(135deg, var(--bg-deep-velvet) 0%, var(--bg-charcoal-rose) 100%);
}

/* Elegant Custom Scrollbar for Desktop */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.6);
}
::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent);
}

/* ==========================================================================
   SCROLL SYSTEM (SCROLL SNAP)
   ========================================================================== */
.scroll-container {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  z-index: 2;
  scrollbar-width: thin;
  scrollbar-color: var(--color-primary) rgba(0, 0, 0, 0.6);
}

.slide {
  position: relative;
  width: 100%;
  height: 100vh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  overflow: hidden;
  box-sizing: border-box;
  z-index: 3;
  background: transparent;
}

/* Sticky Tall Slide for Desktop */
@media (min-width: 769px) {
  .slide-tall {
    height: 250vh !important; /* Larger scrollable height for animations */
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: block; /* Let sticky handle alignment */
    padding: 0;
    overflow: visible; /* Important for sticky child */
  }
}

/* Nav Dots Indicator */
.nav-dots {
  position: fixed;
  right: 25px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 15px;
  pointer-events: auto;
}

.nav-dots.hidden {
  opacity: 0;
  pointer-events: none;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: var(--transition-fast);
  padding: 0;
  outline: none;
}

.dot:hover {
  background: var(--color-primary);
  transform: scale(1.2);
}

.dot.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  transform: scale(1.4);
  box-shadow: 0 0 10px var(--color-primary);
}

/* ==========================================================================
   CORE GLASSMORPHISM CARD DESIGN
   ========================================================================== */
.glass-card {
  position: relative;
  background: rgba(10, 10, 10, 0.65);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 40px;
  width: 100%;
  max-width: 580px;
  box-shadow: var(--shadow-dark), inset 0 1px 1px rgba(255, 255, 255, 0.15);
  text-align: center;
  z-index: 3;
  transform: translateY(0);
  transition: var(--transition-smooth);
}

.glass-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-dark), 0 0 30px rgba(255, 117, 143, 0.2);
}

/* Allow Outro Glass Card to expand when showing polaroids */
#outro-card-glass {
  max-width: 650px;
  transition: var(--transition-smooth);
}

.card-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 117, 143, 0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: -1;
  animation: rotateGlow 20s linear infinite;
}

@keyframes rotateGlow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Typography Utilities */
.font-playfair {
  font-family: var(--font-serif);
}

.romantic-title {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: 20px;
  letter-spacing: 0.5px;
  text-shadow: 0 0 15px rgba(255, 117, 143, 0.4);
}

.subtitle {
  font-size: 1rem;
  font-weight: 300;
  color: var(--color-text-muted);
  margin-bottom: 35px;
  letter-spacing: 1px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  color: var(--color-primary);
  text-align: center;
  margin-bottom: 10px;
  text-shadow: 0 0 10px rgba(255, 117, 143, 0.2);
}

.section-desc {
  font-size: 0.95rem;
  font-weight: 300;
  color: var(--color-text-muted);
  text-align: center;
  margin-bottom: 40px;
  letter-spacing: 0.5px;
}

/* Buttons Styling */
.btn-primary, .btn-secondary, .btn-outline {
  position: relative;
  display: inline-block;
  padding: 14px 35px;
  border-radius: 50px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
  outline: none;
  z-index: 1;
  overflow: hidden;
}

.btn-primary {
  background: #ffffff;
  color: #000000;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
  border: 1px solid #ffffff;
}

.btn-primary:hover {
  transform: translateY(-3px);
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 8px 25px rgba(255, 117, 143, 0.6);
}

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

.btn-secondary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(255, 77, 109, 0.4);
}

.btn-secondary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(255, 77, 109, 0.6);
  background: #ffffff;
  color: #000000;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary);
  color: #000000;
  box-shadow: 0 4px 15px rgba(255, 117, 143, 0.3);
  transform: translateY(-2px);
}

/* ==========================================================================
   EXO HEXAGON LOGO DESIGN
   ========================================================================== */
.exo-logo-wrapper {
  margin: 0 auto 30px;
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  filter: drop-shadow(0 0 15px rgba(255, 117, 143, 0.6));
  animation: floatLogo 4s ease-in-out infinite;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.exo-logo-wrapper:hover {
  color: var(--color-accent);
  filter: drop-shadow(0 0 25px rgba(255, 255, 255, 0.8));
  transform: scale(1.08) rotate(5deg);
}

.exo-logo-svg, .exo-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@keyframes floatLogo {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ==========================================================================
   SLIDE 1: WELCOME COVER
   ========================================================================== */
.welcome-card {
  animation: fadeInUp 1.2s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   SLIDE 2: STICKY SCROLL GALLERY COLLAGE (10 PHOTOS)
   ========================================================================== */
.gallery-sticky-container {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 3;
}

@media (min-width: 769px) {
  .gallery-sticky-container {
    position: sticky;
    top: 0;
  }
}

.gallery-bg-glow {
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(255, 117, 143, 0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

/* Central Header Floating Above Stack */
.gallery-center-header {
  position: absolute;
  z-index: 5;
  text-align: center;
  max-width: 450px;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.4);
  padding: 20px 30px;
  border-radius: 20px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

.gallery-center-header .section-title {
  margin-bottom: 5px;
}

.gallery-center-header .section-desc {
  margin-bottom: 0;
}

/* DESKTOP COLLAGE LAYOUT */
.desktop-collage-container {
  display: none;
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 4;
}

@media (min-width: 769px) {
  .desktop-collage-container {
    display: block; /* Only show collage on desktop */
  }
}

/* Static Target Positions for 10 Polaroids */
.collage-item.polaroid {
  position: absolute;
  width: 155px; /* Perfect desktop size */
  transition: transform 0.1s linear, opacity 0.2s ease;
  z-index: 3;
}

/* Top Row (Items 1, 2, 3, 4) */
.collage-item.polaroid:nth-of-type(1) { left: 6%; top: 8%; }
.collage-item.polaroid:nth-of-type(2) { left: 28%; top: 5%; }
.collage-item.polaroid:nth-of-type(3) { left: 51%; top: 6%; }
.collage-item.polaroid:nth-of-type(4) { left: 74%; top: 8%; }

/* Middle Row - Left & Right Sides (Items 5, 6) */
.collage-item.polaroid:nth-of-type(5) { left: 4%; top: 38%; }
.collage-item.polaroid:nth-of-type(6) { left: 76%; top: 36%; }

/* Bottom Row (Items 7, 8, 9, 10) */
.collage-item.polaroid:nth-of-type(7) { left: 8%; top: 68%; }
.collage-item.polaroid:nth-of-type(8) { left: 30%; top: 72%; }
.collage-item.polaroid:nth-of-type(9) { left: 52%; top: 70%; }
.collage-item.polaroid:nth-of-type(10) { left: 75%; top: 66%; }


/* MOBILE FALLBACK SCROLLER LAYOUT */
.mobile-scroller-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  z-index: 4;
  padding: 0 10px;
}

@media (min-width: 769px) {
  .mobile-scroller-wrapper {
    display: none; /* Hide on desktop */
  }
}

.mobile-scroller {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  overflow-y: hidden; /* Block vertical scroll indicator */
  scroll-snap-type: x mandatory;
  width: 100%;
  padding: 40px 20px 45px 20px; /* Give room for rotated polaroids */
  scrollbar-width: none;
}

.mobile-scroller::-webkit-scrollbar {
  display: none;
}

.mobile-entry {
  flex: 0 0 240px;
  scroll-snap-align: center;
  background: #ffffff;
  padding: 10px 10px 16px 10px;
  border-radius: 4px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  transform: rotate(var(--angle, 0deg));
  transition: transform 0.3s ease;
}

.mobile-entry .polaroid-img-wrapper {
  width: 220px;
  height: 293.3px; /* Portrait 3x4 ratio (220 x 293.3) */
  margin-bottom: 8px;
}

.mobile-entry .polaroid-caption {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  color: #111111;
  text-align: center;
}

.mobile-carousel-tip {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-primary);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 15px;
  text-shadow: 0 0 8px rgba(255, 117, 143, 0.4);
  animation: pulseLogo 1.5s infinite alternate;
}

@media (max-width: 768px) {
  .glass-card {
    padding: 24px 18px !important;
    max-width: calc(100% - 32px) !important;
    border-radius: 20px !important;
  }

  .welcome-card {
    max-width: 330px !important;
    margin: 0 auto !important;
  }

  .welcome-card .romantic-title {
    font-size: 1.65rem !important;
    margin-bottom: 8px !important;
  }

  .welcome-card .subtitle {
    font-size: 0.82rem !important;
    line-height: 1.5 !important;
  }

  .welcome-card .logo-wrapper {
    margin-bottom: 12px !important;
  }

  .welcome-card .exo-logo {
    width: 60px !important;
    height: 60px !important;
  }

  .gallery-sticky-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 40px 10px 10px 10px;
    gap: 10px;
    height: 100vh;
    box-sizing: border-box;
  }

  .gallery-center-header {
    position: relative;
    z-index: 5;
    width: calc(100% - 20px);
    max-width: 340px;
    margin: 0 auto;
    padding: 15px 20px;
    background: rgba(10, 10, 10, 0.65);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
  }

  .mobile-scroller-wrapper {
    position: relative;
    width: 100%;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: 0;
  }

  .mobile-scroller {
    padding: 30px 20px 35px 20px;
    overflow-y: hidden !important;
  }

  /* Outro Card & Wish Reveal Mobile Overrides */
  .outro-card {
    padding: 15px 12px;
  }
  
  .outro-card .romantic-title {
    font-size: 1.35rem;
    margin-bottom: 4px;
  }

  .outro-subtitle {
    font-size: 0.78rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 12px;
    max-width: 280px;
    text-align: center;
  }
  
  .cake-icon {
    font-size: 1.8rem;
    margin-bottom: 6px;
  }
  
  .wish-text {
    font-size: 0.76rem;
    margin-bottom: 8px;
    line-height: 1.4;
  }
  
  .polaroids-grid {
    gap: 6px;
    margin: 8px auto;
  }
  
  .polaroids-grid .polaroid {
    width: 70px;
    padding: 4px 4px 8px 4px;
  }
  
  .polaroids-grid .polaroid-img-wrapper {
    width: 62px;
    height: 62px;
    margin-bottom: 3px;
  }
  
  .polaroids-grid .polaroid-caption {
    font-size: 0.48rem;
  }

  .candle-container {
    margin-top: 10px;
  }

  .outro-card .btn-outline {
    padding: 8px 20px;
    font-size: 0.75rem;
  }

  /* Compact Music Player Widget on Mobile */
  .music-player-widget {
    top: 12px;
    right: 12px;
    width: 175px;
    padding: 5px 8px;
    border-radius: 30px;
    gap: 0;
  }

  .music-disc-wrapper {
    width: 26px;
    height: 26px;
  }

  .song-info {
    max-width: 75px;
    margin-left: 2px;
  }

  .song-title {
    font-size: 0.62rem;
    letter-spacing: 0.1px;
  }

  .song-artist {
    font-size: 0.52rem;
  }

  #player-prev, #player-next {
    display: none !important; /* hide prev/next buttons on mobile to fit the bar */
  }

  .player-btn {
    padding: 4px;
  }

  .play-pause-btn {
    padding: 5px;
  }

  .player-playlist-panel {
    max-height: 90px;
  }

  .playlist-item {
    font-size: 0.62rem;
    padding: 4px 6px;
  }
}

/* ==========================================================================
   SLIDE 3: HEARTFELT LETTER
   ========================================================================== */
.letter-card {
  text-align: left;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  padding: 35px 35px 25px;
}

.letter-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 15px;
  margin-bottom: 20px;
}

.letter-header .date {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 2px;
  display: block;
  margin-bottom: 5px;
}

.letter-title {
  font-size: 1.8rem;
  color: var(--color-accent);
  font-weight: 600;
  text-shadow: 0 0 10px rgba(255,255,255,0.2);
}

.letter-content {
  overflow-y: auto;
  padding-right: 10px;
  flex-grow: 1;
}

/* Stylized Letter Text */
.letter-content p {
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--color-text-muted);
  margin-bottom: 18px;
}

.letter-content p:last-of-type {
  margin-bottom: 30px;
}

.signature {
  text-align: right;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--color-primary);
}

.letter-content strong {
  color: var(--color-primary);
  font-size: 1.3rem;
  font-style: normal;
  text-shadow: 0 0 5px rgba(255, 117, 143, 0.4);
}

/* Scrollbar within Letter Card */
.scroll-box::-webkit-scrollbar {
  width: 4px;
}
.scroll-box::-webkit-scrollbar-thumb {
  background: rgba(255, 117, 143, 0.4);
  border-radius: 2px;
}

/* ==========================================================================
   SLIDE 4: INTERACTIVE TIMELINE
   ========================================================================== */
.timeline-wrapper {
  width: 100%;
  max-width: 750px;
  z-index: 3;
}

.timeline {
  position: relative;
  margin: 40px auto 0;
  padding: 10px 0;
  width: 100%;
}

.timeline::after {
  content: '';
  position: absolute;
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--color-primary), var(--color-accent), transparent);
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -1px;
}

.timeline-item {
  position: relative;
  width: 50%;
  padding: 15px 40px;
  box-sizing: border-box;
}

.timeline-item.left {
  left: 0;
  text-align: right;
}

.timeline-item.right {
  left: 50%;
  text-align: left;
}

.timeline-dot {
  position: absolute;
  width: 16px;
  height: 16px;
  right: -8px;
  top: 35px;
  background: #000;
  border: 2px solid var(--color-primary);
  border-radius: 50%;
  z-index: 5;
  box-shadow: 0 0 10px var(--color-primary);
}

.timeline-item.right .timeline-dot {
  left: -8px;
}

.timeline-card {
  padding: 25px;
  text-align: left;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.timeline-item.left .timeline-card {
  text-align: right;
}

.timeline-date {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-primary);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 5px;
  display: block;
}

.timeline-card h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  margin-bottom: 8px;
  color: var(--color-text-light);
}

.timeline-card p {
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--color-text-muted);
}

/* Timeline Responsiveness */
@media (max-width: 768px) {
  .timeline::after {
    left: 20px;
  }
  .timeline-item {
    width: 100%;
    padding-left: 50px;
    padding-right: 10px;
  }
  .timeline-item.left, .timeline-item.right {
    left: 0;
    text-align: left;
  }
  .timeline-item.left .timeline-card {
    text-align: left;
  }
  .timeline-dot {
    left: 12px !important;
    right: auto !important;
  }
}

/* ==========================================================================
   SLIDE 5: CLOSING & CANDLE BLOW INTERACTIVE GAME
   ========================================================================== */
.outro-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 50px 30px;
}

.cake-icon {
  font-size: 3.5rem;
  margin-bottom: 20px;
  animation: pulseLogo 2s infinite alternate;
}

@keyframes pulseLogo {
  0% { transform: scale(1); filter: drop-shadow(0 0 2px var(--color-primary)); }
  100% { transform: scale(1.1); filter: drop-shadow(0 0 15px var(--color-primary)); }
}

/* Candle game container */
.candle-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 30px;
  transition: var(--transition-smooth);
}

.candle-container.hidden {
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
  margin-top: 0;
  height: 0;
  overflow: hidden;
}

.candle {
  position: relative;
  width: 25px;
  height: 90px;
  background: linear-gradient(to right, #ffccd5, var(--color-primary));
  border-radius: 5px;
  margin-bottom: 40px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.6);
}

.candle::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  top: 0;
  left: 0;
}

.wick {
  position: absolute;
  width: 3px;
  height: 15px;
  background: #222;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
}

.flame {
  position: absolute;
  width: 18px;
  height: 35px;
  background: radial-gradient(circle at center, #ffffff, var(--color-primary), transparent);
  border-radius: 50% 50% 20% 20%;
  top: -48px;
  left: 50%;
  transform: translateX(-50%);
  filter: drop-shadow(0 0 15px var(--color-primary));
  animation: flicker 1s infinite alternate;
}

.flame.extinguished {
  animation: smoke 1.5s ease-out forwards;
}

@keyframes flicker {
  0% {
    transform: translateX(-50%) rotate(-3deg) scaleX(0.85);
  }
  100% {
    transform: translateX(-50%) rotate(3deg) scaleX(1.15) scaleY(1.08);
  }
}

@keyframes smoke {
  0% {
    background: #bbb;
    width: 6px;
    height: 15px;
    top: -20px;
    border-radius: 50%;
    opacity: 0.8;
    filter: blur(1px);
  }
  50% {
    background: #888;
    width: 12px;
    height: 25px;
    top: -40px;
    opacity: 0.4;
    filter: blur(2px);
    transform: translateX(-10px);
  }
  100% {
    width: 2px;
    height: 10px;
    top: -60px;
    opacity: 0;
    filter: blur(4px);
  }
}

/* Wish Reveal Layout */
.wish-reveal {
  margin-top: 10px;
  animation: fadeInUp 0.8s ease-out forwards;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.wish-reveal.hidden {
  display: none !important;
}

.wish-text {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--color-primary);
  margin-bottom: 25px;
  line-height: 1.6;
  text-shadow: 0 0 15px rgba(255, 117, 143, 0.4);
}

.heart-pulse {
  font-size: 3.5rem;
  color: var(--color-primary);
  margin-bottom: 30px;
  animation: pulseLogo 1.2s infinite alternate;
  filter: drop-shadow(0 0 12px var(--color-primary));
}

/* ==========================================================================
   POLAROIDS & BALLOONS EFFECTS ON BLOW CANDLE
   ========================================================================== */

/* Polaroid Cards Grid */
.polaroids-grid {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin: 30px auto;
  width: 100%;
}

.polaroid {
  background: #ffffff;
  padding: 10px 10px 18px 10px;
  border-radius: 4px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 10px rgba(255, 117, 143, 0.1);
  transform: rotate(var(--angle)) scale(0.6);
  opacity: 0;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.8s ease;
  width: 130px;
  max-width: 100%;
}

/* Stagger transition delays in standard CSS */
.polaroid:nth-child(1) { transition-delay: 0.2s; }
.polaroid:nth-child(2) { transition-delay: 0.45s; }
.polaroid:nth-child(3) { transition-delay: 0.7s; }

.wish-reveal:not(.hidden) .polaroid {
  opacity: 1;
  transform: rotate(var(--angle)) scale(1);
}

.polaroid-img-wrapper {
  width: 110px;
  height: 110px;
  overflow: hidden;
  background: #eee;
  border: 1px solid #ddd;
  margin-bottom: 8px;
}

.polaroid-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(10%) contrast(105%);
}

.polaroid-caption {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  color: #111111;
  display: block;
  text-align: center;
  letter-spacing: 0.5px;
}

/* Floating Balloons Styling */
.balloon {
  position: absolute;
  bottom: -150px;
  width: 50px;
  height: 65px;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  z-index: 8;
  cursor: pointer;
  box-shadow: inset -5px -5px 10px rgba(0,0,0,0.15), 0 8px 20px rgba(0,0,0,0.3);
  transition: transform 0.2s ease-out, opacity 0.2s ease-out;
  animation: floatUp 8s linear forwards;
}

/* Balloon Knot/Tail */
.balloon::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 6px solid currentColor;
  opacity: 0.8;
}

/* Balloon String */
.balloon-string {
  position: absolute;
  width: 1px;
  height: 70px;
  background: rgba(255, 255, 255, 0.4);
  bottom: -75px;
  left: 50%;
  transform: translateX(-50%);
  transform-origin: top center;
  animation: stringWave 2s ease-in-out infinite alternate;
}

@keyframes floatUp {
  0% {
    bottom: -150px;
    transform: translateX(0) rotate(0deg);
  }
  50% {
    transform: translateX(var(--wobble-distance)) rotate(var(--wobble-angle));
  }
  100% {
    bottom: 120vh;
    transform: translateX(0) rotate(0deg);
  }
}

@keyframes stringWave {
  0% { transform: translateX(-50%) rotate(-5deg); }
  100% { transform: translateX(-50%) rotate(5deg); }
}

.balloon.popped {
  transform: scale(1.6);
  opacity: 0;
  pointer-events: none;
}

/* Floating Member polaroid balloons */
.member-balloon {
  position: absolute;
  bottom: -180px;
  width: 75px;
  height: 95px;
  background: #ffffff;
  padding: 6px 6px 14px 6px;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 10px rgba(255, 117, 143, 0.15);
  z-index: 9;
  cursor: pointer;
  transition: transform 0.2s ease-out, opacity 0.2s ease-out;
  animation: floatUp 8s linear forwards;
}

.member-balloon-img-wrapper {
  width: 100%;
  height: 75px;
  overflow: hidden;
  background: #eee;
  border: 1px solid #ddd;
}

.member-balloon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.member-balloon.popped {
  transform: scale(1.6);
  opacity: 0;
  pointer-events: none;
}


/* ==========================================================================
   MUSIC CONTROL WIDGET
   ========================================================================== */
/* Music Player Widget */
.music-player-widget {
  position: fixed;
  top: 25px;
  right: 25px;
  z-index: 100;
  padding: 8px 12px;
  border-radius: 40px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  background: rgba(10, 10, 10, 0.75);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  width: 255px;
  box-sizing: border-box;
}

/* Minimized state */
.music-player-widget.minimized {
  width: 44px !important;
  height: 44px !important;
  padding: 5px !important;
  border-radius: 50% !important;
  overflow: hidden !important;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(255, 117, 143, 0.5) !important;
}

.music-player-widget.minimized .song-info,
.music-player-widget.minimized .player-controls,
.music-player-widget.minimized .player-playlist-panel,
.music-player-widget.minimized .minimize-btn {
  display: none !important;
}

.music-player-widget.minimized .music-disc-wrapper {
  width: 32px !important;
  height: 32px !important;
  margin: 0 auto !important;
}

.minimize-btn {
  opacity: 0.6;
  transition: opacity 0.2s ease;
}
.minimize-btn:hover {
  opacity: 1;
}

.music-player-widget.hidden {
  opacity: 0;
  transform: translateY(-20px) scale(0.9);
  pointer-events: none;
}

.player-main {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.music-disc-wrapper {
  position: relative;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.music-disc {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, #333 40%, #111 41%, #222 60%, #000 61%, #222 100%);
  border: 1px solid rgba(255, 117, 143, 0.6);
  box-shadow: 0 0 10px rgba(255, 117, 143, 0.3);
  animation: spinDisc 4s linear infinite;
  animation-play-state: paused;
}

.music-player-widget.playing .music-disc {
  animation-play-state: running;
}

.disc-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  background: var(--color-accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.song-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 60px;
  max-width: 85px;
  overflow: hidden;
  text-align: left;
}

.song-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  letter-spacing: 0.3px;
}

.song-artist {
  font-size: 0.6rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.player-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  outline: none;
}

.player-btn:hover {
  color: var(--color-primary);
  background: rgba(255, 255, 255, 0.08);
}

.play-pause-btn {
  background: rgba(255, 117, 143, 0.15);
  color: var(--color-primary);
  padding: 6px;
  border: 1px solid rgba(255, 117, 143, 0.3);
}

.play-pause-btn:hover {
  background: var(--color-primary);
  color: #000;
}

/* Playlist Panel */
.player-playlist-panel {
  margin-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 6px;
  max-height: 120px;
  overflow-y: auto;
  text-align: left;
}

.player-playlist-panel::-webkit-scrollbar {
  width: 3px;
}

.player-playlist-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 117, 143, 0.3);
  border-radius: 2px;
}

.playlist-items {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.playlist-item {
  font-size: 0.68rem;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.65);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.15s ease;
}

.playlist-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.playlist-item.active {
  background: rgba(255, 117, 143, 0.12);
  color: var(--color-primary);
  font-weight: 500;
}

@keyframes spinDisc {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ==========================================================================
   SCROLL ANIMATIONS (MODERN NATIVE CSS OR FALLBACK)
   ========================================================================== */

/* Define Animation Timelines & Keyframes if supported */
@supports ((animation-timeline: view()) and (animation-range: entry)) {
  
  @keyframes slideInUp {
    from {
      opacity: 0;
      transform: translateY(100px) scale(0.95);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  @keyframes timelineSlideLeft {
    from {
      opacity: 0;
      transform: translateX(-100px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }

  @keyframes timelineSlideRight {
    from {
      opacity: 0;
      transform: translateX(100px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }

  /* Applied scroll driven animations */
  .letter-card {
    animation: slideInUp auto linear both;
    animation-timeline: view();
    animation-range: entry 10% entry 70%;
  }

  .timeline-item.left {
    animation: timelineSlideLeft auto linear both;
    animation-timeline: view();
    animation-range: entry 10% entry 60%;
  }

  .timeline-item.right {
    animation: timelineSlideRight auto linear both;
    animation-timeline: view();
    animation-range: entry 10% entry 60%;
  }

  .outro-card {
    animation: slideInUp auto linear both;
    animation-timeline: view();
    animation-range: entry 15% entry 75%;
  }
}

/* Fallback Classes applied by JS when CSS scroll timelines not supported */
.scroll-animate-hidden {
  opacity: 0;
  transform: translateY(60px) scale(0.95);
  transition: transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.8s ease;
}

.timeline-left-hidden {
  opacity: 0;
  transform: translateX(-60px);
  transition: transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.8s ease;
}

.timeline-right-hidden {
  opacity: 0;
  transform: translateX(60px);
  transition: transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.8s ease;
}

.scroll-animate-show {
  opacity: 1 !important;
  transform: translateY(0) scale(1) !important;
  transform: translateX(0) !important;
}

@media (prefers-reduced-motion: reduce) {
  .slide * {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Background Member/Idol Images Container */
#bg-member-container {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2; /* behind slides (z-index 3), but in front of canvas (z-index 1) */
  pointer-events: none;
  overflow: hidden;
}

.member-bg-image {
  position: absolute;
  pointer-events: none;
  opacity: 0.06; /* slightly lowered for better scroll readability */
  max-width: 250px;
  max-height: 360px;
  object-fit: contain;
  filter: grayscale(100%) contrast(90%) brightness(85%) blur(1px);
  transition: opacity 0.5s ease;
  animation: floatBgMember 20s ease-in-out infinite alternate;
}

@keyframes floatBgMember {
  0% {
    transform: translateY(0) rotate(var(--target-rotation, 0deg)) scale(0.98);
  }
  50% {
    transform: translateY(-30px) rotate(calc(var(--target-rotation, 0deg) + 3deg)) scale(1.02);
  }
  100% {
    transform: translateY(20px) rotate(calc(var(--target-rotation, 0deg) - 3deg)) scale(0.98);
  }
}

/* Welcome Section Background Cover Photo */
.slide-welcome-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.15; /* subtle background (feel free to increase this up to 0.4 - 0.5) */
  z-index: 1; /* strictly behind card contents */
  pointer-events: none;
  filter: grayscale(15%) brightness(90%) blur(0.5px);
  transition: opacity 0.5s ease;
}

/* Interactive Yes/No Question Game Styles */
.question-box {
  margin: 25px auto 10px;
  text-align: center;
  width: 100%;
  z-index: 5;
}

.question-title {
  font-size: 1.1rem;
  font-weight: 500;
  color: #ffffff;
  margin-bottom: 12px;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.question-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-top: 10px;
  position: relative;
  height: 55px; /* helps secure layout space when button moves */
}

.no-btn {
  transition: transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  will-change: transform;
}

.success-message {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--color-primary);
  margin-top: 15px;
  margin-bottom: 25px;
  line-height: 1.5;
  text-shadow: 0 0 12px rgba(255, 117, 143, 0.4);
  animation: fadeIn 0.6s ease forwards;
}

#btn-restart {
  margin-top: 30px;
}

@media (max-width: 768px) {
  .question-box {
    margin: 10px auto 4px;
  }
  .success-message {
    font-size: 0.82rem;
    margin-top: 8px;
    margin-bottom: 15px;
    line-height: 1.4;
  }
  #btn-restart {
    margin-top: 18px !important;
  }
}

/* Custom Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200; /* overlay above everything, even music player */
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.modal-overlay:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: calc(100% - 40px);
  max-width: 380px;
  padding: 35px 25px;
  text-align: center;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 25px rgba(255, 117, 143, 0.15);
  transform: scale(0.9);
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.modal-overlay:not(.hidden) .modal-card {
  transform: scale(1);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 500;
  color: #ffffff;
  margin-bottom: 22px;
  line-height: 1.6;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.modal-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  position: relative;
  height: 55px; /* secure space for button dodge */
}

.modal-buttons button {
  padding: 8px 18px !important;
  font-size: 0.8rem !important;
  border-radius: 20px !important;
  min-width: 90px;
}

/* Mobile responsive modal styles */
@media (max-width: 768px) {
  .modal-card {
    padding: 25px 20px;
    max-width: 310px;
  }
  .modal-title {
    font-size: 0.88rem;
    margin-bottom: 15px;
    line-height: 1.5;
  }
  .modal-buttons {
    gap: 10px;
    height: 48px;
  }
  .modal-buttons button {
    padding: 6px 14px !important;
    font-size: 0.72rem !important;
    border-radius: 16px !important;
    min-width: 75px;
  }
}



