@font-face {
  font-family: "Jason Handwriting";
  src: url("assets/fonts/JasonHandwriting1.ttf") format("truetype");
  font-display: swap;
  font-weight: 400 900;
}

:root {
  --pink: #f5b9ca;
  --pink-deep: #dd789a;
  --pink-pale: #fff3f6;
  --mint: #bde8d5;
  --mint-deep: #67ac91;
  --ink: #6f4f5b;
  --cream: #fffaf8;
}

* { box-sizing: border-box; }
button,input,textarea { font-family:inherit; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Jason Handwriting", "STXingkai", "华文行楷", cursive;
  overflow-x: hidden;
  background-color: var(--mint);
  background-image:
    radial-gradient(circle, rgba(255,255,255,.78) 0 5px, transparent 6px),
    radial-gradient(circle, rgba(244,174,195,.48) 0 3px, transparent 4px);
  background-position: 0 0, 28px 28px;
  background-size: 56px 56px;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  filter: blur(1px);
  opacity: .72;
}

body::before {
  width: 360px;
  height: 360px;
  left: -140px;
  top: -120px;
  background: var(--pink);
}

body::after {
  width: 300px;
  height: 300px;
  right: -110px;
  bottom: -100px;
  background: #f8d4df;
}

.page-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 36px 18px;
}

.question-card {
  position: relative;
  width: min(600px, 100%);
  padding: 48px 56px 40px;
  text-align: center;
  border: 3px solid rgba(255,255,255,.9);
  border-radius: 42px;
  background: rgba(255,250,248,.94);
  box-shadow: 0 20px 55px rgba(87,139,119,.22), 0 7px 0 rgba(255,255,255,.64);
}

.intro-card { position:relative;width:min(520px,100%);height:520px;display:grid;place-items:center;background:transparent; }
.birthday-cake { position:relative;width:390px;height:410px;margin:0;transform:scale(.896); }
.birthday-cake-photo { position:absolute;z-index:2;left:50%;top:88px;width:390px;height:310px;object-fit:contain;transform:translateX(-50%);filter:drop-shadow(0 18px 18px rgba(97,72,83,.18));user-select:none;pointer-events:none; }
.candle-button { position:absolute;z-index:6;left:50%;top:3px;width:72px;height:130px;padding:0;border:0;background:none;transform:translateX(-50%);cursor:pointer; }
.intro-candle { position:absolute;left:19px;bottom:0;width:34px;height:72px;padding-top:22px;border-radius:9px 9px 3px 3px;color:white;background:repeating-linear-gradient(135deg,#ffe799 0 9px,#f4a9bd 9px 18px);font:800 14px "Trebuchet MS",sans-serif;box-shadow:inset -4px 0 rgba(193,116,137,.13); }
.wick { position:absolute;left:34px;top:30px;width:3px;height:17px;border-radius:3px;background:#74525f; }
.intro-flame { position:absolute;z-index:2;left:25px;top:0;width:23px;height:35px;border-radius:70% 30% 65% 35%;background:linear-gradient(#fff8b8,#ffc65e 55%,#f49a68);transform:rotate(8deg);animation:big-flicker .85s ease-in-out infinite alternate; }
.glow { position:absolute;left:13px;top:-12px;width:48px;height:55px;border-radius:50%;background:rgba(255,205,111,.34);filter:blur(8px);animation:glow 1s ease-in-out infinite alternate; }
.smoke { position:absolute;left:30px;top:-4px;width:13px;height:45px;border-radius:50%;opacity:0;background:rgba(166,177,172,.55);filter:blur(5px); }
.cake-top { position:absolute;z-index:4;left:43px;top:124px;width:224px;height:50px;border-radius:50%;background:#fff1a8;border:5px solid white;box-shadow:0 7px 0 #f0cd72; }
.cake-top span{position:absolute;display:block;width:15px;height:15px;color:#ef86aa;font:900 15px/1 "Arial Rounded MT Bold","Arial Rounded MT",sans-serif;filter:drop-shadow(0 1px 0 rgba(255,255,255,.8));transform:rotate(-8deg)}
.cake-top span::before{content:"★";display:block;-webkit-text-stroke:1.3px currentColor;paint-order:stroke fill;transform:scale(.88);filter:blur(.08px)}
.cake-top span:nth-child(1){left:15px;top:9px;color:#ef86aa;transform:rotate(-18deg) scale(.82)}
.cake-top span:nth-child(2){left:55px;top:6px;color:#7ccbb0;transform:rotate(13deg) scale(.72)}
.cake-top span:nth-child(3){left:98px;top:8px;color:#a99cdb;transform:rotate(-9deg) scale(.9)}
.cake-top span:nth-child(4){left:140px;top:6px;color:#ff9f72;transform:rotate(19deg) scale(.76)}
.cake-top span:nth-child(5){left:182px;top:9px;color:#79b9df;transform:rotate(-15deg) scale(.86)}
.cake-top span:nth-child(6){left:34px;top:19px;color:#ffd05e;transform:rotate(12deg) scale(.7)}
.cake-top span:nth-child(7){left:76px;top:20px;color:#ef86aa;transform:rotate(-14deg) scale(.88)}
.cake-top span:nth-child(8){left:118px;top:18px;color:#8ac8a8;transform:rotate(17deg) scale(.74)}
.cake-top span:nth-child(9){left:160px;top:20px;color:#a99cdb;transform:rotate(-8deg) scale(.92)}
.cake-top span:nth-child(10){left:199px;top:18px;color:#ff9f72;transform:rotate(14deg) scale(.68)}
.cake-top span:nth-child(11){left:16px;top:30px;color:#79b9df;transform:rotate(8deg) scale(.7)}
.cake-top span:nth-child(12){left:57px;top:29px;color:#ff9f72;transform:rotate(-16deg) scale(.84)}
.cake-top span:nth-child(13){left:99px;top:31px;color:#ffd05e;transform:rotate(11deg) scale(.72)}
.cake-top span:nth-child(14){left:142px;top:29px;color:#ef86aa;transform:rotate(-10deg) scale(.9)}
.cake-top span:nth-child(15){left:184px;top:31px;color:#7ccbb0;transform:rotate(16deg) scale(.75)}
.cake-layer { position:absolute;left:43px;width:224px; }.cake-layer.upper{z-index:3;top:149px;height:67px;border-radius:0 0 25px 25px;background:#ffe28a}.cake-layer.lower{z-index:1;top:202px;height:70px;border-radius:0 0 32px 32px;background:var(--pink)}
.cake-bow { position:absolute;left:105px;top:22px;width:16px;height:16px;border:3px double #fff;border-radius:50%;background:#fffdf8;font-size:0;filter:drop-shadow(0 2px 1px rgba(196,151,72,.24)); }
.cake-bow::before,.cake-bow::after{content:"";position:absolute;top:-8px;width:37px;height:29px;border:5px double #fff;border-radius:68% 38% 64% 42%;background:rgba(255,255,255,.12)}
.cake-bow::before{right:10px;transform:rotate(12deg)}.cake-bow::after{left:10px;transform:scaleX(-1) rotate(12deg)}
.cake-lace { position:absolute;z-index:4;left:42px;top:196px;width:226px;height:27px;background:radial-gradient(circle at 13px -1px,transparent 13px,white 14px 18px,transparent 19px) 0 0/28px 28px repeat-x; }
.cake-plate { position:absolute;left:20px;top:259px;width:270px;height:25px;border-radius:50%;background:#fff;box-shadow:0 7px 0 #aadbc7,0 13px 18px rgba(77,125,106,.16); }
.candle-out .intro-flame,.candle-out .glow{animation:none;opacity:0;transform:translateY(-8px) scale(.2);transition:.55s ease}.candle-out .smoke{animation:smoke-up 2.1s ease-out both}.intro-card.leaving{animation:page-leave .43s ease both}.page-arrive{animation:page-arrive .48s ease both}
@keyframes big-flicker{from{transform:rotate(3deg) scale(.93)}to{transform:rotate(13deg) scale(1.07)}}@keyframes glow{to{transform:scale(1.18);opacity:.6}}@keyframes smoke-up{0%{opacity:0;transform:translateY(12px) scale(.4)}25%{opacity:.7}100%{opacity:0;transform:translate(-10px,-60px) scale(1.8)}}@keyframes page-leave{to{opacity:0;transform:scale(.94) translateY(-15px)}}@keyframes page-arrive{from{opacity:0;transform:translateY(22px) scale(.96)}to{opacity:1;transform:none}}

.mini-dots {
  position: absolute;
  top: 26px;
  right: 30px;
  display: flex;
  gap: 7px;
}

.mini-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--pink);
}

.mini-dots i:nth-child(2) { background: var(--mint); }

.eyebrow {
  margin: 0 0 16px;
  color: var(--mint-deep);
  font-size: 12px;
  font-weight: 800;
  font-family: "Trebuchet MS", sans-serif;
  letter-spacing: .28em;
}

.cake {
  position: relative;
  width: 146px;
  height: 120px;
  margin: 0 auto 23px;
  filter: drop-shadow(0 8px 7px rgba(196,128,147,.16));
}

.candle {
  position: absolute;
  z-index: 2;
  top: 15px;
  left: 54px;
  width: 38px;
  height: 45px;
  padding-top: 9px;
  border-radius: 12px 12px 4px 4px;
  color: white;
  font-weight: 900;
  background: repeating-linear-gradient(135deg,#bce8d5 0 8px,#78c5a7 8px 16px);
  box-shadow: inset -3px 0 rgba(61,132,104,.12),0 2px 0 rgba(255,255,255,.8);
}

.flame {
  position: absolute;
  z-index: 3;
  left: 66px;
  top: -5px;
  width: 15px;
  height: 23px;
  border-radius: 70% 30% 60% 40%;
  background: #ffd170;
  transform: rotate(12deg);
  animation: flicker 1.25s ease-in-out infinite alternate;
}

.icing, .base { position: absolute; left: 0; width: 146px; }
.base { bottom: 0; height: 61px;border:3px solid #fff8df;border-radius:13px 13px 30px 30px;background:linear-gradient(90deg,#f6b4c8 0 50%,#ffe69a 50%);box-shadow:inset 0 -9px rgba(255,255,255,.2);overflow:hidden; }
.base::before { content:"";position:absolute;inset:9px 8px;background:radial-gradient(circle,#fff8df 0 3px,transparent 3.5px) 0 0/24px 20px;opacity:.92; }
.base::after { content:"୨୧";position:absolute;left:50%;top:16px;transform:translateX(-50%);color:white;font:900 29px/1 Georgia,serif;text-shadow:0 2px 0 rgba(216,145,164,.2); }
.icing { z-index:1;bottom:44px;height:27px;border:3px solid #fff8df;border-radius:50%;background:#fffdf4;box-shadow:0 7px 0 #f3c0ce; }
.icing::after { content:"";position:absolute;left:5px;right:5px;bottom:-14px;height:18px;background:radial-gradient(circle at 9px 0,#fffdf4 0 9px,transparent 9.5px) 0 0/22px 18px repeat-x; }


.question-copy h1 {
  max-width: 100%;
  margin: 0;
  color: var(--pink-deep);
  font-family: "Jason Handwriting", "STXingkai", "华文行楷", cursive;
  font-size: clamp(29px, 6vw, 42px);
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.question-copy p {
  margin: 10px 0 30px;
  color: #98808a;
  font-family: Georgia, serif;
  font-size: clamp(16px, 3vw, 20px);
  font-style: italic;
  letter-spacing: .02em;
}

form { display: grid; gap: 13px; }

.name-field { display:grid;align-items:center;min-height:58px;padding:8px 18px;border:5px solid #fff0bd;outline:2px dotted #e9c36d;outline-offset:-7px;border-radius:22px;background:#fff5f8;box-shadow:0 5px 0 #eccb81;color:#d66f91; }
.name-field input { min-width:0;width:100%;padding:9px 12px;border:0;outline:0;background:transparent;color:#b95679;text-align:center;font:italic 16px Georgia,serif; }
.name-field input::placeholder { color:#bba5ad;opacity:1; }
.name-field:focus-within { border-color:#ffe5a0;box-shadow:0 5px 0 #eccb81,0 0 0 4px rgba(239,158,184,.16); }

.date-button, .continue-button {
  width: 100%;
  min-height: 62px;
  border-radius: 20px;
  transition: transform .18s ease, box-shadow .18s ease;
}

.date-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 2px solid #f3b3c6;
  color: #bd6784;
  font-weight: 700;
  cursor: pointer;
  background: #fde3eb;
  box-shadow: inset 0 -4px 0 rgba(221,120,154,.13);
}

.date-button:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(221,120,154,.16); }
.date-button:focus-visible { outline: 4px solid rgba(103,172,145,.22); }
.heart { font-size: 24px; }
.chevron { position: absolute; right: 22px; font-size: 22px; transition: transform .2s ease; }
.date-button[aria-expanded="true"] .chevron { transform: rotate(180deg); }

.age-panel {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 9px;
  padding: 16px;
  border: 2px solid #f3b3c6;
  border-radius: 20px;
  background: #fff7f9;
  box-shadow: 0 10px 25px rgba(221,120,154,.12);
}

.age-panel[hidden] { display: none; }

.age-option {
  aspect-ratio: 1;
  border: 1.5px solid #f0b3c5;
  border-radius: 14px;
  color: #b65f7d;
  font: 800 17px "Jason Handwriting", "STXingkai", "华文行楷", cursive;
  cursor: pointer;
  background: #fde3eb;
  box-shadow: 0 3px 0 #efb1c3;
  transition: transform .15s ease, background .15s ease, color .15s ease;
}

.age-option:hover { transform: translateY(-2px); background: #f8cada; }
.age-option:focus-visible { outline: 3px solid rgba(103,172,145,.35); }
.age-option.selected { color: white; border-color: var(--mint-deep); background: var(--mint-deep); box-shadow: 0 3px 0 #4c8f76; }

.continue-button {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  padding: 10px 20px;
  border: 0;
  color: white;
  cursor: pointer;
  background: var(--pink-deep);
  box-shadow: 0 6px 0 #bd5f80;
}

.continue-button span { grid-column: 1; font-size: 18px; font-weight: 800; }
.continue-button span,.continue-button small { font-family:"Trebuchet MS",sans-serif; }
.continue-button small { grid-column: 1; font-size: 9px; letter-spacing: .18em; opacity: .8; }
.continue-button b { grid-column: 2; grid-row: 1 / span 2; font-size: 24px; }
.continue-button:hover { transform: translateY(-2px); box-shadow: 0 8px 0 #bd5f80; }
.continue-button:active { transform: translateY(4px); box-shadow: 0 2px 0 #bd5f80; }

.note { margin: 25px 0 2px; color: var(--mint-deep); font-size: 13px; font-weight: 700; }
.note-en { margin: 0; color: #a7999f; font: italic 11px Georgia, serif; }

/* Soft buttercream lace treatment for the age page */
#age-screen {
  border: 8px solid #fff0bd;
  outline: 3px dotted #efcd7c;
  outline-offset: -13px;
  box-shadow: 0 20px 55px rgba(87,139,119,.16), 0 8px 0 #f5d994, 0 14px 28px rgba(215,171,85,.14);
}

#age-screen::before {
  content: "";
  position: absolute;
  inset: 9px;
  z-index: 0;
  pointer-events: none;
  border: 2px dashed rgba(244,208,125,.75);
  border-radius: 28px;
}

#age-screen > * { position: relative; z-index: 1; }

#age-screen .date-button,
#age-screen .continue-button {
  border: 6px solid #fff0bd;
  outline: 2px dotted #e9c36d;
  outline-offset: -8px;
  border-radius: 25px;
  box-shadow: 0 6px 0 #eccb81, 0 11px 22px rgba(218,173,88,.13);
}

#age-screen .date-button:hover,
#age-screen .continue-button:hover {
  box-shadow: 0 8px 0 #eccb81, 0 14px 25px rgba(218,173,88,.16);
}

#age-screen .continue-button:active { box-shadow: 0 2px 0 #eccb81; }

#age-screen .age-panel {
  position: relative;
  padding: 25px 16px 18px;
  border: 6px solid #fff0bd;
  outline: 2px dotted #edc975;
  outline-offset: -8px;
  border-radius: 24px;
  background: #fffdfd;
  box-shadow: 0 10px 24px rgba(217,164,84,.14);
}

#age-screen .age-option {
  color: #d66f91;
  border: 2px solid #f7d9a1;
  background: #fff;
  box-shadow: 0 3px 0 #f2d491;
}

#age-screen .age-option:hover {
  color: #bc5779;
  background: #fff3f7;
  border-color: #f1b8ca;
}

#age-screen .age-option.selected {
  color: #c45e80;
  border-color: #efabc1;
  background: #fde3eb;
  box-shadow: 0 3px 0 #efb6c8;
}

.toast {
  position: fixed;
  z-index: 5;
  left: 50%;
  bottom: 25px;
  padding: 12px 22px;
  border-radius: 999px;
  color: white;
  background: var(--mint-deep);
  opacity: 0;
  transform: translate(-50%, 20px);
  transition: .25s ease;
  pointer-events: none;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

[hidden] { display: none !important; }
.wishes-stage { position:relative; width:min(650px,100%); }
.prompt-card,.success-card { position:relative; padding:48px 54px 42px; border:3px solid rgba(255,255,255,.9); border-radius:42px; background:rgba(255,250,248,.96); box-shadow:0 20px 55px rgba(87,139,119,.22),0 7px 0 rgba(255,255,255,.64); }
.prompt-card::before,.prompt-card::after { content:""; position:absolute; width:22px; height:22px; border-radius:50%; background:var(--pink); opacity:.55; }
.prompt-card::before { top:25px;left:28px; }.prompt-card::after { right:28px;bottom:25px;background:var(--mint); }
.step { margin:0 0 13px; color:var(--mint-deep); font-size:12px; font-weight:900; letter-spacing:.2em; }
.prompt-card h2,.success-card h2 { margin:0; color:var(--pink-deep); font-family:"Jason Handwriting","STXingkai","华文行楷",cursive; font-size:clamp(30px,5vw,42px); }
.question-en { margin:7px 0 28px; color:#99808a; font:italic 17px Georgia,serif; }
.prompt-card label { display:block; margin:0 0 9px; color:var(--mint-deep); font-weight:800; }
textarea { display:block; width:100%; min-height:220px; resize:vertical; padding:20px; border:2px solid #f3b3c6; border-radius:22px; outline:0; color:var(--ink); background:#fff7f9; font:19px/1.7 "Jason Handwriting","STXingkai","华文行楷",cursive; box-shadow:inset 0 3px 9px rgba(221,120,154,.08); }
textarea:focus { border-color:var(--mint-deep); box-shadow:0 0 0 4px rgba(103,172,145,.17); }
.field-footer { display:flex; justify-content:space-between; margin:9px 5px 17px; color:#b98295; font-size:12px; }
.text-back { padding:0;border:0;color:var(--mint-deep);font-weight:800;background:none;cursor:pointer; }
.bow { position:absolute; z-index:2; color:var(--pink-deep); font:700 58px Georgia,serif; text-shadow:0 3px 0 white; }
.bow-left { left:-31px;top:-35px;transform:rotate(-13deg); }.bow-right { right:-30px;bottom:-36px;transform:rotate(15deg); }
.success-card { width:min(560px,100%);min-height:260px;display:grid;place-items:center;text-align:center;animation:success-reveal 1.8s ease both; }
.success-card h2 { animation:success-text-reveal 2s .45s ease both; }
.success-card p { color:#917985;font:italic 18px Georgia,serif; }.success-card small { color:var(--mint-deep);font-weight:800; }
@keyframes success-reveal { from{opacity:0;transform:scale(.96);filter:blur(8px)} to{opacity:1;transform:none;filter:blur(0)} }
@keyframes success-text-reveal { from{opacity:0;transform:translateY(14px);letter-spacing:.12em} to{opacity:1;transform:none;letter-spacing:normal} }
.continue-button:disabled { opacity:.65;cursor:wait; }
@keyframes flicker { from { transform: rotate(6deg) scale(.95); } to { transform: rotate(16deg) scale(1.08); } }

@media (max-width: 560px) {
  .question-card { padding: 42px 22px 32px; border-radius: 30px; }
  .cake { transform: scale(.9); margin-bottom: 12px; }
  .date-button, .continue-button { min-height: 58px; }
  .age-panel { grid-template-columns: repeat(4, 1fr); gap: 7px; padding: 12px; }
  .prompt-card,.success-card { padding:40px 22px 32px;border-radius:30px; }
  textarea { min-height:190px; }
  .bow { font-size:45px; }.bow-left{left:-8px}.bow-right{right:-8px}
  .intro-card{height:440px}.birthday-cake{transform:scale(.704)}
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
