:root {
  --bg-1: #fff1f5;
  --bg-2: #ffe4ee;
  --bg-3: #fff4e6;
  --rose-deep: #be123c;
  --rose-main: #f43f5e;
  --rose-soft: #fb7185;
  --peach-gold: #ffb703;
  --cream: #fffafb;
  --text-dark: #4a192c;
  --text-muted: #8c4a62;
  --card-w: 84px;
  --card-h: 98px;
}

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

html, body {
  min-height: 100%;
  font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-dark);
  overflow-x: hidden;
  background: linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 48%, var(--bg-3) 100%);
  transition: background 1s ease;
}

body.celebration-bg {
  background: radial-gradient(circle at 50% 30%, #fff7e8 0%, #ffd6e6 45%, #ffc2d4 100%);
}

/* Dreamy Romantic Background Blobs & Twinkles */
.bg-scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.aurora-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  animation: floatBlob 14s ease-in-out infinite alternate;
}

.blob-1 {
  width: 380px;
  height: 380px;
  top: -80px;
  left: -90px;
  background: radial-gradient(circle, #ff9ebb, transparent 70%);
}

.blob-2 {
  width: 420px;
  height: 420px;
  bottom: -100px;
  right: -80px;
  background: radial-gradient(circle, #ffd6a5, transparent 70%);
  animation-delay: -5s;
}

.blob-3 {
  width: 300px;
  height: 300px;
  top: 40%;
  left: 52%;
  background: radial-gradient(circle, #ffb3c6, transparent 70%);
  animation-delay: -9s;
}

@keyframes floatBlob {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(35px, -30px) scale(1.12); }
}

.twinkle-layer {
  position: absolute;
  inset: 0;
}

.twinkle-star {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #fff;
  clip-path: polygon(50% 0%, 63% 37%, 100% 50%, 63% 63%, 50% 100%, 37% 63%, 0% 50%, 37% 37%);
  opacity: 0.3;
  animation: twinklePulse 3s ease-in-out infinite;
}

@keyframes twinklePulse {
  0%, 100% { transform: scale(0.6); opacity: 0.25; }
  50% { transform: scale(1.25); opacity: 0.9; }
}

#celebration-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20;
}

/* Top Bar */
.top-bar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 780px;
  margin: 0 auto;
  padding: 14px 18px 6px;
}

.progress-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 143, 171, 0.4);
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.1);
}

.pill-gap {
  width: 6px;
}

.pill {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  background: #ffe4ec;
  color: #b5657e;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pill.active {
  background: #ffb3c6;
  color: #fff;
  transform: scale(1.1);
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.22);
}

.pill.revealed {
  background: linear-gradient(135deg, #ff4d79, #fb7185);
  color: #fff;
  transform: scale(1.12);
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.35);
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 143, 171, 0.45);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  font-size: 1.15rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 16px rgba(244, 63, 94, 0.12);
  transition: transform 0.2s ease;
}

.icon-btn:hover {
  transform: scale(1.08);
}

/* Main Stage */
.stage {
  position: relative;
  z-index: 10;
  max-width: 820px;
  margin: 0 auto;
  padding: 6px 16px 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Cute Baby Mascot */
.baby-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 6px;
}

.baby-bubble {
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid #ffc2d4;
  color: var(--text-dark);
  padding: 9px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  box-shadow: 0 8px 22px rgba(244, 63, 94, 0.14);
  position: relative;
  margin-bottom: 6px;
  max-width: 92vw;
  animation: bubbleFloat 3.2s ease-in-out infinite;
}

.baby-bubble::after {
  content: "";
  position: absolute;
  bottom: -9px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 9px 8px 0;
  border-style: solid;
  border-color: #ffffff transparent transparent;
}

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

.baby-mascot {
  width: 128px;
  height: 124px;
  animation: babyIdleBob 2.8s ease-in-out infinite;
  transform-origin: center bottom;
}

.baby-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 10px 18px rgba(244, 63, 94, 0.16));
}

@keyframes babyIdleBob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-6px) rotate(1.5deg); }
}

.baby-arm-left {
  transform-origin: 54px 128px;
  animation: waveLeft 2.4s ease-in-out infinite;
}

.baby-arm-right {
  transform-origin: 126px 128px;
  animation: waveRight 2.4s ease-in-out infinite;
}

@keyframes waveLeft {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-16deg); }
}

@keyframes waveRight {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(16deg); }
}

.mini-heart {
  animation: miniFloat 2.4s ease-in-out infinite;
}
.mini-heart.h2 { animation-delay: 0.9s; }

@keyframes miniFloat {
  0%, 100% { transform: translateY(0) scale(0.95); opacity: 0.75; }
  50% { transform: translateY(-6px) scale(1.15); opacity: 1; }
}

/* Baby Mood States */
.baby-crown,
.eyes-happy,
.mouth-giggle,
.mouth-kiss {
  display: none;
}

.baby-mascot[data-mood="happy"] {
  animation: babyHappyJump 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 2;
}
.baby-mascot[data-mood="happy"] .eyes-open,
.baby-mascot[data-mood="happy"] .mouth-idle {
  display: none;
}
.baby-mascot[data-mood="happy"] .eyes-happy,
.baby-mascot[data-mood="happy"] .mouth-giggle {
  display: block;
}

.baby-mascot[data-mood="kiss"] {
  animation: babyHappyJump 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 2;
}
.baby-mascot[data-mood="kiss"] .eyes-open,
.baby-mascot[data-mood="kiss"] .mouth-idle {
  display: none;
}
.baby-mascot[data-mood="kiss"] .eyes-happy,
.baby-mascot[data-mood="kiss"] .mouth-kiss {
  display: block;
}

.baby-mascot[data-mood="party"] {
  animation: babyPartyDance 0.9s ease-in-out infinite;
}
.baby-mascot[data-mood="party"] .baby-crown {
  display: block;
}
.baby-mascot[data-mood="party"] .eyes-open,
.baby-mascot[data-mood="party"] .mouth-idle {
  display: none;
}
.baby-mascot[data-mood="party"] .eyes-happy,
.baby-mascot[data-mood="party"] .mouth-giggle {
  display: block;
}

@keyframes babyHappyJump {
  0%, 100% { transform: translateY(0) scale(1); }
  45% { transform: translateY(-16px) scale(1.08); }
}

@keyframes babyPartyDance {
  0%, 100% { transform: translateY(0) rotate(-5deg) scale(1.04); }
  50% { transform: translateY(-10px) rotate(5deg) scale(1.08); }
}

/* Scratch Arena */
.scratch-arena {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.scratch-arena.fade-out {
  opacity: 0;
  transform: scale(0.9) translateY(-16px);
  pointer-events: none;
}

.headline-wrap {
  text-align: center;
  margin-bottom: 18px;
}

.main-title {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(2.1rem, 5vw, 3.1rem);
  color: var(--rose-deep);
  text-shadow: 0 4px 14px rgba(255, 255, 255, 0.9);
  line-height: 1.15;
}

.subtitle {
  margin-top: 6px;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-muted);
}

.cards-layout {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 20px 26px;
  max-width: 760px;
  padding: 12px 6px;
}

.word-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.42);
  border: 1.5px solid rgba(255, 194, 212, 0.7);
  box-shadow: 0 10px 28px rgba(244, 63, 94, 0.08);
}

/* Individual Scratch Card */
.scratch-card {
  position: relative;
  width: var(--card-w);
  height: var(--card-h);
  border-radius: 20px;
  background: linear-gradient(145deg, #ffffff 0%, #fff0f5 100%);
  box-shadow: 0 10px 24px rgba(190, 18, 60, 0.14), inset 0 0 0 2px #ffc2d4;
  overflow: hidden;
  user-select: none;
  touch-action: none;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease, opacity 0.35s ease;
}

.scratch-card .letter-underlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.scratch-card .revealed-char {
  font-family: 'Fredoka', sans-serif;
  font-size: 3rem;
  font-weight: 700;
  background: linear-gradient(135deg, #e11d48 0%, #fb7185 55%, #f59e0b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 6px rgba(244, 63, 94, 0.22));
  transform: scale(0.85);
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scratch-card.revealed .revealed-char {
  transform: scale(1.08);
}

.scratch-card .card-mini-heart {
  font-size: 0.85rem;
  margin-top: -4px;
  opacity: 0.85;
}

.scratch-card canvas.scratch-foil {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  border-radius: 20px;
  transition: opacity 0.45s ease;
}

.scratch-card canvas.scratch-foil:active {
  cursor: grabbing;
}

/* Locked State (waiting for previous letter) */
.scratch-card.locked {
  opacity: 0.72;
  transform: scale(0.95);
  box-shadow: 0 6px 14px rgba(190, 18, 60, 0.08);
}

.scratch-card .lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 228, 236, 0.55);
  backdrop-filter: blur(1.5px);
  pointer-events: auto;
  cursor: not-allowed;
  font-size: 0.72rem;
  font-weight: 700;
  color: #9d4e68;
  gap: 4px;
  z-index: 4;
  transition: opacity 0.3s ease;
}

.scratch-card:not(.locked) .lock-overlay {
  opacity: 0;
  pointer-events: none;
}

/* Active Next Card Glow + Scratch Hint */
.scratch-card.active-target {
  transform: scale(1.06);
  box-shadow: 0 14px 32px rgba(244, 63, 94, 0.32), 0 0 0 4px rgba(255, 133, 161, 0.55);
  animation: activeCardPulse 1.7s ease-in-out infinite;
  z-index: 3;
}

@keyframes activeCardPulse {
  0%, 100% { box-shadow: 0 14px 32px rgba(244, 63, 94, 0.28), 0 0 0 3px rgba(255, 133, 161, 0.5); }
  50% { box-shadow: 0 18px 36px rgba(244, 63, 94, 0.42), 0 0 0 7px rgba(255, 180, 200, 0.7); }
}

.scratch-card .hand-hint {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: 1.25rem;
  pointer-events: none;
  z-index: 5;
  display: none;
  animation: scratchGesture 1.1s ease-in-out infinite;
}

.scratch-card.active-target:not(.scratching) .hand-hint {
  display: block;
}

@keyframes scratchGesture {
  0%, 100% { transform: translate(0, 0) rotate(-10deg); }
  50% { transform: translate(-12px, -8px) rotate(12deg); }
}

.scratch-card.revealed {
  transform: scale(1);
  box-shadow: 0 12px 26px rgba(244, 63, 94, 0.22), inset 0 0 0 2.5px #ff7aa2;
  animation: popReveal 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scratch-card.revealed canvas.scratch-foil {
  opacity: 0;
  pointer-events: none;
}

@keyframes popReveal {
  0% { transform: scale(0.9); }
  50% { transform: scale(1.16) rotate(-2deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* Grand Finale: Arranged Together "I LOVE U" */
.finale-stage {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  padding-top: 6px;
  animation: finaleEntrance 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hidden {
  display: none !important;
}

@keyframes finaleEntrance {
  from { opacity: 0; transform: translateY(24px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.finale-glow-ring {
  position: absolute;
  top: -20px;
  width: 340px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 133, 161, 0.42), rgba(255, 209, 102, 0.2), transparent 72%);
  filter: blur(20px);
  z-index: -1;
  animation: ringPulse 3s ease-in-out infinite;
}

@keyframes ringPulse {
  0%, 100% { transform: scale(1); opacity: 0.75; }
  50% { transform: scale(1.15); opacity: 1; }
}

.assembled-phrase {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
  padding: 18px 22px;
  margin: 4px 0 22px;
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(12px);
  border: 2.5px solid #ffb3c6;
  box-shadow: 0 20px 50px rgba(244, 63, 94, 0.22), 0 0 36px rgba(255, 209, 102, 0.3);
}

.phrase-word {
  display: flex;
  gap: 6px;
}

.finale-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 64px;
  border-radius: 16px;
  font-family: 'Fredoka', sans-serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, #ff4d79 0%, #fb7185 55%, #ff9ebb 100%);
  box-shadow: 0 8px 18px rgba(225, 29, 72, 0.28), inset 0 2px 4px rgba(255, 255, 255, 0.45);
  opacity: 0;
  transform: translateY(-38px) scale(0.4) rotate(-12deg);
  animation: flyInLetter 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) var(--delay) forwards,
             letterFloat 2.8s ease-in-out calc(var(--delay) + 0.8s) infinite;
}

@keyframes flyInLetter {
  to {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

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

.heart-divider {
  font-size: 1.7rem;
  animation: heartBeat 1.15s ease-in-out infinite;
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.28); }
  60% { transform: scale(1.06); }
}

.love-note-card {
  max-width: 520px;
  width: 100%;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  border: 2px solid rgba(255, 179, 198, 0.85);
  border-radius: 26px;
  padding: 22px 24px;
  box-shadow: 0 16px 38px rgba(190, 18, 60, 0.14);
  margin-bottom: 20px;
}

.note-badge {
  display: inline-block;
  background: linear-gradient(135deg, #ffe4ec, #fff0db);
  color: var(--rose-deep);
  padding: 5px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.love-note-text {
  font-size: 1.06rem;
  line-height: 1.65;
  font-weight: 600;
  color: var(--text-dark);
}

.note-signature {
  margin-top: 12px;
  font-family: 'Dancing Script', cursive;
  font-size: 1.65rem;
  color: var(--rose-deep);
}

.finale-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.btn-romantic,
.btn-soft {
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-romantic {
  background: linear-gradient(135deg, #ff4d79, #fb7185);
  color: #fff;
  box-shadow: 0 10px 24px rgba(244, 63, 94, 0.34);
}

.btn-soft {
  background: rgba(255, 255, 255, 0.9);
  color: var(--rose-deep);
  border: 1.5px solid #ffc2d4;
  box-shadow: 0 8px 18px rgba(244, 63, 94, 0.12);
}

.btn-romantic:hover,
.btn-soft:hover {
  transform: translateY(-2px) scale(1.03);
}

/* Floating Bollywood Music Bar */
.music-dock {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  width: min(94vw, 520px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border: 2px solid #ffb3c6;
  box-shadow: 0 14px 36px rgba(190, 18, 60, 0.22);
  animation: slideUpDock 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUpDock {
  from { opacity: 0; transform: translate(-50%, 30px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.vinyl-disc {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff4d79, #ffd166);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
}

.vinyl-disc.spinning {
  animation: spinDisc 3.2s linear infinite;
}

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

.music-info {
  flex: 1;
  min-width: 0;
}

.music-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rose-main);
}

.music-title {
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-play-btn {
  border: none;
  border-radius: 999px;
  padding: 9px 15px;
  background: linear-gradient(135deg, #ff4d79, #fb7185);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
}

.music-play-btn.pulse-attention {
  animation: activeCardPulse 1.3s ease-in-out infinite;
}

.yt-peek-btn {
  border: 1.5px solid #ffc2d4;
  background: #fff5f8;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  flex-shrink: 0;
}

.yt-drawer {
  position: fixed;
  bottom: 86px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 29;
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid #ffb3c6;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
  background: #000;
}

/* Mobile Responsive Adjustments */
@media (max-width: 560px) {
  :root {
    --card-w: 68px;
    --card-h: 82px;
  }

  .baby-mascot {
    width: 108px;
    height: 104px;
  }

  .cards-layout {
    gap: 12px;
  }

  .word-group {
    gap: 8px;
    padding: 8px 10px;
  }

  .scratch-card .revealed-char {
    font-size: 2.35rem;
  }

  .finale-letter {
    width: 42px;
    height: 52px;
    font-size: 1.85rem;
    border-radius: 13px;
  }

  .assembled-phrase {
    gap: 8px;
    padding: 14px 14px;
  }
}
