/* ==========================================================================
   CSS variables for themes, colors and fonts
   ========================================================================== */
:root {
  --primary-pink: hsl(348, 100%, 73%);
  --primary-pink-dark: hsl(348, 90%, 65%);
  --soft-lavender: hsl(265, 80%, 88%);
  --soft-peach: hsl(20, 100%, 92%);
  --sparkle-gold: hsl(45, 100%, 60%);
  --dark-plum: hsl(280, 50%, 20%);
  
  --bg-gradient: linear-gradient(135deg, hsl(320, 100%, 94%) 0%, hsl(265, 90%, 92%) 100%);
  --glass-bg: rgba(255, 255, 255, 0.45);
  --glass-border: rgba(255, 255, 255, 0.55);
  --glass-shadow: 0 8px 32px 0 rgba(255, 94, 126, 0.12);
  
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Montserrat', sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
}

/* Theme Overrides */
body[data-theme="purple"] {
  --primary-pink: hsl(270, 100%, 75%);
  --primary-pink-dark: hsl(270, 90%, 65%);
  --glass-shadow: 0 8px 32px 0 rgba(168, 85, 247, 0.15);
  --bg-gradient: linear-gradient(135deg, hsl(280, 100%, 94%) 0%, hsl(240, 90%, 92%) 100%);
}

body[data-theme="blue"] {
  --primary-pink: hsl(210, 100%, 73%);
  --primary-pink-dark: hsl(210, 90%, 63%);
  --glass-shadow: 0 8px 32px 0 rgba(59, 130, 246, 0.15);
  --bg-gradient: linear-gradient(135deg, hsl(210, 100%, 94%) 0%, hsl(180, 90%, 92%) 100%);
}

body[data-theme="mint"] {
  --primary-pink: hsl(150, 80%, 65%);
  --primary-pink-dark: hsl(150, 90%, 55%);
  --glass-shadow: 0 8px 32px 0 rgba(16, 185, 129, 0.15);
  --bg-gradient: linear-gradient(135deg, hsl(150, 100%, 94%) 0%, hsl(100, 90%, 92%) 100%);
}

body[data-theme="gold"] {
  --primary-pink: hsl(40, 100%, 65%);
  --primary-pink-dark: hsl(40, 90%, 55%);
  --glass-shadow: 0 8px 32px 0 rgba(245, 158, 11, 0.15);
  --bg-gradient: linear-gradient(135deg, hsl(45, 100%, 94%) 0%, hsl(25, 90%, 92%) 100%);
}

/* ==========================================================================
   Global Resets
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent; /* Disable touch blue outline in Chrome */
}

body, html {
  width: 100%;
  height: 100%;
  font-family: var(--font-body);
  background: var(--bg-gradient);
  color: var(--dark-plum);
  overflow: hidden;
  position: relative;
}

/* ==========================================================================
   Floating Background Hearts
   ========================================================================== */
#hearts-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.bg-heart {
  position: absolute;
  bottom: -50px;
  color: rgba(255, 94, 126, 0.25);
  animation: floatUp 12s linear infinite;
}

@keyframes floatUp {
  0% {
    transform: translateY(0) rotate(0deg) scale(0.6);
    opacity: 0;
  }
  10% {
    opacity: 0.8;
  }
  90% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(-110vh) rotate(360deg) scale(1.3);
    opacity: 0;
  }
}

/* ==========================================================================
   Confetti Canvas
   ========================================================================== */
#confetti-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99;
  pointer-events: none;
}

/* ==========================================================================
   CAT INTRO POPUP — Card Style
   ========================================================================== */
.cat-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 5, 40, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.cat-popup-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.cat-popup-overlay.dismiss {
  opacity: 0;
  transition: opacity 0.35s ease;
}

/* The white card */
.cat-popup-card {
  background: #fff;
  border-radius: 32px;
  padding: 28px 24px 22px;
  width: 82%;
  max-width: 310px;
  text-align: center;
  box-shadow:
    0 0 0 3px rgba(255,255,255,0.2),
    0 20px 60px rgba(0,0,0,0.45),
    0 0 50px rgba(255, 94, 126, 0.35);
  animation: cardPop 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes cardPop {
  0%   { transform: scale(0.72) translateY(30px); opacity: 0; }
  100% { transform: scale(1) translateY(0);        opacity: 1; }
}

/* Cat image — no cropping, full image visible */
.cat-popup-gif {
  width: 100%;
  max-width: 230px;
  height: auto;
  display: block;
  margin: 0 auto 14px;
  border-radius: 16px;
  image-rendering: -webkit-optimize-contrast;
}

.cat-popup-heading {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--dark-plum);
  margin-bottom: 8px;
}

.cat-tap-hint {
  font-size: 0.82rem;
  color: rgba(80, 30, 80, 0.6);
  font-family: var(--font-body);
  animation: hintPulse 2s ease-in-out infinite;
}

@keyframes hintPulse {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1; }
}

/* ==========================================================================
   Screen Management (Unlock & Main App)
   ========================================================================== */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.screen.hidden {
  opacity: 0;
  transform: scale(0.92);
  pointer-events: none;
  z-index: 0;
}

.screen.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
  z-index: 10;
}

/* ==========================================================================
   LOCK SCREEN STYLE
   ========================================================================== */
#lock-screen {
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: var(--bg-gradient);
  user-select: none;
  -webkit-user-select: none;
}

.lock-card {
  width: 100%;
  max-width: 350px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 30px;
  padding: 30px 20px;
  text-align: center;
  box-shadow: var(--glass-shadow);
  z-index: 5;
  animation: lockEntrance 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes lockEntrance {
  0% { transform: translateY(50px) scale(0.9); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.lock-avatar {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: radial-gradient(circle, var(--primary-pink) 0%, var(--primary-pink-dark) 100%);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 8px 20px rgba(255, 94, 126, 0.3);
}

.pulse-icon {
  font-size: 2.2rem;
  color: white;
  animation: pulseScale 2s infinite ease-in-out;
}

@keyframes pulseScale {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.lock-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--dark-plum);
  margin-bottom: 8px;
}

.lock-subtitle {
  font-size: 0.9rem;
  color: rgba(60, 20, 60, 0.7);
  line-height: 1.4;
  margin-bottom: 25px;
}

.passcode-dots {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 25px;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--primary-pink);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.dot.filled {
  background-color: var(--primary-pink);
  transform: scale(1.25);
  box-shadow: 0 0 10px rgba(255, 94, 126, 0.5);
}

.passcode-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 260px;
  margin: 0 auto 20px;
}

.key {
  height: 60px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.5);
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--dark-plum);
  cursor: pointer;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s, transform 0.15s;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.key:active {
  background-color: var(--primary-pink);
  color: white;
  transform: scale(0.9);
}

.check-key {
  color: var(--primary-pink);
}
.check-key:active {
  background-color: var(--primary-pink-dark);
}

.lock-hint {
  font-size: 0.75rem;
  color: rgba(60, 20, 60, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

/* Shaking animation on wrong passcode */
.shake {
  animation: shakeEffect 0.5s ease-in-out;
}

@keyframes shakeEffect {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

/* ==========================================================================
   MAIN APPLICATION
   ========================================================================== */
#main-app {
  height: 100%;
}

.app-header {
  height: 65px;
  padding: 0 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 8;
  flex-shrink: 0;
}

.music-controller {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--primary-pink) 0%, var(--primary-pink-dark) 100%);
  color: white;
  padding: 6px 14px;
  border-radius: 20px;
  box-shadow: 0 4px 10px rgba(255, 94, 126, 0.25);
  cursor: pointer;
  transition: transform 0.2s;
}

.music-controller:active {
  transform: scale(0.95);
}

.music-controller.playing i {
  animation: musicSpin 3s linear infinite;
}

@keyframes musicSpin {
  100% { transform: rotate(360deg); }
}

.app-logo {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  font-style: italic;
  color: var(--primary-pink-dark);
}

.text-gold {
  color: var(--sparkle-gold);
  font-size: 1.2rem;
  animation: spinGold 4s linear infinite;
}

@keyframes spinGold {
  50% { transform: scale(1.2); opacity: 0.8; }
}

.app-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 20px 20px 85px 20px; /* offset bottom nav */
  z-index: 5;
  -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   PROGRESS BAR & STAGE STYLES
   ========================================================================== */
.progress-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: 90px;
}

.progress-outer {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 94, 126, 0.15);
}

.progress-inner {
  height: 100%;
  background: linear-gradient(to right, var(--primary-pink), var(--primary-pink-dark));
  border-radius: 4px;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.progress-label {
  font-size: 0.58rem;
  font-weight: 700;
  color: rgba(60, 20, 60, 0.5);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.journey-stage {
  display: none;
}

.journey-stage.active-stage {
  display: block;
  animation: slideInStage 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideInStage {
  0% { transform: translateX(25px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  color: var(--dark-plum);
  margin-bottom: 6px;
}

.section-desc {
  font-size: 0.85rem;
  color: rgba(60, 20, 60, 0.6);
  text-align: center;
  margin-bottom: 25px;
  line-height: 1.4;
  padding: 0 10px;
}

/* ==========================================================================
   JOURNEY FOOTER & ACTION BUTTONS
   ========================================================================== */
.app-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 70px;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  padding-bottom: env(safe-area-inset-bottom, 10px);
  z-index: 10;
}

.footer-btn {
  padding: 8px 18px;
  border-radius: 20px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  user-select: none;
}

.footer-btn.primary {
  background: linear-gradient(135deg, var(--primary-pink) 0%, var(--primary-pink-dark) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(255, 94, 126, 0.25);
}

.footer-btn.primary:active {
  transform: scale(0.95);
}

.footer-btn.secondary {
  background: rgba(60, 20, 60, 0.05);
  color: var(--dark-plum);
}

.footer-btn.secondary:active {
  background: rgba(60, 20, 60, 0.1);
  transform: scale(0.95);
}

.footer-btn.hidden {
  opacity: 0;
  pointer-events: none;
}

.footer-spacer {
  flex-grow: 1;
}

.action-container {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  margin-bottom: 25px;
}

.journey-next-btn {
  background: linear-gradient(135deg, var(--primary-pink) 0%, var(--primary-pink-dark) 100%);
  color: white;
  border: none;
  border-radius: 25px;
  padding: 12px 32px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(255, 94, 126, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.journey-next-btn:active {
  transform: scale(0.95);
}

.glow-btn {
  animation: heartPulse-btn 2s infinite ease-in-out;
}

@keyframes heartPulse-btn {
  0%, 100% { box-shadow: 0 6px 18px rgba(255, 94, 126, 0.3); }
  50% { box-shadow: 0 8px 24px rgba(255, 94, 126, 0.55); transform: scale(1.03); }
}

.celebration-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary-pink-dark);
  background: rgba(255, 94, 126, 0.12);
  padding: 6px 18px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 auto 15px;
  text-align: center;
}

.final-card {
  background: linear-gradient(135deg, var(--dark-plum) 0%, #17001d 100%);
  color: white;
  border-radius: 26px;
  padding: 26px 20px;
  text-align: center;
  box-shadow: 0 12px 30px rgba(21, 0, 26, 0.25);
  position: relative;
  overflow: hidden;
  border: 1.5px solid rgba(255, 94, 126, 0.2);
}

.final-card h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 12px;
  background: linear-gradient(to right, #ffffff, var(--primary-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.final-card p {
  font-size: 0.85rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 15px;
}

.final-emoji {
  font-size: 1.8rem;
  letter-spacing: 6px;
}

.game-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--primary-pink-dark);
  background: rgba(255, 94, 126, 0.1);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 10px;
  text-transform: uppercase;
}

/* ==========================================================================
   SECTION: HOME STYLING
   ========================================================================== */
.animate-fade-in {
  opacity: 0;
  transform: translateY(15px);
  animation: smoothFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fade-in:nth-child(2) { animation-delay: 0.15s; }
.animate-fade-in:nth-child(3) { animation-delay: 0.3s; }

@keyframes smoothFade {
  100% { opacity: 1; transform: translateY(0); }
}

.welcome-card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 20px;
  text-align: center;
  box-shadow: var(--glass-shadow);
  margin-bottom: 20px;
}

.cake-image-container {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 18px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.04);
}

.cover-image {
  width: 100%;
  height: auto;
  display: block;
}

.card-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-pink-dark);
  background: rgba(255, 94, 126, 0.15);
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.wishes-heading {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.3;
}

.wishes-text {
  font-size: 0.88rem;
  line-height: 1.5;
  color: rgba(60, 20, 60, 0.8);
}

.letter-card {
  background: rgba(255, 255, 255, 0.55);
  border: 1px dashed rgba(255, 94, 126, 0.4);
  border-radius: 24px;
  padding: 24px 20px;
  box-shadow: var(--glass-shadow);
  margin-bottom: 20px;
  position: relative;
}

.letter-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(255, 94, 126, 0.15);
  padding-bottom: 10px;
}

.letter-icon {
  font-size: 1.4rem;
  color: var(--primary-pink-dark);
}

.letter-header h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
}

.letter-body {
  line-height: 1.6;
  font-size: 0.92rem;
  color: var(--dark-plum);
}

.italic-text {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  margin-bottom: 12px;
}

.letter-signature {
  text-align: right;
  font-family: var(--font-serif);
  font-weight: bold;
  font-size: 1rem;
  color: var(--primary-pink-dark);
}

.countdown-card {
  background: linear-gradient(135deg, var(--dark-plum) 0%, #15001a 100%);
  color: white;
  border-radius: 24px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 10px 25px rgba(21, 0, 26, 0.2);
  margin-bottom: 20px;
  overflow: hidden;
  position: relative;
}

.countdown-card h4 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  z-index: 2;
  position: relative;
}

.floating-mini-hearts {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 10px;
}

.floating-heart-mini {
  font-size: 1.1rem;
  animation: heartWiggle 2s infinite ease-in-out;
}

.floating-heart-mini:nth-child(2) { animation-delay: 0.4s; }
.floating-heart-mini:nth-child(3) { animation-delay: 0.8s; }

.text-pink { color: var(--primary-pink); }
.text-lavender { color: var(--soft-lavender); }

@keyframes heartWiggle {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(15deg); }
}

/* ==========================================================================
   SECTION: GALLERY (Polaroid deck)
   ========================================================================== */
.polaroid-container {
  display: flex;
  justify-content: center;
  width: 100%;
  perspective: 1000px;
  padding-bottom: 25px;
}

.polaroid-wrapper {
  display: flex;
  flex-direction: column;
  gap: 30px;
  width: 100%;
  max-width: 320px;
}

/* Card 3D Flip Mechanics */
.polaroid-card {
  width: 100%;
  height: 380px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
}

.polaroid-card.flipped {
  transform: rotateY(180deg);
}

.polaroid-front, .polaroid-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: white;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0,0,0,0.05);
}

.polaroid-front {
  z-index: 2;
  transform: rotate(0deg);
}

.polaroid-back {
  transform: rotateY(180deg);
  background: radial-gradient(circle at top right, var(--soft-peach) 0%, white 100%);
  justify-content: center;
  align-items: center;
  text-align: center;
}

.photo-frame {
  width: 100%;
  flex-grow: 1;
  background-color: #f7f7f7;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.polaroid-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.red-tint {
  background: linear-gradient(135deg, #ffe3e8 0%, #ffc4cf 100%);
}

.violet-tint {
  background: linear-gradient(135deg, #eee3ff 0%, #d8c4ff 100%);
}

.placeholder-icon {
  font-size: 4rem;
  color: white;
  text-shadow: 0 4px 10px rgba(0,0,0,0.05);
  animation: pulseScale 3s infinite ease-in-out;
}

.polaroid-caption {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
  text-align: center;
  color: #554;
  padding-top: 15px;
  padding-bottom: 5px;
}

.polaroid-back-content {
  padding: 20px;
}

.polaroid-back-content i {
  font-size: 2.2rem;
  margin-bottom: 15px;
}

.polaroid-back-content h4 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.polaroid-back-content p {
  font-size: 0.88rem;
  line-height: 1.5;
  color: rgba(60, 20, 60, 0.85);
}

/* ==========================================================================
   SECTION: WISH JAR
   ========================================================================== */
.jar-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 260px;
  position: relative;
  margin-top: 10px;
  margin-bottom: 30px;
}

.jar-wrapper {
  width: 150px;
  height: 210px;
  position: relative;
  cursor: pointer;
  transform-origin: bottom center;
}

.jar-wrapper:active {
  animation: shakeJar 0.4s ease;
}

@keyframes shakeJar {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-8deg) scale(0.98); }
  75% { transform: rotate(8deg) scale(0.98); }
}

.jar-lid {
  width: 90px;
  height: 24px;
  background: linear-gradient(to right, #e6c587, #cfa862);
  border-radius: 8px 8px 3px 3px;
  margin: 0 auto;
  border-bottom: 2px solid #b5924d;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.jar-body {
  width: 140px;
  height: 180px;
  background: rgba(255, 255, 255, 0.25);
  border: 3px solid rgba(255, 255, 255, 0.6);
  border-top: none;
  border-radius: 10px 10px 40px 40px;
  margin: 0 auto;
  box-shadow: inset 0 8px 10px rgba(255, 255, 255, 0.4), 
              0 8px 20px rgba(0,0,0,0.06);
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.glass-reflection {
  position: absolute;
  top: 0;
  left: 10px;
  width: 15px;
  height: 90%;
  background: rgba(255, 255, 255, 0.4);
  transform: skewX(-10deg);
  border-radius: 10px;
  filter: blur(1px);
}

.jar-notes-inside {
  position: absolute;
  width: 100%;
  height: 100%;
}

.jar-note {
  position: absolute;
  width: 25px;
  height: 18px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transform: rotate(15deg);
}

.note-1 { background-color: var(--primary-pink); top: 120px; left: 30px; transform: rotate(-25deg); }
.note-2 { background-color: var(--soft-lavender); top: 130px; right: 28px; transform: rotate(15deg); }
.note-3 { background-color: #ffd8a8; top: 100px; left: 55px; transform: rotate(40deg); }
.note-4 { background-color: #ffc9c9; top: 140px; left: 62px; transform: rotate(-5deg); }

.jar-label {
  background: #fdfaf6;
  border: 1px dashed #b5924d;
  color: #7c5c22;
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: bold;
  padding: 4px 14px;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  z-index: 2;
  transform: rotate(-3deg);
  user-select: none;
}

.jar-glow {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.3) 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
  animation: glowPulse 2s infinite ease-in-out;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.2); }
}

/* Modal style Card for displayed Wish */
.wish-card {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 88%;
  max-width: 320px;
  background: white;
  border-radius: 28px;
  padding: 30px 24px;
  box-shadow: 0 15px 40px rgba(60, 20, 60, 0.25);
  z-index: 100;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wish-card.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.wish-card-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 28px;
  box-shadow: inset 0 0 25px rgba(255, 94, 126, 0.15);
  pointer-events: none;
}

.wish-index {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--primary-pink-dark);
  letter-spacing: 1px;
  background: rgba(255, 94, 126, 0.1);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 15px;
}

#wish-text {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--dark-plum);
  margin-bottom: 25px;
}

.wish-next-btn {
  background: linear-gradient(135deg, var(--primary-pink) 0%, var(--primary-pink-dark) 100%);
  border: none;
  border-radius: 25px;
  color: white;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 24px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 94, 126, 0.3);
  outline: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s;
}

.wish-next-btn:active {
  transform: scale(0.95);
}

/* ==========================================================================
   SECTION: COUPONS
   ========================================================================== */
.coupons-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.coupon-card {
  background: white;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 6px 15px rgba(0,0,0,0.03);
  border: 1px solid rgba(255, 94, 126, 0.15);
  position: relative;
  overflow: hidden;
  display: flex;
  transition: transform 0.3s, box-shadow 0.3s;
}

/* Ticket dashed separator lines */
.coupon-card::before, .coupon-card::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--bg-gradient);
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
  box-shadow: inset 0 0 4px rgba(0,0,0,0.05);
}
.coupon-card::before { left: -8px; }
.coupon-card::after { right: -8px; }

.coupon-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 8px;
  height: 100%;
  background: repeating-linear-gradient(to bottom, var(--primary-pink), var(--primary-pink) 6px, transparent 6px, transparent 12px);
}

.coupon-content {
  padding-left: 12px;
  padding-right: 8px;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.coupon-icon {
  font-size: 1.5rem;
  color: var(--primary-pink-dark);
  margin-bottom: 8px;
}

.coupon-content h4 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--dark-plum);
}

.coupon-content p {
  font-size: 0.8rem;
  line-height: 1.4;
  color: rgba(60, 20, 60, 0.7);
  margin-bottom: 12px;
  flex-grow: 1;
}

.redeem-btn {
  align-self: flex-start;
  background: var(--glass-bg);
  border: 1.5px solid var(--primary-pink);
  border-radius: 20px;
  color: var(--primary-pink-dark);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 16px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
}

.redeem-btn:active {
  transform: scale(0.95);
}

.coupon-badge {
  display: none;
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 600;
  color: #2b8a3e;
  background-color: #ebfbee;
  border: 1px solid #c3e6cb;
  padding: 4px 12px;
  border-radius: 20px;
  align-items: center;
  gap: 4px;
}

/* Coupon Redeemed State */
.coupon-card[data-redeemed="true"] {
  background: #fbfbfb;
  border-color: rgba(0,0,0,0.06);
  opacity: 0.8;
}

.coupon-card[data-redeemed="true"] .coupon-pattern {
  background: repeating-linear-gradient(to bottom, #ced4da, #ced4da 6px, transparent 6px, transparent 12px);
}

.coupon-card[data-redeemed="true"] .coupon-icon {
  color: #868e96;
}

.coupon-card[data-redeemed="true"] .redeem-btn {
  display: none;
}

.coupon-card[data-redeemed="true"] .coupon-badge {
  display: inline-flex;
}

.reset-coupons-container {
  display: flex;
  justify-content: center;
  margin-top: 30px;
  margin-bottom: 10px;
}

.reset-btn {
  background: transparent;
  border: none;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(60, 20, 60, 0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 10px;
  transition: background-color 0.2s;
}

.reset-btn:active {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--dark-plum);
}

/* ==========================================================================
   COUNTDOWN TIMER STYLES
   ========================================================================= */
.countdown-timer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  max-width: 280px;
  margin: 15px auto 20px;
}

.time-block {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.time-block span {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-pink);
  text-shadow: 0 0 10px rgba(255, 94, 126, 0.3);
}

.time-block label {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 600;
  margin-top: 4px;
  letter-spacing: 0.5px;
}

.cat-bubble {
  background: #fff0f3;
  border: 1px dashed var(--primary-pink);
  border-radius: 16px;
  padding: 10px 15px;
  font-size: 0.82rem;
  color: var(--primary-pink-dark);
  font-style: italic;
  margin: 12px auto;
  max-width: 280px;
  line-height: 1.4;
  box-shadow: 0 4px 10px rgba(255, 94, 126, 0.05);
}

/* Scratch Card Styles */
.scratch-container {
  position: relative;
  width: 100%;
  min-height: 180px;
  background: white;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.03);
}

#scratch-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 2;
  transition: opacity 0.4s ease;
  touch-action: none; /* Disable native touch scrolling on canvas scratch */
}

/* Cute Meter Clicker Game Styles */
.clicker-card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 22px 18px;
  text-align: center;
  box-shadow: var(--glass-shadow);
  margin-bottom: 20px;
}

.clicker-card h4 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--dark-plum);
}

.clicker-desc {
  font-size: 0.78rem;
  color: rgba(60, 20, 60, 0.6);
  margin-bottom: 15px;
}

.meter-container {
  width: 100%;
  height: 22px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  margin-bottom: 20px;
  border: 1.5px solid rgba(255, 94, 126, 0.25);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.03);
}

.meter-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(to right, var(--primary-pink), var(--primary-pink-dark));
  transition: width 0.15s cubic-bezier(0.1, 0.8, 0.2, 1);
}

.meter-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--dark-plum);
}

.clicker-heart-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--primary-pink) 0%, var(--primary-pink-dark) 100%);
  border: none;
  color: white;
  font-size: 2.1rem;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(255, 94, 126, 0.35);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  outline: none;
  transition: transform 0.1s, box-shadow 0.1s;
}

.clicker-heart-btn:active {
  transform: scale(0.9);
  box-shadow: 0 3px 8px rgba(255, 94, 126, 0.2);
}

.clicker-status {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary-pink-dark);
  margin-top: 15px;
  min-height: 20px;
}

/* Wish Popup Cat Image Styles */
.wish-cat-container {
  width: 90px;
  height: 90px;
  margin: 0 auto 12px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--primary-pink);
  box-shadow: 0 4px 10px rgba(255, 94, 126, 0.15);
}

.wish-popup-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Ambient: Theme Switcher */
.theme-switcher {
  display: flex;
  gap: 6px;
  align-items: center;
}
.theme-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
}
.theme-dot:hover {
  transform: scale(1.25);
}

/* Ambient: Shooting Stars */
.shooting-stars-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.shooting-star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: linear-gradient(90deg, #fff, transparent);
  animation: shoot 2.2s linear infinite;
  opacity: 0.8;
}
@keyframes shoot {
  0% {
    transform: rotate(-35deg) translateX(0) scale(1);
    opacity: 1;
  }
  100% {
    transform: rotate(-35deg) translateX(250px) scale(0);
    opacity: 0;
  }
}

/* Ambient: Future Misti Notification */
.future-notif {
  position: fixed;
  top: 15px;
  left: 5%;
  width: 90%;
  max-width: 320px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  transform: translateY(-80px);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.5s ease;
}
.future-notif.show {
  transform: translateY(0);
  opacity: 1;
}
.notif-inner {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  gap: 12px;
  position: relative;
}
.notif-icon {
  font-size: 1.5rem;
}
.notif-text {
  flex-grow: 1;
}
.notif-text strong {
  display: block;
  font-size: 0.82rem;
  color: var(--dark-plum);
  text-align: left;
}
.notif-text p {
  font-size: 0.76rem;
  color: rgba(60, 20, 60, 0.8);
  margin-top: 2px;
  text-align: left;
}
.notif-close {
  background: none;
  border: none;
  font-size: 1rem;
  color: rgba(60, 20, 60, 0.4);
  cursor: pointer;
  align-self: flex-start;
}

/* Welcome Stage: Age Counter */
.age-counter-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 16px;
  margin: 15px auto;
  max-width: 310px;
  box-shadow: var(--glass-shadow);
  text-align: center;
}
.age-counter-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary-pink-dark);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.age-counter-display {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 4px;
  margin: 8px 0;
}
.age-counter-display span {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--dark-plum);
}
.age-counter-display small {
  font-size: 0.68rem;
  color: rgba(60, 20, 60, 0.6);
  margin-right: 6px;
}

/* Stage: Love Letter */
.envelope-scene {
  position: relative;
  width: 100%;
  max-width: 300px;
  margin: 30px auto;
  height: 240px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.envelope {
  position: relative;
  width: 200px;
  height: 130px;
  background: #f87171;
  border-radius: 0 0 16px 16px;
  box-shadow: 0 12px 24px rgba(0,0,0,0.1);
  cursor: pointer;
  z-index: 10;
  transition: transform 0.4s ease;
}
.envelope:hover {
  transform: translateY(-4px) scale(1.02);
}
.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: 100px solid transparent;
  border-right: 100px solid transparent;
  border-top: 75px solid #ef4444;
  transform-origin: top;
  transition: transform 0.4s ease 0.2s, border-top-color 0.4s;
  z-index: 12;
}
.envelope.open .envelope-flap {
  transform: rotateX(180deg);
  border-top-color: #f87171;
  z-index: 8;
}
.envelope-body {
  position: absolute;
  inset: 0;
  background: #f87171;
  border-radius: 0 0 16px 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 11;
}
.envelope-heart {
  font-size: 2.2rem;
  animation: heartPulse-btn 1.5s infinite;
}
.love-letter {
  position: absolute;
  top: 15px;
  width: 190px;
  height: 180px;
  background: #fff;
  border-radius: 12px;
  padding: 16px 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.06);
  z-index: 9;
  transform: translateY(0);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.15s, opacity 0.35s ease 0.15s;
  overflow-y: auto;
  text-align: left;
}
.love-letter.reveal {
  position: fixed;
  top: 12vh;
  left: 50%;
  width: 90vw;
  max-width: 600px;
  height: auto;
  max-height: 80vh;
  transform: translateX(-50%);
  opacity: 1;
  z-index: 9999;
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 10px 50px rgba(0,0,0,0.5);
}

.love-letter.reveal .love-letter-header {
  font-size: 1.6rem;
  margin-bottom: 20px;
  border-bottom: 2px dashed var(--soft-lavender);
  padding-bottom: 10px;
}

.love-letter.reveal p {
  font-size: 1.15rem;
  line-height: 1.6;
  margin-bottom: 16px;
  color: #333;
}

.love-letter.reveal .love-letter-sign {
  font-size: 1.2rem;
  margin-top: 24px;
}
.love-letter-header {
  font-family: var(--font-serif);
  font-size: 0.72rem;
  color: var(--primary-pink-dark);
  border-bottom: 1px dashed var(--soft-lavender);
  padding-bottom: 4px;
  margin-bottom: 8px;
}
.love-letter p {
  font-size: 0.62rem;
  line-height: 1.4;
  color: rgba(60, 20, 60, 0.9);
  margin-bottom: 8px;
}
.love-letter-sign {
  font-size: 0.58rem;
  text-align: right;
  border-top: 1px dashed var(--soft-lavender);
  padding-top: 4px;
  color: var(--dark-plum);
}

/* Stage: 21 Reasons */
.reasons-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 310px;
  margin: 15px auto;
  max-height: 380px;
  overflow-y: auto;
  padding: 5px;
  /* Add padding-right to avoid scrollbar overlapping content */
  padding-right: 8px;
}
/* Custom sleek scrollbar for reasons list */
.reasons-list::-webkit-scrollbar {
  width: 5px;
}
.reasons-list::-webkit-scrollbar-track {
  background: transparent;
}
.reasons-list::-webkit-scrollbar-thumb {
  background: rgba(255, 94, 126, 0.4);
  border-radius: 10px;
}
.reasons-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 94, 126, 0.7);
}
.reason-item {
  display: flex;
  align-items: center;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 10px 14px;
  gap: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}
.reason-item.locked {
  background: rgba(255, 255, 255, 0.25);
  border: 1px dashed rgba(255, 255, 255, 0.45);
}
.reason-item.locked:active {
  transform: scale(0.97);
}
.reason-item.revealed {
  box-shadow: var(--glass-shadow);
  border-color: var(--primary-pink);
  background: white;
}
.reason-num {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-pink);
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
}
.reason-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--dark-plum);
  text-align: left;
}

/* Stage: Birthday Timeline */
.timeline {
  position: relative;
  max-width: 300px;
  margin: 20px auto;
  padding-left: 30px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--primary-pink-dark);
  opacity: 0.35;
}
.tl-item {
  position: relative;
  margin-bottom: 22px;
  cursor: pointer;
  text-align: left;
}
.tl-dot {
  position: absolute;
  left: -28px;
  top: 0;
  width: 18px;
  height: 18px;
  background: white;
  border: 2px solid var(--primary-pink);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.65rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}
.tl-item:hover .tl-dot {
  transform: scale(1.22);
}
.tl-content {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 10px 14px;
  transition: all 0.3s ease;
}
.tl-content strong {
  font-size: 0.8rem;
  color: var(--dark-plum);
  display: block;
}
.tl-detail {
  font-size: 0.72rem;
  color: rgba(60, 20, 60, 0.75);
  margin-top: 4px;
  display: none;
}
.tl-item.expanded .tl-content {
  background: white;
  box-shadow: var(--glass-shadow);
  border-color: var(--primary-pink);
}
.tl-item.expanded .tl-detail {
  display: block;
}

/* Stage: Guess the Memory Quiz */
.quiz-container {
  max-width: 310px;
  margin: 15px auto;
}
.quiz-card {
  background: white;
  border-radius: 24px;
  padding: 22px 18px;
  box-shadow: var(--glass-shadow);
  border: 1px solid var(--glass-border);
}
.quiz-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(0,0,0,0.05);
  border-radius: 3px;
  margin-bottom: 18px;
  overflow: hidden;
}
#quiz-prog-fill {
  height: 100%;
  background: var(--primary-pink);
  width: 0%;
  transition: width 0.3s ease;
}
.quiz-question {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dark-plum);
  margin-bottom: 18px;
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.quiz-opt-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 10px 14px;
  border-radius: 16px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--dark-plum);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}
.quiz-opt-btn:active {
  transform: scale(0.98);
}
.quiz-opt-btn.correct {
  background: #34d399;
  border-color: #10b981;
  color: white;
}
.quiz-opt-btn.wrong {
  background: #f87171;
  border-color: #ef4444;
  color: white;
}
.quiz-result {
  background: white;
  border-radius: 24px;
  padding: 28px 18px;
  box-shadow: var(--glass-shadow);
  text-align: center;
}
.quiz-result-emoji {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

/* ==========================================
   GIFT BOX → ENVELOPE → LETTER SYSTEM
   ========================================== */

/* === GIFT BOX SCENE === */
.gbox-scene {
  position: relative;
  width: 175px;
  margin: 14px auto 6px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  animation: gboxFloat 3s ease-in-out infinite;
}
.gbox-scene:hover { filter: brightness(1.06); }
@keyframes gboxFloat {
  0%,100% { transform: translateY(0) rotate(-1deg); }
  50%      { transform: translateY(-10px) rotate(1deg); }
}
.gbox-scene.shaking {
  animation: gboxShake 0.55s ease-in-out forwards;
}
@keyframes gboxShake {
  0%,100% { transform: translateX(0) rotate(0deg); }
  20% { transform: translateX(-8px) rotate(-4deg); }
  40% { transform: translateX(8px)  rotate(4deg); }
  60% { transform: translateX(-5px) rotate(-2deg); }
  80% { transform: translateX(5px)  rotate(2deg); }
}

/* Sparkle particles */
.gsp {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  font-size: 1rem;
  animation: gspAnim linear infinite;
}
.gs1 { left: -18px; top: 50%; animation-duration:3.8s; animation-delay:0.0s; }
.gs2 { left: 105%;  top: 35%; animation-duration:4.6s; animation-delay:0.9s; font-size:0.85rem; }
.gs3 { left: 30%;  top: 108%; animation-duration:4.2s; animation-delay:1.4s; }
.gs4 { left: 78%;  top: 108%; animation-duration:5.0s; animation-delay:0.4s; font-size:0.9rem; }
.gs5 { left: 110%; top: 65%; animation-duration:4.5s; animation-delay:2.0s; }
@keyframes gspAnim {
  0%   { transform: translateY(0) rotate(0deg); opacity:0; }
  12%  { opacity: 1; }
  88%  { opacity: 0.8; }
  100% { transform: translateY(-110px) rotate(380deg); opacity:0; }
}

/* BOX LID */
.gbox-lid {
  position: relative;
  width: 185px;
  margin-left: -5px;
  height: 34px;
  background: linear-gradient(135deg, #ff4d80, #d91450);
  border-radius: 9px 9px 3px 3px;
  box-shadow: 0 -4px 14px rgba(217,20,80,0.3), 0 5px 0 #b00e42;
  z-index: 4;
  transform-origin: top center;
  transition: transform 0.65s cubic-bezier(0.175,0.885,0.32,1.275), opacity 0.5s ease;
}
.gbox-lid-ribbon-v {
  position: absolute;
  left: 50%; top: 0;
  transform: translateX(-50%);
  width: 20px; height: 100%;
  background: linear-gradient(to right, #e8a000, #ffd040, #e8a000);
  opacity: 0.9;
}
.gbox-lid.fly-off {
  transform: translateY(-170px) rotate(-22deg) scale(1.06);
  opacity: 0;
}

/* BOW */
.gbox-bow {
  position: absolute;
  top: -48px; left: 50%;
  transform: translateX(-50%);
  width: 78px; height: 50px;
  z-index: 10;
}
.gbow-l, .gbow-r {
  position: absolute;
  width: 32px; height: 32px;
  border-radius: 50% 50% 50% 0;
  background: linear-gradient(135deg, #ffe040, #ffaa00);
  box-shadow: 0 2px 10px rgba(255,150,0,0.4);
  animation: gbowPulse 2.6s ease-in-out infinite;
}
.gbow-l { left:0;  transform: rotate(45deg); }
.gbow-r { right:0; transform: rotate(-45deg) scaleX(-1); animation-delay: 0.15s; }
.gbow-knot {
  position: absolute;
  top:50%; left:50%;
  transform: translate(-50%,-50%);
  width:15px; height:15px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff07a, #ffaa00);
  box-shadow: 0 0 12px rgba(255,200,0,0.7);
  z-index: 11;
}
.gbow-tail-l, .gbow-tail-r {
  position: absolute;
  bottom: -14px;
  width: 10px; height: 18px;
  background: linear-gradient(to bottom, #ffaa00, #e88000);
  border-radius: 0 0 6px 6px;
}
.gbow-tail-l { left: 28px; transform: rotate(-10deg); }
.gbow-tail-r { right: 28px; transform: rotate(10deg); }
@keyframes gbowPulse {
  0%,100% { filter: brightness(1) drop-shadow(0 0 3px rgba(255,180,0,0.3)); }
  50%      { filter: brightness(1.15) drop-shadow(0 0 8px rgba(255,200,0,0.5)); }
}

/* Envelope rising out from box (mini, inside box zone) */
.genv-rising {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  animation: envRise 0.7s cubic-bezier(0.175,0.885,0.32,1.275) forwards;
}
@keyframes envRise {
  0%   { transform: translateX(-50%) translateY(60px) scale(0.6); opacity:0; }
  100% { transform: translateX(-50%) translateY(-10px) scale(1);  opacity:1; }
}
.genv-mini {
  width: 60px; height: 42px;
  background: linear-gradient(145deg, #fff3f8, #ffe0ed);
  border-radius: 6px 6px 4px 4px;
  border: 1.5px solid rgba(255,94,126,0.35);
  box-shadow: 0 4px 14px rgba(255,94,126,0.25);
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.genv-flap-top {
  position: absolute;
  top: 0; left: 0;
  width: 0; height: 0;
  border-left: 30px solid transparent;
  border-right: 30px solid transparent;
  border-top: 20px solid rgba(255,94,126,0.22);
}
.genv-heart { font-size: 1.3rem; }

/* BOX BODY */
.gbox-body {
  position: relative;
  width: 175px;
  height: 138px;
  background: linear-gradient(155deg, #ff5e7e 0%, #e8265d 58%, #c4144b 100%);
  border-radius: 3px 3px 16px 16px;
  box-shadow: 0 18px 38px rgba(196,20,75,0.35), 0 5px 14px rgba(0,0,0,0.1);
  overflow: hidden;
}
.gbox-ribbon-v {
  position: absolute;
  left: 50%; top: 0;
  transform: translateX(-50%);
  width: 22px; height: 100%;
  background: linear-gradient(to right, #e8a000, #ffd040, #e8a000);
  opacity: 0.9;
}
.gbox-ribbon-h {
  position: absolute;
  top: 40%; left: 0;
  transform: translateY(-50%);
  width: 100%; height: 22px;
  background: linear-gradient(to bottom, #e8a000, #ffd040, #e8a000);
  opacity: 0.9;
}

/* Shadow below box */
.gbox-shadow {
  width: 140px; height: 22px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255,94,126,0.38) 0%, transparent 75%);
  margin: 0 auto;
  animation: gboxShadow 3s ease-in-out infinite;
}
@keyframes gboxShadow {
  0%,100% { transform: scaleX(1);   opacity:0.6; }
  50%      { transform: scaleX(1.2); opacity:1; }
}

/* Tap label */
.gbox-tap-label {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary-pink-dark);
  margin: 8px 0 0;
  animation: gboxLabelBob 1.8s ease-in-out infinite;
}
@keyframes gboxLabelBob {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

/* Shake hint below box */
.gift-shake-hint {
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-pink-dark);
  margin: 6px auto 0;
  animation: fadeInUp 0.4s ease;
}

/* === FULL ENVELOPE === */
.genv-wrap {
  max-width: 300px;
  margin: 10px auto 0;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  animation: envPopIn 0.55s cubic-bezier(0.175,0.885,0.32,1.275) forwards;
}
@keyframes envPopIn {
  0%   { transform: scale(0.7) translateY(20px); opacity:0; }
  100% { transform: scale(1) translateY(0);       opacity:1; }
}
.genv-tap-hint {
  text-align: center;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--primary-pink-dark);
  margin-bottom: 8px;
  animation: gboxLabelBob 1.8s ease-in-out infinite;
}
.genv-body {
  position: relative;
  width: 100%;
  height: 180px;
  background: linear-gradient(145deg, #fff5f8, #ffe8f0);
  border-radius: 12px;
  border: 2px solid rgba(255,94,126,0.25);
  box-shadow: 0 12px 32px rgba(255,94,126,0.18), 0 2px 8px rgba(0,0,0,0.06);
  overflow: hidden;
}
/* Envelope flap (triangle top) */
.genv-flap {
  position: absolute;
  top: 0; left: 0;
  width: 0; height: 0;
  border-left: 150px solid transparent;
  border-right: 150px solid transparent;
  border-top: 80px solid rgba(255,94,126,0.18);
  transition: transform 0.6s cubic-bezier(0.175,0.885,0.32,1.275);
  transform-origin: top center;
  z-index: 3;
}
.genv-flap.open-flap {
  transform: rotateX(180deg);
  border-top-color: rgba(255,94,126,0.08);
}
/* Seal */
.genv-seal {
  position: absolute;
  top: 28px; left: 50%;
  transform: translateX(-50%);
  font-size: 1.8rem;
  z-index: 4;
  transition: transform 0.4s ease, opacity 0.3s ease;
  filter: drop-shadow(0 2px 6px rgba(255,94,126,0.4));
}
.genv-seal.break {
  transform: translateX(-50%) scale(0) rotate(45deg);
  opacity: 0;
}
/* Lines decoration */
.genv-lines {
  position: absolute;
  bottom: 28px; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px;
  width: 180px;
}
.genv-lines span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: rgba(255,94,126,0.18);
}
.genv-to {
  position: absolute;
  bottom: 16px; left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(200,20,80,0.5);
  white-space: nowrap;
  letter-spacing: 0.5px;
}

/* === LETTER === */
.gletter-wrap {
  max-width: 310px;
  margin: 10px auto 0;
  animation: letterUnfold 0.6s cubic-bezier(0.175,0.885,0.32,1.275) forwards;
}
@keyframes letterUnfold {
  0%   { transform: scaleY(0.1) translateY(-20px); opacity:0; transform-origin: top center; }
  100% { transform: scaleY(1) translateY(0);        opacity:1; }
}
@keyframes letterRise {
  0%   { transform: translateY(60px) scale(0.85); opacity: 0; }
  60%  { transform: translateY(-8px) scale(1.02); opacity: 1; }
  100% { transform: translateY(0) scale(1);        opacity: 1; }
}
.gletter-paper {
  background: linear-gradient(160deg, #fffdf0, #fff8f0, #fff0f6);
  border-radius: 16px 16px 4px 4px;
  box-shadow: 0 16px 40px rgba(255,94,126,0.15), 0 2px 8px rgba(0,0,0,0.07);
  border: 1.5px solid rgba(255,182,150,0.35);
  overflow: hidden;
  /* Lined paper effect */
  background-image:
    linear-gradient(160deg, #fffdf0, #fff8f0, #fff0f6),
    repeating-linear-gradient(
      transparent,
      transparent 27px,
      rgba(255,150,150,0.12) 27px,
      rgba(255,150,150,0.12) 28px
    );
}
.gletter-header {
  background: linear-gradient(135deg, #ff5e7e, #e8265d);
  padding: 16px 20px 14px;
  text-align: center;
  color: white;
}
.gletter-icon { font-size: 1.8rem; display: block; margin-bottom: 4px; }
.gletter-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: white;
  margin: 0;
}
.gletter-divider {
  height: 2px;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
  margin-top: 10px;
}
.gletter-body {
  padding: 18px 20px 16px;
  text-align: left;
}
.gletter-body p {
  font-size: 0.78rem;
  line-height: 1.72;
  color: rgba(60,20,50,0.78);
  margin-bottom: 10px;
}
.gletter-sign {
  font-size: 0.78rem;
  color: var(--primary-pink-dark) !important;
  text-align: right;
  font-style: italic;
  border-top: 1px dashed rgba(255,94,126,0.25);
  padding-top: 10px;
  margin-top: 4px !important;
}



/* Wrapper — clickable, centered */
.gift-wrap-area {
  position: relative;
  width: 180px;
  margin: 18px auto 10px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  animation: gbFloat 3s ease-in-out infinite;
}
.gift-wrap-area:hover { filter: brightness(1.07); }
@keyframes gbFloat {
  0%,100% { transform: translateY(0px) rotate(-1.5deg); }
  50%      { transform: translateY(-12px) rotate(1.5deg); }
}
.gift-wrap-area.shaking {
  animation: gbShake 0.55s ease-in-out;
}
@keyframes gbShake {
  0%,100% { transform: translateX(0) rotate(0deg); }
  15%  { transform: translateX(-7px) rotate(-4deg); }
  30%  { transform: translateX(7px)  rotate(4deg);  }
  45%  { transform: translateX(-5px) rotate(-3deg); }
  60%  { transform: translateX(5px)  rotate(3deg);  }
  75%  { transform: translateX(-3px) rotate(-1deg); }
}

/* Floating emoji particles */
.gfp {
  position: absolute;
  pointer-events: none;
  font-size: 1.1rem;
  animation: gfpFloat linear infinite;
  opacity: 0;
  z-index: 10;
}
.gfp1 { left: -20px; top: 40%;  animation-duration: 4.0s; animation-delay: 0.0s; }
.gfp2 { left: 110%;  top: 30%;  animation-duration: 5.0s; animation-delay: 0.8s; font-size: 1.0rem; }
.gfp3 { left: 20%;   top: 110%; animation-duration: 4.5s; animation-delay: 1.5s; font-size: 0.9rem; }
.gfp4 { left: 80%;   top: 110%; animation-duration: 5.2s; animation-delay: 0.3s; }
.gfp5 { left: -15px; top: 20%;  animation-duration: 4.8s; animation-delay: 2.1s; font-size: 0.85rem; }
.gfp6 { left: 105%;  top: 60%;  animation-duration: 4.3s; animation-delay: 1.1s; font-size: 1.2rem; }
@keyframes gfpFloat {
  0%   { transform: translateY(0) rotate(0deg);    opacity: 0; }
  15%  { opacity: 0.9; }
  85%  { opacity: 0.7; }
  100% { transform: translateY(-120px) rotate(360deg); opacity: 0; }
}

/* LID */
.gb-lid {
  position: relative;
  width: 190px;
  margin-left: -5px;
  height: 32px;
  background: linear-gradient(135deg, #ff4d80, #e0165b);
  border-radius: 8px 8px 2px 2px;
  box-shadow: 0 -3px 12px rgba(224,22,91,0.28), 0 4px 0 #c01050;
  z-index: 3;
  transition: transform 0.7s cubic-bezier(0.175,0.885,0.32,1.275), opacity 0.5s;
  transform-origin: bottom center;
}
.gb-lid.pop-off {
  transform: translateY(-160px) rotate(-20deg) scale(1.05);
  opacity: 0;
}

/* BOW */
.gb-bow {
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 52px;
  z-index: 10;
}
.gb-bow-l, .gb-bow-r {
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 50% 50% 50% 0;
  background: linear-gradient(135deg, #ffe234, #ffaa00);
  box-shadow: 0 2px 8px rgba(255,160,0,0.45);
  animation: gbBowWiggle 2.5s ease-in-out infinite;
}
.gb-bow-l { left: 0;  transform: rotate(45deg); }
.gb-bow-r { right: 0; transform: rotate(-45deg) scaleX(-1); animation-delay: 0.12s; }
.gb-bow-c {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 16px; height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff176, #ffaa00);
  box-shadow: 0 0 10px rgba(255,200,0,0.7);
  z-index: 11;
}
@keyframes gbBowWiggle {
  0%,100% { filter: brightness(1); }
  50%      { filter: brightness(1.15); }
}

/* BOX BODY */
.gb-body {
  position: relative;
  width: 180px;
  height: 135px;
  background: linear-gradient(160deg, #ff5e7e 0%, #e8265d 60%, #c7164a 100%);
  border-radius: 2px 2px 16px 16px;
  box-shadow: 0 16px 36px rgba(200,20,80,0.35), 0 4px 12px rgba(0,0,0,0.12);
  overflow: hidden;
}
/* Ribbons on body */
.gb-ribbon-v {
  position: absolute;
  left: 50%; top: 0;
  width: 20px; height: 100%;
  background: linear-gradient(to right, #ffc000, #ffe040, #ffc000);
  transform: translateX(-50%);
  opacity: 0.92;
}
.gb-ribbon-h {
  position: absolute;
  top: 42%; left: 0;
  width: 100%; height: 20px;
  background: linear-gradient(to bottom, #ffc000, #ffe040, #ffc000);
  transform: translateY(-50%);
  opacity: 0.92;
}

/* Glow ring below box */
.gb-glow-ring {
  position: absolute;
  bottom: 42px;
  left: 50%;
  transform: translateX(-50%);
  width: 140px; height: 26px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255,94,126,0.4) 0%, transparent 75%);
  animation: gbGlow 2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes gbGlow {
  0%,100% { transform: translateX(-50%) scaleX(1);   opacity: 0.6; }
  50%      { transform: translateX(-50%) scaleX(1.2); opacity: 1;   }
}

/* Tap label */
.gb-tap-label {
  text-align: center;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--primary-pink-dark);
  margin: 10px 0 0;
  letter-spacing: 0.3px;
  animation: gbLabelBob 1.8s ease-in-out infinite;
}
@keyframes gbLabelBob {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

/* Shake hint text */
.gift-shake-hint {
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-pink-dark);
  margin: 8px auto 0;
  animation: fadeInUp 0.4s ease;
}

/* REVEAL CARD */
.gift-reveal-card {
  background: linear-gradient(145deg, #fff0f6, #fffafc);
  border-radius: 28px;
  padding: 26px 20px 22px;
  box-shadow: 0 18px 45px rgba(255,94,126,0.18), 0 2px 8px rgba(0,0,0,0.06);
  border: 1.5px solid rgba(255,182,205,0.45);
  text-align: center;
  max-width: 300px;
  margin: 12px auto 0;
  animation: revealCardPop 0.55s cubic-bezier(0.175,0.885,0.32,1.275) forwards;
}
@keyframes revealCardPop {
  0%   { transform: scale(0.72) translateY(24px); opacity: 0; }
  100% { transform: scale(1) translateY(0);        opacity: 1; }
}
.gift-reveal-emoji {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 8px;
  animation: spinSlow 4s linear infinite;
}
@keyframes spinSlow {
  to { transform: rotate(360deg); }
}
.gift-reveal-circle {
  width: 100px; height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffeef4, #ffd4e8);
  box-shadow: 0 6px 22px rgba(255,94,126,0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: 0 auto 16px;
}
.gift-reveal-gif {
  width: 90px; height: 90px;
  object-fit: cover;
  border-radius: 50%;
}
.gift-reveal-title {
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 800;
  color: var(--primary-pink-dark);
  margin-bottom: 8px;
}
.gift-reveal-text {
  font-size: 0.78rem;
  line-height: 1.65;
  color: rgba(60,20,60,0.75);
  margin-bottom: 18px;
}


.gift-scene-new {
  width: 100%;
  max-width: 340px;
  min-height: 280px;
  margin: 10px auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
}

/* Floating particles */
.gift-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: 20px;
}
.gift-particles .gp {
  position: absolute;
  font-size: 1.1rem;
  animation: floatParticle linear infinite;
  opacity: 0;
}
.gift-particles .gp:nth-child(1)  { left: 8%;  animation-duration: 4.2s; animation-delay: 0s;    font-size: 0.9rem; }
.gift-particles .gp:nth-child(2)  { left: 22%; animation-duration: 5.5s; animation-delay: 0.5s;  }
.gift-particles .gp:nth-child(3)  { left: 38%; animation-duration: 4.8s; animation-delay: 1.1s;  font-size: 0.8rem; }
.gift-particles .gp:nth-child(4)  { left: 55%; animation-duration: 5.2s; animation-delay: 0.3s;  }
.gift-particles .gp:nth-child(5)  { left: 68%; animation-duration: 4.6s; animation-delay: 1.5s;  font-size: 1.3rem; }
.gift-particles .gp:nth-child(6)  { left: 80%; animation-duration: 5.8s; animation-delay: 0.8s;  }
.gift-particles .gp:nth-child(7)  { left: 15%; animation-duration: 4.3s; animation-delay: 2.0s;  font-size: 0.85rem; }
.gift-particles .gp:nth-child(8)  { left: 48%; animation-duration: 5.1s; animation-delay: 0.2s;  }
.gift-particles .gp:nth-child(9)  { left: 92%; animation-duration: 4.9s; animation-delay: 1.8s;  }
@keyframes floatParticle {
  0%   { transform: translateY(280px) rotate(0deg);  opacity: 0; }
  10%  { opacity: 0.9; }
  90%  { opacity: 0.7; }
  100% { transform: translateY(-40px) rotate(360deg); opacity: 0; }
}

/* Main 3D Gift Box wrapper */
.gift-box-3d {
  position: relative;
  width: 155px;
  cursor: pointer;
  margin: 20px auto 10px;
  transform-style: preserve-3d;
  animation: giftFloat 3s ease-in-out infinite;
  transition: transform 0.2s;
  user-select: none;
  -webkit-user-select: none;
}
.gift-box-3d:hover {
  transform: scale(1.05);
  animation-play-state: paused;
}
@keyframes giftFloat {
  0%, 100% { transform: translateY(0px) rotate(-1deg); }
  50%       { transform: translateY(-10px) rotate(1deg); }
}
.gift-box-3d.shaking {
  animation: giftShake 0.5s ease-in-out;
}
@keyframes giftShake {
  0%,100% { transform: rotate(0deg) translateX(0); }
  15%  { transform: rotate(-4deg) translateX(-5px); }
  30%  { transform: rotate(4deg)  translateX(5px);  }
  45%  { transform: rotate(-3deg) translateX(-4px); }
  60%  { transform: rotate(3deg)  translateX(4px);  }
  75%  { transform: rotate(-2deg) translateX(-2px); }
  90%  { transform: rotate(1deg)  translateX(1px);  }
}

/* Glow Aura */
.gift-glow-aura {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 130px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 94, 126, 0.45) 0%, transparent 75%);
  animation: glowPulse 2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes glowPulse {
  0%, 100% { transform: translateX(-50%) scaleX(1);   opacity: 0.6; }
  50%       { transform: translateX(-50%) scaleX(1.18); opacity: 1;   }
}

/* Lid */
.gift-lid-3d {
  position: relative;
  width: 165px;
  margin-left: -5px;
  height: 30px;
  z-index: 4;
  transform-origin: bottom center;
  transition: transform 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.5s ease;
}
.gift-lid-3d.pop-off {
  transform: translateY(-130px) rotate(-25deg) scale(1.1);
  opacity: 0;
}
.gift-lid-face {
  position: absolute;
  left: 0;
}
.gift-lid-face.top {
  top: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #ff4d80 0%, #e8265d 100%);
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -4px 12px rgba(232, 38, 93, 0.3);
}
.gift-lid-face.front-lid {
  bottom: -10px;
  width: 100%;
  height: 14px;
  background: linear-gradient(to bottom, #e8265d, #c7164a);
  border-radius: 0 0 3px 3px;
}

/* 3D Bow */
.gift-bow-3d {
  position: absolute;
  top: -42px;
  left: 50%;
  transform: translateX(-50%);
  width: 72px;
  height: 44px;
  z-index: 10;
}
.bow-left, .bow-right {
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50% 50% 50% 0;
  background: linear-gradient(135deg, #ffd700, #ff9a00);
  box-shadow: inset 0 0 8px rgba(0,0,0,0.15), 0 2px 6px rgba(255,154,0,0.4);
  animation: bowWiggle 2.8s ease-in-out infinite;
}
.bow-left  { left: 0;   transform: rotate(45deg); }
.bow-right { right: 0;  transform: rotate(-45deg) scaleX(-1); animation-delay: 0.15s; }
.bow-center {
  position: absolute;
  width: 14px;
  height: 14px;
  background: radial-gradient(circle, #ffe066, #ff9a00);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 8px rgba(255,200,0,0.6);
  z-index: 11;
}
.bow-ribbon-h {
  position: absolute;
  top: 50%; left: -2px;
  width: calc(100% + 4px);
  height: 10px;
  background: linear-gradient(to right, #ffb300, #ffd700, #ffb300);
  transform: translateY(-50%);
}
.bow-ribbon-v {
  position: absolute;
  top: -2px; left: 50%;
  width: 10px;
  height: calc(100% + 4px);
  background: linear-gradient(to bottom, #ffb300, #ffd700, #ffb300);
  transform: translateX(-50%);
}
@keyframes bowWiggle {
  0%, 100% { transform: rotate(45deg) scale(1); }
  50%       { transform: rotate(45deg) scale(1.08); }
}

/* Box Body */
.gift-body-3d {
  position: relative;
  width: 155px;
  height: 130px;
  z-index: 3;
}
.gift-body-face {
  position: absolute;
}
.front-body {
  width: 100%;
  height: 100%;
  background: linear-gradient(160deg, #ff5e7e 0%, #e8265d 55%, #c7164a 100%);
  border-radius: 0 0 14px 14px;
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(232, 38, 93, 0.35), 0 4px 10px rgba(0,0,0,0.1);
}
.body-ribbon-v {
  position: absolute;
  left: 50%;
  top: 0;
  width: 18px;
  height: 100%;
  background: linear-gradient(to right, #ffb300, #ffd700, #ffb300);
  transform: translateX(-50%);
  opacity: 0.9;
}
.body-stars {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: flex-end;
  padding-right: 18px;
  font-size: 1.1rem;
  opacity: 0.6;
}
.side-body {
  width: 22px;
  height: 100%;
  right: -18px;
  top: 0;
  background: linear-gradient(to right, #c7164a, #a00f38);
  border-radius: 0 0 4px 0;
  transform: skewY(-8deg);
  transform-origin: top left;
}
.bottom-body {
  width: 100%;
  height: 14px;
  bottom: -12px;
  left: 0;
  background: linear-gradient(to bottom, #a00f38, #800c2e);
  border-radius: 0 0 14px 14px;
  box-shadow: 0 6px 10px rgba(0,0,0,0.15);
}

/* Tap pulse ring */
.tap-pulse-ring {
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid rgba(255, 94, 126, 0.5);
  animation: tapPulse 1.6s ease-out infinite;
  pointer-events: none;
}
@keyframes tapPulse {
  0%   { transform: translateX(-50%) scale(0.6); opacity: 0.9; }
  100% { transform: translateX(-50%) scale(1.8); opacity: 0;   }
}
.tap-hint-label {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary-pink-dark);
  margin-top: 36px;
  letter-spacing: 0.2px;
  animation: tapLabelBob 1.8s ease-in-out infinite;
}
@keyframes tapLabelBob {
  0%, 100% { transform: translateY(0);   }
  50%       { transform: translateY(-3px); }
}

.gift-step-hint {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-pink-dark);
  margin-top: 6px;
  text-align: center;
  animation: fadeInUp 0.4s ease;
}

/* ---- REVEAL CARD ---- */
.gift-reveal-card {
  background: linear-gradient(145deg, #fff0f6, #fff8fc);
  border-radius: 28px;
  padding: 26px 20px 22px;
  box-shadow: 0 16px 40px rgba(255, 94, 126, 0.18), 0 2px 8px rgba(0,0,0,0.06);
  border: 1.5px solid rgba(255, 182, 205, 0.4);
  text-align: center;
  max-width: 300px;
  margin: 10px auto 0;
  animation: revealCardPop 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes revealCardPop {
  0%   { transform: scale(0.75) translateY(20px); opacity: 0; }
  100% { transform: scale(1) translateY(0);        opacity: 1; }
}
.gift-reveal-sparkles {
  font-size: 2rem;
  animation: spinSlow 4s linear infinite;
  display: block;
  margin-bottom: 6px;
}
@keyframes spinSlow {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.gift-reveal-icon-wrap {
  margin: 8px auto 14px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffeef4, #ffd6e7);
  box-shadow: 0 6px 20px rgba(255,94,126,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.gift-reveal-gif {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 50%;
}
.gift-reveal-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary-pink-dark);
  margin-bottom: 8px;
}
.gift-reveal-text {
  font-size: 0.78rem;
  line-height: 1.6;
  color: rgba(60, 20, 60, 0.75);
  margin-bottom: 18px;
}

/* Stage: Birthday Slot Machine */
.slot-machine {
  background: #1e1b4b;
  border-radius: 28px;
  padding: 22px 16px;
  max-width: 290px;
  margin: 15px auto;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
  border: 4px solid #fbbf24;
}
.slot-display {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: #0f172a;
  border-radius: 16px;
  padding: 16px 8px;
  margin-bottom: 20px;
}
.slot-reel {
  background: white;
  border-radius: 8px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.8rem;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
}
.slot-lever-wrap {
  text-align: center;
}
.slot-lever-btn {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  border: none;
  padding: 12px 28px;
  border-radius: 20px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: #1e1b4b;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(251, 191, 36, 0.35);
  transition: all 0.1s ease;
}
.slot-lever-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 4px rgba(251, 191, 36, 0.2);
}
.slot-prize {
  margin-top: 15px;
  background: rgba(251, 191, 36, 0.15);
  border: 1px dashed #fbbf24;
  padding: 8px 12px;
  border-radius: 12px;
}
.slot-prize p {
  color: #fbbf24;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Stage: Blow the Candles Cake */
.cake-scene {
  max-width: 320px;
  margin: 25px auto;
  text-align: center;
  position: relative;
}
.candles-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  height: 60px;
  align-items: flex-end;
  position: relative;
  z-index: 10;
  margin-bottom: -15px; /* Pull into top tier */
}
.candle {
  position: relative;
  width: 14px;
  height: 45px;
  border-radius: 7px 7px 2px 2px;
  cursor: pointer;
  box-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}
.candle::after {
  content: '';
  position: absolute;
  top: -15px; left: -15px; right: -15px; bottom: -5px;
  cursor: pointer;
}
.candle-body {
  width: 100%;
  height: 100%;
  border-radius: 7px 7px 2px 2px;
  box-shadow: inset -4px 0 6px rgba(0,0,0,0.15), inset 2px 0 4px rgba(255,255,255,0.3);
}
.candle-body::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 6px;
  background: rgba(255,255,255,0.4);
  border-radius: 50%;
}
.flame {
  position: absolute;
  top: -18px; left: 50%;
  transform: translateX(-50%);
  width: 10px; height: 18px;
  background: radial-gradient(ellipse, #fff 0%, #fbbf24 30%, #f97316 70%, transparent 100%);
  border-radius: 50% 50% 20% 20%;
  animation: flicker 0.12s ease-in-out infinite alternate;
  transform-origin: bottom center;
  box-shadow: 0 0 10px #fbbf24;
}
@keyframes flicker {
  0% { transform: translateX(-50%) scale(0.95) rotate(-2deg); }
  100% { transform: translateX(-50%) scale(1.05) rotate(2deg); }
}
.candle.blown .flame { display: none; }

/* Split Cake Container & Split Animation */
.cake-container-wrap {
  position: relative;
  width: 220px;
  height: 140px;
  margin: 20px auto 10px;
}
.cake-half {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.left-half { clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%); }
.right-half { clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%); }
.cake-container-wrap.cut .left-half { transform: translateX(-40px) rotate(-4deg); }
.cake-container-wrap.cut .right-half { transform: translateX(40px) rotate(4deg); }

.cake-surprise-inside {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  opacity: 0;
  z-index: 20; /* Pops IN FRONT of the cake */
  text-align: center;
  pointer-events: none;
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.3s, opacity 0.4s ease 0.3s;
}
.cake-container-wrap.cut .cake-surprise-inside {
  transform: translate(-50%, -100%) scale(1.1); /* Floats much higher */
  opacity: 1;
}
/* Hide candles when cake is cut */
.cake-container-wrap.cut ~ .candles-row {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.cs-emoji {
  font-size: 2.5rem;
  margin-bottom: 5px;
  animation: float 3s ease-in-out infinite;
}
.cs-text {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 900;
  color: #db2777;
  line-height: 1.2;
  text-shadow: 0 2px 10px rgba(255, 255, 255, 0.9), 0 0 5px #fff;
  white-space: nowrap;
}

.cake-base-display {
  width: 220px;
  margin: 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.c3d-tier {
  position: relative;
  border-radius: 50% / 15%;
}
/* Tier 1 (Top) */
.c3d-tier-1 {
  width: 140px; height: 45px;
  background: linear-gradient(135deg, #fbcfe8, #f472b6);
  z-index: 3;
}
.c3d-tier-1::before {
  content: ''; position: absolute;
  top: -15px; left: 0;
  width: 100%; height: 30px;
  background: #fce7f3;
  border-radius: 50%;
  box-shadow: inset 0 0 12px rgba(244,114,182,0.3);
}
.c3d-text {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: 0.95rem; font-weight: 800;
  color: #db2777;
  white-space: nowrap;
}
/* Tier 2 (Middle) */
.c3d-tier-2 {
  width: 180px; height: 50px;
  background: linear-gradient(135deg, #fce7f3, #fbcfe8);
  z-index: 2;
  margin-top: -12px;
}
.c3d-tier-2::before {
  content: ''; position: absolute;
  top: -18px; left: 0;
  width: 100%; height: 36px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: inset 0 0 15px rgba(244,114,182,0.2);
}
/* Dripping icing on tier 2 */
.c3d-drip {
  position: absolute;
  top: 0; left: 10px;
  width: 12px; height: 25px;
  background: #ffffff;
  border-radius: 6px;
  box-shadow: 25px 5px 0 #ffffff, 50px 10px 0 #ffffff, 80px 2px 0 #ffffff, 110px 15px 0 #ffffff, 140px 5px 0 #ffffff;
}
/* Tier 3 (Base) */
.c3d-tier-3 {
  width: 220px; height: 25px;
  background: linear-gradient(135deg, #db2777, #be185d);
  z-index: 1;
  margin-top: -10px;
  box-shadow: 0 12px 25px rgba(157,23,77,0.35);
}
.c3d-tier-3::before {
  content: ''; position: absolute;
  top: -20px; left: 0;
  width: 100%; height: 40px;
  background: #f472b6;
  border-radius: 50%;
}

/* Virtual Knife styling & Slicing Keyframes */
.cake-knife {
  position: absolute;
  top: -45px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  font-size: 2.6rem;
  opacity: 0;
  pointer-events: none;
  z-index: 15;
}
.cake-knife.slice-anim {
  animation: knifeSlice 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
@keyframes knifeSlice {
  0% {
    top: -45px;
    opacity: 0;
    transform: translateX(-50%) rotate(45deg) scale(1.4);
  }
  20% {
    opacity: 1;
    top: -20px;
  }
  60% {
    top: 75px;
    transform: translateX(-50%) rotate(-45deg) scale(1.15);
    opacity: 1;
  }
  100% {
    top: 110px;
    opacity: 0;
    transform: translateX(-50%) rotate(-90deg) scale(1);
  }
}

.candles-blown-msg {
  margin-top: 20px;
  background: rgba(219, 39, 119, 0.08);
  border: 1px dashed var(--primary-pink);
  padding: 12px 14px;
  border-radius: 16px;
}
.candles-blown-msg p {
  color: var(--primary-pink-dark);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 10px;
}

/* Sliced success card pop anim */
@keyframes cardPop {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Welcome Stage: Lyrics Ticker */
.lyrics-ticker-container {
  overflow: hidden;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 8px 12px;
  max-width: 310px;
  margin: 15px auto;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.lyrics-ticker-inner {
  display: inline-block;
  padding-left: 100%;
  animation: ticker 15s linear infinite;
}
.lyrics-ticker-inner span {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--primary-pink-dark);
}
@keyframes ticker {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-100%, 0, 0); }
}

/* Creator Credit Centered in Footer Bar */
.footer-credit {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.76rem;
  font-weight: 600;
  color: rgba(60, 20, 60, 0.42);
  font-family: var(--font-body);
  pointer-events: none;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.footer-credit .fa-heart {
  color: var(--primary-pink-dark);
  font-size: 0.68rem;
  margin: 0 2px;
  animation: heartBeat 1.4s ease-in-out infinite;
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.22); }
}


/* Epic Balloons */
.balloon {
  position: fixed;
  bottom: -150px;
  width: 40px;
  height: 50px;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  box-shadow: inset -5px -5px 15px rgba(0,0,0,0.2), inset 5px 5px 15px rgba(255,255,255,0.4);
  animation-name: balloonRise;
  animation-timing-function: ease-in-out;
  animation-fill-mode: forwards;
  z-index: 1000;
  pointer-events: none;
}
.balloon::before {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  background: inherit;
  border-radius: 50%;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}
.balloon::after {
  content: '';
  position: absolute;
  bottom: -45px;
  left: 50%;
  width: 1px;
  height: 40px;
  background: rgba(255,255,255,0.6);
}
@keyframes balloonRise {
  0%   { bottom: -150px; transform: translateX(0) scale(var(--scale, 1)) rotate(-5deg); }
  50%  { transform: translateX(20px) scale(var(--scale, 1)) rotate(5deg); }
  100% { bottom: 120vh; transform: translateX(-20px) scale(var(--scale, 1)) rotate(-5deg); }
}
