:root {
  --ease-soft: cubic-bezier(.22, .61, .36, 1);
  --pace: 1.6;
  --f-display: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --f-hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --f-serif: "Lora", Georgia, "Times New Roman", serif;

  --ink: #f6f3e9;
  --ink-soft: rgba(246, 243, 233, 0.78);
  --gold: #e9c46a;
  --mint: #b7f0d0;
  --jade: #00a86b;
  --emerald: #0b6e4f;
  --deep: #04261d;
  --string: #c8102e;
  --cream: #fffdf6;

  --base: #04261d;
  --b1: #0b6e4f;
  --b2: #00a86b;
  --thread-k: 0.1;

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --player-h: 70px;

  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: #021a14;
  color: var(--ink);
  font-family: var(--f-display);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }

#stage {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
@media (min-width: 520px) {
  #stage { box-shadow: 0 0 80px rgba(0, 0, 0, 0.6); }
}

/* ---------- Background ---------- */
#bg {
  position: absolute; inset: 0;
  background-color: var(--base);
  transition: background-color 1.8s ease;
  overflow: hidden;
}
.blob {
  position: absolute;
  width: 90%; aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.75;
  transition: background-color 1.8s ease;
}
.b1 { background-color: var(--b1); top: -20%; left: -30%; animation: drift1 18s ease-in-out infinite alternate; }
.b2 { background-color: var(--b2); bottom: -25%; right: -35%; animation: drift2 22s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(25%, 30%) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-30%, -25%) scale(1.2); } }

/* The red string that runs through everything */
#thread {
  position: absolute; left: 0;
  /* positioned within the slide area (between the progress bar and the player), not the whole screen */
  top: calc(var(--safe-t) + 22px + (100% - var(--safe-t) - 22px - var(--player-h) - var(--safe-b)) * var(--thread-k, 0.1));
  width: 200%; height: 46px;
  margin-top: -23px;
  pointer-events: none;
  transition: top 2s var(--ease-soft), opacity 1.2s;
  animation: thread-flow 26s linear infinite;
  opacity: 0.85;
}
#thread path { fill: none; stroke: var(--string); stroke-width: 2.4; stroke-linecap: round; vector-effect: non-scaling-stroke; }
@keyframes thread-flow { to { transform: translateX(-50%); } }
#stage.no-thread #thread { opacity: 0; }

/* ---------- Progress ---------- */
#progress {
  position: absolute; z-index: 5;
  top: calc(var(--safe-t) + 10px); left: 12px; right: 12px;
  display: flex; gap: 3px;
  pointer-events: none;
}
#progress i {
  flex: 1; height: 3px; border-radius: 3px;
  background: rgba(255, 255, 255, 0.25);
  overflow: hidden;
}
#progress i b { display: block; height: 100%; width: 0; background: #fff; transition: width 0.9s var(--ease-soft); }
#progress i.done b, #progress i.now b { width: 100%; }
#stage.light #progress i { background: rgba(4, 38, 29, 0.18); }
#stage.light #progress i b { background: var(--deep); }

/* ---------- Slides ---------- */
#slides {
  position: absolute; z-index: 2;
  top: calc(var(--safe-t) + 22px);
  bottom: calc(var(--player-h) + var(--safe-b));
  left: 0; right: 0;
}
.slide {
  position: absolute; inset: 0;
  padding: 18px 22px 14px;
  display: flex; flex-direction: column;
  overflow-x: hidden; overflow-y: auto;
  scrollbar-width: none;
  opacity: 0; visibility: hidden;
  transform: translateX(28px);
  transition: opacity 0.9s var(--ease-soft), transform 0.9s var(--ease-soft), visibility 0s linear 0.9s;
}
.slide::-webkit-scrollbar { display: none; }
.slide.from-left { transform: translateX(-28px); }
.slide.active {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity 0.9s var(--ease-soft), transform 0.9s var(--ease-soft), visibility 0s;
}
#stage.light .slide { color: var(--deep); }

.col { display: flex; flex-direction: column; gap: 14px; margin: auto 0; width: 100%; }
.center { text-align: center; align-items: center; }

/* Entrance animations: replay every time a slide becomes active */
.pop, .pop-up { opacity: 0; }
.slide.active .pop { animation: pop 1.3s var(--ease-soft) both; animation-delay: calc(var(--d, 0) * var(--pace) * 1ms); }
.slide.active .pop-up { animation: pop-up 1.8s var(--ease-soft) both; animation-delay: calc(var(--d, 0) * var(--pace) * 1ms); }
@keyframes pop { from { opacity: 0; transform: translateY(14px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes pop-up { from { opacity: 0; transform: translateY(40px) rotate(-3deg) scale(.95); } to { opacity: 1; transform: rotate(var(--r, 0deg)); } }

/* ---------- Type ---------- */
.kicker {
  margin: 0;
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--mint);
}
#stage.light .kicker { color: var(--emerald); }
.title {
  margin: 0;
  font-size: clamp(30px, 9vw, 44px); font-weight: 900;
  line-height: 1; letter-spacing: -0.03em;
}
.mega {
  margin: 0;
  font-size: clamp(46px, 15vw, 72px); font-weight: 900;
  line-height: 0.9; letter-spacing: -0.045em;
}
.mega span { display: block; }
.mega span:nth-child(even) { color: var(--gold); }
.sub { margin: 0; font-size: 17px; font-weight: 600; color: var(--ink-soft); line-height: 1.35; }
.hand { font-family: var(--f-hand); font-weight: 500; font-size: 25px; line-height: 1.15; margin: 0; }
.small { margin: 0; font-size: 14px; line-height: 1.45; color: var(--ink-soft); font-weight: 500; }
.tap-hint {
  margin: 6px 0 0;
  font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-soft);
}
.tap-hint.blink { animation: blink 2.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.35; } }

.btn {
  appearance: none; border: 0; cursor: pointer;
  padding: 14px 22px; border-radius: 999px;
  background: var(--jade); color: #021a14;
  font-weight: 800; font-size: 15px; letter-spacing: 0.02em;
  transition: transform 0.15s;
}
.btn:active { transform: scale(0.96); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px rgba(255,255,255,0.35); }
.link { appearance: none; background: none; border: 0; cursor: pointer; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; font-size: 14px; font-weight: 600; padding: 8px; }

/* ---------- Gate ---------- */
#gate {
  position: absolute; inset: 0; z-index: 50;
  display: grid; place-items: center;
  padding: calc(var(--safe-t) + 24px) 24px calc(var(--safe-b) + 24px);
  background:
    radial-gradient(120% 70% at 0% 0%, rgba(0, 168, 107, 0.55), transparent 60%),
    radial-gradient(120% 70% at 100% 100%, rgba(11, 110, 79, 0.7), transparent 60%),
    #04261d;
  transition: opacity 1.4s ease, visibility 0s linear 1.4s;
}
#gate.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.gate-inner { width: 100%; max-width: 360px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.gate-gift { font-size: 64px; animation: wobble 2.4s ease-in-out infinite; }
@keyframes wobble { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg) translateY(-6px); } }
.gate-title { margin: 0 0 6px; font-size: 30px; font-weight: 900; line-height: 1.05; letter-spacing: -0.03em; }
#gate-form { display: flex; flex-direction: column; gap: 10px; width: 100%; }
#pw {
  width: 100%;
  padding: 15px 18px; border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.25);
  color: var(--ink); font: 600 18px var(--f-display); text-align: center;
  outline: none;
}
#pw:focus { border-color: var(--mint); }
#gate-form.shake { animation: shake 0.45s; }
@keyframes shake { 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }
.hint { margin: 0; font-family: var(--f-hand); font-size: 24px; color: var(--gold); line-height: 1.15; }
.welcome { display: flex; flex-direction: column; gap: 10px; width: 100%; }

/* ---------- Toast ---------- */
#toast {
  position: absolute; z-index: 30;
  left: 16px; right: 16px;
  bottom: calc(var(--player-h) + var(--safe-b) + 10px);
  padding: 12px 16px; border-radius: 14px;
  background: rgba(2, 20, 15, 0.92);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: var(--ink); font-size: 15px; line-height: 1.4; font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  opacity: 0; transform: translateY(10px);
  transition: opacity 0.5s, transform 0.5s var(--ease-soft);
}
#toast.show { opacity: 1; transform: none; }
#toast b { display: block; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mint); margin-bottom: 3px; }

/* ---------- Player ---------- */
#player {
  position: absolute; z-index: 20;
  left: 0; right: 0; bottom: 0;
  padding: 0 10px calc(var(--safe-b) + 8px);
  background: linear-gradient(to top, rgba(2, 16, 12, 0.98) 60%, rgba(2, 16, 12, 0.85));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.pl-bar { height: 3px; margin: 0 -10px 8px; background: rgba(255, 255, 255, 0.15); }
.pl-bar i { display: block; height: 100%; width: 0; background: var(--jade); }
.pl-row { display: flex; align-items: center; gap: 4px; height: calc(var(--player-h) - 19px); }
.pl-meta {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 10px;
  background: none; border: 0; padding: 0; cursor: pointer; text-align: left;
}
.pl-cover { width: 42px; height: 42px; flex: none; border-radius: 6px; background: #0b3d2e center / cover; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.pl-text { min-width: 0; display: flex; flex-direction: column; }
.pl-text b, .pl-text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-text b { font-size: 14px; font-weight: 700; }
.pl-text span { font-size: 12px; color: var(--ink-soft); font-weight: 500; }
.pl-btn { width: 40px; height: 40px; flex: none; display: grid; place-items: center; background: none; border: 0; cursor: pointer; border-radius: 50%; }
.pl-btn svg { width: 22px; height: 22px; fill: currentColor; }
.pl-play { width: 44px; height: 44px; background: var(--ink); color: #021a14; }
.pl-play .i-pause { display: none; }
#player.playing .pl-play .i-play { display: none; }
#player.playing .pl-play .i-pause { display: block; }

/* ---------- Last year ---------- */
.shot {
  margin: 4px 0;
  border-radius: 14px; overflow: hidden;
  background: #313338;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255,255,255,0.06);
  --r: -2deg;
}

/* ---------- Top words ---------- */
.rank { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rank li { display: grid; grid-template-columns: 34px 1fr auto; align-items: baseline; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,0.14); }
.rank .n { font-size: 18px; font-weight: 800; color: var(--ink-soft); }
.rank .w { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.rank .c { font-size: 15px; font-weight: 700; color: var(--mint); font-variant-numeric: tabular-nums; text-align: right; }
.rank li:first-child .n { color: var(--gold); }
.rank li:first-child .w { font-size: clamp(40px, 12vw, 54px); font-weight: 900; color: var(--gold); line-height: 1; }
.rank li:first-child .c { font-size: 17px; }
.foot { margin: 2px 0 0; font-size: 14px; font-weight: 600; color: var(--ink-soft); }

/* ---------- Numbers ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile {
  padding: 16px 14px; border-radius: 18px;
  background: rgba(0, 0, 0, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
}
.tile.span { grid-column: 1 / -1; }
.tile.wide { grid-column: 1 / -1; background: var(--gold); color: #1d1606; box-shadow: none; }
.tile .num { display: block; font-size: clamp(30px, 9vw, 42px); font-weight: 900; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.tile .unit { font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.tile p { margin: 6px 0 0; font-size: 14px; line-height: 1.3; font-weight: 600; opacity: 0.85; }
.tile .note { font-family: var(--f-hand); font-size: 21px; opacity: 1; font-weight: 600; }

/* ---------- Songs ---------- */
.songs { display: flex; flex-direction: column; gap: 8px; }
.song {
  display: grid; grid-template-columns: 22px 52px 1fr; align-items: center; gap: 12px;
  width: 100%; padding: 8px; border-radius: 12px; border: 0;
  background: transparent; text-align: left; cursor: pointer;
  transition: background 0.25s;
}
.song.playing { background: rgba(255, 255, 255, 0.1); }
.song .n { font-size: 18px; font-weight: 800; color: var(--ink-soft); text-align: center; }
.song img { width: 52px; height: 52px; border-radius: 6px; object-fit: cover; box-shadow: 0 4px 12px rgba(0,0,0,.4); }
.song .t { min-width: 0; }
.song .t b { display: block; font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.song .t span { display: block; font-size: 13px; color: var(--ink-soft); font-weight: 500; }
.song .t em { display: block; max-height: 0; overflow: hidden; font-style: normal; font-family: var(--f-hand); font-size: 20px; line-height: 1.1; color: var(--gold); transition: max-height 0.8s var(--ease-soft), margin 0.8s var(--ease-soft); }
.song.playing .t em { max-height: 90px; margin-top: 4px; }
.song.playing .t b { color: var(--mint); }

/* ---------- Gallery on a string ---------- */
.gallery { flex: 1; display: flex; flex-direction: column; min-height: 0; gap: 6px; }
.gal-head { text-align: center; }
.gal-line { position: relative; flex: 1 1 auto; min-height: 280px; margin: 0 -22px; overflow: hidden; }
.track {
  position: absolute; top: 28px; left: 0;
  display: flex; gap: var(--gap, 26px);
  transition: transform 1.2s var(--ease-soft);
}
.track .string { position: absolute; left: 0; top: -14px; overflow: visible; pointer-events: none; }
.track .string path { fill: none; stroke: var(--string); stroke-width: 2.4; stroke-linecap: round; }
.pol {
  position: relative; flex: none;
  width: var(--pw, 240px);
  margin: 0;
  padding: 10px 10px 0;
  background: var(--cream);
  box-shadow: 0 14px 30px rgba(30, 24, 10, 0.28), 0 2px 4px rgba(0,0,0,0.12);
  transform-origin: 50% -6px;
  transform: rotate(var(--r, 0deg)) scale(0.9);
  opacity: 0.6;
  transition: transform 1.2s var(--ease-soft), opacity 0.9s;
}
.pol.on { transform: rotate(calc(var(--r, 0deg) * 0.4)) scale(1); opacity: 1; animation: swing 4s ease-in-out infinite; }
@keyframes swing { 50% { transform: rotate(calc(var(--r, 0deg) * -0.4)) scale(1); } }
.pol .ph { aspect-ratio: 3 / 4; overflow: hidden; background: #ddd5c2; }
.pol .ph img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.pol figcaption { height: 40px; display: grid; place-items: center; font-family: var(--f-hand); font-size: 22px; font-weight: 700; color: #3a3a3a; }
/* A small wooden clothespin */
.pin {
  position: absolute; z-index: 2; left: 50%; top: -22px;
  width: 13px; height: 38px; margin-left: -6.5px;
  border-radius: 3px 3px 2px 2px;
  background: linear-gradient(90deg, #d6ae78 0 46%, #a77e4b 46% 54%, #d6ae78 54%);
  box-shadow: 0 2px 4px rgba(0,0,0,0.25);
}
.pin::after { content: ""; position: absolute; left: -2px; right: -2px; top: 12px; height: 4px; border-radius: 2px; background: #8d8d8d; }
.gal-cap { margin: 0 auto; max-width: 400px; min-height: 3.5em; text-align: center; font-family: var(--f-hand); font-size: 22px; line-height: 1.15; font-weight: 600; transition: opacity 0.6s; }
.gal-cap.swap { opacity: 0; }
.gal-count { margin: 0; text-align: center; font-size: 12px; font-weight: 700; letter-spacing: 0.14em; opacity: 0.6; }

/* ---------- Favourite (GIF) ---------- */
.pol.solo { --pw: min(68vw, 290px); opacity: 1; transform: rotate(-2deg); animation: none; margin-top: 26px; }
.slide.active .pol.solo { animation: pop-up 1.9s var(--ease-soft) both 0.5s; --r: -2deg; }
.solo-string { position: absolute; left: -40vw; right: -40vw; top: -4px; height: 2.4px; background: var(--string); }

/* ---------- Reveal cards (proud / wishes) ---------- */
.cards { display: flex; flex-direction: column; gap: 10px; }
.card {
  display: none;
  padding: 14px 16px; border-radius: 16px;
  background: rgba(0, 0, 0, 0.24);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}
.card.on { display: block; animation: pop 1.1s var(--ease-soft) both; }
.card h3 { margin: 0 0 4px; font-size: 18px; font-weight: 800; letter-spacing: -0.01em; display: flex; gap: 10px; align-items: baseline; }
.card h3 span { font-size: 13px; color: var(--gold); font-weight: 800; }
.card p { margin: 0; font-size: 15px; line-height: 1.42; font-weight: 500; color: var(--ink-soft); }

/* ---------- Poem ---------- */
.poem { font-family: var(--f-serif); font-size: 18px; line-height: 1.5; padding-bottom: 24px; font-style: italic; text-align: center; }
.poem h2 { font-family: var(--f-hand); font-style: normal; font-size: 36px; margin: 0 0 14px; color: var(--gold); }
.poem .line { margin: 0; }
.poem .w { opacity: 0; filter: blur(4px); transition: opacity 0.7s ease, filter 0.7s ease; }
.poem .w.on { opacity: 1; filter: none; }
.col.poem { gap: 0; }
.poem .gap { height: 1.1em; }

/* ---------- Verses ---------- */
.verse-stage { position: relative; width: 100%; min-height: 380px; }
.verse {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center; gap: 16px;
  text-align: center;
  opacity: 0; transform: translateX(40px);
  transition: opacity 1.1s var(--ease-soft), transform 1.1s var(--ease-soft);
  pointer-events: none;
}
.verse.on { opacity: 1; transform: none; }
.verse.past { transform: translateX(-40px); }
.vtext { margin: 0; font-family: var(--f-serif); font-size: clamp(21px, 6.2vw, 27px); line-height: 1.4; font-weight: 500; }
.vref { margin: 0; font-size: 14px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.vref span { opacity: 0.6; font-weight: 600; }
.vnote { margin: 4px 0 0; font-family: var(--f-hand); font-size: 23px; line-height: 1.15; color: var(--ink); font-weight: 600; }
.dots { display: flex; gap: 8px; justify-content: center; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.3); transition: background 0.3s, transform 0.3s; }
.dots i.on { background: #fff; transform: scale(1.3); }

/* ---------- Prayer ---------- */
.pray-btn {
  width: 92px; height: 92px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center;
  background: var(--ink); color: var(--deep);
  box-shadow: 0 0 0 0 rgba(246, 243, 233, 0.4);
  animation: ring 2.6s ease-out infinite;
}
.pray-btn svg { width: 38px; height: 38px; fill: currentColor; }
.pray-btn .i-pause { display: none; }
.pray-btn.playing .i-play { display: none; }
.pray-btn.playing .i-pause { display: block; }
.pray-btn:disabled { opacity: 0.4; animation: none; cursor: default; }
@keyframes ring { 70% { box-shadow: 0 0 0 22px rgba(246, 243, 233, 0); } 100% { box-shadow: 0 0 0 0 rgba(246, 243, 233, 0); } }
.wave { display: flex; gap: 5px; align-items: center; height: 46px; }
.wave i { width: 5px; height: 8px; border-radius: 3px; background: var(--mint); opacity: 0.5; }
.wave.on i { animation: bar 1.1s ease-in-out infinite; animation-delay: calc(var(--k) * -0.13s); opacity: 0.9; }
@keyframes bar { 50% { height: 42px; } }

/* ---------- Cake ---------- */
.cake { position: relative; width: 230px; height: 210px; margin: 6px auto 0; cursor: pointer; }
.candles { position: absolute; left: 40px; right: 40px; top: 0; height: 74px; display: flex; justify-content: space-between; align-items: flex-end; }
.candle {
  position: relative; width: 12px; height: 46px; border-radius: 3px;
  background: repeating-linear-gradient(-45deg, var(--cream) 0 6px, var(--jade) 6px 12px);
  cursor: pointer;
}
.candle::before { content: ""; position: absolute; left: 5px; top: -7px; width: 2px; height: 7px; background: #333; }
.flame {
  position: absolute; left: 50%; top: -30px;
  width: 14px; height: 22px; margin-left: -7px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 50% 70%, #fff6c9 0 22%, #ffc94a 40%, #ff8a1f 75%, transparent 76%);
  box-shadow: 0 0 18px 6px rgba(255, 190, 70, 0.55);
  transform-origin: 50% 90%;
  animation: flicker 0.18s ease-in-out infinite alternate;
  transition: opacity 0.25s, transform 0.25s;
}
@keyframes flicker { to { transform: rotate(3deg) scaleY(1.08); } }
.candle.out .flame { opacity: 0; transform: scale(0.2) translateY(-10px); animation: none; }
.candle.out::after { content: ""; position: absolute; left: 1px; top: -40px; width: 10px; height: 30px; border-radius: 50%; background: rgba(255,255,255,0.35); filter: blur(4px); animation: smoke 1.2s ease-out forwards; }
@keyframes smoke { to { opacity: 0; transform: translateY(-30px) scaleX(1.8); } }
.tier { position: absolute; left: 50%; transform: translateX(-50%); border-radius: 12px 12px 6px 6px; }
.tier.top { top: 70px; width: 170px; height: 56px; background: var(--cream); box-shadow: inset 0 -10px 0 rgba(0,0,0,0.06); }
.tier.top::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 18px; border-radius: 12px 12px 0 0; background: radial-gradient(circle at 10px 18px, var(--cream) 9px, transparent 10px) 0 0 / 20px 30px repeat-x, var(--jade); }
.tier.bottom { top: 122px; width: 220px; height: 66px; background: var(--emerald); box-shadow: inset 0 -12px 0 rgba(0,0,0,0.12); }
.tier.bottom::before { content: ""; position: absolute; left: 0; right: 0; top: 26px; height: 4px; background: var(--string); }
.plate { position: absolute; left: 50%; bottom: 10px; width: 250px; height: 14px; margin-left: -125px; border-radius: 50%; background: rgba(255,255,255,0.75); }
.mic-btn { padding: 11px 18px; font-size: 14px; }
.wish-done { font-family: var(--f-hand); font-size: 40px; color: var(--gold); margin: 0; min-height: 1.1em; opacity: 0; transform: scale(0.8); transition: opacity 1.4s var(--ease-soft), transform 1.4s var(--ease-soft); }
.wish-done.on { opacity: 1; transform: none; }
.frog {
  position: absolute; right: 10px; bottom: 18px;
  width: 44px; height: 44px; border: 0; background: none; cursor: pointer;
  font-size: 30px; line-height: 1; padding: 0;
  transform: translateY(14px) rotate(-8deg); opacity: 0.9;
  animation: peek 5s ease-in-out infinite;
}
@keyframes peek { 0%, 70%, 100% { transform: translateY(14px) rotate(-8deg); } 78%, 92% { transform: translateY(0) rotate(4deg); } }

/* ---------- Summary card ---------- */
.sum-card {
  width: 100%; max-width: 360px;
  border-radius: 22px; overflow: hidden;
  background: linear-gradient(160deg, #50c878, var(--jade) 55%, #078a5b);
  color: #032118;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45);
  text-align: left;
  --r: 0deg;
}
.sum-photo { aspect-ratio: 16 / 10; overflow: hidden; }
.sum-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.sum-name { margin: 14px 18px 0; font-size: 26px; font-weight: 900; letter-spacing: -0.03em; line-height: 1; }
.sum-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; padding: 14px 18px 6px; }
.sum-grid h4 { margin: 0 0 4px; font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.7; }
.sum-grid ol { margin: 0; padding: 0; list-style: none; font-size: 14px; font-weight: 700; line-height: 1.45; }
.sum-grid ol li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sum-grid ol li span { opacity: 0.6; margin-right: 6px; }
.sum-grid .big { margin: 0; font-size: 34px; font-weight: 900; line-height: 1; }
.sum-grid .verse-ref { margin: 0; font-size: 15px; font-weight: 800; }
.sum-foot { display: flex; justify-content: space-between; padding: 12px 18px 14px; font-size: 11px; font-weight: 800; letter-spacing: 0.12em; }

/* ---------- Video ---------- */
.video-box {
  width: min(100%, calc(56vh * 9 / 16));
  aspect-ratio: 9 / 16; max-height: 58vh;
  border-radius: 18px; overflow: hidden;
  background: #000; box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
.video-box video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.video-ph { height: 100%; display: grid; place-items: center; text-align: center; padding: 20px; font-weight: 700; color: var(--ink-soft); line-height: 1.5; }

/* ---------- Final ---------- */
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; }
.countdown div { padding: 12px 4px 10px; border-radius: 14px; background: rgba(0, 0, 0, 0.25); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12); }
.countdown b { display: block; font-size: clamp(28px, 9vw, 40px); font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.countdown span { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.75; }
.today { margin: 0; font-size: 44px; font-weight: 900; color: var(--gold); }
.ticket {
  position: relative; width: 100%; max-width: 360px;
  display: grid; grid-template-columns: 1fr 86px;
  margin-top: 18px;
  background: var(--cream); color: #1e2a24;
  border-radius: 14px;
  text-align: left;
  box-shadow: 0 16px 36px rgba(0,0,0,0.4);
  --r: -1.5deg;
}
.t-main { padding: 16px 16px 16px 18px; border-right: 2px dashed rgba(0,0,0,0.2); }
.t-admit { display: block; font-size: 11px; font-weight: 800; letter-spacing: 0.2em; color: var(--emerald); margin-bottom: 4px; }
.t-main p { margin: 0; font-size: 16px; font-weight: 800; line-height: 1.25; letter-spacing: -0.01em; }
.t-stub { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 10px 6px; }
.t-stub b { font-size: 22px; font-weight: 900; }
.t-stub span { font-size: 13px; font-weight: 700; opacity: 0.7; }
/* The red string, tied around the ticket */
.ticket::before { content: ""; position: absolute; top: -2px; bottom: -2px; right: 85px; width: 3px; background: var(--string); }
.bow { position: absolute; right: 55px; top: -30px; width: 64px; height: 50px; overflow: visible; }
.bow path { fill: none; stroke: var(--string); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 220; stroke-dashoffset: 220; }
.slide.active .bow path { animation: draw 2.6s var(--ease-soft) forwards 2s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.cosy { margin: 6px 0 0; font-family: var(--f-hand); font-size: 30px; font-weight: 700; color: var(--gold); line-height: 1.1; }
.forever { margin: 0; font-size: 14px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; color: var(--mint); }
.sign { margin: 0; font-family: var(--f-hand); font-size: 26px; line-height: 1.2; }

@media (max-height: 700px) {
  .slide { padding-top: 12px; }
  .col { gap: 10px; }
  .verse-stage { min-height: 340px; }
}

@media (prefers-reduced-motion: reduce) {
  .blob, #thread, .pol.on, .gate-gift, .frog, .pray-btn { animation: none !important; }
}
