/* ==========================================================================
   HAPPY BIRTHDAY SURPRISE - AESTHETIC ROMANTIC THEME
   Inspired by the viral POV video with enhanced animations, colors & gifs
   ========================================================================== */

:root {
  --bg-gradient-start: #fdf5f0;
  --bg-gradient-mid: #fce4dc;
  --bg-gradient-end: #ffd7e2;
  
  --primary-pink: #ff6584;
  --primary-rose: #f0506e;
  --soft-peach: #ffeedb;
  --soft-pink: #ffe3ec;
  --warm-gold: #f6c85f;
  --cake-pink: #f7a2b2;
  --cake-cream: #fae4aa;
  
  --envelope-body: #ffffff;
  --envelope-flap: #fca882;
  --envelope-back: #eb8c62;
  --wax-red: #ea3f60;
  
  --text-dark: #3a2e39;
  --text-muted: #8b7580;
  --card-bg: rgba(255, 255, 255, 0.94);
  --shadow-soft: 0 10px 30px rgba(220, 120, 140, 0.18);
  --shadow-hover: 0 16px 40px rgba(220, 120, 140, 0.28);
  
  --font-cursive: 'Caveat', cursive;
  --font-script: 'Dancing Script', cursive;
  --font-sans: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-letter: 'Caveat', 'Sacramento', cursive;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-sans);
  background: linear-gradient(135deg, #1b1924 0%, #2c2230 50%, #1a1622 100%);
  color: var(--text-dark);
}

/* --------------------------------------------------------------------------
   AMBIENT BACKGROUND PARTICLES (HEARTS & SPARKLES)
   -------------------------------------------------------------------------- */
.ambient-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.ambient-particle {
  position: absolute;
  pointer-events: none;
  opacity: 0.65;
  animation: floatUpward linear infinite;
}

@keyframes floatUpward {
  0% {
    transform: translateY(105vh) scale(0.6) rotate(0deg);
    opacity: 0;
  }
  15% {
    opacity: 0.7;
  }
  85% {
    opacity: 0.7;
  }
  100% {
    transform: translateY(-10vh) scale(1.1) rotate(360deg);
    opacity: 0;
  }
}

/* --------------------------------------------------------------------------
   MUSIC CONTROLLER FLOATING PILL
   -------------------------------------------------------------------------- */
.music-pill {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 6px 14px 6px 8px;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.7);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.music-pill:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 24px rgba(240, 80, 110, 0.25);
}

.music-disc {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff758c, #ff7eb3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(255, 117, 140, 0.4);
}

.music-pill.playing .music-disc {
  animation: spinDisc 3s linear infinite;
}

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

.music-waves {
  display: flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 14px;
}

.music-waves span {
  width: 3px;
  background: var(--primary-rose);
  border-radius: 2px;
  height: 4px;
  transition: height 0.2s ease;
}

.music-pill.playing .music-waves span:nth-child(1) { animation: soundWave 0.7s ease infinite 0.1s; }
.music-pill.playing .music-waves span:nth-child(2) { animation: soundWave 0.9s ease infinite 0.3s; }
.music-pill.playing .music-waves span:nth-child(3) { animation: soundWave 0.6s ease infinite 0.2s; }
.music-pill.playing .music-waves span:nth-child(4) { animation: soundWave 0.8s ease infinite 0.4s; }

@keyframes soundWave {
  0%, 100% { height: 3px; }
  50% { height: 14px; }
}

.music-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dark);
  letter-spacing: 0.3px;
}

/* --------------------------------------------------------------------------
   RESPONSIVE PHONE VIEWPORT CONTAINER
   -------------------------------------------------------------------------- */
.mobile-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  padding: 10px;
}

.phone-screen {
  position: relative;
  width: 100%;
  max-width: 420px;
  height: 94vh;
  max-height: 860px;
  border-radius: 44px;
  background: linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-mid) 48%, var(--bg-gradient-end) 100%);
  box-shadow: 0 25px 65px rgba(0, 0, 0, 0.45), 0 0 0 8px rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

/* Native full-screen on mobile devices */
@media (max-width: 480px) {
  .mobile-wrapper {
    padding: 0;
  }
  .phone-screen {
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    box-shadow: none;
    border: none;
  }
  .music-pill {
    top: 12px;
    right: 12px;
    padding: 4px 10px 4px 6px;
  }
  .music-label {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   SCREEN CONTAINER & TRANSITIONS
   -------------------------------------------------------------------------- */
.screen {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.98);
  transition: opacity 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.screen.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.screen-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 24px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.screen-content.center-content {
  justify-content: center;
  gap: 20px;
}

.screen-content::-webkit-scrollbar {
  display: none;
}

.cursive-heading {
  font-family: var(--font-cursive);
  font-size: 32px;
  font-weight: 700;
  color: #43323a;
  text-align: center;
  margin-top: 6px;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.instruction-text {
  font-family: var(--font-cursive);
  font-size: 26px;
  color: #4b3842;
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.screen-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.cute-pill-btn {
  background: linear-gradient(135deg, #ff758c 0%, #ff7eb3 100%);
  color: white;
  border: none;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(255, 117, 140, 0.35);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cute-pill-btn:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 12px 28px rgba(255, 117, 140, 0.5);
}

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

/* --------------------------------------------------------------------------
   SCREEN 1: BALLOONS POPPING STAGE
   -------------------------------------------------------------------------- */
.balloons-stage {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 380px;
  cursor: pointer;
}

.balloon {
  position: absolute;
  width: 66px;
  height: 82px;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.12));
  transition: transform 0.15s ease;
  animation: balloonFloat 3.5s ease-in-out infinite alternate;
}

.balloon:hover {
  transform: scale(1.1) !important;
}

.balloon::before {
  content: '';
  position: absolute;
  top: 14%;
  left: 20%;
  width: 14px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  transform: rotate(-30deg);
}

/* Balloon knot */
.balloon-knot {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 7px;
  height: 6px;
  border-radius: 2px;
  background: inherit;
}

/* Balloon string */
.balloon-string {
  position: absolute;
  top: 100%;
  left: 50%;
  width: 1.5px;
  height: 60px;
  background: rgba(140, 100, 110, 0.35);
  transform-origin: top center;
  animation: stringWave 2s ease-in-out infinite alternate;
}

@keyframes balloonFloat {
  0% { transform: translateY(0px) rotate(-2deg); }
  100% { transform: translateY(-16px) rotate(3deg); }
}

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

/* Balloon pop burst */
.balloon.popping {
  animation: balloonPop 0.25s forwards cubic-bezier(0.1, 0.9, 0.2, 1);
  pointer-events: none;
}

@keyframes balloonPop {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.8; }
  100% { transform: scale(0); opacity: 0; }
}

.progress-dots {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.progress-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(180, 140, 150, 0.35);
  transition: all 0.3s ease;
}

.progress-dots .dot.filled {
  background: var(--primary-rose);
  transform: scale(1.2);
}

.bounce-hint {
  animation: subtleBounce 2s ease-in-out infinite;
}

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

/* --------------------------------------------------------------------------
   SCREEN 2: BIRTHDAY CAKE & CANDLE BLOWING
   -------------------------------------------------------------------------- */
.cute-gif-container {
  margin: 6px 0;
}

.cute-gif {
  max-width: 110px;
  height: auto;
  border-radius: 16px;
  filter: drop-shadow(0 6px 12px rgba(255, 120, 140, 0.2));
}

.floating-gif {
  animation: floatMascot 2.8s ease-in-out infinite alternate;
}

@keyframes floatMascot {
  0% { transform: translateY(0); }
  100% { transform: translateY(-8px); }
}

.cake-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 10px 0 16px;
  cursor: pointer;
}

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

/* Row of Candles */
.candles-row {
  display: flex;
  gap: 16px;
  margin-bottom: -4px;
  z-index: 5;
}

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

.flame {
  width: 11px;
  height: 18px;
  background: radial-gradient(ellipse at bottom, #fff4b8 0%, #ffaa00 55%, #ff4500 100%);
  border-radius: 50% 50% 20% 20% / 60% 60% 40% 40%;
  box-shadow: 0 0 14px #ffb300, 0 0 28px #ff7700;
  animation: flameFlicker 0.6s infinite alternate ease-in-out;
  transform-origin: bottom center;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.candle:nth-child(2) .flame { animation-delay: 0.15s; }
.candle:nth-child(3) .flame { animation-delay: 0.3s; }
.candle:nth-child(4) .flame { animation-delay: 0.45s; }
.candle:nth-child(5) .flame { animation-delay: 0.2s; }

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

.flame.extinguished {
  opacity: 0 !important;
  transform: scale(0.2) translateY(-10px) !important;
  box-shadow: none !important;
}

.wick {
  width: 2px;
  height: 6px;
  background: #55444b;
}

.stick {
  width: 7px;
  height: 30px;
  background: repeating-linear-gradient(45deg, #ffffff, #ffffff 4px, #ff92ad 4px, #ff92ad 8px);
  border-radius: 3px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

/* Cake Tiers */
.cake-tier {
  position: relative;
  border-radius: 14px 14px 6px 6px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

.tier-top {
  width: 150px;
  height: 62px;
  background: #ffc9d6;
  z-index: 3;
  margin-bottom: -3px;
}

.tier-bottom {
  width: 200px;
  height: 72px;
  background: #fae4be;
  z-index: 2;
}

/* Frosting drips */
.frosting-drips {
  display: flex;
  justify-content: space-around;
  width: 100%;
  position: absolute;
  top: 0;
}

.frosting-drips span {
  width: 16px;
  height: 14px;
  background: #ffffff;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 2px 3px rgba(0,0,0,0.05);
}

.frosting-drips span:nth-child(even) {
  height: 19px;
}

/* Kawaii Face on Cake */
.kawaii-face {
  position: absolute;
  top: 52%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 12px;
}

.eye {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #46343b;
  position: relative;
  animation: kawaiiBlink 4s infinite;
}

@keyframes kawaiiBlink {
  0%, 94%, 100% { transform: scaleY(1); }
  97% { transform: scaleY(0.1); }
}

.blush {
  width: 9px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 90, 120, 0.45);
}

.mouth {
  width: 9px;
  height: 5px;
  border-bottom: 2.5px solid #46343b;
  border-radius: 0 0 9px 9px;
}

.mouth.smile {
  height: 7px;
  border-radius: 0 0 12px 12px;
}

/* Sprinkles */
.sprinkles span {
  position: absolute;
  width: 7px;
  height: 3px;
  border-radius: 2px;
}

.sp-1 { top: 22px; left: 16px; background: #ff758c; transform: rotate(20deg); }
.sp-2 { top: 38px; left: 32px; background: #ffaa00; transform: rotate(-30deg); }
.sp-3 { top: 24px; right: 24px; background: #9c6ade; transform: rotate(45deg); }
.sp-4 { top: 44px; right: 38px; background: #4cd494; transform: rotate(-15deg); }
.sp-5 { top: 52px; left: 24px; background: #55acee; transform: rotate(60deg); }
.sp-6 { top: 50px; right: 20px; background: #ff758c; transform: rotate(-40deg); }

/* Cake Plate */
.cake-plate {
  width: 236px;
  height: 14px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.1);
  margin-top: -2px;
}

/* Smoke puff */
.smoke-particle {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(200, 190, 200, 0.6);
  pointer-events: none;
  animation: smokePuff 1.2s forwards ease-out;
}

@keyframes smokePuff {
  0% { transform: translateY(0) scale(0.5); opacity: 0.8; }
  100% { transform: translateY(-40px) scale(2.2); opacity: 0; }
}

/* --------------------------------------------------------------------------
   SCREEN 3: "OUR BEST MOMENTS" POLAROID GALLERY
   -------------------------------------------------------------------------- */
.polaroid-container {
  perspective: 1000px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0;
  width: 100%;
}

.polaroid-card {
  position: relative;
  background: #ffffff;
  padding: 12px 12px 20px;
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(180, 100, 120, 0.25), 0 2px 6px rgba(0, 0, 0, 0.08);
  width: 250px;
  cursor: pointer;
  transform: rotate(-2deg);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s ease;
}

.polaroid-card:hover {
  transform: rotate(0deg) scale(1.04);
  box-shadow: 0 22px 48px rgba(180, 100, 120, 0.35);
}

.washi-tape {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(1deg);
  width: 76px;
  height: 24px;
  background: rgba(255, 215, 225, 0.85);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  border-left: 2px dashed rgba(255, 120, 150, 0.3);
  border-right: 2px dashed rgba(255, 120, 150, 0.3);
  z-index: 5;
}

.polaroid-photo-box {
  position: relative;
  width: 100%;
  height: 255px;
  border-radius: 10px;
  overflow: hidden;
  background: #f7eef0;
}

.polaroid-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.4s ease;
}

.polaroid-card:hover .polaroid-img {
  transform: scale(1.05);
}

.polaroid-heart-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.9);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.polaroid-caption {
  margin-top: 14px;
  text-align: center;
}

.polaroid-caption p {
  font-family: var(--font-cursive);
  font-size: 21px;
  font-weight: 600;
  color: #3b2a33;
  line-height: 1.2;
}

.polaroid-date {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  color: #a48c97;
  font-weight: 500;
}

/* Polaroid navigation bar */
.polaroid-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 6px;
}

.nav-arrow-btn {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.9);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  color: #4b3641;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-arrow-btn:hover {
  background: #ffffff;
  transform: scale(1.1);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.moment-dots {
  display: flex;
  gap: 6px;
}

.moment-dots .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(180, 140, 150, 0.35);
  transition: all 0.25s ease;
}

.moment-dots .dot.active {
  background: var(--primary-rose);
  width: 18px;
  border-radius: 999px;
}

.cute-corner-sticker {
  margin-top: 4px;
}

.sticker-gif {
  max-width: 75px;
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

/* --------------------------------------------------------------------------
   SCREEN 4: "TAP TO OPEN" ROMANTIC ENVELOPE
   -------------------------------------------------------------------------- */
.envelope-scene {
  perspective: 1000px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 30px 0 20px;
}

.envelope-wrapper {
  position: relative;
  width: 250px;
  height: 165px;
  background: #fdf5f0;
  border-radius: 0 0 16px 16px;
  box-shadow: 0 20px 45px rgba(220, 110, 130, 0.35);
  cursor: pointer;
  transition: transform 0.3s ease;
}

.envelope-wrapper:hover {
  transform: scale(1.03);
}

/* Envelope Back */
.envelope-back {
  position: absolute;
  inset: 0;
  background: #ea8a62;
  border-radius: 12px;
}

/* Letter sneaking inside envelope */
.envelope-letter-sneak {
  position: absolute;
  top: 15px;
  left: 20px;
  right: 20px;
  height: 125px;
  background: #ffffff;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 2;
}

.letter-sneak-line {
  height: 6px;
  background: #fae1ea;
  border-radius: 3px;
  width: 85%;
}

.letter-sneak-line.short {
  width: 55%;
}

/* When envelope opens: letter slides up */
.envelope-wrapper.open .envelope-letter-sneak {
  transform: translateY(-90px);
  z-index: 6;
}

/* Front triangular pocket of envelope */
.envelope-front-pocket {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100%;
  border-bottom: 95px solid #ffffff;
  border-left: 125px solid #faf0ea;
  border-right: 125px solid #f4e3da;
  border-top: 70px solid transparent;
  border-radius: 0 0 16px 16px;
  z-index: 3;
}

/* Top triangular flap */
.envelope-top-flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0;
  border-left: 125px solid transparent;
  border-right: 125px solid transparent;
  border-top: 100px solid #fca882;
  transform-origin: top center;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 4;
}

.envelope-wrapper.open .envelope-top-flap {
  transform: rotateX(180deg);
  z-index: 1;
}

/* Heart Wax Seal */
.wax-seal {
  position: absolute;
  top: 86px;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ff5277, #d82346);
  box-shadow: 0 6px 16px rgba(216, 35, 70, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: transform 0.4s ease, opacity 0.4s ease;
  animation: heartThrob 1.8s infinite ease-in-out;
}

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

.seal-heart {
  font-size: 18px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.envelope-wrapper.open .wax-seal {
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
}

.pulse-text {
  animation: pulseLetterText 1.8s infinite ease-in-out;
}

@keyframes pulseLetterText {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

.envelope-gif-wrap {
  margin-top: 6px;
}

.mini-gif {
  max-width: 80px;
  height: auto;
}

/* --------------------------------------------------------------------------
   SCREEN 5: THE BIRTHDAY LETTER & FINALE
   -------------------------------------------------------------------------- */
.letter-screen-content {
  padding: 10px 18px 20px;
  justify-content: flex-start;
  gap: 12px;
}

.letter-top-gif {
  text-align: center;
}

.peach-gif {
  max-width: 90px;
  height: auto;
  border-radius: 12px;
}

/* Parchment Birthday Letter Card */
.parchment-letter {
  background: #ffffff;
  border-radius: 20px;
  padding: 24px 22px;
  box-shadow: 0 16px 40px rgba(180, 110, 130, 0.2), 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(255, 230, 238, 0.8);
  width: 100%;
  animation: letterAppear 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
}

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

.parchment-header {
  text-align: center;
  margin-bottom: 14px;
}

.letter-h1 {
  font-family: var(--font-cursive);
  font-size: 34px;
  font-weight: 700;
  color: #3b2834;
  line-height: 1.1;
}

.recipient-name {
  font-family: var(--font-cursive);
  font-size: 26px;
  font-weight: 600;
  color: var(--primary-rose);
  margin-top: 2px;
}

.doodle-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

.doodle-line hr {
  width: 80px;
  border: none;
  border-top: 1.5px dashed #f6b5c9;
}

.parchment-body {
  margin: 14px 0 18px;
}

.letter-paragraph {
  font-family: var(--font-letter);
  font-size: 20px;
  line-height: 1.55;
  color: #382833;
  text-align: center;
  font-weight: 500;
  letter-spacing: 0.3px;
  white-space: pre-line;
}

.parchment-footer {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-top: 10px;
}

.from-tag {
  font-family: var(--font-letter);
  font-size: 16px;
  color: #9c8390;
}

.sender-name {
  font-family: var(--font-letter);
  font-size: 22px;
  font-weight: 700;
  color: #382833;
}

.letter-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  align-items: center;
  margin-top: 6px;
}

.love-btn {
  width: 100%;
  justify-content: center;
  background: linear-gradient(135deg, #ff5277, #ff758c);
}

.replay-btn {
  background: rgba(255, 255, 255, 0.85);
  color: #4b3641;
  border: 1px solid rgba(255, 180, 200, 0.5);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  padding: 8px 24px;
  font-size: 13px;
}

.replay-btn:hover {
  background: #ffffff;
  color: var(--primary-rose);
}

.app-footer {
  text-align: center;
  margin-top: 4px;
}

.footer-love {
  font-size: 12px;
  color: #9f8994;
  letter-spacing: 0.4px;
}

/* --------------------------------------------------------------------------
   PHOTO FULLSCREEN MODAL
   -------------------------------------------------------------------------- */
.photo-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.photo-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.photo-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 14, 20, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.photo-modal-card {
  position: relative;
  background: #ffffff;
  padding: 14px 14px 20px;
  border-radius: 20px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  z-index: 2;
  text-align: center;
  animation: modalScaleUp 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

.modal-close-btn {
  position: absolute;
  top: -14px;
  right: -14px;
  background: #ffffff;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 700;
  color: #333;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.photo-modal-card img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.modal-caption {
  font-family: var(--font-cursive);
  font-size: 22px;
  font-weight: 600;
  color: #3b2a33;
  margin-top: 10px;
}

.modal-sub {
  font-size: 11px;
  color: #a48c97;
  margin-top: 2px;
}

/* --------------------------------------------------------------------------
   CUSTOMIZATION DRAWER MODAL
   -------------------------------------------------------------------------- */
.custom-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.custom-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.custom-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.custom-modal-box {
  position: relative;
  background: #ffffff;
  width: 100%;
  max-width: 440px;
  border-radius: 28px 28px 0 0;
  padding: 20px 22px 30px;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
  z-index: 2;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  max-height: 85vh;
  overflow-y: auto;
}

.custom-modal.active .custom-modal-box {
  transform: translateY(0);
}

.modal-handle {
  width: 42px;
  height: 4px;
  background: #ddd;
  border-radius: 2px;
  margin: 0 auto 14px;
}

.custom-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.custom-header h3 {
  font-size: 17px;
  font-weight: 600;
  color: #333;
}

.close-custom-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #888;
  padding: 4px;
}

.custom-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.custom-body label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.custom-body label span {
  font-size: 12px;
  font-weight: 600;
  color: #555;
}

.custom-body input[type="text"],
.custom-body textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #ffd0df;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  background: #fffbfd;
}

.custom-body input[type="text"]:focus,
.custom-body textarea:focus {
  border-color: var(--primary-pink);
  background: #ffffff;
}

.hint-small {
  font-size: 11px;
  color: #999;
}

.custom-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.save-btn {
  background: linear-gradient(135deg, #ff6584, #f0506e);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(240, 80, 110, 0.3);
}

.copy-link-btn {
  background: #f7eff3;
  color: #5d4653;
  border: 1px solid #ebd3df;
  padding: 10px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   NOTIFICATION TOAST
   -------------------------------------------------------------------------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(30, 24, 28, 0.92);
  color: white;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  z-index: 500;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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