/* ZEIT-Kapsel-Suche – Gästeseiten.
   Mobile first: Die Grundregeln gelten fürs Handy, ganz unten steht die einzige Erweiterung für breitere Schirme.
   Stil: Schnee und Eis. Weiße Glasflächen über einer hellen Winterlandschaft, Nachtblau für Schrift und
   Buttons, ein klares Pistenblau als Akzent. Bewusst flach: feine Linien statt Wölbungen und Glanz.
   Leitmotiv ist die Kapselform: Buttons, Stationen und die Kapselreihe, die sich mit jedem Fund füllt. */
@font-face {
  font-family: "Caveat";
  src: url("/assets/fonts/caveat-latin-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
:root {
  /* Palette */
  --schnee: #ffffff;
  --firn: #f3f7fb;            /* Seitengrund */
  --eis: #dce9f6;             /* helle Flächen, Tönungen */
  --nacht: #0c2140;           /* Schrift, Buttons */
  --nacht-leise: #2b4263;     /* Nebentext, dunkel genug für Sonnenlicht */
  --piste: #1f63e6;           /* Akzent: gefunden, Links, Fokus */
  --piste-hauch: rgba(31, 99, 230, .08);
  --linie: rgba(12, 33, 64, .3);
  --linie-stark: rgba(12, 33, 64, .62);
  --hinweis: #b4690e;         /* einziger warmer Ton, nur für Hinweise */
  --hinweis-grund: rgba(255, 249, 238, .9);
  --fehler: #b3261e;
  /* Glas */
  --glas: rgba(255, 255, 255, .88);    /* fast deckend: draußen zählt Kontrast */
  --glas-kante: rgba(255, 255, 255, .9);
  --glas-schatten: 0 18px 40px -30px rgba(12, 33, 64, .45);
  --unschaerfe: none;         /* Unschärfe nur am Desktop, siehe unten: am Handy kostet sie über bewegtem Grund Akku */
  /* Maße */
  --rand: 16px;
  --radius: 26px;
  --radius-feld: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-hand: "Caveat", "Segoe Script", "Bradley Hand", cursive;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  font: 400 1.1875rem/1.5 var(--font);
  color: var(--nacht);
  background: var(--firn);
}
a { color: #1650c4; text-underline-offset: 4px; text-decoration-thickness: 2px; }
h1, h2 { margin: 0 0 .45em; font-weight: 700; letter-spacing: -.022em; line-height: 1.12; text-wrap: balance; }
h1 { font-size: 1.85rem; }
h2 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--piste); outline-offset: 3px; }

/* Szene: Winterhimmel und verschneite Bergketten. Liegt fest hinter allem. */
.scene {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background: linear-gradient(180deg, #c9dcf0 0%, #dde9f5 34%, #eef4fa 62%, #f6f9fc 100%);
}
.scene svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ridge-far { fill: #b7cde6; }
.ridge-cap { fill: #d3e1f1; }
.cable { fill: none; stroke: rgba(12, 33, 64, .2); stroke-width: 1.2; }
.gondola { fill: var(--piste); stroke: rgba(12, 33, 64, .45); stroke-width: 1.2; opacity: .6; transform: translate(640px, 400px); }
.ridge-mid { fill: #d2e1f1; }
.ridge-near { fill: #e9f1f9; }
.ridge-lake { fill: #f8fbfd; }

/* Glasflächen */
.card, .top .brand {
  background: var(--glas);
  -webkit-backdrop-filter: var(--unschaerfe);
  backdrop-filter: var(--unschaerfe);
  border: 1px solid var(--glas-kante);
  box-shadow: var(--glas-schatten);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glas: rgba(255, 255, 255, .94); }
}

/* Kopf: schwebende Kapsel mit Wortmarke */
.top { padding: 12px var(--rand) 0; }
.brand {
  display: flex; align-items: center; gap: 10px; width: fit-content; max-width: 100%;
  min-height: 60px; padding: 8px 22px 8px 10px; border-radius: 999px;
  color: var(--nacht); text-decoration: none;
}
.brand-mark {
  flex: none; width: 40px; height: 40px; padding: 7px; border-radius: 50%;
  background: var(--nacht); fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-family: var(--font-hand); font-size: 1.75rem; line-height: 1; color: var(--nacht); white-space: nowrap; }
.brand-text small { font-size: 1rem; line-height: 1.2; color: var(--nacht-leise); }

/* Inhalt */
.wrap { width: 100%; max-width: 520px; margin: 0 auto; padding: 14px var(--rand) 8px; flex: 1; display: flex; flex-direction: column; gap: 14px; }
.card { border-radius: var(--radius); padding: 22px 20px; }
.card > :last-child { margin-bottom: 0; }
.card-warn { background: #fff8ec; border: 2px solid var(--hinweis); }
.eyebrow { margin: 0 0 .15em; color: var(--nacht-leise); }
.lead { font-size: 1.2rem; }
.note, .hint { color: var(--nacht-leise); }
.hint { margin: .9em 0 0; }
.alert { margin: 0 0 1em; padding: 12px 16px; border-radius: var(--radius-feld); font-weight: 600; background: var(--hinweis-grund); border: 1px solid rgba(180, 105, 14, .5); }

/* Buttons: flache Kapseln */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 66px; padding: 16px 32px; border: 2px solid var(--nacht); border-radius: 999px;
  font: 700 1.25rem/1.2 var(--font); letter-spacing: -.005em; text-decoration: none;
  color: #fff; background: var(--nacht);
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: background-color .15s ease, border-color .15s ease, transform .09s ease;
}
.btn:hover { background: #17335c; border-color: #17335c; }
.btn:active { transform: scale(.96); background: var(--piste); border-color: var(--piste); color: #fff; }
.btn-block { width: 100%; }
.btn-secondary { color: var(--nacht); background: rgba(255, 255, 255, .7); border-color: var(--linie-stark); }
.btn-secondary:hover { background: #fff; border-color: var(--nacht); }
.btn-danger { background: var(--fehler); border-color: var(--fehler); }
.btn-danger:hover { background: #8f1d17; border-color: #8f1d17; }

/* Formular */
.form { margin-top: 10px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-weight: 700; margin: 0 0 4px 4px; }
.field input {
  width: 100%; min-height: 62px; padding: 12px 18px;
  font: inherit; color: inherit;
  background: rgba(255, 255, 255, .92);
  border: 2px solid var(--linie-stark); border-radius: var(--radius-feld);
  -webkit-appearance: none; appearance: none;
}
.field input.pin { min-height: 76px; font-size: 2.2rem; font-weight: 700; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.field input:focus { border-color: var(--piste); background: #fff; outline: 3px solid rgba(31, 99, 230, .35); outline-offset: 0; }
.field input[aria-invalid="true"] { border-color: var(--fehler); border-width: 2px; }
.field-error { color: var(--fehler); font-weight: 600; margin: .4em 0 .75em 4px; }
.check { display: flex; gap: 16px; align-items: flex-start; padding: 10px 0; min-height: 60px; line-height: 1.35; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.check:active { background: var(--piste-hauch); border-radius: var(--radius-feld); }
.check input { flex: none; width: 40px; height: 40px; margin: 0; accent-color: var(--piste); }
.form .btn { margin-top: 14px; }
/* Honeypot: für Menschen unsichtbar */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Seitenraster: am Handy untereinander, am Desktop zweispaltig (siehe unten) */
.home, .kap, .sign { display: grid; gap: 14px; }

/* Einleitung: steht frei auf der Landschaft, ohne Karte */
.intro { padding: 18px 4px 6px; }
.intro h1 { font-size: 2.3rem; line-height: 1.06; letter-spacing: -.03em; margin-bottom: .35em; overflow-wrap: anywhere; }
.intro h1 span { display: block; }
.intro h1.hand { font-family: var(--font-hand); font-size: 3.6rem; line-height: .95; letter-spacing: 0; }
.intro .lead { max-width: 30em; margin-bottom: 1.1em; }
.intro > :last-child { margin-bottom: 4px; }
.home .intro h1 { font-size: 2.6rem; line-height: 1.04; letter-spacing: -.035em; }
.intro-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.intro-msg { padding-top: 12vh; }
.found-tag { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 8px 18px 8px 8px; border-radius: 999px; font-weight: 700; color: #fff; background: var(--piste); }
.found-tag svg { width: 32px; height: 32px; padding: 6px; border-radius: 50%; background: rgba(255, 255, 255, .22); fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.home-draw p { margin-bottom: .2em; }
.prose p { max-width: 38em; }

/* Drei Schritte als Weg: Symbole an einer durchgehenden Linie */
.steps { list-style: none; padding: 0; margin: 4px 0 0; }
.steps li { position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr); column-gap: 16px; padding-bottom: 22px; }
.steps li:last-child { padding-bottom: 0; }
.steps li:not(:last-child)::before { content: ""; position: absolute; left: 25px; top: 58px; bottom: 6px; width: 2px; background: var(--piste); opacity: .45; transform-origin: top; }
.step-ico {
  width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: #fff; border: 2px solid var(--piste); color: var(--piste);
}
.step-ico svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.steps h3 { margin: 3px 0 2px; font-size: 1.15rem; font-weight: 700; letter-spacing: -.015em; line-height: 1.25; }
.steps p { margin: 0; color: var(--nacht-leise); line-height: 1.4; }

/* Ergebnis: steht frei auf der Szene, ohne Glas */
.hero { text-align: center; padding: 14px 8px 6px; }
.hero h1 { font-family: var(--font-hand); font-weight: 700; font-size: 4.2rem; line-height: .95; letter-spacing: 0; margin-bottom: .15em; color: var(--nacht); }
/* Die Handschrift gehört dem Erfolgsmoment; die anderen Meldungen bleiben sachlich */
.hero-duplicate h1, .hero-rate_limited h1 { font-family: var(--font); font-size: 1.85rem; line-height: 1.12; letter-spacing: -.022em; margin-bottom: .4em; }
.hero .lead { margin-bottom: .5em; }
.hero .note { margin-bottom: 0; }
.lens {
  width: 92px; height: 92px; margin: 0 auto 14px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--piste); box-shadow: 0 0 0 8px rgba(31, 99, 230, .14), 0 0 0 16px rgba(31, 99, 230, .07);
}
.lens svg { width: 46px; height: 46px; fill: none; stroke: #fff; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; }
.hero-duplicate .lens, .hero-rate_limited .lens { background: var(--nacht-leise); box-shadow: 0 0 0 8px rgba(60, 83, 114, .14), 0 0 0 16px rgba(60, 83, 114, .07); }

/* Fortschritt: große Zahl, Kapselreihe */
.count { display: flex; align-items: baseline; gap: 12px; margin: 0 0 14px; font-size: 1.2rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
.count-n { font-size: 4.2rem; font-weight: 800; letter-spacing: -.05em; line-height: .85; color: var(--piste); font-variant-numeric: tabular-nums; }
.caps { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.caps li { height: 16px; border-radius: 999px; background: rgba(12, 33, 64, .2); }
.caps li.is-found { background: var(--piste); }
.tickets { margin: 0 0 .3em; font-weight: 700; font-size: 1.2rem; }

/* Stationen: nach Bereich gruppiert, eine Kapsel pro Zeile */
.group { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 22px 4px 8px; font-size: 1.05rem; font-weight: 700; }
.group:first-of-type { margin-top: 10px; }
.group-n { font-weight: 500; color: var(--nacht-leise); font-variant-numeric: tabular-nums; }
.stations { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.station {
  display: flex; align-items: center; gap: 12px;
  min-height: 62px; padding: 6px 18px 6px 6px; border-radius: 999px;
  border: 2px solid var(--linie);
}
.station-nr {
  flex: none; width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--nacht); border: 2px solid var(--linie-stark);
}
.station-nr svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.station-name { flex: 1; min-width: 0; font-weight: 700; line-height: 1.2; overflow-wrap: break-word; hyphens: auto; }
/* Am Handy trägt der Haken die Aussage, der Text bleibt für Screenreader; ab 600 px steht er sichtbar daneben */
.station-state { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; color: var(--nacht-leise); font-weight: 500; }
.station { position: relative; }
.station.is-found { background: rgba(31, 99, 230, .12); border-color: var(--piste); }
.station.is-found .station-nr { background: var(--piste); border-color: var(--piste); }
.station.is-found .station-state { color: #1650c4; font-weight: 700; }
.kap-list .note { margin-top: 18px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.draw-when { font-size: 1.3rem; font-weight: 700; letter-spacing: -.02em; margin-bottom: .2em; }

/* Fuß: schlichte Links auf dem Schnee */
.foot { width: 100%; max-width: 520px; margin: 10px auto 0; padding: 4px calc(var(--rand) + 6px) 22px; color: var(--nacht-leise); }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 26px; }
.foot a { display: inline-flex; align-items: center; min-height: 56px; padding: 0 2px; font-weight: 600; color: var(--nacht); }
.foot p { margin: 4px 0 0; }

/* ---------- Bewegung ----------
   Alles hier läuft nur, wenn das Gerät nicht „Bewegung reduzieren“ meldet, und nutzt ausschließlich
   transform und opacity. Bedienelemente sind nie von einer Animation abhängig: Sie sind sofort antippbar. */
@media (prefers-reduced-motion: no-preference) {
  /* Landschaft: Die Bergketten wandern langsam gegeneinander, eine Gondel pendelt, Schnee fällt in zwei Ebenen. */
  .ridge-far, .ridge-cap, .lift, .ridge-mid, .ridge-near { transform-box: view-box; transform-origin: 50% 100%; will-change: transform; }
  .ridge-far, .ridge-cap, .lift { animation: wandern-a 46s ease-in-out infinite alternate; }
  .ridge-mid { animation: wandern-b 34s ease-in-out infinite alternate; }
  .ridge-near { animation: wandern-a 26s ease-in-out infinite alternate-reverse; }
  .gondola { animation: gondel 38s ease-in-out infinite alternate; }
  @keyframes wandern-a { from { transform: translateX(-26px) scaleX(1.05); } to { transform: translateX(26px) scaleX(1.05); } }
  @keyframes wandern-b { from { transform: translateX(34px) scaleX(1.06); } to { transform: translateX(-34px) scaleX(1.06); } }
  /* Seil und Gondel wandern gemeinsam mit den Gipfeln (.lift); die Gondel fährt zusätzlich am Seil entlang. */
  @keyframes gondel {
    0% { transform: translate(350px, 437px); }
    40% { transform: translate(640px, 400px); }
    100% { transform: translate(1080px, 429px); }
  }
  .scene::before, .scene::after {
    content: ""; position: absolute; left: 0; right: 0; top: -440px; height: calc(100% + 440px); pointer-events: none; will-change: transform;
    background-image:
      radial-gradient(circle, #fff 0 2.5px, rgba(255, 255, 255, 0) 3.5px),
      radial-gradient(circle, rgba(255, 255, 255, .85) 0 1.6px, rgba(255, 255, 255, 0) 2.6px),
      radial-gradient(circle, rgba(255, 255, 255, .9) 0 2px, rgba(255, 255, 255, 0) 3px);
    background-size: 220px 220px, 110px 220px, 220px 440px;
    background-position: 40px 30px, 85px 140px, 150px 260px;
    animation: schnee 26s linear infinite;
  }
  .scene::after { z-index: 1; opacity: .9; background-position: 120px 90px, 20px 10px, 60px 350px; animation-duration: 15s; }
  @keyframes schnee { to { transform: translateY(440px); } }

  /* Auftritt beim Laden: erst die Einleitung Zeile für Zeile, danach die Karten */
  .intro > *, .intro h1 span, .wrap .card, .hero h1, .hero .lead { animation: hoch .55s cubic-bezier(.2, .8, .2, 1) both; }
  .home .intro h1 { animation: none; }
  .intro h1 span:nth-child(2) { animation-delay: .09s; }
  .intro h1 span:nth-child(3) { animation-delay: .18s; }
  .intro > :nth-child(2) { animation-delay: .14s; }
  .intro > :nth-child(3) { animation-delay: .26s; }
  .intro > :nth-child(4) { animation-delay: .36s; }
  .wrap .card { animation-delay: .2s; }
  .wrap .card ~ .card { animation-delay: .32s; }
  .wrap .card ~ .card ~ .card { animation-delay: .44s; }
  .hero h1 { animation-delay: .15s; }
  .hero .lead { animation-delay: .25s; }
  @keyframes hoch { from { opacity: 0; transform: translateY(18px); } }
  /* Die große Zahl zählt sichtbar hoch: Sie rutscht von unten ein */
  .count-n { animation: hoch .6s cubic-bezier(.2, 1.3, .4, 1) .45s both; }

  /* Die drei Schritte erscheinen nacheinander, die Linie wächst von oben nach unten */
  .steps .step-ico { animation: punkt .45s cubic-bezier(.2, 1.4, .4, 1) both; }
  .steps li:not(:last-child)::before { animation: linie .5s ease-out both; }
  .steps li:nth-child(1) .step-ico { animation-delay: .5s; }
  .steps li:nth-child(1)::before { animation-delay: .75s; }
  .steps li:nth-child(2) .step-ico { animation-delay: 1s; }
  .steps li:nth-child(2)::before { animation-delay: 1.25s; }
  .steps li:nth-child(3) .step-ico { animation-delay: 1.5s; }
  @keyframes punkt { from { opacity: 0; transform: scale(.4); } }
  @keyframes linie { from { transform: scaleY(0); } }

  /* Ergebnis: Die Scheibe erscheint, der Haken zeichnet sich, die Ringe atmen weiter */
  .hero-counted .lens { animation: auf .5s cubic-bezier(.2, .9, .3, 1) both, ringe 2.8s ease-in-out .6s infinite; }
  .hero-counted .lens path { stroke-dasharray: 60; stroke-dashoffset: 60; animation: haken .45s .25s ease-out forwards; }
  @keyframes auf { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
  @keyframes haken { to { stroke-dashoffset: 0; } }
  @keyframes ringe { 50% { box-shadow: 0 0 0 12px rgba(31, 99, 230, .16), 0 0 0 24px rgba(31, 99, 230, .06); } }

  /* Fortschritt: Die gefundenen Kapseln füllen sich der Reihe nach */
  .caps li.is-found { animation: fuellen .4s cubic-bezier(.2, .8, .2, 1) both; transform-origin: left; }
  .caps li:nth-child(1) { animation-delay: .5s; } .caps li:nth-child(2) { animation-delay: .58s; }
  .caps li:nth-child(3) { animation-delay: .66s; } .caps li:nth-child(4) { animation-delay: .74s; }
  .caps li:nth-child(5) { animation-delay: .82s; } .caps li:nth-child(6) { animation-delay: .9s; }
  .caps li:nth-child(7) { animation-delay: .98s; } .caps li:nth-child(8) { animation-delay: 1.06s; }
  .caps li:nth-child(9) { animation-delay: 1.14s; } .caps li:nth-child(10) { animation-delay: 1.22s; }
  @keyframes fuellen { from { transform: scaleX(0); opacity: 0; } }
}
/* Wer weniger Transparenz oder mehr Kontrast eingestellt hat, bekommt feste Flächen und kräftigere Linien */
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  :root { --glas: #fff; --unschaerfe: none; --linie: rgba(12, 33, 64, .5); --nacht-leise: #263a56; }
}

/* Ab Tablet-Breite: mehr Luft, Stationen zweispaltig */
@media (min-width: 600px) {
  :root { --rand: 24px; }
  .top { width: 100%; max-width: 640px; margin: 0 auto; padding-top: 20px; }
  .wrap { max-width: 640px; padding-top: 28px; gap: 18px; }
  .card { padding: 30px; }
  .foot { max-width: 640px; }
  h1 { font-size: 2.3rem; }
  .hero h1 { font-size: 5rem; }
  .station-state { position: static; width: auto; height: auto; overflow: visible; clip-path: none; flex: none; }
}

/* Ab Desktop-Breite: zweispaltig. Links die Einleitung, rechts das, was man bedient oder liest. */
@media (min-width: 940px) {
  body:has(.home, .kap, .sign) .top, body:has(.home, .kap, .sign) .wrap, body:has(.home, .kap, .sign) .foot { max-width: 1080px; }
  .wrap:has(.home, .sign) { justify-content: center; padding-top: 12px; }
  .home, .sign { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 20px 56px; align-items: center; }
  .home .intro { grid-row: span 2; padding: 0 0 8px 8px; }
  .home .intro h1 { font-size: 4.4rem; }
  .intro h1 { font-size: 3.2rem; }
  .intro .lead { font-size: 1.3rem; }
  .home-steps { padding: 34px 32px; }
  .sign .intro { padding: 0 0 8px 8px; }
  /* Kapselseite: links Stand und Verlosung, rechts die Stationsliste über die ganze Höhe */
  .kap { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 18px 40px; align-items: start; }
  .kap > * { grid-column: 1; }
  .kap > .kap-list { grid-column: 2; grid-row: 1 / span 6; }
  .kap .hero, .kap .intro { padding-top: 28px; }
  .intro-msg { max-width: 640px; }
}

/* Am Desktop mit Maus: echtes Milchglas. Am Handy bleibt es bei der fast deckenden Fläche. */
@media (min-width: 940px) and (hover: hover) {
  :root { --glas: rgba(255, 255, 255, .72); --unschaerfe: blur(18px) saturate(140%); }
}
