@font-face {
  font-family: "DaiMengHandwriting";
  src: url("../assets/fonts/DaiMengHandwriting.woff") format("woff");
  font-display: swap;
}

:root {
  --color-bg: #fff6ef;
  --color-blush: #ffd6e7;
  --color-pink: #ff8fb7;
  --color-lavender: #c7b8ff;
  --color-mint: #bdefe6;
  --color-butter: #ffe6a7;
  --color-text: #4f3f4d;
  --color-muted: #8d7685;
  --color-surface: rgba(255, 255, 255, 0.84);
  --shadow-soft: 0 16px 34px rgba(142, 108, 123, 0.16);
  --radius-page: 34px;
  --radius-card: 30px;
  --stage-width: min(100%, 430px);
  --stage-height: min(100%, 932px);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: visible;
}

body {
  margin: 0;
  color: var(--color-text);
  background: var(--color-bg);
  overscroll-behavior: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  width: 100vw;
  height: 100dvh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(8px, env(safe-area-inset-top)) 12px max(8px, env(safe-area-inset-bottom));
  overflow: hidden;
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 214, 231, 0.7), transparent 28%),
    radial-gradient(circle at 86% 20%, rgba(189, 239, 230, 0.58), transparent 24%),
    var(--color-bg);
}

.card-stage {
  position: relative;
  width: min(100%, 430px);
  height: min(100%, 932px);
  min-height: 0;
  max-height: 932px;
  overflow: hidden;
  border-radius: var(--radius-page);
  background: var(--color-bg);
  box-shadow: var(--shadow-soft);
  isolation: isolate;
}

.card-status {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 32px;
  color: var(--color-text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  background: rgba(255, 246, 239, 0.92);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

body[data-card-state="loading"] .card-status,
body[data-card-state="error"] .card-status {
  opacity: 1;
  pointer-events: auto;
}

body[data-card-state="loading"] .page-shell,
body[data-card-state="error"] .page-shell,
body[data-card-state="error"] .music-button {
  pointer-events: none;
}

.ambient {
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  z-index: -1;
}

.ambient-blush {
  width: 188px;
  height: 188px;
  left: -56px;
  top: 76px;
  background: rgba(255, 214, 231, 0.56);
}

.ambient-mint {
  width: 142px;
  height: 142px;
  right: -34px;
  top: 132px;
  background: rgba(189, 239, 230, 0.48);
}

.ambient-lavender {
  width: 180px;
  height: 180px;
  right: -42px;
  bottom: 54px;
  background: rgba(199, 184, 255, 0.34);
}

.fireworks-lottie {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  user-select: none;
  transform: scale(1.04);
  transition: opacity 220ms ease;
}

.fireworks-lottie canvas,
.fireworks-lottie svg {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.card-stage.is-fireworks-playing .fireworks-lottie {
  opacity: 0.84;
}

.card-stage.is-fireworks-hidden .fireworks-lottie,
.card-stage.is-fireworks-lottie-unavailable .fireworks-lottie {
  opacity: 0;
}

.music-button {
  position: absolute;
  top: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #7a5b52;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 6px 16px rgba(181, 139, 156, 0.12);
  z-index: 5;
}

.music-disc {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.95) 0 4px, transparent 5px),
    var(--color-blush);
}

.music-note {
  position: relative;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.music-button.is-playing {
  animation: spin 3.4s linear infinite;
}

.page-shell {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  padding: 72px 34px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px);
  transition:
    opacity 520ms ease,
    transform 520ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.page-shell.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.page-cake {
  align-content: start;
  gap: 0;
  padding: 68px 24px 18px;
}

.cake-copy {
  display: grid;
  justify-items: center;
  gap: 8px;
  animation: title-rise 720ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.wish-title-image {
  display: block;
  width: min(196px, 64vw);
  height: auto;
  margin-bottom: 2px;
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(0 8px 12px rgba(255, 143, 183, 0.12));
}

.eyebrow {
  margin: 0;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 500;
}

h1 {
  max-width: 300px;
  margin: 0;
  font-size: 26px;
  line-height: 34px;
  letter-spacing: 0;
}

.cake-title {
  max-width: 320px;
  font-family: "DaiMengHandwriting", "Yuppy SC", "HanziPen SC", "PingFang SC", sans-serif;
  font-size: 30px;
  line-height: 38px;
  font-weight: 700;
  color: #e95698;
  -webkit-text-fill-color: #e95698;
  -webkit-text-stroke: 0.7px rgba(255, 255, 255, 0.9);
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.95),
    0 4px 0 rgba(142, 210, 232, 0.28),
    0 8px 16px rgba(201, 89, 139, 0.22);
}

.lead {
  max-width: 280px;
  margin: 0;
  color: var(--color-muted);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  line-height: 20px;
}

.blow-control {
  position: relative;
  width: 118px;
  height: 118px;
  margin-top: -8px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--color-pink);
  background: transparent;
  animation: fade-soft 640ms 360ms ease both;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.blow-control:disabled,
.page-cake.is-blow-locked .blow-control {
  opacity: 1;
  cursor: default;
  pointer-events: none;
}

.blow-control::before,
.blow-control::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.blow-control::before {
  background: radial-gradient(circle, rgba(255, 143, 183, 0.28) 0 52%, rgba(199, 184, 255, 0.16) 66%, transparent 72%);
  filter: blur(1px);
  transform: scale(0.92);
}

.blow-control::after {
  inset: -4px;
  background: conic-gradient(from 0deg, transparent 0 68%, rgba(255, 255, 255, 0.84) 75%, transparent 84% 100%);
  mask: radial-gradient(circle, transparent 0 51px, #000 52px, #000 61px, transparent 62px);
}

.blow-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    conic-gradient(var(--color-pink) calc(var(--blow-progress, 0) * 1turn), rgba(234, 221, 230, 0.92) 0),
    rgba(234, 221, 230, 0.92);
  mask: radial-gradient(circle, transparent 0 47px, #000 48px);
  transition: filter 180ms ease;
}

.blow-ring::after {
  content: none;
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 8px solid rgba(255, 143, 183, 0.58);
  clip-path: polygon(50% 0, 100% 0, 100% 58%, 50% 50%);
}

.blow-button-preview {
  width: 80px;
  height: 80px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--color-pink);
  font-size: 21px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 22px rgba(181, 139, 156, 0.16);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.interaction-hint {
  margin: 4px 0 0;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 500;
  animation: fade-soft 640ms 420ms ease both;
}

.page-particles,
.page-gift {
  align-content: start;
  gap: 0;
  padding: 86px 28px 28px;
  background:
    radial-gradient(circle at 28% 36%, rgba(255, 143, 183, 0.2), transparent 28%),
    radial-gradient(circle at 76% 62%, rgba(199, 184, 255, 0.24), transparent 30%);
}

.particle-copy {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.particle-title-image {
  display: block;
  width: min(196px, 64vw);
  height: auto;
  max-height: 90px;
  margin-bottom: 0;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(0 8px 12px rgba(255, 143, 183, 0.12));
}

.particle-title {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  max-width: 320px;
  margin: -8px 0 0;
}

.page-particles .lead {
  margin-top: -4px;
}

.particle-title-text {
  font-family: "DaiMengHandwriting", "Yuppy SC", "HanziPen SC", "PingFang SC", sans-serif;
  font-size: 30px;
  line-height: 38px;
  font-weight: 700;
  color: #e95698;
  -webkit-text-fill-color: #e95698;
  -webkit-text-stroke: 0.7px rgba(255, 255, 255, 0.9);
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.95),
    0 4px 0 rgba(142, 210, 232, 0.28),
    0 8px 16px rgba(201, 89, 139, 0.22);
}

.particle-title-star {
  font-size: 20px;
  line-height: 1;
  filter: drop-shadow(0 5px 8px rgba(255, 203, 83, 0.22));
}

.particle-stage {
  position: relative;
  width: min(318px, 100%);
  height: 368px;
  margin-top: 46px;
  overflow: hidden;
  border-radius: 34px;
  background:
    radial-gradient(circle at 22% 22%, rgba(255, 214, 231, 0.5), transparent 24%),
    radial-gradient(circle at 76% 70%, rgba(189, 239, 230, 0.44), transparent 28%),
    rgba(255, 255, 255, 0.48);
  box-shadow: 0 12px 24px rgba(142, 108, 123, 0.1);
  animation: particle-stage-enter 640ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.particle-message {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 32px 22px;
  margin: 0;
  color: #a9a9f5;
  font-family: "DaiMengHandwriting", "Yuppy SC", "HanziPen SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 38px;
  --particle-message-fit-size: 38px;
  font-weight: 400;
  line-height: 1.22;
  letter-spacing: 0;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
  pointer-events: none;
}

.particle-message.is-fading-out {
  animation: particle-message-fade-out var(--message-fade-duration, 640ms) ease forwards;
}

.particle-message-line {
  display: flex;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  justify-content: center;
  flex-wrap: nowrap;
  white-space: nowrap;
  font-size: var(--particle-message-fit-size, 38px);
  opacity: 0;
  transform: translateY(3px) scale(0.992);
  animation: particle-line-fade-in 900ms cubic-bezier(0.16, 1, 0.3, 1) var(--line-delay, 0ms) both;
}

.particle-message-line.is-wrapping {
  width: 100%;
  flex-wrap: wrap;
  white-space: normal;
}

.particle-message-line.is-secondary {
  font-size: calc(var(--particle-message-fit-size, 38px) * 1.08);
}

.particle-message-line.is-primary {
  font-size: calc(var(--particle-message-fit-size, 38px) * 1.08);
}

.page-gift {
  padding: 84px 28px 26px;
  justify-items: center;
  text-align: center;
}

.gift-copy {
  display: grid;
  width: min(100%, 340px);
  margin: 0 auto;
  justify-items: center;
  gap: 10px;
  animation: title-rise 680ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.gift-title-image {
  display: block;
  width: min(196px, 64vw);
  height: auto;
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(0 8px 12px rgba(191, 131, 169, 0.12));
}

.gift-copy h1 {
  max-width: 340px;
  font-family: "DaiMengHandwriting", "Yuppy SC", "HanziPen SC", "PingFang SC", sans-serif;
  font-size: 28px;
  line-height: 36px;
  font-weight: 700;
  color: #e95698;
  -webkit-text-fill-color: #e95698;
  -webkit-text-stroke: 0.6px rgba(255, 255, 255, 0.9);
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.92),
    0 4px 0 rgba(142, 210, 232, 0.2),
    0 8px 14px rgba(201, 89, 139, 0.16);
}

.gift-stage {
  position: relative;
  width: min(260px, 68vw);
  height: min(260px, 68vw);
  display: grid;
  place-items: center;
  margin-top: 90px;
  padding: 0;
  border-radius: 34px;
  background: transparent;
  transform-origin: 50% 72%;
  animation: gift-idle-float 2.8s ease-in-out infinite;
  transition: transform 480ms cubic-bezier(0.2, 0.82, 0.22, 1);
  -webkit-tap-highlight-color: transparent;
}

.gift-stage::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 72%;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(205, 110, 125, 0.32) 0%, rgba(220, 150, 160, 0.16) 44%, rgba(220, 150, 160, 0) 76%);
  filter: blur(20px);
  opacity: 0.82;
  transform: translateX(-50%);
  z-index: -1;
}

.gift-stage:disabled {
  cursor: default;
}

.page-gift.is-gift-entering .gift-stage,
.page-gift.is-gift-opening .gift-stage,
.page-gift.is-gift-opened .gift-stage {
  animation: none;
}

.page-gift.is-gift-settling .gift-stage {
  transform: translateY(84px);
}

.gift-lottie {
  width: 100%;
  height: 100%;
  opacity: 1;
  pointer-events: none;
  user-select: none;
  transform: scale(1.04);
  transform-origin: 50% 50%;
  transition: transform 360ms cubic-bezier(0.2, 0.9, 0.2, 1.18);
}

.page-gift.is-gift-opening .gift-lottie,
.page-gift.is-gift-opened .gift-lottie {
  transform: scale(1.12);
}

.gift-lottie canvas,
.gift-lottie svg {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.gift-lottie svg {
  filter:
    drop-shadow(0 10px 15px rgba(101, 40, 58, 0.3))
    drop-shadow(0 20px 34px rgba(205, 110, 125, 0.2));
}

.gift-fallback {
  position: absolute;
  inset: 50% auto auto 50%;
  display: none;
  place-items: center;
  width: 112px;
  height: 112px;
  border-radius: 28px;
  color: #b96d80;
  font-size: 24px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 28px rgba(142, 108, 123, 0.14);
  transform: translate(-50%, -50%);
}

.page-gift.is-gift-lottie-unavailable .gift-lottie {
  opacity: 0;
}

.page-gift.is-gift-lottie-unavailable .gift-fallback {
  display: grid;
}

.gift-hint {
  min-height: 22px;
  width: 100%;
  margin: 22px 0 0;
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  animation: gift-hint-fade 640ms 260ms ease both;
  transition:
    opacity 260ms ease,
    transform 480ms cubic-bezier(0.2, 0.82, 0.22, 1);
}

.page-gift:not(.is-gift-ready):not(.is-gallery-ready) .gift-hint {
  animation: none;
  opacity: 0;
  transform: translateY(0);
}

.page-gift.is-gift-ready .gift-hint,
.page-gift.is-gallery-ready .gift-hint {
  opacity: 1;
}

.page-gift.is-gallery-ready .gift-hint {
  color: #d66294;
  transform: translateY(24px);
}

.gift-next-button {
  position: relative;
  z-index: 5;
  display: block;
  width: min(132px, 40vw);
  margin-top: 28px;
  padding: 0;
  color: transparent;
  background: transparent;
  box-shadow: none;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 260ms ease,
    transform 320ms ease,
    filter 220ms ease;
}

.gift-next-button img,
.future-return-button img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  pointer-events: none;
}

.gift-next-button:not(:disabled):hover,
.future-return-button:hover {
  filter: brightness(1.03) drop-shadow(0 6px 10px rgba(210, 98, 132, 0.12));
}

.page-gift.is-active.is-gallery-ready .gift-next-button:not(:disabled) {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.gift-balloon-reveal {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.page-gift.is-active.is-photo-open .gift-balloon-reveal,
.page-gift.is-active.is-gallery-ready .gift-balloon-reveal {
  pointer-events: auto;
}

.gift-focus-backdrop {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: rgba(68, 45, 58, 0.16);
  backdrop-filter: blur(0);
  transition:
    opacity 420ms ease,
    backdrop-filter 420ms ease;
}

.page-gift.is-photo-open .gift-focus-backdrop {
  opacity: 1;
  backdrop-filter: blur(3px);
}

.gift-mouth-anchor {
  position: absolute;
  left: var(--gift-mouth-left, 50%);
  top: var(--gift-mouth-top, clamp(326px, 48vh, 378px));
  width: 1px;
  height: 1px;
  transform: translateX(-50%);
}

.gift-balloon-rig,
.gift-balloon-particles,
.gift-left-star,
.gift-hanging-photos,
.gift-polaroid {
  position: absolute;
  left: 0;
  top: 0;
}

.gift-balloon-rig {
  z-index: 3;
  width: 1px;
  height: 1px;
  opacity: 0;
  transform: translateY(0) scale(0.7);
  transform-origin: 0 0;
  transition:
    opacity 420ms ease,
    transform 980ms cubic-bezier(0.2, 0.82, 0.22, 1);
}

.page-gift.is-balloon-emerging .gift-balloon-rig {
  opacity: 1;
  animation: balloon-emerge 760ms cubic-bezier(0.18, 0.82, 0.2, 1) both;
}

.page-gift.is-balloon-rise .gift-balloon-rig {
  opacity: 1;
  animation: balloon-float 3.2s ease-in-out 980ms infinite;
}

.page-gift.is-pulling-photo .gift-balloon-rig,
.page-gift.is-photo-open .gift-balloon-rig,
.page-gift.is-photo-closing .gift-balloon-rig,
.page-gift.is-gallery-ready .gift-balloon-rig {
  opacity: 1;
  animation: balloon-float 3.2s ease-in-out infinite;
}

.page-gift.is-gallery-photo-open .gift-balloon-rig {
  opacity: 1;
  animation: balloon-float 3.2s ease-in-out infinite;
}

.page-gift.is-balloon-exit .gift-balloon-rig,
.page-gift.is-star-left .gift-balloon-rig,
.page-gift.is-soft-page-transition .gift-balloon-rig {
  opacity: 0;
  transform: translate(-50%, -560px) scale(0.8) rotate(8deg);
  transition:
    opacity 420ms ease 360ms,
    transform 920ms cubic-bezier(0.22, 0.74, 0.24, 1);
}

.heart-balloon {
  position: absolute;
  left: 0;
  top: 0;
  width: 104px;
  height: 104px;
  transform: translate(-50%, -86.5%);
  transform-origin: 50% 100%;
}

.heart-balloon::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(238, 82, 112, 0.22), transparent 68%);
  filter: blur(10px);
}

.heart-balloon-svg {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter:
    drop-shadow(0 16px 20px rgba(139, 45, 72, 0.16))
    drop-shadow(0 0 24px rgba(238, 82, 112, 0.26));
}

.heart-balloon-aura {
  fill: url("#heartBalloonGlow");
}

.heart-balloon-body {
  fill: url("#heartBalloonFill");
  stroke: rgba(255, 205, 214, 0.42);
  stroke-width: 2.2;
}

.heart-balloon-shine {
  fill: rgba(255, 255, 255, 0.62);
  filter: blur(0.4px);
}

.gift-chain-strings {
  position: absolute;
  left: -110px;
  top: -126px;
  width: 220px;
  height: 430px;
  overflow: visible;
  pointer-events: none;
}

.gift-chain-string {
  fill: none;
  stroke: rgba(178, 130, 78, 0.82);
  stroke-width: 2.15;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
  filter: drop-shadow(0 0 5px rgba(255, 238, 202, 0.5));
  transition:
    opacity 260ms ease,
    stroke-dashoffset 780ms cubic-bezier(0.2, 0.82, 0.22, 1);
}

.gift-chain-string.is-visible {
  opacity: 1;
  stroke-dashoffset: 0;
}

.gift-hanging-photos {
  z-index: 2;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.gift-mini-polaroid {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--mini-width, 92px);
  height: var(--mini-height, 68px);
  display: block;
  padding: 4px;
  border: 0;
  border-radius: 5px;
  opacity: 0;
  background: #fffdf8;
  box-shadow: 0 10px 18px rgba(86, 54, 71, 0.16);
  transform: translate(-50%, -50%) translate(var(--photo-start-x, 0px), var(--photo-start-y, 86px)) scale(0.22) rotate(var(--mini-rot, -3deg));
  transform-origin: 50% 12%;
  transition:
    opacity 460ms ease,
    filter 260ms ease,
    transform 980ms cubic-bezier(0.2, 0.82, 0.22, 1);
  pointer-events: none;
  -webkit-tap-highlight-color: transparent;
}

.gift-mini-polaroid.is-pulling-from-box,
.gift-mini-polaroid.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) translate(var(--mini-x), var(--mini-y)) scale(1) rotate(var(--mini-rot, -3deg));
}

.page-gift.is-active.is-gallery-ready .gift-mini-polaroid.is-visible {
  pointer-events: auto;
  cursor: pointer;
}

.page-gift.is-active.is-photo-open .gift-mini-polaroid {
  pointer-events: none;
}

.gift-mini-polaroid.is-current {
  filter: drop-shadow(0 0 10px rgba(255, 195, 214, 0.44));
}

.gift-mini-polaroid-image-wrap {
  display: block;
  height: 100%;
  overflow: hidden;
  border-radius: 3px;
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.86), transparent 25%),
    linear-gradient(145deg, rgba(255, 213, 226, 0.9), rgba(255, 231, 181, 0.58), rgba(201, 184, 255, 0.7));
}

.gift-mini-polaroid-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  opacity: 0;
  transition: opacity 320ms ease;
}

.gift-mini-polaroid.is-polaroid-ready .gift-mini-polaroid-image {
  opacity: 1;
}

.gift-mini-polaroid-date {
  display: none;
}

.gift-balloon-particle {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--particle-size);
  height: var(--particle-size);
  border-radius: 50%;
  opacity: 0;
  background: var(--particle-color);
  box-shadow: 0 0 9px rgba(255, 217, 120, 0.28);
  animation: balloon-particle-rise 920ms cubic-bezier(0.18, 0.8, 0.24, 1) var(--particle-delay) both;
}

.gift-polaroid {
  z-index: 5;
  width: 94px;
  min-height: 128px;
  display: grid;
  gap: 7px;
  padding: 9px 9px 12px;
  border-radius: 6px;
  opacity: 0;
  background: #fffdf8;
  box-shadow: 0 14px 30px rgba(86, 54, 71, 0.2);
  transform: translate(-50%, -50%) translateY(-14px) scale(0.36) rotate(var(--polaroid-rotate, -3deg));
  pointer-events: none;
  transition:
    width 600ms cubic-bezier(0.22, 0.74, 0.24, 1),
    min-height 600ms cubic-bezier(0.22, 0.74, 0.24, 1),
    opacity 360ms ease,
    filter 420ms ease,
    transform 940ms cubic-bezier(0.2, 0.82, 0.22, 1);
}

.gift-polaroid-image-wrap {
  position: relative;
  height: 76px;
  overflow: hidden;
  border-radius: 4px;
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.82), transparent 24%),
    linear-gradient(145deg, rgba(255, 213, 226, 0.9), rgba(255, 231, 181, 0.58), rgba(201, 184, 255, 0.7));
}

.gift-polaroid-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  opacity: 0;
  transition: opacity 360ms ease;
}

.gift-polaroid.is-polaroid-ready .gift-polaroid-image {
  opacity: 1;
}

.gift-polaroid-date {
  min-height: 13px;
  color: #b79aa8;
  font-size: 10px;
  font-weight: 600;
  line-height: 13px;
  text-align: left;
}

.gift-polaroid-text {
  margin: 0;
  color: #6a5360;
  font-size: 10px;
  font-weight: 600;
  line-height: 15px;
  text-align: left;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 460ms ease 260ms,
    transform 460ms cubic-bezier(0.2, 0.8, 0.2, 1) 260ms;
}

.page-gift.is-pulling-photo .gift-polaroid {
  opacity: 0;
  pointer-events: none;
}

.page-gift.is-active.is-photo-open .gift-polaroid {
  width: min(304px, 82vw);
  min-height: min(310px, 50vh);
  opacity: 1;
  transform: translate(-50%, -50%) translateY(-122px) scale(1.08) rotate(0deg);
  pointer-events: auto;
}

.page-gift:not(.is-active) .gift-balloon-reveal,
.page-gift:not(.is-active) .gift-mini-polaroid,
.page-gift:not(.is-active) .gift-polaroid,
.page-gift:not(.is-active) .gift-next-button {
  pointer-events: none !important;
}

.page-gift.is-photo-open .gift-polaroid-image-wrap {
  height: min(190px, 28vh);
}

.page-gift.is-photo-open .gift-polaroid-date {
  font-size: 12px;
  line-height: 17px;
}

.page-gift.is-photo-open .gift-polaroid-text {
  font-size: 14px;
  line-height: 22px;
  opacity: 1;
  transform: translateY(0);
}

.page-gift.is-photo-closing .gift-polaroid {
  opacity: 0;
  filter: blur(4px);
  transform: translate(-50%, -50%) translateY(-120px) scale(0.92) rotate(0deg);
}

.gift-left-star {
  width: 18px;
  height: 18px;
  opacity: 0;
  transform: translate(-50%, -50%) translateY(-8px) scale(0.6);
}

.gift-left-star::before,
.gift-left-star::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255, 246, 196, 0.95), rgba(255, 213, 96, 0.62) 46%, transparent 68%);
  clip-path: polygon(50% 0, 61% 36%, 100% 50%, 61% 64%, 50% 100%, 39% 64%, 0 50%, 39% 36%);
}

.gift-left-star::after {
  filter: blur(7px);
  transform: scale(1.8);
}

.page-gift.is-star-left .gift-left-star,
.page-gift.is-soft-page-transition .gift-left-star {
  opacity: 1;
  animation: tiny-star-twinkle 1000ms ease-in-out both;
}

.page-gift.is-soft-page-transition::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.72);
  animation: page-white-glow 620ms ease both;
  backdrop-filter: blur(5px);
}

.page-final {
  align-content: start;
  gap: 8px;
  padding: 42px 22px 18px;
  background:
    radial-gradient(circle at 22% 24%, rgba(255, 214, 231, 0.34), transparent 30%),
    radial-gradient(circle at 80% 72%, rgba(199, 184, 255, 0.26), transparent 30%),
    radial-gradient(circle at 70% 12%, rgba(255, 230, 167, 0.22), transparent 28%);
}

.future-copy {
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 100%;
  animation: title-rise 680ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.future-title-image {
  display: block;
  width: min(170px, 58vw);
  max-height: 64px;
  height: auto;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(0 8px 12px rgba(255, 143, 183, 0.12));
}

.future-title {
  margin: -6px 0 0;
  font-family: "DaiMengHandwriting", "Yuppy SC", "HanziPen SC", "PingFang SC", sans-serif;
  font-size: 28px;
  line-height: 34px;
  font-weight: 700;
  color: #e95698;
  -webkit-text-fill-color: #e95698;
  -webkit-text-stroke: 0.7px rgba(255, 255, 255, 0.9);
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.95),
    0 4px 0 rgba(142, 210, 232, 0.28),
    0 8px 16px rgba(201, 89, 139, 0.22);
}

.future-copy .lead {
  margin-top: -4px;
}

.future-memory-card {
  position: relative;
  width: min(326px, 100%);
  display: grid;
  gap: 10px;
  margin-top: 2px;
  padding: 16px 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 30px;
  color: #2f1b14;
  text-align: left;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.74), rgba(255, 247, 237, 0.92)),
    radial-gradient(circle at 20% 18%, rgba(255, 221, 230, 0.28), transparent 34%);
  box-shadow:
    0 22px 40px rgba(142, 108, 123, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  animation: title-rise 720ms 120ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.future-location {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 48%;
  margin: 0 0 0 -4px;
  color: #3b2116;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.025em;
  white-space: nowrap;
}

.future-location-pin {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  display: inline-flex;
  color: #4a2412;
}

.future-location-pin svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.future-location-pin circle {
  fill: #fff8f0;
}

.future-photo-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1.22;
  margin: 0;
  overflow: hidden;
  border-radius: 18px;
  background:
    radial-gradient(circle at 70% 28%, rgba(255, 223, 170, 0.8), transparent 34%),
    linear-gradient(135deg, #f7d6d3, #d8e4ef 48%, #f8e5bd);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.58);
}

.future-photo-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.future-photo-placeholder {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  margin: 0;
  color: rgba(79, 63, 77, 0.54);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.future-photo-frame.is-photo-missing .future-photo-image {
  display: none;
}

.future-photo-frame.is-photo-missing .future-photo-placeholder {
  display: grid;
}

.future-card-copy {
  position: relative;
  padding: 0 10px;
}

.future-card-copy h2 {
  margin: 0 34px 6px 0;
  color: #2f180f;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  line-height: 27px;
  font-weight: 700;
}

.future-card-copy p {
  margin: 0;
  color: #3c2a22;
  font-size: 12.5px;
  line-height: 22px;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.future-card-heart {
  position: absolute;
  top: 4px;
  right: 8px;
  width: 44px;
  height: 36px;
  overflow: visible;
  transform: rotate(-10deg);
  filter: drop-shadow(0 2px 0 rgba(255, 255, 255, 0.68));
}

.future-card-heart-fill {
  fill: rgba(233, 147, 130, 0.26);
}

.future-card-heart-line {
  fill: none;
  stroke: #df8f7f;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.future-card-heart-line-main {
  stroke-width: 4;
}

.future-card-heart-line-sketch {
  stroke-width: 2;
  opacity: 0.66;
}

.future-date-rule {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  color: #e6a28f;
}

.future-date-rule span {
  height: 1px;
  background: rgba(80, 42, 24, 0.14);
}

.future-date-rule i {
  font-style: normal;
  font-size: 13px;
}

.future-date {
  display: block;
  color: #1f1512;
  text-align: center;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.16em;
}

.future-return-button {
  display: block;
  width: min(140px, 44vw);
  margin: 47px auto 0;
  padding: 0;
  background: transparent;
  opacity: 1;
  transition:
    filter 220ms ease,
    transform 220ms ease;
}

.future-return-button:active,
.gift-next-button:not(:disabled):active {
  transform: translateY(1px) scale(0.98);
}

.page-cake.is-holding .blow-button-preview {
  transform: scale(0.94);
  background: rgba(255, 250, 252, 0.96);
  box-shadow: 0 6px 16px rgba(181, 139, 156, 0.2);
}

.page-cake.is-holding .blow-ring {
  filter: drop-shadow(0 0 10px rgba(255, 143, 183, 0.18));
}

.page-cake.is-ready-blow .blow-control::before {
  animation: ready-ring-breathe 920ms ease-in-out infinite;
}

.page-cake.is-ready-blow .blow-control::after {
  animation: ready-ring-sweep 1120ms linear infinite;
  opacity: 0.72;
}

.page-cake.is-ready-blow .blow-ring {
  filter:
    drop-shadow(0 0 12px rgba(255, 143, 183, 0.34))
    drop-shadow(0 0 18px rgba(199, 184, 255, 0.22));
}

.page-cake.is-ready-blow .blow-button-preview {
  animation: ready-button-pulse 920ms ease-in-out infinite;
  box-shadow: 0 10px 24px rgba(255, 143, 183, 0.2);
}

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

@keyframes title-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cake-enter {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fade-soft {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gift-hint-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes ready-ring-breathe {
  0%,
  100% {
    opacity: 0.28;
    transform: scale(0.94);
  }

  50% {
    opacity: 0.52;
    transform: scale(1.08);
  }
}

@keyframes ready-ring-sweep {
  to {
    transform: rotate(360deg);
  }
}

@keyframes ready-button-pulse {
  0%,
  100% {
    transform: scale(0.94);
  }

  50% {
    transform: scale(0.98);
  }
}

@keyframes particle-stage-enter {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes particle-line-fade-in {
  from {
    opacity: 0;
    transform: translateY(3px) scale(0.992);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes particle-message-fade-out {
  to {
    opacity: 0;
    transform: translateY(-4px);
  }
}

@keyframes gift-idle-float {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-6px) scale(1.015);
  }
}

@keyframes balloon-float {
  0%,
  100% {
    margin-top: 0;
    margin-left: 0;
  }

  50% {
    margin-top: -5px;
    margin-left: 4px;
  }
}

@keyframes balloon-emerge {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.86);
  }

  to {
    opacity: 1;
    transform: translateY(-34px) scale(1);
  }
}

@keyframes string-sway {
  0%,
  100% {
    transform: translateX(-50%) rotate(-3deg);
  }

  50% {
    transform: translateX(-50%) rotate(4deg);
  }
}

@keyframes balloon-particle-rise {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }

  18% {
    opacity: 0.88;
  }

  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--particle-x)), calc(-50% + var(--particle-y))) scale(1);
  }
}

@keyframes tiny-star-twinkle {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) translateY(-8px) scale(0.6) rotate(0deg);
  }

  38% {
    opacity: 1;
    transform: translate(-50%, -50%) translateY(-12px) scale(1.12) rotate(18deg);
  }

  100% {
    opacity: 0.82;
    transform: translate(-50%, -50%) translateY(-10px) scale(0.92) rotate(30deg);
  }
}

@keyframes page-white-glow {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes cake-fly-away {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg) scale(1);
  }

  42% {
    opacity: 1;
    transform: translateY(-26px) rotate(-10deg) scale(1.04);
  }

  100% {
    opacity: 0;
    transform: translate(160px, -210px) rotate(28deg) scale(0.78);
  }
}

@keyframes cake-drop-in {
  0% {
    opacity: 0;
    transform: translateY(-190px) rotate(-4deg) scale(0.92);
  }

  72% {
    opacity: 1;
    transform: translateY(10px) rotate(2deg) scale(1.02);
  }

  100% {
    opacity: 1;
    transform: translateY(0) rotate(0deg) scale(1);
  }
}

/* Cake visual uses the supplied Lottie JSON asset, not CSS-drawn geometry. */
.cake {
  position: relative;
  width: min(272px, 78vw);
  height: 300px;
  margin: 26px auto 0;
  animation: cake-enter 860ms 120ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  transform-origin: 50% 78%;
}

.cake-shadow {
  position: absolute;
  left: 50%;
  bottom: 26px;
  width: 88%;
  height: 34px;
  border-radius: 50%;
  background: rgba(78, 52, 62, 0.14);
  filter: blur(13px);
  transform: translateX(-50%);
}

.cake-lottie,
.flame-lottie {
  position: absolute;
  left: 50%;
  bottom: 42px;
  display: grid;
  place-items: center;
  width: 100%;
  height: 236px;
  user-select: none;
  pointer-events: none;
  transform: translateX(-50%);
  filter: drop-shadow(0 18px 24px rgba(142, 93, 102, 0.14));
  transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cake-lottie {
  z-index: 1;
}

.flame-lottie {
  z-index: 2;
  opacity: 1;
  transition:
    opacity 220ms ease,
    transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.smoke-lottie {
  position: absolute;
  left: 50%;
  bottom: 238px;
  z-index: 3;
  width: 68px;
  height: 68px;
  opacity: 0;
  pointer-events: none;
  user-select: none;
  transform: translateX(-50%) translateY(0) scale(0.96);
  transition:
    opacity 120ms ease,
    transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.smoke-lottie canvas,
.smoke-lottie svg {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.page-cake.is-smoke-playing .smoke-lottie {
  opacity: 1;
  transform: translateX(-50%) translateY(-2px) scale(1);
}

.cake-lottie canvas,
.cake-lottie svg,
.flame-lottie canvas,
.flame-lottie svg {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.page-cake.is-holding .cake-lottie,
.page-cake.is-holding .flame-lottie {
  transform: translateX(-50%) translateY(2px) scale(0.995);
}

.page-cake.is-cake-lottie-unavailable .cake-lottie,
.page-cake.is-flame-hidden .flame-lottie,
.page-cake.is-flame-lottie-unavailable .flame-lottie,
.page-cake.is-smoke-hidden .smoke-lottie,
.page-cake.is-smoke-lottie-unavailable .smoke-lottie {
  opacity: 0;
}

.page-cake.is-overblown .cake {
  animation: cake-fly-away 860ms cubic-bezier(0.22, 0.74, 0.36, 1) both;
}

.page-cake.is-cake-reset .cake {
  animation: cake-drop-in 760ms cubic-bezier(0.2, 0.82, 0.22, 1.18) both;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
