/* =====================================================================
   Linn 18 – birthday scroll story
   Only transform / opacity are animated (GSAP + CSS keyframes).
   ===================================================================== */

:root {
  color-scheme: only light; /* never let the browser auto-darken this page */
  --pink: #ff77b5;
  --pink-deep: #e0337e;
  --powder: #ffd3e4;
  --peach: #ffc6a5;
  --violet: #7a3fa0;
  --ink: #3a1f52;
  --cream: #fff4e8;
  --gold: #ffc94d;
  --navy: #0a1030;

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);

  --f-title: "Shrikhand", "Georgia", serif;
  --f-hand: "Caveat", "Bradley Hand", "Segoe Print", cursive;
  --f-text: "DM Sans", -apple-system, "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  background: var(--pink);
}
html.locked, html.locked body { overflow: hidden; }

body {
  margin: 0;
  font-family: var(--f-text);
  color: var(--ink);
  background: transparent;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}

img { -webkit-user-drag: none; user-select: none; }

/* ---------- fixed background canvas (polka dots / stars) ---------- */
#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}
main { position: relative; z-index: 1; }

/* ---------- scenes: tall section + sticky full-screen stage ---------- */
.scene {
  position: relative;
  height: calc(var(--len) * 1vh);
  height: calc(var(--len) * 1svh);
  overflow-x: clip;
}
.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  will-change: transform;
}
.layer svg { width: 100%; height: 100%; display: block; overflow: visible; } /* no hard clip edge when a layer moves */

/* ---------- photo cards ---------- */
.card {
  --ch: 50dvh;          /* target height */
  --maxw: 72vw;         /* width cap */
  margin: 0;
  position: relative;
  width: min(var(--maxw), calc(var(--ch) * var(--ar, .63)));
  will-change: transform, opacity;
}
.frame {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  background: var(--powder);
  box-shadow:
    0 22px 44px -14px rgba(58, 31, 82, .5),
    0 0 36px rgba(255, 201, 77, .35);
  -webkit-mask-image: -webkit-radial-gradient(white, black); /* Safari: clip transformed child to radius */
}
.card img {
  display: block;
  width: 100%;
  height: auto;
  transform-origin: 50% 40%;
  animation: kenburns 18s ease-in-out infinite alternate;
  animation-delay: calc(var(--d, 0s) * -1);
}
/* slow documentary zoom */
@keyframes kenburns {
  from { transform: scale(1.02) translate(0, 0); }
  to { transform: scale(1.13) translate(-2%, -1.5%); }
}
/* light sweep across the photo, now and then */
.frame::after {
  content: "";
  position: absolute;
  inset: -10% -60%;
  background: linear-gradient(110deg, transparent 40%, rgba(255, 250, 235, .38) 50%, transparent 60%);
  transform: translateX(-70%);
  animation: sweep 8s ease-in-out infinite;
  animation-delay: var(--d, 0s);
  pointer-events: none;
}
@keyframes sweep {
  0%, 62% { transform: translateX(-70%); opacity: 0; }
  66% { opacity: 1; }
  86% { transform: translateX(70%); opacity: 1; }
  90%, 100% { transform: translateX(70%); opacity: 0; }
}

/* ---------- cinematic overlays ---------- */
#motes, #vignette, #grain { position: fixed; pointer-events: none; z-index: 30; }
#motes { inset: 0; overflow: hidden; }
#motes i {
  position: absolute;
  bottom: -20px;
  border-radius: 50%;
  background: #fff6dc;
  box-shadow: 0 0 10px 3px rgba(255, 214, 140, .55);
  opacity: 0;
  animation: rise linear infinite;
}
@keyframes rise {
  0% { transform: translate(0, 0); opacity: 0; }
  10% { opacity: .75; }
  50% { transform: translate(var(--dx), -55vh); }
  85% { opacity: .5; }
  100% { transform: translate(0, -115vh); opacity: 0; }
}
#vignette {
  inset: 0;
  background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(25, 8, 35, .38) 100%);
}
/* Lenis smooth scrolling */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* off-screen scenes: pause all autonomous animations (saves GPU, keeps frames smooth) */
.scene:not(.active) *, .scene:not(.active) *::after { animation-play-state: paused !important; }
#progress {
  position: fixed;
  z-index: 46;
  left: 0;
  right: 0;
  top: var(--safe-t);
  height: 3px;
  pointer-events: none;
}
#progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--pink), var(--gold));
  box-shadow: 0 0 8px rgba(255, 201, 77, .8);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

/* title letters float on their own */
.tch { display: inline-block; animation: hover 4.5s ease-in-out infinite; }
@keyframes hover {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50% { transform: translateY(-12px) rotate(1.5deg); }
}

/* autonomous scenery motion */
.clouds svg { animation: drift 26s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translateX(-4%); } to { transform: translateX(4%); } }
.sun-l svg circle { transform-box: fill-box; transform-origin: 50% 50%; animation: glow 5s ease-in-out infinite; }
@keyframes glow { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
.sway { transform-box: fill-box; transform-origin: 50% 100%; animation: sway 4.5s ease-in-out infinite alternate; }
@keyframes sway { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
.necklace { transform-origin: 50% 0; animation: swing 6s ease-in-out infinite alternate; }
@keyframes swing { from { transform: rotate(-1.2deg); } to { transform: rotate(1.2deg); } }
.float { animation: bob 6s ease-in-out infinite; }
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(.6deg); }
}

/* ---------- typography ---------- */
.hand { font-family: var(--f-hand); font-weight: 700; line-height: 1.05; margin: 0; }
.ch { display: inline-block; }
.big { font-size: clamp(2.2rem, 10vw, 4rem); color: var(--pink-deep); }
.caption {
  position: absolute;
  font-size: clamp(1.8rem, 8vw, 3.2rem);
  text-align: center;
  width: 92%;
  left: 4%;
}

/* ---------- loader ---------- */
#loader {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #000;
  display: grid;
  place-items: center;
  transition: opacity .6s ease;
}
#loader.done { opacity: 0; pointer-events: none; }
.heart {
  position: relative;
  width: 120px;
  height: 110px;
  animation: pulse 1.1s ease-in-out infinite;
}
.heart i {
  position: absolute;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--pink);
}
@keyframes pulse {
  0%, 100% { transform: scale(.9); }
  30% { transform: scale(1.08); }
  45% { transform: scale(.96); }
  60% { transform: scale(1.04); }
}

/* ---------- intro gag ---------- */
#intro {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #000;
  display: grid;
  place-items: center;
  padding: calc(var(--safe-t) + 24px) calc(var(--safe-r) + 24px) calc(var(--safe-b) + 24px) calc(var(--safe-l) + 24px);
  overflow: hidden;
}
#intro.gone { display: none; }
.type {
  position: relative;
  z-index: 2;
  margin: 0;
  max-width: 22ch;
  text-align: center;
  color: var(--cream);
  font-size: clamp(1.4rem, 6vw, 2.6rem);
  font-weight: 500;
  line-height: 1.35;
}
#typeB { font-family: var(--f-hand); font-weight: 700; font-size: 1.5em; color: var(--pink); }
.caret {
  display: inline-block;
  width: .08em;
  height: 1.1em;
  margin-left: .06em;
  vertical-align: -.15em;
  background: var(--pink);
  animation: blink .8s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
#burst { position: absolute; inset: 0; pointer-events: none; }
#burst i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
}

/* ---------- sound button ---------- */
#sound {
  position: fixed;
  z-index: 45;
  top: calc(var(--safe-t) + 12px);
  right: calc(var(--safe-r) + 12px);
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 244, 232, .82);
  box-shadow: 0 4px 14px rgba(58, 31, 82, .25);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity .4s;
}
#sound.show { opacity: 1; }
#sound svg { width: 24px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#sound .spk { fill: var(--ink); }
#sound .on { display: none; }
#sound[aria-pressed="true"] .on { display: inline; }
#sound[aria-pressed="true"] .off { display: none; }

/* ---------- 1 START ---------- */
#s-start .stage { align-content: center; gap: 0; text-align: center; padding: 0 16px; }
.kicker {
  margin: 0 0 .2em;
  font-weight: 700;
  font-size: clamp(.9rem, 3.6vw, 1.2rem);
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--cream);
}
.title {
  margin: 0;
  font-family: var(--f-title);
  font-weight: 400;
  font-size: clamp(5rem, 34vw, 15rem);
  line-height: .95;
  color: var(--cream);
  text-shadow: 0 6px 0 var(--pink-deep), 0 18px 40px rgba(122, 63, 160, .35);
}
.hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--safe-b) + 96px);
  display: grid;
  justify-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--cream);
  letter-spacing: .08em;
}
.arrow {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: var(--cream);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: nudge 1.4s ease-in-out infinite;
}
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(9px); } }

/* ---------- 2 SUNSET ---------- */
.sky-day { background: linear-gradient(#ffb79b 0%, #ffc9b4 45%, #ffd9c9 70%, #ffc3d6 100%); }
.sky-night { background: linear-gradient(#140f3c 0%, #3b2370 45%, #8a3f8f 75%, #e06a9c 100%); opacity: 0; }
.stars {
  opacity: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 8%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 44% 26%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 63% 12%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 78% 22%, #ffe9b8 50%, transparent 51%),
    radial-gradient(1px 1px at 90% 6%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 6% 34%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 52% 4%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 36% 40%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 84% 38%, #fff 50%, transparent 51%);
}
.card-sunset { --ch: 40dvh; --maxw: 58vw; position: absolute; top: calc(var(--safe-t) + 9dvh); z-index: 3; }
.sunset-cap { top: calc(var(--safe-t) + 52dvh); color: var(--cream); z-index: 3; text-shadow: 0 2px 4px rgba(58, 31, 82, .7), 0 0 18px rgba(58, 31, 82, .6); }
.leg { transform-box: fill-box; transform-origin: 50% 0; }
.walking .bob { animation: bob-dog .25s ease-in-out infinite alternate; }
@keyframes bob-dog { from { transform: translateY(0); } to { transform: translateY(-2px); } }
.walking .leg-a { animation: legA .5s ease-in-out infinite; }
.walking .leg-b { animation: legB .5s ease-in-out infinite; }
@keyframes legA { 0%, 100% { transform: rotate(22deg); } 50% { transform: rotate(-22deg); } }
@keyframes legB { 0%, 100% { transform: rotate(-22deg); } 50% { transform: rotate(22deg); } }

/* ---------- split stages (Little Linn, Skadi) ---------- */
.split {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3dvh;
  padding: calc(var(--safe-t) + 60px) 16px calc(var(--safe-b) + 24px);
  text-align: center;
}
.side { position: relative; z-index: 2; }
.card-kind { --ch: 38dvh; --maxw: 88vw; }
.counter {
  font-family: var(--f-title);
  color: var(--violet);
  line-height: .9;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: .25em;
}
#count { font-size: clamp(5rem, 26vw, 10rem); font-variant-numeric: tabular-nums; min-width: 1.3em; display: inline-block; }
.counter small { font-family: var(--f-text); font-weight: 700; font-size: clamp(1rem, 4.5vw, 1.6rem); letter-spacing: .1em; }

.card-skadi { --ch: 56dvh; --maxw: 74vw; z-index: 1; }
.paws { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.paw { position: absolute; width: 9vmin; height: 9vmin; margin: -4.5vmin 0 0 -4.5vmin; fill: var(--violet); opacity: 0; }

/* ---------- 5 RACE ---------- */
.race-sky { background: linear-gradient(#3b2370 0%, #8a3f8f 45%, #ff9a8a 78%, #ffc6a5 100%); }
.track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 26dvh;
  will-change: transform;
}
.kerb { height: 14px; overflow: hidden; position: relative; }
.kerb-strip, .lane-strip {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 300%;
  will-change: transform;
}
.kerb-strip { background: repeating-linear-gradient(90deg, #e2263b 0 36px, #fff4e8 36px 72px); }
.asphalt { position: relative; height: calc(100% - 28px); background: linear-gradient(#2c2633, #1d1824); overflow: hidden; }
.lane { position: absolute; left: 0; right: 0; top: 50%; height: 6px; margin-top: -3px; overflow: hidden; }
.lane-strip { background: repeating-linear-gradient(90deg, rgba(255, 244, 232, .8) 0 60px, transparent 60px 120px); }

.lights { position: absolute; top: calc(var(--safe-t) + 9dvh); left: 0; right: 0; display: grid; place-items: center; z-index: 4; will-change: transform, opacity; }
.gantry {
  display: flex;
  gap: clamp(6px, 2vw, 14px);
  padding: 10px clamp(10px, 3vw, 18px);
  background: #15121b;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}
.pod {
  position: relative;
  width: clamp(36px, 11vw, 60px);
  height: calc(clamp(36px, 11vw, 60px) * 2);
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 27%, #3b0d12 0 30%, transparent 31%),
    radial-gradient(circle at 50% 73%, #3b0d12 0 30%, transparent 31%),
    #221d29;
}
.pod i {
  position: absolute;
  left: 20%;
  width: 60%;
  height: 30%;
  border-radius: 50%;
  background: radial-gradient(circle, #ff6b6b 0%, #e2142b 55%, #a10a1a 100%);
  box-shadow: 0 0 18px 6px rgba(255, 40, 60, .6);
  opacity: 0;
}
.pod i:first-child { top: 12%; }
.pod i:last-child { top: 58%; }
.go {
  position: absolute;
  z-index: 5;
  margin: 0;
  font-family: var(--f-title);
  font-size: clamp(4rem, 22vw, 10rem);
  color: var(--cream);
  text-shadow: 0 6px 0 var(--pink-deep), 0 0 40px rgba(255, 201, 77, .7);
  opacity: 0;
}
.race-title { position: absolute; top: calc(var(--safe-t) + 9dvh + clamp(36px, 11vw, 60px) * 2 + 40px); font-size: clamp(1.8rem, 8vw, 3rem); color: var(--cream); text-align: center; width: 100%; z-index: 4; }
.speedlines {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(180deg, transparent 0 37px, rgba(255, 244, 232, .35) 37px 39px, transparent 39px 91px);
  z-index: 2;
}
.gallery {
  position: absolute;
  z-index: 3;
  left: 0;
  top: calc(var(--safe-t) + 14dvh);
  display: flex;
  align-items: center;
  gap: 14vw;
  padding-left: 100vw;
  width: max-content;
  will-change: transform;
}
.rc { --ch: 46dvh; --maxw: 66vw; }
.trail {
  position: absolute;
  top: 18%;
  bottom: 18%;
  left: 55%;
  width: 90vw;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 201, 77, .7), rgba(255, 119, 181, .35) 35%, rgba(255, 119, 181, 0) 100%);
  filter: blur(10px);
  transform-origin: 0 50%;
  transform: scaleX(0);
  opacity: 0;
  z-index: -1;
}
.finish {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2dvh;
  padding: calc(var(--safe-t) + 56px) 16px calc(var(--safe-b) + 20px);
  pointer-events: none;
}
.finish .caption { position: static; width: auto; color: var(--cream); text-shadow: 0 2px 14px rgba(0, 0, 0, .45); opacity: 0; }
.card-berg { --ch: 58dvh; --maxw: 80vw; opacity: 0; }

/* ---------- 6 ART ---------- */
.duo .card { position: absolute; --ch: 44dvh; --maxw: 54vw; }
.card-a { left: 6%; top: calc(var(--safe-t) + 16dvh); }
.card-b { right: 6%; bottom: calc(var(--safe-b) + 6dvh); z-index: 2; }
.duo-cap { top: calc(var(--safe-t) + 6dvh); color: var(--cream); text-shadow: 0 2px 14px rgba(22, 12, 43, .55); z-index: 3; }

/* ---------- 7 HOLIDAY ---------- */
.sun-glow { background: radial-gradient(circle at 70% 18%, rgba(255, 235, 170, .85) 0, rgba(255, 201, 77, .25) 22%, transparent 45%); }
.card-meer { position: absolute; --ch: 58dvh; --maxw: 66vw; left: 5%; top: calc(var(--safe-t) + 14dvh); }
.card-gasse { position: absolute; --ch: 40dvh; --maxw: 46vw; right: 5%; bottom: calc(var(--safe-b) + 5dvh); z-index: 2; }
.holiday-cap { top: calc(var(--safe-t) + 5dvh); color: var(--pink-deep); z-index: 3; }

/* ---------- 8 FLOWERS ---------- */
.necklace { position: absolute; top: calc(var(--safe-t) + 58px); left: 50%; width: min(94vw, 720px); margin-left: calc(min(94vw, 720px) / -2); height: auto; z-index: 3; overflow: visible; }
.necklace .string { transform-box: fill-box; transform-origin: 0 50%; }
.bead text { font-family: var(--f-text); font-weight: 700; font-size: 30px; fill: var(--ink); text-anchor: middle; dominant-baseline: central; }
.flowers .card { position: absolute; --ch: 36dvh; --maxw: 42vw; }
.card-tulpen { left: 5%; top: 30dvh; }
.card-arm { right: 5%; top: 35dvh; }
.tulips { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 34dvh; z-index: 2; overflow: visible; }
.tulip { transform-box: fill-box; transform-origin: 50% 100%; }
.flowers-cap { top: calc(var(--safe-t) + 58px + min(94vw, 720px) * .22 + 4px); color: var(--violet); z-index: 3; font-size: clamp(1.6rem, 7vw, 2.8rem); }

/* ---------- 9 NIGHT ---------- */
.night-sky { background: radial-gradient(ellipse at 50% 110%, rgba(52, 72, 150, .75) 0%, rgba(20, 28, 80, .45) 40%, rgba(10, 16, 48, 0) 75%); }
.shooting { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.sky-rot { position: absolute; left: -50%; top: -50%; width: 200%; height: 200%; transform: rotate(35deg); }
.sky-rot i {
  position: absolute;
  height: 2px;
  width: 150px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(160, 195, 255, 0), rgba(190, 215, 255, .9) 85%, #fff);
  filter: drop-shadow(0 0 6px rgba(150, 190, 255, .9));
  transform-origin: 100% 50%;
  opacity: 0;
  animation: shoot 3.2s ease-in-out infinite;
  animation-play-state: paused;
}
.night.on .sky-rot i { animation-play-state: running; }
@keyframes shoot {
  0% { transform: translateX(0) scaleX(.1); opacity: 0; }
  12% { opacity: 1; }
  70% { transform: translateX(55vmax) scaleX(1); opacity: 1; }
  100% { transform: translateX(80vmax) scaleX(.1); opacity: 0; }
}
.card-mond { --ch: 46dvh; --maxw: 66vw; position: absolute; top: calc(var(--safe-t) + 10dvh); z-index: 2; }
.wish {
  position: absolute;
  bottom: calc(var(--safe-b) + 12dvh);
  margin: 0;
  width: 100%;
  text-align: center;
  font-family: var(--f-hand);
  font-weight: 700;
  font-size: clamp(2.6rem, 12vw, 5rem);
  color: #ffe9b8;
  text-shadow: 0 0 22px rgba(255, 201, 77, .75);
  z-index: 3;
}

/* ---------- 10 GALAXY ---------- */
.galaxy { background: #05040f; }
#galaxy { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.galaxy-cap {
  position: absolute;
  bottom: calc(var(--safe-b) + 9dvh);
  width: 100%;
  margin: 0;
  text-align: center;
  font-family: var(--f-title);
  font-size: clamp(1.8rem, 8vw, 3.4rem);
  color: var(--cream);
  text-shadow: 0 0 24px rgba(255, 119, 181, .8);
  opacity: 0;
  z-index: 2;
  padding: 0 16px;
}

/* ---------- 11 FINALE ---------- */
.finale {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
  padding: calc(var(--safe-t) + 16dvh) calc(var(--safe-r) + 16px) calc(var(--safe-b) + 72px) calc(var(--safe-l) + 16px);
}
.letter {
  width: min(100%, 560px);
  background: rgba(255, 251, 246, .94);
  border-radius: 24px;
  padding: 28px 24px 30px;
  box-shadow: 0 24px 50px -18px rgba(58, 31, 82, .45), 0 0 40px rgba(255, 201, 77, .25);
}
.finale-title { margin: 0 0 12px; font-family: var(--f-title); font-weight: 400; font-size: clamp(2rem, 9vw, 3rem); color: var(--pink-deep); }
.gruss .line { margin: 0 0 .45em; font-family: var(--f-hand); font-weight: 500; font-size: clamp(1.45rem, 6vw, 1.9rem); line-height: 1.22; color: var(--ink); opacity: 0; will-change: transform, opacity; }
.gruss .line.sign { font-weight: 700; color: var(--pink-deep); font-size: clamp(1.8rem, 7.5vw, 2.4rem); }

.ticket { position: relative; width: min(100%, 520px); margin: 16px 0; }
.ticket::before, .ticket::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 14px;
  background:
    linear-gradient(-45deg, var(--pink) 7px, transparent 0),
    linear-gradient(45deg, var(--pink) 7px, transparent 0);
  background-size: 14px 14px;
  background-repeat: repeat-x;
}
.ticket::before { top: -13px; background-position: left bottom; }
.ticket::after { bottom: -13px; transform: rotate(180deg); background-position: left bottom; }
.ticket-inner {
  background-color: var(--pink);
  background-image: radial-gradient(circle, #ffc4dd 0 6px, transparent 6.5px);
  background-size: 30px 30px;
  background-position: 0 0;
  padding: 22px 20px 24px;
  text-align: center;
  box-shadow: 0 30px 50px -24px rgba(58, 31, 82, .5);
}
.ticket-label { margin: 0 0 14px; font-family: var(--f-title); font-size: clamp(1.8rem, 8vw, 2.6rem); color: var(--cream); text-shadow: 0 3px 0 var(--pink-deep); }
.scratch-area {
  position: relative;
  min-height: 140px;
  border-radius: 16px;
  background: var(--cream);
  display: grid;
  place-items: center;
  padding: 18px;
  border: 2px dashed rgba(224, 51, 126, .5);
  overflow: hidden;
}
.voucher-text { margin: 0; font-weight: 700; font-size: clamp(1.15rem, 5vw, 1.5rem); line-height: 1.3; color: var(--violet); white-space: pre-line; }
#scratch {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
  transition: opacity .7s ease;
}
#scratch.cleared { opacity: 0; pointer-events: none; }
.ticket-from { margin: 14px 0 0; font-family: var(--f-hand); font-weight: 700; font-size: 1.6rem; color: var(--cream); }

.again {
  border: 0;
  border-radius: 999px;
  padding: 16px 28px;
  min-height: 52px;
  font-family: var(--f-text);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--cream);
  background: var(--violet);
  box-shadow: 0 12px 26px -10px rgba(58, 31, 82, .6);
  cursor: pointer;
}

#confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
#confetti > * { position: absolute; left: 0; top: 0; will-change: transform, opacity; }

/* ---------- landscape / wide screens ---------- */
@media (orientation: landscape) {
  .split { flex-direction: row; gap: 5vw; padding: calc(var(--safe-t) + 20px) calc(var(--safe-r) + 6vw) calc(var(--safe-b) + 20px) calc(var(--safe-l) + 6vw); }
  .card-kind { --ch: 64dvh; --maxw: 52vw; }
  .card-skadi { --ch: 76dvh; --maxw: 40vw; }
  #count { font-size: clamp(4rem, 13vw, 10rem); }
  .card-sunset { --ch: 52dvh; left: 8vw; top: calc(var(--safe-t) + 10dvh); }
  .sunset-cap { width: 44vw; left: auto; right: 6vw; top: 22dvh; }
  .rc { --ch: 58dvh; }
  .gallery { top: calc(var(--safe-t) + 10dvh); gap: 10vw; }
  .card-berg { --ch: 66dvh; }
  .duo .card { --ch: 62dvh; --maxw: 34vw; }
  .card-a { left: 14vw; top: 18dvh; }
  .card-b { right: 14vw; bottom: 8dvh; }
  .card-meer { --ch: 76dvh; --maxw: 44vw; left: 12vw; top: 14dvh; }
  .card-gasse { --ch: 56dvh; --maxw: 34vw; right: 14vw; }
  .flowers .card { --ch: 50dvh; --maxw: 30vw; }
  .card-tulpen { left: 16vw; top: 32dvh; }
  .card-arm { right: 16vw; top: 36dvh; }
  .necklace { width: min(70vw, 720px); margin-left: calc(min(70vw, 720px) / -2); top: calc(var(--safe-t) + 10px); }
  .flowers-cap { top: calc(var(--safe-t) + 10px + min(70vw, 720px) * .22); }
  .card-mond { --ch: 62dvh; left: 10vw; top: 18dvh; }
  .wish { width: 50vw; right: 4vw; left: auto; bottom: 40dvh; }
}
/* very short landscape phones */
@media (orientation: landscape) and (max-height: 500px) {
  .race-title { display: none; }
  .lights { top: calc(var(--safe-t) + 4dvh); }
  .pod { width: 30px; height: 60px; }
  .flowers-cap { display: none; }
  .split { padding-top: calc(var(--safe-t) + 12px); }
  .big { font-size: clamp(1.8rem, 6vw, 3rem); }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .float, .arrow, .heart, .caret, .card img, .frame::after, .tch,
  .clouds svg, .sun-l svg circle, .sway, .necklace { animation: none; }
  .sky-rot i { animation: none; opacity: .5; transform: translateX(20vmax) scaleX(.8); }
  .walking .leg-a, .walking .leg-b, .walking .bob { animation: none; }
}

/* ---------- next-chapter arrow ---------- */
#next {
  position: fixed;
  z-index: 45;
  left: 50%;
  bottom: calc(var(--safe-b) + 18px);
  width: 58px;
  height: 58px;
  margin-left: -29px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 244, 232, .92);
  box-shadow: 0 8px 24px rgba(58, 31, 82, .35);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s;
}
#next.show { opacity: 1; pointer-events: auto; }
#next.show.hidden { opacity: 0; pointer-events: none; }
#next svg { width: 26px; height: 26px; fill: none; stroke: var(--pink-deep); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; animation: nudge 1.6s ease-in-out infinite; }
#next::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 119, 181, .75);
  animation: ring 2.2s ease-out infinite;
}
@keyframes ring { from { transform: scale(1); opacity: .8; } to { transform: scale(1.6); opacity: 0; } }

/* ---------- race cars ---------- */
.car {
  position: absolute;
  left: 0;
  top: var(--lane);
  height: 36%;
  z-index: 2;
  transform: translateX(var(--gx));
}
.car svg { height: 100%; width: auto; display: block; overflow: visible; }
.car .streak { opacity: 0; transition: opacity .3s; }
.racing .car .streak { opacity: 1; }
.racing .car {
  animation:
    launch .9s cubic-bezier(.55, 0, .9, .6) var(--ld) forwards,
    drive var(--dur) linear calc(var(--ld) + .9s) infinite;
}
@keyframes launch { from { transform: translateX(var(--gx)); } to { transform: translateX(110vw); } }
@keyframes drive { from { transform: translateX(-45vw); } to { transform: translateX(110vw); } }

@media (prefers-reduced-motion: reduce) {
  #next svg, #next::before, .racing .car { animation: none; }
}
