/* ============================================================
   Look & feel borrowed from the classic "birthday" page:
   dark room → peach glow, bulbs, bunting, balloons, CSS cake.
   ============================================================ */
:root {
  --ink: #4a2f27;
  --ink-soft: #7a5a4e;
  --peach: #FFDAB9;
  --peach-2: #FFE4B5;
  --peach-3: #FFEFD5;
  --cream: #FFF6EA;
  --teal: #2E9C93;
  --teal-dark: #23786f;
  --lime: #C2CD3A;
  --mint: #E4EFD9;
  --yellow: #F2B300;
  --red: #D14D39;
  --blue: #3550D4;
  --purple: #8377E4;
  --night: #14101f;
  --paper: #FFFDF6;
  --D: min(300px, 56vw);          /* cake size */
  --bw: clamp(58px, 17vw, 100px); /* balloon width */
  --display: 'Signika', 'Trebuchet MS', system-ui, sans-serif;
  --body: 'Lato', 'Helvetica Neue', Arial, sans-serif;
  --hand: 'Caveat', 'Comic Sans MS', cursive;
  --serif: 'Bodoni Moda', Didot, 'Times New Roman', Georgia, serif;
  /* faint paper grain for the light sections */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .29 0 0 0 0 .18 0 0 0 0 .12 0 0 0 .38 -.12'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; touch-action: manipulation; }   /* no double-tap-to-zoom (rapid taps: the 19 egg, hugs…); pinch still works */
body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}
body.locked { overflow: hidden; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
em { font-style: italic; color: var(--teal); }

.hand { font-family: var(--hand); font-size: 1.6rem; line-height: 1.3; }
.muted { color: var(--ink-soft); }
.small { font-size: .9rem; }
.center { display: flex; justify-content: center; }
.center-text { text-align: center; }
.big { font-size: 2.2rem; }

/* ---------- buttons ---------- */
.btn {
  border: 0;
  border-radius: 999px;
  padding: .85rem 1.6rem;
  background: var(--teal);
  color: #fff;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: .03em;
  box-shadow: 0 6px 0 var(--teal-dark), 0 12px 24px rgba(46, 156, 147, .3);
  transition: transform .15s, box-shadow .15s;
}
@media (hover: hover) { .btn:hover { transform: translateY(-2px); } }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--teal-dark); }
.btn-red { background: var(--red); box-shadow: 0 6px 0 #a63a2a, 0 12px 24px rgba(209, 77, 57, .3); }
.btn-purple { background: var(--purple); box-shadow: 0 6px 0 #6257bd, 0 12px 24px rgba(131, 119, 228, .3); }
.link-btn {
  background: none; border: 0; padding: .6rem 1rem;
  font-family: var(--display); font-size: .95rem;
  color: inherit; opacity: .7; text-decoration: underline; text-underline-offset: 4px;
}
@media (hover: hover) { .link-btn:hover { opacity: 1; } }

/* ============================================================
   PASSWORD GATE
   ============================================================ */
.gate {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center; padding: 1.25rem;
  background: var(--night); overflow-y: auto;
}
.gate-card {
  margin: auto;
  width: min(380px, 100%);
  background: var(--cream); border-radius: 24px;
  padding: 2rem 1.5rem; text-align: center;
}
.gate-card h2 { font-family: var(--serif); font-weight: 600; margin: 0 0 .25rem; }
.gate-card input {
  width: 100%; padding: .85rem 1rem; margin: 1rem 0;
  border: 2px solid var(--peach); border-radius: 14px;
  font: inherit; background: #fff; color: var(--ink);
}
.gate-err { color: var(--red); min-height: 1.5em; margin: .5rem 0 0; }

/* ============================================================
   BULBS (used by the opening scene and a few sections)
   ============================================================ */
.bulbs {
  display: flex; justify-content: space-around;
  width: min(760px, 100%);
  position: relative;
  padding-top: 6px;
}
.bulbs::before { /* the wire */
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 18px;
  border-bottom: 2px solid rgba(80, 60, 50, .45);
  border-radius: 0 0 50% 50%;
}
.bulb {
  position: relative;
  width: clamp(32px, 9vw, 50px); aspect-ratio: 1;
  background: url(../assets/bulb.webp) center/contain no-repeat;
}
.bulb i {
  position: absolute; inset: 0;
  background: center/contain no-repeat;
  opacity: 0;
}
.bulbs.on .bulb i { opacity: 1; transition: opacity 5s linear; }
.bulbs.flashing .bulb i { animation: bulb-flash var(--speed, 1s) linear infinite; }
@keyframes bulb-flash { 0%, 100% { opacity: .1; } 50% { opacity: 1; } }
.bulbs-small .bulb { width: clamp(24px, 6vw, 34px); }

/* ============================================================
   THE REST OF THE SITE
   ============================================================ */
main { background: var(--cream); overflow-x: clip; }   /* nothing inside may widen the page */
.sec { padding: clamp(64px, 12vw, 110px) max(16px, env(safe-area-inset-right, 0px)) clamp(64px, 12vw, 110px) max(16px, env(safe-area-inset-left, 0px)); position: relative; }   /* clear of the notch in landscape */
.sec-cream { background: var(--cream) var(--grain); }
.sec-peach { background: var(--peach-3) var(--grain); }
.sec-head { text-align: center; max-width: 720px; margin: 0 auto 2.5rem; }
.sec-head h2, .final-msg h2 {
  font-family: var(--serif); font-weight: 600; letter-spacing: -.01em;
  font-size: clamp(1.85rem, 6.4vw, 3.1rem);
  line-height: 1.12; margin: .3rem 0 .6rem;
}
.sec-head h2 em, .final-msg h2 em { font-weight: 500; }
.gate-card h2, .reply h3, .egg-card h3 { font-family: var(--serif) !important; font-weight: 600; }

/* section intros that break the bunting pattern */
.sec-stamp {
  display: inline-block; margin-bottom: 1.1rem; padding: .3rem .9rem;
  border: 3px solid var(--red); border-radius: 4px; color: var(--red);
  font-family: 'Special Elite', 'Courier New', monospace; font-size: .95rem; letter-spacing: .25em; text-transform: uppercase;
  transform: rotate(-4deg); opacity: .85;
}
.sec-head-num { position: relative; isolation: isolate; padding-top: 1rem; }
.sec-head-num::before {
  content: attr(data-num); position: absolute; left: 50%; top: 50%; transform: translate(-50%, -54%); z-index: -1;
  font-family: var(--serif); font-weight: 700; font-size: clamp(9rem, 42vw, 17rem); line-height: 1;
  color: transparent; -webkit-text-stroke: 2px rgba(209, 77, 57, .22); pointer-events: none;
}
.sec-moon { display: block; font-size: 2.2rem; line-height: 1; margin-bottom: .6rem; color: #ffe2b8; text-shadow: 0 0 22px rgba(255, 210, 150, .7); }

/* the letter happens at night: a quiet, darker section after all the jokes */
.sec-dusk {
  color: #fff;
  background:
    radial-gradient(1.5px 1.5px at 15% 18%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 78% 12%, #fff, transparent),
    radial-gradient(2px 2px at 88% 40%, var(--peach), transparent),
    radial-gradient(1px 1px at 8% 55%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 60% 28%, #fff, transparent),
    linear-gradient(#2d2145, #1b1529 60%, #14101f);
}
.sec-dusk .eyebrow { color: var(--peach); }
.sec-dusk em { color: var(--peach); }
.sec-dusk .sub, .sec-dusk .muted, .sec-dusk .paper-hint { color: rgba(255, 255, 255, .72); }
.sec-dusk .voice-title, .sec-dusk .voice-name { color: #fff; }
.sec-dusk .voice-card, .sec-dusk .paper { color: var(--ink); }
.sec-dusk .envelope { box-shadow: 0 16px 40px rgba(0, 0, 0, .45), 0 0 50px rgba(233, 137, 122, .25); }
.eyebrow {
  margin: 0; font-family: var(--display); font-size: .78rem;
  letter-spacing: .22em; text-transform: uppercase; color: var(--red);
}
.sub { color: var(--ink-soft); margin: 0; }
.note { text-align: center; color: var(--ink-soft); font-size: .92rem; margin-top: 2rem; }

/* bunting above headings */
.bunting { display: flex; justify-content: center; gap: 3px; margin-bottom: 1rem; }
.bunting i {
  width: 22px; height: 26px;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: var(--c);
}
.bunting i:nth-child(odd) { transform: translateY(-2px); }

/* light-string divider between sections */
.divider {
  display: flex; justify-content: space-around;
  padding: 0 4%; height: 40px; position: relative;
  background: linear-gradient(var(--cream) 50%, var(--peach-3) 50%);
}
.divider-pc { background: linear-gradient(var(--peach-3) 50%, var(--cream) 50%); }
.divider::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 14px;
  border-bottom: 2px solid rgba(80, 60, 50, .3); border-radius: 0 0 50% 50%;
}
.divider .bulb { width: 26px; }
.divider .bulb i { animation: bulb-flash var(--speed) linear infinite; }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s, transform .9s; }
.reveal.in { opacity: 1; transform: none; }
/* headings come in line by line, then the section's content follows */
.sec-head.reveal { opacity: 1; transform: none; }
.sec-head.reveal > * { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s ease; }
.sec-head.reveal.in > * { opacity: 1; transform: none; }
.sec-head.reveal.in > :nth-child(2) { transition-delay: .12s; }
.sec-head.reveal.in > :nth-child(3) { transition-delay: .26s; }
.sec-head.reveal.in > :nth-child(4) { transition-delay: .4s; }
.sec-head-num.reveal::before { opacity: 0; transition: opacity 1.2s ease .3s; }
.sec-head-num.reveal.in::before { opacity: 1; }
.reveal-late { opacity: 0; transform: translateY(24px); transition: opacity .9s ease .45s, transform .9s ease .45s; }
.reveal-late.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-late, .sec-head.reveal > *, .sec-head-num.reveal::before { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ---------- chat timeline ---------- */
.chat {
  max-width: 560px; margin: 0 auto;
  background: #fff; border-radius: 28px;
  padding: 1.25rem 1rem 1.5rem;
  box-shadow: 0 20px 50px rgba(74, 47, 39, .12);
  display: flex; flex-direction: column; gap: 1rem;
}
.chat-top {
  display: flex; align-items: center; gap: .7rem;
  padding: 0 .3rem .9rem; border-bottom: 1px solid #f1e5d8;
}
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--peach), var(--purple));
  color: #fff; font-family: var(--display); font-weight: 700;
}
.chat-top b { font-family: var(--display); display: block; line-height: 1.1; }
.chat-top small { color: var(--teal); }
.bubble {
  max-width: 82%;
  padding: .7rem 1rem .55rem;
  border-radius: 20px 20px 20px 6px;
  background: var(--mint);
  opacity: 0; transform: translateY(16px) scale(.97);
  transition: opacity .7s, transform .7s;
}
.bubble.in { opacity: 1; transform: none; }
.bubble.me {
  align-self: flex-end;
  border-radius: 20px 20px 6px 20px;
  background: var(--teal); color: #fff;
}
.bubble strong { font-family: var(--display); display: block; font-size: .95rem; }
.bubble p { margin: .15rem 0 0; }
.bubble time { display: block; text-align: right; font-size: .72rem; opacity: .7; margin-top: .25rem; }
.typing { display: flex; gap: 5px; padding: .9rem 1rem; background: var(--mint); border-radius: 20px; width: fit-content; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-soft); animation: dot 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes dot { 0%, 60%, 100% { opacity: .25; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

/* ---------- the Siya files: evidence board ---------- */
.case-board {
  position: relative; overflow: hidden;    /* keep hidden stamps / string from widening the page on phones */
  max-width: 1000px; margin: 0 auto;
  padding: 3.2rem clamp(14px, 4vw, 40px) 2rem;
  border: 12px solid #7a4e2d; border-radius: 12px;
  background-color: #c99a64;
  background-image:
    radial-gradient(rgba(90, 55, 25, .28) 1px, transparent 1.6px),
    radial-gradient(rgba(255, 232, 196, .28) 1px, transparent 1.6px),
    radial-gradient(rgba(70, 40, 15, .18) 1.5px, transparent 2px);
  background-size: 9px 9px, 13px 13px, 23px 23px;
  background-position: 0 0, 4px 6px, 11px 3px;
  box-shadow: inset 0 0 0 2px #5e3a20, inset 0 6px 24px rgba(0, 0, 0, .3), 0 18px 40px rgba(74, 47, 39, .25);
}
.board-label {
  position: absolute; top: .9rem; left: 50%; transform: translateX(-50%) rotate(-1deg);
  background: #fffdf6; padding: .3rem .9rem;
  font-family: 'Special Elite', 'Courier New', monospace; font-size: clamp(.68rem, 2.6vw, .85rem);
  letter-spacing: .12em; white-space: nowrap;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .2);
}
.board-label::before, .board-label::after { /* tape */
  content: ''; position: absolute; top: -8px; width: 34px; height: 16px;
  background: rgba(255, 255, 255, .55); transform: rotate(-8deg);
}
.board-label::before { left: -14px; }
.board-label::after { right: -14px; transform: rotate(8deg); }

.exhibits {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr; gap: 42px;
}
@media (min-width: 760px) {
  .exhibits { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 46px 34px; }
  .exhibit:nth-child(3n + 2) { margin-top: 36px; }
}
@media (max-width: 759px) {          /* phones: a zig-zag down the board */
  .exhibit { width: 86%; }
  .exhibit:nth-child(odd) { justify-self: start; }
  .exhibit:nth-child(even) { justify-self: end; }
}

.exhibit {
  position: relative; text-align: left; color: #2b211d;
  border: 0; padding: 1.5rem 1.1rem 1.2rem;
  transform: rotate(var(--rot));
  box-shadow: 2px 10px 18px rgba(40, 20, 5, .35);
  transition: transform .3s;
}
@media (hover: hover) { .exhibit:hover { transform: rotate(0) translateY(-4px) scale(1.02); } }
.exhibit-card {
  background:
    linear-gradient(transparent 33px, rgba(209, 77, 57, .45) 33px 35px, transparent 35px),
    repeating-linear-gradient(#fffdf6 0 23px, #cfe0ea 23px 24px);
}
.exhibit-sticky { background: #ffe98a; }
.exhibit-pink { background: #ffc9d6; }
.exhibit-kraft { background: #e3c79c; clip-path: polygon(0 2%, 4% 0, 30% 2%, 60% 0, 100% 1%, 99% 40%, 100% 98%, 70% 100%, 35% 98%, 2% 100%, 0 60%); }
.pin-anchor { position: absolute; top: 8px; left: 50%; width: 2px; height: 2px; }

.ex-no { font-family: 'Special Elite', 'Courier New', monospace; font-size: .78rem; letter-spacing: .14em; }
.ex-quote {
  display: block; clear: both;
  font-family: var(--hand); font-weight: 700; font-size: 1.65rem; line-height: 1.1;
  margin: .55rem 0 .6rem;
}
.ex-detail {
  margin: 0; font-family: 'Special Elite', 'Courier New', monospace;
  font-size: .86rem; line-height: 1.7;
}
/* the redaction: a black bar over every line, wiped away when opened */
.redact {
  color: transparent;
  background-image: linear-gradient(#211a17, #211a17);
  background-repeat: no-repeat; background-position: right center; background-size: 100% 78%;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  transition: background-size 1.1s cubic-bezier(.6, 0, .3, 1), color .5s .55s;
}
.exhibit.open .redact { background-size: 0% 78%; color: #2b211d; }
.ex-hint {
  display: block; margin-top: .8rem;
  font-family: var(--display); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase;
  opacity: .6; animation: hint 1.8s ease-in-out infinite;
}
@keyframes hint { 50% { opacity: .25; } }
.exhibit.open .ex-hint { display: none; }
.ex-stamp {
  position: absolute; right: 10px; bottom: 12px;
  border: 3px double #c0392b; color: #c0392b; border-radius: 4px;
  font-family: var(--display); font-weight: 700; font-size: .85rem; letter-spacing: .14em;
  padding: 2px 8px; mix-blend-mode: multiply;
  opacity: 0; transform: rotate(-14deg) scale(2.4);
  pointer-events: none;
}
.exhibit.open .ex-stamp { animation: stamp .45s cubic-bezier(.5, 0, .7, 1.4) 1s forwards; }
@keyframes stamp { 0% { opacity: 0; transform: rotate(-14deg) scale(2.4); } 100% { opacity: .85; transform: rotate(-14deg) scale(1); } }
.exhibit.open { animation: thud .35s ease 1.35s; }
@keyframes thud { 40% { transform: rotate(var(--rot)) scale(.97); } }

/* red string + pin heads (SVG drawn by buildJokes) */
.board-string { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; overflow: visible; }
.board-string .string {
  fill: none; stroke: #c0392b; stroke-width: 2.2; stroke-linecap: round;
  filter: drop-shadow(0 2px 1.5px rgba(0, 0, 0, .35));
  stroke-dasharray: var(--len); stroke-dashoffset: var(--len);
}
.strung .board-string .string { animation: draw-string 1.2s ease forwards; }
.drawn .board-string .string { animation: none; stroke-dashoffset: 0; }
@keyframes draw-string { to { stroke-dashoffset: 0; } }
.pin-head { fill: #d63a3a; stroke: #8f1f1f; stroke-width: 1; filter: drop-shadow(1px 3px 2px rgba(0, 0, 0, .4)); }
.pin-shine { fill: rgba(255, 255, 255, .7); }

.case-status { position: relative; z-index: 1; text-align: center; margin-top: 2.2rem; }
.case-progress {
  display: inline-block; margin: 0;
  background: #fffdf6; padding: .35rem .9rem; transform: rotate(.8deg);
  font-family: 'Special Elite', 'Courier New', monospace; font-size: .85rem;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .2);
}
.verdict {
  margin: 1.2rem auto 0; width: fit-content; max-width: 100%;
  border: 4px double #c0392b; color: #c0392b; background: rgba(255, 253, 246, .9);
  padding: .5rem 1.1rem; transform: rotate(-4deg);
  animation: verdict-in .6s cubic-bezier(.5, 0, .7, 1.4);
}
.verdict span { display: block; font-family: var(--display); font-weight: 700; font-size: 1.4rem; letter-spacing: .2em; }
.verdict b { font-family: 'Special Elite', 'Courier New', monospace; font-weight: 400; font-size: .85rem; }
@keyframes verdict-in { from { opacity: 0; transform: rotate(-4deg) scale(2.2); } to { opacity: 1; transform: rotate(-4deg) scale(1); } }

/* ---------- report card ---------- */
.report {
  max-width: 560px; margin: 0 auto;
  background: var(--paper); border-radius: 18px;
  padding: 1.4rem 1.3rem 1.6rem; position: relative;
  box-shadow: 0 18px 40px rgba(74, 47, 39, .14);
}
.report-top {
  display: flex; justify-content: space-between; gap: 1rem;
  font-family: var(--display); font-size: .72rem; letter-spacing: .14em;
  border-bottom: 2px dashed #ead9c5; padding-bottom: .7rem; margin-bottom: 1rem;
}
.stat { margin-bottom: .9rem; }
.stat-row { display: flex; justify-content: space-between; gap: 1rem; font-size: .95rem; }
.stat-row b { font-family: var(--display); }
.bar { height: 12px; border-radius: 99px; background: var(--peach-2); overflow: hidden; margin-top: .3rem; }
.bar i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--teal), var(--lime));
  border-radius: inherit; transition: width 1.4s cubic-bezier(.2, .8, .2, 1);
}
.report-stamp {
  position: absolute; right: 14px; bottom: -22px;
  border: 3px double var(--red); color: var(--red); background: var(--paper);
  font-family: var(--display); font-weight: 700; font-size: .8rem; line-height: 1.1;
  text-align: center; padding: .4rem .6rem; transform: rotate(-10deg);
}
.chaos-actions {
  max-width: 900px; margin: 3.5rem auto 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 1.6rem;
  text-align: center;
}
.chaos-box .out { min-height: 3em; margin: 1rem 0 0; }

/* ---------- gift boxes ---------- */
.gifts {
  max-width: 960px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px;
}
@media (min-width: 640px) { .gifts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .gifts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.gift {
  /* every card is the same fixed height, closed or open, so the grid never jumps */
  position: relative; height: 170px; border: 0; border-radius: 16px;
  background: var(--c); color: #fff; overflow: hidden;
  font-family: var(--display); font-weight: 600;
  box-shadow: 0 10px 22px rgba(74, 47, 39, .15);
  animation: float 3.5s ease-in-out infinite; animation-delay: var(--d);
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.gift::before, .gift::after { content: ''; position: absolute; background: rgba(255, 255, 255, .55); }
.gift::before { left: 50%; top: 0; bottom: 0; width: 16px; margin-left: -8px; }
.gift::after { top: 50%; left: 0; right: 0; height: 16px; margin-top: -8px; }
.gift .bow { position: relative; z-index: 1; font-size: 2.2rem; }
.gift .num { position: absolute; left: 10px; top: 8px; font-size: .75rem; opacity: .85; z-index: 1; }
/* opening a wish: a gentle tremble, the lid lifts, the card turns and the wish glows in */
.gift.unwrapping { animation: tremble .9s ease-in-out; }
.gift.unwrapping .bow { animation: lid-off .9s ease-in forwards; }
.gift.unwrapping::before, .gift.unwrapping::after { transition: opacity .6s .3s; opacity: 0; }
@keyframes tremble {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(-4deg) scale(1.02); } 30% { transform: rotate(4deg) scale(1.03); }
  45% { transform: rotate(-3deg) scale(1.04); } 60% { transform: rotate(2deg) scale(1.05); }
  80% { transform: scale(1.06); }
}
@keyframes lid-off { 60% { transform: translateY(-14px) rotate(-10deg); opacity: 1; } 100% { transform: translateY(-60px) rotate(-25deg); opacity: 0; } }
.gift.open {
  background: var(--paper); color: var(--ink);
  font-family: var(--hand); font-weight: 500; font-size: 1.25rem; line-height: 1.3;
  padding: 1rem; overflow: visible;
  border: 2px solid var(--c);
  animation: wish-turn 1s cubic-bezier(.2, .8, .2, 1), wish-glow 2.4s ease-out;
}
.gift.open::before, .gift.open::after { display: none; }
@keyframes wish-turn { 0% { transform: perspective(600px) rotateY(90deg) scale(.92); } 100% { transform: none; } }
@keyframes wish-glow {
  0% { box-shadow: 0 0 0 0 rgba(255, 196, 140, 0); }
  35% { box-shadow: 0 0 34px 8px rgba(255, 196, 140, .75); }
  100% { box-shadow: 0 10px 22px rgba(74, 47, 39, .15); }
}
.wish-text { display: block; animation: wish-in 1.6s ease-out .45s both; }
@keyframes wish-in { from { opacity: 0; filter: blur(6px); transform: translateY(8px); } to { opacity: 1; filter: none; transform: none; } }
.wish-heart {
  position: absolute; left: var(--x); bottom: 30%;
  font-size: var(--s); color: var(--c); pointer-events: none;
  opacity: 0; animation: heart-rise 2.2s ease-out var(--d) forwards;
}
@keyframes heart-rise { 0% { opacity: 0; transform: translateY(0) scale(.6); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-110px) scale(1.1) rotate(15deg); } }
@keyframes pop { 0% { transform: scale(.85); } 70% { transform: scale(1.05); } 100% { transform: none; } }

/* ---------- little things (night) ---------- */
.sec-night {
  color: #fff; text-align: center;
  background:
    radial-gradient(1.5px 1.5px at 20% 30%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 70% 20%, #fff, transparent),
    radial-gradient(2px 2px at 40% 70%, var(--peach), transparent),
    radial-gradient(1.5px 1.5px at 85% 65%, #fff, transparent),
    radial-gradient(1px 1px at 10% 85%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 55% 45%, #fff, transparent),
    linear-gradient(#14101f, #2d2145);
}
.sec-night .bulbs { margin: -40px auto 3rem; }
.sec-night em { color: var(--peach); }
.sec-night .eyebrow { color: var(--peach); }
/* phones: a neat 4 + 3; wider screens: all in one row */
.things {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 1.4rem 1rem;
  max-width: calc(4 * 66px + 3 * 1rem); margin: 0 auto;
}
@media (min-width: 700px) { .things { max-width: none; flex-wrap: nowrap; gap: 1.6rem; } }
.things button {
  width: 66px; height: 66px; padding: 0; display: grid; place-items: center;
  background: none; border: 0; font-size: 3rem; line-height: 1;
  animation: float 3s ease-in-out infinite; animation-delay: var(--d);
  transition: transform .2s;
}
@media (hover: hover) { .things button:hover { transform: scale(1.3); } }
.things-out { min-height: 3.2em; max-width: 520px; margin: 2.5rem auto 0; }

.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

/* ---------- hug ---------- */
.hug-gif {
  /* about 300px tall; landscape GIFs get wider, never wider than the screen */
  width: min(max(calc(320px * var(--ar, .74)), 250px), 88vw, 440px); margin: 1.6rem auto 0;
  background: #fff; padding: 8px; border-radius: 14px;
  box-shadow: 0 14px 30px rgba(74, 47, 39, .18);
  transform: rotate(var(--tilt, -2deg));
}
.hug-gif .tenor-gif-embed { border-radius: 8px; overflow: hidden; }
/* all hug GIFs are stacked inside; only the active one shows (and sets the frame's height) */
.hug-gif { position: relative; overflow: hidden; }
.hug-frame { position: absolute; top: 8px; left: 8px; right: 8px; opacity: 0; pointer-events: none; }
.hug-frame.active { position: relative; top: 0; left: 0; right: 0; opacity: 1; pointer-events: auto; }
/* before the first tap: loading quietly, taking up no space */
.hug-gif.parked { height: 0; padding: 0; margin: 0; box-shadow: none; background: none; opacity: 0; }
.hug-gif.arrive { animation: hug-arrive .9s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes hug-arrive { from { opacity: 0; transform: translateY(30px) scale(.6) rotate(-8deg); } to { opacity: 1; transform: rotate(var(--tilt, -2deg)); } }
.hug-gif.squeeze { animation: squeeze .7s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes squeeze { 0% { transform: rotate(-2deg) scale(1); } 40% { transform: rotate(1deg) scale(1.08); } 100% { transform: rotate(-2deg) scale(1); } }
#hugOut { min-height: 2.6em; margin-top: 1.2rem; padding: 0 8px; }

/* ---------- voice note (before the letter) ---------- */
.voice { flex-direction: column; align-items: center; gap: .6rem; margin-bottom: 1.2rem; }
.voice-from { display: flex; align-items: center; gap: .6rem; }
.voice-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--teal); color: #fff;
  display: grid; place-items: center; font-family: var(--display); font-weight: 700;
  background-size: cover; background-position: center; overflow: hidden;
}
.voice-name { font-family: var(--display); font-weight: 700; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; }
.voice-title { font-family: var(--hand); font-size: 1.6rem; margin: 0; }
.voice-card {
  display: flex; align-items: center; gap: .9rem; width: min(360px, 90vw);
  background: #fff; border-radius: 99px; padding: .6rem 1.1rem .6rem .6rem;
  box-shadow: 0 12px 28px rgba(74, 47, 39, .18);
}
.voice-btn {
  flex: none; width: 54px; height: 54px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--red); color: #fff; font-size: 1.2rem; box-shadow: 0 3px 0 #a63a2a; transition: transform .2s;
}
@media (hover: hover) { .voice-btn:hover { transform: translateY(-2px); } }
.voice-btn.pulse { animation: voicePulse 1.6s ease-in-out infinite; }
@keyframes voicePulse { 50% { transform: scale(1.1); } }
.voice-main { flex: 1; min-width: 0; }
.voice-wave { display: flex; align-items: center; gap: 2px; height: 34px; cursor: pointer; touch-action: none; }
.voice-wave i { flex: 1; min-width: 2px; border-radius: 2px; background: rgba(74, 47, 39, .22); transition: background .15s; }
.voice-wave i.on { background: var(--red); }
.voice-wave.playing i.on:last-of-type, .voice-wave.playing i.now { animation: waveBounce .6s ease-in-out infinite alternate; }
@keyframes waveBounce { to { transform: scaleY(1.35); } }
.voice-time { display: flex; justify-content: space-between; font-size: .72rem; opacity: .7; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .voice-btn.pulse, .voice-wave i.now { animation: none !important; } }

/* ---------- letter ---------- */
.envelope {
  position: relative; width: 230px; height: 150px;
  border: 0; border-radius: 10px;
  background: #E9897A; box-shadow: 0 16px 34px rgba(74, 47, 39, .25);
  overflow: hidden; transition: transform .3s;
}
@media (hover: hover) { .envelope:hover { transform: translateY(-6px) rotate(-2deg); } }
.env-flap {
  position: absolute; left: 0; right: 0; top: 0; height: 60%;
  background: #D9705F; clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.env-heart {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--red); color: #fff; font-size: 1.4rem;
  display: grid; place-items: center; box-shadow: 0 3px 0 #a63a2a;
}
.env-label { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; color: #fff; font-family: var(--hand); font-size: 1.5rem; }
.paper {
  max-width: 640px; margin: 0 auto;
  background:
    linear-gradient(90deg, transparent 38px, rgba(209, 77, 57, .25) 38px 40px, transparent 40px),
    repeating-linear-gradient(var(--paper) 0 37px, #e8ddcf 37px 38px);
  border-radius: 6px;
  padding: 2.2rem 1.4rem 2rem 3.2rem;
  box-shadow: 0 18px 40px rgba(74, 47, 39, .18);
  animation: unfold .9s ease-out;
}
@keyframes unfold { from { opacity: 0; transform: translateY(40px) rotateX(35deg); } }
.paper-text { font-family: var(--hand); font-size: 1.45rem; line-height: 38px; white-space: pre-wrap; }
.paper-sign { font-family: var(--hand); font-size: 1.6rem; text-align: right; margin: 1rem 0 0; color: var(--teal); }
.letter-actions { gap: .8rem; flex-wrap: wrap; margin-top: 1.4rem; align-items: center; flex-direction: column; }
#letterStatus { margin: 0; min-height: 1.4em; }

/* ---------- loading screen ---------- */
.loader {
  position: fixed; inset: 0; z-index: 300; background: var(--night); color: #ffe2b8;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem;
  font-family: var(--hand); font-size: 1.6rem;
  animation: loader-in .4s ease .5s both;           /* invisible if the page loads quickly */
}
.loader.done { animation: loader-out .6s ease forwards; pointer-events: none; }
@keyframes loader-in { from { opacity: 0; } }
@keyframes loader-out { to { opacity: 0; visibility: hidden; } }
.loader p { margin: 0; }
.loader-candle { position: relative; width: 14px; height: 54px; border-radius: 3px; background: repeating-linear-gradient(135deg, #fff 0 6px, #ff8fb1 6px 12px); }
.loader-candle i {
  position: absolute; left: 50%; bottom: 100%; width: 16px; height: 26px; margin: 0 0 4px -8px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(ellipse at 50% 70%, #fff6c8, #ffc23d 45%, #ff7a2b 80%);
  box-shadow: 0 0 22px 6px rgba(255, 190, 90, .55);
  transform-origin: 50% 100%; animation: candle 1s ease-in-out infinite alternate;
}
@keyframes candle { from { transform: scale(1) rotate(-3deg); } to { transform: scale(1.12, .92) rotate(3deg); } }

/* ---------- blowing into the mic ---------- */
.mic-btn { display: block; margin: .4rem auto 0; }
.cake-final.blowing::after { animation: flicker .12s ease-in-out infinite alternate; }
.cake-final.blowing .cake-lit { opacity: .55; transition: opacity .15s; }
.mic-level { display: block; width: 140px; height: 6px; margin: .6rem auto 0; border-radius: 99px; background: rgba(74, 47, 39, .15); overflow: hidden; }
.mic-level i { display: block; height: 100%; width: 0; background: var(--teal); transition: width .08s; }

/* ---------- "open when" see more ---------- */
.ow-more-btn { display: block; margin: 1.8rem auto 0; }
.ow.ow-late { animation: drop-in .7s cubic-bezier(.3, 1.4, .5, 1) both; animation-delay: var(--delay, 0s); }

/* ---------- the Aadhaar joke ---------- */
.kyc {
  margin: 2.6rem auto 0; width: min(440px, 100%); text-align: left;
  background: #fff; color: var(--ink); border-radius: 12px; padding: 1.2rem 1.2rem 1rem;
  border-top: 6px solid; border-image: linear-gradient(90deg, #ff9933 0 33%, #fff 33% 66%, #138808 66%) 1;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
}
.kyc-tag { margin: 0; font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft); }
.kyc h3 { font-family: var(--serif); font-weight: 600; font-size: 1.45rem; margin: .3rem 0 .4rem; }
.kyc-text { margin: 0 0 1rem; }
.kyc-drop {
  display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 1rem; width: 100%;
  border: 2px dashed #d9c9b6; border-radius: 10px; background: #fffaf3; color: var(--ink-soft); font-size: .8rem; margin-bottom: 1rem;
  transition: background .2s, border-color .2s;
}
@media (hover: hover) { .kyc-drop:hover { background: #fff3e3; border-color: var(--teal); } }
.kyc-drop b { color: var(--ink); font-size: .95rem; }
.kyc-card { font-size: 2.2rem; line-height: 1; }
.kyc-btns { display: flex; gap: .6rem; }
.kyc-btns .btn { flex: 1; padding-left: .5rem; padding-right: .5rem; font-size: .9rem; }
.kyc-progress { margin-top: .2rem; text-align: center; font-size: .82rem; color: var(--ink-soft); }
.kyc-bar { height: 10px; border-radius: 99px; background: #eee3d6; overflow: hidden; margin-bottom: .4rem; }
.kyc-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ff9933, #138808); transition: width .15s linear; }
.kyc-fine { margin: .6rem 0 0; font-size: .7rem; color: var(--ink-soft); text-align: center; }
.bat {
  position: fixed; inset: 0; z-index: 176; display: grid; place-items: center; padding: 16px;
  background: rgba(5, 5, 10, .9); animation: credits-in .25s ease both;
}
.bat-card {
  width: min(360px, 100%); background: #111; color: #f5d90a; border-radius: 16px; padding: 12px 12px 18px; text-align: center;
  box-shadow: 0 0 0 2px #f5d90a, 0 20px 60px rgba(0, 0, 0, .6);
  animation: bat-in .6s cubic-bezier(.3, 1.5, .5, 1) both;
}
.bat-card img { width: 100%; height: auto; max-height: 58vh; max-height: 58dvh; object-fit: cover; border-radius: 10px; }
.bat-text { font-family: var(--serif); font-weight: 600; font-size: 1.35rem; line-height: 1.25; margin: .9rem 0 1rem; }
@keyframes bat-in { from { opacity: 0; transform: scale(.4) rotate(-20deg); } }
@media (prefers-reduced-motion: reduce) { .bat-card, .ow.ow-late { animation: none; } }

/* ---------- the bouquet ---------- */
.bouquet {
  position: fixed; inset: 0; z-index: 175; overflow: hidden;
  background: rgba(20, 16, 31, .84); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  display: flex; flex-direction: column; align-items: center; padding: max(28px, env(safe-area-inset-top)) 16px 0;
  animation: credits-in .8s ease both;
}
.bouquet.out { animation: credits-out .7s ease forwards; }
.bq-before { color: #ffe2b8; font-size: clamp(1.8rem, 7vw, 2.5rem); margin: 0 0 1rem; text-align: center; animation: bq-fade 1s ease .3s both; }
.bq-card {
  position: relative; z-index: 2; width: min(380px, 100%); margin-left: auto; margin-right: max(0px, calc(50% - 360px));
  background: var(--paper); color: var(--ink); border-radius: 14px; padding: 1.1rem 1.2rem 1.2rem; text-align: center;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35); transform: rotate(1.5deg);
  animation: bq-fade 1s ease 2.2s both;
}
.bq-note { font-family: var(--hand); font-size: 1.4rem; line-height: 1.3; margin: 0 0 .9rem; }
.bq-after { margin: .2rem 0 .7rem; color: var(--teal); font-size: 1.5rem; }
.bq-img {
  position: absolute; left: 0; bottom: 0; z-index: 1;
  height: min(64vh, 600px); width: auto; max-width: none;
  transform-origin: 0% 100%;
  animation: bq-in 1.6s cubic-bezier(.22, 1.2, .36, 1) .7s both, bq-sway 3.2s ease-in-out 2.4s infinite;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .4));
}
.bouquet.taken .bq-img { animation: bq-take .9s cubic-bezier(.3, 1.5, .5, 1) both, bq-sway 3.2s ease-in-out .9s infinite; }
@keyframes bq-fade { from { opacity: 0; transform: translateY(12px); } }
@keyframes bq-in { from { transform: translateX(-105%) rotate(-12deg); } to { transform: none; } }
@keyframes bq-sway { 50% { transform: rotate(2.5deg); } }
@keyframes bq-take { 40% { transform: translate(6%, -3%) scale(1.08) rotate(3deg); } to { transform: none; } }
.bq-again { display: block; margin: 2rem auto 0; color: inherit; }
@media (min-width: 760px) { .bq-img { height: min(78vh, 680px); } }
@media (prefers-reduced-motion: reduce) { .bq-img, .bouquet.taken .bq-img, .bq-card, .bq-before { animation: none !important; } }

/* ---------- end credits ---------- */
.credits {
  position: fixed; inset: 0; z-index: 180; overflow: hidden;
  background: radial-gradient(ellipse at 50% 120%, #2d2145, #0b0912 70%); color: #f5e9dc;
  display: flex; justify-content: center; animation: credits-in 1.2s ease both;
}
.credits.out { animation: credits-out 1s ease forwards; }
@keyframes credits-in { from { opacity: 0; } }
@keyframes credits-out { to { opacity: 0; } }
.credits-roll {
  position: absolute; top: 100%; width: min(560px, calc(100% - 32px)); text-align: center;
  animation: credits-roll var(--dur, 26s) linear forwards;
}
@keyframes credits-roll { to { transform: translateY(calc(-100% - 100vh)); } }
.credits-title { font-family: var(--serif); font-weight: 600; font-size: clamp(2rem, 8vw, 3.2rem); letter-spacing: .04em; margin: 0 0 4.5rem; }
.credits-title small { display: block; font-family: var(--body); font-size: .75rem; letter-spacing: .4em; opacity: .6; margin-bottom: 1rem; }
.credit { margin: 0 0 2.6rem; }
.credit span { display: block; font-size: .72rem; letter-spacing: .3em; text-transform: uppercase; opacity: .6; margin-bottom: .45rem; }
.credit b { font-family: var(--serif); font-weight: 500; font-size: clamp(1.3rem, 5vw, 1.75rem); line-height: 1.25; }
.credits-end { font-family: var(--hand); font-size: clamp(1.7rem, 6.5vw, 2.4rem); color: var(--peach); margin: 5rem 0 0; }
.credits-fin { font-family: var(--serif); font-style: italic; font-size: 2.6rem; margin: 3rem 0 0; opacity: .85; }
.credits-skip {
  position: absolute; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 1;
  background: rgba(255, 255, 255, .12); color: #fff; border: 0; border-radius: 99px; padding: .5rem 1rem; font-size: .85rem;
}
@media (prefers-reduced-motion: reduce) { .credits-roll { animation: none; top: 50%; transform: translateY(-50%); } }

/* ---------- final ---------- */
.sec-final {
  text-align: center; min-height: 100vh;
  display: flex; flex-direction: column; align-items: center;
  background-color: var(--peach);
  transition: background-color 2.5s;
}
.sec-final .bulbs { margin: -40px auto 2rem; }
.sec-final.dark { background-color: var(--night); color: #fff; }
.sec-final.dark em { color: var(--peach); }
.cake-final { --D: min(280px, 72vw); opacity: 1; transform: none; cursor: pointer; }
.final-hint { margin-top: 1.4rem; }
.final-msg { max-width: 600px; margin: 2rem auto 0; animation: pop .8s; }
.final-msg .muted { color: rgba(255, 255, 255, .7); }
.envelope-small { width: 150px; height: 98px; margin: .8rem auto 0; }
.envelope-small .env-heart { width: 34px; height: 34px; font-size: 1rem; }
.paper-small { color: var(--ink); text-align: left; margin-top: 1.5rem; }
.paper-small p { margin: 0; font-family: var(--hand); font-size: 1.45rem; line-height: 38px; white-space: pre-wrap; }
footer { margin-top: auto; padding-top: 4rem; font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; opacity: .55; }

/* ---------- lightbox / toast / music ---------- */
.toast {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 14px); z-index: 160;
  transform: translate(-50%, -30px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: .7rem 1.2rem; border-radius: 999px;
  font-size: .92rem; max-width: calc(100vw - 32px); text-align: center;
  transition: opacity .3s, transform .3s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.music-toggle {
  position: fixed; right: 10px; top: calc(env(safe-area-inset-top, 0px) + 10px); z-index: 120;
  width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: var(--teal); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}
.music-toggle svg { width: 22px; height: 22px; fill: currentColor; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
.chaos-box .btn { width: 100%; max-width: 320px; }
.finding { margin-top: 1.2rem; padding-top: .9rem; border-top: 2px dashed #ead9c5; }
.finding span { font-family: var(--display); font-size: .72rem; letter-spacing: .14em; color: var(--red); }
.finding p { margin: .2rem 0 0; }

/* ---------- "open when…" envelopes ---------- */
.ow-grid {
  max-width: 900px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 18px;
}
@media (min-width: 760px) { .ow-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ow {
  position: relative; aspect-ratio: 4 / 3; border: 0; padding: 0;
  background: var(--c); border-radius: 8px; overflow: hidden;
  box-shadow: 0 12px 22px rgba(74, 47, 39, .18);
  transform: rotate(var(--r)); transition: transform .3s;
}
@media (hover: hover) { .ow:hover { transform: rotate(0) translateY(-5px); } }
.ow::before { /* envelope's lower folds */
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top right, rgba(0, 0, 0, .08) 50%, transparent 50%) left bottom / 50% 100% no-repeat,
              linear-gradient(to top left, rgba(0, 0, 0, .08) 50%, transparent 50%) right bottom / 50% 100% no-repeat;
}
.ow-flap {
  position: absolute; left: 0; right: 0; top: 0; height: 44%;
  background: var(--c); filter: brightness(.9);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top; transition: transform .6s;
  z-index: 2;
}
.ow-seal {
  position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); z-index: 3;
  width: 30px; height: 30px; border-radius: 50%;
  background: #b8323f; color: #fff; display: grid; place-items: center; font-size: 1rem;
  box-shadow: 0 2px 0 #7e1f29, 0 4px 8px rgba(0, 0, 0, .25);
  transition: opacity .3s;
}
.ow-label {
  position: absolute; left: 8px; right: 8px; top: 58%; bottom: 6px; z-index: 1;
  display: flex; flex-direction: column; justify-content: center;
  color: #fff; text-align: center; line-height: 1.15; text-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.ow-label small { display: block; font-family: var(--display); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; opacity: .9; }
.ow-label b { font-family: var(--hand); font-size: clamp(1.05rem, 4vw, 1.35rem); }
.ow-stamp {
  position: absolute; top: 8px; right: 8px; z-index: 4;
  font-family: var(--display); font-weight: 700; font-size: .62rem; letter-spacing: .12em;
  background: #fff; color: var(--c); padding: 2px 7px; border-radius: 999px;
  opacity: 0; transform: scale(.6); transition: opacity .3s, transform .3s;
}
.ow.opening .ow-flap, .ow.opened .ow-flap { transform: rotateX(180deg); }
.ow.opening .ow-seal, .ow.opened .ow-seal { opacity: 0; }
.ow.opening { animation: tremble .65s ease-in-out; }
.ow.opened .ow-stamp { opacity: 1; transform: none; }
.ow.opened { filter: saturate(.75); }

.ow-modal, .egg, .meme-pop {
  position: fixed; inset: 0; z-index: 180;
  background: rgba(20, 16, 31, .6); display: grid; place-items: center; padding: 16px;
}
.ow-paper {
  position: relative; width: min(460px, 100%); max-height: 86vh; max-height: 86dvh; overflow: auto;
  background:
    linear-gradient(90deg, transparent 30px, rgba(209, 77, 57, .25) 30px 32px, transparent 32px),
    repeating-linear-gradient(var(--paper) 0 33px, #e8ddcf 33px 34px);
  padding: 1.6rem 1.3rem 1.4rem 2.6rem; border-radius: 6px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, .3);
  animation: unfold .7s ease-out;
}
.ow-paper h3 { font-family: var(--hand); font-size: 2rem; line-height: 1.1; margin: .2rem 0 .6rem; color: var(--teal); }
.ow-note { font-family: var(--hand); font-size: 1.4rem; line-height: 34px; margin: 0; white-space: pre-wrap; }
.ow-sign { font-family: var(--hand); font-size: 1.4rem; text-align: right; margin: .6rem 0 0; color: var(--red); }
.ow-modal .close, .egg .close, .meme-pop .close {
  position: absolute; right: 8px; top: 8px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: var(--red); color: #fff; font-size: .9rem;
}

/* ---------- meme pop-up (tarot cards, after the pinky promise) ---------- */
.meme-pop { z-index: 200; background: rgba(20, 16, 31, .72); }
.meme-card {
  position: relative; width: min(440px, 100%); max-height: 92vh; max-height: 92dvh; overflow: auto;
  display: flex; flex-direction: column; align-items: center; gap: 1rem; text-align: center;
  background: linear-gradient(160deg, #fff6ea, #ffe0ec); border-radius: 22px;
  padding: 1.4rem 1.1rem 1.3rem; box-shadow: 0 24px 60px rgba(0, 0, 0, .35), inset 0 0 0 2px rgba(217, 180, 90, .55);
}
.meme-card.pop { animation: egg-pop .6s cubic-bezier(.3, 1.6, .5, 1); }
.meme-label { margin: 0; padding: 0 36px; }                 /* clear of the ✕ */
.meme-card img {
  display: block; max-width: 100%; max-height: 64vh; max-height: 64dvh; width: auto; height: auto;
  border-radius: 12px; box-shadow: 0 10px 24px rgba(74, 47, 39, .2); background: #fff;
}
.meme-label[hidden] + img { margin-top: 1.6rem; }          /* no label: keep the picture clear of the ✕ */
@media (prefers-reduced-motion: reduce) { .meme-card.pop { animation: none; } }

/* ---------- easter egg ---------- */
.egg { z-index: 250; background: rgba(20, 16, 31, .72); }
.egg-card {
  position: relative; width: min(400px, 100%); text-align: center;
  background: linear-gradient(160deg, #fff6ea, #ffe0ec); border-radius: 22px;
  padding: 2rem 1.4rem 1.6rem; box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
  animation: egg-pop .7s cubic-bezier(.3, 1.6, .5, 1);
}
@keyframes egg-pop { from { opacity: 0; transform: scale(.4) rotate(-10deg); } to { opacity: 1; transform: none; } }
.egg-icon { font-size: 3rem; animation: float 2.4s ease-in-out infinite; }
.egg-card h3 { font-family: var(--display); font-size: 1.6rem; margin: .4rem 0 .5rem; }
.egg-card p { font-family: var(--hand); font-size: 1.35rem; line-height: 1.35; margin: 0 0 1.2rem; }

/* ---------- GIF placeholders (until the video loads, or if it can't) ---------- */
.tenor-gif-embed video { display: block; width: 100%; height: 100%; object-fit: cover; background: transparent; }
.tenor-gif-embed {
  position: relative;
  background: repeating-linear-gradient(45deg, #fff3e6 0 12px, #ffe9d6 12px 24px);
}
.tenor-gif-embed:not([data-processed]) > a { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.tenor-gif-embed::before {
  content: '🐾\A loading the dance moves…'; white-space: pre-line;
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
  padding: 6px; font-family: var(--hand); font-size: clamp(.8rem, 2.6vw, 1.1rem); line-height: 1.25;
  color: #b07a62; animation: paw 1.4s ease-in-out infinite;
}
.tenor-gif-embed[data-processed]:not(.gif-offline)::before { display: none; }   /* video has a frame: drop the placeholder text */
.dance-tile .tenor-gif-embed::before { content: '🐾\A loading…'; }
.hug-frame .tenor-gif-embed::before { content: '🤗\A a hug is on its way…'; font-size: 1.3rem; }
@keyframes paw { 50% { opacity: .55; transform: translateY(-3px); } }
.tenor-gif-embed.gif-offline { aspect-ratio: auto !important; min-height: 90px; height: 100%; }
.tenor-gif-embed.gif-offline::before { content: '📶\A no internet right now…\A imagine cats dancing 🐾'; animation: none; }
.dance-tile .tenor-gif-embed.gif-offline { min-height: 0; height: auto; aspect-ratio: var(--ar) !important; }
.dance-tile .tenor-gif-embed.gif-offline::before { content: '📶\A no internet'; }
.hug-frame .tenor-gif-embed.gif-offline { min-height: 220px; }
.hug-frame .tenor-gif-embed.gif-offline::before { content: '📶\A no internet, but\A consider yourself hugged 🤗'; }

/* ---------- write back to me ---------- */
.reply {
  margin: 2.6rem auto 0; width: min(440px, 100%); text-align: left;
  background: var(--paper); color: var(--ink);
  border-radius: 16px; padding: 1.3rem 1.2rem 1.1rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
  transform: rotate(-1deg);
}
.reply h3 { font-family: var(--display); font-size: 1.45rem; margin: 0 0 .2rem; }
.reply-sub { margin: 0 0 .8rem; color: var(--ink-soft); font-size: .95rem; }
.reply textarea {
  width: 100%; resize: vertical; min-height: 120px;
  border: 2px solid var(--peach); border-radius: 12px; padding: .7rem .8rem;
  font-family: var(--hand); font-size: 1.35rem; line-height: 1.3; color: var(--ink);
  background: repeating-linear-gradient(#fff 0 31px, #f0e4d6 31px 32px);
}
.reply textarea:focus { outline: none; border-color: var(--teal); }
.reply .btn { margin-top: .8rem; width: 100%; }
.reply-status { min-height: 1.3em; margin: .6rem 0 0; font-size: .9rem; color: var(--red); text-align: center; }
.reply-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.reply-sent {
  margin: 2.6rem auto 0; width: min(440px, 100%);
  background: rgba(255, 255, 255, .08); border: 1.5px dashed rgba(255, 218, 185, .6);
  border-radius: 16px; padding: 1.2rem; animation: pop .5s;
}
.reply-sent .hand { margin: 0; color: var(--peach); }
.reply-sent p { margin: .3rem 0 .6rem; }
.reply-sent .link-btn { color: #fff; }

/* ---------- tap sparkles ---------- */
.tap-spark {
  position: fixed; z-index: 400; pointer-events: none; line-height: 1;
  transform: translate(-50%, -50%);
  animation: spark .75s ease-out forwards;
}
@keyframes spark {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(.4); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.1) rotate(25deg); }
}

/* ---------- make-a-wish pause ---------- */
body::after {                                   /* the dimmed world */
  content: ''; position: fixed; inset: 0; z-index: 150; pointer-events: none;
  background: radial-gradient(circle at 50% 42%, rgba(20, 14, 30, .55), rgba(10, 8, 18, .92) 60%);
  opacity: 0; transition: opacity 1.2s ease;
}
body.wishing::after { opacity: 1; pointer-events: auto; }
body.wishing .cake-final { position: relative; z-index: 151; filter: drop-shadow(0 0 40px rgba(255, 200, 120, .55)); }
.cake-final { transition: filter 1s; }
.wish {
  position: fixed; left: 0; right: 0; bottom: 14vh; z-index: 152;
  text-align: center; color: #ffe9d2; padding: 0 16px;
  animation: wish-in 1.2s ease both;
}
@keyframes wish-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.wish-line { font-size: clamp(1.6rem, 6vw, 2.3rem); margin: 0 0 .4rem; text-shadow: 0 0 18px rgba(255, 200, 120, .5); }
.wish-count {
  display: inline-block; min-height: 1.2em; font-family: var(--display); font-weight: 700; font-size: 3rem;
  color: rgba(255, 233, 210, .85); text-shadow: 0 0 24px rgba(255, 200, 120, .7);
}
.wish-count.soft { animation: soft-count 1s ease-out; }
@keyframes soft-count { 0% { opacity: 0; transform: scale(1.5); filter: blur(4px); } 30% { opacity: 1; filter: none; } 100% { opacity: .35; transform: scale(.9); } }
/* after the wish: the cake gently invites the tap */
.cake-final.ready { animation: invite 1.6s ease-in-out infinite; }
@keyframes invite { 50% { transform: scale(1.04); } }

/* ---------- the little cat that walks with her ---------- */
.buddy {
  position: fixed; left: 0; bottom: calc(env(safe-area-inset-bottom, 0px) + 4px); z-index: 100;
  width: 62px; pointer-events: none;
  opacity: 0; transition: opacity .5s, transform .12s linear;
}
.buddy.show { opacity: 1; }
/* two frames of the same cat stacked: holding the McFloat (scrolling) and sipping it (stopped) */
.buddy-cat { position: relative; transform-origin: 50% 100%; transition: transform .35s ease, scale .2s ease; }
.buddy.left .buddy-cat { scale: -1 1; }                  /* faces the way she scrolls (separate property, so animations still work) */
.buddy-cat img { width: 100%; display: block; filter: drop-shadow(0 4px 5px rgba(74, 47, 39, .3)); }
.buddy-cat .bc-drink { position: absolute; left: 0; bottom: 0; opacity: 0; }
.buddy-cat .bc-hold, .buddy-cat .bc-drink { transition: opacity .22s ease; }
.buddy.walking .buddy-cat { animation: waddle .32s ease-in-out infinite alternate; }
@keyframes waddle { from { transform: rotate(-6deg) translateY(0); } to { transform: rotate(6deg) translateY(-4px); } }
/* sipping: cup comes up, a little tilt back, slow swallow bobs */
.buddy.sip .bc-drink { opacity: 1; }
.buddy.sip .bc-hold { opacity: 0; }
.buddy.sip .buddy-cat { animation: sip 1.3s ease-in-out infinite; }
@keyframes sip {
  0%, 100% { transform: translateY(-1px) rotate(-3deg); }
  35% { transform: translateY(-2px) rotate(-4.5deg) scaleY(1.01); }
  55% { transform: translateY(0) rotate(-2.5deg) scaleY(.975); }
  75% { transform: translateY(-1px) rotate(-3.5deg); }
}
/* between sips: cup down, a happy little settle */
.buddy.savour .buddy-cat { animation: savour 1.6s ease-in-out infinite; }
@keyframes savour { 0%, 100% { transform: none; } 50% { transform: translateY(-1px) scaleY(.985); } }
.buddy-slurp { position: absolute; bottom: 70%; left: 62%; font-family: var(--hand); font-weight: 700; font-size: .95rem; color: #e36a2e; white-space: nowrap; pointer-events: none; animation: slurp 1.4s ease-out forwards; }
.buddy.left .buddy-slurp { left: auto; right: 62%; }
@keyframes slurp { 0% { opacity: 0; transform: translateY(4px) scale(.7); } 25% { opacity: 1; transform: translateY(-4px) scale(1); } 100% { opacity: 0; transform: translateY(-20px) scale(1.05); } }
@media (prefers-reduced-motion: reduce) { .buddy-cat, .buddy.walking .buddy-cat, .buddy.sip .buddy-cat, .buddy.savour .buddy-cat { animation: none !important; } }
.buddy-heart {
  position: absolute; left: 50%; top: -14px; transform: translateX(-50%) scale(.3);
  color: #ff5f8f; font-size: 1.2rem; opacity: 0; transition: opacity .4s, transform .4s;
}
.buddy.home .buddy-heart { opacity: 1; transform: translateX(-50%) scale(1); animation: float 1.6s ease-in-out infinite; }

/* ---------- shooting stars ---------- */
.sec-night { overflow: hidden; }
.shooting-star {
  position: absolute; z-index: 2; width: 56px; height: 56px; padding: 0; border: 0; background: none;
  animation: shoot 2.6s cubic-bezier(.3, .1, .6, 1) forwards;
}
.shooting-star i {
  position: absolute; right: 18px; top: 50%; width: 110px; height: 2px; margin-top: -1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 240, 210, .9));
  transform: rotate(20deg); transform-origin: right center; border-radius: 2px;
}
.shooting-star i::after {
  content: ''; position: absolute; right: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 10px 3px rgba(255, 230, 180, .9);
}
@keyframes shoot {
  0% { opacity: 0; transform: translate(0, 0); }
  10% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(min(46vw, 420px), min(17vw, 150px)); }
}
.star-wish {
  /* centred with margins (not transform) so the animation can't knock it sideways */
  position: absolute; left: 0; right: 0; margin: 0 auto; z-index: 3; width: min(320px, 86%);
  background: rgba(45, 33, 69, .88); border: 1px solid rgba(255, 233, 210, .45);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35), 0 0 24px rgba(255, 220, 160, .15);
  border-radius: 14px; padding: .7rem .9rem; text-align: center; color: #fff;
  will-change: transform, opacity;
  animation: star-wish-in .55s cubic-bezier(.2, .9, .3, 1.15) both;
  transition: opacity .5s ease, transform .5s ease;
}
@keyframes star-wish-in { from { opacity: 0; transform: translateY(14px) scale(.92); } to { opacity: 1; transform: none; } }
.star-wish b { display: block; font-family: var(--display); color: #FFDAB9; margin-bottom: .15rem; }
.star-wish span { font-family: var(--hand); font-size: 1.25rem; line-height: 1.25; }
.star-wish.bye { opacity: 0; transform: translateY(-10px); }
@media (prefers-reduced-motion: reduce) { .star-wish { animation: none; } }

/* ---------- paper airplane reply ---------- */
.reply.folding { animation: fold .5s ease-in forwards; pointer-events: none; }
@keyframes fold {
  0% { transform: rotate(-1deg); }
  60% { transform: perspective(700px) rotateX(70deg) scale(.6); opacity: .8; }
  100% { transform: perspective(700px) rotateX(85deg) scale(.15); opacity: 0; }
}
.paper-plane {
  position: fixed; z-index: 300; width: 64px; height: 64px; margin: -32px 0 0 -32px; pointer-events: none;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .35));
  animation: plane-in .45s cubic-bezier(.3, 1.6, .5, 1) both;
}
.paper-plane svg { width: 100%; height: 100%; display: block; }
@keyframes plane-in { from { transform: scale(.2) rotate(-30deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
.paper-plane.fly { animation: plane-fly 1.9s cubic-bezier(.45, 0, .7, .4) forwards; }
@keyframes plane-fly {
  0% { transform: translate(0, 0) rotate(0) scale(1); opacity: 1; }
  25% { transform: translate(-40px, 30px) rotate(-12deg) scale(1); }
  60% { transform: translate(40vw, -30vh) rotate(-28deg) scale(.8); opacity: 1; }
  100% { transform: translate(90vw, -110vh) rotate(-35deg) scale(.5); opacity: 0; }
}

/* ---------- "you stayed" ---------- */
.stayed {
  margin: .6rem auto 0; max-width: 420px;
  font-family: var(--hand); font-size: 1.3rem; line-height: 1.3; color: rgba(255, 233, 210, .85);
  animation: wish-in 1.4s ease .8s both;
}

@media (min-width: 640px) { .gift { height: 190px; } }
.gift.open { display: flex; align-items: center; justify-content: center; }
.gift.open .wish-text { max-width: 100%; overflow-wrap: anywhere; }


/* ---------- heart cursor + sparkle trail (laptops / mouse only) ---------- */
@media (pointer: fine) {
  html, body { cursor: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2232%22 height=%2232%22 viewBox=%220 0 32 32%22%3E%3Cpath d=%22M16 28s-11-6.6-11-14.2A6.3 6.3 0 0 1 16 9.6a6.3 6.3 0 0 1 11 4.2C27 21.4 16 28 16 28z%22 fill=%22%23fff6ea%22 stroke=%22%23e8467c%22 stroke-width=%222.4%22 stroke-linejoin=%22round%22/%3E%3C/svg%3E") 16 16, auto; }
  a, button, label, [role="button"], .gift, .exhibit, .ow, .polaroid-card, .lab-slot, .things button,
  .cake-img, .bdtext.show, .shooting-star, .envelope, .gang-member {
    cursor: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2232%22 height=%2232%22 viewBox=%220 0 32 32%22%3E%3Cpath d=%22M16 28s-11-6.6-11-14.2A6.3 6.3 0 0 1 16 9.6a6.3 6.3 0 0 1 11 4.2C27 21.4 16 28 16 28z%22 fill=%22%23ff5f8f%22 stroke=%22%23fff%22 stroke-width=%222.2%22 stroke-linejoin=%22round%22/%3E%3C/svg%3E") 16 16, pointer !important;
  }
  textarea, input[type="text"], input[type="password"] { cursor: text !important; }
}
.cursor-spark {
  position: fixed; z-index: 390; pointer-events: none; line-height: 1;
  transform: translate(-50%, -50%); color: #ff7fa8;
  animation: cursor-spark .9s ease-out forwards;
}
@keyframes cursor-spark {
  0% { opacity: .75; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, calc(-50% + 14px)) scale(.4) rotate(40deg); }
}

/* ---------- keyboard focus ---------- */
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.gang-member:focus-visible { outline-offset: 0; border-radius: 12px; }

.paper-hint { text-align: center; font-size: .72rem; opacity: .6; margin: .6rem 0 0; }

/* ============================================================
   CUTE EXTRAS
   ============================================================ */

/* ---------- the walking cat: tap to purr, falls asleep when she stops ---------- */
.buddy.show { pointer-events: auto; cursor: pointer; touch-action: none; }   /* touch-action: a swipe on the cat moves the cat, not the page */
.buddy-say {
  position: absolute; bottom: 100%; left: 50%; margin-bottom: 18px; transform: translateX(-30%);
  white-space: nowrap; background: #fff; color: var(--ink); font-family: var(--hand); font-size: 1.05rem;
  padding: .15rem .6rem; border-radius: 12px; box-shadow: 0 4px 12px rgba(74, 47, 39, .2);
  animation: say-in .3s ease both; pointer-events: none;
}
@keyframes say-in { from { opacity: 0; transform: translateX(-30%) translateY(6px) scale(.9); } }
.buddy.sleeping .buddy-cat { animation: snooze 2.6s ease-in-out infinite; }
.buddy.has-drink.sleeping .bc-hold { opacity: 0; } .buddy.has-drink.sleeping .bc-drink { opacity: 1; }   /* eyes-closed frame */
@keyframes snooze { 0%, 100% { transform: rotate(-6deg) scaleY(.92) translateY(3px); } 50% { transform: rotate(-6deg) scaleY(.96) translateY(2px); } }
.buddy-z { position: absolute; left: 60%; top: -6px; font-family: var(--display); font-weight: 700; color: var(--purple); pointer-events: none; opacity: 0; }
.buddy.sleeping .buddy-z { animation: zzz 2.4s ease-in infinite; }
.buddy.sleeping .buddy-z:nth-of-type(2) { animation-delay: .8s; font-size: .8rem; }
.buddy.sleeping .buddy-z:nth-of-type(3) { animation-delay: 1.6s; font-size: .65rem; }
@keyframes zzz { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(18px, -34px) scale(1.2); } }
.buddy.stretch .buddy-cat { animation: stretch .7s ease-out; }
@keyframes stretch { 30% { transform: scaleX(1.18) scaleY(.85); } 60% { transform: scaleY(1.1); } }

/* ---------- hold to hug (also the pinky promise button) ---------- */
.hold-hug { text-align: center; margin-top: 2.4rem; }
.hold-hug .hand { margin: 0 0 .6rem; }
.hold-btn {
  position: relative; width: 120px; height: 120px; border: 0; padding: 0; border-radius: 50%;
  background: #fff; box-shadow: 0 10px 24px rgba(74, 47, 39, .18);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: none;
  transition: transform .2s;
}
.hold-btn.holding { transform: scale(.94); }
.hold-btn svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.hold-track { fill: none; stroke: #f1e4d4; stroke-width: 8; }
.hold-ring { fill: none; stroke: var(--red); stroke-width: 8; stroke-linecap: round; stroke-dasharray: 339.3; stroke-dashoffset: 339.3; }
.hold-face { position: relative; font-size: 2.6rem; pointer-events: none; display: inline-block; }
.hold-btn.holding .hold-face { animation: squeeze .5s ease-in-out infinite alternate; }
@keyframes squeeze { to { transform: scale(1.18); } }
.hold-btn.done { box-shadow: 0 0 0 6px rgba(209, 77, 57, .15), 0 10px 24px rgba(74, 47, 39, .18); }
.hold-out { min-height: 1.4em; margin: .8rem 0 0; }
.hold-small { width: 96px; height: 96px; }
.hold-small .hold-face { font-size: 2.1rem; }

/* ---------- the moon above the letter ---------- */
/* uses the separate scale/rotate properties so the heading reveal (which sets transform) can't cancel them */
button.sec-moon { margin: 0 auto .6rem; border: 0; background: none; padding: .2rem .5rem; min-width: 44px; min-height: 44px; cursor: pointer; transition: color .4s, text-shadow .4s, scale .3s, rotate .3s; }
@media (hover: hover) { button.sec-moon:hover { rotate: -12deg; } }
.sec-moon.blush { color: #ffb3c7; text-shadow: 0 0 26px rgba(255, 150, 190, .9); scale: 1.15; rotate: -12deg; }
.moon-say { display: block; min-height: 1.6em; margin-top: -.4rem; font-family: var(--hand); font-size: 1.3rem; color: #ffe2b8; }
.moon-say.show { animation: moon-say-in .35s ease both; }
@keyframes moon-say-in { from { opacity: 0; transform: translateY(6px); } }
.twinkle { position: absolute; color: #fff6d8; pointer-events: none; font-size: .9rem; animation: twinkle 1.6s ease-out forwards; }
@keyframes twinkle { 0% { opacity: 0; transform: scale(.2); } 30% { opacity: 1; transform: scale(1.2); } 100% { opacity: 0; transform: scale(.6) translateY(-14px); } }

/* ---------- hidden heart constellation ---------- */
.sec-night { position: relative; }
/* tucked into the top-right of the night sky, looks like ordinary stars until they're tapped */
/* only the ten stars take taps; the box around them lets taps through to the little things underneath */
.sky { position: absolute; z-index: 1; right: max(2%, calc(50% - 640px)); top: clamp(56px, 6vw, 80px); width: clamp(110px, 18vw, 220px); pointer-events: none; }
.sky .sky-star { pointer-events: auto; }
.sky-field { position: relative; width: 100%; aspect-ratio: 1; pointer-events: none; }
.things { position: relative; z-index: 2; }
.sky-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sky-lines line { stroke: rgba(255, 226, 184, .85); stroke-width: .7; stroke-linecap: round; filter: drop-shadow(0 0 1.5px #ffd9a0); animation: draw .5s ease-out both; }
.sky-lines path { fill: rgba(255, 143, 177, .0); transition: fill 1.4s ease; }
.sky.done .sky-lines path { fill: rgba(255, 143, 177, .28); }
@keyframes draw { from { opacity: 0; } }
.sky-star {
  position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; padding: 0; border: 0; background: none; border-radius: 50%;
  display: grid; place-items: center;
}
.sky-star::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%; background: #fff; opacity: .55;
  box-shadow: 0 0 6px 1px rgba(255, 255, 255, .5); animation: tw 2.4s ease-in-out infinite; animation-delay: var(--d, 0s);
  transition: transform .3s, background .3s;
}
.sky-star.lit::before { opacity: 1; background: #ffe2b8; transform: scale(1.8); box-shadow: 0 0 12px 4px rgba(255, 210, 150, .8); animation: none; }
@keyframes tw { 50% { opacity: .2; } }
.sky-found { margin: .6rem 0 0; color: #ffd3e2; }

/* ---------- message in a bottle ---------- */
.sec-sea { background: linear-gradient(var(--cream) 0, #e6f4f1 45%, #bfe3df 100%); }
.bottle-box { max-width: 460px; margin: 0 auto; }
.bottle-write { background: var(--paper); border-radius: 14px; padding: 1rem; box-shadow: 0 12px 28px rgba(46, 156, 147, .18); transition: opacity .4s, transform .4s; }
.bottle-write textarea {
  width: 100%; border: 0; border-bottom: 2px dashed #d9c9b6; background: transparent; resize: none;
  font-family: var(--hand); font-size: 1.4rem; line-height: 1.35; color: var(--ink); padding: .2rem 0 .4rem; margin-bottom: .8rem;
}
.bottle-write textarea:focus { outline: none; border-bottom-color: var(--teal); }
.bottle-write .btn { width: 100%; }
.bottle-write.gone { opacity: 0; transform: scale(.9); pointer-events: none; }
.bottle-status { margin: .5rem 0 0; min-height: 1.2em; color: var(--ink-soft); text-align: center; }
.bottle-stage { position: relative; height: 200px; margin-top: 1rem; overflow: hidden; border-radius: 0 0 16px 16px; }
.scroll-note { position: absolute; left: 50%; top: 0; width: 70%; height: 0; margin-left: -35%; background: #fff6e0; border-radius: 6px; opacity: 0; pointer-events: none; }
.scroll-note.roll { animation: roll-up 1s ease-in forwards; }
@keyframes roll-up { 0% { opacity: 1; height: 70px; top: -80px; } 60% { opacity: 1; height: 16px; width: 22%; margin-left: -11%; top: 30px; } 100% { opacity: 0; height: 14px; width: 8%; margin-left: -4%; top: 90px; } }
.bottle { position: absolute; left: 50%; bottom: 46px; width: 64px; margin-left: -32px; transform-origin: 50% 70%; transform: rotate(0); transition: transform .6s; }
.bottle.sealed { transform: rotate(-78deg); }
.bottle.float { animation: float-away 4.2s ease-in forwards; }
@keyframes float-away {
  0% { transform: rotate(-78deg) translate(0, 0); }
  20% { transform: rotate(-70deg) translate(-10px, 10px); }
  40% { transform: rotate(-86deg) translate(-4px, 60px); }
  60% { transform: rotate(-70deg) translate(-14px, 120px); }
  80% { transform: rotate(-86deg) translate(-6px, 190px); }
  100% { transform: rotate(-74deg) translate(-12px, 300px); opacity: 0; }
}
.waves { position: absolute; left: 0; right: 0; bottom: 0; height: 64px; }
.waves i {
  position: absolute; left: -50%; bottom: 0; width: 200%; height: 100%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 40'%3E%3Cpath d='M0 20 Q25 0 50 20 T100 20 T150 20 T200 20 V40 H0z' fill='%232E9C93' fill-opacity='.45'/%3E%3C/svg%3E") repeat-x 0 100% / 200px 40px;
  animation: wave 6s linear infinite;
}
.waves i + i { bottom: -8px; opacity: .8; animation-duration: 9s; animation-direction: reverse; }
@keyframes wave { to { transform: translateX(200px); } }
@media (prefers-reduced-motion: reduce) { .waves i { animation: none; } }

/* ---------- pinky promise + certificate ---------- */
.pinky-stage { position: relative; height: 130px; max-width: 420px; margin: 0 auto 1.4rem; overflow: hidden; }
.pinky {
  position: absolute; top: 50%; width: 52%; height: 34px; margin-top: -17px; border-radius: 18px;
  transition: transform 1s cubic-bezier(.3, 1.3, .5, 1);
}
.pinky i { position: absolute; top: 6px; width: 20px; height: 22px; border-radius: 9px; background: rgba(255, 255, 255, .55); }
.pinky-left { left: 0; background: linear-gradient(90deg, #ffc9d6, #ffb0c4); transform: translateX(-110%); border-radius: 4px 20px 20px 4px; }
.pinky-left i { right: 6px; }
.pinky-right { right: 0; background: linear-gradient(270deg, #d9cff9, #c6b8f5); transform: translateX(110%); border-radius: 20px 4px 4px 20px; }
.pinky-right i { left: 6px; }
.pinky-stage.ready .pinky-left { transform: translate(-58%, 8px) rotate(-6deg); }
.pinky-stage.ready .pinky-right { transform: translate(58%, -8px) rotate(-6deg); }
.pinky-stage.hooked .pinky-left { transform: translate(-6%, 9px) rotate(-14deg); }
.pinky-stage.hooked .pinky-right { transform: translate(6%, -9px) rotate(-14deg); }
.wax {
  position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e86a6a, #b8282f 60%, #8e1b22); color: #ffd9d0;
  box-shadow: 0 6px 14px rgba(90, 20, 20, .4), inset 0 -4px 8px rgba(0, 0, 0, .25);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
  opacity: 0; transform: scale(2.2) rotate(-20deg);
}
.wax span { font-size: 1.6rem; }
.wax small { font-family: var(--display); font-weight: 700; font-size: .55rem; letter-spacing: .14em; margin-top: 2px; }
.pinky-stage.sealed .wax { animation: stamp .45s cubic-bezier(.3, 1.6, .5, 1) .9s forwards; }
@keyframes stamp { to { opacity: 1; transform: scale(1) rotate(-8deg); } }
.pinky-out { min-height: 1.4em; margin: .8rem 0 0; }
.cert { max-width: 560px; margin: 2rem auto 0; animation: star-wish-in .7s ease both; }
.cert img { width: 100%; height: auto; border-radius: 6px; box-shadow: 0 16px 34px rgba(74, 47, 39, .2); transform: rotate(-1deg); }

/* ---------- cake: mic first, tap second ---------- */
.mic-btn { display: block; margin: .8rem auto 0; }
.tap-instead { display: block; margin: .2rem auto 0; }

/* ---------- game card (birthday tarot), centred ---------- */
.game {
  max-width: 520px; margin: 0 auto; text-align: center;
  padding: clamp(1.5rem, 5vw, 2.25rem) clamp(1.1rem, 5vw, 2.25rem) clamp(1.4rem, 5vw, 2rem);
  background: rgba(255, 255, 255, .55); border-radius: 20px; box-shadow: 0 10px 26px rgba(74, 47, 39, .08);
}
.game .center { margin-top: 1.4rem; }
.game-title { font-family: var(--serif); font-weight: 600; font-size: 1.35rem; margin: 0 0 .2rem; }
.game-step { margin: 0 0 1.1rem; color: var(--ink-soft); min-height: 1.6em; }

/* ---------- birthday tarot ---------- */
.tarot { position: relative; min-height: 230px; }
.tarot-deck { position: relative; width: 96px; height: 150px; margin: 30px auto 0; }
.tarot-deck i, .tarot-card .tc-back {
  background:
    radial-gradient(circle at 50% 50%, transparent 22%, rgba(242, 179, 0, .9) 23% 25%, transparent 26%),
    radial-gradient(circle at 50% 50%, #3b2a63, #1c1430);
  border: 3px solid #d9b45a; border-radius: 10px;
}
.tarot-deck i { position: absolute; inset: 0; box-shadow: 0 6px 14px rgba(28, 20, 48, .35); }
.tarot-deck i:nth-child(1) { transform: rotate(-5deg); }
.tarot-deck i:nth-child(2) { transform: rotate(3deg); }
.tarot-deck i::after, .tarot-card .tc-back::after { content: '☾'; position: absolute; inset: 0; display: grid; place-items: center; color: #f2d48a; font-size: 1.6rem; }
.tarot-deck.shuffling i:nth-child(1) { animation: shuf-l .45s ease-in-out 3; }
.tarot-deck.shuffling i:nth-child(3) { animation: shuf-r .45s ease-in-out 3; }
@keyframes shuf-l { 50% { transform: translateX(-60px) rotate(-14deg); } }
@keyframes shuf-r { 50% { transform: translateX(60px) rotate(14deg); } }
.tarot-spread { display: flex; justify-content: center; gap: clamp(8px, 2.5vw, 14px); }
.tarot-spread:empty { display: none; }
.tarot-card {
  width: min(31%, 120px); aspect-ratio: 2 / 3.1; perspective: 900px; border: 0; padding: 0; background: none;
  animation: deal .55s cubic-bezier(.2, .9, .3, 1.1) both; animation-delay: var(--d, 0s);
}
@keyframes deal { from { opacity: 0; transform: translateY(-60px) rotate(-10deg) scale(.8); } }
.tc-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .8s cubic-bezier(.3, 1.2, .5, 1); }
.tarot-card.flipped .tc-inner { transform: rotateY(180deg); }
.tc-back, .tc-front { position: absolute; inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; border-radius: 10px; }
.tc-back { box-shadow: 0 8px 18px rgba(28, 20, 48, .3); }
.tarot-card:not(.flipped) .tc-inner { animation: hover-card 2.4s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes hover-card { 50% { transform: translateY(-5px); } }
.tc-front {
  transform: rotateY(180deg); overflow: hidden; background: #fffaf0; border: 3px solid #d9b45a;
  box-shadow: 0 8px 18px rgba(28, 20, 48, .25);
}
.tc-front img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tarot-card.active .tc-front { box-shadow: 0 0 0 3px #f2b300, 0 0 26px rgba(242, 179, 0, .6); }
@media (prefers-reduced-motion: reduce) { .tarot-card, .tarot-card:not(.flipped) .tc-inner, .tarot-deck.shuffling i { animation: none !important; } .tc-inner { transition: none; } }

/* ---------- the full-pressure hug ---------- */
.hug-vignette {
  position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(255, 110, 160, .55) 100%);
}
#hug.shaking { animation: hug-shake .12s linear infinite; }
@keyframes hug-shake {
  0% { transform: translate(calc(var(--s) * 1px), 0); } 25% { transform: translate(0, calc(var(--s) * -1px)); }
  50% { transform: translate(calc(var(--s) * -1px), 0); } 75% { transform: translate(0, calc(var(--s) * 1px)); }
}

/* ---------- the full-pressure hug: hugging cats in the centre, every hug meme framed around them ---------- */
.hugzilla {
  position: fixed; inset: 0; z-index: 185; overflow: hidden;
  background: radial-gradient(circle at 50% 50%, #ffd3e2, #ff8fb1 55%, #e8436a);
  animation: credits-in .25s ease both;
}
.hugzilla.out { animation: credits-out .5s ease forwards; }
.hz-glow { position: absolute; inset: -20%; background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .18) 0 10deg, transparent 10deg 20deg); animation: hz-spin 14s linear infinite; pointer-events: none; }
@keyframes hz-spin { to { transform: rotate(360deg); } }

/* phones (portrait): 3 on top, 2 down each side, 2 at the bottom with the button between */
.hz-grid {
  position: relative; height: 100%; box-sizing: border-box;
  padding: max(12px, env(safe-area-inset-top)) 10px max(12px, env(safe-area-inset-bottom));
  display: grid; gap: 10px;
  grid-template-columns: 1fr 1.35fr 1fr;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1.25fr) minmax(0, 1fr);
  grid-template-areas: "m1 m2 m3" "m4 c m6" "m5 c m7" "m8 x m9";
}
/* wide screens: 5 across the top, 1 each side, 2 at the bottom corners */
@media (min-aspect-ratio: 1/1) {
  .hz-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-rows: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, .9fr);
    grid-template-areas: "m1 m2 m3 m4 m5" "m6 c c c m7" "m8 x x x m9";
  }
}
.hz-center { grid-area: c; z-index: 2; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #fff; text-shadow: 0 4px 18px rgba(140, 20, 60, .45); }
.hz-heart { font-size: clamp(2.2rem, 9vw, 4rem); line-height: 1; filter: drop-shadow(0 0 24px rgba(255, 255, 255, .8)); transform: scale(0); animation: hz-beat 1.1s ease-in-out .9s infinite; }
@keyframes hz-beat { 0% { transform: scale(1); } 14% { transform: scale(1.3); } 28% { transform: scale(1); } 42% { transform: scale(1.25); } 70%, 100% { transform: scale(1); } }
.hz-title { margin: .2rem 0 0; font-family: var(--serif); font-weight: 700; font-size: clamp(1.25rem, 5.6vw, 3.2rem); letter-spacing: .03em; line-height: 1.05; animation: hz-stamp .5s cubic-bezier(.3, 1.6, .5, 1) 1.1s both; }
@keyframes hz-stamp { from { opacity: 0; transform: scale(2.6) rotate(-8deg); } to { opacity: 1; transform: rotate(-3deg); } }
.hz-cats { display: flex; justify-content: center; align-items: flex-end; width: 100%; min-height: 0; flex: 1 1 auto; max-height: 46%; margin: .3rem 0; }
.hz-cat { width: 50%; max-width: 210px; height: 100%; object-fit: contain; object-position: bottom; filter: drop-shadow(0 10px 16px rgba(120, 20, 60, .35)); }
.hz-left { transform-origin: 100% 100%; animation: hz-in-left 1s cubic-bezier(.3, 1.4, .5, 1) .15s both, hz-squeeze 1.6s ease-in-out 1.2s infinite; }
.hz-right { transform-origin: 0% 100%; animation: hz-in-right 1s cubic-bezier(.3, 1.4, .5, 1) .15s both, hz-squeeze-r 1.6s ease-in-out 1.2s infinite; }
@keyframes hz-in-left { from { transform: translateX(-100vw) rotate(-20deg); } to { transform: translateX(12%) rotate(8deg); } }
@keyframes hz-in-right { from { transform: translateX(100vw) scaleX(-1) rotate(-20deg); } to { transform: translateX(-12%) scaleX(-1) rotate(8deg); } }
@keyframes hz-squeeze { 0%, 100% { transform: translateX(12%) rotate(8deg); } 50% { transform: translateX(18%) rotate(12deg) scale(1.05, .95); } }
@keyframes hz-squeeze-r { 0%, 100% { transform: translateX(-12%) scaleX(-1) rotate(8deg); } 50% { transform: translateX(-18%) scaleX(-1) rotate(12deg) scale(1.05, .95); } }
.hz-sub { margin: 0; font-family: var(--hand); font-size: clamp(1.05rem, 4.4vw, 1.8rem); line-height: 1.15; animation: moon-say-in .5s ease 1.6s both; }

.hz-x { grid-area: x; z-index: 2; display: flex; align-items: center; justify-content: center; }
.hz-close { box-shadow: 0 8px 20px rgba(120, 20, 60, .35); padding-left: .9rem; padding-right: .9rem; animation: moon-say-in .5s ease 1.8s both; }

/* each meme gets its own grid cell, so nothing can overlap */
.hz-slot { min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; border: 0; padding: 0; background: none; cursor: zoom-in; }
.hz-slot img {
  max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain;
  padding: 4px 4px 12px; background: #fff; border-radius: 4px; box-sizing: border-box;
  box-shadow: 0 8px 18px rgba(120, 20, 60, .3); transform: rotate(var(--r, 0deg));
  animation: meme-land .5s cubic-bezier(.3, 1.4, .5, 1) both; animation-delay: var(--d, 0s);
  transition: opacity .5s;
}
.hz-slot img.swap { opacity: 0; }
@keyframes meme-land { from { opacity: 0; transform: scale(.4) rotate(calc(var(--r, 0deg) * -4)); } }

/* tap a meme to see it big */
.hz-zoom { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 20px; background: rgba(40, 10, 25, .82); cursor: zoom-out; animation: credits-in .2s ease both; }
.hz-zoom img { max-width: min(92vw, 560px); max-height: 82vh; max-height: 82dvh; width: auto; height: auto; padding: 8px 8px 22px; background: #fff; border-radius: 6px; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); animation: meme-land .35s ease both; }
@media (prefers-reduced-motion: reduce) { .hugzilla *, #hug.shaking { animation: none !important; } .hz-heart { transform: none; } .hz-left { transform: translateX(12%); } .hz-right { transform: translateX(-12%) scaleX(-1); } }

/* ---------- blowing too softly: the cake teases her ---------- */
.final-hint.tease { animation: tease-pop .45s cubic-bezier(.3, 1.6, .5, 1); color: var(--red); font-weight: 700; }
@keyframes tease-pop { from { transform: scale(.8); opacity: .3; } }
.cake-final.wobble { animation: cake-no .5s ease-in-out; }
@keyframes cake-no { 20% { transform: rotate(-4deg); } 40% { transform: rotate(4deg); } 60% { transform: rotate(-3deg); } 80% { transform: rotate(2deg); } }
@media (prefers-reduced-motion: reduce) { .final-hint.tease, .cake-final.wobble { animation: none; } }

/* ---------- McFloat cat: empty cup, refill, dance ---------- */
.buddy-empty {
  position: absolute; bottom: 100%; left: 50%; margin-bottom: 14px; transform: translateX(-35%); white-space: nowrap;
  background: #fff; color: var(--ink); font-family: var(--hand); font-size: 1.05rem; padding: .15rem .6rem; border-radius: 12px;
  box-shadow: 0 4px 12px rgba(74, 47, 39, .2); pointer-events: none; animation: say-in .3s ease both;
}
.buddy-refill {
  position: absolute; bottom: 100%; left: 100%; margin: 0 0 2px -6px; width: 38px; height: 38px; border-radius: 50%; border: 0; padding: 0;
  background: #fff; box-shadow: 0 4px 12px rgba(74, 47, 39, .25), 0 0 0 3px #ffb07a; font-size: 1.25rem; cursor: pointer; pointer-events: auto;
  animation: refill-pulse 1.2s ease-in-out infinite;
}
.buddy.left .buddy-refill { left: auto; right: 100%; margin: 0 -6px 2px 0; }
@keyframes refill-pulse { 50% { transform: scale(1.12); } }
.buddy.empty .buddy-cat { animation: empty-sad 2.4s ease-in-out infinite; }
@keyframes empty-sad { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-4deg) translateY(1px); } }
.buddy.dance .buddy-cat { animation: cat-dance 2.2s ease-in-out; }
@keyframes cat-dance {
  0% { transform: none; } 12% { transform: translateY(-14px) rotate(-10deg); } 24% { transform: translateY(0) rotate(0); }
  36% { transform: translateY(-14px) rotate(10deg); } 48% { transform: translateY(0); } 60% { transform: translateY(-18px) rotate(-360deg); }
  75% { transform: translateY(0) rotate(-360deg); } 88% { transform: translateY(-8px) rotate(-360deg) scale(1.1); } 100% { transform: rotate(-360deg); }
}
@media (prefers-reduced-motion: reduce) { .buddy-refill, .buddy.empty .buddy-cat, .buddy.dance .buddy-cat { animation: none; } }

/* ---------- the last note, written in the dark (flashlight) ---------- */
.torch {
  position: relative; max-width: 460px; margin: 1.4rem auto 0; border-radius: 14px; overflow: hidden; touch-action: none;
  background: #1a1424; box-shadow: 0 18px 40px rgba(0, 0, 0, .45); cursor: crosshair;
  -webkit-user-select: none; user-select: none;
}
.torch-text { margin: 0; padding: 1.8rem 1.4rem; font-family: var(--hand); font-size: 1.5rem; line-height: 1.35; color: #ffe9c7; text-align: left; white-space: pre-wrap; text-shadow: 0 0 12px rgba(255, 200, 120, .35); }
.torch-dark { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity 1.2s ease; }
.torch::after {                       /* the warm beam that follows her finger */
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(circle 90px at var(--x, 50%) var(--y, 50%), rgba(255, 220, 160, .28), rgba(255, 220, 160, 0) 70%);
}
.torch.lit::after { opacity: 1; }
.torch.done .torch-dark { opacity: 0; pointer-events: none; }
.torch.done { cursor: default; }
.torch-hint { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; font-size: .8rem; color: rgba(255, 233, 199, .7); pointer-events: none; transition: opacity .5s; }
.torch.started .torch-hint { opacity: 0; }

/* ---------- sky lanterns ---------- */
.lanterns { margin: 3rem auto 0; max-width: 460px; text-align: center; }
.lanterns h3 { font-family: var(--serif); font-weight: 600; font-size: 1.6rem; margin: .3rem 0 .2rem; }
.lantern-sub { margin: 0 0 1rem; opacity: .75; }
.lantern-words { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-bottom: .9rem; }
.lantern-words button {
  border: 1px solid rgba(255, 210, 150, .55); background: rgba(255, 190, 110, .12); color: inherit; border-radius: 99px;
  padding: .35rem .85rem; font-family: var(--hand); font-size: 1.15rem;
}
.lantern-words button[aria-pressed="true"] { background: #ffb36b; color: #3a1d0a; border-color: #ffb36b; }
.lantern-own { display: flex; gap: .5rem; }
.lantern-own input { flex: 1; min-width: 0; border-radius: 99px; border: 1px solid rgba(255, 210, 150, .55); background: rgba(255, 255, 255, .08); color: inherit; padding: .55rem 1rem; font: inherit; }
.lantern-own input::placeholder { color: rgba(255, 255, 255, .5); }
.lantern-out { min-height: 1.4em; margin: 1rem 0 0; color: #ffd9a8; }
.lantern-sky { position: fixed; inset: 0; z-index: 95; pointer-events: none; overflow: hidden; }
.lantern { position: absolute; bottom: -140px; width: 58px; animation: lantern-rise var(--dur, 16s) linear forwards; }
.lantern-body {
  position: relative; display: grid; place-items: center; height: 74px; border-radius: 14px 14px 22px 22px;
  background: radial-gradient(ellipse at 50% 85%, #fff2b8 0, #ffb347 40%, #f06a2b 100%);
  box-shadow: 0 0 30px 10px rgba(255, 170, 80, .45), 0 0 80px 20px rgba(255, 140, 60, .2);
  clip-path: polygon(10% 0, 90% 0, 100% 100%, 0 100%);
  animation: lantern-sway 4s ease-in-out infinite, lantern-flicker 1.6s ease-in-out infinite alternate;
}
.lantern-body span { font-family: var(--hand); font-weight: 700; font-size: .85rem; line-height: 1; color: #6a2a08; padding: 0 6px; text-align: center; }
@keyframes lantern-rise { 0% { transform: translate(0, 0) scale(1); opacity: 0; } 6% { opacity: 1; } 80% { opacity: .9; } 100% { transform: translate(var(--drift, 30px), -120vh) scale(.45); opacity: 0; } }
@keyframes lantern-sway { 50% { transform: rotate(4deg) translateX(6px); } }
@keyframes lantern-flicker { to { filter: brightness(1.15); } }
@media (prefers-reduced-motion: reduce) { .lantern-body { animation: none; } }

/* ---------- cover + polaroid frames ---------- */
.cover-frame { position: relative; width: min(420px, 100%); }
.cover-frame img { width: 100%; }
.scrap-wrap { position: relative; width: min(560px, 100%); margin: 0 auto; }
.scrap-wrap .scrapbook { width: 100%; }

.buddy.empty.walking .buddy-cat { animation: waddle .32s ease-in-out infinite alternate; }

/* ---------- 🎧 Siya Wrapped ---------- */
.wr-card {
  position: relative; overflow: hidden; isolation: isolate; max-width: 520px; margin: 0 auto; text-align: left;
  padding: clamp(1.8rem, 6vw, 2.6rem) clamp(1.3rem, 5vw, 2.2rem); border-radius: 26px; color: #fff;
  background: linear-gradient(150deg, #2a1840 0%, #5b3fa8 55%, #D14D39 100%);
  box-shadow: 0 24px 50px rgba(42, 24, 64, .35);
}
.wr-blob { position: absolute; z-index: -1; border-radius: 50%; opacity: .45; filter: blur(2px); animation: wr-float 7s ease-in-out infinite; }
.wr-b1 { width: 180px; height: 180px; background: #F2B300; right: -40px; top: -50px; }
.wr-b2 { width: 120px; height: 120px; background: #2E9C93; left: -30px; bottom: -30px; animation-delay: -2s; }
.wr-b3 { width: 70px; height: 70px; background: #E9897A; right: 30%; bottom: 18%; animation-delay: -4s; }
@keyframes wr-float { 50% { transform: translate(10px, -14px) scale(1.08); } }
.wr-kicker { margin: 0 0 .6rem; font-family: var(--body); font-weight: 700; font-size: .8rem; letter-spacing: .2em; color: #f6dc9b; }
.wr-title { margin: 0 0 .6rem; font-family: var(--display); font-weight: 700; font-size: clamp(2rem, 8vw, 2.9rem); line-height: 1.02; }
.wr-sub { margin: 0 0 1.4rem; color: rgba(255, 255, 255, .82); max-width: 30ch; }
.wr-play { background: #fff; color: #2a1840; box-shadow: 0 6px 0 rgba(0, 0, 0, .25); }

.wr-view { position: fixed; inset: 0; z-index: 220; background: rgba(8, 5, 14, .92); display: grid; place-items: center; }
.wr-story {
  --wr-bg: #8377E4; --wr-fg: #fff;
  position: relative; overflow: hidden; isolation: isolate; color: var(--wr-fg);
  width: 100vw; height: 100vh; height: 100dvh;                /* phones: the whole screen, like a real story */
  background: var(--wr-bg); transition: background .5s ease;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
@media (min-width: 600px) { .wr-story { width: min(420px, calc(92vh * 9 / 16)); height: min(92vh, 746px); border-radius: 20px; } }
.wr-story::before, .wr-story::after {                     /* two soft shapes drifting behind every slide */
  content: ''; position: absolute; z-index: -1; border-radius: 50%; background: rgba(255, 255, 255, .14);
  animation: wr-float 8s ease-in-out infinite;
}
.wr-story::before { width: 70%; aspect-ratio: 1; right: -25%; top: -12%; }
.wr-story::after { width: 50%; aspect-ratio: 1; left: -18%; bottom: -10%; animation-delay: -3s; background: rgba(0, 0, 0, .14); }
.wr-bars { position: absolute; z-index: 3; left: 10px; right: 10px; top: max(10px, env(safe-area-inset-top, 0px)); display: flex; gap: 4px; }
.wr-bars span { flex: 1; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .35); background: color-mix(in srgb, var(--wr-fg) 35%, transparent); overflow: hidden; }
.wr-bars i { display: block; height: 100%; width: 0; background: var(--wr-fg); }
.wr-bars span.done i { width: 100%; }
.wr-bars span.run i { animation: wr-fill linear forwards; }
.wr-story.held .wr-bars span.run i { animation-play-state: paused; }
@keyframes wr-fill { to { width: 100%; } }
.wr-close {
  position: absolute; z-index: 4; right: 10px; top: calc(max(10px, env(safe-area-inset-top, 0px)) + 12px);
  width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .25); color: #fff; font-size: .95rem;
}
.wr-tap { position: absolute; z-index: 2; top: 0; bottom: 0; border: 0; padding: 0; background: transparent; -webkit-tap-highlight-color: transparent; }
.wr-prev { left: 0; width: 30%; }
.wr-next { right: 0; width: 70%; }
.wr-tap:focus-visible { outline: 3px solid rgba(255, 255, 255, .6); outline-offset: -6px; }
.wr-slide { position: absolute; inset: 0; display: flex; align-items: center; padding: 64px 28px 40px; pointer-events: none; }
.wr-inner { width: 100%; }
.wr-inner > * { animation: wr-in .6s cubic-bezier(.2, .9, .3, 1.1) both; }
.wr-inner > :nth-child(2) { animation-delay: .12s; }
.wr-inner > :nth-child(3) { animation-delay: .24s; }
.wr-inner > :nth-child(4) { animation-delay: .36s; }
.wr-inner > :nth-child(5) { animation-delay: .48s; }
@keyframes wr-in { from { opacity: 0; transform: translateY(22px); } }
.wr-small { margin: 0 0 .5rem; font-family: var(--body); font-weight: 700; font-size: 1.05rem; opacity: .85; }
.wr-num { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(2.6rem, 13vw, 4.2rem); line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.wr-unit { margin: .2rem 0 0; font-family: var(--display); font-weight: 600; font-size: 1.6rem; }
.wr-big { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(2.2rem, 10.5vw, 3.4rem); line-height: 1.02; letter-spacing: -.01em; }
.wr-intro .wr-big { font-size: clamp(2.8rem, 14vw, 4.4rem); }
.wr-after { margin: 1.1rem 0 0; font-family: var(--hand); font-size: 1.55rem; line-height: 1.2; }
.wr-list { list-style: none; margin: .6rem 0 0; padding: 0; }
.wr-list li { display: flex; align-items: baseline; gap: .8rem; padding: .32rem 0; font-family: var(--display); font-weight: 700; font-size: clamp(1.5rem, 7vw, 2rem); animation: wr-in .5s ease both; animation-delay: var(--d, 0s); }
.wr-list li b { min-width: 1.2em; opacity: .55; }
.wr-genre .wr-list li { font-size: 1.25rem; font-weight: 600; }
.wr-chart { display: flex; align-items: flex-end; gap: 3px; height: 120px; margin: 1.2rem 0 .3rem; }
.wr-chart i { flex: 1; height: var(--h); border-radius: 3px 3px 0 0; background: currentColor; opacity: .4; transform-origin: bottom; animation: wr-grow .7s cubic-bezier(.2, .9, .3, 1.2) both; animation-delay: var(--d); }
.wr-chart i.peak { opacity: 1; }
@keyframes wr-grow { from { transform: scaleY(0); } }
.wr-axis { display: flex; justify-content: space-between; font-size: .7rem; opacity: .75; }
.wr-img { display: block; width: 46%; max-width: 180px; margin: 1rem 0 0 auto; animation: wr-in .6s ease both, float 2.6s ease-in-out .6s infinite; }
.wr-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin-top: 1.6rem; pointer-events: auto; position: relative; z-index: 3; }
.wr-save { background: #fff; color: #2a1840; }
.wr-again { color: var(--wr-fg); }
.wr-outro .wr-big { font-size: clamp(2rem, 9vw, 2.9rem); }
@media (prefers-reduced-motion: reduce) {
  .wr-blob, .wr-story::before, .wr-story::after, .wr-inner > *, .wr-list li, .wr-chart i, .wr-img { animation: none !important; }
  .wr-bars span.run i { animation-duration: 6s; }
}

/* ---------- 🎟️ scratch card ---------- */
.sc-card {
  position: relative; width: min(400px, 100%); aspect-ratio: 16 / 10; margin: 0 auto; border-radius: 18px; overflow: hidden;
  box-shadow: 0 18px 40px rgba(74, 47, 39, .22), 0 0 0 1px rgba(74, 47, 39, .08);
  transform: rotate(-1.5deg);
}
.sc-ticket {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 1rem 1.2rem; color: #4a2f27;
  background:
    radial-gradient(circle at 0 50%, var(--peach-3) 14px, transparent 15px),
    radial-gradient(circle at 100% 50%, var(--peach-3) 14px, transparent 15px),
    linear-gradient(135deg, #fff6e0, #ffe0ec);
}
.sc-ticket::after { content: ''; position: absolute; inset: 10px; border: 2px dashed rgba(209, 77, 57, .35); border-radius: 12px; pointer-events: none; }
.sc-kicker { margin: 0; font-family: var(--body); font-weight: 700; font-size: .7rem; letter-spacing: .22em; color: var(--red); }
.sc-icon { margin: .1rem 0 0; font-size: 2.2rem; line-height: 1.1; }
.sc-prize { margin: .1rem 0 0; font-family: var(--display); font-weight: 700; font-size: clamp(1.5rem, 7vw, 2rem); line-height: 1.05; }
.sc-when { margin: 0; font-family: var(--hand); font-size: 1.6rem; color: var(--red); line-height: 1.1; }
.sc-small { margin: .35rem 0 0; font-size: .7rem; color: rgba(74, 47, 39, .7); max-width: 32ch; }
.sc-foil { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; transition: opacity .7s ease; }
.sc-foil:focus-visible { outline: 3px solid var(--teal); outline-offset: -3px; }
.sc-card.done .sc-foil { opacity: 0; pointer-events: none; }
.sc-card.done { animation: sc-pop .6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes sc-pop { 40% { transform: rotate(-1.5deg) scale(1.05); } }
.sc-actions { margin-top: 1.4rem; }
.sc-note { min-height: 1.4em; margin: .7rem 0 0; color: var(--ink-soft); }

/* ---------- ⏳ time capsule ---------- */
.tc-box { max-width: 480px; margin: 0 auto; }
.tc-write { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14); border-radius: 16px; padding: 1.1rem; }
.tc-write textarea {
  display: block; width: 100%; border: 0; resize: vertical; min-height: 150px; margin-bottom: .9rem;
  background: repeating-linear-gradient(transparent 0 33px, rgba(255, 255, 255, .12) 33px 34px); background-attachment: local;
  color: #fff; font-family: var(--hand); font-size: 1.45rem; line-height: 34px; padding: 0 .2rem;
}
.tc-write textarea::placeholder { color: rgba(255, 255, 255, .45); }
.tc-write textarea:focus { outline: none; }
.tc-write .btn { width: 100%; }
.tc-status { margin: .5rem 0 0; min-height: 1.2em; color: #ffd3e2; text-align: center; }
.tc-sealed { text-align: center; }
.tc-sealed.tc-in-anim .tc-jar { animation: tc-drop .9s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes tc-drop { from { opacity: 0; transform: translateY(-50px) scale(.7) rotate(-8deg); } }
.tc-jar {
  position: relative; width: 120px; height: 150px; margin: 0 auto 1rem; border-radius: 24px 24px 34px 34px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, .06));
  border: 2px solid rgba(255, 255, 255, .45); box-shadow: inset 0 0 30px rgba(255, 214, 130, .25), 0 0 40px rgba(255, 214, 130, .18);
}
.tc-jar::before { content: ''; position: absolute; left: 18px; right: 18px; top: -16px; height: 18px; border-radius: 6px; background: linear-gradient(#d9b45a, #a9802f); }
.tc-jar::after { content: ''; position: absolute; left: 30px; right: 30px; top: 42px; bottom: 30px; border-radius: 4px; background: #fff6e0; transform: rotate(-6deg); box-shadow: 0 0 0 3px #ead8b5; }
.tc-lock { position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 1.8rem; }
.tc-jar i { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #ffe9a8; box-shadow: 0 0 8px #ffe9a8; animation: tw 2s ease-in-out infinite; }
.tc-jar i:nth-child(2) { left: 14px; top: 22px; }
.tc-jar i:nth-child(3) { right: 16px; top: 60px; animation-delay: -.7s; }
.tc-jar i:nth-child(4) { left: 22px; bottom: 18px; animation-delay: -1.3s; }
.tc-msg { margin: 0 0 .6rem; font-size: 1.6rem; color: #ffd3e2; }
.tc-in { margin: 0 0 .5rem; font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; color: rgba(255, 255, 255, .6); }
.tc-count { display: flex; justify-content: center; gap: .6rem; }
.tc-unit { min-width: 64px; padding: .6rem .4rem; border-radius: 12px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); }
.tc-unit b { display: block; font-family: var(--display); font-weight: 700; font-size: 1.6rem; color: #fff; font-variant-numeric: tabular-nums; }
.tc-unit span { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .6); }
#tcOpen { margin-top: 1rem; }
.tc-letter {
  position: relative; padding: 1.6rem 1.3rem 1.4rem 2.6rem; border-radius: 6px; color: var(--ink);
  background: linear-gradient(90deg, transparent 30px, rgba(209, 77, 57, .25) 30px 32px, transparent 32px), repeating-linear-gradient(var(--paper) 0 33px, #e8ddcf 33px 34px);
  box-shadow: 0 24px 50px rgba(0, 0, 0, .3); animation: unfold .7s ease-out;
}
.tc-letter-text { margin: 0; font-family: var(--hand); font-size: 1.4rem; line-height: 34px; white-space: pre-wrap; }
.tc-from { margin: .6rem 0 0; font-family: var(--hand); font-size: 1.4rem; text-align: right; color: var(--red); }
@media (prefers-reduced-motion: reduce) { .sc-card.done, .tc-sealed.tc-in-anim .tc-jar, .tc-jar i, .tc-letter { animation: none !important; } }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- 🏆 badge pop-up ---------- */
.ach-toast {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 66px); z-index: 255;
  display: flex; align-items: center; gap: .7rem; padding: .55rem 1.1rem .55rem .6rem; max-width: calc(100vw - 32px);
  background: #1c1430; color: #fff; border-radius: 999px; box-shadow: 0 12px 30px rgba(0, 0, 0, .3), inset 0 0 0 1px rgba(242, 212, 138, .5);
  opacity: 0; transform: translate(-50%, -24px) scale(.9); pointer-events: none;
  transition: opacity .3s, transform .45s cubic-bezier(.3, 1.6, .5, 1);
}
.ach-toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.ach-toast .ach-ico { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; font-size: 1.3rem; background: #fff6dc; box-shadow: inset 0 0 0 2px #d9a441; }
.ach-toast .ach-txt { display: flex; flex-direction: column; line-height: 1.15; }
.ach-toast small { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: #f6dc9b; white-space: nowrap; }
.ach-toast b { font-family: var(--display); font-size: 1.02rem; }

/* ---------- 🗺️ chapter map ---------- */
.map-btn {
  position: fixed; left: 10px; top: calc(env(safe-area-inset-top, 0px) + 10px); z-index: 120;
  display: flex; align-items: center; gap: .35rem; height: 44px; padding: 0 .8rem 0 .7rem; border: 0; border-radius: 999px;
  background: rgba(255, 253, 246, .92); color: var(--ink); box-shadow: 0 6px 16px rgba(74, 47, 39, .18);
  font-size: 1.15rem; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.map-btn b { font-family: var(--display); font-size: .85rem; }
.map-wrap { position: fixed; inset: 0; z-index: 210; background: rgba(20, 16, 31, .55); display: flex; align-items: flex-end; justify-content: center; }
.map-panel {
  position: relative; width: min(520px, 100%); max-height: 86vh; max-height: 86dvh; overflow: auto; overscroll-behavior: contain;
  background: var(--paper); border-radius: 22px 22px 0 0; padding: 1.4rem 1.1rem calc(1.4rem + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .3); animation: map-up .35s cubic-bezier(.2, .9, .3, 1);
}
@media (min-width: 700px) { .map-wrap { align-items: center; } .map-panel { border-radius: 22px; } }
@keyframes map-up { from { transform: translateY(40px); opacity: 0; } }
.map-panel .close { position: absolute; right: 10px; top: 10px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--red); color: #fff; }
.map-title { margin: 0 0 .8rem; padding-right: 40px; font-family: var(--serif); font-weight: 600; font-size: 1.5rem; }
.map-list { list-style: none; margin: 0 0 1.4rem; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.map-item {
  display: flex; align-items: center; gap: .5rem; width: 100%; min-height: 44px; padding: .45rem .6rem; text-align: left;
  border: 1px solid rgba(74, 47, 39, .12); border-radius: 12px; background: #fff; color: var(--ink); font-size: .88rem;
}
.map-item.seen { background: #eef8f6; border-color: rgba(46, 156, 147, .35); }
.map-ico { font-size: 1.1rem; }
.map-name { flex: 1; line-height: 1.15; }
.map-tick { color: var(--teal); font-weight: 700; }
.map-ach-head { display: flex; align-items: baseline; justify-content: space-between; }
.map-ach-head h4 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 1.25rem; }
.map-ach-head span { font-family: var(--display); font-weight: 700; color: var(--red); }
.ach-bar { height: 8px; margin: .5rem 0 .9rem; border-radius: 8px; background: rgba(74, 47, 39, .1); overflow: hidden; }
.ach-bar i { display: block; height: 100%; width: 0; border-radius: 8px; background: linear-gradient(90deg, #f6d27a, #D14D39); transition: width .6s ease; }
.ach-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.ach { display: flex; align-items: center; gap: .55rem; padding: .5rem .55rem; border-radius: 12px; background: rgba(74, 47, 39, .05); }
.ach .ach-ico { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(74, 47, 39, .1); color: rgba(74, 47, 39, .45); font-weight: 700; }
.ach.got { background: #fff7e3; }
.ach.got .ach-ico { background: #fff; box-shadow: inset 0 0 0 2px #d9a441; font-size: 1.1rem; }
.ach .ach-txt { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.ach b { font-size: .82rem; }
.ach small { font-size: .7rem; color: var(--ink-soft); }
@media (max-width: 360px) { .map-list, .ach-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .ach-toast, .map-panel { transition: none; animation: none; } }

/* ---------- 🔒 midnight lock ---------- */
.lock { background: radial-gradient(circle at 50% 0%, #3a2766 0%, var(--night) 65%); }
.lock::before {                                     /* a few stars */
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .7;
  background-image: radial-gradient(1.5px 1.5px at 12% 18%, #fff, transparent), radial-gradient(1px 1px at 80% 12%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 66% 30%, #ffe9a8, transparent), radial-gradient(1px 1px at 25% 70%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 88% 78%, #fff, transparent), radial-gradient(1px 1px at 45% 88%, #ffe9a8, transparent),
    radial-gradient(1px 1px at 8% 52%, #fff, transparent), radial-gradient(1.5px 1.5px at 55% 8%, #fff, transparent);
  animation: tw 3s ease-in-out infinite;
}
.lock-card { position: relative; background: rgba(255, 253, 246, .06); color: #fff; border: 1px solid rgba(255, 255, 255, .14); }
.lock-card .hand { color: #ffd3e2; font-size: 1.5rem; margin: 0; }
.lock-card h2 { font-size: 2.2rem; }
.lock-card .muted { color: rgba(255, 255, 255, .72); }
.lock-in { margin: 1.2rem 0 .5rem; font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; color: rgba(255, 255, 255, .6); }
.lock-count .tc-unit { min-width: 58px; }
.lock-note { margin: 1.1rem 0 0; }
@media (prefers-reduced-motion: reduce) { .lock::before { animation: none; } }
