* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }
html { overflow-x: hidden; }

body {
  font-family: "Georgia", "Times New Roman", serif;
  color: #3a1a1a;
  -webkit-tap-highlight-color: transparent;
  background: #f9e2b8;
}

img { -webkit-user-drag: none; user-select: none; }

button { font-family: inherit; }

#gift-landing {
  position: relative;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  background: radial-gradient(circle at center, #faeed4 0%, #f9e2b8 48%, #f5d4a0 100%);
}

#gift-landing.hidden { display: none; }

.gift-fade-veil {
  position: absolute;
  inset: 0;
  background-color: #faf0e6;
  opacity: 1;
  transition: opacity 900ms ease-out;
  pointer-events: none;
  z-index: 0;
}
#gift-landing.state-curtain .gift-fade-veil,
#gift-landing.state-bloom .gift-fade-veil {
  opacity: 0;
}

.gift-stage {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.gift-click-wrap {
  display: flex;
  height: 100%;
  width: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  transition: opacity 0.4s ease;
}
#gift-landing.state-bloom .gift-click-wrap,
#gift-landing.state-curtain .gift-click-wrap {
  opacity: 0;
  pointer-events: none;
}

.gift-box-btn {
  cursor: pointer;
  border: 0;
  background: transparent;
  padding: 0;
  outline: none;
  animation: gift-bob 3s ease-in-out infinite;
}
.gift-box-btn img {
  width: min(60vw, 320px);
  height: auto;
  filter: drop-shadow(0 10px 20px rgba(128, 0, 0, 0.25));
  transition: transform 0.3s ease;
  display: block;
}
.gift-box-btn:hover img { transform: scale(1.05); }
.gift-box-btn:active img { transform: scale(0.95); }

.gift-caption {
  font-family: "Caveat", cursive;
  font-size: clamp(2rem, 5vw, 3.25rem);
  color: #800000;
  margin: 0;
}
.gift-hint {
  font-family: "Caveat", cursive;
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: #a0522d;
  margin: 0;
  opacity: 0.75;
}

.bloom-field {
  position: absolute;
  inset: 0;
  pointer-events: none;
  contain: layout paint style;
  isolation: isolate;
  transform: translateZ(0);
  z-index: 1;
}

.bloom-flower {
  position: absolute;
  left: 0;
  top: 0;
  object-fit: contain;
  will-change: transform, opacity;
  backface-visibility: hidden;
  transform: translate3d(var(--fx), var(--fy), 0);
}
.bloom-flower.in {
  animation: flower-rain-in var(--rdur) cubic-bezier(0.19, 0.75, 0.24, 1) var(--ldelay, 0s) both,
    flower-float var(--dur) ease-in-out var(--fdelay, 0s) infinite;
}
.bloom-flower.curtain-open {
  animation: none;
  transition: transform 1.3s cubic-bezier(0.62, 0.04, 0.32, 1) var(--cdelay, 0s),
    opacity 1.3s ease-in var(--cdelay, 0s);
  transform: translate3d(calc(var(--fx) + var(--cx, 0px)), calc(var(--fy) + var(--cy, 0px)), 0)
    rotate(var(--rot-end, 0deg)) scale(0.94);
  opacity: 0;
}

@keyframes gift-bob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-8px) rotate(1deg); }
}
@keyframes flower-rain-in {
  0% {
    transform: translate3d(var(--fx), calc(var(--fy) - var(--fall)), 0) translateX(0)
      rotate(var(--rot-start, -30deg)) scale(0.9);
    opacity: 0;
  }
  8% { opacity: 1; }
  38% {
    transform: translate3d(var(--fx), calc(var(--fy) - var(--fall) * 0.6), 0) translateX(var(--sway1, 30px))
      rotate(calc(var(--rot-start, -30deg) * 0.35)) scale(0.97);
  }
  70% {
    transform: translate3d(var(--fx), calc(var(--fy) - var(--fall) * 0.2), 0) translateX(var(--sway2, -22px))
      rotate(var(--rot-end, 0deg)) scale(1.03);
  }
  100% {
    transform: translate3d(var(--fx), var(--fy), 0) translateX(0) rotate(var(--rot-end, 0deg)) scale(1);
    opacity: 1;
  }
}
@keyframes flower-float {
  0%, 100% {
    transform: translate3d(var(--fx), var(--fy), 0) rotate(var(--rot-end, 0deg)) translateY(0);
  }
  50% {
    transform: translate3d(var(--fx), var(--fy), 0) rotate(var(--rot-end, 0deg)) translateY(-9px);
  }
}

#page2 {
  display: none;
  position: relative;
  width: 100%;
  background: radial-gradient(circle at center, #faeed4 0%, #f9e2b8 48%, #f5d4a0 100%);
  background-attachment: fixed;
  color: #3a1a1a;
}
#page2.shown { display: block; }

#page3 {
  display: none;
  position: relative;
  width: 100%;
  min-height: 100dvh;
  background: radial-gradient(circle at center, #faeed4 0%, #f9e2b8 48%, #f5d4a0 100%);
  background-attachment: fixed;
  color: #3a1a1a;
}
#page3.shown {
  display: block;
  animation: page3-in 0.5s ease both;
}
@keyframes page3-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.page3-back {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(42, 90, 58, 0.18);
  border-radius: 999px;
  padding: 8px 16px 8px 12px;
  cursor: pointer;
  color: #2a5a3a;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 0.95rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px rgba(42, 90, 58, 0.12);
}
.page3-back svg { width: 16px; height: 16px; }
.page3-back:active { transform: scale(0.95); }

.page2-tint {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 240, 246, 0.15), rgba(128, 0, 0, 0.15));
  z-index: 20;
  pointer-events: none;
}

.page2-content {
  position: relative;
  z-index: 3;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes centre-enter {
  0% { transform: scale(0.6); opacity: 0; filter: blur(6px); }
  100% { transform: scale(1); opacity: 1; filter: blur(0); }
}

.rose-deco {
  position: absolute;
  top: 0px;
  left: calc(min(200px, 48vw) * -0.15); 
  z-index: 50;
  opacity: 0;
}
.rose-deco.spring {
  animation: rose-spring 1.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.rose-deco img {
  width: min(200px, 48vw);
  height: auto;
  display: block;
  border-radius: 8px;
  animation: rose-sway 7s ease-in-out infinite 1.5s;
  filter: drop-shadow(8px 10px 14px rgba(50, 10, 5, 0.45)) drop-shadow(4px 5px 8px rgba(70, 15, 8, 0.35))
    drop-shadow(2px 3px 4px rgba(0, 0, 0, 0.25)) drop-shadow(0 0 3px rgba(255, 190, 170, 0.25));
}

@keyframes rose-spring {
  0% { transform: scale(0.15); opacity: 0; }
  35% { opacity: 1; }
  52% { transform: scale(1.08); } 
  68% { transform: scale(0.97); }
  82% { transform: scale(1.02); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes rose-sway {
  0%, 100% { transform: rotate(0deg); }
  30% { transform: rotate(2deg); }
  70% { transform: rotate(-2deg); }
}

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 8vh 1rem 0;
}
.hero h1 {
  font-family: "Dancing Script", cursive;
  font-size: clamp(3rem, 9vw, 6.5rem);
  font-weight: 700;
  color: #800000;
  margin: 0;
  line-height: 1.15;
  text-shadow: 0 2px 16px rgba(255, 255, 255, 0.5), 0 0 40px rgba(128, 0, 0, 0.08);
  animation: fade-up 1.2s ease-out both;
}
.hero .sub {
  font-family: "Caveat", cursive;
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 500;
  color: #6b1f3a;
  margin-top: 0.6rem;
  margin-bottom: 2rem;
  animation: fade-up 1.4s 0.3s ease-out both;
}
.hero .centre-wrap {
  animation: centre-enter 1.2s 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  margin-bottom: 0.8rem;
}
.hero .centre-wrap > img {
  width: min(380px, 70vw);
  height: auto;
  display: block;
  filter: drop-shadow(0 8px 20px rgba(128, 0, 0, 0.12)) drop-shadow(0 2px 6px rgba(255, 140, 110, 0.1));
}

/* Cake in place of centre.png */
.hero .cake-wrap {
  position: relative;
  width: min(390px, 86vw);
  margin: 0.2rem auto 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cake-interactive-stage {
  position: relative;
  width: 100%;
  display: block;
}

.cake-img {
  width: 100% !important;
  height: auto !important;
  display: block !important;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

/* Candles Layer - Clean, transparent hotspots (no white blobs) */
.candles-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.candle-btn {
  position: absolute;
  left: var(--cx);
  top: var(--cy);
  transform: translate(-50%, -100%);
  width: 32px;
  height: 44px;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  pointer-events: auto;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 10;
}

.candle-btn.flame-center-btn {
  width: 36px;
  height: 50px;
}

/* Accessible tap target without stretching flame image */
.candle-btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 56px;
}

/* Authentic Animated SVG Candle Flames */
.candle-btn .candle-flame-svg {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: clamp(20px, 5.5vw, 26px);
  height: clamp(28px, 7.5vw, 36px);
  overflow: visible;
  pointer-events: none;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.22s ease-out;
}

.candle-btn.flame-center-btn .candle-flame-svg {
  width: clamp(22px, 6vw, 30px);
  height: clamp(32px, 8.5vw, 42px);
}

.flicker-flame {
  transform-origin: 50px 110px;
  animation: flameFlicker 0.28s infinite alternate ease-in-out;
}

/* Organic flame offsets so each candle flickers independently */
.candle-btn[data-candle="1"] .flicker-flame { animation-delay: 0s; }
.candle-btn[data-candle="2"] .flicker-flame { animation-delay: 0.07s; }
.candle-btn[data-candle="3"] .flicker-flame { animation-delay: 0.14s; }
.candle-btn[data-candle="4"] .flicker-flame { animation-delay: 0.21s; }
.candle-btn[data-candle="5"] .flicker-flame { animation-delay: 0.1s; }

@keyframes flameFlicker {
  0%, 100% {
    transform: scale(1) rotate(0deg);
    filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.55)) drop-shadow(0 0 12px rgba(245, 158, 11, 0.35));
  }
  25% {
    transform: scale(1.08, 0.95) rotate(-2deg);
    filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.7)) drop-shadow(0 0 16px rgba(251, 191, 36, 0.4));
  }
  50% {
    transform: scale(0.94, 1.06) rotate(1.5deg);
    filter: drop-shadow(0 0 5px rgba(251, 191, 36, 0.45)) drop-shadow(0 0 10px rgba(245, 158, 11, 0.3));
  }
  75% {
    transform: scale(1.04, 0.98) rotate(-1deg);
    filter: drop-shadow(0 0 7px rgba(245, 158, 11, 0.65)) drop-shadow(0 0 14px rgba(251, 191, 36, 0.35));
  }
}

.candle-btn.extinguished .candle-flame-svg {
  transform: translateX(-50%) scale(0);
  opacity: 0;
  pointer-events: none;
}

.smoke-container {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 1px;
  pointer-events: none;
}

/* Dense, realistic birthday candle smoke wisps */
.smoke-puff {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 45% 45%, rgba(60, 45, 40, 0.95) 0%, rgba(105, 90, 85, 0.8) 35%, rgba(165, 150, 145, 0.45) 65%, transparent 100%);
  animation: smokeWisp 1.8s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
  pointer-events: none;
  filter: blur(1px);
}

@keyframes smokeWisp {
  0% {
    transform: translate(-50%, 0) scale(0.5);
    opacity: 0.95;
  }
  30% {
    transform: translate(calc(-50% + var(--sx, -8px)), -22px) scale(1.4);
    opacity: 0.85;
  }
  70% {
    transform: translate(calc(-50% + var(--sx2, 12px)), -55px) scale(2.2);
    opacity: 0.5;
  }
  100% {
    transform: translate(calc(-50% + var(--sx2, 16px)), -85px) scale(3.0);
    opacity: 0;
    filter: blur(5px);
  }
}

/* ============================================================
   CAKE TOPPER NAME CARD & SCRATCH-OFF REVEAL
============================================================ */

.cake-topper-wrap {
  position: absolute;
  top: 2%;
  left: 9%;
  width: clamp(140px, 35%, 175px);
  aspect-ratio: 340 / 500;
  z-index: 12;
  pointer-events: none;
  filter: drop-shadow(0 8px 18px rgba(50, 18, 12, 0.22));
  transition: transform 0.3s ease;
}

.topper-rotator {
  position: relative;
  width: 100%;
  height: 100%;
  transform: rotate(-10deg);
  transform-origin: 50% 88%;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.topper-rotator.wiggle {
  animation: topperWiggle 0.55s ease-in-out;
}

@keyframes topperWiggle {
  0%, 100% { transform: rotate(-10deg) scale(1); }
  25% { transform: rotate(-16deg) scale(1.06); }
  50% { transform: rotate(-4deg) scale(1.06); }
  75% { transform: rotate(-13deg) scale(1.03); }
}

.topper-svg {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

/* Scratch-off Canvas precisely covers inner photo well: (68/340, 46/500, 204/340, 100/500) */
.topper-scratch-canvas {
  position: absolute;
  left: 20%;
  top: 9.2%;
  width: 60%;
  height: 20%;
  border-radius: 6px;
  cursor: grab;
  touch-action: none;
  pointer-events: auto;
  z-index: 5;
  box-shadow: inset 0 0 5px rgba(220, 120, 130, 0.3), 0 2px 6px rgba(60, 15, 20, 0.15);
  transition: opacity 0.45s ease, transform 0.45s ease, filter 0.45s ease;
}

.topper-scratch-canvas:active {
  cursor: grabbing;
}

.topper-scratch-canvas.fade-out {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: scale(1.04);
  filter: blur(3px);
  visibility: hidden;
}

.topper-scratch-hint {
  position: absolute;
  left: 20%;
  top: 9.2%;
  width: 60%;
  height: 20%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 6;
  font-family: 'Caveat', cursive;
  font-size: clamp(0.82rem, 2.3vw, 1.1rem);
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(120, 25, 45, 0.85), 0 0 10px rgba(255, 230, 240, 0.8);
  animation: topperHintPulse 2s ease-in-out infinite;
  transition: opacity 0.25s ease;
  user-select: none;
  -webkit-user-select: none;
}

.topper-scratch-hint.hidden {
  opacity: 0 !important;
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

@keyframes topperHintPulse {
  0%, 100% { transform: scale(1); opacity: 0.95; }
  50% { transform: scale(1.07); opacity: 1; text-shadow: 0 0 14px rgba(255, 220, 235, 1); }
}

.topper-sparkle {
  position: absolute;
  pointer-events: none;
  z-index: 25;
  font-size: 1.1rem;
  animation: topperSparkleFly 1.25s ease-out forwards;
}

@keyframes topperSparkleFly {
  0% {
    transform: translate(0, 0) scale(0.2) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty)) scale(1.3) rotate(var(--rot, 45deg));
    opacity: 0;
  }
}

@media (max-width: 640px) {
  .cake-topper-wrap {
    top: 2%;
    left: 8%;
    width: clamp(130px, 36%, 160px);
  }
}

/* Status Badge */
.cake-status-badge {
  margin-top: 1rem;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(220, 160, 130, 0.35);
  border-radius: 30px;
  padding: 0.4rem 1.2rem;
  font-family: "Caveat", cursive;
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  font-weight: 600;
  color: #7a3e2b;
  box-shadow: 0 4px 16px rgba(150, 70, 40, 0.08);
  transition: all 0.35s ease;
  text-align: center;
}

.cake-status-badge.all-cleared {
  background: linear-gradient(135deg, rgba(255, 244, 246, 0.96), rgba(255, 228, 236, 0.96));
  border-color: #e27d8d;
  color: #9c1c38;
  transform: scale(1.04);
  box-shadow: 0 8px 28px rgba(220, 70, 100, 0.22);
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1.4rem;
  animation: badgeCelebrationPulse 2.8s ease-in-out infinite;
}

@keyframes badgeCelebrationPulse {
  0%, 100% { box-shadow: 0 8px 28px rgba(220, 70, 100, 0.22); }
  50% { box-shadow: 0 10px 34px rgba(220, 70, 100, 0.38), 0 0 18px rgba(245, 158, 11, 0.25); }
}

.hero .flourish {
  display: flex;
  gap: 1.2rem;
  justify-content: center;
  animation: fade-up 1s 1.2s ease-out both;
  opacity: 0.35;
}
.hero .flourish span { font-family: serif; }
.hero .flourish .sm { font-size: 0.7rem; color: #800000; }
.hero .flourish .heart { font-size: 1rem; color: #a03040; }

.smile-section {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.5rem 25vh;
  position: relative;
  z-index: 2;
}
.smile-card {
  position: relative;
  max-width: 540px;
  width: 100%;
  background: linear-gradient(145deg, #fffdf8 0%, #fef9f0 50%, #fdf5e8 100%);
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1.5rem, 4vw, 3rem);
  border-radius: 16px;
  box-shadow: 0 18px 45px rgba(120, 40, 20, 0.12), 0 5px 15px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  font-family: "Caveat", cursive;
  font-size: clamp(1.5rem, 3.8vw, 2.2rem);
  font-weight: 600;
  line-height: 1.7;
  opacity: 0;
  transform: translateY(20px) scale(0.97);
  transition: opacity 0.8s ease, transform 0.8s ease;
  background-image: repeating-linear-gradient(transparent, transparent 30px, rgba(180, 130, 80, 0.04) 31px);
}
.smile-card.in {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.smile-card .deco { position: absolute; opacity: 0.6; }
.smile-card .deco.d1 { top: -14px; left: 26px; font-size: 1.3rem; color: #e8737a; transform: rotate(-15deg); }
.smile-card .deco.d2 { top: 10px; right: 22px; font-size: 0.9rem; color: #7cb87c; opacity: 0.5; transform: rotate(20deg); }
.smile-card .deco.d3 { bottom: -12px; right: 32px; font-size: 1.1rem; color: #d4626a; opacity: 0.6; transform: rotate(12deg); }
.smile-card .deco.d4 { bottom: 14px; left: 20px; font-size: 0.7rem; color: #c4956a; opacity: 0.4; }
.smile-card p { margin: 0; text-align: center; color: #3a1a1a; }
.smile-card .hl-smile { background: linear-gradient(180deg, transparent 50%, rgba(248, 140, 165, 0.5) 50%); padding: 0 4px; border-radius: 3px; color: #c43850; }
.smile-card .hl-peace { background: linear-gradient(180deg, transparent 50%, rgba(120, 195, 135, 0.5) 50%); padding: 0 4px; border-radius: 3px; color: #2a7540; }
.smile-card .hl-love { background: linear-gradient(180deg, transparent 50%, rgba(235, 120, 110, 0.5) 50%); padding: 0 4px; border-radius: 3px; color: #b02828; }
.smile-card .hl-home { background: linear-gradient(180deg, transparent 50%, rgba(225, 185, 95, 0.5) 50%); padding: 0 4px; border-radius: 3px; color: #8a6018; }

/* ============================================================
   PULL STRING INTERACTION
============================================================ */

.pull-string-zone {
  position: relative;
  height: 100vh;
  min-height: 100vh;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0;
  margin: 0;
  z-index: 5;
  user-select: none;
  -webkit-user-select: none;
  background: transparent;
  overflow: hidden;
}

/* Ambient glow orbs - softly blended */
.pull-bg-glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  filter: blur(60px);
}
.pull-bg-glow.glow-1 {
  width: min(380px, 80vw);
  height: min(380px, 80vw);
  top: 10%;
  left: 6%;
  background: radial-gradient(circle, rgba(235, 140, 155, 0.08) 0%, transparent 70%);
}
.pull-bg-glow.glow-2 {
  width: min(420px, 85vw);
  height: min(420px, 85vw);
  bottom: 8%;
  right: 6%;
  background: radial-gradient(circle, rgba(220, 155, 105, 0.09) 0%, transparent 70%);
}

/* Scattered floating decorations */
.pull-decorations {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.deco-item {
  position: absolute;
  left: var(--l);
  top: var(--t);
  font-size: calc(1.15rem * var(--s));
  color: #c9796e;
  opacity: 0.35;
  animation: decoFloat 4.5s ease-in-out infinite alternate;
  animation-delay: var(--d);
}

@keyframes decoFloat {
  0% { transform: translateY(0) rotate(-6deg); opacity: 0.25; }
  50% { opacity: 0.5; }
  100% { transform: translateY(-16px) rotate(8deg); opacity: 0.35; }
}

.pull-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 440px;
  height: 100%;
  z-index: 3;
  opacity: 0;
  transform: translateY(-24px);
  pointer-events: none;
  transition: opacity 0.85s cubic-bezier(0.25, 1, 0.5, 1), transform 0.85s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pull-stage.in {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Flush top ceiling anchor peg */
.pull-anchor {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pull-peg {
  width: 32px;
  height: 14px;
  border-radius: 0 0 10px 10px;
  background: linear-gradient(135deg, #dfad7b 0%, #b87b47 50%, #7d4d25 100%);
  box-shadow: 0 4px 10px rgba(90, 45, 20, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.pull-ring {
  width: 13px;
  height: 13px;
  border: 2.6px solid #a86b3e;
  border-radius: 50%;
  margin-top: -3px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Dynamic cord SVG - centered string canvas with room for wave sway */
.pull-string-svg {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 160px;
  height: 700px;
  pointer-events: none;
  overflow: visible;
  z-index: 4;
}

#pull-string-path {
  fill: none;
  stroke: #7f4c2c;
  stroke-width: 3.2px;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(100, 45, 20, 0.22));
  transition: stroke 0.2s ease, stroke-width 0.2s ease;
}

.pull-stage.ready #pull-string-path {
  stroke: #d04d60;
  stroke-width: 4px;
  filter: drop-shadow(0 0 6px rgba(220, 70, 90, 0.5));
}

/* Mobile responsive sizing: make rope, peg, and lock handle bigger & clearer */
@media (max-width: 640px) {
  #pull-string-path {
    stroke-width: 4.6px;
  }
  .pull-stage.ready #pull-string-path {
    stroke-width: 5.5px;
  }
  .pull-peg {
    width: 42px;
    height: 16px;
  }
  .pull-ring {
    width: 16px;
    height: 16px;
    border-width: 3.2px;
  }
  .pull-handle {
    top: 170px;
    width: 114px;
    height: 114px;
    margin-left: -57px;
    transform-origin: 50% 32px;
  }
  .pull-lock-img {
    width: 104px;
    height: 104px;
    aspect-ratio: 1 / 1;
    object-fit: contain;
  }
  .pull-handle-aura {
    width: 98px;
    height: 98px;
  }
  .pull-caption-wrap {
    top: 295px;
  }
  .pull-hint {
    font-size: clamp(1.4rem, 4.5vw, 1.75rem);
  }
  .pull-trail-zone {
    top: 385px;
  }
}

/* Interactive pull handle with locked.png */
.pull-handle {
  position: absolute;
  top: 175px;
  left: 50%;
  margin-left: -48px;
  width: 96px;
  height: 96px;
  z-index: 8;
  cursor: grab;
  touch-action: none;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  animation: handleBobSway 3.8s ease-in-out infinite;
  transform-origin: 50% 28px;
}

.pull-handle:active,
.pull-handle.dragging {
  cursor: grabbing;
  animation: none !important;
}

.pull-handle-lock-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  flex-shrink: 0;
}

.pull-lock-img {
  width: 86px;
  height: 86px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
  transform-origin: 50% 60%;
  filter: drop-shadow(0 8px 20px rgba(120, 50, 40, 0.25)) drop-shadow(0 2px 6px rgba(255, 255, 255, 0.5));
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s ease;
}

.pull-handle.dancing-miss .pull-lock-img,
.pull-handle.dancing-miss .pull-handle-aura {
  transition: none !important;
}

.pull-handle.dancing-miss .pull-lock-img {
  filter: drop-shadow(0 10px 24px rgba(220, 60, 80, 0.45)) drop-shadow(0 0 16px rgba(255, 180, 190, 0.75));
}

.pull-handle:hover .pull-lock-img {
  transform: scale(1.08);
  filter: drop-shadow(0 10px 24px rgba(150, 50, 50, 0.35)) drop-shadow(0 0 12px rgba(255, 200, 180, 0.8));
}

.pull-handle.ready .pull-lock-img {
  transform: scale(1.15) rotate(-3deg);
  filter: drop-shadow(0 12px 28px rgba(220, 40, 60, 0.5)) drop-shadow(0 0 20px rgba(255, 120, 150, 0.8));
}

.pull-handle-aura {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 200, 180, 0.4) 0%, transparent 70%);
  filter: blur(8px);
  pointer-events: none;
  opacity: 0.5;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.pull-handle.ready .pull-handle-aura {
  background: radial-gradient(circle, rgba(255, 120, 140, 0.6) 0%, transparent 70%);
  transform: scale(1.3);
  opacity: 0.85;
}

/* Caption and animated hint arrow */
.pull-caption-wrap {
  position: absolute;
  top: 275px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 6;
}

.pull-hint {
  font-family: "Caveat", cursive;
  font-size: clamp(1.25rem, 3.2vw, 1.6rem);
  font-weight: 600;
  color: #6d3f2a;
  letter-spacing: 0.02em;
  margin: 0;
  transition: color 0.2s ease, transform 0.2s ease;
  text-shadow: 0 1px 4px rgba(255, 255, 255, 0.8);
}

.pull-stage.ready .pull-hint {
  color: #b5223a;
  transform: scale(1.1);
  text-shadow: 0 0 12px rgba(255, 140, 160, 0.6);
}

.pull-arrow-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  animation: arrowBounce 1.8s ease-in-out infinite;
}

.arrow-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #a85848;
  opacity: 0.6;
}

.arrow-head {
  font-size: 1.25rem;
  color: #a85848;
  line-height: 1;
  font-weight: bold;
}

.pull-stage.ready .pull-arrow-hint {
  opacity: 0;
}

/* Faint dotted trail leading down to memory teaser */
.pull-trail-zone {
  position: absolute;
  top: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 340px;
  pointer-events: none;
  z-index: 5;
}

.pull-dotted-trail {
  width: 2px;
  height: 80px;
  background: repeating-linear-gradient(to bottom, #d29477 0, #d29477 4px, transparent 4px, transparent 10px);
  opacity: 0.55;
  margin-bottom: 14px;
}

.pull-teaser-card {
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(220, 160, 130, 0.35);
  border-radius: 30px;
  padding: 0.55rem 1.3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 8px 24px rgba(160, 90, 60, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.pull-teaser-card .teaser-icon {
  font-size: 0.95rem;
}

.pull-teaser-card .teaser-text {
  font-family: "Caveat", cursive;
  font-size: clamp(1.05rem, 2.6vw, 1.28rem);
  font-weight: 500;
  color: #7b4532;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Animations */
@keyframes handleBobSway {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-2.5deg);
  }
  75% {
    transform: rotate(2.5deg);
  }
}

@keyframes arrowBounce {
  0%, 100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  50% {
    transform: translateY(8px);
    opacity: 1;
  }
}

/* Snap release effect */
.pull-handle.snapping {
  transition: transform 0.22s cubic-bezier(0.18, 0.89, 0.32, 1.28) !important;
}

.pull-stage.snapped #pull-string-path {
  animation: cordSnap 0.35s ease-out forwards;
}

@keyframes cordSnap {
  0% { opacity: 1; }
  50% { stroke-width: 4.5; opacity: 0.8; stroke: #e06075; }
  100% { opacity: 0; stroke-width: 1; }
}

/* Page 2 smooth exit */
#page2.pull-transitioning {
  opacity: 0;
  transform: translateY(-40px) scale(0.98);
  transition: opacity 0.65s cubic-bezier(0.4, 0, 0.2, 1), transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.photo-grid-section {
  padding: 1.5rem 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-up 0.8s ease-out both;
}
.photo-grid {
  columns: 2;
  column-gap: 18px;
  width: 100%;
  max-width: 560px;
}
@media (min-width: 640px) {
  .photo-grid { columns: 3; column-gap: 22px; max-width: 800px; }
}
@media (min-width: 1024px) {
  .photo-grid { columns: 4; column-gap: 28px; max-width: 1200px; }
}
.photo-card {
  break-inside: avoid;
  margin-bottom: 26px;
  background: #fff;
  padding: 10px 10px 30px;
  box-shadow: 0 12px 28px rgba(80, 40, 20, 0.22);
  opacity: 0;
  transform: rotate(var(--rot)) translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  width: 100%;
}
.photo-card.size-lg { width: 100%; }
.photo-card.size-md { width: 87%; }
.photo-card.size-sm { width: 74%; }
.photo-card:nth-child(odd) { margin-left: 0; margin-right: auto; }
.photo-card:nth-child(even) { margin-left: auto; margin-right: 0; }
.photo-card.in {
  opacity: 1;
  transform: rotate(var(--rot)) translateY(0);
}
.photo-card:hover { transform: rotate(0deg) scale(1.04); z-index: 5; position: relative; }
.photo-card img {
  width: 100%;
  height: auto;
  display: block;
  background: #f3e6ea;
}

.letter-section {
  padding: 0.5rem 1rem 1.5rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  animation: fade-up 0.8s 0.1s ease-out both;
}
.letter-card {
  max-width: 720px;
  width: 100%;
  background: linear-gradient(#fffaf3, #fdf1e1), repeating-linear-gradient(transparent, transparent 36px, rgba(128, 0, 0, 0.07) 37px);
  background-blend-mode: multiply;
  padding: clamp(1.5rem, 4vw, 3rem);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  font-family: "Caveat", cursive;
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  font-weight: 500;
  color: #3a1a1a;
  line-height: 1.75;
}
.letter-card .word {
  opacity: 0;
  transition: opacity 0.3s ease;
  display: inline-block;
  margin-right: 0.32em;
}
.letter-card .word.in { opacity: 1; }

.heart-divider {
  padding: 1rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.heart-divider span {
  font-family: "Dancing Script", cursive;
  font-size: clamp(2rem, 4vw, 3rem);
  color: #800000;
  opacity: 0.4;
}

.footer-section {
  padding: 6vh 1rem 8vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.footer-section h2 {
  font-family: "Dancing Script", cursive;
  font-size: clamp(3rem, 9vw, 6.5rem);
  font-weight: 700;
  color: #800000;
  margin: 0;
  line-height: 1.15;
  text-shadow: 0 2px 16px rgba(255, 255, 255, 0.5), 0 0 40px rgba(128, 0, 0, 0.08);
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1.2s ease, transform 1.2s ease;
}
.footer-section h2.in { opacity: 1; transform: translateY(0); }
.footer-section p {
  font-family: "Caveat", cursive;
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 500;
  color: #6b1f3a;
  margin-top: 0.6rem;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1.4s ease, transform 1.4s ease;
}
.footer-section p.in { opacity: 1; transform: translateY(0); }

/* ============================================================
   CELEBRATION CONFETTI & RAIN EFFECT (from lavwedsazar.com)
============================================================ */

.celebration-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 85;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.celebration-overlay.active {
  opacity: 1;
  visibility: visible;
}

.star-rain-container,
.confetti-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

/* 1. Falling Star Rain (inspired by lavwedsazar.com i1) */
.star-rain-drop {
  position: absolute;
  top: -35px;
  display: block;
  pointer-events: none;
  will-change: transform, opacity;
  animation: starRainFall var(--duration, 9s) linear var(--delay, 0s) infinite;
  filter: drop-shadow(0 0 6px var(--glow, rgba(232, 130, 78, 0.65)));
}

.star-rain-drop svg {
  display: block;
  width: 100%;
  height: 100%;
  animation: starTwinkle 2.4s ease-in-out infinite alternate;
}

@keyframes starRainFall {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 0;
  }
  12% {
    opacity: var(--max-opacity, 0.7);
  }
  85% {
    opacity: var(--max-opacity, 0.7);
  }
  100% {
    transform: translateY(calc(100vh + 60px)) translateX(var(--drift, 45px)) rotate(var(--rot, 180deg));
    opacity: 0;
  }
}

@keyframes starTwinkle {
  0% {
    transform: scale(0.85);
    filter: brightness(0.92);
  }
  100% {
    transform: scale(1.18);
    filter: brightness(1.3);
  }
}

/* 2. Celebration Confetti Rain (inspired by lavwedsazar.com a1) */
.celebration-confetti-piece {
  position: absolute;
  top: -24px;
  pointer-events: none;
  will-change: transform, opacity;
  animation: confettiFall var(--dur, 3.4s) cubic-bezier(0.25, 0.1, 0.25, 1) var(--delay, 0s) forwards;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

@keyframes confettiFall {
  0% {
    transform: translate3d(0, -10vh, 0) rotate(var(--rot0, 0deg)) rotateX(0deg) rotateY(0deg);
    opacity: 1;
  }
  15% {
    opacity: 1;
  }
  75% {
    opacity: 0.95;
  }
  100% {
    transform: translate3d(var(--drift, 60px), 112vh, 0) rotate(calc(var(--rot0, 0deg) + var(--spin, 480deg))) rotateX(540deg) rotateY(360deg);
    opacity: 0;
  }
}

/* 3. Celebration Upward Burst Cannons */
.cannon-confetti-piece {
  position: absolute;
  pointer-events: none;
  will-change: transform, opacity;
  animation: cannonArc var(--dur, 2.8s) cubic-bezier(0.12, 0.8, 0.32, 1) var(--delay, 0s) forwards;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

@keyframes cannonArc {
  0% {
    transform: translate3d(var(--x0), var(--y0), 0) scale(0.3) rotate(0deg);
    opacity: 1;
  }
  32% {
    transform: translate3d(calc(var(--x0) + var(--dx) * 0.75), calc(var(--y0) - var(--dy-peak)), 0) scale(1.1) rotate(calc(var(--spin) * 0.45));
    opacity: 1;
  }
  100% {
    transform: translate3d(calc(var(--x0) + var(--dx)), calc(var(--y0) + 110vh), 0) scale(0.85) rotate(var(--spin));
    opacity: 0;
  }
}

/* 4. Candle Extinguish Mini-Spark Pop */
.candle-spark-pop {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  animation: candleSparkPop 0.85s ease-out forwards;
}

@keyframes candleSparkPop {
  0% {
    transform: translate(-50%, -50%) scale(0.4);
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.4);
    opacity: 0;
  }
}

/* 5. Replay Celebration Button in Status Badge */
.celebration-replay-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.4rem;
  padding: 0.22rem 0.75rem;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  color: #9c1c38;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(226, 125, 141, 0.45);
  border-radius: 20px;
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.25s ease;
  box-shadow: 0 2px 6px rgba(200, 50, 80, 0.12);
  vertical-align: middle;
}

.celebration-replay-btn:hover {
  background: #ffffff;
  color: #74112c;
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 4px 12px rgba(200, 50, 80, 0.24);
}

.celebration-replay-btn:active {
  transform: translateY(0) scale(0.97);
}

@media (prefers-reduced-motion: reduce) {
  .bloom-flower, .gift-box-btn, .lock-btn, .wreath, .wreath-item img, .loading-text, .star-rain-drop, .celebration-confetti-piece, .cannon-confetti-piece {
    animation-duration: 0.001ms !important;
  }
}