/* ═══════════════════════════════════════
   生日贺卡 · 简约可爱风
   ═══════════════════════════════════════ */
:root {
  --bg: #fffaf5;          /* 奶油白 */
  --pink: #f8a5c2;        /* 主粉 */
  --pink-deep: #ef6f9f;
  --purple: #c3a6e0;      /* 薰衣草紫 */
  --mint: #a8e6cf;        /* 薄荷绿 */
  --text: #5b4b4b;        /* 暖棕文字 */
  --text-light: #a89090;
  --card-bg: #ffffff;
  --radius: 20px;
  --shadow: 0 8px 24px rgba(248, 165, 194, 0.25);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

img { max-width: 100%; }

/* ── 背景装饰 ─────────────────────── */
.bg-decor { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.deco-cloud { position: absolute; opacity: 0.5; width: 90px; }
.cloud-1 { top: 8%; left: -20px; animation: drift 26s linear infinite; }
.cloud-2 { top: 30%; right: -30px; animation: drift 32s linear infinite reverse; }
.deco-star { position: absolute; opacity: 0.35; width: 22px; animation: twinkle 3s ease-in-out infinite; }
.star-1 { top: 12%; left: 12%; animation-delay: 0s; }
.star-2 { top: 55%; right: 10%; animation-delay: 1.2s; }
.star-3 { top: 78%; left: 18%; animation-delay: 2.1s; }

@keyframes drift {
  0%   { transform: translateX(0); }
  50%  { transform: translateX(40px); }
  100% { transform: translateX(0); }
}
@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.9); }
  50%      { opacity: 0.7; transform: scale(1.15); }
}

/* ── 音乐按钮 ─────────────────────── */
.music-btn {
  position: fixed; top: calc(12px + env(safe-area-inset-top)); right: 12px;
  z-index: 100; border: none; background: rgba(255,255,255,0.9);
  border-radius: 999px; padding: 8px 14px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: 14px; color: var(--text);
}
.music-btn .music-icon { font-size: 18px; }
.music-btn .music-tip { font-size: 12px; color: var(--text-light); }
.music-btn.playing { background: var(--pink); color: #fff; }
.music-btn.playing .music-icon { animation: spin 2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 屏幕通用 ─────────────────────── */
.screen {
  min-height: 100vh;
  min-height: 100svh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 24px 40px;
  position: relative; z-index: 1;
  text-align: center;
}

.sec-title { font-size: 26px; font-weight: 700; color: var(--pink-deep); letter-spacing: 2px; }
.sec-title em { font-style: normal; color: var(--pink-deep); font-size: 34px; }
.sec-sub { margin-top: 10px; font-size: 14px; color: var(--text-light); }

/* ── 屏 1 · 开场 ──────────────────── */
.hero { overflow: hidden; }
.hero-inner { animation: fadeUp 1.2s ease both; }
.hero-gift { width: 90px; margin: 0 auto 24px; animation: bob 3s ease-in-out infinite; }
.hero-name { font-size: 44px; font-weight: 800; color: var(--pink-deep); letter-spacing: 6px; }
.hero-sub { margin-top: 16px; font-size: 17px; color: var(--text); }
.hero-date {
  margin-top: 28px; font-size: 15px; color: var(--purple);
  letter-spacing: 4px; font-weight: 600;
}
.hero-balloons { position: absolute; inset: 0; pointer-events: none; }
.hb { position: absolute; width: 64px; opacity: 0.85; animation: floatBalloon 6s ease-in-out infinite; }
.b1 { left: 8%;  top: 18%; animation-delay: 0s; }
.b2 { right: 10%; top: 22%; animation-delay: 1.4s; width: 52px; }
.b3 { left: 18%; bottom: 20%; animation-delay: 2.6s; width: 46px; }
.b4 { right: 16%; bottom: 26%; animation-delay: 0.8s; }
@keyframes floatBalloon {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-26px) rotate(3deg); }
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.scroll-hint {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  font-size: 13px; color: var(--text-light); animation: bounceDown 1.6s infinite;
}
@keyframes bounceDown {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 8px); }
}

/* ── 屏 2 · 寄语 ──────────────────── */
.wish-card {
  background: var(--card-bg); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 44px 30px 36px;
  max-width: 440px; width: 100%;
}
.wish-emoji { width: 56px; margin: 0 auto 20px; }
.wish-typing {
  font-size: 18px; line-height: 2; color: var(--text);
  min-height: 150px; text-align: left; letter-spacing: 1px;
}
.wish-typing::after {
  content: "▍"; color: var(--pink); animation: blink 0.8s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.wish-from { margin-top: 22px; font-size: 13px; color: var(--text-light); text-align: right; }

/* ── 屏 3 · 18 个心愿 ─────────────── */
.wishes { max-width: 600px; margin: 0 auto; }
.card-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 14px; margin-top: 30px; width: 100%;
}
.w-card {
  aspect-ratio: 1; perspective: 600px; cursor: pointer;
}
.w-card-inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d; transition: transform 0.6s ease;
}
.w-card.flipped .w-card-inner { transform: rotateY(180deg); }
.w-face {
  position: absolute; inset: 0; backface-visibility: hidden;
  border-radius: 16px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  box-shadow: var(--shadow);
}
.w-front { background: linear-gradient(145deg, #ffeef5, #fff); }
.w-front .w-emoji { font-size: 28px; }
.w-front .w-num { font-size: 13px; color: var(--text-light); font-weight: 600; }
.w-back {
  background: linear-gradient(145deg, var(--pink), var(--purple));
  transform: rotateY(180deg); color: #fff; padding: 10px;
  font-size: 14px; line-height: 1.5; font-weight: 600;
}

/* ── 屏 4 · 数据彩蛋 ──────────────── */
.stats { max-width: 600px; margin: 0 auto; }
.stat-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 14px; margin-top: 30px; width: 100%;
}
.stat-card {
  background: var(--card-bg); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 26px 14px;
}
.stat-num {
  font-size: 40px; font-weight: 800; color: var(--pink-deep);
  font-variant-numeric: tabular-nums;
}
.stat-num .big-symbol { font-size: 34px; }
.stat-num sup { font-size: 18px; }
.stat-label { margin-top: 8px; font-size: 13px; color: var(--text-light); }
.stats-foot { margin-top: 22px; font-size: 15px; color: var(--purple); font-weight: 600; }

.highlights { margin-top: 34px; width: 100%; display: flex; flex-direction: column; gap: 22px; }
.hl-item { display: flex; flex-direction: column; gap: 8px; }
.bubble {
  max-width: 82%; padding: 10px 14px; border-radius: 16px;
  font-size: 14px; line-height: 1.6; text-align: left;
  box-shadow: 0 3px 10px rgba(0,0,0,0.06);
}
.bubble-left  { align-self: flex-start; background: #fff; border-bottom-left-radius: 4px; }
.bubble-right { align-self: flex-end;   background: var(--pink); color: #fff; border-bottom-right-radius: 4px; }
.stats-tip { margin-top: 20px; font-size: 12px; color: var(--text-light); }

/* ── 屏 5 · 许愿互动 ──────────────── */
.interact { max-width: 600px; margin: 0 auto; }
.pop-balloons {
  display: flex; justify-content: center; gap: 40px;
  margin-top: 40px; min-height: 130px; align-items: center;
}
.pop-balloon {
  width: 90px; cursor: pointer; text-align: center;
  transition: transform 0.2s ease;
  animation: floatBalloon 4.5s ease-in-out infinite;
}
.pop-balloon:nth-child(2) { animation-delay: 1s; }
.pop-balloon:nth-child(3) { animation-delay: 2s; }
.pop-balloon:hover { transform: scale(1.1); }
.pop-balloon img { width: 100%; }
.pop-label { display: block; margin-top: 4px; font-size: 13px; color: var(--text-light); font-weight: 600; }
.pop-balloon.popped { animation: popAnim 0.4s ease forwards; pointer-events: none; }
@keyframes popAnim {
  0%   { transform: scale(1); opacity: 1; }
  50%  { transform: scale(1.25); opacity: 0.7; }
  100% { transform: scale(0); opacity: 0; }
}

.pop-message {
  min-height: 34px; margin-top: 18px; font-size: 17px; color: var(--pink-deep);
  font-weight: 700; letter-spacing: 1px;
}

.cake-zone { margin-top: 44px; position: relative; }
.cake-img { width: 220px; }
.candles { position: absolute; top: 34px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; }
.candle { position: relative; width: 8px; height: 34px; background: linear-gradient(#fff, #ffe3ee); border-radius: 4px 4px 2px 2px; }
.candle .flame {
  position: absolute; top: -16px; left: 50%; transform: translateX(-50%);
  width: 12px; height: 16px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 50% 80%, #ffd166, #ff9f43);
  animation: flicker 0.18s ease-in-out infinite alternate;
  box-shadow: 0 0 12px rgba(255, 159, 67, 0.8);
}
@keyframes flicker {
  from { transform: translateX(-50%) scale(1) rotate(-2deg); }
  to   { transform: translateX(-50%) scale(0.92, 1.08) rotate(2deg); }
}
.candle.out .flame { display: none; }
.cake-hint { margin-top: 16px; font-size: 14px; color: var(--text-light); }

/* 烟花粒子 */
.particle {
  position: fixed; border-radius: 50%; pointer-events: none; z-index: 99;
  animation: particleFly 1s ease-out forwards;
}
@keyframes particleFly {
  0%   { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0.3); opacity: 0; }
}

/* ── 屏 6 · 结尾 ──────────────────── */
.finale { background: linear-gradient(180deg, var(--bg), #fdeef5); }
.finale-inner { animation: fadeUp 1.2s ease both; }
.finale-sparkle { width: 56px; margin: 0 auto 18px; animation: spinSlow 6s linear infinite; }
@keyframes spinSlow { to { transform: rotate(360deg); } }
.finale-title {
  font-size: 40px; font-weight: 800; color: var(--pink-deep);
  letter-spacing: 2px; line-height: 1.3;
}
.finale-text { margin-top: 22px; font-size: 16px; color: var(--text); }
.finale-heart { width: 40px; margin: 26px auto 0; animation: heartbeat 1.2s ease-in-out infinite; }
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  25%      { transform: scale(1.18); }
  40%      { transform: scale(0.96); }
  60%      { transform: scale(1.12); }
}
.finale-ps { margin-top: 26px; font-size: 14px; color: var(--purple); font-weight: 600; letter-spacing: 2px; }

/* ── 滚动进入动画 ─────────────────── */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (min-width: 768px) {
  .hero-name { font-size: 56px; }
  .card-grid { grid-template-columns: repeat(6, 1fr); }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
}
