/* ===== RESET & BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #0d0015 0%, #1a0a2e 30%, #2d1b4e 60%, #1a0a2e 100%);
  color: #f3f3f3;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
}

/* ===== FLOATING HEARTS BACKGROUND ===== */
#hearts-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floating-heart {
  position: absolute;
  bottom: -50px;
  color: rgba(255, 100, 150, 0.3);
  font-size: 20px;
  animation: floatUp linear infinite;
  pointer-events: none;
  user-select: none;
}

@keyframes floatUp {
  0% {
    transform: translateY(0) rotate(0deg) scale(1);
    opacity: 0;
  }
  10% { opacity: 1; }
  90% { opacity: 0.8; }
  100% {
    transform: translateY(-110vh) rotate(720deg) scale(0.3);
    opacity: 0;
  }
}

/* ===== SPARKLE CANVAS ===== */
#sparkle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* ===== HEART BURST CANVAS ===== */
#heart-burst-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
}

/* ===== INTRO SCREEN ===== */
#intro-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, #2d1b4e 0%, #1a0a2e 40%, #0d0015 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  transition: opacity 1s ease, transform 1s ease;
}

#intro-screen.hide {
  opacity: 0;
  transform: scale(1.1);
  pointer-events: none;
}

.intro-content {
  text-align: center;
  padding: 40px;
  animation: fadeInUp 1.2s ease-out;
}

.intro-hearts { margin-bottom: 20px; }

.intro-heart {
  display: inline-block;
  font-size: 2.5rem;
  color: #ff4081;
  animation: heartPulse 1.5s ease-in-out infinite;
  margin: 0 8px;
  filter: drop-shadow(0 0 10px rgba(255, 64, 129, 0.6));
}
.intro-heart.delay-1 { animation-delay: 0.3s; font-size: 3.5rem; color: #ff1744; }
.intro-heart.delay-2 { animation-delay: 0.6s; }

@keyframes heartPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

.intro-title {
  font-family: 'Dancing Script', cursive;
  font-size: 4rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 30%, #ffecd2 60%, #ff9a9e 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s ease-in-out infinite;
  margin-bottom: 10px;
}

@keyframes shimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.intro-subtitle {
  font-family: 'Poppins', sans-serif;
  font-size: 1.2rem;
  color: #e0b0ff;
  font-weight: 300;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 25px;
  opacity: 0;
  animation: fadeInUp 1s ease-out 0.5s forwards;
}

.intro-line {
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #ff4081, transparent);
  margin: 0 auto 25px;
  opacity: 0;
  animation: fadeInUp 1s ease-out 0.7s forwards;
}

.intro-poem {
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  color: #c4a5d6;
  line-height: 1.9;
  font-weight: 300;
  max-width: 500px;
  margin: 0 auto 35px;
  opacity: 0;
  animation: fadeInUp 1s ease-out 0.9s forwards;
}

.btn-love {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #ff4081, #ff1744, #d50000);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 15px 40px;
  font-family: 'Poppins', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 5px 25px rgba(255, 23, 68, 0.4), 0 0 60px rgba(255, 64, 129, 0.15);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  opacity: 0;
  animation: fadeInUp 1s ease-out 1.2s forwards;
  position: relative;
  overflow: hidden;
}
.btn-love::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 60%);
  transform: scale(0);
  transition: transform 0.6s ease;
}
.btn-love:hover::before { transform: scale(1); }
.btn-love:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 10px 35px rgba(255, 23, 68, 0.5), 0 0 80px rgba(255, 64, 129, 0.25);
}
.btn-love:active { transform: translateY(-1px) scale(0.98); }

/* ===== MAIN PAGE ===== */
.container {
  width: 100%;
  max-width: 1000px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
}

.love-badge {
  background: rgba(255, 64, 129, 0.15);
  border: 1px solid rgba(255, 64, 129, 0.3);
  border-radius: 50px;
  padding: 8px 24px;
  font-size: 0.85rem;
  color: #ff80ab;
  font-weight: 400;
  letter-spacing: 1px;
  margin-bottom: 15px;
  animation: fadeInUp 0.8s ease-out;
}

.main-title {
  font-family: 'Dancing Script', cursive;
  font-size: 3.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ff9a9e, #fad0c4, #ffecd2, #ff9a9e);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s ease-in-out infinite, fadeInUp 1s ease-out;
  text-align: center;
  margin-bottom: 5px;
}

.main-subtitle {
  font-size: 1.1rem;
  color: #c4a5d6;
  font-weight: 300;
  letter-spacing: 1px;
  margin-bottom: 20px;
  animation: fadeInUp 1s ease-out 0.3s both;
}

/* ===== CAKE CONTAINER ===== */
#cake-container {
  position: relative;
  width: 100%;
  max-width: 500px;
  margin: 20px 0 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cake-glow {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 140%;
  height: 140%;
  background: radial-gradient(ellipse, rgba(255, 120, 160, 0.12) 0%, rgba(255, 183, 77, 0.08) 30%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: cakeGlowPulse 3s ease-in-out infinite alternate;
}

@keyframes cakeGlowPulse {
  0% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

/* ===== CANDLE ===== */
#cake-candle-canvas {
  position: relative;
  width: 60px;
  height: 90px;
  z-index: 10;
  background: transparent;
  margin-bottom: -18px;
  filter:
    drop-shadow(0 0 15px rgba(255, 237, 133, 0.7))
    drop-shadow(0 0 30px rgba(255, 213, 0, 0.5));
  transition: all 0.3s ease;
}

#cake-candle-canvas.candle-off {
  filter: none;
  opacity: 0.8;
}

/* ========================================
   ===== PURE CSS CAKE =====
   ======================================== */

.css-cake {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 5;
  animation: cakeEntrance 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: 0.3s;
  cursor: pointer;
}

#cake-sparkle-canvas {
  position: absolute;
  top: -20px;
  left: -30px;
  width: calc(100% + 60px);
  height: calc(100% + 40px);
  pointer-events: none;
  z-index: 20;
}

@keyframes cakeEntrance {
  0% {
    opacity: 0;
    transform: scale(0.6) translateY(60px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.css-cake:hover .tier-1 { transform: translateY(-6px); }
.css-cake:hover .tier-2 { transform: translateY(-3px); }
.css-cake:hover .tier-1 .tier-body { box-shadow: 0 8px 30px rgba(255, 105, 135, 0.35); }
.css-cake:hover .tier-2 .tier-body { box-shadow: 0 8px 30px rgba(255, 105, 135, 0.3); }
.css-cake:hover .tier-3 .tier-body { box-shadow: 0 10px 35px rgba(255, 105, 135, 0.25); }

/* ===== CAKE TIERS ===== */
.cake-tier {
  position: relative;
  display: flex;
  justify-content: center;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 5;
}

.tier-body {
  position: relative;
  border-radius: 12px 12px 14px 14px;
  overflow: visible;
  transition: box-shadow 0.5s ease, transform 0.3s ease;
}

/* Tier 1 - Top */
.tier-1 { z-index: 7; margin-bottom: -2px; }
.tier-1 .tier-body {
  width: 140px;
  height: 75px;
  background: linear-gradient(180deg, #f8bbd0 0%, #f48fb1 40%, #ec407a 100%);
  border-radius: 10px 10px 12px 12px;
  box-shadow:
    0 4px 15px rgba(236, 64, 122, 0.3),
    inset 0 2px 4px rgba(255, 255, 255, 0.25),
    inset 0 -3px 6px rgba(0, 0, 0, 0.1);
}

/* Tier 2 - Middle */
.tier-2 { z-index: 6; margin-bottom: -2px; }
.tier-2 .tier-body {
  width: 210px;
  height: 85px;
  background: linear-gradient(180deg, #f8bbd0 0%, #f06292 40%, #e91e63 100%);
  border-radius: 10px 10px 14px 14px;
  box-shadow:
    0 4px 18px rgba(233, 30, 99, 0.3),
    inset 0 2px 4px rgba(255, 255, 255, 0.2),
    inset 0 -3px 6px rgba(0, 0, 0, 0.1);
}

/* Tier 3 - Bottom */
.tier-3 { z-index: 5; }
.tier-3 .tier-body {
  width: 290px;
  height: 95px;
  background: linear-gradient(180deg, #f48fb1 0%, #e91e63 40%, #c2185b 100%);
  border-radius: 10px 10px 16px 16px;
  box-shadow:
    0 6px 25px rgba(194, 24, 91, 0.35),
    inset 0 2px 4px rgba(255, 255, 255, 0.2),
    inset 0 -4px 8px rgba(0, 0, 0, 0.12);
}

/* ===== FROSTING TOP ===== */
.frosting-top {
  position: absolute;
  top: -6px;
  left: -4px;
  right: -4px;
  height: 16px;
  background: linear-gradient(180deg, #fff5f5 0%, #fce4ec 60%, #f8bbd0 100%);
  border-radius: 10px 10px 50% 50% / 10px 10px 100% 100%;
  z-index: 3;
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.08),
    inset 0 -1px 3px rgba(248, 187, 208, 0.5);
}

/* ===== CREAM BORDER ===== */
.tier-cream-border {
  position: absolute;
  bottom: -3px;
  left: -2px;
  right: -2px;
  height: 10px;
  background: linear-gradient(180deg, #fce4ec, #fff5f5);
  border-radius: 0 0 14px 14px;
  z-index: 2;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

/* ===== FROSTING DRIPS ===== */
.drip {
  position: absolute;
  top: 4px;
  width: 14px;
  background: linear-gradient(180deg, #fff5f5, #fce4ec, #f8bbd0);
  border-radius: 0 0 50% 50%;
  z-index: 4;
  animation: dripDown 3s ease-in-out infinite alternate;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

@keyframes dripDown {
  0% { height: var(--drip-h); }
  50% { height: calc(var(--drip-h) + 5px); }
  100% { height: var(--drip-h); }
}

/* Tier 1 drips */
.tier-1 .drip-1 { left: 15%; --drip-h: 22px; height: 22px; animation-delay: 0s; width: 12px; }
.tier-1 .drip-2 { left: 50%; --drip-h: 30px; height: 30px; animation-delay: 0.8s; }
.tier-1 .drip-3 { left: 78%; --drip-h: 18px; height: 18px; animation-delay: 1.5s; width: 11px; }

/* Tier 2 drips */
.tier-2 .drip-1 { left: 10%; --drip-h: 28px; height: 28px; animation-delay: 0.3s; }
.tier-2 .drip-2 { left: 35%; --drip-h: 20px; height: 20px; animation-delay: 1.2s; width: 12px; }
.tier-2 .drip-3 { left: 60%; --drip-h: 32px; height: 32px; animation-delay: 0.6s; }
.tier-2 .drip-4 { left: 85%; --drip-h: 24px; height: 24px; animation-delay: 1.8s; width: 11px; }

/* Tier 3 drips */
.tier-3 .drip-1 { left: 8%; --drip-h: 26px; height: 26px; animation-delay: 0.2s; }
.tier-3 .drip-2 { left: 25%; --drip-h: 34px; height: 34px; animation-delay: 1s; }
.tier-3 .drip-3 { left: 45%; --drip-h: 20px; height: 20px; animation-delay: 0.5s; width: 12px; }
.tier-3 .drip-4 { left: 65%; --drip-h: 30px; height: 30px; animation-delay: 1.4s; }
.tier-3 .drip-5 { left: 85%; --drip-h: 22px; height: 22px; animation-delay: 0.7s; width: 11px; }

/* ===== DECORATIONS - HEARTS ===== */
.tier-deco {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-evenly;
  padding: 0 12px;
  z-index: 5;
  pointer-events: none;
}

.deco-heart {
  font-size: 12px;
  color: #fff;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.6));
  animation: decoFloat 2.5s ease-in-out infinite;
  transition: transform 0.3s ease;
}

.deco-heart.dh-1 { animation-delay: 0s; }
.deco-heart.dh-2 { animation-delay: 0.4s; }
.deco-heart.dh-3 { animation-delay: 0.8s; }
.deco-heart.dh-4 { animation-delay: 1.2s; }

.deco-rose {
  font-size: 13px;
  color: #ffcdd2;
  filter: drop-shadow(0 0 3px rgba(255, 205, 210, 0.5));
  animation: decoSpin 4s linear infinite;
}

.deco-rose.dr-1 { animation-delay: 0s; }
.deco-rose.dr-2 { animation-delay: 1.3s; }
.deco-rose.dr-3 { animation-delay: 2.6s; }

@keyframes decoFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3px) scale(1.15); }
}

@keyframes decoSpin {
  0% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(90deg) scale(1.1); }
  50% { transform: rotate(180deg) scale(1); }
  75% { transform: rotate(270deg) scale(1.1); }
  100% { transform: rotate(360deg) scale(1); }
}

/* ===== DECORATIONS - DOTS ===== */
.tier-dots {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-evenly;
  padding: 0 18px;
  z-index: 5;
  pointer-events: none;
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, #fce4ec);
  box-shadow:
    0 0 6px rgba(255, 255, 255, 0.5),
    0 0 12px rgba(255, 182, 193, 0.3);
  animation: dotTwinkle 2s ease-in-out infinite;
}

.dot:nth-child(1) { animation-delay: 0s; }
.dot:nth-child(2) { animation-delay: 0.25s; }
.dot:nth-child(3) { animation-delay: 0.5s; }
.dot:nth-child(4) { animation-delay: 0.75s; }
.dot:nth-child(5) { animation-delay: 1s; }
.dot:nth-child(6) { animation-delay: 1.25s; }
.dot:nth-child(7) { animation-delay: 1.5s; }
.dot:nth-child(8) { animation-delay: 1.75s; }
.dot:nth-child(9) { animation-delay: 0.15s; }

@keyframes dotTwinkle {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.5), 0 0 12px rgba(255, 182, 193, 0.3);
  }
  50% {
    transform: scale(1.4);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 0 0 20px rgba(255, 105, 135, 0.5);
  }
}

/* ===== CAKE PLATE ===== */
.cake-plate {
  position: relative;
  width: 340px;
  height: 22px;
  background: linear-gradient(180deg, #e8e0e4 0%, #f5f0f2 30%, #d4ccd0 100%);
  border-radius: 50%;
  margin-top: -4px;
  z-index: 4;
  box-shadow:
    0 4px 15px rgba(0, 0, 0, 0.2),
    0 8px 30px rgba(0, 0, 0, 0.1),
    inset 0 1px 3px rgba(255, 255, 255, 0.6),
    inset 0 -2px 4px rgba(0, 0, 0, 0.08);
}

.plate-shine {
  position: absolute;
  top: 3px;
  left: 15%;
  width: 70%;
  height: 5px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
  border-radius: 50%;
}

/* ===== CAKE HOVER MICRO-INTERACTIONS ===== */
.css-cake:hover .deco-heart {
  animation-duration: 1.5s;
}
.css-cake:hover .deco-rose {
  animation-duration: 2s;
}
.css-cake:hover .dot {
  animation-duration: 1.2s;
}
.css-cake:hover .drip {
  animation-duration: 1.5s;
}

/* Tier click ripple */
.tier-body.ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  animation: rippleOut 0.6s ease-out forwards;
  z-index: 10;
}

@keyframes rippleOut {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(20); opacity: 0; }
}

/* Cake gentle float */
.css-cake {
  animation: cakeEntrance 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) both,
             cakeBreath 4s ease-in-out 1.5s infinite;
}

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

/* ===== MESSAGES ===== */
#congrats-message {
  font-family: 'Dancing Script', cursive;
  font-size: 1.6rem;
  color: #ffb3c6;
  font-weight: 600;
  margin: 10px 0;
  text-align: center;
  line-height: 1.6;
  display: block;
  margin-top: 300px;
  animation: fadeIn 0.8s ease-out, subtleGlow 2s ease-in-out infinite alternate;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 15px rgba(255, 100, 150, 0.3);
}

#celebrate-message {
  font-family: 'Dancing Script', cursive;
  font-size: 1.6rem;
  color: #ff4081;
  font-weight: 700;
  margin: 10px 0 15px;
  text-align: center;
  display: none;
  animation: popIn 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55), float 3s ease-in-out infinite;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 64, 129, 0.4);
}

.celebrate-hearts {
  display: inline-block;
  animation: heartPulse 1s ease-in-out infinite;
  color: #ff1744;
}

/* ===== WISH TEXT ===== */
.wish-text {
  color: #c4a5d6;
  font-size: 1.1rem;
  margin-top: 15px;
  margin-bottom: 5px;
  font-style: italic;
  animation: fadeInUp 1s ease-out 0.5s both;
}

.wish-prompt {
  font-family: 'Dancing Script', cursive;
  color: #ffb3c6;
  margin-top: 5px;
  font-size: 1.5rem;
  text-shadow: 0 0 15px rgba(255, 150, 180, 0.3);
  animation: fadeInUp 1s ease-out 0.7s both;
}

/* ===== BUTTONS ===== */
.btn-main {
  background: linear-gradient(135deg, #ff4081 0%, #ff1744 50%, #d50000 100%);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 14px 40px;
  font-family: 'Poppins', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 15px;
  box-shadow: 0 5px 20px rgba(255, 64, 129, 0.4), 0 0 40px rgba(255, 64, 129, 0.1);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 10;
  position: relative;
  overflow: hidden;
  animation: fadeInUp 1s ease-out 0.9s both;
}
.btn-main::after {
  content: '';
  position: absolute;
  top: -2px; left: -2px; right: -2px; bottom: -2px;
  background: linear-gradient(135deg, #ff4081, #ff9100, #ff4081);
  border-radius: 52px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.btn-main:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 30px rgba(255, 64, 129, 0.5), 0 0 60px rgba(255, 64, 129, 0.15);
}
.btn-main:hover::after { opacity: 1; }
.btn-icon { margin-right: 5px; }

.btn-secondary {
  background: linear-gradient(135deg, #7c4dff 0%, #651fff 100%);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 10px 30px;
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  margin-top: 10px;
  box-shadow: 0 4px 15px rgba(101, 31, 255, 0.3);
  transition: all 0.3s ease;
  display: none;
}
.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(101, 31, 255, 0.4);
}

/* ===== LOVE LETTER ===== */
#love-letter {
  margin-top: 40px;
  width: 100%;
  max-width: 500px;
  animation: fadeInUp 1s ease-out;
}

.letter-envelope {
  background: linear-gradient(135deg, #fff5f5, #fff0f5);
  border-radius: 20px;
  padding: 3px;
  box-shadow: 0 10px 40px rgba(255, 64, 129, 0.15), 0 0 0 1px rgba(255, 100, 150, 0.1);
}

.letter-paper {
  background: linear-gradient(180deg, #fffbfe, #fff5f8);
  border-radius: 18px;
  padding: 35px 30px;
  position: relative;
}

.letter-paper::before {
  content: '';
  position: absolute;
  top: 15px;
  left: 20px;
  right: 20px;
  height: 1px;
  background: repeating-linear-gradient(90deg, transparent, transparent 5px, rgba(255, 150, 180, 0.3) 5px, rgba(255, 150, 180, 0.3) 10px);
}

.letter-heading {
  font-family: 'Dancing Script', cursive;
  font-size: 1.8rem;
  color: #d81b60;
  text-align: center;
  margin-bottom: 20px;
}

.letter-body {
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  color: #5d4037;
  line-height: 1.8;
  text-align: center;
  min-height: 80px;
}

.letter-body .cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: #d81b60;
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 0.8s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.letter-sign {
  font-family: 'Dancing Script', cursive;
  font-size: 1.4rem;
  color: #e91e63;
  text-align: right;
  margin-top: 20px;
  opacity: 0;
  transition: opacity 1s ease;
}
.letter-sign.show { opacity: 1; }

/* ===== GREETING CARD ===== */
.greeting-card {
  position: absolute;
  left: 50%;
  top: 60%;
  transform: translate(-50%, -50%);
  z-index: 15;
  width: 90%;
  max-width: 420px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease-out, transform 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  perspective: 1200px;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
}

.greeting-card.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes popIn {
  0% { transform: scale(0.5); opacity: 0; }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes subtleGlow {
  0% { text-shadow: 0 2px 4px rgba(0,0,0,0.3), 0 0 10px rgba(255,100,150,0.3); }
  100% { text-shadow: 0 2px 6px rgba(0,0,0,0.4), 0 0 20px rgba(255,100,150,0.5); }
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .intro-title { font-size: 2.8rem; }
  .intro-subtitle { font-size: 0.95rem; }
  .intro-poem { font-size: 0.9rem; padding: 0 15px; }
  .main-title { font-size: 2.4rem; }

  #cake-container { max-width: 95%; margin: 15px 0 15px; }

  #cake-candle-canvas {
    width: 45px;
    height: 70px;
    margin-bottom: -14px;
  }

  .tier-1 .tier-body { width: 100px; height: 55px; }
  .tier-2 .tier-body { width: 155px; height: 65px; }
  .tier-3 .tier-body { width: 210px; height: 75px; }
  .cake-plate { width: 245px; height: 18px; }

  .deco-heart { font-size: 9px; }
  .deco-rose { font-size: 10px; }
  .dot { width: 5px; height: 5px; }
  .drip { width: 10px; }

  #congrats-message { font-size: 1.3rem; margin: 8px 0; display: block; margin-top: 100px; }
  #celebrate-message { font-size: 1.4rem; margin: 8px 0 12px; }
  .btn-main { padding: 12px 28px; font-size: 1rem; margin-top: 12px; }
  .wish-prompt { font-size: 1.3rem; margin: 8px 0 4px; }
  .greeting-card { max-width: 320px; top: 65%; }
  .letter-paper { padding: 25px 20px; }
  .letter-heading { font-size: 1.5rem; }
}

/* Desktop Enhancements */
@media (min-width: 1024px) {
  .intro-title { font-size: 5rem; }

  #cake-container { max-width: 600px; margin: 30px 0 30px; }

  #cake-candle-canvas {
    width: 70px;
    height: 100px;
    margin-bottom: -20px;
    filter:
      drop-shadow(0 0 20px rgba(255, 237, 133, 0.8))
      drop-shadow(0 0 40px rgba(255, 213, 0, 0.6));
  }

  .tier-1 .tier-body { width: 170px; height: 85px; }
  .tier-2 .tier-body { width: 260px; height: 100px; }
  .tier-3 .tier-body { width: 350px; height: 110px; }
  .cake-plate { width: 410px; height: 26px; }

  .deco-heart { font-size: 15px; }
  .deco-rose { font-size: 16px; }
  .dot { width: 9px; height: 9px; }

  #congrats-message { font-size: 1.9rem; }
  #celebrate-message { font-size: 2.1rem; }
  .main-title { font-size: 4rem; }
}
