:root {
  --nacht: #1c1410;
  --nacht-2: #2a1e17;
  --papier: #f6eedf;
  --papier-2: #ede1cb;
  --tinte: #2b211b;
  --leise: #a08b79;
  --gold: #f2b544;
  --gold-dunkel: #b47f1d;
  --koralle: #ea5b3f;
  --rosa: #f3a6a0;
  --mint: #8fcfb4;

  --serif: "Fraunces", Georgia, serif;
  --hand: "Caveat", "Segoe Print", cursive;
  --rand: 16px;
  --oben: max(16px, env(safe-area-inset-top));
  --unten: max(20px, env(safe-area-inset-bottom));
  --leiste: 52px;
  --federnd: cubic-bezier(.34, 1.56, .64, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--nacht);
  color: var(--papier);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
img { display: block; max-width: 100%; height: auto; -webkit-user-drag: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
[hidden] { display: none !important; }

/* Körnung über allem – gibt dem Ganzen etwas Papierhaftes */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 60;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

#konfetti {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 50;
}

/* ───────── Bühne & Folien ───────── */
.buehne {
  position: fixed; inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 15%, rgba(234,91,63,.22), transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(242,181,68,.18), transparent 50%),
    var(--nacht);
}
.folie {
  position: absolute; inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--oben) + var(--leiste)) var(--rand) calc(var(--unten) + 88px);
  opacity: 0;
  visibility: hidden;
  transform: translateX(40px) scale(.98);
  transition: opacity .55s ease, transform .7s cubic-bezier(.2,.8,.2,1), visibility 0s .7s;
}
.folie.ist-vorbei { transform: translateX(-40px) scale(.98); }
.folie.ist-aktiv {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .55s ease .15s, transform .7s cubic-bezier(.2,.8,.2,1) .15s, visibility 0s;
}
/* Einblend-Animationen laufen erst, wenn die Folie dran ist (Klasse wird beim Betreten neu gesetzt) */
.folie:not(.ist-aktiv) * { animation: none !important; }

/* Wischen: senkrecht scrollt der Browser, waagerecht übernimmt app.js */
.buehne, .buehne * { touch-action: pan-y; }
.folie.wird-gezogen { transition: none !important; }

/* ───────── Kopfleiste ───────── */
.leiste {
  position: fixed;
  z-index: 30;
  top: var(--oben); left: 8px; right: var(--rand);
  height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.leiste__zurueck {
  width: 36px; height: 36px;
  flex: none;
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
  color: var(--papier);
  opacity: .7;
}
.leiste__fortschritt {
  flex: 1;
  display: flex;
  gap: 5px;
  margin: 0; padding: 0;
  list-style: none;
}
.leiste__fortschritt li {
  flex: 1;
  height: 3px;
  border-radius: 3px;
  background: rgba(246,238,223,.18);
  overflow: hidden;
}
.leiste__fortschritt li::after {
  content: "";
  display: block;
  height: 100%;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .6s ease;
}
.leiste__fortschritt li.ist-erledigt::after { transform: scaleX(1); }
/* Galerie: Segment folgt dem Scroll-Stand (--anteil 0…1 aus app.js) */
.leiste__fortschritt li.ist-laufend::after { transform: scaleX(var(--anteil, 0)); transition: transform .15s linear; }

/* ───────── Weiter-Knopf ───────── */
.weiter {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: calc(var(--unten) + 8px);
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 56px;
  padding: 12px 30px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--nacht);
  font-weight: 800;
  font-size: 20px;
  box-shadow: 0 6px 0 var(--gold-dunkel), 0 18px 30px -10px rgba(0,0,0,.6);
  translate: -50% 0;
  animation: aufploppen .55s var(--federnd) both, stupsen 2.6s ease-in-out 1.6s infinite;
}
.weiter:active { translate: -50% 4px; box-shadow: 0 2px 0 var(--gold-dunkel); }
/* Rolle „Alles zeigen": zurückhaltender, ohne Stupsen */
.weiter[data-rolle="zeigen"] {
  min-height: 40px;
  padding: 8px 18px;
  background: rgba(28,20,16,.4);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(246,238,223,.22);
  color: var(--leise);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .04em;
  box-shadow: none;
  animation: aufploppen .55s var(--federnd) both;
}
.weiter[data-rolle="zeigen"]:active { translate: -50% 2px; box-shadow: none; }
.weiter[data-rolle="zeigen"].ist-weg { animation: abtauchen .25s ease-in both; }
.weiter.ist-weg { animation: abtauchen .25s ease-in both; }
@keyframes aufploppen { from { opacity: 0; transform: translateY(120px) scale(.6); } }
@keyframes abtauchen { to { opacity: 0; transform: translateY(100px) scale(.8); } }
@keyframes stupsen {
  0%, 70%, 100% { transform: none; }
  78% { transform: scale(1.06) rotate(-2deg); }
  86% { transform: scale(1.02) rotate(1.5deg); }
}

/* ───────── 0 · Umschlag ───────── */
.folie--umschlag {
  gap: 28px;
  padding-top: var(--oben);
  background: radial-gradient(ellipse at 50% 40%, #3a2a20 0%, var(--nacht) 70%);
  perspective: 1000px;
}
/* Intro: erst dunkel, dann geht das Licht an, der Umschlag fliegt an, zuletzt die Schrift */
.folie--umschlag::before {
  content: "";
  position: absolute; inset: 0;
  z-index: 0;
  background: #0b0806;
  pointer-events: none;
  animation: licht-an 1.6s ease .2s both;
}
.folie--umschlag > * { position: relative; z-index: 1; }
@keyframes licht-an { to { opacity: 0; } }
/* „Post für" (Handschrift) überlappt groß gesetztes „Roland" */
.umschlag__titel {
  margin: 0 0 4px;
  text-align: center;
  line-height: .9;
}
.umschlag__an {
  position: relative;
  z-index: 2;
  display: block;
  width: fit-content;
  margin: 0 auto -16px;
  translate: -38% 0;
  rotate: -7deg;
  font-family: var(--hand);
  font-weight: 700;
  font-size: 36px;
  color: var(--gold);
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
  animation: weich-rein 1.1s ease-out 1.9s both;
}
.umschlag__name {
  display: block;
  font-weight: 900;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
  font-size: clamp(78px, 25vw, 150px);
  letter-spacing: -.03em;
  color: #fffaf0;
  animation: name-rein 1.3s cubic-bezier(.2, .7, .2, 1) 2.2s both;
}
@keyframes name-rein {
  from { opacity: 0; filter: blur(10px); letter-spacing: .25em; }
  60% { filter: blur(0); }
}
@keyframes weich-rein { from { opacity: 0; filter: blur(6px); transform: translateY(10px); } }
.umschlag__tipp {
  margin: 0;
  font-size: 14px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--leise);
  animation: weich-rein .9s ease-out 3.1s both, pulsieren 2.4s ease-in-out 4s infinite;
}
@keyframes pulsieren { 50% { opacity: .35; } }

.kuvert {
  --b: min(320px, 82vw);
  position: relative;
  width: var(--b);
  aspect-ratio: 1.45;
  perspective: 900px;
  animation: anflug 1.6s cubic-bezier(.16, .74, .3, 1) .5s both, wackeln 3.5s ease-in-out 4s infinite;
}
/* aus der Tiefe anfliegen, übers Ziel schießen, abbremsen, aufsetzen */
@keyframes anflug {
  0% { opacity: 0; transform: translate3d(-40px, -120px, -1800px) rotateX(58deg) rotateY(-24deg) rotateZ(-28deg); }
  12% { opacity: 1; }
  62% { transform: translate3d(0, 14px, 60px) rotateX(-9deg) rotateY(3deg) rotateZ(4deg); }
  80% { transform: translate3d(0, -5px, -8px) rotateX(4deg) rotateY(-1deg) rotateZ(-1.5deg); }
  92% { transform: translate3d(0, 2px, 0) rotateX(-1deg) rotateZ(.5deg); }
  100% { transform: none; }
}
@keyframes wackeln {
  0%, 80%, 100% { transform: rotate(0); }
  84% { transform: rotate(-3deg); }
  88% { transform: rotate(3deg); }
  92% { transform: rotate(-2deg); }
  96% { transform: rotate(1deg); }
}
.kuvert::before { /* Innenfutter */
  content: "";
  position: absolute; inset: 0;
  border-radius: 6px;
  background: repeating-linear-gradient(45deg, #c64630 0 8px, #d1503a 8px 16px);
  z-index: 0;
}
.kuvert__vorne,
.kuvert__klappe { position: absolute; inset: 0; }
.kuvert__vorne {
  z-index: 3;
  border-radius: 6px;
  background:
    linear-gradient(to top right, transparent 49.6%, rgba(0,0,0,.08) 50%, transparent 50.4%) left / 50% 100% no-repeat,
    linear-gradient(to top left, transparent 49.6%, rgba(0,0,0,.08) 50%, transparent 50.4%) right / 50% 100% no-repeat,
    var(--koralle);
  clip-path: polygon(0 0, 50% 52%, 100% 0, 100% 100%, 0 100%);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.6);
}
.kuvert__klappe {
  z-index: 4;
  height: 55%; /* reicht über den V-Ausschnitt der Vorderseite, sonst blitzt an der Kante die Karte durch */
  background: #f06a4d;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  filter: drop-shadow(0 2px 1px rgba(120,30,15,.35));
  transform-origin: top center;
  transition: transform .7s cubic-bezier(.6,0,.3,1), z-index 0s .35s;
  border-radius: 6px 6px 0 0;
}
.kuvert__siegel {
  position: absolute;
  z-index: 5;
  left: 50%; top: 48%;
  width: calc(var(--b) * .2); aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(201,138,28,.35), 0 6px 14px rgba(0,0,0,.35);
  transition: transform .4s ease, opacity .4s ease, box-shadow .2s ease;
  animation: siegeln .5s var(--federnd) 1.85s both; /* wie ein Stempel aufgedrückt */
}
/* zwei Hälften mit Zickzack-Riss – heil liegen sie deckungsgleich aufeinander */
.siegel__haelfte {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  border-radius: 50%;
  font-style: italic;
  font-weight: 800;
  font-size: calc(var(--b) * .1);
  color: #fff3d6;
  background: radial-gradient(circle at 35% 30%, #f7c966, var(--gold) 45%, #c98a1c);
}
.siegel__haelfte--l { clip-path: polygon(0 0, 53% 0, 46% 21%, 57% 39%, 44% 58%, 55% 77%, 48% 100%, 0 100%); }
.siegel__haelfte--r { clip-path: polygon(53% 0, 100% 0, 100% 100%, 48% 100%, 55% 77%, 44% 58%, 57% 39%, 46% 21%); }
.kuvert__siegel.wackelt { animation: siegel-wackeln .5s ease; }
@keyframes siegel-wackeln {
  20% { rotate: -12deg; } 40% { rotate: 10deg; } 60% { rotate: -7deg; } 80% { rotate: 4deg; }
}
.kuvert__siegel.bricht { box-shadow: none; animation: none; }
.kuvert__siegel.bricht .siegel__haelfte--l { animation: haelfte-l .9s cubic-bezier(.45, 0, .8, .5) both; }
.kuvert__siegel.bricht .siegel__haelfte--r { animation: haelfte-r .9s cubic-bezier(.45, 0, .8, .5) .04s both; }
@keyframes haelfte-l {
  0% { transform: none; }
  18% { transform: translate(-3px, 0) rotate(-4deg); }
  100% { transform: translate(-46px, 120px) rotate(-55deg); opacity: 0; }
}
@keyframes haelfte-r {
  0% { transform: none; }
  18% { transform: translate(3px, 0) rotate(4deg); }
  100% { transform: translate(52px, 130px) rotate(48deg); opacity: 0; }
}
.kuvert__karte {
  position: absolute;
  z-index: 1;
  left: 7%; right: 7%; top: 8%; bottom: 8%;
  border-radius: 4px;
  background: var(--papier);
  display: grid;
  place-items: start center;
  padding-top: 8%;
  transition: transform .8s cubic-bezier(.3,1.3,.5,1) .45s;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.kuvert__karte-text {
  font-family: var(--hand);
  font-size: calc(var(--b) * .11);
  color: var(--koralle);
}
.kuvert.ist-offen { animation: none; }
.kuvert.ist-offen .kuvert__klappe { transform: rotateX(180deg); z-index: 0; }
.kuvert.ist-offen .kuvert__siegel { transform: scale(.4); opacity: 0; animation: none; }
.kuvert.ist-offen .kuvert__karte { transform: translateY(-62%); z-index: 2; }

/* ───────── Rätsel vor dem Öffnen ───────── */
.folie--umschlag > .raetsel { position: absolute; z-index: 20; }
.raetsel {
  inset: 0;
  width: 100%;
  height: 100%;
  /* deckend: sonst scheinen „Roland" und der Umschlag versetzt durch */
  background:
    radial-gradient(ellipse at 50% 30%, #2c2019 0%, transparent 70%),
    #120d0a;
  animation: raetsel-rein .45s cubic-bezier(.2, .9, .3, 1) both;
}
/* kam das Overlay per View-Transition, übernimmt die das Einblenden – sonst startete es danach erneut */
.raetsel.per-vt { animation: none; }
.raetsel.ist-weg { animation: raetsel-raus .4s ease-in both; }
@keyframes raetsel-rein { from { opacity: 0; transform: translateY(40px); } }
@keyframes raetsel-raus { to { opacity: 0; transform: scale(.96); } }
.raetsel__rolle {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding: calc(var(--oben) + 8px) 18px calc(var(--unten) + 28px);
}
.raetsel__rolle > * { max-width: 440px; margin-left: auto; margin-right: auto; }
.raetsel__kicker {
  margin: 0;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--gold);
}
.raetsel__titel {
  margin: 2px auto 0;
  text-align: center;
  font-style: italic;
  font-weight: 700;
  font-size: 28px;
  color: var(--papier);
}
.raetsel__schritt { margin-top: 18px; scroll-margin-top: 12px; transition: opacity .5s ease, filter .5s ease; }
.raetsel__auftrag { margin: 0 0 12px; font-size: 15px; line-height: 1.4; color: var(--papier-2); }
.raetsel__auftrag b {
  display: inline-grid; place-items: center;
  width: 24px; height: 24px; margin-right: 6px;
  border-radius: 50%;
  background: var(--gold); color: var(--nacht);
  font-size: 14px;
}
.raetsel__hinweis {
  margin: 12px 0 0;
  text-align: center;
  font-family: var(--hand);
  font-size: 22px;
  color: var(--rosa);
  animation: weich-rein .5s ease both;
}

/* Siegel als Bild (Teaser groß, Kopf klein) – Gegenstück zum Siegel auf dem Umschlag */
.siegel-bild {
  display: grid; place-items: center;
  border-radius: 50%;
  font-style: italic;
  font-weight: 800;
  color: #fff3d6;
  background: radial-gradient(circle at 35% 30%, #f7c966, var(--gold) 45%, #c98a1c);
  box-shadow: 0 0 0 4px rgba(201,138,28,.35), 0 6px 14px rgba(0,0,0,.35);
}
.siegel-bild--klein { width: 40px; height: 40px; margin: 0 auto 8px; font-size: 20px; }
.siegel-bild--gross {
  width: min(48vw, 200px); aspect-ratio: 1;
  margin: 0 auto 28px;
  font-size: min(24vw, 100px);
  box-shadow: 0 0 0 8px rgba(201,138,28,.3), 0 20px 40px -10px rgba(0,0,0,.7);
  animation: siegel-puls 2.6s ease-in-out 1.2s infinite;
}
@keyframes siegel-puls { 50% { transform: scale(1.04); box-shadow: 0 0 0 14px rgba(201,138,28,.18), 0 20px 40px -10px rgba(0,0,0,.7); } }
.raetsel.zeigt-teaser .raetsel__kopf { display: none; }
.raetsel__teaser {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding-bottom: 40px;
}
.teaser__titel { margin: 0; font-style: italic; font-weight: 800; font-size: 40px; color: var(--papier); animation: rein .5s ease-out .55s both; }
.teaser__text { margin: 8px auto 26px; max-width: 300px; font-size: 17px; color: var(--papier-2); animation: rein .5s ease-out .75s both; }
.teaser__los {
  align-self: center;
  min-height: 52px;
  padding: 12px 26px;
  background: var(--gold);
  color: var(--nacht);
  box-shadow: 0 6px 0 var(--gold-dunkel);
  animation: aufploppen .5s var(--federnd) 1s both;
}
.teaser__los:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--gold-dunkel); }
/* View-Transition des Siegels */
.vt-siegel::view-transition-group(siegel) { animation-duration: .75s; animation-timing-function: cubic-bezier(.3, 1.15, .4, 1); }
.vt-siegel::view-transition-old(siegel),
.vt-siegel::view-transition-new(siegel) { height: 100%; }
/* Umschlag klemmt: Lasche hebt sich, fällt zurück, alles ruckelt */
.kuvert.gelandet { animation: wackeln 3.5s ease-in-out 1.5s infinite; }
.kuvert.gelandet .kuvert__siegel { animation: none; } /* Stempel-Animation nicht neu starten */
.kuvert.klemmt { animation: klemmt .6s ease; }
.kuvert.klemmt .kuvert__klappe { animation: klappe-klemmt .6s ease; }
.kuvert.klemmt .kuvert__siegel { animation: siegel-wackeln .5s ease .1s; }
.kuvert.klemmt-stark { animation: klemmt-stark .6s ease; }
.kuvert.klemmt-stark .kuvert__klappe { animation: klappe-klemmt-stark .6s ease; }
@keyframes klemmt-stark { 15% { transform: translateY(-6px) rotate(-3deg); } 35% { transform: rotate(3deg); } 55% { transform: rotate(-2deg); } 75% { transform: rotate(1deg); } }
@keyframes klappe-klemmt-stark { 25% { transform: rotateX(48deg); } 45% { transform: rotateX(0); } 62% { transform: rotateX(18deg); } 80% { transform: rotateX(0); } 90% { transform: rotateX(5deg); } }
.umschlag__tipp.ist-neu { animation: weich-rein .45s ease-out both; letter-spacing: .08em; text-transform: none; font-family: var(--hand); font-size: 22px; color: var(--rosa); }
@keyframes klemmt { 20% { transform: translateY(-4px) rotate(-1.5deg); } 45% { transform: rotate(1.5deg); } 70% { transform: rotate(-.8deg); } }
@keyframes klappe-klemmt { 30% { transform: rotateX(32deg); } 55% { transform: rotateX(0); } 72% { transform: rotateX(10deg); } 100% { transform: rotateX(0); } }

/* Schritt 1: Fotos zum Sortieren – Polaroids, die sich umdrehen lassen */
.rfotos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 14px; perspective: 1000px; }
.rfotos.ist-falsch { animation: punkte-nein .5s ease; }
.rfoto {
  position: relative;
  aspect-ratio: .86;
  transform-style: preserve-3d;
  transition: transform .7s cubic-bezier(.4, .2, .2, 1);
  rotate: var(--dreh, 0deg);
}
.rfoto:nth-child(1) { --dreh: -3deg; } .rfoto:nth-child(2) { --dreh: 2deg; }
.rfoto:nth-child(3) { --dreh: 2.5deg; } .rfoto:nth-child(4) { --dreh: -2deg; }
.rfoto.ist-umgedreht { transform: rotateY(180deg); }
/* nach dem Umdrehen flach: gleiche Optik ohne 3D, damit die View-Transition sie sauber erfasst */
.rfoto.ist-flach { transform: none; transition: none; }
.rfoto.ist-flach .rfoto__vorne,
.rfoto.ist-flach .rfoto__nr { display: none; }
.rfoto.ist-flach .rfoto__hinten { transform: none; }
.rfoto__vorne,
.rfoto__hinten {
  position: absolute; inset: 0;
  padding: 6px 6px 22px;
  background: #fffaf0;
  box-shadow: 0 12px 22px -12px rgba(0,0,0,.8);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.rfoto__vorne img { width: 100%; height: 100%; object-fit: cover; }
.rfoto__hinten {
  transform: rotateY(180deg);
  display: grid; place-items: center;
  font-size: 54px;
  background:
    repeating-linear-gradient(135deg, rgba(109,93,80,.06) 0 10px, transparent 10px 20px),
    #f3ead9;
}
.rfoto__nr {
  position: absolute;
  z-index: 2;
  top: -10px; left: -10px;
  width: 34px; height: 34px;
  display: none; place-items: center;
  border-radius: 50%;
  background: var(--gold);
  color: var(--nacht);
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 4px 10px rgba(0,0,0,.5);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(4px); /* sicher vor dem Foto, sonst sortiert 3D es mal dahinter */
}
.rfoto.ist-gewaehlt .rfoto__nr { display: grid; animation: nummer-plopp .35s var(--federnd) both; }
@keyframes nummer-plopp { from { opacity: 0; transform: translateZ(4px) scale(2); } }
.rfoto.ist-gewaehlt .rfoto__vorne { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Seite 2 oben: die Symbole in der richtigen Reihenfolge */
.symbolreihe {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 16px;
}
.symbolkarte {
  display: grid; place-items: center;
  aspect-ratio: .86;
  padding-bottom: 10px;
  font-size: 34px;
  background:
    repeating-linear-gradient(135deg, rgba(109,93,80,.06) 0 10px, transparent 10px 20px),
    #f3ead9;
  border: 4px solid #fffaf0;
  border-bottom-width: 14px;
  box-shadow: 0 10px 18px -10px rgba(0,0,0,.8);
}
.symbolkarte:nth-child(odd) { rotate: -2deg; }
.symbolkarte:nth-child(even) { rotate: 2deg; }
/* Flug der Karten: leicht versetzt, federnd */
.vt-symbole::view-transition-group(symbol-0),
.vt-symbole::view-transition-group(symbol-1),
.vt-symbole::view-transition-group(symbol-2),
.vt-symbole::view-transition-group(symbol-3) { animation-duration: .8s; animation-timing-function: cubic-bezier(.3, 1.2, .45, 1); }
.vt-symbole::view-transition-group(symbol-1) { animation-delay: .07s; }
.vt-symbole::view-transition-group(symbol-2) { animation-delay: .14s; }
.vt-symbole::view-transition-group(symbol-3) { animation-delay: .2s; }
.vt-symbole::view-transition-old(symbol-0), .vt-symbole::view-transition-new(symbol-0),
.vt-symbole::view-transition-old(symbol-1), .vt-symbole::view-transition-new(symbol-1),
.vt-symbole::view-transition-old(symbol-2), .vt-symbole::view-transition-new(symbol-2),
.vt-symbole::view-transition-old(symbol-3), .vt-symbole::view-transition-new(symbol-3) { height: 100%; }

/* Schritt 2: Decoder-Zettel */
.decoder {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px 6px;
  padding: 26px 14px 14px;
  border-radius: 4px;
  background:
    repeating-linear-gradient(to bottom, transparent 0 27px, rgba(109,93,80,.12) 27px 28px),
    #f6eedf;
  color: var(--tinte);
  rotate: -1.2deg;
  box-shadow: 0 16px 30px -16px rgba(0,0,0,.9);
}
.decoder::before {
  content: "Decoder";
  position: absolute;
  top: 6px; left: 50%;
  translate: -50% 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--tinte-leise, #6d5d50);
}
.decoder span { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 24px; }
.decoder b { font-family: var(--hand); font-size: 26px; font-weight: 700; }
.decoder b::before { content: "="; margin-right: 3px; font-size: 18px; color: #6d5d50; }

/* wie „Rätsel starten“; doppelte Klasse, weil .knopf weiter unten display überschreibt */
.knopf.raetsel__weiter {
  display: flex; width: fit-content; margin: 26px auto 0;
  min-height: 52px; padding: 12px 26px;
  background: var(--gold); color: var(--nacht);
  box-shadow: 0 6px 0 var(--gold-dunkel);
}
.knopf.raetsel__weiter:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--gold-dunkel); }
.raetsel__vergessen {
  display: block;
  margin: 18px auto 0;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--papier-2);
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: .75;
}

/* Schritt 3: Drehschloss */
.schloss {
  display: flex;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 12px;
  border-radius: 18px;
  background: linear-gradient(#3b2d24, #241a15);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 18px 34px -18px rgba(0,0,0,.9);
}
/* Schloss füllt seinen Container: Räder teilen sich die Breite, große Tippflächen fürs Handy */
.rad { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.rad__knopf {
  width: 100%; height: 52px;
  border-radius: 12px;
  color: var(--gold);
  font-size: 24px;
  background: rgba(246,238,223,.06);
  touch-action: manipulation;
}
.rad__knopf:active { background: rgba(242,181,68,.25); }
.rad__fenster {
  width: 100%; height: 92px;
  display: grid; place-items: center;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(#d9ccb5, #f6eedf 30%, #f6eedf 70%, #d9ccb5);
  box-shadow: inset 0 3px 8px rgba(0,0,0,.35);
  touch-action: none;
  cursor: ns-resize;
}
.rad__ziffer { font-weight: 800; font-size: 54px; color: var(--tinte); }
.rad__ziffer.rollt-hoch { animation: rollt-hoch .22s ease-out; }
.rad__ziffer.rollt-runter { animation: rollt-runter .22s ease-out; }
@keyframes rollt-hoch { from { transform: translateY(70%); opacity: 0; } }
@keyframes rollt-runter { from { transform: translateY(-70%); opacity: 0; } }
.schloss.ist-offen .rad__fenster { background: linear-gradient(#a9dcc6, #d9f2e7 30%, #d9f2e7 70%, #a9dcc6); transition: background .3s; }
.schloss.ist-offen { animation: siegeln .5s var(--federnd); }
@keyframes punkte-nein { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }

/* ───────── 1 · Aufmacher ───────── */
.folie--aufmacher { text-align: center; }
.aufmacher-karte {
  position: relative;
  /* gleiche Maße wie die Grußkarte auf der Rückseite → beim Umdrehen wirkt es wie eine Karte */
  width: min(100%, 480px);
  min-height: min(600px, 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 54px 20px 44px;
  border-radius: 6px;
  color: var(--tinte);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255,255,255,.75), transparent 60%),
    linear-gradient(#fbf6ec, #f3e9d6);
  box-shadow: 0 2px 0 #e2d3b6, 0 4px 0 #d8c7a6, 0 34px 60px -24px rgba(0,0,0,.85);
  animation: rein .8s .1s both;
}
.aufmacher-karte::before,
.aufmacher-karte::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border: 1px solid #b8913f;
  border-radius: 3px;
}
.aufmacher-karte::before { inset: 10px; opacity: .9; }
.aufmacher-karte::after { inset: 14px; opacity: .45; }
.aufmacher__titel {
  margin: 0;
  font-weight: 900;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
  font-size: clamp(60px, 19vw, 120px);
  line-height: .88;
  letter-spacing: -.03em;
}
.aufmacher__titel span { display: block; }
.aufmacher__titel span:nth-child(1) { animation: rein .8s .3s both; }
.aufmacher__titel span:nth-child(2) { animation: rein .8s .55s both; font-style: italic; font-weight: 300; color: var(--koralle); }
.aufmacher__name { color: #c4841a; animation: rein .8s .8s both; }
@keyframes rein { from { opacity: 0; transform: translateY(40px) rotate(-3deg); } }
.aufmacher__hand {
  margin: 22px 0 0;
  font-family: var(--hand);
  font-size: 30px;
  line-height: 1.1;
  color: var(--tinte);
  rotate: -2deg;
  animation: rein .8s 1.1s both;
}
.aufmacher__deko {
  display: flex; justify-content: center; gap: 18px;
  margin-top: 20px;
  color: var(--koralle);
  font-size: 20px;
  animation: rein .8s 1.3s both;
}
.aufmacher__deko span:nth-child(2) { color: #c4841a; animation: drehen 12s linear infinite; }
@keyframes drehen { to { transform: rotate(360deg); } }

/* Kommt die Folie per View-Transition aus dem Umschlag, übernimmt der Übergang
   das Einfliegen von Karte und Titel. */
.folie--aufmacher.per-vt .aufmacher-karte,
.folie--aufmacher.per-vt .aufmacher__titel span { animation: none; }
.vt-laeuft .folie { transition: none !important; }
.folie--brief.per-vt .grusskarte { animation: none; }

/* Karte umdrehen: Vorderseite dreht bis zur Kante weg, Rückseite dreht von der Kante her ein */
.vt-drehen::view-transition-group(karte),
.vt-drehen-zurueck::view-transition-group(karte) { animation-duration: 1s; animation-timing-function: cubic-bezier(.45, 0, .2, 1); }
.vt-drehen::view-transition-old(karte),
.vt-drehen::view-transition-new(karte),
.vt-drehen-zurueck::view-transition-old(karte),
.vt-drehen-zurueck::view-transition-new(karte) { height: 100%; backface-visibility: hidden; mix-blend-mode: normal; }
.vt-drehen::view-transition-old(karte) { animation: dreh-weg .5s cubic-bezier(.5, 0, .9, .5) both; }
.vt-drehen::view-transition-new(karte) { animation: dreh-her .5s cubic-bezier(.1, .5, .5, 1) .5s both; }
.vt-drehen-zurueck::view-transition-old(karte) { animation: dreh-weg-zurueck .5s cubic-bezier(.5, 0, .9, .5) both; }
.vt-drehen-zurueck::view-transition-new(karte) { animation: dreh-her-zurueck .5s cubic-bezier(.1, .5, .5, 1) .5s both; }
@keyframes dreh-weg { to { transform: perspective(1400px) rotateY(90deg); } }
@keyframes dreh-her { from { transform: perspective(1400px) rotateY(-90deg); } }
@keyframes dreh-weg-zurueck { to { transform: perspective(1400px) rotateY(-90deg); } }
@keyframes dreh-her-zurueck { from { transform: perspective(1400px) rotateY(90deg); } }

::view-transition-group(*) {
  animation-duration: .85s;
  animation-timing-function: cubic-bezier(.2, .85, .25, 1);
}
::view-transition-old(karte),
::view-transition-new(karte) { height: 100%; }
::view-transition-old(gruss) { animation: vt-raus .4s ease both; }
::view-transition-new(gruss) { animation: vt-rein .6s ease .2s both; }
::view-transition-old(kuvert) { animation: vt-raus .45s ease both; }
::view-transition-old(root) { animation: vt-raus .5s ease both; }
::view-transition-new(root) { animation: vt-rein .6s ease .25s both; }
@keyframes vt-raus { to { opacity: 0; } }
@keyframes vt-rein { from { opacity: 0; } }

/* ───────── 2 · Brief: Grußkarte ───────── */
.grusskarte {
  --rahmen: #b8913f;
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: min(600px, 100%);
  max-height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
  padding: 30px 30px 28px;
  color: var(--tinte);
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255,255,255,.7), transparent 60%),
    radial-gradient(ellipse at 50% 120%, rgba(184,145,63,.16), transparent 60%),
    linear-gradient(#fbf6ec, #f3e9d6);
  border-radius: 6px;
  box-shadow:
    0 1px 0 rgba(255,255,255,.6) inset,
    0 2px 0 #e2d3b6,
    0 4px 0 #d8c7a6,
    0 34px 60px -24px rgba(0,0,0,.85);
  animation: aufklappen 1s cubic-bezier(.2,.9,.25,1) .15s both;
  transform-origin: 50% 100%;
  cursor: pointer;
}
.grusskarte::-webkit-scrollbar { display: none; }
/* doppelter Goldrahmen */
.grusskarte::before,
.grusskarte::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border: 1px solid var(--rahmen);
  border-radius: 3px;
}
.grusskarte::before { inset: 10px; opacity: .9; }
.grusskarte::after { inset: 14px; opacity: .45; }
@keyframes aufklappen {
  from { opacity: 0; transform: perspective(900px) rotateX(-70deg) translateY(40px); }
}

.grusskarte__kopf {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 6px 10px;
}
.grusskarte__kopf > span:not(.grusskarte__siegel) {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--rahmen));
}
.grusskarte__kopf > span:last-child { background: linear-gradient(270deg, transparent, var(--rahmen)); }
.grusskarte__siegel {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-style: italic;
  font-weight: 800;
  font-size: 24px;
  color: #fff6de;
  background: radial-gradient(circle at 35% 30%, #f7c966, var(--gold) 45%, #c98a1c);
  box-shadow: 0 0 0 3px rgba(201,138,28,.25), 0 4px 10px rgba(0,0,0,.2);
  animation: siegeln .6s var(--federnd) .9s both;
}
@keyframes siegeln { from { opacity: 0; transform: scale(2.2) rotate(-25deg); } }
.grusskarte__ueber {
  margin: 0 0 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--rahmen);
}
.grusskarte p { margin: 0 0 14px; }
/* Handschrift: Tegaki zeichnet in currentColor, Größe über font-size */
.grusskarte tegaki-renderer {
  display: block;
  width: 100%;
  margin: 0 0 12px;
  text-align: left;
  color: #26335a; /* Tinte */
  font-family: var(--hand);
  font-size: 25px;
  line-height: 1.3;
}
.grusskarte.neu-messen tegaki-renderer { letter-spacing: .001px; }
.grusskarte__anrede { font-size: 34px !important; color: #8a5a1c !important; }
.grusskarte__absatz:last-child { margin-bottom: 0; }
/* betonte Schlusssätze: eigene Zeile direkt unter ihrem Absatz, mit kräftigeren Strichen */
.grusskarte .grusskarte__betont { margin-top: -10px; }
/* bis Tegaki geladen ist, nichts aufblitzen lassen; klappt das Laden nicht, steht der Text normal da */
tegaki-renderer:not(:defined) { visibility: hidden; }
.ohne-tegaki tegaki-renderer { visibility: visible; }

/* ───────── Überschriften ───────── */
.ueberschrift {
  margin: 0 0 22px;
  text-align: center;
  font-weight: 800;
  font-variation-settings: "opsz" 144, "SOFT" 100;
  font-size: clamp(38px, 11vw, 60px);
  line-height: 1;
  letter-spacing: -.02em;
}
.ueberschrift__klein {
  display: block;
  margin-bottom: 8px;
  font-family: var(--hand);
  font-weight: 500;
  font-size: 25px;
  letter-spacing: 0;
  color: var(--rosa);
}
.hand { font-family: var(--hand); font-weight: 700; color: var(--gold); font-size: 1.25em; }

/* ───────── 3 · Geschenk ───────── */
.geschenk {
  width: 100%;
  max-height: 100%;
  overflow: hidden; /* sonst blitzen beim Reinfliegen/Umdrehen Scrollbalken auf */
  text-align: center;
}
/* Erst wird die Überschrift geschrieben, dann (Klasse .zeigt) kommt der Rest zügig gestaffelt */
.geschenk > :not(.geschenk__titel),
.geschenk__text span { opacity: 0; }
.geschenk__text span { display: block; }
.geschenk.zeigt > :not(.geschenk__titel),
.geschenk.zeigt .geschenk__text span { opacity: 1; }
.geschenk.zeigt .geschenk__text span { animation: rein .45s ease-out both; }
.geschenk.zeigt .geschenk__text span:nth-child(2) { animation-delay: .14s; }
.geschenk.zeigt > .wende { animation: kartenflug .75s var(--federnd) .3s both; }
.geschenk.zeigt .karte-link { animation: stickerplopp .55s var(--federnd) .85s both; }
.geschenk.zeigt .wende__tipp { animation: rein .4s ease-out 1s both; }
.geschenk.zeigt > .laden { animation: rein .45s ease-out 1.1s both; }
@keyframes kartenflug { from { opacity: 0; transform: translateY(60px) rotate(-8deg) scale(.8); } }
.geschenk__titel {
  max-width: 420px;
  margin: 0 auto 10px;
  font-family: var(--hand);
  font-weight: 700;
  color: var(--rosa);
}
.geschenk__titel tegaki-renderer {
  display: block;
  white-space: pre-line; /* fester Umbruch: „Weil Reden nicht / satt macht“ */
  font-size: clamp(38px, 11.5vw, 60px);
  line-height: 1.05;
}
.geschenk__text { max-width: 420px; margin: 0 auto 26px; color: var(--papier-2); font-size: 18px; text-wrap: balance; }
.geschenk__text strong { color: var(--gold); font-weight: 700; }

.wende { max-width: 520px; margin: 0 auto; perspective: 1400px; }
.wende__buehne { position: relative; }
.wende__karte {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1200 / 543;
  transform-style: preserve-3d;
  transition: transform .9s cubic-bezier(.4,.2,.2,1);
}
.wende__karte.ist-gedreht { transform: rotateY(180deg); }
.wende__seite {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 12px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 30px 50px -20px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.06);
}
.wende__hinten { transform: rotateY(180deg); }
.wende__tipp { margin: 30px 0 0; font-family: var(--hand); font-size: 22px; color: var(--leise); }

.laden {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
  margin: 22px auto 14px;
}
.knopf {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 46px;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
}
.knopf span { font-size: 19px; line-height: 1; }
.knopf__symbol { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.knopf--hell { border: 1.5px solid rgba(242,181,68,.6); color: var(--gold); }
.knopf--hell:active { background: rgba(242,181,68,.12); }
.knopf--rand {
  border: 1px dashed rgba(246,238,223,.4);
  font-family: var(--hand);
  font-size: 24px;
  font-weight: 700;
}
.knopf--leise { color: var(--leise); font-size: 16px; min-height: 40px; }
/* Maps-Plakette klebt wie ein Sticker unten rechts am Gutschein */
.karte-link {
  opacity: 0;
  position: absolute;
  z-index: 2;
  right: 10px;
  bottom: -16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px 5px 7px;
  border-radius: 12px;
  background: #fffaf0;
  color: var(--tinte);
  text-decoration: none;
  text-align: left;
  box-shadow: 0 10px 22px -12px rgba(0,0,0,.8);
  rotate: -4deg;
  transition: transform .15s ease;
}
.geschenk.zeigt .karte-link { opacity: 1; }
.karte-link:active { transform: scale(.96); }
.karte-link__pin {
  width: 19px; height: 25px;
  flex: none;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.25));
  animation: pin-wippen 2.4s ease-in-out 2s infinite;
}
@keyframes pin-wippen {
  0%, 70%, 100% { transform: none; }
  80% { transform: translateY(-5px); }
  90% { transform: translateY(0) scaleY(.92); }
}
.karte-link__text { display: grid; line-height: 1.15; }
.karte-link__text strong { font-size: 14px; font-weight: 800; }
.karte-link__text small { font-size: 11px; color: #6d5d50; }
.karte-link__pfeil { margin-left: 2px; font-size: 15px; color: var(--koralle); font-weight: 700; }

/* Niedrige Handys: alles muss ohne Scrollen passen (.geschenk hat overflow: hidden) */
@media (max-height: 720px) {
  .geschenk__titel tegaki-renderer { font-size: clamp(32px, 9.5vw, 46px); }
  .geschenk__text { font-size: 16px; margin-bottom: 16px; }
  .wende__tipp { margin-top: 24px; font-size: 19px; }
  .laden { margin: 10px auto 0; }
}

/* ───────── 4 · Fotos ───────── */
.folie--fotos { padding: 0; }
/* Verläufe oben und unten, damit Leiste und Weiter-Knopf über den Fotos lesbar bleiben */
.folie--fotos::before,
.folie--fotos::after {
  content: "";
  position: absolute; left: 0; right: 0;
  z-index: 1;
  pointer-events: none;
}
.folie--fotos::before {
  top: 0;
  height: calc(var(--oben) + 64px);
  background: linear-gradient(var(--nacht) 45%, transparent);
}
.folie--fotos::after {
  bottom: 0;
  height: calc(var(--unten) + 70px);
  background: linear-gradient(transparent, rgba(28,20,16,.85));
}
.fotos__rolle {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0 var(--rand) calc(var(--unten) + 110px);
  scrollbar-width: none;
}
.fotos__rolle::-webkit-scrollbar { display: none; }
/* Überschrift bleibt oben stehen, die Fotos laufen darunter durch */
.fotos__titel {
  position: sticky;
  top: 0;
  z-index: 50; /* über allen Fotos, auch den vergrößerten im Fokus */
  margin: 0 0 14px;
  padding-top: calc(var(--oben) + var(--leiste)) !important;
  pointer-events: none;
  text-shadow: 0 2px 4px rgba(0,0,0,.55), 0 6px 24px rgba(0,0,0,.6);
}

/* Dezenter Hinweis beim Start des Auto-Scrollens */
.scrollhinweis {
  position: absolute;
  z-index: 60; /* über den Fotos */
  left: 50%;
  bottom: calc(var(--unten) + 22px);
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 12px;
  border-radius: 999px;
  background: rgba(20,14,11,.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--papier-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  animation: hinweis-rein .6s ease both;
}
.scrollhinweis.ist-weg { animation: hinweis-raus .5s ease both; }
.scrollhinweis__strich {
  position: relative;
  width: 2px; height: 16px;
  border-radius: 2px;
  background: rgba(246,238,223,.25);
  overflow: hidden;
}
.scrollhinweis__strich::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 6px;
  border-radius: 2px;
  background: var(--gold);
  animation: strich-lauf 1.6s ease-in-out infinite;
}
@keyframes strich-lauf { 0% { top: 100%; } 100% { top: -6px; } }
@keyframes hinweis-rein { from { opacity: 0; transform: translateY(6px); } }
@keyframes hinweis-raus { to { opacity: 0; transform: translateY(6px); } }

.fotos__wand {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-flow: row dense;
  align-items: start;
  gap: 22px 16px;
}
@media (min-width: 700px) { .fotos__wand { grid-template-columns: repeat(3, 1fr); gap: 36px 28px; } }
.polaroid {
  display: block;
  width: 100%;
  padding: 8px 8px 0;
  background: #fffaf0;
  color: var(--tinte);
  /* --naehe (0…1, aus app.js): nahe der Bildschirmmitte gerade, größer, mit tieferem Schatten */
  --naehe: 0;
  position: relative;
  z-index: calc(var(--naehe) * 10);
  transform: rotate(calc(var(--dreh, 0deg) * (1 - var(--naehe)) + var(--naehe) * var(--kipp, 1deg))) scale(calc(1 + var(--naehe) * .16));
  box-shadow: 0 calc(14px + var(--naehe) * 26px) calc(28px + var(--naehe) * 34px) -12px rgba(0,0,0,calc(.7 + var(--naehe) * .2));
  opacity: 0;
  translate: 0 30px;
  transition: transform .25s ease-out, box-shadow .25s ease-out, opacity .7s ease, translate .7s ease;
}
.polaroid:nth-child(even) { --kipp: -1deg; }
.polaroid.ist-sichtbar { opacity: 1; translate: 0 0; }
.polaroid:active { scale: .98; }
.polaroid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--papier-2);
}
.polaroid span {
  display: block;
  min-height: 34px;
  padding: 4px 2px 6px;
  font-family: var(--hand);
  font-size: 19px;
  line-height: 1.1;
  text-align: center;
}
.polaroid--quer { grid-column: span 2; }
.polaroid--quer img { aspect-ratio: 3 / 2; }
.polaroid--zukunft { background: #fff6e8; translate: none; }
/* leerer Rahmen: was noch kommt, hat noch kein Bild */
.polaroid__leer {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 2px dashed rgba(109,93,80,.35);
  background:
    repeating-linear-gradient(135deg, rgba(109,93,80,.06) 0 10px, transparent 10px 20px),
    #f3ead9;
  font-family: var(--hand);
  font-weight: 700;
  font-size: clamp(56px, 18vw, 90px);
  line-height: 1;
  color: rgba(109,93,80,.45);
}
.polaroid--zukunft.wackelt .polaroid__leer { animation: fragezeichen .6s ease; }
@keyframes fragezeichen { 25% { transform: rotate(-12deg) scale(1.1); } 60% { transform: rotate(8deg); } }

/* ───────── 5 · Schluss ───────── */
.folie--schluss {
  justify-content: flex-start;
  padding-top: calc(var(--oben) + var(--leiste) + 3svh);
  text-align: center;
}
/* Feuerwerk liegt direkt über dem Hintergrund, alles andere darüber */
.feuerwerk {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}
.folie--schluss > :not(.feuerwerk) { position: relative; z-index: 1; }
.folie--schluss > .sticker,
.folie--schluss > .sr-only { position: absolute; }
.folie--schluss { cursor: pointer; }
.schluss__klein {
  margin: 0;
  font-family: var(--hand);
  font-size: 30px;
  color: var(--rosa);
  animation: rein .7s .2s both;
}
.schluss__titel {
  margin: 0;
  font-weight: 900;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
  font-size: clamp(56px, 18vw, 130px);
  line-height: .95;
  color: var(--gold);
  animation: rein .8s .4s both;
}
.schluss__nachweis {
  margin: 2px 0 0;
  font-size: 10px;
  color: rgba(160,139,121,.7);
}
.schluss__nachweis a { color: inherit; }
.schluss__knoepfe {
  position: relative;
  z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  margin-top: 18px;
  animation: rein .7s 2.6s both;
}

.sticker {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: min(52svh, 480px);
  pointer-events: none;
}
.sticker__person {
  position: absolute;
  bottom: -28px;
  margin: 0;
  transform-origin: 50% 100%;
}
.sticker__person img { height: 100%; width: auto; max-width: none; }
.sticker__person--andrea {
  z-index: 3; /* über Hiro, damit ihr Namensschild frei bleibt */
  left: max(-66px, calc(50% - 280px)); /* schaut vom linken Rand herein */
  bottom: -26px;
  height: 74%;
  rotate: -5deg;
  animation: stickerplopp .8s var(--federnd) 1.1s both, wippen 4s ease-in-out 2.2s infinite;
}
.sticker__person--danny {
  right: max(-44px, calc(50% - 280px));
  height: 62%;
  rotate: 6deg;
  animation: stickerplopp .8s var(--federnd) 1.6s both, wippen 4.6s ease-in-out 2.7s infinite reverse;
}
.sticker__person--kaenguru,
.sticker__schatten--kaenguru {
  /* hinter Andrea, schaut über ihren Kopf */
  left: max(-14px, calc(50% - 215px));
  bottom: 50%;
  height: 36%;
  rotate: -8deg;
}
.sticker__person--kaenguru { animation: auftauchen-plopp .7s var(--federnd) 6s both, wippen 3.2s ease-in-out 7s infinite; }

.sticker__person--claude,
.sticker__schatten--claude {
  /* hinter Danny, über ihm */
  z-index: 4; /* sitzt vorn auf Dannys Schulter */
  right: max(-14px, calc(50% - 213px));
  bottom: 17%;
  height: 28%;
  rotate: 6deg;
}
.sticker__person--claude { animation: auftauchen-plopp .75s var(--federnd) 8.6s both, schweben 3.4s ease-in-out 9.4s infinite; }
@keyframes schweben { 50% { transform: translateY(-6px) rotate(-2deg); } }

/* Vorboten: heller Umriss, der näher kommt (größer, schärfer, deutlicher) und beim Aufploppen verschwindet */
.sticker__schatten img { filter: brightness(0) invert(.92) sepia(.25); }
.sticker__schatten--kaenguru { animation: naeherkommen 2.4s cubic-bezier(.4, 0, .6, 1) 3.6s both, schatten-weg .25s ease 6s forwards; }
.sticker__schatten--claude { animation: naeherkommen-weit 4s cubic-bezier(.4, 0, .6, 1) 4.6s both, schatten-weg .25s ease 8.6s forwards; }
@keyframes naeherkommen {
  0% { opacity: 0; transform: scale(.72); filter: blur(10px); }
  100% { opacity: .28; transform: scale(.97); filter: blur(1.5px); }
}
@keyframes naeherkommen-weit {
  0% { opacity: 0; transform: scale(.5) translateY(-12%); filter: blur(14px); }
  100% { opacity: .26; transform: scale(.96); filter: blur(1.5px); }
}
@keyframes schatten-weg { to { opacity: 0; } }
@keyframes auftauchen-plopp {
  0% { opacity: 0; transform: scale(.9); }
  45% { opacity: 1; transform: scale(1.12); }
  70% { transform: scale(.96); }
  100% { transform: none; }
}

.sticker__person--hiro {
  left: 50%;
  bottom: -6px;
  height: 36%;
  translate: -70% 0;
  rotate: -3deg;
  animation: stickerplopp .8s var(--federnd) 2.2s both, wippen 3.8s ease-in-out 3.2s infinite;
}

/* Namensschilder wie aufgeklebtes Klebeband, ploppen kurz nach ihrem Sticker ein */
.namensschild {
  position: absolute;
  white-space: nowrap;
  padding: 4px 12px 5px;
  border-radius: 3px;
  font-family: var(--hand);
  font-weight: 700;
  font-size: 23px;
  line-height: 1;
  color: var(--tinte);
  background: var(--gold);
  box-shadow: 0 6px 12px -6px rgba(0,0,0,.6);
  animation: schild .55s var(--federnd) both;
}
.sticker__person--andrea .namensschild { left: calc(6px + max(0px, min(66px, 280px - 50vw))); /* am Bildschirmrand, nur wenn Andrea über ihn hinausragt */ top: auto; bottom: 40px; rotate: -8deg; background: var(--rosa); animation-delay: 1.6s; }
.sticker__person--danny .namensschild { left: 24%; top: 70%; rotate: 5deg; background: var(--mint); animation-delay: 2.1s; }
.sticker__person--claude .namensschild { right: 46%; top: -14%; font-size: 16px; padding: 3px 8px 4px; rotate: -5deg; background: #f0b8a0; animation-delay: 9.15s; }
.sticker__person--hiro .namensschild { left: 44%; top: -24%; rotate: -4deg; background: var(--gold); animation-delay: 2.7s; }
.sticker__person--kaenguru .namensschild { left: 62%; top: 4%; font-size: 16px; padding: 3px 8px 4px; rotate: 7deg; animation-delay: 6.5s; }
@keyframes schild {
  from { opacity: 0; transform: scale(.2) rotate(-25deg); }
}
@keyframes photobomb {
  0% { transform: translateY(115%); }
  55% { transform: translateY(-6%) rotate(-6deg); }
  75% { transform: translateY(2%) rotate(4deg); }
  100% { transform: none; }
}
@keyframes stickerplopp {
  0% { transform: translateY(110%) scale(.5); }
  100% { transform: none; }
}
@keyframes wippen { 50% { transform: rotate(2.5deg); } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ───────── Foto-Lupe ───────── */
.lupe {
  width: 100vw; height: 100svh;
  max-width: none; max-height: none;
  margin: 0; padding: 0;
  border: 0;
  background: rgba(14,10,8,.95);
  color: var(--papier);
}
.lupe[open] { display: grid; place-items: center; }
.lupe::backdrop { background: transparent; }
.lupe figure { margin: 0; padding: 56px 16px; display: grid; gap: 12px; justify-items: center; }
.lupe img { max-height: 76svh; width: auto; border: 6px solid #fffaf0; }
.lupe figcaption { font-family: var(--hand); font-size: 26px; text-align: center; }
.lupe__zu {
  position: absolute; top: max(10px, env(safe-area-inset-top)); right: 12px;
  width: 48px; height: 48px;
  font-size: 36px; line-height: 1;
}
.lupe__pfeil {
  position: absolute; top: 50%;
  translate: 0 -50%;
  width: 48px; height: 72px;
  font-size: 48px; line-height: 1;
  opacity: .8;
}
.lupe__pfeil--l { left: 4px; }
.lupe__pfeil--r { right: 4px; }

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