/* The surprise "stage": themed full-screen scene used by the viewer, the preview and the demos. */
.stage {
  --fg: #fff; --accent: #ff5d8f; --accent2: #ffd166; --card: rgba(255, 255, 255, .09); --cardfg: #fff;
  position: fixed; inset: 0; overflow: hidden; color: var(--fg); font-family: var(--font);
  background: linear-gradient(160deg, var(--bg1, #12071f), var(--bg2, #4a1248)); isolation: isolate;
}
.stage.is-preview { position: absolute; }
.stage .bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; will-change: transform; animation: drift 18s ease-in-out infinite; }
.orb.o1 { width: 60vmax; height: 60vmax; left: -22vmax; top: -18vmax; background: var(--accent); }
.orb.o2 { width: 48vmax; height: 48vmax; right: -18vmax; bottom: -16vmax; background: var(--accent2); animation-delay: -6s; opacity: .38; }
.orb.o3 { width: 34vmax; height: 34vmax; left: 30%; top: 45%; background: var(--accent); animation-delay: -11s; opacity: .22; }
@keyframes drift { 0%, 100% { transform: translate3d(0, 0, 0) scale(1); } 33% { transform: translate3d(6vmax, 4vmax, 0) scale(1.1); } 66% { transform: translate3d(-4vmax, 7vmax, 0) scale(.94); } }
.stage[data-dark="0"] .orb { opacity: .32; }

.fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.view { position: absolute; inset: 0; z-index: 3; overflow-x: hidden; overflow-y: auto; display: flex; flex-direction: column; align-items: center; padding: 0 16px; -webkit-overflow-scrolling: touch; }
.view > * { margin-top: auto; margin-bottom: auto; width: 100%; max-width: 640px; }
.stage.finale .bg { background: radial-gradient(ellipse at 50% 100%, rgba(0, 0, 0, .55), transparent 70%); }

/* reveal helpers (templates add .pre then swap to .in) */
.pre { opacity: 0; transform: translateY(22px) scale(.97); filter: blur(8px); }
.pre, .in { transition: opacity 1s ease, transform 1s cubic-bezier(.2, .8, .2, 1), filter 1s ease; }
.in { opacity: 1; transform: none; filter: none; }

/* ---------- HUD, gate, end bar ---------- */
.hud { position: absolute; z-index: 25; top: 12px; right: 12px; display: flex; gap: 8px; align-items: center; }
.hud-btn {
  min-width: 42px; height: 42px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(0, 0, 0, .32); color: #fff; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: 18px; font-weight: 700; transition: transform .2s, background .2s;
}
.hud-btn:hover { transform: scale(1.08); }
.hud-btn.on { background: var(--accent); color: #1b0b22; animation: beat 1.4s ease-in-out infinite; }
.hud-btn.q { font-size: 10px; letter-spacing: .08em; }
.hud-btn.wide { font-size: 13px; }
.stage[data-dark="0"] .hud-btn { background: rgba(255, 255, 255, .65); color: #3a1630; border-color: rgba(0, 0, 0, .1); }
.stage[data-dark="0"] .hud-btn.on { background: var(--accent); color: #fff; border-color: transparent; }
@keyframes beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }

.gate {
  position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  border: 0; background: radial-gradient(circle at 50% 42%, rgba(0, 0, 0, .12), rgba(0, 0, 0, .55)); color: #fff; text-align: center; padding: 24px;
  transition: opacity .6s ease, transform .65s cubic-bezier(.6, 0, .2, 1), filter .6s;
}
.gate.go { opacity: 0; transform: scale(1.35); filter: blur(10px); pointer-events: none; }
.gate-heart { font-size: clamp(70px, 22vw, 120px); line-height: 1; animation: heartbeat 1.5s ease-in-out infinite; filter: drop-shadow(0 0 30px var(--accent)); }
.gate-title { font-family: var(--font); font-size: clamp(22px, 6vw, 34px); font-weight: 700; max-width: 18em; text-shadow: 0 4px 24px rgba(0, 0, 0, .5); }
/* The gate title uses the body font (Hind Siliguri), NOT the Cinzel serif:
   Cinzel renders lowercase as small capitals, so a name typed "Haki" showed
   as "HAKI". The name must show exactly as typed. */
.gate-foot { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 6px; }
.gate-emojis { font-size: 20px; letter-spacing: .35em; opacity: .95; animation: float-y 3.4s ease-in-out infinite; }
.gate-hint { font-size: .85rem; opacity: .75; }
.nowrap { white-space: nowrap; }
.gate-tap { padding: .7em 1.6em; border-radius: 999px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .4); font-weight: 700; letter-spacing: .02em; animation: pulse-ring 2.2s infinite; }
.gate-from { opacity: .8; font-size: .95rem; }
@keyframes heartbeat { 0%, 100% { transform: scale(1); } 14% { transform: scale(1.16); } 28% { transform: scale(1); } 42% { transform: scale(1.1); } 70% { transform: scale(1); } }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .45); } 70% { box-shadow: 0 0 0 22px rgba(255, 255, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); } }

.endbar { position: absolute; z-index: 24; left: 0; right: 0; bottom: 18px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; opacity: 0; transform: translateY(20px); transition: opacity .8s, transform .8s; pointer-events: none; padding: 0 12px; }
.endbar.show { opacity: 1; transform: none; pointer-events: auto; }
.stage .btn { color: #fff; }
.stage[data-dark="0"] .btn { color: #3a1630; border-color: rgba(0, 0, 0, .16); background: rgba(255, 255, 255, .7); }
.stage .btn.pink { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent2)); border-color: transparent; }
.stage[data-dark="1"] .btn.pink { color: #1b0b22; }
.stage[data-dark="0"] .btn.pink { color: #fff; }
.report { position: absolute; z-index: 24; left: 10px; bottom: 8px; border: 0; background: none; color: inherit; opacity: .45; font-size: 11px; text-decoration: underline; }

.modal { position: absolute; inset: 0; z-index: 40; background: rgba(0, 0, 0, .78); display: grid; place-items: center; padding: 16px; animation: fadein .3s; }
.modal-box { display: flex; flex-direction: column; align-items: center; gap: 14px; width: min(94vw, 680px); }
.vid { width: 100%; aspect-ratio: 16 / 9; max-height: 70vh; border: 0; border-radius: 16px; background: #000; }
@keyframes fadein { from { opacity: 0; } }
.embed-player { position: absolute; z-index: 22; left: 10px; bottom: 34px; border-radius: 12px; overflow: hidden; opacity: .92; box-shadow: 0 8px 30px rgba(0, 0, 0, .45); }
.embed-player iframe { display: block; border: 0; }
.embed-player.youtube iframe { width: 190px; height: 107px; }
.embed-player.spotify iframe { width: 290px; height: 152px; }

/* Per-character typewriter spans (player.js): staggered rise, per-char hue. */
.ch { display: inline-block; animation: ch-rise .45s cubic-bezier(.2, .8, .2, 1) both; }
/* Typewriter word wrapper: keeps a word on one line (no mid-word breaks). */
.tw { display: inline-block; white-space: nowrap; }
@keyframes ch-rise { from { opacity: 0; transform: translateY(8px); } }

/* Gradient-text utility: hues --c1/2/3 are set per template on .stage by
   player.js applyTheme (theme colours). Applied to titles, section heads and
   the typewriter line, not just .title.big any more. */
.shine-text, .title:not(.big), .sec, .ht-head, .cd-title, .inv-title, .tg-label, .qz-q, .ask-q, .prop-line { background: linear-gradient(120deg, var(--c1, var(--accent)), var(--c2, var(--accent2)) 45%, var(--c3, var(--fg))); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; animation: shine 6s linear infinite; }
.title { font-family: var(--serif); font-weight: 800; font-size: clamp(30px, 8.5vw, 52px); line-height: 1.15; margin: 0; text-align: center; text-shadow: 0 6px 40px rgba(0, 0, 0, .28); letter-spacing: .005em; }
.title.big { font-size: clamp(34px, 10vw, 64px); background: linear-gradient(120deg, var(--fg), var(--accent2) 45%, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; animation: shine 6s linear infinite; background-size: 220% 100%; }
@keyframes shine { to { background-position: -220% 0; } }
.fin-sub { text-align: center; opacity: .9; font-size: 1.1rem; margin: 10px 0 0; font-style: italic; }
.fin-sign { text-align: center; font-family: var(--font); font-style: italic; font-size: 1.25rem; margin-top: 14px; color: var(--deep, var(--accent2)); }
.finale { text-align: center; padding: 20px 6px 110px; animation: rise 1.2s cubic-bezier(.2, .8, .2, 1) both; min-height: min(74vh, 660px); display: flex; flex-direction: column; justify-content: center; }
/* Finale footer: fills the space below the sign-off so no finale ends on a
   big blank area. Photo strip when the wish has photos, else an emoji
   divider + a "for {name}" chip. */
.fin-foot { margin-top: 26px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.fin-photos { display: flex; gap: 8px; justify-content: center; }
.fin-photos img { width: 64px; height: 80px; object-fit: cover; border-radius: 12px; border: 3px solid #fff; box-shadow: 0 10px 24px rgba(0, 0, 0, .35); }
.fin-photos img:nth-child(odd) { rotate: -3deg; } .fin-photos img:nth-child(even) { rotate: 3deg; }
.fin-div { display: flex; align-items: center; gap: 12px; width: min(100%, 280px); }
.fin-div i { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--accent2), transparent); }
.fin-div span { font-size: 20px; }
.fin-for { margin: 0; font-size: .95rem; opacity: .85; font-style: italic; }
@keyframes rise { from { opacity: 0; transform: translateY(40px) scale(.94); filter: blur(10px); } }
.orb-av { width: 112px; height: 112px; margin: 0 auto 18px; display: grid; place-items: center; font-size: 54px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .35), rgba(255, 255, 255, .06)); border: 2px solid rgba(255, 255, 255, .5); box-shadow: 0 0 0 8px rgba(255, 255, 255, .07), 0 0 60px var(--accent); animation: float-y 4s ease-in-out infinite; }
@keyframes float-y { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.sub { text-align: center; opacity: .85; margin: 4px 0 16px; }
.sec { font-family: var(--serif); font-size: clamp(26px, 7vw, 36px); text-align: center; margin: 0 0 4px; }

/* ---------- carousel ---------- */
.car { position: relative; width: 100%; margin: 12px auto; }
.car-track { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 6px 10%; -webkit-overflow-scrolling: touch; }
.car-track::-webkit-scrollbar { display: none; }
.car-item { flex: 0 0 78%; margin: 0; scroll-snap-align: center; }
.car-item img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 14px; border: 4px solid #fff; box-shadow: 0 14px 40px rgba(0, 0, 0, .35); }
.car.small { max-width: 320px; }
.car-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .85); color: #333; font-size: 24px; line-height: 1; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); }
.car-btn.l { left: 0; } .car-btn.r { right: 0; }
.car.emoji { display: flex; gap: 18px; justify-content: center; font-size: 56px; padding: 18px 0; }
.emo { animation: float-y 3s ease-in-out infinite; }
.emo:nth-child(2n) { animation-delay: -1.2s; }

/* ---------- Heart tree ---------- */
.ht { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 26px 0 110px; }
.ht-head { font-family: var(--serif); font-weight: 800; font-size: clamp(32px, 9vw, 50px); margin: 0; text-shadow: 0 4px 30px rgba(0, 0, 0, .35); }
.ht-space { height: 41vh; min-height: 240px; width: 100%; }
.ht-count { font-size: .9rem; padding: .3em 1em; border-radius: 999px; background: rgba(0, 0, 0, .22); border: 1px solid rgba(255, 255, 255, .18); margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.ht-hint { border: 0; background: none; color: inherit; font-size: 1.02rem; font-weight: 600; opacity: .92; margin-bottom: 14px; padding: .4em 1em; border-radius: 999px; animation: bob 2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-5px); } }
.ht-card { width: min(100%, 400px); padding: 20px 20px 16px; border-radius: 24px; background: var(--card); color: var(--cardfg); border: 1px solid rgba(255, 255, 255, .2); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 20px 60px -20px rgba(0, 0, 0, .6); text-align: left; }
.ht-greet { margin: 0 0 8px; font-size: 1.2rem; color: var(--deep, var(--accent2)); }
.ht-msg { margin: 0; white-space: pre-wrap; line-height: 1.75; font-size: 1.02rem; min-height: 3em; }
.ht-sign { margin-top: 12px; font-weight: 700; text-align: right; color: var(--deep, var(--accent2)); }
.typing::after { content: ''; display: inline-block; width: 2px; height: 1.1em; margin-left: 2px; vertical-align: text-bottom; background: currentColor; animation: caret .8s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

/* ---------- Retro OS windows ---------- */
.win { width: min(92vw, 360px); max-width: 360px; background: #fffaf2; color: #3a1630; border: 3px solid #2b1b2e; border-radius: 8px; box-shadow: 7px 7px 0 rgba(43, 27, 46, .4), 0 30px 60px rgba(0, 0, 0, .25); overflow: hidden; font-family: var(--mono); }
.win.pre { transform: translateY(26px) scale(.9) rotate(-1.5deg); filter: none; }
.win.out { opacity: 0; transform: scale(.9) translateY(-14px); transition: opacity .45s, transform .45s; }
.win-bar { display: flex; align-items: center; gap: 6px; padding: 5px 10px; background: var(--accent2); border-bottom: 3px solid #2b1b2e; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.win-bar i { width: 9px; height: 9px; border: 2px solid #2b1b2e; border-radius: 2px; background: #fffaf2; }
.win-bar span { margin-left: auto; }
.win-body { padding: 16px 14px 18px; text-align: center; }
.win-title { font-family: var(--serif); font-size: 1.45rem; font-weight: 800; color: #d6336c; margin: 0 0 4px; }
.win-sub { font-size: 11px; opacity: .65; margin: 0 0 8px; }
.curtain-box { position: relative; height: 270px; border-radius: 4px; overflow: hidden; background: radial-gradient(circle at 50% 50%, #ffe3ee, #ffc2d6); border: 3px solid #2b1b2e; }
.curtain { position: absolute; top: 0; bottom: 0; width: 51%; background: repeating-linear-gradient(90deg, #7a1745 0 14px, #9c2160 14px 28px, #6a1139 28px 40px); box-shadow: inset 0 -30px 40px rgba(0, 0, 0, .25); transition: transform 1.1s cubic-bezier(.7, 0, .2, 1); z-index: 3; }
.curtain.l { left: 0; border-right: 2px solid #3d0a22; } .curtain.r { right: 0; border-left: 2px solid #3d0a22; }
.win.open .curtain.l { transform: translateX(-102%); } .win.open .curtain.r { transform: translateX(102%); }
.seal-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; z-index: 4; transition: opacity .5s; }
.win.open .seal-wrap { opacity: 0; }
.seal { width: 84px; height: 84px; border-radius: 50%; border: 3px solid #fff; background: radial-gradient(circle at 35% 30%, #ff9ac1, #d6336c); font-size: 34px; box-shadow: 0 0 0 6px rgba(255, 255, 255, .35), 0 10px 26px rgba(0, 0, 0, .4); animation: heartbeat 1.6s infinite, glowring 2s infinite; }
.seal.pop { animation: none; transform: scale(2.6); opacity: 0; transition: transform .6s, opacity .6s; }
@keyframes glowring { 0%, 100% { box-shadow: 0 0 0 6px rgba(255, 255, 255, .35), 0 0 30px 6px rgba(255, 105, 160, .6); } 50% { box-shadow: 0 0 0 12px rgba(255, 255, 255, .18), 0 0 46px 12px rgba(255, 105, 160, .85); } }
.seal-text { background: #fffaf2; border: 2px solid #2b1b2e; padding: 3px 8px; font-size: 9px; font-weight: 800; letter-spacing: .06em; max-width: 230px; }
.load { padding: 30px 8px; } .load p { font-size: 13px; margin: 6px 0 12px; }
.load-icon { font-size: 66px; animation: shake 1.1s ease-in-out infinite; }
@keyframes shake { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg) scale(1.1); } }
.dots i { display: inline-block; width: 9px; height: 9px; margin: 0 3px; border-radius: 50%; background: var(--accent2); animation: blink 1s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.2); } }
.cake-area { position: relative; height: 240px; margin: 4px 0 10px; display: grid; place-items: center; touch-action: none; cursor: crosshair; }
.cake-cut { position: relative; width: 220px; height: 200px; }
.half { position: absolute; inset: 0; transition: transform 1.1s cubic-bezier(.2, .8, .2, 1); }
.half.l { clip-path: inset(0 50% 0 0); } .half.r { clip-path: inset(0 0 0 50%); }
.cut .half.l { transform: translateX(-12px) rotate(-2deg); } .cut .half.r { transform: translateX(12px) rotate(2deg); }
.cake-svg { width: 100%; height: 100%; overflow: visible; }
.flame { transform-origin: center bottom; animation: flicker .45s ease-in-out infinite alternate; }
@keyframes flicker { from { transform: scale(1, 1) rotate(-3deg); } to { transform: scale(.88, 1.15) rotate(3deg); } }
.candle { animation: bob 2.4s ease-in-out infinite; }
.mono-title { font-weight: 800; text-align: left; margin: 0 0 8px; font-size: 13px; }
.mono-box { text-align: left; min-height: 210px; max-height: 52vh; overflow: auto; padding: 12px; border: 2px solid #2b1b2e; background: #fff; font-size: 12.5px; line-height: 1.75; white-space: pre-wrap; border-radius: 4px; }
.win .btn.pink { margin-top: 12px; color: #fff; }
.win .btn.soft { background: #ffe0ec; color: #3a1630; border: 2px solid #2b1b2e; margin-top: 8px; }
.win .typing::after { background: #3a1630; }

/* ---------- Story journey ---------- */
.dots-nav { position: sticky; top: 10px; z-index: 6; margin-top: 14px !important; margin-bottom: 0 !important; display: flex; gap: 5px; padding: 5px 8px; border-radius: 999px; width: auto; background: rgba(0, 0, 0, .24); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, .16); transition: opacity .6s; }
.dots-nav.hide { opacity: 0; pointer-events: none; }
.dn { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font: 700 9px/1 var(--mono); font-style: normal; background: rgba(255, 255, 255, .14); color: inherit; transition: all .4s; }
.dn.on { background: var(--accent); color: #1b0b22; transform: scale(1.25); box-shadow: 0 0 14px var(--accent); }
.dn.done { background: rgba(255, 255, 255, .32); }
.panel { flex: 1; width: 100%; max-width: 620px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 18px 0 110px; margin: 0 !important; transition: opacity .42s ease, transform .42s ease; perspective: 900px; }
.panel.leave { opacity: 0; transform: translateY(-16px) scale(.98); }
.panel.enter { opacity: 0; transform: translateY(24px) scale(.98); }
.next { margin-top: 22px; }
.loader { text-align: center; width: 100%; }
.loader h2 { font-family: var(--serif); font-size: 1.45rem; margin: 10px 0 18px; }
.pulse-heart { font-size: 78px; animation: heartbeat 1.2s infinite; filter: drop-shadow(0 0 24px var(--accent)); }
.bar { width: min(76%, 280px); height: 6px; margin: 0 auto 8px; border-radius: 99px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent2)); box-shadow: 0 0 14px var(--accent); }
.pct { font-size: .85rem; opacity: .75; }
.intro { text-align: center; }
.big-emoji { font-size: 90px; animation: float-y 3.6s ease-in-out infinite; filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .35)); }
.for { margin: 12px 0 0; letter-spacing: .12em; opacity: .85; }
.paper { width: min(94%, 430px); padding: 10px; background: #fffdf6; color: #4a3a2a; border-radius: 6px; box-shadow: 0 24px 60px -16px rgba(0, 0, 0, .55), 0 0 0 1px rgba(0, 0, 0, .06); transform: rotate(-1deg); transform-style: preserve-3d; animation: paper-in 1s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes paper-in { from { opacity: 0; transform: translateZ(140px) rotateX(8deg) rotate(4deg) scale(.92); } }
.paper-in { padding: 18px 16px; border: 1px dashed #d8ccb2; min-height: 240px; background: repeating-linear-gradient(transparent 0 29px, rgba(180, 160, 120, .22) 29px 30px); }
.paper-text { font: 15px/30px var(--mono); white-space: pre-wrap; text-align: left; }
.paper .typing::after { background: #4a3a2a; }
.balloons { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 18px; width: 100%; padding: 6px 0 10px; }
.balloon { position: relative; width: 62px; height: 92px; border: 0; background: none; padding: 0; animation: bob 3s ease-in-out infinite; animation-delay: calc(var(--i) * -.45s); transition: transform .35s, opacity .35s; }
.b-body { position: absolute; left: 0; top: 0; width: 62px; height: 74px; border-radius: 50% 50% 48% 48% / 56% 56% 44% 44%; background: radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .85), var(--c) 42%, color-mix(in srgb, var(--c) 70%, #000)); box-shadow: inset -6px -8px 14px rgba(0, 0, 0, .2), 0 10px 24px -6px var(--c); }
.b-str { position: absolute; left: 50%; top: 74px; width: 1px; height: 18px; background: rgba(255, 255, 255, .5); }
.balloon:hover { transform: scale(1.08) translateY(-4px); }
.balloon.popped { transform: scale(1.9); opacity: 0; pointer-events: none; }
.wish-reveal { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 420px; margin-top: 6px; }
.wish-card { padding: .7em 1em; border-radius: 14px; background: var(--card); color: var(--cardfg); border: 1px solid rgba(255, 255, 255, .2); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); text-align: center; opacity: 0; transform: translateY(14px) scale(.96); transition: opacity .6s, transform .6s cubic-bezier(.2, .8, .2, 1); }
.wish-card.in { opacity: 1; transform: none; }
.skip { margin-top: 14px; }
.mem-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: min(100%, 420px); margin-top: 12px; }
.mem-grid.c1 { grid-template-columns: 1fr; max-width: 270px; }
.mem { margin: 0; transition: transform .2s ease-out; animation: pop-in .8s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d); }
.mem:nth-child(odd) { rotate: -2deg; } .mem:nth-child(even) { rotate: 2deg; }
.mem img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 12px; border: 4px solid #fff; box-shadow: 0 16px 36px -8px rgba(0, 0, 0, .5); }
@keyframes pop-in { from { opacity: 0; transform: scale(.6) translateY(30px); } }
.star-pad { width: min(88vw, 340px); height: min(56vh, 340px); margin: 12px auto; touch-action: none; border-radius: 20px; border: 1px dashed rgba(255, 255, 255, .22); background: radial-gradient(circle, rgba(255, 255, 255, .05), transparent 70%); }
.ask { text-align: center; position: relative; width: 100%; }
.ask-q { font-family: var(--serif); font-size: clamp(26px, 7.4vw, 42px); margin: 0 0 30px; line-height: 1.25; }
.ask-row { display: flex; gap: 18px; justify-content: center; align-items: center; min-height: 110px; }
.btn.yes { background: linear-gradient(135deg, #34d399, #10b981); color: #052e1f; border: 0; box-shadow: 0 12px 34px -8px #10b981; transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.stage[data-dark="0"] .btn.yes, .stage .btn.yes { color: #052e1f; }
.btn.no { background: rgba(255, 255, 255, .16); }
.btn.no.flee { position: absolute; z-index: 8; transition: left .35s cubic-bezier(.2, .9, .3, 1.2), top .35s cubic-bezier(.2, .9, .3, 1.2), opacity .4s; }
.prop { text-align: center; width: 100%; }
.prop-line { font-family: var(--serif); font-size: clamp(20px, 5.6vw, 28px); line-height: 1.5; margin: 0 0 18px; }

/* ---------- Counters ---------- */
.tg { text-align: center; padding: 30px 0 110px; }
.tg-heart { font-size: 64px; animation: heartbeat 1.3s infinite; filter: drop-shadow(0 0 30px var(--accent)); }
.tg-label { font-family: var(--serif); font-size: clamp(22px, 6vw, 30px); margin: 4px 0 14px; }
.tg-big { display: flex; gap: clamp(12px, 5vw, 26px); justify-content: center; }
.tg-u b { display: block; font-size: clamp(44px, 14vw, 76px); line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; background: linear-gradient(180deg, #fff, var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tg-u span { font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; opacity: .75; }
.tg-small { margin: 14px 0 6px; font: 700 1.05rem/1.4 var(--mono); letter-spacing: .06em; opacity: .9; }
.tg-msg { white-space: pre-wrap; line-height: 1.8; max-width: 440px; margin: 14px auto 0; font-size: 1.02rem; }
.cd { text-align: center; padding: 24px 0 110px; transition: opacity .6s, transform .6s; }
.cd.out { opacity: 0; transform: scale(.92); }
.cd-title { font-family: var(--serif); font-size: clamp(26px, 7.4vw, 40px); margin: 0 0 26px; }
.cd-row { display: flex; gap: clamp(8px, 3vw, 16px); justify-content: center; }
.cd-card { min-width: clamp(58px, 18vw, 92px); padding: 16px 6px; border-radius: 18px; background: linear-gradient(180deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, .06)); border: 1px solid rgba(255, 255, 255, .25); box-shadow: 0 16px 40px -14px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .35); perspective: 400px; }
.cd-num { display: inline-block; font: 800 clamp(30px, 10vw, 50px)/1 var(--mono); font-variant-numeric: tabular-nums; }
.cd-num.flip { animation: flip .5s cubic-bezier(.2, .8, .2, 1); }
@keyframes flip { from { transform: rotateX(-90deg); opacity: .2; } }
.cd-lab { margin-top: 8px; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; opacity: .75; }
.cd-sub { margin-top: 26px; opacity: .85; font-style: italic; }

/* ---------- Open when... ---------- */
.ow { text-align: center; padding: 28px 0 110px; }
.ow-head { font-family: var(--serif); font-size: clamp(30px, 8vw, 44px); margin: 0 0 4px; }
.ow-sub { opacity: .8; margin: 0 0 22px; }
.ow-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 14px; justify-items: center; }
.env { position: relative; width: 100%; max-width: 160px; height: 108px; padding: 0; border: 0; background: none; perspective: 500px; transition: transform .3s, opacity .4s; }
.env.pre { transform: translateY(30px) scale(.8); }
.env:hover { transform: translateY(-5px) rotate(-1.5deg); }
.env.read { opacity: .6; }
.env-back { position: absolute; inset: 0; border-radius: 6px; background: linear-gradient(180deg, #ffe9cf, #ffd3a1); box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .5); }
.env-letter { position: absolute; left: 9px; right: 9px; top: 9px; bottom: 26px; border-radius: 3px; background: #fff; transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.env-flap { position: absolute; left: 0; right: 0; top: 0; height: 62%; background: linear-gradient(180deg, #ffc78f, #ffd9b0); clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: top; transition: transform .6s cubic-bezier(.6, 0, .2, 1); z-index: 3; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .15)); }
.env.open .env-flap { transform: rotateX(180deg); z-index: 0; }
.env.open .env-letter { transform: translateZ(60px) translateY(-34px) rotateX(-8deg); }
.env-seal { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); z-index: 4; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; background: radial-gradient(circle at 35% 30%, #ff6b8a, #b8183f); color: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .4); transition: opacity .3s; }
.env.open .env-seal { opacity: 0; }
.env-title { position: absolute; left: 6px; right: 6px; bottom: 4px; z-index: 4; font-size: 10.5px; font-weight: 800; color: #6b3a14; line-height: 1.2; }
.ow-reader { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .66); opacity: 0; pointer-events: none; transition: opacity .35s; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); perspective: 900px; }
.ow-reader.show { opacity: 1; pointer-events: auto; }
.ow-paper { width: min(92vw, 420px); max-height: 82vh; overflow: auto; padding: 22px 20px; background: #fffdf6; color: #4a3a2a; border-radius: 8px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); text-align: left; animation: paper-in .8s cubic-bezier(.2, .8, .2, 1) both; }
.ow-paper h3 { margin: 0 0 10px; font-family: var(--serif); font-size: 1.3rem; color: #b8183f; }
.ow-body { font: 14.5px/1.9 var(--mono); white-space: pre-wrap; margin: 0 0 14px; min-height: 5em; }
.ow-paper .typing::after { background: #4a3a2a; }
.ow-paper .btn { color: #fff; }

/* ---------- Time capsule ---------- */
.capw { display: grid; place-items: center; min-height: 60vh; }
.cap { position: relative; width: 200px; height: 200px; display: grid; place-items: center; transition: transform .9s, opacity .7s; }
.cap-orb { position: relative; width: 130px; height: 130px; border-radius: 50%; background: radial-gradient(circle at 32% 28%, #fff, var(--accent2) 28%, var(--accent) 62%, #08122e); box-shadow: 0 0 60px var(--accent), inset -14px -16px 30px rgba(0, 0, 0, .4); animation: float-y 3.4s ease-in-out infinite; }
.cap-orb i { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .5); }
.cap-orb i:nth-child(1) { width: 28px; height: 14px; left: 26px; top: 20px; rotate: -30deg; }
.cap-orb i:nth-child(2) { width: 8px; height: 8px; right: 30px; top: 38px; }
.cap-orb i:nth-child(3) { width: 12px; height: 12px; left: 44px; bottom: 26px; opacity: .3; }
.cap-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px dashed rgba(255, 255, 255, .45); animation: spin 14s linear infinite; }
.cap-ring.r2 { inset: -26px; animation-duration: 22s; animation-direction: reverse; border-style: dotted; opacity: .6; }
@keyframes spin { to { transform: rotate(360deg); } }
.cap.crack { animation: crack .9s ease-in-out; }
@keyframes crack { 10%, 50%, 90% { transform: translateX(-8px) rotate(-3deg) scale(1.05); } 30%, 70% { transform: translateX(8px) rotate(3deg) scale(1.1); } }
.cap.gone { transform: scale(2.6); opacity: 0; }
.tc { text-align: center; padding: 26px 0 110px; }
.tc-msg { white-space: pre-wrap; line-height: 1.85; max-width: 440px; margin: 14px auto 0; }

/* ---------- Locked / password screens (viewer) ---------- */
.lock { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 50% 30%, #3b1458, #0d0616 70%); overflow: hidden; }
.lock-card { position: relative; z-index: 2; width: min(92vw, 400px); padding: 30px 24px; border-radius: 26px; text-align: center; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7); animation: rise 1s cubic-bezier(.2, .8, .2, 1) both; }
.lock-emoji { font-size: 64px; animation: float-y 3.5s ease-in-out infinite; }
.lock-card h1 { font-family: var(--serif); font-size: 1.6rem; margin: 8px 0; }
.lock-card p { color: var(--mute); margin: 0 0 16px; }
.lock-card .inp { margin-bottom: 12px; text-align: center; letter-spacing: .08em; }
.lock-err { color: var(--bad); min-height: 1.4em; font-size: .92rem; margin: 0 0 8px !important; }
.lock-cd { display: flex; gap: 10px; justify-content: center; margin: 14px 0; font-variant-numeric: tabular-nums; }
.lock-cd div { min-width: 62px; padding: 10px 4px; border-radius: 14px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); }
.lock-cd b { display: block; font: 800 1.7rem/1 var(--mono); }
.lock-cd small { font-size: .68rem; opacity: .7; letter-spacing: .1em; text-transform: uppercase; }
.lock .fx { z-index: 1; }

/* ================= Quiz / Scratch / Treasure / Voice / Invite / Cake ================= */
.qz, .th, .sc, .vg, .cakep { text-align: center; padding: 28px 0 110px; }
.qz-ico { font-size: 60px; line-height: 1; margin-bottom: 8px; animation: float-y 4s ease-in-out infinite; filter: drop-shadow(0 0 24px var(--accent)); }
.qz-bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .2); overflow: hidden; margin-bottom: 10px; }
.qz-bar i { display: block; height: 100%; width: var(--w, 0%); border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .7s cubic-bezier(.2, .8, .2, 1); }
.qz-n { opacity: .7; }
.qz-q { font-family: var(--serif); font-size: clamp(22px, 6vw, 30px); margin: 10px 0 18px; line-height: 1.35; }
.qz-opts { display: grid; gap: 10px; }
.qz-opt { padding: 15px 18px; border-radius: 16px; border: 1px solid rgba(255, 255, 255, .3); background: var(--card); color: var(--cardfg); font: 600 16px/1.3 var(--font); text-align: left; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: opacity .6s, transform .6s cubic-bezier(.2, .8, .2, 1), background .25s, color .25s; }
.qz-opt:hover:not(:disabled) { transform: translateX(6px) scale(1.01); background: rgba(255, 255, 255, .2); }
.qz-opt.ok { background: #1fbf75; color: #fff; border-color: transparent; animation: kf-pop .5s ease; }
.qz-opt.bad { background: #e5484d; color: #fff; border-color: transparent; animation: kf-shake .5s ease; }
.qz-ring { position: relative; width: 160px; height: 160px; margin: 14px auto; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent) calc(var(--p, 0) * 1%), rgba(255, 255, 255, .16) 0); box-shadow: 0 0 50px -8px var(--accent); }
.qz-ring::before { content: ''; position: absolute; inset: 14px; border-radius: 50%; background: var(--bg1); }
.qz-ring b { position: relative; font-size: 36px; font-family: var(--serif); }
@keyframes kf-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
@keyframes kf-pop { 0% { transform: scale(1); } 50% { transform: scale(1.06); } 100% { transform: scale(1); } }

.sc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.sc-card { position: relative; aspect-ratio: 3 / 2; border-radius: 16px; overflow: hidden; display: grid; place-items: center; padding: 10px; background: linear-gradient(135deg, var(--card), rgba(255, 255, 255, .16)); border: 1px solid rgba(255, 255, 255, .35); box-shadow: 0 16px 34px -16px rgba(0, 0, 0, .6); }
.sc-text { font-weight: 700; font-size: 14px; line-height: 1.4; color: var(--cardfg); }
.sc-foil { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; transition: opacity .9s; }
.sc-foil.gone { opacity: 0; pointer-events: none; }
.sc-final { margin-top: 20px; padding: 18px; border-radius: 18px; background: var(--card); border: 1px solid rgba(255, 255, 255, .3); font-size: 1.15rem; line-height: 1.7; }

.th-steps { display: flex; gap: 6px; justify-content: center; margin-bottom: 16px; }
.th-steps i { width: 30px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .25); transition: background .4s; }
.th-steps i.done { background: var(--accent2); } .th-steps i.cur { background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.th-card { padding: 22px 18px; border-radius: 22px; background: var(--card); color: var(--cardfg); border: 1px solid rgba(255, 255, 255, .3); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.th-card.right { box-shadow: 0 0 0 2px #1fbf75, 0 0 40px #1fbf7566; }
.th-card.shake { animation: kf-shake .45s ease; }
.th-form { display: flex; gap: 8px; margin-top: 14px; } .th-inp { flex: 1; min-width: 0; }
.th-msg { min-height: 1.5em; margin: 10px 0 0; font-size: .95rem; opacity: .95; }
.chest { position: relative; width: 150px; height: 130px; margin: 20px auto 10px; }
.chest .base { position: absolute; left: 0; right: 0; bottom: 0; height: 66%; border-radius: 8px 8px 12px 12px; background: linear-gradient(#a35a1c, #6b3410); border: 3px solid #4a2408; box-shadow: inset 0 10px 0 -4px #ffc83d55; }
.chest .lid { position: absolute; left: -4px; right: -4px; top: 6%; height: 40%; border-radius: 70px 70px 6px 6px / 40px 40px 6px 6px; background: linear-gradient(#c97a2e, #8a4515); border: 3px solid #4a2408; transform-origin: left bottom; transition: transform .9s cubic-bezier(.3, 1.4, .5, 1); z-index: 2; }
.chest.open .lid { transform: translate(-6px, -24px) rotate(-32deg); }
.chest .glow { position: absolute; left: 50%; top: 36%; width: 220px; height: 220px; transform: translate(-50%, -50%) scale(.2); border-radius: 50%; background: radial-gradient(circle, rgba(255, 224, 120, .95), transparent 65%); opacity: 0; transition: transform 1s, opacity 1s; }
.chest.open .glow { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.vg-box { position: relative; display: block; width: 160px; height: 160px; margin: 30px auto 14px; border: 0; background: none; animation: float-y 3.4s ease-in-out infinite; }
.vg-body { position: absolute; left: 8%; right: 8%; bottom: 0; height: 60%; border-radius: 10px; background: linear-gradient(135deg, var(--accent), var(--accent2)); box-shadow: 0 20px 40px -14px rgba(0, 0, 0, .6); }
.vg-body::before { content: ''; position: absolute; left: 44%; width: 12%; top: 0; bottom: 0; background: rgba(255, 255, 255, .65); }
.vg-lid { position: absolute; left: 0; right: 0; top: 12%; height: 30%; border-radius: 10px; background: linear-gradient(135deg, var(--accent2), var(--accent)); transform-origin: left bottom; transition: transform .9s cubic-bezier(.3, 1.4, .5, 1); z-index: 2; box-shadow: 0 8px 18px -8px rgba(0, 0, 0, .5); }
.vg-lid::before { content: ''; position: absolute; left: 44%; width: 12%; top: 0; bottom: 0; background: rgba(255, 255, 255, .65); }
.vg-glow { position: absolute; inset: -30%; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .95), transparent 60%); opacity: 0; transition: opacity .8s; pointer-events: none; }
.vg-box.open { animation: none; } .vg-box.open .vg-lid { transform: translate(34px, -54px) rotate(26deg); } .vg-box.open .vg-glow { opacity: .85; }
.vg-player { display: flex; align-items: center; gap: 14px; padding: 16px 18px; margin-top: 24px; border-radius: 26px; background: var(--card); border: 1px solid rgba(255, 255, 255, .3); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.vg-wave { flex: 1; height: 60px; display: flex; align-items: center; gap: 3px; }
.vg-wave i { flex: 1; min-height: 4px; height: calc(var(--v, .12) * 100%); border-radius: 3px; background: linear-gradient(var(--accent2), var(--accent)); transition: height .09s linear; }
.vg-play { width: 58px; height: 58px; flex: none; border: 0; border-radius: 50%; font-size: 20px; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent2)); box-shadow: 0 0 0 0 var(--accent); animation: pulse-ring 2.2s infinite; }
.vg-note { margin: 22px 0 0; line-height: 1.9; font-style: italic; white-space: pre-wrap; }

.inv-wrap { display: grid; place-items: center; padding: 26px 0 100px; }
.inv-env { position: relative; width: min(78vw, 300px); height: 200px; border: 0; border-radius: 8px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 16px; font-weight: 800; color: #5b3b0a; background: linear-gradient(160deg, #f6e7c6, #e3c78f); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .65); animation: float-y 3.6s ease-in-out infinite; }
.inv-flap { position: absolute; left: 0; right: 0; top: 0; height: 62%; background: linear-gradient(#ecd6a6, #d9bc84); clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: top; transition: transform .9s cubic-bezier(.6, 0, .2, 1); }
.inv-seal { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; font-style: normal; color: #fff; background: radial-gradient(circle at 35% 30%, #ff6b8a, #9d174d); box-shadow: 0 4px 10px rgba(0, 0, 0, .4); animation: heartbeat 1.6s infinite; z-index: 2; transition: opacity .4s; }
.inv-env.open { animation: none; } .inv-env.open .inv-flap { transform: rotateX(180deg); } .inv-env.open .inv-seal { opacity: 0; }
.inv-card { position: relative; text-align: center; padding: 34px 20px 26px; border-radius: 24px; color: var(--cardfg); background: var(--card); border: 2px solid var(--accent2); box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .6), inset 0 0 0 8px rgba(255, 255, 255, .05); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); transform-style: preserve-3d; }
.inv-card.in { animation: card-in 1s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes card-in { from { opacity: 0; transform: perspective(900px) translateZ(140px) rotateX(10deg) scale(.92); } }
.inv-kicker { letter-spacing: .22em; text-transform: uppercase; opacity: .8; font-size: .74rem; }
.inv-title { font-family: var(--serif); font-size: clamp(32px, 10vw, 50px); line-height: 1.15; margin: .3em 0 .1em; color: var(--accent2); }
.inv-sub { opacity: .85; margin: 0; }
.inv-photos { display: flex; gap: 8px; justify-content: center; margin-top: 16px; } .inv-photos img { width: 30%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; }
.inv-line { border: 0; height: 1px; margin: 20px 0; background: linear-gradient(90deg, transparent, var(--accent2), transparent); }
.inv-when { font-weight: 800; font-size: 1.1rem; margin: 0 0 6px; } .inv-venue { font-weight: 700; margin: 0; } .inv-addr { opacity: .8; margin: 2px 0 0; }
.inv-cd { display: inline-block; margin: 16px 0 4px; padding: 10px 18px; border-radius: 999px; background: rgba(255, 255, 255, .14); font-weight: 800; font-variant-numeric: tabular-nums; }
.inv-msg { line-height: 1.85; margin: 14px 0; white-space: pre-wrap; opacity: .95; } .inv-extra { font-size: .9rem; opacity: .8; margin: 6px 0 0; }
.inv-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }

.cake-cut.big { transform: scale(1.3); margin: 36px 0 28px; }
.cakep .cake-area { height: 320px; }
/* Realistic 3D CSS cake (cake.js only — retro-os keeps the flat SVG cake).
   Layered tiers with a visible top surface, wavy frosting drips, sprinkles,
   a rimmed plate + floor shadow, striped candles with glowing flames.
   The cut is a CLEAN SLICE: the halves barely part (12px, 2deg), a cream
   crumb face appears on the cut edges, a knife sweeps across, and one wedge
   slides out onto the plate — never two broken halves. */
.cake3d { position: relative; width: 220px; height: 200px; perspective: 600px; }
.ck-shadow { position: absolute; left: 6%; right: 6%; bottom: -8px; height: 18px; border-radius: 50%; background: rgba(0, 0, 0, .28); filter: blur(8px); }
.ck-plate { position: absolute; left: -3%; right: -3%; bottom: 0; height: 16px; border-radius: 50%; background: radial-gradient(ellipse at 50% 38%, #fff 0%, #e6e6f2 55%, #b9b9cc 100%); box-shadow: 0 10px 22px rgba(0, 0, 0, .35), inset 0 -3px 0 rgba(0, 0, 0, .12); }
.ck-tier { position: absolute; left: 50%; transform: translateX(-50%) rotateX(8deg); border-radius: 10px; border: 3px solid #a4133c; box-shadow: 0 12px 24px rgba(0, 0, 0, .32), inset 0 -14px 0 rgba(120, 20, 50, .14), inset 0 10px 0 rgba(255, 255, 255, .35); background: linear-gradient(180deg, #ffe3ec 0%, #ffb3c6 45%, #f78fb0 100%); }
.ck-tier.t1 { bottom: 14px; width: 200px; height: 62px; }
.ck-tier.t2 { bottom: 72px; width: 150px; height: 48px; background: linear-gradient(180deg, #fff8f0 0%, #ffe0ea 45%, #ffc2d6 100%); }
.ck-tier.t3 { bottom: 116px; width: 104px; height: 40px; background: linear-gradient(180deg, #fffdf6 0%, #fff 45%, #ffe3ee 100%); }
/* top surface of each tier (the 3D bit) */
.ck-top { position: absolute; left: -3px; right: -3px; top: -8px; height: 16px; border-radius: 50%; background: radial-gradient(ellipse at 50% 40%, #fffdf8, #ffe9f1 70%); border: 3px solid #a4133c; box-shadow: inset 0 2px 4px rgba(255, 255, 255, .9); }
/* wavy frosting drips hanging off the top edge */
.ck-tier::before { content: ''; position: absolute; left: 2px; right: 2px; top: 4px; height: 20px; border-radius: 0 0 10px 10px; background: radial-gradient(circle at 10px 0, #fff 9px, transparent 10px), radial-gradient(circle at 34px 0, #fff 11px, transparent 12px), radial-gradient(circle at 58px 0, #fff 8px, transparent 9px), radial-gradient(circle at 82px 0, #fff 11px, transparent 12px), radial-gradient(circle at 106px 0, #fff 9px, transparent 10px), radial-gradient(circle at 130px 0, #fff 11px, transparent 12px), radial-gradient(circle at 154px 0, #fff 8px, transparent 9px), radial-gradient(circle at 178px 0, #fff 11px, transparent 12px); background-size: 200px 20px; background-repeat: repeat-x; }
/* sprinkles */
.ck-tier::after { content: ''; position: absolute; inset: 24px 10px 8px; background-image: radial-gradient(circle 2px, #ffd166 98%, transparent), radial-gradient(circle 2px, #7cd1ff 98%, transparent), radial-gradient(circle 2px, #b388ff 98%, transparent), radial-gradient(circle 2px, #34d399 98%, transparent), radial-gradient(circle 2px, #ff5d8f 98%, transparent), radial-gradient(circle 2px, #ffd166 98%, transparent), radial-gradient(circle 2px, #7cd1ff 98%, transparent), radial-gradient(circle 2px, #ff9f1c 98%, transparent); background-position: 12% 30%, 30% 70%, 48% 25%, 62% 65%, 78% 35%, 88% 70%, 22% 55%, 68% 45%; background-repeat: no-repeat; opacity: .9; }
.ck-candle { position: absolute; bottom: 154px; width: 9px; height: 28px; border-radius: 2px; border: 2px solid #333; animation: bob 2.4s ease-in-out infinite; box-shadow: 0 4px 8px rgba(0, 0, 0, .25); }
.ck-candle:nth-of-type(1) { left: 26%; background: repeating-linear-gradient(45deg, #fff 0 3px, #7cd1ff 3px 6px); }
.ck-candle:nth-of-type(2) { left: 48%; background: repeating-linear-gradient(45deg, #fff 0 3px, #ffd166 3px 6px); animation-delay: .2s; }
.ck-candle:nth-of-type(3) { left: 70%; background: repeating-linear-gradient(45deg, #fff 0 3px, #b388ff 3px 6px); animation-delay: .4s; }
.ck-flame { position: absolute; left: 50%; top: -16px; width: 11px; height: 17px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: radial-gradient(circle, #fff7c0, #ffe08a 35%, #ffb400 60%, #ff7a00); transform: translateX(-50%); transform-origin: center bottom; animation: flicker .45s ease-in-out infinite alternate; box-shadow: 0 0 14px 5px rgba(255, 180, 0, .5); }
.ck-candle.out .ck-flame { opacity: 0; animation: none; box-shadow: none; }
/* cream crumb face on the cut edge — appears only after the cut */
.ck-face { position: absolute; left: 50%; top: 44px; bottom: 14px; width: 12px; transform: translateX(-50%); border-radius: 3px; background: linear-gradient(180deg, #fff8ec, #f6e3c2 55%, #eed9ae); box-shadow: inset 0 0 0 1px rgba(160, 110, 40, .25); opacity: 0; transition: opacity .5s .25s; z-index: 2; }
.cake-cut.cut .ck-face { opacity: 1; }
/* the slice that slides out onto the plate */
.ck-slice { position: absolute; left: 50%; bottom: 8px; width: 66px; height: 78px; margin-left: -33px; z-index: 3; opacity: 0; transform: translate(0, 10px) scale(.7); transition: opacity .5s .35s, transform 1.1s cubic-bezier(.2, .8, .2, 1) .35s; pointer-events: none; }
.ck-slice i { position: absolute; }
.ck-slice .ck-slice-body { inset: 14px 0 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); background: linear-gradient(180deg, #ffe3ec, #f78fb0 70%, #e26a92); }
.ck-slice .ck-slice-top { left: 14px; right: 14px; top: 6px; height: 12px; border-radius: 8px; background: #fff; border: 2px solid #a4133c; }
.ck-slice .ck-slice-cherry { left: 50%; top: 0; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ff8fa3, #d81159); box-shadow: 0 2px 4px rgba(0, 0, 0, .3); }
.cake-cut.cut .ck-slice { opacity: 1; transform: translate(44px, 22px) rotate(12deg) scale(1); }
/* knife that sweeps across when the cut starts */
.ck-knife { position: absolute; left: -60px; top: 60px; font-size: 38px; z-index: 6; opacity: 0; transform: rotate(28deg); pointer-events: none; }
.ck-knife.sweep { animation: knife-sweep .55s ease-in .05s both; }
@keyframes knife-sweep { 0% { opacity: 0; left: -60px; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; left: 215px; } }
/* Story-finale signature visuals: Eid crescent, Boishakh sunrise. */
.sig-crescent { width: 70px; height: 70px; margin: 0 auto 12px; border-radius: 50%; box-shadow: 16px 8px 0 0 var(--accent2); filter: drop-shadow(0 0 22px var(--accent2)); animation: float-y 4s ease-in-out infinite; }
.sig-sunrise { width: 120px; height: 60px; margin: 0 auto 8px; border-radius: 120px 120px 0 0; background: linear-gradient(180deg, #ffd166, #ff9f1c 55%, #ff5d8f); box-shadow: 0 0 50px #ff9f1c; animation: sunrise-sweep 2.4s ease-out both; }
@keyframes sunrise-sweep { from { transform: translateY(40px) scale(.6); opacity: 0; } }
.candle.out .flame { opacity: 0; animation: none; }
.cake-msg { white-space: pre-wrap; font-family: var(--font); font-size: 1.25rem; line-height: 1.9; text-align: center; margin: 18px 0 0; }
/* Cake finale fills the screen like the other finales. */
.cakep { min-height: min(74vh, 660px); display: flex; flex-direction: column; justify-content: center; }
.chest { margin: 44px auto 40px; }
.th .title.big { margin-top: 18px; }

/* ================= Per-template distinctness ================= */
/* Every story preset (and proposal) has its own letter paper — a distinct
   tint, border, ruled-line colour, tilt and a small corner watermark — so the
   letter stage never feels like the same page twice. All papers stay light,
   so the dark typewriter ink always reads. */
.paper { position: relative; }
.paper::after { content: ''; position: absolute; right: 14px; top: 10px; font-size: 26px; opacity: .22; pointer-events: none; z-index: 0; }
.paper-in { position: relative; z-index: 1; }
.sig-story-journey .paper { background: #fff5f8; transform: rotate(-1deg); }
.sig-story-journey .paper-in { border-color: #f2a7bd; background: repeating-linear-gradient(transparent 0 29px, rgba(194, 24, 91, .14) 29px 30px); }
.sig-story-journey .paper::after { content: '🎂'; }
.sig-friendship .paper { background: #f0f8ff; transform: rotate(1deg); }
.sig-friendship .paper-in { border-color: #93c5fd; background: repeating-linear-gradient(transparent 0 29px, rgba(2, 132, 199, .14) 29px 30px); }
.sig-friendship .paper::after { content: '🤝'; }
.sig-parents .paper { background: #fffaf0; transform: rotate(-1deg); }
.sig-parents .paper-in { border-color: #e7c46a; background: repeating-linear-gradient(transparent 0 29px, rgba(180, 130, 29, .16) 29px 30px); }
.sig-parents .paper::after { content: '🌷'; }
.sig-farewell .paper { background: #fff3e6; transform: rotate(1deg); }
.sig-farewell .paper-in { border-color: #f0a35e; background: repeating-linear-gradient(transparent 0 29px, rgba(194, 65, 12, .14) 29px 30px); }
.sig-farewell .paper::after { content: '🌅'; }
.sig-apology .paper { background: #f6f2ff; transform: rotate(-1deg); }
.sig-apology .paper-in { border-color: #c4b5fd; background: repeating-linear-gradient(transparent 0 29px, rgba(109, 40, 217, .14) 29px 30px); }
.sig-apology .paper::after { content: '🥺'; }
.sig-eid .paper { background: #f0fdf4; transform: rotate(1deg); }
.sig-eid .paper-in { border-color: #86efac; background: repeating-linear-gradient(transparent 0 29px, rgba(21, 128, 61, .14) 29px 30px); }
.sig-eid .paper::after { content: '🌙'; }
.sig-boishakh .paper { background: #fff7ed; transform: rotate(-1deg); }
.sig-boishakh .paper-in { border-color: #fdba74; background: repeating-linear-gradient(transparent 0 29px, rgba(194, 65, 12, .14) 29px 30px); }
.sig-boishakh .paper::after { content: '🪔'; }
.sig-newyear .paper { background: #f0f4ff; transform: rotate(1deg); }
.sig-newyear .paper-in { border-color: #a5b4fc; background: repeating-linear-gradient(transparent 0 29px, rgba(67, 56, 202, .14) 29px 30px); }
.sig-newyear .paper::after { content: '🎆'; }
.sig-valentine .paper { background: #fff0f3; transform: rotate(-1deg); }
.sig-valentine .paper-in { border-color: #fda4af; background: repeating-linear-gradient(transparent 0 29px, rgba(190, 18, 60, .14) 29px 30px); }
.sig-valentine .paper::after { content: '💘'; }
.sig-anniversary .paper { background: #fffbeb; transform: rotate(1deg); }
.sig-anniversary .paper-in { border-color: #fcd34d; background: repeating-linear-gradient(transparent 0 29px, rgba(180, 83, 9, .16) 29px 30px); }
.sig-anniversary .paper::after { content: '💍'; }
.sig-constellation .paper { background: #f5f3ff; transform: rotate(-1deg); }
.sig-constellation .paper-in { border-color: #c7d2fe; background: repeating-linear-gradient(transparent 0 29px, rgba(91, 33, 182, .14) 29px 30px); }
.sig-constellation .paper::after { content: '✨'; }
.sig-proposal .paper { background: #fff1f2; transform: rotate(-1deg); }
.sig-proposal .paper-in { border-color: #f9a8d4; background: repeating-linear-gradient(transparent 0 29px, rgba(190, 18, 60, .14) 29px 30px); }
.sig-proposal .paper::after { content: '💍'; }

/* Each finale gets its own frame treatment, so the ending never looks like
   the same page with a different title. */
.sig-story-journey .finale { border: 2px solid rgba(255, 143, 177, .5); border-radius: 30px; background: radial-gradient(ellipse at 50% 0%, rgba(255, 143, 177, .14), transparent 65%); }
.sig-anniversary .finale { border: 2px solid rgba(255, 200, 61, .55); outline: 1px solid rgba(255, 200, 61, .25); outline-offset: 6px; border-radius: 30px; background: linear-gradient(180deg, rgba(255, 200, 61, .12), rgba(255, 200, 61, .02)); }
.sig-parents .finale { border: 2px solid rgba(253, 164, 175, .5); border-radius: 30px; background: linear-gradient(180deg, rgba(253, 164, 175, .12), transparent 70%); }
.sig-apology .finale { background: radial-gradient(ellipse at 50% 40%, rgba(167, 139, 250, .18), transparent 65%); }
.sig-eid .finale { border: 2px solid rgba(123, 224, 176, .5); border-radius: 30px; background: linear-gradient(180deg, rgba(123, 224, 176, .12), transparent 70%); }
.sig-boishakh .finale { border: 2px solid rgba(255, 159, 28, .5); border-radius: 30px; background: linear-gradient(180deg, rgba(255, 159, 28, .14), transparent 65%); }
.sig-newyear .finale { border: 2px solid rgba(255, 255, 255, .35); border-radius: 30px; background: radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, .12), transparent 60%); }
.sig-valentine .finale { border: 2px solid rgba(255, 93, 143, .5); border-radius: 30px; background: radial-gradient(ellipse at 50% 30%, rgba(255, 93, 143, .16), transparent 70%); }
.sig-friendship .finale { border: 2px solid rgba(76, 201, 240, .5); border-radius: 30px; background: linear-gradient(180deg, rgba(76, 201, 240, .12), transparent 70%); }
.sig-farewell .finale { border-radius: 30px; background: linear-gradient(180deg, rgba(255, 159, 104, .18), rgba(255, 209, 102, .06) 55%, transparent); }
.sig-constellation .finale { border: 2px solid rgba(199, 125, 255, .4); border-radius: 30px; background: radial-gradient(ellipse at 50% 20%, rgba(199, 125, 255, .2), transparent 65%); }
.sig-proposal .finale { border: 2px solid rgba(232, 121, 249, .5); border-radius: 30px; background: radial-gradient(ellipse at 50% 30%, rgba(232, 121, 249, .16), transparent 70%); }
