/* Layout: one full-screen scene at a time over a sky backdrop (Toy Story cloud wallpaper by day, starry sky by night).
   Cream paper surfaces carry the reading moments; the 3D Lotso lives in a .lotso-spot inside each scene. */
:root {
  color-scheme: dark;
  --night: #0a1a3a;
  --deep: #14316b;
  --day-top: #3a86e0;
  --day-bot: #9ccfff;
  --sky: #2f6fd8;
  --ice: #dcecff;
  --mist: #93b6e6;
  --berry: #3f4fc4;
  --lotso: #e0508a;
  --lotso-dark: #b03a6c;
  --cream: #fff7ea;
  --ink: #1b2547;
  --ink-soft: #55607f;
  --display: "Fredoka", "PingFang HK", "Microsoft JhengHei", "Noto Sans HK", sans-serif;
  --body: "Nunito", "PingFang HK", "Microsoft JhengHei", "Noto Sans HK", sans-serif;
  --cjk: "PingFang HK", "Microsoft JhengHei", "Noto Sans HK", "Heiti TC", sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
:root { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
[hidden] { display: none !important; }
img { max-width: 100%; }
body {
  margin: 0; background: var(--night); color: #fff;
  font-family: var(--body); font-size: 16px; line-height: 1.6;
  overflow: hidden; -webkit-tap-highlight-color: transparent;
}

/* ---------- backdrops ---------- */
.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; transition: opacity 1s ease; }
#sky-night { background: radial-gradient(120% 80% at 50% 0%, var(--deep) 0%, var(--night) 65%); }
#sky-day { background: linear-gradient(var(--day-top), var(--day-bot)); opacity: 0; }
body[data-sky="day"] #sky-day { opacity: 1; }
body[data-sky="day"] #sky-night { opacity: 0; }
.star { position: absolute; border-radius: 50%; background: var(--ice); opacity: .55; animation: twinkle 3s ease-in-out infinite; }
@keyframes twinkle { 50% { opacity: .12; transform: scale(.6); } }
.shoot { position: absolute; width: 120px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, rgba(255,255,255,0), #fff);
  transform: rotate(-28deg); animation: shoot 1.1s ease-out forwards; }
@keyframes shoot { from { opacity: 0; translate: 0 0; } 15% { opacity: 1; } to { opacity: 0; translate: -340px 180px; } }
/* Toy Story style wallpaper clouds: flat, puffy, white with a soft blue underside */
.cloud { position: absolute; width: 200px; height: 80px; animation: drift linear infinite; filter: drop-shadow(0 6px 0 rgba(120,170,230,.35)); }
.cloud i { position: absolute; background: #fff; border-radius: 50%; }
@keyframes drift { from { transform: translateX(-260px) scale(var(--s, 1)); } to { transform: translateX(calc(100vw + 60px)) scale(var(--s, 1)); } }

/* ---------- cloud curtain transition (like turning a storybook page) ---------- */
#curtain { position: fixed; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; }
#curtain .half { position: absolute; top: -10%; bottom: -10%; width: 70%; }
#curtain .left { left: 0; transform: translateX(-170%); }
#curtain .right { right: 0; transform: translateX(170%); }
#curtain .puff { position: absolute; border-radius: 50%; background: #fff; box-shadow: inset 0 -14px 0 rgba(150,190,240,.35); }
#curtain.busy { pointer-events: auto; }

/* ---------- chrome ---------- */
#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }
#mute {
  position: fixed; z-index: 55; top: calc(12px + env(safe-area-inset-top, 0px)); right: calc(12px + env(safe-area-inset-right, 0px));
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35);
  background: rgba(10,26,58,.45); color: #fff; font-size: 18px; cursor: pointer;
}
#mute[aria-pressed="true"] { opacity: .5; text-decoration: line-through; }
#progress { position: fixed; z-index: 55; left: 50%; transform: translateX(-50%); top: calc(26px + env(safe-area-inset-top, 0px)); display: flex; gap: 5px; }
#progress i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.3); transition: background .3s, width .3s; }
#progress i.on { background: var(--lotso); width: 16px; border-radius: 4px; }
#progress i.done { background: rgba(255,255,255,.75); }

/* ---------- scenes ---------- */
#app { position: relative; height: 100%; z-index: 2; }        /* page content sits above the 3D layer (z-index 1) */
.scene {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; align-items: center;
  padding-block: 64px 36px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.scene > .inner { width: 100%; max-width: 440px; margin: auto 0; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
h1, h2 { font-family: var(--display); font-weight: 600; line-height: 1.2; margin: 0; text-wrap: balance; text-shadow: 0 2px 0 rgba(20,49,107,.35); }
h1 { font-size: clamp(28px, 8vw, 40px); }
h2 { font-size: clamp(22px, 6.2vw, 30px); }
.cjk { font-family: var(--cjk); font-weight: 700; }
.lead { margin: 0; color: #eef6ff; font-size: 15px; max-width: 34ch; text-wrap: balance; text-shadow: 0 1px 0 rgba(20,49,107,.3); }
body[data-sky="night"] .lead { color: var(--mist); text-shadow: none; }
/* by day, white text can drift over white clouds: a soft blue halo keeps it readable */
body[data-sky="day"] :is(h1, h2, .lead, .round-tag, .sentence, .score, .eta, .tap-hint) {
  color: #fff; text-shadow: 0 1px 2px rgba(20,60,140,.7), 0 0 10px rgba(30,90,180,.55), 0 0 2px rgba(20,60,140,.6);
}
.hi { color: #ffb3d1; }
.round-tag { font-family: var(--display); color: rgba(255,255,255,.85); font-size: 13px; letter-spacing: .1em; margin: 0; }
.tap-hint { font-size: 14px; color: rgba(255,255,255,.8); animation: pulse 1.6s ease-in-out infinite; margin: 0; }
@keyframes pulse { 50% { opacity: .45; } }
.btn {
  font: 800 16px/1 var(--body); letter-spacing: .02em; padding: 14px 26px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--lotso); color: #fff; box-shadow: 0 6px 0 var(--lotso-dark), 0 10px 24px rgba(224,80,138,.35);
  transition: transform .12s, box-shadow .12s; touch-action: manipulation; text-decoration: none; display: inline-block;
}
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--lotso-dark); }
.btn.ghost { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.5); }
.btn.blue { background: var(--sky); box-shadow: 0 6px 0 #1d4c9e, 0 10px 24px rgba(47,111,216,.35); }
.btn:disabled { opacity: .4; pointer-events: none; }
:focus-visible { outline: 3px solid #ffd54a; outline-offset: 3px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.paper { background: var(--cream); color: var(--ink); border-radius: 22px; box-shadow: 0 14px 30px rgba(10,26,58,.3); }

/* with the 3D world on, its own clouds and stars replace the flat CSS ones */
body:not(.no3d) #sky-night .star, body:not(.no3d) #sky-day .cloud { display: none; }

/* ---------- Lotso spot + speech bubble ----------
   The spot is an empty placeholder: the 3D Lotso stands on it (feet at its bottom, hat at its top). */
.lotso-spot { position: relative; width: 200px; height: 240px; flex: none; margin-top: 34px; }   /* room above for the speech bubble */
.lotso-spot.big { width: min(290px, 72vw); height: min(330px, 40vh); }
.lotso-spot.small { width: 165px; height: 195px; }
.lotso-spot .bubble {
  position: absolute; left: 50%; bottom: calc(100% - 14px); transform: translateX(-50%); z-index: 2;
  width: max-content; max-width: min(250px, 80vw); padding: 8px 14px; border-radius: 18px;
  background: #fff; color: var(--ink); font: 700 15px/1.45 var(--cjk); box-shadow: 0 6px 16px rgba(10,26,58,.22);
  transition: opacity .25s;
}
.lotso-spot .bubble::after { content: ""; position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); border: 10px solid transparent; border-top-color: #fff; border-bottom: 0; }
.lotso-spot .bubble:empty { opacity: 0; }
.lotso-spot.bubble-left .bubble { left: auto; right: 62%; transform: none; }
.lotso-spot.bubble-left .bubble::after { left: auto; right: 14px; transform: none; }
.lotso-spot .lotso-canvas { position: absolute; inset: 0; }
.with-lotso { display: flex; align-items: flex-end; justify-content: center; gap: 0; width: 100%; }

/* ---------- chapter card (shown on the closed cloud curtain) ---------- */
#chapter { position: fixed; inset: 0; z-index: 62; display: grid; place-items: center; pointer-events: none; perspective: 700px; }
#chapter .ch-card { opacity: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 34px 20px; border-radius: 22px;
  background: rgba(255,255,255,.92); color: var(--ink); box-shadow: 0 18px 40px rgba(30,70,150,.25), inset 0 0 0 3px #dcebff; transform-origin: 50% 100%; }
#chapter small { font: 600 14px var(--display); letter-spacing: .18em; color: var(--sky); }
#chapter b { font-size: 28px; color: var(--berry); letter-spacing: .06em; }

/* ---------- start ---------- */
.start-dim { --r: 210px; }
.start-tip { position: relative; z-index: 5; margin: 0; color: #f3e6c8; font-size: 16px; line-height: 1.7; text-shadow: 0 0 12px rgba(255,200,90,.35); }
.start-btn { position: relative; z-index: 5; }

/* ---------- 0 · opening ---------- */
.name-stars { width: 100%; height: clamp(96px, 16vh, 140px); display: block; }
.gift { position: relative; width: 170px; height: 120px; cursor: pointer; border: 0; background: none; padding: 0; }
.gift .body { position: absolute; inset: 22px 8px 0; background: linear-gradient(var(--sky), var(--berry)); border-radius: 8px 8px 14px 14px; }
.gift .lid { position: absolute; left: 0; right: 0; top: 0; height: 34px; background: linear-gradient(#5b93ee, var(--sky)); border-radius: 8px; transition: transform .6s cubic-bezier(.3,1.6,.5,1), opacity .5s .3s; transform-origin: 20% 100%; }
.gift .rib { position: absolute; left: 50%; top: 0; bottom: 0; width: 24px; transform: translateX(-50%); background: var(--lotso); }
.gift .bow { position: absolute; left: 50%; top: -26px; transform: translateX(-50%); font-size: 38px; line-height: 1; }
.gift.wiggle { animation: wiggle 2.4s ease-in-out infinite; }
@keyframes wiggle { 0%,80%,100% { transform: rotate(0); } 85% { transform: rotate(-4deg); } 90% { transform: rotate(4deg); } 95% { transform: rotate(-2deg); } }
.gift.open .lid { transform: translate(-30px,-90px) rotate(-35deg); opacity: 0; }

/* ---------- 1 · cake ---------- */
/* lights off: only a warm pool of candlelight around the flame; the blow button stays readable above it */
.dim { position: absolute; left: 0; top: 0; width: 100%; height: max(100%, var(--h, 100%)); z-index: 3; pointer-events: none;
  background: radial-gradient(circle var(--r, 190px) at var(--x, 50%) var(--y, 40%),
    rgba(255,190,90,.08) 0%, rgba(40,24,10,.14) 30%, rgba(4,8,22,.5) 62%, rgba(2,5,16,.72) 100%);
  transition: opacity 1.4s ease; }
.dim.off { opacity: 0; }
.flash { position: absolute; inset: 0; z-index: 4; pointer-events: none; background: #fff6dd; opacity: 0; }
.scene[data-scene="cake"] .blow, .scene[data-scene="cake"] #cakeNext { position: relative; z-index: 5; }
.cake-stage { position: relative; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.cake-stage svg { width: min(250px, 52vw); display: block; overflow: visible; flex: none; }
.cake-stage .lotso-spot { margin-left: -12px; }
#flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flick .14s ease-in-out infinite alternate; transition: opacity .4s, transform .4s; }
@keyframes flick { from { transform: scale(1,1) skewX(-2deg); } to { transform: scale(.94,1.06) skewX(2deg); } }
#flame.windy { animation: windy .08s ease-in-out infinite alternate; }
@keyframes windy { from { transform: scale(.8,.9) skewX(-14deg); } to { transform: scale(.7,.8) skewX(-24deg); } }
#flame.out { opacity: 0; animation: none; transform: scale(.1); }
#glow { transition: opacity .5s; }
#smoke { opacity: 0; }
#smoke.go { animation: smoke 2.2s ease-out forwards; }
@keyframes smoke { 0% { opacity: .8; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-40px); } }
.blow { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.hold {
  position: relative; overflow: hidden; width: min(280px, 100%); padding: 16px 20px; border-radius: 999px; cursor: pointer;
  border: 2px solid rgba(220,236,255,.35); background: rgba(20,49,107,.6); color: var(--ice);
  font: 800 16px/1.2 var(--body); touch-action: none; user-select: none; -webkit-user-select: none;
}
.hold .fill { position: absolute; inset: 0; width: calc(var(--p, 0) * 100%); background: linear-gradient(90deg, var(--sky), var(--lotso)); transition: width .08s linear; }
.hold span { position: relative; }
.mic-note { font-size: 13px; color: var(--mist); margin: 0; min-height: 1.4em; }

/* ---------- 2 · wish jar ---------- */
.jar-stage { position: relative; width: 100%; display: flex; justify-content: center; align-items: flex-end; }
.jar-stage svg { width: 150px; overflow: visible; }
.wish-form { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.wish-form textarea {
  width: 100%; resize: none; height: 76px; padding: 12px 14px; border-radius: 16px;
  border: 2px solid rgba(220,236,255,.25); background: rgba(10,26,58,.65); color: var(--ice); font: 600 16px/1.5 var(--cjk);
}
.wish-form textarea::placeholder { color: rgba(147,182,230,.7); }
.wish-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; width: 100%; }
.wish-list li { background: rgba(220,236,255,.08); border-radius: 12px; padding: 8px 12px; font-family: var(--cjk); font-size: 15px; text-align: left; overflow-wrap: anywhere; }
.flying-star { position: fixed; left: 0; top: 0; z-index: 35; font-size: 30px; pointer-events: none; }
.promise { background: var(--cream); color: var(--ink); border-radius: 18px; padding: 14px 18px; font-family: var(--cjk); font-weight: 700; margin: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; align-items: center; width: 100%; }

/* ---------- 3 · connect the dots ---------- */
.board { width: 100%; max-width: 360px; aspect-ratio: 1; max-height: 46vh; }
.board svg { width: 100%; height: 100%; display: block; }
.dot { cursor: pointer; }
.dot circle.hit { fill: transparent; }
.dot circle.pt { fill: #fff; stroke: var(--berry); stroke-width: .8; transition: fill .2s; }
.dot text { font-family: var(--cjk); font-weight: 700; font-size: 4.4px; fill: var(--ink); pointer-events: none; }
.dot.done circle.pt { fill: var(--lotso); stroke: var(--lotso); }
.dot.next circle.pt { animation: dotPulse 1s ease-in-out infinite; }
@keyframes dotPulse { 50% { fill: #ffd3e4; stroke-width: 1.6; } }
.dot.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-1.2px); } 75% { transform: translateX(1.2px); } }
.seg { stroke: var(--lotso); stroke-width: 1.8; stroke-linecap: round; fill: none; }
.shape-glow { filter: drop-shadow(0 0 1.5px var(--lotso)); }
.sentence { min-height: 1.6em; font-family: var(--cjk); font-weight: 700; font-size: 18px; margin: 0; text-shadow: 0 1px 0 rgba(20,49,107,.35); }
.iloveu { display: flex; gap: 10px; justify-content: center; }
.iloveu svg { width: 84px; height: 84px; background: var(--cream); border-radius: 18px; }

/* ---------- 4 · love padlock ---------- */
.chest { width: min(230px, 64vw); }
.chest svg { width: 100%; display: block; overflow: visible; }
#chestLid { transform-box: fill-box; transform-origin: 50% 100%; transition: transform .9s cubic-bezier(.3,1.4,.5,1); }
.chest.open #chestLid { transform: translateY(-34px) rotate(-10deg) scaleY(.82); }
#heartLock { transform-box: fill-box; transform-origin: 50% 0; transition: transform .6s cubic-bezier(.3,1.6,.5,1), opacity .5s .5s; }
.chest.open #heartLock { transform: translateY(70px) rotate(25deg); opacity: 0; }
#shackle { transition: transform .35s; }
.chest.unlocked #shackle { transform: translateY(-8px); }
#chestLight { transition: opacity 1s .3s; }
.chest.open #chestLight { opacity: 1; }
.chest.shake { animation: lockshake .45s; }
@keyframes lockshake { 20%, 60% { transform: translateX(-7px) rotate(-2deg); } 40%, 80% { transform: translateX(7px) rotate(2deg); } }
.code { display: flex; gap: 10px; }
.code span { width: 46px; height: 56px; border-radius: 14px; background: var(--cream); color: var(--berry); display: grid; place-items: center;
  font: 700 30px var(--display); box-shadow: inset 0 -4px 0 rgba(63,79,196,.15), 0 6px 14px rgba(10,26,58,.2); transition: transform .15s; }
.code span.on { box-shadow: inset 0 0 0 3px var(--lotso), 0 6px 14px rgba(10,26,58,.2); }
.code.ok span { background: #ffe4ef; color: var(--lotso); }
.code.bad span { background: #ffd9d9; }
.keypad { display: grid; grid-template-columns: repeat(3, 64px); gap: 10px; }
.keypad button { height: 52px; border-radius: 16px; border: 0; cursor: pointer; background: rgba(255,255,255,.92); color: var(--ink);
  font: 700 22px var(--display); box-shadow: 0 4px 0 rgba(63,79,196,.25); touch-action: manipulation; }
.keypad button:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(63,79,196,.25); }
.keypad button[data-k="ok"] { background: var(--lotso); color: #fff; box-shadow: 0 4px 0 var(--lotso-dark); }
.keypad.done { opacity: .35; pointer-events: none; }
.lock-reveal { width: 100%; padding: 18px 16px; animation: rise .8s cubic-bezier(.2,.9,.3,1.1) both; }
.lock-reveal p { margin: 0; color: var(--ink-soft); font-size: 15px; }
.lock-reveal p.big { margin-top: 8px; color: var(--berry); font-size: 20px; line-height: 1.55; }
/* ---------- 5 · scratch cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.scratch { position: relative; aspect-ratio: 3 / 4.4; border-radius: 16px; overflow: hidden; background: var(--cream); color: var(--ink); box-shadow: 0 10px 22px rgba(10,26,58,.3); }
.scratch .under { position: absolute; inset: 0; display: flex; flex-direction: column; }
.scratch .under img { flex: 1; min-height: 0; width: 100%; object-fit: cover; }
.scratch .under .big-emoji { flex: 1; display: grid; place-items: center; font-size: 46px; }
.scratch .under p { margin: 0; padding: 8px 8px 10px; font-family: var(--cjk); font-weight: 700; font-size: 12.5px; line-height: 1.4; }
.scratch canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; transition: opacity .6s; }
.scratch canvas.clear { opacity: 0; pointer-events: none; }
@media (max-width: 520px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .scratch .under p { font-size: 14px; }
  .scratch:nth-child(3) { grid-column: span 2; aspect-ratio: 2 / 1.1; }
  .scratch:nth-child(3) .under { flex-direction: row; align-items: center; }
  .scratch:nth-child(3) .under img { flex: 0 0 44%; width: 44%; height: 100%; }
  .scratch:nth-child(3) .under p { font-size: 17px; padding: 12px 14px 12px 4px; text-align: left; }
}

/* ---------- 6 · envelope + letter ---------- */
.envelope { position: relative; width: min(280px, 80vw); aspect-ratio: 3 / 2; cursor: pointer; border: 0; padding: 0; background: none; perspective: 800px; }
.envelope .back { position: absolute; inset: 0; background: var(--sky); border-radius: 10px; }
.envelope .front { position: absolute; inset: 0; border-radius: 10px; background: linear-gradient(to top right, #2a62c4 50%, transparent 50.5%) left/50.5% 100% no-repeat, linear-gradient(to top left, #2a62c4 50%, transparent 50.5%) right/50.5% 100% no-repeat; }
.envelope .flap { position: absolute; left: 0; right: 0; top: 0; height: 62%; background: #4a86e8; clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: top; transition: transform .7s ease; border-radius: 10px 10px 0 0; }
.envelope .seal { position: absolute; left: 50%; top: 56%; transform: translate(-50%, -50%); width: 46px; height: 46px; border-radius: 50%; background: var(--lotso); color: #fff; display: grid; place-items: center; font-size: 22px; box-shadow: 0 4px 10px rgba(0,0,0,.3); transition: opacity .3s; }
.envelope.open .flap { transform: rotateX(180deg); }
.envelope.open .seal { opacity: 0; }
.letter { width: 100%; padding: 22px 18px 26px; display: flex; flex-direction: column; gap: 16px; align-items: center; animation: rise .9s cubic-bezier(.2,.9,.3,1.1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(80px) scale(.95); } }
.letter h2 { color: var(--berry); text-shadow: none; }
.carousel { width: 100%; display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: none; }
.carousel::-webkit-scrollbar { display: none; }
.carousel img { flex: 0 0 78%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 14px; scroll-snap-align: center; }
.swipe { font-size: 12px; color: var(--ink-soft); margin: -8px 0 0; }
.letter .text { text-align: left; font-family: var(--cjk); font-size: 16px; line-height: 1.85; max-width: 34ch; }
.letter .text p { margin: 0 0 12px; }
.letter .sign { text-align: right; color: var(--lotso); }
.letter .last { font-family: var(--display); font-weight: 600; font-size: 20px; color: var(--berry); margin: 0; text-wrap: balance; }

/* handwritten letter: the photo sits on lined blue paper; white paper disappears (multiply) so only the ink shows,
   and it is revealed top to bottom as if being written */
.hand { width: 100%; display: flex; flex-direction: column; gap: 10px; border-radius: 14px; padding: 6px;
  background: repeating-linear-gradient(#fffdf6 0 27px, #d8e6fb 27px 28px); box-shadow: inset 0 0 0 2px #e7eefb; }
.hand img { width: 100%; display: block; mix-blend-mode: multiply; cursor: zoom-in;
  -webkit-mask-image: linear-gradient(#000 0 var(--reveal, 0%), transparent calc(var(--reveal, 0%) + 8%));
          mask-image: linear-gradient(#000 0 var(--reveal, 0%), transparent calc(var(--reveal, 0%) + 8%)); }
.zoom { position: fixed; inset: 0; z-index: 70; background: rgba(10,26,58,.92); overflow: auto; padding: 16px; touch-action: pan-x pan-y pinch-zoom; }
.zoom img { width: 170%; max-width: none; display: block; border-radius: 8px; background: #fffdf6; }
.zoom .close { position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; z-index: 71; }

/* ---------- easter egg deck ---------- */
.deck { position: relative; width: min(300px, 82vw); height: 230px; cursor: pointer; outline-offset: 6px; }
.fact { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 22px;
  background: var(--cream); color: var(--ink); border-radius: 22px; box-shadow: 0 12px 26px rgba(10,26,58,.28);
  transform: rotate(var(--rot, 0deg)) translateY(var(--dy, 0)); transition: transform .35s; }
.fact .ico { font-size: 40px; line-height: 1; }
.fact p { margin: 0; font: 700 18px/1.55 var(--cjk); text-wrap: balance; }
.fact b { color: var(--lotso); font-family: var(--display); font-size: 1.25em; font-variant-numeric: tabular-nums; }
.fact.gone { animation: flyoff .55s ease-in forwards; pointer-events: none; }
@keyframes flyoff { to { transform: translate(140%, -30px) rotate(28deg); opacity: 0; } }

/* ---------- hug ---------- */
.hug-heart { position: relative; width: 120px; height: 110px; border: 0; background: none; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none;
  transform: scale(calc(1 + var(--p, 0) * .9)); transition: transform .08s linear; }
.hug-heart::before { content: ""; position: absolute; inset: 0; background: var(--lotso);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='2 3 20 18.4'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='2 3 20 18.4'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E") center/contain no-repeat;
  filter: drop-shadow(0 0 calc(6px + var(--p, 0) * 22px) rgba(255,150,200,.8)); }
.hug-heart span { position: relative; color: #fff; font-size: 16px; }
.hug-heart.beat { animation: beat 1s ease-in-out infinite; }
@keyframes beat { 15% { transform: scale(1.08); } 30% { transform: scale(1); } 45% { transform: scale(1.06); } }

/* ---------- sing ---------- */
.notes { position: absolute; inset: 0; pointer-events: none; }
.note { position: absolute; top: 30%; font-size: 26px; color: #ffd95a; animation: note 2.2s ease-out forwards; text-shadow: 0 2px 8px rgba(255,217,90,.5); }
@keyframes note { from { opacity: 0; transform: translate(0, 0) rotate(-10deg) scale(.7); } 20% { opacity: 1; } to { opacity: 0; transform: translate(var(--dx), -150px) rotate(15deg) scale(1.1); } }

/* ---------- gift on the way ---------- */
.route { width: 100%; max-width: 400px; padding: 16px 10px 10px; }
.route svg { width: 100%; display: block; overflow: visible; }
.route text { font-family: var(--cjk); font-weight: 700; font-size: 12px; fill: var(--ink); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; width: 100%; max-width: 400px; }
.steps li { font-family: var(--cjk); font-size: 13px; font-weight: 700; padding: 8px 2px; border-radius: 12px; background: rgba(255,255,255,.3); color: #fff; }
.steps li.done { background: #fff; color: var(--sky); }
.steps li.now { background: var(--lotso); color: #fff; }
.eta { margin: 0; font-family: var(--cjk); font-weight: 700; }
@keyframes bump { 50% { transform: translateY(-2px); } }
#truck { animation: bump .5s ease-in-out infinite; }

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