@font-face {
  font-family: Birthday Round;
  src: url("../assets/fonts/birthday-round.woff2") format("woff2");
  font-display: swap;
}
:root {
  color-scheme: light;
  --ink: #654044;
  --rose: #bf577d;
  --paper: #fff8f2;
  --edge: #f1b5c9;
  --cut: 16px;
  font-family: "Birthday Round", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color: var(--ink);
  background: #ffe4ef;
  -webkit-tap-highlight-color: transparent;
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse at 50% 43%, #fff1f2 0, #ffe4ef 58%, #f8c9da 117%);
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
button:focus-visible { outline: 3px solid #84455c; outline-offset: 5px; }
h1 { margin: 0; }
h1:focus { outline: none; }
.library { position: absolute; width: 0; height: 0; overflow: hidden; }
.wallpaper {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle, #fff6f4 1.65px, transparent 2.4px) 3px 8px / 24px 24px,
    repeating-linear-gradient(0deg, #e793b31c 0 15px, transparent 15px 30px),
    repeating-linear-gradient(90deg, #e793b31c 0 15px, transparent 15px 30px);
}
.wallpaper span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  transform: translate(-50%, -50%) rotate(var(--angle));
  opacity: .75;
}
.wallpaper span:nth-child(3n+1) svg,
.wallpaper span:nth-child(3n+2) svg { animation: drift 8s var(--delay) ease-in-out infinite; }
.wallpaper svg { display: block; width: 100%; }
.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  padding: 32px 19px 24px;
  padding: max(32px, env(safe-area-inset-top)) max(19px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(19px, env(safe-area-inset-left));
  display: grid;
  place-items: center;
}
.card {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 436px;
  min-height: 464px;
  height: min(74vh, 650px);
  height: clamp(464px, 75svh, 650px);
  height: clamp(464px, 75dvh, 650px);
  display: grid;
  border: 2px solid #9c6671;
  border-radius: 40px;
  background: #fff9f5;
  box-shadow: 0 8px 0 #e8a4bb, 0 18px 33px #ab567534, inset 0 0 0 6px #ffe1eb, inset 0 0 0 8px #f5b5cd;
}
.frame {
  pointer-events: none;
  position: absolute;
  inset: 14px;
  border: 1px dashed #e1a4b7;
  border-radius: 27px;
  background:
    radial-gradient(ellipse at 50% 52%, #ffe1eb 0%, #fff4f1 66%, transparent 92%);
  z-index: -1;
}
.card::before, .card::after {
  content: "";
  position: absolute;
  top: calc(50% - var(--cut) / 2);
  width: var(--cut);
  height: var(--cut);
  border: 1px solid #b67b87;
  border-radius: 50%;
  background: #ffe0eb;
  z-index: 2;
}
.card::before { left: calc(var(--cut) / -2); }
.card::after { right: calc(var(--cut) / -2); }
.seal {
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%) rotate(-6deg);
  width: 74px;
  background: #fff8f2;
  padding: 2px 7px 0;
  border: 1.5px solid #9c6671;
  border-radius: 21px;
  box-shadow: 0 3px #f0adc3;
  z-index: 3;
  pointer-events: none;
}
.seal svg { display: block; width: 100%; }
.scene {
  grid-area: 1 / 1;
  min-width: 0;
  display: grid;
  align-items: center;
  text-align: center;
  padding: 25px 21px 49px;
  animation: scene-in .48s both;
}
.scene.is-leaving { animation: scene-out .25s both; pointer-events: none; }
.composition { display: grid; justify-items: center; align-content: center; min-width: 0; }
.gift-composition { gap: 5px; }
.wish-composition { gap: 5px; }
.party-composition { gap: 8px; }
.cake-composition { gap: 1px; }
.art { display: block; width: 100%; height: auto; overflow: visible; }
.art-button {
  display: block;
  width: 100%;
  max-width: 365px;
  border: 0;
  background: none;
  border-radius: 29px;
  padding: 0;
}
.art-button:active:not([aria-disabled]) { transform: scale(.975); }
.gift { animation: gift-float 4s ease-in-out infinite; }
.gift-lid { transform-origin: 50% 52%; }
.is-opening .gift { animation: gift-open .75s both; }
.is-opening .gift-lid { animation: lid-open .74s both; }
.gift-label { pointer-events: auto; cursor: pointer; }
.pill {
  display: inline-grid;
  place-items: center;
  min-height: 46px;
  max-width: 100%;
  padding: 9px 16px;
  border: 1.5px solid #a46376;
  border-radius: 999px;
  font-size: clamp(14px, 4.35vw, 20px);
  line-height: 1.25;
  font-weight: 700;
  color: #783d52;
  background: #fff8f2;
  box-shadow: 0 4px 0 #eca5bd;
}
.action {
  background: #ffbed4;
  box-shadow: 0 4px 0 #dc8ba8, inset 0 2px 0 #ffe2e9;
  transition: transform .16s, box-shadow .16s;
}
.action:active { transform: translateY(3px) scale(.98); box-shadow: 0 1px 0 #dc8ba8; }
.bubble {
  position: relative;
  z-index: 1;
  color: var(--rose);
  letter-spacing: .055em;
  font-size: clamp(33px, 9vw, 57px);
  line-height: 1.14;
  font-weight: 900;
  text-shadow: 2px 0 #fff8f2, -2px 0 #fff8f2, 0 2px #fff8f2, 0 -2px #fff8f2, 0 5px #edacc3;
  -webkit-text-stroke: 7px #fff8f2;
  paint-order: stroke fill;
}
.wish-title { animation: title-in .66s .1s both; }
.wish-title span { display: block; font-size: .78em; margin-top: .12em; color: #9e4860; }
.wish-art { max-width: 308px; }
.pop-art { animation: wobble 4.4s ease-in-out infinite; transform-origin: 51% 75%; }
.is-charging .pop-art { animation: charge .42s both; }
.is-revealed .party-button { width: 63%; max-width: 191px; margin-top: 0; cursor: default; pointer-events: none; }
.is-revealed .pop-art { animation: appeared .5s both; }
.is-revealed .confession { grid-row: 1; }
.confession { font-size: clamp(51px, 13vw, 74px); margin-bottom: 2px; animation: confession-in .72s cubic-bezier(.18,.72,.28,1.15) both; }
.party-next { animation: appeared .33s both; }
.cake-title { font-size: clamp(32px, 8.6vw, 49px); }
.cake-art { max-width: 364px; animation: cake-float 5.4s ease-in-out infinite; }
.cake-footer { display: flex; align-items: center; gap: 7px; }
.cake-footer svg { width: 13px; }
.cake-footer svg:nth-child(2) { width: 31px; }
.flame { transform-box: fill-box; transform-origin: 50% 90%; animation: flame 1.85s ease-in-out infinite alternate; }
.flame-side { animation-delay: -.7s; }
.progress {
  display: flex;
  gap: 9px;
  position: absolute;
  left: 50%;
  bottom: 27px;
  transform: translateX(-50%);
}
.progress i { width: 7px; height: 7px; border-radius: 50%; background: #e9b5c5; }
[data-act="1"] i:nth-child(1), [data-act="2"] i:nth-child(2),
[data-act="3"] i:nth-child(3), [data-act="4"] i:nth-child(4) { background: #b75378; box-shadow: 0 0 0 3px #f5cedb; }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 5; pointer-events: none; }
.noscript { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; padding: 10px; text-align: center; background: #fff8f2; }
@keyframes drift { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes scene-in { from { opacity: 0; transform: scale(.967) translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes scene-out { to { opacity: 0; transform: scale(.974) translateY(-3px); } }
@keyframes gift-float { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(1deg); } }
@keyframes gift-open { 0% { transform: none; } 23% { transform: translateY(4px) scale(.96, 1.04); } 56% { transform: translateY(-9px) scale(1.03, .98); } 100% { transform: none; } }
@keyframes lid-open { 0%, 20% { transform: none; } 65% { transform: translate(-19px, -66px) rotate(-22deg); } 100% { opacity: 0; transform: translate(-33px, -83px) rotate(-31deg); } }
@keyframes title-in { 0% { opacity: 0; transform: translateY(13px) scale(.85); } 66% { opacity: 1; transform: translateY(-2px) scale(1.04); } 100% { transform: none; } }
@keyframes wobble { 0%, 70%, 100% { transform: rotate(0); } 78% { transform: rotate(-4deg); } 87% { transform: rotate(4deg); } }
@keyframes charge { 0% { transform: none; } 45% { transform: translateY(8px) scale(.91, 1.07) rotate(-5deg); } 76% { transform: translateY(-10px) scale(1.05) rotate(5deg); } 100% { transform: none; } }
@keyframes confession-in { 0% { opacity: 0; transform: rotate(-14deg) scale(.27); } 57% { opacity: 1; transform: rotate(4deg) scale(1.13); } 78% { transform: rotate(-2deg) scale(.97); } 100% { transform: none; } }
@keyframes appeared { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes cake-float { 0%, 100% { transform: translateY(2px); } 50% { transform: translateY(-5px); } }
@keyframes flame { 0%, 100% { transform: scale(1) skewX(-2deg); } 33% { transform: scale(.85, 1.05) skewX(4deg); } 71% { transform: scale(1.1, .91) skewX(-4deg); } }
@media (max-width: 550px) {
  .wallpaper span { width: calc(var(--size) * .72); opacity: .65; }
  .wallpaper .d0 { left: 15%; top: 5%; }
  .wallpaper .d1 { left: 88%; top: 7%; }
  .wallpaper .d7 { left: 70%; top: 3.7%; }
  .wallpaper .d8 { top: 92%; }
  .wallpaper .d9 { top: 92%; left: 83%; }
  .wallpaper .d2 { left: 2%; top: 71%; }
  .wallpaper .d3 { left: 98%; top: 67%; }
}
@media (max-height: 640px) {
  .card { min-height: 420px; height: min(83vh, 530px); height: clamp(420px, 83dvh, 530px); }
  .wallpaper .d8, .wallpaper .d9 { top: 96%; }
  .scene { padding-top: 20px; padding-bottom: 41px; }
  .wish-art { max-width: 250px; }
  .cake-art { max-width: 290px; }
  .progress { bottom: 23px; }
}
@media (min-width: 950px) {
  .card { max-width: 490px; }
  .wallpaper span { width: calc(var(--size) * 1.23); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}