/* =========================================================================
   LUXURY CINEMATIC BIRTHDAY THEME - CSS VARIABLES
========================================================================= */
:root {
  --c-black-bg: #050505;
  --c-dark-bg: #0F0F0F;
  --c-gold-primary: #D4AF37;
  --c-gold-light: #F5D67B;
  --c-white: #FFFFFF;
  --c-text-muted: #A0A0A0;
  
  --f-heading: 'Playfair Display', serif;
  --f-script: 'Cormorant Garamond', serif;
  --f-body: 'Inter', sans-serif;
  
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  
  --z-bg: -1;
  --z-content: 10;
  --z-overlay: 100;
  --z-floating: 200;
  --z-cursor: 1000000;
}

/* =========================================================================
   RESET & GLOBAL STYLES
========================================================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }
html {
  scroll-behavior: smooth;
}
html.has-custom-cursor, html.has-custom-cursor * {
  cursor: none !important;
}
body {
  background-color: var(--c-black-bg);
  color: var(--c-white);
  font-family: var(--f-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.intro-active {
  overflow: hidden !important;
  height: 100vh !important;
}

/* Custom Cursor */
#cursor-dot {
  position: fixed; top: 0; left: 0; width: 8px; height: 8px;
  background-color: var(--c-gold-primary); border-radius: 50%;
  pointer-events: none; z-index: var(--z-cursor);
  transform: translate3d(-100px, -100px, 0);
  opacity: 0;
  transition: transform 0.05s linear, opacity 0.3s ease;
}
#cursor-dot.visible-cursor {
  opacity: 1;
}
#cursor-ring {
  position: fixed; top: 0; left: 0; width: 40px; height: 40px;
  border: 1px solid var(--c-gold-light); border-radius: 50%;
  pointer-events: none; z-index: var(--z-cursor);
  transform: translate3d(-100px, -100px, 0);
  opacity: 0;
  transition: transform 0.15s ease-out, opacity 0.3s ease, width 0.3s, height 0.3s;
}
#cursor-ring.visible-cursor {
  opacity: 1;
}
body:hover #cursor-ring { width: 50px; height: 50px; }

/* Background Canvas */
#bg-canvas {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: var(--z-bg); pointer-events: none; opacity: 0.5;
}

/* Scroll Progress Bar */
#progress-bar {
  position: fixed; top: 0; left: 0; width: 0%; height: 3px;
  background: linear-gradient(90deg, var(--c-gold-primary), var(--c-gold-light));
  z-index: 1000;
}

/* Audio Toggle */
#sound-toggle {
  position: fixed; top: 25px; left: 30px;
  background: rgba(15, 15, 15, 0.8); border: 1px solid rgba(212, 175, 55, 0.4);
  color: var(--c-gold-primary); font-size: 24px; padding: 12px;
  border-radius: 50%; z-index: var(--z-floating);
  cursor: pointer; backdrop-filter: blur(5px);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.15); transition: all 0.3s ease;
}
#sound-toggle:hover {
  background: rgba(212, 175, 55, 0.2); transform: scale(1.1);
}

/* Buttons */
.gold-btn {
  background: transparent;
  border: 1px solid var(--c-gold-primary);
  color: var(--c-gold-light);
  padding: 12px 30px; font-size: 16px;
  font-family: var(--f-heading); text-transform: uppercase; letter-spacing: 2px;
  cursor: pointer; border-radius: 30px; transition: all 0.3s ease;
  position: relative; overflow: hidden;
}
.gold-btn::before {
  content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(212,175,55,0.4), transparent);
  transition: all 0.5s ease;
}
.gold-btn:hover {
  background: var(--c-gold-primary); color: var(--c-black-bg);
  box-shadow: 0 0 20px rgba(212,175,55,0.4);
}
.gold-btn:hover::before { left: 100%; }
.gold-btn.outline {
  background: rgba(255,255,255,0.05); border-color: rgba(212,175,55,0.5); color: var(--c-white);
}

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

/* =========================================================================
   GLOBAL OVERLAYS (Timer, Ricky, Achievements)
========================================================================= */
.floating-card {
  position: fixed; top: 20px; right: 20px;
  background: rgba(15, 15, 15, 0.85); border: 1px solid rgba(212,175,55,0.3);
  border-radius: var(--radius-md); padding: 15px 20px;
  z-index: var(--z-floating); backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  animation: slideInRight 0.5s ease forwards;
  min-width: 200px;
}
.timer-title { font-size: 12px; color: var(--c-text-muted); text-transform: uppercase; letter-spacing: 1px; }
.timer-time { font-family: var(--f-heading); font-size: 20px; color: var(--c-gold-light); margin-top: 5px; }
.timer-message { font-size: 14px; margin-top: 10px; font-style: italic; color: #ff9ec6; display: none; }

.achievement-toast {
  position: fixed; bottom: 30px; right: 30px;
  background: linear-gradient(135deg, rgba(20,20,20,0.95), rgba(40,30,10,0.95));
  border-left: 4px solid var(--c-gold-primary);
  border-radius: var(--radius-sm); padding: 15px;
  display: flex; align-items: center; gap: 15px;
  z-index: var(--z-floating); box-shadow: 0 5px 20px rgba(0,0,0,0.5);
  animation: slideInUp 0.5s ease forwards;
}
.achieve-icon { font-size: 30px; }
.achieve-title { font-size: 12px; color: var(--c-gold-primary); text-transform: uppercase; font-weight: bold; }
.achieve-desc { font-size: 14px; margin-top: 5px; }

#notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 330px;
  max-width: calc(100vw - 40px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1000000;
  pointer-events: none;
}

.ricky-notification {
  background: rgba(15, 15, 15, 0.95);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 15px rgba(212, 175, 55, 0.1);
  width: 100%;
  pointer-events: auto;
  position: relative;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.2), opacity 0.4s;
}

.ricky-notification.show {
  transform: translateX(0);
  opacity: 1;
}

.ricky-notification.hide {
  transform: translateX(120%) scale(0.9);
  opacity: 0;
}

.ricky-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.ricky-text {
  flex-grow: 1;
  padding-right: 15px;
}

.ricky-title {
  font-size: 12px;
  color: var(--c-gold-primary);
  text-transform: uppercase;
  font-weight: bold;
  letter-spacing: 1px;
}

.ricky-desc {
  font-family: var(--f-body);
  font-size: 13px;
  line-height: 1.45;
  margin-top: 4px;
  color: var(--c-white);
  text-align: left;
}

.notif-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: var(--c-text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 2px;
  line-height: 1;
  transition: color 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notif-close-btn:hover {
  color: #ff4444;
  transform: scale(1.1);
}

/* Bell button styles */
#notif-center-toggle {
  position: fixed;
  bottom: 85px;
  left: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(15, 15, 15, 0.85);
  border: 1px solid var(--c-gold-primary);
  color: var(--c-white);
  font-size: 22px;
  cursor: pointer;
  z-index: var(--z-floating);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

#notif-center-toggle:hover {
  background: rgba(212, 175, 55, 0.2);
  transform: scale(1.1);
}

#notif-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ff3333;
  color: white;
  border-radius: 50%;
  font-size: 10px;
  font-weight: bold;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* History Drawer panel */
#notif-history-panel {
  position: fixed;
  top: 0;
  right: -360px;
  width: 360px;
  height: 100vh;
  background: rgba(10, 10, 10, 0.98);
  border-left: 2px solid var(--c-gold-primary);
  z-index: 2000000;
  box-shadow: -10px 0 40px rgba(0,0,0,0.8);
  transition: right 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  backdrop-filter: blur(15px);
  display: flex;
  flex-direction: column;
}

#notif-history-panel.open {
  right: 0;
}

.notif-history-header {
  padding: 20px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notif-history-header h3 {
  font-family: var(--f-heading);
  color: var(--c-gold-light);
  font-size: 16px;
  margin: 0;
}

#close-notif-history {
  background: none;
  border: none;
  color: var(--c-text-muted);
  font-size: 28px;
  cursor: pointer;
  transition: color 0.2s;
  line-height: 1;
}

#close-notif-history:hover {
  color: var(--c-gold-primary);
}

.notif-history-list {
  flex-grow: 1;
  overflow-y: auto;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.no-notifs {
  color: var(--c-text-muted);
  text-align: center;
  font-style: italic;
  font-size: 13px;
  margin-top: 40px;
}

.history-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(212, 175, 55, 0.15);
  border-radius: var(--radius-sm);
  padding: 12px 15px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: all 0.2s ease;
  position: relative;
  cursor: pointer;
}

.history-item:hover {
  background: rgba(212, 175, 55, 0.05);
  border-color: rgba(212, 175, 55, 0.4);
}

.history-item.unread {
  border-left: 3px solid var(--c-gold-primary);
}

.history-item-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.history-item-details {
  flex-grow: 1;
}

.history-item-title {
  font-size: 11px;
  color: var(--c-gold-light);
  font-weight: bold;
}

.history-item-desc {
  font-size: 12.5px;
  color: var(--c-white);
  margin-top: 4px;
  line-height: 1.4;
}

.history-item-time {
  font-size: 10px;
  color: var(--c-text-muted);
  margin-top: 6px;
}

.replay-badge {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 9px;
  color: var(--c-gold-primary);
  opacity: 0;
  transition: opacity 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.history-item:hover .replay-badge {
  opacity: 1;
}

.ricky-emergency {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.9); z-index: 2000001;
  display: flex; justify-content: center; align-items: center;
  backdrop-filter: blur(10px);
}
.emergency-content {
  background: #111; border: 2px solid #ff3333;
  padding: 40px; border-radius: var(--radius-lg);
  text-align: center; max-width: 400px;
  box-shadow: 0 0 50px rgba(255,0,0,0.2);
  animation: emergencyPulse 1s infinite alternate;
}
.emergency-title { font-family: var(--f-heading); color: #ff3333; font-size: 28px; margin-bottom: 20px; }
.emergency-time { font-family: var(--f-heading); font-size: 32px; color: var(--c-white); margin: 10px 0; }
.emergency-desc { color: var(--c-text-muted); font-size: 14px; margin-bottom: 10px; }
.emergency-level { font-size: 24px; color: #ff3333; font-weight: bold; margin: 10px 0 30px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.emergency-options { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.emergency-options .gold-btn { min-width: 220px; text-align: center; }
.hunger-bar { display: inline-block; width: 100px; height: 10px; background: rgba(255,0,0,0.3); border-radius: 5px; position: relative; overflow: hidden; }
.hunger-bar::after { content:''; position: absolute; top:0; left:0; height: 100%; width: 97%; background: #ff3333; }

@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideInUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes shakeAlert { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-10px); } 50% { transform: translateX(10px); } 75% { transform: translateX(-10px); } }
@keyframes emergencyPulse { from { box-shadow: 0 0 20px rgba(255,0,0,0.2); } to { box-shadow: 0 0 50px rgba(255,0,0,0.6); transform: scale(1.02); } }

/* =========================================================================
   CINEMATIC INTRO
========================================================================= */
.fullscreen-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: var(--c-black-bg); z-index: 1000;
  display: flex; justify-content: center; align-items: center; flex-direction: column;
  transition: opacity 1.5s ease, visibility 1.5s;
}
.fullscreen-overlay:not(.active) { opacity: 0; visibility: hidden; }

#intro-particles {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%; pointer-events: none;
  z-index: 1; overflow: hidden;
}

.intro-particle {
  position: absolute;
  width: 4px; height: 4px;
  background: var(--c-gold-primary);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--c-gold-primary);
  animation: floatUp 3s linear infinite;
  opacity: 0;
}

@keyframes floatUp {
  0% { transform: translateY(0); opacity: 0; }
  50% { opacity: 0.8; }
  100% { transform: translateY(-100px); opacity: 0; }
}

.intro-content { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; }
.intro-content-new { text-align: center; max-width: 800px; padding: 20px; z-index: 2; position: relative; }
.intro-tagline { font-family: var(--f-body); font-size: 14px; letter-spacing: 4px; color: var(--c-text-muted); margin-bottom: 30px; text-transform: uppercase; opacity: 0; animation: fadeIn 2s 0.5s forwards; }
.intro-hero-title { font-family: var(--f-heading); font-size: clamp(3rem, 8vw, 6rem); line-height: 1.1; margin-bottom: 20px; }
.intro-line { display: block; opacity: 0; transform: translateY(30px); }
#il1 { color: var(--c-white); animation: slideUpFade 1.5s 1.5s forwards; }
#il2 { color: var(--c-gold-primary); animation: slideUpFade 1.5s 2s forwards; }
#il3 { color: var(--c-white); font-style: italic; animation: slideUpFade 1.5s 2.5s forwards; }
.intro-sparkle-icon { font-size: 40px; margin: 30px 0; opacity: 0; animation: scaleIn 1s 3.5s forwards; }
.intro-subtitle { font-family: var(--f-script); font-size: 24px; color: var(--c-gold-light); margin-bottom: 50px; opacity: 0; animation: fadeIn 2s 4s forwards; }
#begin-btn {
  opacity: 0;
  display: inline-block;
  animation: slideUpFade 1s 5s forwards;
}

/* =========================================================================
   CINEMATIC CELEBRATION DATE
========================================================================= */
.intro-date-wrapper {
  margin: 0 auto 30px;
  padding: 18px 30px;
  background: rgba(212, 175, 55, 0.04);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: var(--radius-md);
  max-width: 380px;
  text-align: center;
  backdrop-filter: blur(8px);
  animation: fadeIn 1.5s 4.5s forwards;
  opacity: 0;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 0 15px rgba(212,175,55,0.05);
}
.intro-date-label {
  font-family: var(--f-heading);
  font-size: 24px;
  color: var(--c-gold-primary);
  letter-spacing: 2px;
  font-weight: 600;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

@keyframes fadeIn { to { opacity: 1; } }
@keyframes slideUpFade { to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn { 0% { transform: scale(0); opacity: 0; } 50% { transform: scale(1.2); } 100% { transform: scale(1); opacity: 1; } }

/* =========================================================================
   SCROLL REVEAL UTILS
========================================================================= */
.reveal-el { opacity: 0; transform: translateY(40px); transition: all 1s cubic-bezier(0.2, 0.8, 0.2, 1); }
.reveal-el.active { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; }

/* =========================================================================
   MAIN LAYOUT & SECTIONS
========================================================================= */
#main-content { position: relative; z-index: var(--z-content); }
.content-section {
  min-height: 100vh; padding: 100px 20px; display: flex; flex-direction: column;
  justify-content: center; align-items: center; position: relative; max-width: 1200px; margin: 0 auto;
}
.section-label { font-size: 14px; text-transform: uppercase; letter-spacing: 3px; color: var(--c-gold-primary); margin-bottom: 10px; text-align: center; }
.section-title { font-family: var(--f-heading); font-size: clamp(2.5rem, 5vw, 4rem); text-align: center; margin-bottom: 60px; color: var(--c-white); }
.section-title span { color: var(--c-gold-primary); font-style: italic; }

/* =========================================================================
   HERO SECTION
========================================================================= */
.parallax-section { position: relative; overflow: hidden; width: 100vw; max-width: 100%; margin: 0; min-height: 100vh; }
.hero-bg-image {
  position: absolute; top: 0; left: 0; width: 100%; height: 130%; /* Extra height for parallax */
  background-size: cover; background-position: center 30%; z-index: 1;
  filter: brightness(0.6) contrast(1.1); transform: translateZ(0); /* Force HW accel */
}
.hero-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to bottom, rgba(5,5,5,0.3) 0%, var(--c-black-bg) 100%); z-index: 2; }
.hero-content { position: relative; z-index: 3; text-align: center; max-width: 800px; padding-top: 100px; }
.hero-name { font-family: var(--f-heading); font-size: clamp(3rem, 6vw, 5rem); margin-bottom: 30px; line-height: 1.2; text-shadow: 0 5px 15px rgba(0,0,0,0.5); }
.hero-name span { color: var(--c-gold-primary); }
.hero-sub { font-family: var(--f-script); font-size: clamp(1.5rem, 3vw, 2.5rem); margin-bottom: 20px; line-height: 1.5; color: var(--c-gold-light); }
.hero-tag { font-family: var(--f-body); font-size: 14px; letter-spacing: 2px; text-transform: uppercase; color: var(--c-text-muted); margin-top: 40px; }
.scroll-cue { margin-top: 80px; display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--c-gold-primary); font-size: 12px; text-transform: uppercase; letter-spacing: 2px; }
.scroll-arrow { font-size: 20px; animation: bounce 2s infinite; }
@keyframes bounce { 0%, 20%, 50%, 80%, 100% { transform: translateY(0); } 40% { transform: translateY(-10px); } 60% { transform: translateY(-5px); } }

/* =========================================================================
   ABOUT YOU GRID
========================================================================= */
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 25px; width: 100%; }
.about-card {
  background: rgba(15, 15, 15, 0.65); border: 1px solid rgba(212,175,55,0.12);
  padding: 40px 24px; text-align: center; border-radius: var(--radius-md);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  backdrop-filter: blur(10px);
}
.about-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--c-gold-primary);
  box-shadow: 0 15px 35px rgba(212,175,55,0.15), 0 0 20px rgba(212,175,55,0.05);
}
.about-icon {
  font-size: 38px;
  margin-bottom: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.06);
  border: 1px solid rgba(212, 175, 55, 0.15);
  color: var(--c-gold-light);
  transition: all 0.4s ease;
}
.about-card:hover .about-icon {
  background: rgba(212, 175, 55, 0.12);
  border-color: var(--c-gold-primary);
  transform: rotate(8deg) scale(1.08);
}
.about-card h3 {
  font-family: var(--f-heading);
  font-size: 21px;
  color: var(--c-white);
  margin-bottom: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.about-card p {
  font-family: var(--f-body);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--c-text-muted);
}

/* =========================================================================
   FAMILY LOVE
========================================================================= */
.family-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; width: 100%; }
.family-card {
  background: linear-gradient(145deg, #111, #0a0a0a);
  border: 1px solid rgba(255,255,255,0.05); padding: 40px; border-radius: var(--radius-lg);
  position: relative; overflow: hidden;
}
.family-card::before {
  content: '”'; position: absolute; top: -10px; right: 20px;
  font-family: var(--f-script); font-size: 120px; color: rgba(212,175,55,0.1); line-height: 1;
}
.family-title { font-family: var(--f-heading); font-size: 20px; color: var(--c-gold-primary); margin-bottom: 20px; letter-spacing: 1px; text-transform: uppercase; }
.family-message { font-family: var(--f-script); font-size: 22px; line-height: 1.6; color: var(--c-white); display: flex; flex-direction: column; gap: 15px; }
.family-sig { margin-top: 20px !important; color: var(--c-gold-light); font-weight: bold; }

/* =========================================================================
   INTERACTIVE LETTER
========================================================================= */
.envelope-wrapper {
  position: relative; width: 320px; height: 220px;
  cursor: pointer; transition: transform 0.4s;
  perspective: 1000px;
}
.envelope { position: absolute; width: 100%; height: 100%; transform-style: preserve-3d; transition: all 1s ease; }
.envelope-front { position: absolute; width: 100%; height: 100%; background: #1a1a1a; border: 2px solid var(--c-gold-primary); z-index: 3; }
.envelope-pocket {
  position: absolute; width: 100%; height: 100%; bottom: 0; left: 0;
  border-left: 150px solid transparent; border-right: 150px solid transparent; border-bottom: 100px solid #222;
  z-index: 4;
}
.envelope-flap {
  position: absolute; width: 100%; height: 100%; top: 0; left: 0;
  border-left: 150px solid transparent; border-right: 150px solid transparent; border-top: 100px solid #2a2a2a;
  transform-origin: top; transition: transform 0.6s ease; z-index: 5;
}
.letter-paper {
  position: absolute; width: 90%; height: 90%; top: 5%; left: 5%;
  background: #fdf5e6; color: #111; padding: 30px; border-radius: 4px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5); z-index: 2; transition: all 0.8s ease;
  overflow-y: auto; overflow-x: hidden;
}
.envelope-wrapper.open { z-index: 500; }
.envelope-wrapper.open .envelope-flap { transform: rotateX(180deg); z-index: 1; }
.envelope-wrapper.open .letter-paper { transform: translateY(-50px) scale(1.2); height: 400px; width: 150%; left: -25%; z-index: 10; cursor: default; }

.click-hint { text-align: center; margin-top: 30px; color: var(--c-text-muted); font-size: 14px; animation: pulse 2s infinite; }
.letter-content { font-family: var(--f-script); font-size: 18px; line-height: 1.6; display: flex; flex-direction: column; gap: 15px; }
.letter-header { font-size: 24px; font-weight: bold; margin-bottom: 10px; }
.signature { margin-top: 30px; font-weight: bold; font-size: 22px; color: #b82a3d; }
#close-letter-btn {
  position: absolute; top: 10px; right: 10px; background: none; border: none; font-size: 24px; color: #111; cursor: pointer; display: none;
}
.envelope-wrapper.open #close-letter-btn { display: block; }

/* =========================================================================
   VERIFICATION & AI ANALYSIS
========================================================================= */
.verification-container { background: var(--c-dark-bg); border: 2px dashed rgba(212,175,55,0.3); padding: 40px; border-radius: var(--radius-lg); text-align: center; max-width: 600px; margin: 0 auto; }
.verification-title { color: #ffcc00; font-family: var(--f-heading); margin-bottom: 20px; font-size: 24px; }
.verification-q { font-size: 20px; margin-bottom: 30px; }
.verification-options { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.ver-btn { width: 100%; text-align: left; }
.verification-result { margin-top: 30px; font-size: 20px; color: #4CAF50; font-weight: bold; }
.verification-result span { font-size: 14px; color: var(--c-text-muted); display: block; margin-top: 5px; font-weight: normal; }

.blur-locked { filter: blur(5px); opacity: 0.5; pointer-events: none; transition: all 0.5s ease; }
.blur-locked.unlocked { filter: blur(0); opacity: 1; pointer-events: auto; }

.ai-card { background: linear-gradient(180deg, #111, #000); border: 1px solid var(--c-gold-primary); border-radius: var(--radius-lg); padding: 40px; width: 100%; max-width: 500px; box-shadow: 0 0 30px rgba(212,175,55,0.1); position: relative; overflow: hidden; }
.ai-title { font-family: var(--f-heading); font-size: 24px; text-align: center; margin-bottom: 30px; color: var(--c-gold-light); }
.ai-loading { text-align: center; color: var(--c-gold-primary); font-family: monospace; }
.spinner { width: 40px; height: 40px; border: 3px solid rgba(212,175,55,0.3); border-top-color: var(--c-gold-primary); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 20px; }
.ai-results p { font-family: monospace; font-size: 16px; margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; }
.ai-bar { flex-grow: 1; height: 6px; background: #222; margin: 0 15px; border-radius: 3px; overflow: hidden; }
.ai-bar span { display: block; height: 100%; background: var(--c-gold-primary); }
.ai-alert { color: #ff3333 !important; animation: flash 1s infinite alternate; }
.ai-final-rating { margin-top: 30px; text-align: center; font-size: 24px; font-family: var(--f-heading); font-weight: bold; color: var(--c-white); padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.1); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes flash { from { opacity: 1; } to { opacity: 0.5; } }

/* =========================================================================
   STATS
========================================================================= */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 30px; width: 100%; }
.stat-card {
  text-align: center;
  padding: 35px 25px;
  border-radius: var(--radius-md);
  background: rgba(15, 15, 15, 0.6);
  border: 1px solid rgba(212, 175, 55, 0.1);
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}
.stat-card:hover {
  transform: translateY(-5px);
  border-color: rgba(212, 175, 55, 0.35);
  box-shadow: 0 10px 25px rgba(212, 175, 55, 0.1);
}
.stat-number { font-family: var(--f-heading); font-size: 4rem; color: var(--c-gold-primary); font-weight: bold; line-height: 1; margin-bottom: 15px; }
.stat-text { font-family: var(--f-heading); font-size: 2.2rem; color: #ff9ec6; line-height: 1.2; margin-bottom: 15px; min-height: 4rem; display: flex; align-items: center; justify-content: center; }
.stat-label { font-size: 13.5px; text-transform: uppercase; letter-spacing: 2px; color: var(--c-text-muted); font-weight: 500; }

/* =========================================================================
   TIMELINE
========================================================================= */
.timeline-container { position: relative; max-width: 800px; margin: 0 auto; padding: 40px 0; }
.timeline-line { position: absolute; top: 0; bottom: 0; left: 50px; width: 2px; background: linear-gradient(to bottom, transparent, var(--c-gold-primary), transparent); }
.timeline-item { position: relative; padding-left: 100px; margin-bottom: 60px; }
.timeline-dot { position: absolute; left: 45px; top: 10px; width: 12px; height: 12px; border-radius: 50%; background: var(--c-black-bg); border: 2px solid var(--c-gold-primary); box-shadow: 0 0 10px var(--c-gold-primary); z-index: 2; }
.timeline-content { background: var(--c-dark-bg); padding: 30px; border-radius: var(--radius-md); border: 1px solid rgba(212,175,55,0.2); }
.timeline-content h3 { font-family: var(--f-heading); font-size: 24px; color: var(--c-gold-light); margin-bottom: 20px; }
.timeline-img { width: 100%; max-height: 300px; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: 20px; filter: grayscale(20%); transition: filter 0.5s; }
.timeline-img:hover { filter: grayscale(0%); }
.timeline-content p { color: var(--c-white); line-height: 1.6; }

/* =========================================================================
   POLAROID MEMORY GALLERY
========================================================================= */
.gallery-subtitle { font-size: 12px; letter-spacing: 3px; color: var(--c-text-muted); text-transform: uppercase; margin-bottom: 50px; text-align: center; }
.polaroid-gallery { display: flex; flex-wrap: wrap; justify-content: center; gap: 40px; width: 100%; perspective: 1000px; }
.polaroid-item {
  background: #fdfdfd; padding: 15px 15px 50px 15px; width: 300px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8); position: relative; cursor: pointer;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), z-index 0s, box-shadow 0.5s;
  /* initial random-looking rotation will be set slightly via nth-child below, or just a default */
  transform: rotate(-3deg) scale(0.95);
  border-radius: 2px;
}
.polaroid-item:nth-child(even) { transform: rotate(4deg) scale(0.95); }
.polaroid-item:nth-child(3n) { transform: rotate(-2deg) scale(0.95); }
.polaroid-item:hover {
  transform: rotate(0deg) scale(1.05) translateY(-10px) translateZ(20px);
  z-index: 10;
  box-shadow: 0 20px 40px rgba(0,0,0,0.9), 0 0 20px rgba(212,175,55,0.3);
}
.polaroid-img-wrap { width: 100%; height: 320px; overflow: hidden; background: #222; }
.polaroid-img-wrap img { width: 100%; height: 100%; object-fit: cover; filter: sepia(20%) contrast(1.1); transition: filter 0.5s; }
.polaroid-item:hover .polaroid-img-wrap img { filter: sepia(0%) contrast(1); }
.polaroid-caption {
  position: absolute; bottom: 15px; left: 0; width: 100%; text-align: center;
  font-family: 'Great Vibes', var(--f-script); font-size: 24px; color: #333;
  font-style: italic; font-weight: 500;
}

/* =========================================================================
   SCRATCH CARD
========================================================================= */
.scratch-card-wrapper { position: relative; width: 300px; height: 150px; margin: 0 auto; user-select: none; }
.scratch-underlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: #111; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; text-align: center; padding: 20px; border: 1px solid var(--c-gold-primary); }
.hidden-message h3 { font-family: var(--f-script); font-size: 24px; color: var(--c-gold-light); }
#scratch-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: var(--radius-md); cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%23D4AF37" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle></svg>') 10 10, auto; touch-action: none; }
.scratch-hint { margin-top: 20px; color: var(--c-text-muted); font-size: 14px; text-transform: uppercase; letter-spacing: 2px; }

/* =========================================================================
   REALISTIC 3D GIFTS
========================================================================= */
/* =========================================================================
   REALISTIC 3D GIFTS & DETAIL MODAL
========================================================================= */
.gifts-3d-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 120px 80px;
  margin-top: 60px;
  perspective: 1200px;
  width: 100%;
}

.gift-3d-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gift-3d {
  position: relative;
  width: 140px;
  height: 140px;
  transform-style: preserve-3d;
  transform: rotateX(-15deg) rotateY(-20deg);
  transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
  cursor: pointer;
}

.gift-3d:hover {
  transform: rotateX(-15deg) rotateY(10deg) translateY(-10px);
}

.gift-3d.opened {
  transform: rotateX(-10deg) rotateY(-5deg);
}

/* 3D Box Shadow */
.box-shadow {
  position: absolute;
  width: 160px;
  height: 40px;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 70%);
  bottom: -30px;
  left: -10px;
  transform: rotateX(90deg) translateZ(-50px);
  pointer-events: none;
}

/* Box Body Sides */
.box-body {
  position: absolute;
  width: 140px;
  height: 100px;
  bottom: 0;
  transform-style: preserve-3d;
}

.box-side {
  position: absolute;
  width: 140px;
  height: 100px;
  background: radial-gradient(circle at center, #420a0a, #1f0202);
  border: 1.5px solid rgba(212, 175, 55, 0.35);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.85);
  backface-visibility: visible;
}

/* Suspicious Gift Box Styling */
.suspicious .box-side {
  background: radial-gradient(circle at center, #2e2e2e, #141414);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Face Rotations and Translations */
.box-side.front  { transform: rotateY(0deg) translateZ(70px); }
.box-side.back   { transform: rotateY(180deg) translateZ(70px); }
.box-side.left   { transform: rotateY(-90deg) translateZ(70px); }
.box-side.right  { transform: rotateY(90deg) translateZ(70px); }
.box-side.bottom {
  width: 140px;
  height: 140px;
  transform: rotateX(-90deg) translateZ(50px);
  background: #110101;
  border-color: rgba(212, 175, 55, 0.2);
}
.suspicious .box-side.bottom {
  background: #0f0f0f;
}

/* Ribbons on Box Sides (using pseudo-elements to wrap cleanly) */
.box-side::before {
  content: '';
  position: absolute;
  top: 0;
  left: calc(50% - 10px);
  width: 20px;
  height: 100%;
  background: linear-gradient(90deg, #a87913, #ffd700, #a87913);
  box-shadow: 0 0 5px rgba(0,0,0,0.4);
  z-index: 1;
}

.suspicious .box-side::before {
  background: linear-gradient(90deg, #6b6b6b, #b8b8b8, #6b6b6b);
}

.box-side::after {
  content: '';
  position: absolute;
  top: calc(50% - 10px);
  left: 0;
  width: 100%;
  height: 20px;
  background: linear-gradient(180deg, #a87913, #ffd700, #a87913);
  box-shadow: 0 0 5px rgba(0,0,0,0.4);
  z-index: 1;
}

.suspicious .box-side::after {
  background: linear-gradient(180deg, #6b6b6b, #b8b8b8, #6b6b6b);
}

/* Box Lid Sides */
.box-lid {
  position: absolute;
  top: 25px;
  left: -5px;
  width: 150px;
  height: 150px;
  transform-style: preserve-3d;
  transform: translateZ(0) translateY(0) rotateX(0) rotateY(0);
  transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.5s;
  z-index: 5;
}

.lid-side {
  position: absolute;
  background: #4f0c0c;
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
}

.suspicious .lid-side {
  background: #333333;
  border-color: rgba(255, 255, 255, 0.2);
}

.lid-side.top {
  width: 150px;
  height: 150px;
  transform: rotateX(90deg) translateZ(75px);
  background: radial-gradient(circle at center, #5c0f0f, #2b0303);
}

.suspicious .lid-side.top {
  background: radial-gradient(circle at center, #3d3d3d, #1f1f1f);
}

.lid-side.front, .lid-side.back, .lid-side.left, .lid-side.right {
  width: 150px;
  height: 25px;
}

.lid-side.front  { transform: rotateY(0deg) translateZ(75px) translateY(62.5px); }
.lid-side.back   { transform: rotateY(180deg) translateZ(75px) translateY(62.5px); }
.lid-side.left   { transform: rotateY(-90deg) translateZ(75px) translateY(62.5px); }
.lid-side.right  { transform: rotateY(90deg) translateZ(75px) translateY(62.5px); }

/* Lid Ribbons */
.lid-side.top::before {
  content: '';
  position: absolute;
  top: 0;
  left: calc(50% - 11px);
  width: 22px;
  height: 100%;
  background: linear-gradient(90deg, #a87913, #ffd700, #a87913);
}
.suspicious .lid-side.top::before { background: linear-gradient(90deg, #6b6b6b, #b8b8b8, #6b6b6b); }

.lid-side.top::after {
  content: '';
  position: absolute;
  top: calc(50% - 11px);
  left: 0;
  width: 100%;
  height: 22px;
  background: linear-gradient(180deg, #a87913, #ffd700, #a87913);
}
.suspicious .lid-side.top::after { background: linear-gradient(180deg, #6b6b6b, #b8b8b8, #6b6b6b); }

/* Lid Bow */
.lid-bow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(45deg) translateZ(76px);
  width: 50px;
  height: 50px;
  z-index: 6;
}

.bow-loop {
  position: absolute;
  width: 32px;
  height: 20px;
  background: linear-gradient(135deg, #ffd700, #a87913);
  border-radius: 50% 50% 0 50%;
  box-shadow: 0 4px 6px rgba(0,0,0,0.4);
}
.suspicious .bow-loop { background: linear-gradient(135deg, #e0e0e0, #737373); }

.bow-loop.left {
  transform: rotate(-15deg) translate(-24px, -8px);
}

.bow-loop.right {
  transform: rotate(75deg) translate(-8px, -24px);
  border-radius: 50% 50% 50% 0;
}

.bow-knot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  background: #ffd700;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  z-index: 7;
}
.suspicious .bow-knot { background: #b8b8b8; }

/* Glowing Scroll/Card Pop-up Preview */
.gift-card-preview {
  position: absolute;
  top: 25px;
  left: 30px;
  width: 80px;
  height: 90px;
  background: linear-gradient(135deg, #ffffff, #f7ebb8);
  border: 2px solid var(--c-gold-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.6), 0 0 20px rgba(212, 175, 55, 0.2);
  transform: translateZ(0) translateY(10px) scale(0.6);
  opacity: 0;
  transition: transform 0.8s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.5s;
  z-index: 1;
  pointer-events: none;
}

.card-glow {
  position: absolute;
  top: -10%; left: -10%; width: 120%; height: 120%;
  background: radial-gradient(circle, rgba(212,175,55,0.4) 0%, rgba(212,175,55,0) 70%);
  z-index: -1;
  pointer-events: none;
}

.card-icon {
  font-size: 28px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* opened styles */
.gift-3d.opened .box-lid {
  transform: translateY(-130px) rotateX(-50deg) rotateY(40deg) translateZ(100px);
  opacity: 0;
  pointer-events: none;
}

.gift-3d.opened .gift-card-preview {
  transform: translateZ(5px) translateY(-85px) scale(1.1);
  opacity: 1;
  pointer-events: auto;
  animation: cardGlowPulse 1.5s infinite alternate;
}

@keyframes cardGlowPulse {
  from { box-shadow: 0 5px 15px rgba(0, 0, 0, 0.6), 0 0 20px rgba(212, 175, 55, 0.2); }
  to { box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 35px rgba(212, 175, 55, 0.6); transform: translateZ(5px) translateY(-88px) scale(1.13); }
}

.gift-label {
  margin-top: 15px;
  font-size: 14px;
  color: var(--c-gold-light);
  text-transform: uppercase;
  font-weight: bold;
  letter-spacing: 1px;
  text-align: center;
}

/* Premium Gift Modal Overlay */
.gift-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 3000000;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.4s ease, visibility 0.4s;
}

.gift-modal.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.gift-modal-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(10px);
  z-index: 1;
}

.gift-modal-content {
  position: relative;
  background: rgba(15, 15, 15, 0.98);
  border: 2px solid var(--c-gold-primary);
  border-radius: var(--radius-lg);
  padding: 40px 30px;
  max-width: 460px;
  width: 90%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(212, 175, 55, 0.2);
  text-align: center;
  z-index: 2;
  animation: modalAppear 0.5s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

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

.gift-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: var(--c-white);
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 20;
}

.gift-close-btn:hover {
  color: #ff4444;
  background: rgba(255, 68, 68, 0.15);
  border-color: #ff4444;
  transform: scale(1.1);
}

.gift-modal-decor {
  font-size: 24px;
  margin-bottom: 15px;
}

.gift-modal-title {
  font-family: var(--f-heading);
  color: var(--c-gold-light);
  font-size: 24px;
  margin-bottom: 15px;
}

.gift-modal-divider {
  width: 60px;
  height: 1.5px;
  background: var(--c-gold-primary);
  margin: 0 auto 25px auto;
  opacity: 0.7;
}

.gift-modal-body-text {
  font-family: var(--f-script);
  font-size: 20px;
  line-height: 1.6;
  color: var(--c-white);
  max-height: 50vh;
  overflow-y: auto;
  padding: 0 10px;
}

.gift-modal-body-text strong {
  color: var(--c-gold-primary);
}

/* =========================================================================
   EXPLORATION PROGRESS TRACKER
========================================================================= */
#exploration-tracker {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 280px;
  background: rgba(15, 15, 15, 0.95);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 15px rgba(212, 175, 55, 0.05);
  z-index: 999;
  backdrop-filter: blur(10px);
  transition: transform 0.4s ease, height 0.4s ease;
  overflow: hidden;
}

#tracker-toggle {
  width: 100%;
  background: none;
  border: none;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: var(--c-white);
  font-family: var(--f-body);
  text-align: left;
}

.tracker-title {
  font-size: 13px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-grow: 1;
}

#tracker-percent {
  font-size: 13px;
  font-weight: bold;
  color: var(--c-gold-primary);
  background: rgba(212, 175, 55, 0.1);
  padding: 2px 8px;
  border-radius: 12px;
}

.tracker-arrow {
  color: var(--c-text-muted);
  font-size: 10px;
  transition: transform 0.3s;
}

#exploration-tracker.collapsed .tracker-arrow {
  transform: rotate(180deg);
}

.tracker-content {
  padding: 0 18px 18px 18px;
  display: block;
  transition: max-height 0.4s ease;
  max-height: 300px;
}

#exploration-tracker.collapsed .tracker-content {
  max-height: 0;
  padding-bottom: 0;
  overflow: hidden;
}

.tracker-progress-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 15px;
}

#tracker-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--c-gold-primary), var(--c-gold-light));
  transition: width 0.5s ease;
}

.tracker-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tracker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--c-text-muted);
  transition: color 0.3s;
}

.tracker-item.completed {
  color: var(--c-white);
  text-decoration: line-through;
  text-decoration-color: rgba(212, 175, 55, 0.5);
}

.tracker-item .checkbox {
  width: 14px;
  height: 14px;
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  transition: all 0.3s;
}

.tracker-item.completed .checkbox {
  background: var(--c-gold-primary);
  border-color: var(--c-gold-primary);
}

.tracker-item.completed .checkbox::after {
  content: '✓';
  color: var(--c-black-bg);
  font-size: 10px;
  font-weight: bold;
}

/* =========================================================================
   VOICE MESSAGE
========================================================================= */
.audio-player-card { background: var(--c-dark-bg); border: 1px solid rgba(212,175,55,0.3); padding: 40px; border-radius: var(--radius-lg); text-align: center; max-width: 400px; margin: 0 auto; }
.audio-label { font-size: 16px; color: var(--c-gold-light); margin-bottom: 30px; text-transform: uppercase; letter-spacing: 2px; }
.waveform { display: flex; align-items: center; justify-content: center; gap: 5px; height: 60px; margin-bottom: 30px; }
.bar { width: 6px; height: 10px; background: var(--c-gold-primary); border-radius: 3px; transition: height 0.1s; }
.playing .bar { animation: wave 1s infinite alternate; }
.playing .bar:nth-child(2) { animation-delay: 0.1s; }
.playing .bar:nth-child(3) { animation-delay: 0.2s; }
.playing .bar:nth-child(4) { animation-delay: 0.3s; }
.playing .bar:nth-child(5) { animation-delay: 0.4s; }
.playing .bar:nth-child(6) { animation-delay: 0.5s; }
.playing .bar:nth-child(7) { animation-delay: 0.4s; }
.playing .bar:nth-child(8) { animation-delay: 0.3s; }
.playing .bar:nth-child(9) { animation-delay: 0.2s; }
.playing .bar:nth-child(10) { animation-delay: 0.1s; }
@keyframes wave { 0% { height: 10px; } 100% { height: 50px; } }

/* =========================================================================
   CAKE SECTION
========================================================================= */
.cake-hidden { display: none !important; }
.security-check-card { background: #111; border: 2px solid #ff3333; padding: 40px; border-radius: var(--radius-lg); text-align: center; }
.security-check-card h2 { color: #ff3333; margin-bottom: 20px; font-family: var(--f-heading); }
.security-check-card p { margin-bottom: 20px; font-size: 18px; }
.ricky-approved { color: #4CAF50 !important; font-size: 20px !important; font-weight: bold; margin-top: 20px !important; }

.cake-wrap { position: relative; width: 300px; height: 350px; margin: 0 auto 40px; perspective: 1000px; }
.cake-svg { width: 100%; height: 100%; display: block; }
.candle-flame { animation: flicker 0.1s infinite alternate; transform-origin: center bottom; }
@keyframes flicker { 0% { transform: scale(1) rotate(-1deg); opacity: 0.9; } 100% { transform: scale(1.1) rotate(2deg); opacity: 1; } }
#candle-glow { animation: pulseGlow 2s infinite alternate; }
@keyframes pulseGlow { 0% { opacity: 0.6; r: 40; } 100% { opacity: 1; r: 60; } }

.cake-controls { text-align: center; }
.btn-row { display: flex; gap: 20px; justify-content: center; margin-top: 20px; }
.wish-toast { font-family: var(--f-script); font-size: 28px; color: var(--c-gold-light); text-align: center; margin-top: 40px; opacity: 0; transition: opacity 1s; }
.wish-toast.show { opacity: 1; }

#smoke-container { position: absolute; top: 50px; left: 0; width: 100%; height: 100px; pointer-events: none; }
.smoke-particle { position: absolute; background: rgba(255,255,255,0.4); border-radius: 50%; filter: blur(5px); opacity: 0; animation: riseSmoke 3s ease-in forwards; }
@keyframes riseSmoke { 0% { transform: translateY(0) scale(1); opacity: 0.8; } 100% { transform: translateY(-100px) scale(3); opacity: 0; } }

/* =========================================================================
   EMOTIONAL DETECTOR
========================================================================= */
.emotional-card { text-align: center; padding: 50px; background: linear-gradient(135deg, rgba(20,20,20,0.9), rgba(5,5,5,0.9)); border-radius: var(--radius-lg); border: 1px solid rgba(212,175,55,0.2); }
.emotional-card h2 { font-family: var(--f-heading); font-size: 36px; margin-bottom: 30px; }
.emo-btns { display: flex; gap: 20px; justify-content: center; }
.emo-result { margin-top: 30px; font-size: 24px; font-family: var(--f-script); color: var(--c-gold-light); }

/* =========================================================================
   GRAND FINALE
========================================================================= */
#finale-overlay { background: #020202; }
#finale-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; }
.finale-close-btn { position: absolute; top: 20px; right: 20px; background: none; border: none; font-size: 40px; color: var(--c-white); cursor: pointer; z-index: 10; opacity: 0.5; }
.finale-content { position: relative; z-index: 2; text-align: center; max-width: 800px; padding: 20px; display: flex; flex-direction: column; gap: 40px; }
.finale-big-title { font-family: var(--f-heading); font-size: clamp(3rem, 8vw, 6rem); line-height: 1.1; color: var(--c-gold-primary); text-shadow: 0 0 20px rgba(212,175,55,0.5); }
.finale-big-title span { display: block; }
.finale-message { font-family: var(--f-script); font-size: 24px; line-height: 1.6; color: var(--c-white); }
.finale-signature { font-family: var(--f-body); font-size: 18px; color: var(--c-gold-light); text-transform: uppercase; letter-spacing: 3px; }

/* Balloons */
.balloon { position: absolute; bottom: -200px; width: 60px; height: 80px; border-radius: 50%; background: #D4AF37; opacity: 0.8; z-index: 1; animation: floatBalloon 15s infinite ease-in; }
.balloon::before { content: ''; position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); width: 2px; height: 100px; background: rgba(255,255,255,0.3); }
.balloon-1 { left: 10%; background: #ff9ec6; animation-delay: 0s; }
.balloon-2 { left: 30%; background: #D4AF37; animation-delay: 2s; }
.balloon-3 { left: 50%; background: #fff; animation-delay: 5s; }
.balloon-4 { left: 70%; background: #87CEEB; animation-delay: 1s; }
.balloon-5 { left: 85%; background: #FFD700; animation-delay: 4s; }
.balloon-6 { left: 20%; background: #ff6b6b; animation-delay: 7s; }
@keyframes floatBalloon { 0% { transform: translateY(0) translateX(0) rotate(0); } 33% { transform: translateY(-30vh) translateX(20px) rotate(5deg); } 66% { transform: translateY(-70vh) translateX(-20px) rotate(-5deg); } 100% { transform: translateY(-120vh) translateX(0) rotate(0); } }

/* =========================================================================
   LIGHTBOX & FOOTER
========================================================================= */
.lightbox-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95); z-index: var(--z-floating); display: none; justify-content: center; align-items: center; backdrop-filter: blur(5px); opacity: 0; transition: opacity 0.3s; }
.lightbox-overlay.show { display: flex; opacity: 1; }
.lightbox-img { max-width: 90%; max-height: 90vh; border-radius: var(--radius-sm); border: 1px solid var(--c-gold-primary); box-shadow: 0 0 30px rgba(212,175,55,0.2); }
.lightbox-close { position: absolute; top: 20px; right: 30px; font-size: 40px; color: var(--c-white); cursor: pointer; transition: color 0.3s; }
.lightbox-close:hover { color: var(--c-gold-primary); }

.footer { text-align: center; padding: 60px 20px; background: #050505; position: relative; z-index: 10; font-family: var(--f-script); font-size: 24px; color: var(--c-gold-light); }
.gold-divider { width: 100px; height: 1px; background: var(--c-gold-primary); margin: 0 auto 30px; opacity: 0.5; }
.footer-credit { font-family: var(--f-body); font-size: 12px; text-transform: uppercase; letter-spacing: 2px; color: var(--c-text-muted); margin-top: 20px; }

/* =========================================================================
   STEP-BY-STEP NAVIGATION
========================================================================= */
.step-nav {
  position: fixed; top: 50%; right: 30px; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 20px; z-index: var(--z-floating);
}
.step-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.2); border: 2px solid transparent;
  cursor: pointer; position: relative; transition: all 0.3s ease;
}
.step-dot.active {
  background: var(--c-gold-primary); border-color: var(--c-white);
  box-shadow: 0 0 10px var(--c-gold-primary); transform: scale(1.3);
}
.step-label {
  position: absolute; right: 25px; top: 50%; transform: translateY(-50%);
  background: rgba(15, 15, 15, 0.9); padding: 5px 12px; border-radius: 4px;
  border: 1px solid rgba(212,175,55,0.3); color: var(--c-gold-light);
  font-size: 12px; text-transform: uppercase; letter-spacing: 1px;
  opacity: 0; pointer-events: none; transition: all 0.3s ease;
  white-space: nowrap;
}
.step-dot:hover .step-label { opacity: 1; transform: translateY(-50%) translateX(-10px); }
.step-dot::before {
  content: ''; position: absolute; top: -20px; left: 5px;
  width: 2px; height: 20px; background: rgba(255,255,255,0.1);
}
.step-dot:first-child::before { display: none; }
.step-dot.active::before, .step-dot.active ~ .step-dot::before {
  background: linear-gradient(to bottom, var(--c-gold-primary), rgba(255,255,255,0.1));
}


/* =========================================================================
   GLOBAL TOUCH & CURSOR FIXES
========================================================================= */
/* Prevent double-tap zoom on all interactive elements */
button, a, .gold-btn, .ver-btn, .polaroid-item, .gift-3d, .envelope-wrapper, 
.step-dot, .lightbox-close, #sound-toggle, .emo-btns button, .gift-close-btn, .notif-close-btn {
  touch-action: manipulation;
}

/* Only apply cursor:none when custom cursor is active (desktop) */
/* Override the hardcoded cursor:none on specific elements for mobile */
@media (hover: none) and (pointer: coarse) {
  .gold-btn, .lightbox-close, .envelope-wrapper, .gift-3d, .step-dot,
  #sound-toggle, .polaroid-item, .scratch-hint, #scratch-canvas {
    cursor: auto !important;
  }
}

/* =========================================================================
   MOBILE RESPONSIVENESS
========================================================================= */
@media (max-width: 768px) {
  /* --- Hero & Section Titles --- */
  .hero-name { font-size: 2.5rem; }
  .section-title { font-size: 2rem; }
  
  /* --- About & Family Grids --- */
  .about-grid { grid-template-columns: 1fr; }
  .family-cards { grid-template-columns: 1fr; }
  
  /* --- Timeline --- */
  .timeline-line { left: 20px; }
  .timeline-dot { left: 15px; }
  .timeline-item { padding-left: 50px; }
  
  /* --- Timer (Floating Card) --- */
  .floating-card { 
    bottom: auto; top: 15px; right: 10px; left: 10px;
    z-index: var(--z-floating);
    max-width: calc(100vw - 20px);
    min-width: unset;
  }
  
  /* --- Achievement Toast --- */
  .achievement-toast { 
    bottom: 95px; right: 10px; left: 10px;
    max-width: calc(100vw - 20px);
    box-sizing: border-box;
  }
  
  /* --- Dynamic Notification Stack --- */
  #notification-container { 
    top: 75px; right: 10px; left: 10px;
    width: auto;
    max-width: calc(100vw - 20px);
  }
  
  .ricky-notification {
    padding: 12px 15px;
  }
  
  .ricky-desc {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
  }
  
  .notif-close-btn {
    width: 30px;
    height: 30px;
    font-size: 20px;
    min-width: 30px;
  }

  /* --- Notification Center Toggle & Panel --- */
  #notif-center-toggle {
    bottom: 20px;
    left: auto;
    right: 20px; /* Swapped to right side on mobile to prevent overlapping music-toggle at left */
  }

  #notif-history-panel {
    width: 100vw;
    right: -100vw;
  }
  
  /* --- Step Nav --- */
  .step-nav { display: none; }
  
  /* --- Letter Section (Full-screen on mobile) --- */
  .envelope-wrapper {
    width: 260px;
    height: 180px;
  }
  .envelope-pocket {
    border-left-width: 130px;
    border-right-width: 130px;
    border-bottom-width: 90px;
  }
  .envelope-flap {
    border-left-width: 130px;
    border-right-width: 130px;
    border-top-width: 90px;
  }
  
  /* When letter is opened on mobile, make it a fixed full-screen overlay */
  .envelope-wrapper.open {
    position: fixed;
    top: 0; left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: none;
  }
  .envelope-wrapper.open .envelope-front,
  .envelope-wrapper.open .envelope-pocket,
  .envelope-wrapper.open .envelope-flap {
    display: none;
  }
  .envelope-wrapper.open .letter-paper {
    position: relative;
    transform: none !important;
    width: 92vw !important;
    max-width: 500px;
    height: auto !important;
    max-height: 85vh;
    left: auto !important;
    top: auto !important;
    z-index: 10001;
    padding: 30px 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  }
  .envelope-wrapper.open #close-letter-btn {
    display: block !important;
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 10002;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(212, 175, 55, 0.5);
  }
  .letter-content {
    font-size: 16px;
  }
  .letter-header {
    font-size: 20px;
  }
  .signature {
    font-size: 18px;
  }
  
  /* --- Polaroid Gallery --- */
  .polaroid-gallery {
    gap: 25px;
  }
  .polaroid-item {
    width: calc(100vw - 60px);
    max-width: 300px;
  }
  .polaroid-img-wrap {
    height: 250px;
  }
  .gallery-subtitle {
    font-size: 11px;
    letter-spacing: 1.5px;
  }
  
  /* --- Gift Section --- */
  .gifts-3d-container {
    gap: 100px;
    margin-top: 30px;
  }

  .gift-modal-content {
    padding: 30px 20px;
    max-width: 90%;
  }

  .gift-modal-body-text {
    font-size: 17px;
  }
  
  /* --- Exploration Tracker --- */
  #exploration-tracker {
    bottom: auto;
    top: auto;
    bottom: 80px;
    right: 10px;
    left: 10px;
    width: auto;
    max-width: calc(100vw - 20px);
  }

  #exploration-tracker.collapsed {
    max-height: 45px;
  }
  
  /* --- Scratch Card --- */
  .scratch-card-wrapper {
    width: calc(100vw - 60px);
    max-width: 300px;
  }
  
  /* --- Cake Section --- */
  .btn-row {
    flex-direction: column;
    gap: 12px;
    align-items: center;
  }
  .wish-toast {
    font-size: 22px;
    padding: 0 15px;
  }
  
  /* --- Verification --- */
  .verification-container {
    padding: 25px 15px;
  }
  .verification-options {
    grid-template-columns: 1fr;
  }
  
  /* --- AI Card --- */
  .ai-card {
    padding: 25px 15px;
  }
  .ai-results p {
    font-size: 13px;
    flex-wrap: wrap;
    gap: 5px;
  }
  
  /* --- Emotional Detector --- */
  .emotional-card {
    padding: 30px 20px;
  }
  .emotional-card h2 {
    font-size: 28px;
  }
  .emo-btns {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  
  /* --- Emergency Modal --- */
  .emergency-content {
    margin: 20px;
    padding: 30px 20px;
    max-width: calc(100vw - 40px);
  }
  .emergency-options {
    gap: 10px;
  }
  .emergency-options .gold-btn {
    min-width: 180px;
    font-size: 14px;
    padding: 10px 20px;
  }
  .emergency-title {
    font-size: 22px;
  }
  .emergency-time {
    font-size: 24px;
  }
  
  /* --- Lightbox --- */
  .lightbox-img {
    max-width: 95%;
  }
  .lightbox-close {
    top: 10px;
    right: 15px;
    font-size: 32px;
  }
  
  /* --- Voice Message --- */
  .audio-player-card {
    padding: 30px 20px;
    max-width: calc(100vw - 40px);
  }
  
  /* --- Footer --- */
  .footer {
    font-size: 20px;
    padding: 40px 15px;
  }
  
  /* --- Intro --- */
  .intro-subtitle {
    font-size: 18px;
    padding: 0 10px;
  }
  .intro-date-wrapper {
    max-width: calc(100vw - 40px);
    padding: 14px 20px;
  }
  .intro-date-label {
    font-size: 18px;
  }
  
  /* --- Family Cards --- */
  .family-card {
    padding: 25px 20px;
  }
  .family-message {
    font-size: 18px;
  }
  
  /* --- Content sections padding --- */
  .content-section {
    padding: 60px 15px;
  }
}

/* Extra small screens (iPhone SE etc.) */
@media (max-width: 375px) {
  .hero-name { font-size: 2rem; }
  .section-title { font-size: 1.7rem; }
  .intro-hero-title { font-size: clamp(2.2rem, 8vw, 3.5rem) !important; }
  
  .envelope-wrapper {
    width: 230px;
    height: 160px;
  }
  .envelope-pocket {
    border-left-width: 115px;
    border-right-width: 115px;
    border-bottom-width: 80px;
  }
  .envelope-flap {
    border-left-width: 115px;
    border-right-width: 115px;
    border-top-width: 80px;
  }
  
  .polaroid-item {
    width: calc(100vw - 40px);
  }
  
  .gift-modal-content {
    width: 95% !important;
  }
  
  .stat-number {
    font-size: 3rem;
  }
  .stat-text {
    font-size: 1.8rem;
    min-height: 3rem;
  }
  
  .gifts-3d-container {
    gap: 50px;
  }
}

/* =========================================================================
   PREFERS REDUCED MOTION
========================================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
