/* =========================================================
   Tarin's 25th Birthday — Design System
   ========================================================= */
:root {
  --blush: #ffb6c8;
  --hot: #ff4f8b;
  --rose: #ff7aa8;
  --lav: #c9a7ff;
  --peach: #ffd3b6;
  --cream: #fff5f8;
  --gold: #ffd166;
  --plum: #5a1e4a;
  --plum-2: #8a3a72;
  --white: #ffffff;
  --glass: rgba(255, 255, 255, 0.55);
  --glass-b: rgba(255, 255, 255, 0.75);
  --shadow: 0 10px 30px rgba(255, 79, 139, 0.18), 0 2px 8px rgba(90, 30, 74, 0.08);
  --shadow-lg: 0 20px 60px rgba(255, 79, 139, 0.28);
  --radius: 22px;
  --f-script: "Great Vibes", cursive;
  --f-body: "Poppins", "Hind Siliguri", system-ui, sans-serif;
  --f-hand: "Caveat", "Hind Siliguri", cursive;
  --f-bn: "Hind Siliguri", "Poppins", sans-serif;
  --f-bn-display: "Galada", "Hind Siliguri", cursive;
}

*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--f-body);
  color: var(--plum);
  min-height: 100dvh;
  overflow-x: hidden;
  background: linear-gradient(-45deg, #ffe1ec, #f3e3ff, #ffe9dc, #ffd6e7);
  background-size: 400% 400%;
  animation: bgShift 18s ease infinite;
  -webkit-tap-highlight-color: transparent;
}
body.is-locked { overflow: hidden; }

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

img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
.bn { font-family: var(--f-bn); }
.script { font-family: var(--f-script); font-weight: 400; }

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

/* ---------- Generic overlay ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  padding: 24px;
  padding-top: max(24px, env(safe-area-inset-top));
  background: radial-gradient(circle at 30% 20%, #ffd1e3 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, #e5d2ff 0%, transparent 50%),
              linear-gradient(160deg, #ffe4ef, #fbe3ff);
  transition: opacity .8s ease, transform .8s ease;
}
.overlay[hidden] { display: none; }
.overlay.fade-out { opacity: 0; transform: scale(1.08); pointer-events: none; }

/* ---------- Lock ---------- */
.lock-inner { text-align: center; max-width: 520px; }
.lock-emoji { font-size: 64px; animation: wobble 2.4s ease-in-out infinite; }
.lock-sub { font-size: 22px; margin-top: 8px; color: var(--plum-2); }
.lock-title {
  font-family: var(--f-script); font-weight: 400;
  font-size: clamp(36px, 10vw, 60px); line-height: 1.1; margin: 8px 0 24px;
  background: linear-gradient(90deg, var(--hot), var(--lav), var(--hot));
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmerMove 4s linear infinite;
}
.flip-clock { display: flex; justify-content: center; align-items: flex-start; gap: 8px; }
.fc-unit {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.fc-unit span {
  font-weight: 800; font-size: clamp(36px, 12vw, 64px);
  min-width: 1.7em; padding: 12px 8px; border-radius: 18px;
  background: linear-gradient(180deg, #fff 0%, #ffe6ef 50%, #ffd9e7 50%, #fff 100%);
  box-shadow: var(--shadow); color: var(--hot);
  font-variant-numeric: tabular-nums;
}
.fc-unit small { font-family: var(--f-bn); font-size: 13px; color: var(--plum-2); }
.fc-sep { font-size: 40px; font-weight: 800; color: var(--rose); padding-top: 14px; animation: blink 1s steps(2) infinite; }
.lock-note { margin-top: 26px; font-size: 16px; color: var(--plum-2); }

@keyframes blink { 50% { opacity: .2; } }
@keyframes wobble { 0%,100% { transform: rotate(-10deg); } 50% { transform: rotate(10deg); } }

/* ---------- Gift ---------- */
.gift-inner { text-align: center; }
.gift-hello { font-size: clamp(22px, 6vw, 30px); font-weight: 600; margin-bottom: 18px; color: var(--plum); }
.gift-btn {
  position: relative; width: min(72vw, 300px); aspect-ratio: 1;
  border-radius: 50%; animation: giftBounce 1.6s ease-in-out infinite;
}
.gift-img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
  -webkit-mask-image: radial-gradient(circle, #000 55%, transparent 71%);
  mask-image: radial-gradient(circle, #000 55%, transparent 71%);
  position: relative; z-index: 1;
}
.gift-glow {
  position: absolute; inset: -10%; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.95), rgba(255,182,200,.4) 50%, transparent 70%);
  animation: pulse 2s ease-in-out infinite;
}
.gift-tap { margin-top: 18px; font-weight: 600; letter-spacing: .5px; color: var(--hot); animation: pulse 1.4s ease-in-out infinite; }
.gift-btn.opening { animation: giftOpen .9s cubic-bezier(.5,-0.6,.4,1.6) forwards; }

@keyframes giftBounce {
  0%,100% { transform: translateY(0) rotate(-3deg) scale(1); }
  25% { transform: translateY(-14px) rotate(3deg) scale(1.03); }
  50% { transform: translateY(0) rotate(-2deg) scale(.98, 1.02); }
  75% { transform: translateY(-6px) rotate(2deg); }
}
@keyframes giftOpen {
  0% { transform: scale(1) rotate(0); }
  30% { transform: scale(.85) rotate(-12deg); }
  55% { transform: scale(1.15) rotate(10deg); }
  100% { transform: scale(2.6) rotate(0); opacity: 0; filter: blur(6px); }
}
@keyframes pulse { 0%,100% { opacity: .75; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }

/* ---------- Music button ---------- */
.music-btn {
  position: fixed; z-index: 40;
  right: 16px; bottom: max(16px, env(safe-area-inset-bottom));
  width: 54px; height: 54px; border-radius: 50%;
  background: linear-gradient(135deg, var(--hot), var(--lav));
  box-shadow: var(--shadow-lg);
  display: grid; place-items: center;
}
.music-btn[hidden] { display: none; }
.eq { display: flex; gap: 3px; align-items: flex-end; height: 20px; }
.eq i { width: 4px; background: #fff; border-radius: 2px; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: .2s; } .eq i:nth-child(3) { animation-delay: .4s; } .eq i:nth-child(4) { animation-delay: .1s; }
.music-btn.paused .eq i { animation: none; height: 4px; }
@keyframes eq { 0%,100% { height: 5px; } 50% { height: 20px; } }

/* ---------- Main / sections ---------- */
main { position: relative; z-index: 1; opacity: 0; transition: opacity 1s ease; }
main.show { opacity: 1; }

.section {
  position: relative;
  min-height: auto;
  padding: 70px 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  max-width: 1100px; margin: 0 auto;
}
.sec-title { text-align: center; line-height: 1.15; margin-bottom: 14px; }
.sec-title .script {
  font-size: clamp(48px, 13vw, 84px);
  background: linear-gradient(90deg, var(--hot), #b06cff, var(--hot));
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmerMove 5s linear infinite;
  filter: drop-shadow(0 4px 12px rgba(255,79,139,.25));
}
.sec-title .bn { font-size: clamp(17px, 4.6vw, 24px); font-weight: 600; color: var(--plum-2); }
.sec-sub { text-align: center; color: var(--plum-2); margin: 6px 0 22px; font-size: 15px; }

.glass {
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--glass-b);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(40px) scale(.97); transition: opacity .9s ease, transform .9s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Buttons ---------- */
.cta-btn {
  padding: 14px 26px; border-radius: 999px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--hot), #ff86b4 50%, var(--lav));
  background-size: 200% 200%;
  box-shadow: 0 10px 24px rgba(255,79,139,.4);
  transition: transform .2s ease, box-shadow .2s ease;
  animation: shimmerMove 4s linear infinite;
  font-family: var(--f-bn);
}
.cta-btn:active { transform: scale(.95); }
.cta-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(255,79,139,.5); }
.cta-btn.sm { padding: 10px 20px; font-size: 15px; }
.ghost-btn {
  padding: 12px 22px; border-radius: 999px; font-weight: 600;
  border: 2px dashed var(--rose); color: var(--hot); font-family: var(--f-bn);
  transition: background .2s;
}
.ghost-btn:hover { background: rgba(255,255,255,.6); }
.ghost-btn.light { color: #fff; border-color: rgba(255,255,255,.6); margin-top: 22px; }
.pill-btn {
  width: 52px; height: 52px; border-radius: 50%; font-size: 22px; font-weight: 700;
  background: #fff; color: var(--hot); box-shadow: var(--shadow);
  transition: transform .2s;
}
.pill-btn:active { transform: scale(.9); }

@keyframes shimmerMove { to { background-position: 200% center; } }

/* ---------- HERO ---------- */
.hero { text-align: center; overflow: hidden; max-width: none; min-height: 100dvh; }
.hero-content { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; }
.crown { font-size: 48px; animation: floaty 3s ease-in-out infinite; filter: drop-shadow(0 6px 10px rgba(255,209,102,.6)); }
.hero-pre { font-family: var(--f-script); font-size: clamp(40px, 11vw, 70px); color: var(--hot); line-height: 1; }
.hero-title { display: flex; flex-direction: column; align-items: center; line-height: .95; }
.big-25 {
  font-weight: 800; font-size: clamp(110px, 38vw, 220px); letter-spacing: -6px;
  line-height: .9;
}
.big-25 sup { font-size: .25em; letter-spacing: 0; vertical-align: top; position: relative; top: .5em; }
.shimmer {
  background: linear-gradient(110deg, #ff4f8b 0%, #ffb347 20%, #ffd166 30%, #fff 38%, #ffd166 46%, #ff7aa8 60%, #c9a7ff 80%, #ff4f8b 100%);
  background-size: 250% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmerMove 3.5s linear infinite;
  filter: drop-shadow(0 8px 20px rgba(255,79,139,.35));
}
.hero-bday { font-weight: 700; font-size: clamp(34px, 10vw, 64px); letter-spacing: 6px; text-transform: uppercase; color: var(--plum); }
.split-text .ch { display: inline-block; opacity: 0; transform: translateY(40px) rotate(-20deg); animation: chIn .7s cubic-bezier(.2,1.4,.4,1) forwards; }
@keyframes chIn { to { opacity: 1; transform: none; } }
.hero-name {
  font-family: var(--f-script); font-size: clamp(76px, 24vw, 150px); line-height: 1.1;
  color: var(--hot); cursor: pointer; user-select: none;
  text-shadow: 0 4px 0 #fff, 0 10px 30px rgba(255,79,139,.4);
  animation: heartbeat 2.4s ease-in-out infinite;
}
@keyframes heartbeat { 0%,100% { transform: scale(1); } 10% { transform: scale(1.06); } 20% { transform: scale(1); } 30% { transform: scale(1.04); } }
.hero-bn { font-family: var(--f-bn-display); font-size: clamp(24px, 7vw, 38px); color: var(--plum-2); margin-top: 4px; }
.hero-img-wrap {
  position: relative;
  width: min(78vw, 360px); aspect-ratio: 1; margin: 24px auto 10px;
  border-radius: 50%; padding: 8px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: grid; place-items: center;
}
.hero-img-wrap::before {
  content: ""; position: absolute; inset: -60%;
  background: conic-gradient(from 0deg, var(--hot), var(--gold), var(--lav), var(--blush), var(--hot));
  animation: spin 7s linear infinite;
  z-index: 1;
}
.hero-img {
  position: relative; z-index: 2;
  width: 100%; height: 100%; object-fit: cover; object-position: center 20%;
  border-radius: 50%; border: 6px solid #fff;
  box-shadow: 0 4px 15px rgba(90, 30, 74, 0.15);
}
@keyframes spin { to { transform: rotate(360deg); } }
.hero-hint { margin-top: 18px; color: var(--plum-2); font-family: var(--f-bn); font-size: 14px; }
.bounce { display: inline-block; animation: floaty 1.2s ease-in-out infinite; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* Balloons */
.balloons { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.balloon {
  position: absolute; bottom: -160px; width: 60px; height: 76px; border-radius: 50% 50% 48% 48% / 55% 55% 45% 45%;
  pointer-events: auto; cursor: pointer;
  animation: rise linear forwards;
  box-shadow: inset -8px -10px 0 rgba(0,0,0,.08), inset 8px 8px 14px rgba(255,255,255,.55);
}
.balloon::before { /* knot */
  content: ""; position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%);
  border: 6px solid transparent; border-bottom-color: inherit; border-bottom-width: 9px;
  filter: brightness(.9);
}
.balloon::after { /* string */
  content: ""; position: absolute; left: 50%; top: 100%; width: 1.5px; height: 70px;
  background: rgba(90,30,74,.35); transform-origin: top; animation: sway 2s ease-in-out infinite;
}
.balloon.pop { animation: pop .25s ease-out forwards !important; }
@keyframes rise {
  0% { transform: translate(0, 0) rotate(-4deg); }
  50% { transform: translate(var(--drift), -60vh) rotate(4deg); }
  100% { transform: translate(calc(var(--drift) * -1), -125vh) rotate(-4deg); }
}
@keyframes sway { 0%,100% { transform: rotate(6deg); } 50% { transform: rotate(-6deg); } }
@keyframes pop { to { transform: scale(1.8); opacity: 0; } }

/* ---------- COUNTER ---------- */
.counter-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: 100%; max-width: 640px; margin: 16px 0 26px; }
.cbox { padding: 18px 6px; text-align: center; }
.cbox b {
  display: block; font-size: clamp(26px, 8vw, 46px); font-weight: 800; line-height: 1.1;
  background: linear-gradient(135deg, var(--hot), #a35cff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-variant-numeric: tabular-nums;
}
.cbox span { font-family: var(--f-bn); font-size: 13px; color: var(--plum-2); }
.stat-cards { display: grid; gap: 14px; width: 100%; max-width: 640px; }
.stat { display: flex; gap: 14px; align-items: center; padding: 16px 18px; }
.stat-ic { font-size: 32px; flex-shrink: 0; animation: floaty 3s ease-in-out infinite; }
.stat p { font-size: 15px; line-height: 1.6; }
.stat b { color: var(--hot); font-size: 1.1em; }

/* ---------- TIMELINE ---------- */
.timeline { list-style: none; position: relative; width: 100%; max-width: 720px; padding-left: 34px; margin-top: 10px; }
.timeline::before {
  content: ""; position: absolute; left: 14px; top: 0; bottom: 0; width: 4px; border-radius: 4px;
  background: linear-gradient(var(--hot), var(--lav), var(--peach));
}
.tl-item { position: relative; margin-bottom: 26px; }
.tl-dot {
  position: absolute; left: -38px; top: 10px; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; font-size: 20px; background: #fff;
  box-shadow: 0 0 0 4px var(--blush), var(--shadow);
}
.tl-card { padding: 16px 18px 16px 22px; margin-left: 14px; }
.tl-date { font-family: var(--f-bn); font-size: 13px; font-weight: 600; color: #fff; background: linear-gradient(90deg, var(--hot), var(--lav)); padding: 3px 12px; border-radius: 999px; display: inline-block; }
.tl-card h3 { font-family: var(--f-bn); font-size: 19px; margin: 8px 0 4px; color: var(--plum); }
.tl-card p { font-family: var(--f-bn); font-size: 15px; line-height: 1.65; color: var(--plum-2); }
.tl-item.reveal { transform: translateX(-40px); }
.tl-item.reveal.in { transform: none; }

/* ---------- GALLERY ---------- */
.polaroid-stack { position: relative; width: min(80vw, 330px); aspect-ratio: 330 / 410; margin: 6px auto 20px; touch-action: pan-y; }
.polaroid {
  position: absolute; inset: 0; background: #fff; padding: 12px 12px 54px; border-radius: 6px;
  box-shadow: 0 14px 40px rgba(90,30,74,.22);
  transition: transform .45s cubic-bezier(.2,.8,.2,1), opacity .45s;
  user-select: none; -webkit-user-select: none; cursor: grab;
}
.polaroid img { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; pointer-events: none; background: #ffe4ec; }
.polaroid figcaption {
  position: absolute; left: 0; right: 0; bottom: 10px; text-align: center;
  font-family: var(--f-hand); font-size: 22px; color: var(--plum); padding: 0 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.polaroid::before { /* tape */
  content: ""; position: absolute; top: -12px; left: 50%; width: 90px; height: 26px; transform: translateX(-50%) rotate(-3deg);
  background: rgba(255,182,200,.75); box-shadow: 0 2px 4px rgba(0,0,0,.06); z-index: 2;
}
.stack-controls { display: flex; gap: 18px; }

/* ---------- REASONS ---------- */
.reasons-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; width: 100%; max-width: 680px; }
.reason { perspective: 900px; aspect-ratio: 1; }
.reason-inner {
  position: relative; width: 100%; height: 100%;
  transition: transform .7s cubic-bezier(.3,1.4,.5,1); transform-style: preserve-3d;
}
.reason.flipped .reason-inner { transform: rotateY(180deg); }
.reason-face {
  position: absolute; inset: 0; border-radius: 16px; display: grid; place-items: center;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.reason-front {
  background: linear-gradient(145deg, #fff, #ffe1ec); box-shadow: var(--shadow);
  font-size: clamp(22px, 7vw, 34px); flex-direction: column;
}
.reason-front small { position: absolute; bottom: 4px; right: 8px; font-size: 11px; font-weight: 700; color: var(--rose); }
.reason-front .h { animation: heartbeat 2s ease-in-out infinite; animation-delay: var(--d); display: inline-block; }
.reason-back { background: linear-gradient(145deg, var(--hot), #b06cff); color: #fff; transform: rotateY(180deg); font-size: 22px; }
.count-chip { display: inline-block; background: #fff; color: var(--hot); font-weight: 700; padding: 2px 10px; border-radius: 999px; margin-left: 6px; box-shadow: var(--shadow); }
.reason-bonus { margin-top: 22px; padding: 18px 24px; text-align: center; font-size: 18px; animation: popIn .6s cubic-bezier(.2,1.6,.4,1); }
.reason-bonus b { color: var(--hot); font-size: 22px; }

/* reason popup */
.reason-pop {
  position: fixed; left: 50%; top: 50%; z-index: 60; width: min(86vw, 380px);
  transform: translate(-50%, -50%) scale(.6); opacity: 0;
  padding: 26px 22px; text-align: center; border-radius: 26px; color: #fff;
  background: linear-gradient(145deg, var(--hot), #b06cff);
  box-shadow: 0 30px 80px rgba(176,108,255,.45);
  transition: transform .45s cubic-bezier(.2,1.5,.4,1), opacity .3s;
  font-family: var(--f-bn); pointer-events: none;
}
.reason-pop.show { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.reason-pop .num { font-family: var(--f-script); font-size: 46px; line-height: 1; }
.reason-pop p { font-size: 19px; line-height: 1.6; margin-top: 8px; font-weight: 500; }
@keyframes popIn { from { transform: scale(.4); opacity: 0; } }

/* ---------- CAKE ---------- */
.cake-stage { position: relative; width: min(84vw, 380px); margin: 30px auto 10px; }
.cake-img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 50%;
  -webkit-mask-image: radial-gradient(circle, #000 58%, transparent 71%);
  mask-image: radial-gradient(circle, #000 58%, transparent 71%);
}
.candles { position: absolute; left: 50%; top: 2%; transform: translateX(-50%); display: flex; gap: 26px; z-index: 2; }
.candle {
  position: relative; width: 44px; height: 58px; display: grid; place-items: center;
  font-weight: 800; font-size: 46px; color: #fff; line-height: 1;
}
.candle span {
  background: linear-gradient(180deg, #ffd166, #ff9f43);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 2px #fff; filter: drop-shadow(0 3px 4px rgba(255,79,139,.4));
  font-size: 58px;
}
.flame {
  position: absolute; left: 50%; top: -34px; width: 18px; height: 30px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 70%, #fff 0%, #ffe66d 30%, #ff9f1c 60%, rgba(255,79,0,0) 75%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: flicker .15s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 12px #ffcf4d) drop-shadow(0 0 26px #ff9f1c);
  transform-origin: 50% 100%;
}
.flame.out { animation: flameOut .5s forwards; }
@keyframes flicker {
  0% { transform: translateX(-50%) scale(1, 1) rotate(-2deg); }
  100% { transform: translateX(-50%) scale(.92, 1.08) rotate(2deg); }
}
@keyframes flameOut { to { transform: translateX(-50%) scale(0); opacity: 0; } }
.smoke-wrap { position: absolute; left: 50%; top: -6%; transform: translateX(-50%); width: 140px; height: 100px; pointer-events: none; }
.smoke { position: absolute; bottom: 0; width: 14px; height: 14px; border-radius: 50%; background: rgba(160,140,160,.5); filter: blur(4px); animation: smoke 2s ease-out forwards; }
@keyframes smoke { to { transform: translate(var(--sx), -90px) scale(3); opacity: 0; } }
.cake-actions { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 14px; }
.mic-meter-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 14px; }
.mic-meter-wrap[hidden] { display: none; }
.mic-meter { width: 220px; height: 12px; border-radius: 999px; background: rgba(255,255,255,.7); overflow: hidden; box-shadow: inset 0 1px 3px rgba(0,0,0,.1); }
.mic-meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--lav), var(--hot)); transition: width .08s; }
.cake-msg { margin-top: 18px; font-size: clamp(20px, 5.5vw, 26px); font-weight: 700; text-align: center; color: var(--hot); animation: popIn .7s cubic-bezier(.2,1.6,.4,1); }

/* ---------- COUPONS ---------- */
.coupon-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; width: 100%; max-width: 720px; margin-bottom: 10px; }
.coupon {
  position: relative; aspect-ratio: 1 / 1.05; border-radius: 20px; overflow: hidden;
  background: #fff; box-shadow: var(--shadow);
  -webkit-mask: radial-gradient(circle 12px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle 12px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle 12px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle 12px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
}
.coupon-body {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 14px; gap: 4px;
  background: linear-gradient(160deg, #fff 0%, #fff0f6 100%);
  border: 2px dashed var(--blush); border-radius: 20px;
}
.coupon-ic { font-size: 40px; }
.coupon-body h4 { font-size: 16px; font-weight: 700; color: var(--hot); }
.coupon-body p { font-family: var(--f-bn); font-size: 13px; line-height: 1.5; color: var(--plum-2); }
.coupon canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; transition: opacity .6s; border-radius: 20px; }
.coupon.done canvas { opacity: 0; pointer-events: none; }
.coupon.done .coupon-body { animation: popIn .5s ease; }

/* ---------- LETTER ---------- */
.envelope-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 30px; }
.envelope {
  position: relative; width: min(80vw, 320px); aspect-ratio: 1.5; perspective: 800px;
  animation: floaty 3s ease-in-out infinite;
}
.env-back, .env-front, .env-flap, .env-paper { position: absolute; display: block; }
.env-back { inset: 0; background: #ff8fb4; border-radius: 10px; }
.env-paper {
  left: 6%; right: 6%; top: 8%; bottom: 8%; background: #fffaf3; border-radius: 6px;
  display: grid; place-items: center; font-size: 34px; transition: transform .8s .4s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.env-front {
  inset: 0; border-radius: 10px;
  background:
    linear-gradient(to top right, #ffa9c6 49.5%, transparent 50%) left / 50.5% 100% no-repeat,
    linear-gradient(to top left, #ffa9c6 49.5%, transparent 50%) right / 50.5% 100% no-repeat,
    linear-gradient(to top, #ffb9d1 0 50%, transparent 50%);
  z-index: 2;
}
.env-flap {
  left: 0; right: 0; top: 0; height: 55%; z-index: 3;
  background: linear-gradient(to bottom, #ff7aa8, #ff94b9);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top; transition: transform .6s ease, z-index 0s .3s;
}
.env-seal {
  position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); z-index: 4;
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 22px;
  background: radial-gradient(circle at 35% 35%, #ff6b9a, #c4185a); box-shadow: 0 4px 10px rgba(196,24,90,.4);
  transition: transform .4s, opacity .4s;
}
.envelope.open { animation: none; }
.envelope.open .env-flap { transform: rotateX(180deg); z-index: 1; }
.envelope.open .env-seal { transform: translate(-50%, -50%) scale(0); opacity: 0; }
.envelope.open .env-paper { transform: translateY(-60%); }
.env-hint { color: var(--plum-2); font-size: 15px; animation: pulse 1.6s infinite; }

.letter-paper {
  position: relative; width: 100%; max-width: 620px; margin-top: 26px;
  padding: 34px 26px 40px 46px; border-radius: 10px;
  background:
    linear-gradient(90deg, transparent 32px, rgba(255,79,139,.35) 32px, rgba(255,79,139,.35) 34px, transparent 34px),
    repeating-linear-gradient(#fffaf3 0 33px, #f6dfe6 33px 34px);
  box-shadow: 0 20px 50px rgba(90,30,74,.18);
  animation: popIn .8s cubic-bezier(.2,1.2,.4,1);
}
.letter-paper[hidden] { display: none; }
.letter-paper::after { content: "🌹"; position: absolute; right: -10px; bottom: -14px; font-size: 44px; transform: rotate(-20deg); }
.letter-text { font-size: 17px; line-height: 34px; white-space: pre-wrap; color: #4a2040; min-height: 200px; }
.letter-text .caret { display: inline-block; width: 2px; height: 1.1em; background: var(--hot); vertical-align: middle; animation: blink .8s steps(2) infinite; }

/* ---------- FINALE ---------- */
.finale {
  max-width: none; overflow: hidden; color: #fff; text-align: center; min-height: 100dvh;
  background: linear-gradient(180deg, rgba(28,11,46,0) 0, #1c0b2e 220px, #2a0f40 65%, #4a1e5e 100%);
  padding-top: 160px;
}
.finale::before { /* soft top fade from pink */
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 120px;
  background: linear-gradient(#ffd6e7, transparent); opacity: .0;
}
#star-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.finale-content { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: 34vh; }
.finale-title .script { font-size: clamp(52px, 14vw, 96px); background: linear-gradient(90deg, #ffd1e3, #ffd166, #e2c7ff, #ffd1e3); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmerMove 5s linear infinite; }
.finale-sub { font-size: 17px; color: #f3d9ff; }
.finale-last { font-size: clamp(18px, 5vw, 24px); line-height: 1.7; margin-top: 18px; font-weight: 600; }
.finale-last .sign { font-family: var(--f-script); font-size: 1.6em; color: #ffb6c8; font-weight: 400; }
.wish-box { display: flex; gap: 8px; padding: 10px; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); width: min(92vw, 440px); }
.wish-box[hidden] { display: none; }
.wish-input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: #fff; font-size: 16px; padding: 8px 10px; }
.wish-input::placeholder { color: rgba(255,255,255,.6); }
.flying-wish {
  position: fixed; z-index: 70; color: #fff; font-family: var(--f-bn); font-size: 18px; font-weight: 600;
  text-shadow: 0 0 12px #ffd166; pointer-events: none;
  animation: flyWish 2.6s cubic-bezier(.5,0,.8,.4) forwards;
}
@keyframes flyWish { to { transform: translate(30vw, -80vh) scale(.2); opacity: 0; } }

.foot { position: relative; z-index: 1; text-align: center; padding: 26px 16px calc(26px + env(safe-area-inset-bottom)); font-size: 13px; color: #f3d9ff; background: #0d0518; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(90,30,74,.35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); padding: 20px; }
.modal[hidden] { display: none; }
.modal-card { max-width: 380px; padding: 28px 22px; text-align: center; background: rgba(255,255,255,.92); animation: popIn .5s cubic-bezier(.2,1.6,.4,1); }
.modal-emoji { font-size: 54px; }
.modal-card p { font-size: 17px; line-height: 1.7; margin: 10px 0 18px; }

/* Floating tap hearts */
.tap-heart { position: fixed; z-index: 90; pointer-events: none; font-size: 22px; animation: tapHeart 1s ease-out forwards; }
@keyframes tapHeart { to { transform: translate(var(--tx), -90px) scale(1.6) rotate(var(--tr)); opacity: 0; } }

/* ---------- Responsive ---------- */
@media (min-width: 720px) {
  .section { padding: 100px 40px; }
  .coupon-grid { grid-template-columns: repeat(3, 1fr); }
  .stat-cards { grid-template-columns: repeat(3, 1fr); }
  .stat { flex-direction: column; text-align: center; }
  .timeline { padding-left: 0; }
  .timeline::before { left: 50%; transform: translateX(-50%); }
  .tl-item { width: 50%; padding-right: 40px; }
  .tl-item:nth-child(even) { margin-left: 50%; padding-right: 0; padding-left: 40px; }
  .tl-item .tl-dot { left: auto; right: -20px; }
  .tl-item:nth-child(even) .tl-dot { right: auto; left: -20px; }
  .tl-card { margin-left: 0; }
  .tl-item:nth-child(even).reveal { transform: translateX(40px); }
  .tl-item.reveal.in { transform: none; }
}
@media (max-width: 380px) {
  .reasons-grid { gap: 7px; }
  .counter-grid { gap: 6px; }
  .cbox { padding: 14px 2px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
