/* Ein kleines Abenteuer – fliessende Story-Folien */
@property --h {
  syntax: "<number>";
  inherits: true;
  initial-value: 280;
}

:root {
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in: cubic-bezier(.5, 0, .75, 0);
  --glass: rgba(255, 255, 255, .12);
  --glass-border: rgba(255, 255, 255, .22);
  --text: #fff;
  --muted: rgba(255, 255, 255, .72);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[x-cloak] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: #1a0f2e;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Hintergrund: Farbe wandert mit jeder Folie ---------- */
.stage { position: fixed; inset: 0; isolation: isolate; transition: --h 1.4s var(--ease-out); }
.bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(120% 80% at 20% 0%, hsl(calc(var(--h) + 30) 70% 38% / .9), transparent 60%),
    radial-gradient(120% 90% at 100% 100%, hsl(calc(var(--h) - 40) 75% 32% / .9), transparent 60%),
    linear-gradient(160deg, hsl(var(--h) 55% 16%), hsl(calc(var(--h) + 60) 50% 10%));
}
.sky { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.blob {
  position: absolute; border-radius: 50%; filter: blur(60px); opacity: .35; mix-blend-mode: screen;
  animation: drift 18s ease-in-out infinite alternate;
}
.b1 { width: 55vmax; height: 55vmax; left: -15vmax; top: -10vmax; background: #ff6b9a; }
.b2 { width: 45vmax; height: 45vmax; right: -12vmax; bottom: -12vmax; background: #6b8cff; animation-duration: 22s; }
.b3 { width: 30vmax; height: 30vmax; left: 40%; top: 45%; background: #ffd166; opacity: .18; animation-duration: 26s; }
@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(6vmax, 4vmax) scale(1.12); }
  100% { transform: translate(-4vmax, 7vmax) scale(.95); }
}
.stars {
  position: absolute; inset: 0; opacity: .5;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, #fff, transparent),
    radial-gradient(1px 1px at 72% 12%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 85% 46%, #fff, transparent),
    radial-gradient(1px 1px at 32% 72%, #fff, transparent),
    radial-gradient(1px 1px at 58% 88%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 8% 82%, #fff, transparent),
    radial-gradient(1px 1px at 46% 36%, #fff, transparent);
  animation: twinkle 5s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .25; } to { opacity: .65; } }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 10; display: none; }
#confetti.on { display: block; }

/* ---------- Folien ---------- */
.slide {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  will-change: transform, opacity, filter;
}
.card {
  width: min(100%, 440px);
  text-align: center;
  padding: 36px 26px 30px;
  border-radius: 32px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .15);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
}

/* Übergang zwischen Folien: neue gleitet von unten weich herein, alte schwebt nach oben weg */
.t-enter { transition: transform .9s var(--ease-out), opacity .7s ease, filter .9s var(--ease-out); transition-delay: .18s; }
.t-enter-from { opacity: 0; transform: translateY(70px) scale(.94) rotate(-1.5deg); filter: blur(10px); }
.t-enter-to { opacity: 1; transform: none; filter: blur(0); }
.t-leave { transition: transform .55s var(--ease-in), opacity .45s ease, filter .55s ease; }
.t-leave-from { opacity: 1; transform: none; filter: blur(0); }
.t-leave-to { opacity: 0; transform: translateY(-60px) scale(1.04) rotate(1deg); filter: blur(8px); }
/* rückwärts (zurück / neu starten): umgekehrte Richtung */
.back .t-enter-from { transform: translateY(-70px) scale(.94) rotate(1.5deg); }
.back .t-leave-to { transform: translateY(60px) scale(.96) rotate(-1deg); }

/* Inhalte einer Folie erscheinen nacheinander */
.card > * { animation: rise .8s var(--ease-out) both; }
.card > :nth-child(1) { animation-delay: .25s; }
.card > :nth-child(2) { animation-delay: .32s; }
.card > :nth-child(3) { animation-delay: .4s; }
.card > :nth-child(4) { animation-delay: .5s; }
.card > :nth-child(5) { animation-delay: .6s; }
.card > :nth-child(6) { animation-delay: .72s; }
.card > :nth-child(7) { animation-delay: .84s; }
.card > :nth-child(8) { animation-delay: .96s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Inhalt ---------- */
.emoji {
  font-size: 64px; line-height: 1; margin: 0 auto 14px;
  display: block; width: max-content;
  animation: rise .8s var(--ease-out) both, bob 3.2s ease-in-out 1s infinite;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .25));
}
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-8px) rotate(3deg); } }
.kicker { margin: 0 0 8px; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
h1 { margin: 0; font-size: clamp(26px, 7.2vw, 34px); line-height: 1.18; font-weight: 750; letter-spacing: -.01em; text-wrap: balance; }
.text { margin: 14px 0 0; font-size: 17px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.reaction {
  display: table; margin: 0 auto 16px; padding: 7px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .14); font-size: 15px;
}
.progress { display: flex; gap: 6px; justify-content: center; margin-bottom: 18px; }
.progress i { width: 26px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .2); transition: background .6s, width .6s var(--ease-out); }
.progress i.on { background: #fff; width: 34px; }

/* ---------- Buttons ---------- */
.choices { display: flex; gap: 12px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.choices.stacked { flex-direction: column; }
.choice {
  appearance: none; border: 1px solid var(--glass-border); cursor: pointer;
  font: inherit; font-size: 17px; font-weight: 650; color: #fff; text-decoration: none;
  padding: 15px 24px; min-height: 54px; min-width: 120px; border-radius: 18px;
  background: rgba(255, 255, 255, .1);
  transition: transform .35s var(--ease-out), background .3s, box-shadow .35s;
  display: inline-flex; align-items: center; justify-content: center;
}
.choices .choice { flex: 1 1 auto; white-space: nowrap; padding-left: 18px; padding-right: 18px; }
.choices.stacked .choice { flex: none; width: 100%; }
.choice:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .18); }
.choice:active { transform: scale(.96); }
.choice.primary { background: #fff; color: #2a1446; border-color: #fff; box-shadow: 0 10px 30px rgba(255, 255, 255, .25); }
.choice.primary:hover { box-shadow: 0 14px 40px rgba(255, 255, 255, .38); }
.choice.big { margin-top: 26px; width: 100%; font-size: 18px; }
.choice:disabled { opacity: .6; }
.ghost { margin-top: 16px; background: none; border: none; color: var(--muted); font: inherit; font-size: 15px; cursor: pointer; padding: 8px; }

/* ---------- Login ---------- */
.login { display: flex; flex-direction: column; gap: 12px; margin-top: 26px; }
.login input {
  font: inherit; font-size: 17px; color: #fff; text-align: center;
  padding: 15px 18px; border-radius: 18px; border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, .2); outline: none; transition: border-color .3s, background .3s;
}
.login input::placeholder { color: rgba(255, 255, 255, .5); }
.login input:focus { border-color: rgba(255, 255, 255, .6); background: rgba(0, 0, 0, .28); }
.login .choice { width: 100%; }
.error { color: #ffb4c6; margin: 14px 0 0; font-size: 15px; }

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