/* ---------- Schrift ---------- */

/* Bricolage Grotesque (SIL OFL 1.1, siehe fonts/OFL.txt), nur für Überschriften.
   Ein statischer Schnitt (800) deckt 700 bis 900 ab, damit der Browser nicht künstlich nachfettet. */
@font-face {
  font-family: 'Bricolage';
  src: url('fonts/bricolage-grotesque-latin-800.woff2') format('woff2');
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
    U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Erweiterte Lateinschrift (z. B. Ł, Č, ő) lädt nur, wenn ein Name solche Zeichen enthält. */
@font-face {
  font-family: 'Bricolage';
  src: url('fonts/bricolage-grotesque-latin-ext-800.woff2') format('woff2');
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Farbwelt "Freibad" (immer hell) ---------- */

:root {
  --bg: #f2fcfc;
  --fg: #082440;
  --muted: #3b5568;
  --line: #c9e9ea;
  --line-strong: #55919b;
  --surface: #ffffff;
  --surface-soft: rgb(255 255 255 / 0.86);
  --accent: #12bfcf;
  --accent2: #ffcf33;
  --on-accent: #082440;
  --error: #a8170f;
  --radius: 16px;
  --press: 0 4px 0 var(--fg);

  /* Farbwolken des Himmels. Werden je Sportart umgefärbt. */
  --aurora-1: #7fe3ec;
  --aurora-2: #ffe07a;
  --aurora-3: #ffb59e;
  --aurora-4: #b6f0f4;

  --font-display: 'Bricolage', ui-rounded, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;

  color-scheme: only light;
}

/* Nach der Wahl gehört die Seite "deiner" Sportart. Der Wechsel passiert unter der Übergangsanimation. */
html[data-sport='gym'] {
  --accent: #c6f94d;
  --aurora-1: #d9fb86;
  --aurora-2: #ffe07a;
  --aurora-3: #9fe8c4;
  --aurora-4: #e6fdb8;
}

html[data-sport='laufen'] {
  --accent: #ff7a59;
  --aurora-1: #ffb59e;
  --aurora-2: #ffd27a;
  --aurora-3: #ff9fb8;
  --aurora-4: #ffd9cc;
}

html[data-sport='schwimmen'] {
  --accent: #19b5d8;
  --aurora-1: #7fe3ec;
  --aurora-2: #9fd8ff;
  --aurora-3: #c9f5ef;
  --aurora-4: #b6f0f4;
}

html[data-sport='rad'] {
  --accent: #ffd84d;
  --aurora-1: #ffe58a;
  --aurora-2: #ffc59e;
  --aurora-3: #c3f0a8;
  --aurora-4: #fff1b8;
}

html[data-sport='sonstiges'] {
  --accent: #ff8fc7;
  --aurora-1: #ffb3da;
  --aurora-2: #d6c2ff;
  --aurora-3: #ffd27a;
  --aurora-4: #ffd6ea;
}

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

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Sommerhimmel ---------- */

.sky {
  position: fixed;
  /* Größer als der Bildschirm, damit beim Ein- und Ausfahren der iOS-Tastatur kein Rand sichtbar wird. */
  inset: -10%;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(180deg, #ddf6f7 0%, #f2fcfc 45%, #fff8dc 100%);
}

/* Kleine Kreise, per scale() vergrößert: spart Grafikspeicher auf Handys mit hoher Pixeldichte. */
.blob {
  position: absolute;
  width: 34vmax;
  height: 34vmax;
  border-radius: 50%;
  background: radial-gradient(circle at center, var(--c) 0%, transparent 68%);
  /* Höchstens 60 %, sonst sinkt der Kontrast des gedämpften Texts in der Wolkenmitte unter 4,5:1. */
  opacity: 0.6;
  will-change: transform;
  animation: drift var(--t, 30s) ease-in-out infinite alternate;
}

.b1 {
  --c: var(--aurora-1);
  --dx: 14vw;
  --dy: 8vh;
  --s0: 1.5;
  --s1: 1.9;
  --t: 26s;
  top: -6%;
  left: -14%;
}

.b2 {
  --c: var(--aurora-2);
  --dx: -16vw;
  --dy: 12vh;
  --s0: 1.3;
  --s1: 1.7;
  --t: 33s;
  top: 30%;
  right: -18%;
}

.b3 {
  --c: var(--aurora-3);
  --dx: 12vw;
  --dy: -14vh;
  --s0: 1.2;
  --s1: 1.6;
  --t: 29s;
  bottom: -8%;
  left: -6%;
}

.b4 {
  --c: var(--aurora-4);
  --dx: -10vw;
  --dy: -8vh;
  --s0: 1.1;
  --s1: 1.5;
  --t: 37s;
  top: 8%;
  right: 6%;
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(var(--s0));
  }
  to {
    transform: translate3d(var(--dx), var(--dy), 0) scale(var(--s1));
  }
}

/* ---------- Grundgerüst ---------- */

.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 5px;
  background: rgb(8 36 64 / 0.08);
  z-index: 5;
}

.progress-bar {
  height: 100%;
  width: 20%;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 0.45s cubic-bezier(0.3, 1.3, 0.5, 1);
}

.app {
  width: 100%;
  max-width: 560px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top)) calc(20px + env(safe-area-inset-right))
    calc(32px + env(safe-area-inset-bottom)) calc(20px + env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  /* Seitlich hereingleitende Schritte dürfen kein horizontales Scrollen auslösen. */
  overflow-x: hidden;
  overflow-x: clip;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  margin-bottom: 3vh;
}

.brand {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* Auf dem Plakat steht der Name schon riesig. */
html[data-step='name'] .brand {
  visibility: hidden;
}

.back {
  width: 44px;
  height: 44px;
  margin-left: -10px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.back:disabled {
  opacity: 0.3;
  cursor: default;
}

.step {
  flex: 1;
  display: flex;
  flex-direction: column;
  animation: step-in-forward 0.38s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}

/* Vorwärts kommt der nächste Schritt von rechts, zurück von links. Wie in einer App. */
html[data-dir='back'] .step {
  animation-name: step-in-back;
}

.step > form {
  display: flex;
  flex-direction: column;
  flex: 1;
}

@keyframes step-in-forward {
  from {
    opacity: 0;
    transform: translateX(32px);
  }
}

@keyframes step-in-back {
  from {
    opacity: 0;
    transform: translateX(-32px);
  }
}

h1 {
  margin: 0 0 24px;
  font-family: var(--font-display);
  font-size: clamp(32px, 9vw, 46px);
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: -0.025em;
  text-wrap: balance;
  outline: none;
}

/* ---------- Schritt 1: Sommerplakat ---------- */

.poster {
  position: relative;
  margin: 0 0 22px;
  transition: margin 0.3s ease;
}

.sun {
  position: absolute;
  z-index: -1;
  top: -4%;
  right: -6%;
  width: min(54vw, 270px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 36%, #fff3b0 0%, #ffd84d 46%, #ffb547 78%, #ff9a5c 100%);
  box-shadow: 0 0 0 14px rgb(255 216 77 / 0.25), 0 0 0 32px rgb(255 216 77 / 0.12);
}

.poster-title {
  display: flex;
  flex-direction: column;
  margin: 0;
  font-size: clamp(76px, 27vw, 140px);
  line-height: 0.84;
  letter-spacing: -0.045em;
  text-wrap: initial;
  transition: font-size 0.3s ease;
}

.pw {
  display: block;
}

.pw2 {
  /* "mit" klein und schräg, wie auf einem Konzertplakat. */
  font-size: 0.42em;
  line-height: 1;
  margin: 0.08em 0 0.06em 0.12em;
  color: var(--fg);
  transform: rotate(-4deg);
  transform-origin: left center;
}

.pw2::before {
  content: '';
  display: inline-block;
  width: 1.6em;
  height: 0.16em;
  margin-right: 0.25em;
  vertical-align: middle;
  border-radius: 1em;
  background: var(--accent);
}

/* Beim ersten Öffnen fliegen die Wörter nacheinander ein, und die Sonne geht auf. */
.intro .pw {
  animation: word-in 0.7s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}

.intro .pw1 {
  animation-delay: 0.05s;
}

.intro .pw2 {
  animation-name: word-in-tilted;
  animation-delay: 0.22s;
}

.intro .pw3 {
  animation-delay: 0.38s;
}

.intro .sun {
  animation: sunrise 1.4s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}

.intro .madlib,
.intro .step-poster .field,
.intro .step-poster .primary {
  animation: fade-up 0.5s ease 0.65s both;
}

@keyframes word-in {
  from {
    opacity: 0;
    transform: translateY(0.4em) scale(0.85);
  }
}

@keyframes word-in-tilted {
  from {
    opacity: 0;
    transform: translateY(0.4em) rotate(-12deg) scale(0.6);
  }
}

@keyframes sunrise {
  from {
    opacity: 0;
    transform: translateY(45%) scale(0.7);
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

/* Beim Tippen rückt das Plakat zu einer Zeile zusammen, damit Feld und Knopf über der Tastatur Platz haben. */
.typing .poster-title {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.22em;
  font-size: clamp(30px, 9.5vw, 46px);
  line-height: 1;
}

.typing .pw2 {
  font-size: 1em;
  margin: 0;
  transform: none;
}

.typing .pw2::before {
  display: none;
}

.typing .poster {
  margin-bottom: 12px;
}

.typing .sun {
  top: -40%;
  right: -4%;
  width: min(26vw, 120px);
}

/* Ist der Bildschirm breiter als die Seite (quer, Tablet), bleibt die Sonne samt Halo im Innenabstand,
   sonst schneidet der Rand der Seite sie senkrecht ab. */
@media (min-width: 561px) {
  .sun {
    right: 12px;
  }
}

@media (max-height: 640px) {
  .poster-title {
    font-size: clamp(56px, 19vw, 96px);
  }
}

.madlib {
  margin: 0 0 22px;
  font-size: clamp(22px, 6.4vw, 28px);
  font-weight: 600;
  line-height: 1.6;
}

.madlib input[type='text'] {
  display: inline-block;
  width: 7.5em;
  max-width: 100%;
  margin: 0 0.15em;
  padding: 0 0.15em;
  border: 0;
  border-bottom: 3px solid var(--fg);
  border-radius: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-weight: 800;
  line-height: 1.25;
  vertical-align: baseline;
  appearance: none;
}

.madlib input[type='text']:focus {
  outline: none;
  border-bottom-color: var(--accent);
  box-shadow: 0 3px 0 var(--fg);
}

.madlib input::placeholder {
  color: var(--muted);
  font-weight: 600;
}

/* ---------- Formularfelder ---------- */

.field {
  display: block;
  margin-bottom: 20px;
}

.label {
  display: block;
  margin-bottom: 8px;
  padding: 0;
  font-size: 15px;
  font-weight: 700;
}

.optional {
  font-weight: 400;
  color: var(--muted);
}

input[type='text'],
textarea {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--fg);
  font: inherit;
  /* Mindestens 16px, sonst zoomt iOS beim Fokussieren. */
  font-size: 17px;
  appearance: none;
}

textarea {
  resize: vertical;
  min-height: 96px;
}

input[type='text']:focus,
textarea:focus {
  outline: none;
  border-color: var(--fg);
  box-shadow: 0 0 0 3px var(--accent);
}

::placeholder {
  color: var(--muted);
  opacity: 1;
}

button {
  touch-action: manipulation;
}

button:focus-visible,
.check input:focus-visible + .box {
  outline: 3px solid var(--fg);
  outline-offset: 3px;
}

/* Knöpfe im Sticker-Look: Akzentfläche, dunkler Rand, harter Schatten. */
.primary,
.secondary {
  display: block;
  width: 100%;
  min-height: 56px;
  margin-top: 12px;
  padding: 14px 20px;
  border: 2px solid var(--fg);
  border-radius: var(--radius);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--press);
  transition:
    transform 0.08s ease,
    box-shadow 0.08s ease,
    opacity 0.2s ease;
}

.primary {
  background: var(--accent);
  color: var(--on-accent);
}

.secondary {
  background: var(--surface);
  color: var(--fg);
}

.primary:active,
.secondary:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--fg);
}

.primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: var(--press);
}

.error {
  margin: 4px 0 8px;
  color: var(--error);
  font-weight: 700;
}

.hint,
.selection {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 15px;
}

.selection {
  min-height: 1.45em;
  margin-top: 16px;
  color: var(--fg);
  font-weight: 700;
}

.subhead {
  margin: 18px 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.group {
  margin: 0 0 20px;
  padding: 0;
  border: 0;
  min-width: 0;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Mein Kommentar zur Zeitwahl ---------- */

.quip {
  min-height: 3.6em;
  margin: 4px 0 0;
  font-size: 15px;
  line-height: 1.35;
}

.bubble {
  position: relative;
  display: inline-block;
  max-width: 100%;
  margin-left: 6px;
  padding: 8px 14px;
  border: 2px solid var(--fg);
  border-radius: 16px 16px 16px 4px;
  background: var(--accent2);
  color: var(--fg);
  font-weight: 700;
  animation: bubble-in 0.4s cubic-bezier(0.2, 1.6, 0.4, 1) both;
  transform-origin: left bottom;
}

@keyframes bubble-in {
  from {
    opacity: 0;
    transform: scale(0.6) rotate(-4deg);
  }
}

/* ---------- Kalender ---------- */

.calendar {
  margin-bottom: 20px;
  padding: 10px 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 22px;
  background: var(--surface-soft);
  box-shadow: 0 10px 30px -18px rgb(8 36 64 / 0.35);
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.calendar-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.icon-button:disabled {
  opacity: 0.2;
  cursor: default;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.calendar-weekdays {
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  color: var(--muted);
}

.day {
  aspect-ratio: 1;
  min-height: 38px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.day:active:not(:disabled) {
  transform: scale(0.92);
}

.day:disabled {
  color: var(--muted);
  opacity: 0.4;
  font-weight: 400;
  cursor: default;
}

.day.today {
  border-color: var(--line-strong);
  border-style: dashed;
}

.day.selected,
.slot.selected {
  background: var(--accent);
  color: var(--on-accent);
  border: 2px solid var(--fg);
  box-shadow: 0 3px 0 var(--fg);
  animation: pop-in 0.3s cubic-bezier(0.2, 1.6, 0.4, 1);
}

@keyframes pop-in {
  from {
    transform: scale(0.8);
  }
}

/* ---------- Uhrzeiten ---------- */

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 8px;
}

.slot {
  min-height: 48px;
  padding: 0 4px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--fg);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

/* ---------- Sportarten ---------- */

.sports {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

/* Jede Kachel trägt schon einen Hauch ihrer Farbe. */
.sport {
  --tile: #ffffff;
  --tile-strong: var(--accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 112px;
  padding: 12px 8px;
  border: 2px solid var(--line);
  border-radius: 20px;
  background: var(--tile);
  color: var(--fg);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 0.1s ease,
    background 0.15s ease;
}

.sport[data-sport='gym'] {
  --tile: #eefdc9;
  --tile-strong: #c6f94d;
}

.sport[data-sport='laufen'] {
  --tile: #ffe4dc;
  --tile-strong: #ff7a59;
}

.sport[data-sport='schwimmen'] {
  --tile: #d6f3f9;
  --tile-strong: #19b5d8;
}

.sport[data-sport='rad'] {
  --tile: #fff4c7;
  --tile-strong: #ffd84d;
}

.sport[data-sport='sonstiges'] {
  --tile: #ffe1f0;
  --tile-strong: #ff8fc7;
}

.sport:active {
  transform: scale(0.96);
}

.sport.selected,
.sport.rolling {
  background: var(--tile-strong);
  border-color: var(--fg);
  box-shadow: 0 4px 0 var(--fg);
}

.sport.rolling {
  transform: translateY(-3px) rotate(-1.5deg);
}

.sport.rolled {
  animation: rolled 0.5s cubic-bezier(0.2, 1.6, 0.4, 1);
}

@keyframes rolled {
  40% {
    transform: scale(1.08) rotate(2deg);
  }
}

.sports.busy {
  pointer-events: none;
}

.sport-wide {
  grid-column: 1 / -1;
  flex-direction: row;
  min-height: 72px;
  gap: 12px;
}

.sport-icon {
  font-size: 40px;
  line-height: 1;
}

.sport-wide .sport-icon {
  font-size: 28px;
}

.dice {
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: 8px;
  min-height: 44px;
  margin: 0 0 20px;
  padding: 8px 16px;
  border: 2px dashed var(--line-strong);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--fg);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.dice:disabled {
  opacity: 0.5;
}

.dice-icon {
  display: inline-block;
  font-size: 22px;
  line-height: 1;
}

.dice.rolling .dice-icon {
  animation: dice-spin 0.4s linear infinite;
}

@keyframes dice-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Checkboxen (Gym) ---------- */

.checks {
  display: grid;
  gap: 10px;
}

.check {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  padding: 12px 16px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.check input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.box {
  position: relative;
  z-index: 1;
  flex: none;
  width: 30px;
  height: 30px;
  border: 2px solid var(--fg);
  border-radius: 9px;
  background: var(--surface);
  transition: background 0.15s ease;
}

.box::after {
  content: '';
  position: absolute;
  left: 9px;
  top: 3px;
  width: 8px;
  height: 15px;
  border: solid #ffffff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.18s cubic-bezier(0.2, 1.6, 0.4, 1);
}

.check input:checked + .box {
  background: var(--fg);
}

.check input:checked + .box::after {
  transform: rotate(45deg) scale(1);
}

.checks.busy {
  pointer-events: none;
}

.check.nudge {
  animation: nudge 0.5s ease;
}

@keyframes nudge {
  25% {
    transform: translateX(-6px);
  }
  50% {
    transform: translateX(6px);
  }
  75% {
    transform: translateX(-3px);
  }
}

/* ---------- Bestätigung mit Eintrittskarte ---------- */

.step-done {
  padding-bottom: 4vh;
}

.done-mark {
  width: 64px;
  margin-bottom: 18px;
}

.done-mark svg {
  display: block;
  overflow: visible;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.done-mark circle {
  fill: var(--accent);
  stroke: var(--fg);
  stroke-width: 3;
  transform-origin: center;
  transform-box: fill-box;
  animation: pop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) 0.05s both;
}

.done-mark path {
  stroke: var(--fg);
  stroke-width: 5;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: draw 0.35s ease 0.45s forwards;
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

.step-done h1 {
  margin-bottom: 12px;
  overflow-wrap: break-word;
  -webkit-hyphens: auto;
  hyphens: auto;
}

.lead {
  margin: 0 0 26px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
}

/* Die Maske schneidet box-shadow ab, deshalb sitzt der Schatten als drop-shadow am äußeren Element. */
.ticket-wrap {
  margin: 0 0 22px;
  filter: drop-shadow(0 0 1px rgb(8 36 64 / 0.55)) drop-shadow(0 12px 18px rgb(8 36 64 / 0.16));
  animation: ticket-in 0.75s cubic-bezier(0.2, 1.2, 0.35, 1) 0.55s both;
}

@keyframes ticket-in {
  from {
    opacity: 0;
    transform: translateY(60px) rotate(-8deg) scale(0.92);
  }
  70% {
    transform: translateY(-4px) rotate(1deg);
  }
}

.ticket {
  --stub: 66px;
  --notch: 11px;
  position: relative;
  display: flex;
  overflow: hidden;
  border-radius: 18px;
  background: var(--surface);
  /* Halbrunde Kerben oben und unten an der Abrisskante. */
  -webkit-mask:
    radial-gradient(circle var(--notch) at calc(100% - var(--stub)) 0, transparent 97%, #000) top / 100% 51% no-repeat,
    radial-gradient(circle var(--notch) at calc(100% - var(--stub)) 100%, transparent 97%, #000) bottom / 100% 51% no-repeat;
  mask:
    radial-gradient(circle var(--notch) at calc(100% - var(--stub)) 0, transparent 97%, #000) top / 100% 51% no-repeat,
    radial-gradient(circle var(--notch) at calc(100% - var(--stub)) 100%, transparent 97%, #000) bottom / 100% 51% no-repeat;
}

/* Einmaliger Lichtreflex über die Karte. */
.ticket::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgb(255 255 255 / 0.75) 50%, transparent 65%);
  transform: translateX(-120%);
  animation: shine 1.1s ease-in-out 1.45s both;
  pointer-events: none;
}

@keyframes shine {
  to {
    transform: translateX(120%);
  }
}

.ticket-main {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 18px 18px 16px 20px;
  background:
    radial-gradient(circle at 100% 0, rgb(255 207 51 / 0.28), transparent 45%),
    linear-gradient(180deg, #ffffff, #f7fdfd);
}

.ticket-kicker {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.ticket-kicker {
  /* Platz für den Stempel oben rechts. Lange Namen dürfen darunter durchlaufen, wie bei einem echten Stempel. */
  padding-right: 96px;
}

.ticket-for {
  margin: 0 0 12px;
  font-size: 15px;
  overflow-wrap: break-word;
  -webkit-hyphens: auto;
  hyphens: auto;
}

.ticket-date {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 10px;
  margin-bottom: 10px;
}

.ticket-weekday {
  flex-basis: 100%;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ticket-day {
  font-family: var(--font-display);
  font-size: clamp(42px, 13vw, 60px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}

.ticket-time {
  font-family: var(--font-display);
  font-size: clamp(22px, 6.5vw, 30px);
  font-weight: 800;
}

.ticket-night {
  flex-basis: 100%;
  font-size: 13px;
  color: var(--muted);
}

.ticket-night:empty {
  display: none;
}

.ticket-sport {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  margin: 0 0 10px;
  padding: 5px 12px 5px 8px;
  border: 2px solid var(--fg);
  border-radius: 14px;
  background: var(--accent);
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: break-word;
  -webkit-hyphens: auto;
  hyphens: auto;
}

/* Darf schrumpfen, sonst bricht ein langes Wort aus "Sonstiges" nicht um und läuft unter den Abriss. */
#ticket-sport {
  min-width: 0;
}

.ticket-sport-icon {
  flex: none;
  font-size: 20px;
  line-height: 1;
}

.ticket-entry {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.stamp {
  position: absolute;
  top: 16px;
  right: 12px;
  padding: 4px 9px;
  border: 3px solid var(--error);
  border-radius: 8px;
  color: var(--error);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: rotate(-12deg);
  opacity: 0.92;
  mix-blend-mode: multiply;
  animation: stamp 0.35s cubic-bezier(0.5, 0, 0.7, 1.4) 1.25s both;
}

@keyframes stamp {
  from {
    opacity: 0;
    transform: rotate(-24deg) scale(2.6);
  }
}

.ticket-stub {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  flex: none;
  width: var(--stub);
  padding: 16px 0 14px;
  border-left: 2px dashed rgb(8 36 64 / 0.4);
  background: var(--accent);
}

.stub-text {
  writing-mode: vertical-rl;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* Zier-Strichcode */
.barcode {
  width: 32px;
  height: 46px;
  margin-top: 12px;
  background: repeating-linear-gradient(
    0deg,
    var(--fg) 0 2px,
    transparent 2px 4px,
    var(--fg) 4px 5px,
    transparent 5px 8px,
    var(--fg) 8px 11px,
    transparent 11px 13px
  );
  opacity: 0.85;
}

/* ---------- Übergangsanimationen ---------- */

.transition {
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow: hidden;
  background: var(--t-bg, #bff0f2);
  color: var(--t-fg, #082440);
  cursor: pointer;
  /* Die Farbe breitet sich kreisförmig vom Fingerpunkt aus. */
  clip-path: circle(150vmax at var(--tx, 50%) var(--ty, 50%));
  animation: t-reveal 0.45s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.transition.leaving {
  animation: t-out 0.3s ease both;
}

@keyframes t-reveal {
  from {
    clip-path: circle(0 at var(--tx, 50%) var(--ty, 50%));
  }
}

@keyframes t-out {
  to {
    opacity: 0;
  }
}

.t-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.t-text {
  position: absolute;
  top: 20%;
  left: 0;
  right: 0;
  padding: 0 24px;
  text-align: center;
  z-index: 2;
}

.t-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(46px, 14vw, 88px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
  animation: pop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) 0.2s both;
}

.t-sub {
  margin: 12px 0 0;
  font-size: clamp(18px, 5vw, 24px);
  font-weight: 700;
  animation: pop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) 0.4s both;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.7) translateY(12px);
  }
}

.t-rad {
  --t-bg: #ffd84d;
}

.t-laufen {
  --t-bg: #ff7a59;
}

.t-schwimmen {
  --t-bg: #bff0f2;
  --t-water: #19b5d8;
}

.t-gym {
  --t-bg: #c6f94d;
}

.t-sonstiges {
  --t-bg: #ff8fc7;
}

/* Boden und Fahrtwind für Rad und Laufen */

.road {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 24%;
  height: 5px;
  background: currentColor;
  opacity: 0.9;
}

.streaks i {
  position: absolute;
  right: -30%;
  height: 4px;
  width: 22%;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.3;
  animation: streak 0.7s linear infinite;
}

.streaks i:nth-child(1) {
  bottom: 30%;
}

.streaks i:nth-child(2) {
  bottom: 36%;
  width: 12%;
  animation-delay: 0.25s;
}

.streaks i:nth-child(3) {
  bottom: 42%;
  width: 18%;
  animation-delay: 0.45s;
}

.streaks i:nth-child(4) {
  bottom: 19%;
  width: 30%;
  animation-delay: 0.1s;
}

@keyframes streak {
  to {
    transform: translateX(-160vw);
  }
}

/* Radfahren */

.bike-ride {
  position: absolute;
  left: 0;
  bottom: 24%;
  width: min(58vw, 300px);
  animation: ride 2.3s cubic-bezier(0.45, 0.05, 0.3, 1) 0.3s both;
}

@keyframes ride {
  from {
    transform: translateX(-110%);
  }
  to {
    transform: translateX(100vw);
  }
}

.bike-wheelie {
  transform-origin: 22% 72%;
  animation: wheelie 2.3s ease-in-out 0.3s both;
}

@keyframes wheelie {
  0%,
  38%,
  72%,
  100% {
    transform: rotate(0deg);
  }
  50%,
  60% {
    transform: rotate(-24deg);
  }
}

.bike {
  display: block;
  width: 100%;
  overflow: visible;
  margin-bottom: -3%;
}

.wheel,
.crank {
  transform-box: fill-box;
  transform-origin: center;
  animation: spin 0.5s linear infinite;
}

.crank {
  animation-duration: 0.8s;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Laufen */

.runner-run {
  position: absolute;
  left: 0;
  bottom: 24%;
  animation: ride 2.1s cubic-bezier(0.5, 0, 0.4, 1) 0.3s both;
}

.runner {
  font-size: min(34vw, 170px);
  line-height: 1;
  /* Das Emoji läuft nach links, gespiegelt läuft es in Fahrtrichtung. */
  transform: scaleX(-1);
  animation: bob 0.28s ease-in-out infinite alternate;
}

@keyframes bob {
  from {
    transform: scaleX(-1) translateY(0) rotate(4deg);
  }
  to {
    transform: scaleX(-1) translateY(-9%) rotate(8deg);
  }
}

.dust {
  position: absolute;
  left: -10%;
  bottom: 0;
}

.dust i {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0;
  animation: puff 0.6s ease-out infinite;
}

.dust i:nth-child(2) {
  animation-delay: 0.15s;
}

.dust i:nth-child(3) {
  animation-delay: 0.3s;
}

.dust i:nth-child(4) {
  animation-delay: 0.45s;
}

@keyframes puff {
  from {
    opacity: 0.45;
    transform: translate(0, 0) scale(0.4);
  }
  to {
    opacity: 0;
    transform: translate(-70px, -30px) scale(1.6);
  }
}

/* Schwimmen */

.water-rise {
  position: absolute;
  inset: 0;
  animation: rise 2.2s cubic-bezier(0.3, 0.7, 0.3, 1) 0.2s both;
}

@keyframes rise {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(8%);
  }
}

.water-slide {
  display: flex;
  width: 200%;
  height: 44px;
  animation: slide 1.6s linear infinite;
}

.water-slide svg {
  width: 50%;
  height: 100%;
  fill: var(--t-water);
}

@keyframes slide {
  to {
    transform: translateX(-50%);
  }
}

.water-body {
  height: 100%;
  margin-top: -1px;
  background: var(--t-water);
}

.swimmer-swim {
  position: absolute;
  left: 0;
  bottom: 22%;
  animation: ride 2.3s ease-in-out 0.4s both;
}

.swimmer {
  font-size: min(30vw, 150px);
  line-height: 1;
  transform: scaleX(-1);
  animation: swim-bob 0.5s ease-in-out infinite alternate;
}

@keyframes swim-bob {
  from {
    transform: scaleX(-1) translateY(0) rotate(-4deg);
  }
  to {
    transform: scaleX(-1) translateY(-10%) rotate(4deg);
  }
}

.bubbles i {
  position: absolute;
  bottom: -30px;
  width: 16px;
  height: 16px;
  border: 3px solid rgb(8 36 64 / 0.45);
  border-radius: 50%;
  animation: bubble 1.8s ease-in infinite;
}

.bubbles i:nth-child(1) {
  left: 12%;
  animation-delay: 0.5s;
}

.bubbles i:nth-child(2) {
  left: 30%;
  width: 10px;
  height: 10px;
  animation-delay: 1s;
}

.bubbles i:nth-child(3) {
  left: 48%;
  animation-delay: 0.7s;
}

.bubbles i:nth-child(4) {
  left: 66%;
  width: 22px;
  height: 22px;
  animation-delay: 1.2s;
}

.bubbles i:nth-child(5) {
  left: 82%;
  width: 12px;
  height: 12px;
  animation-delay: 0.9s;
}

.bubbles i:nth-child(6) {
  left: 92%;
  animation-delay: 1.4s;
}

@keyframes bubble {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(-75vh);
    opacity: 0;
  }
}

/* Gym */

.t-gym .t-stage {
  animation: slam 0.4s linear 2.12s both;
}

@keyframes slam {
  0%,
  100% {
    transform: translate(0, 0);
  }
  20% {
    transform: translate(-6px, 10px);
  }
  40% {
    transform: translate(6px, -6px);
  }
  60% {
    transform: translate(-4px, 5px);
  }
  80% {
    transform: translate(3px, -2px);
  }
}

.floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 16%;
  height: 5px;
  background: currentColor;
}

.barbell-lift {
  position: absolute;
  left: 50%;
  bottom: 16%;
  width: min(84vw, 440px);
  margin-left: calc(min(84vw, 440px) / -2);
  animation: lift 2.3s ease-in-out 0.2s both;
}

.barbell {
  display: block;
  width: 100%;
}

/* Hochstemmen mit kurzem Zittern, oben halten, fallen lassen. */
@keyframes lift {
  0%,
  10% {
    transform: translateY(0) rotate(0deg);
  }
  30% {
    transform: translateY(-16vh) rotate(-3deg);
  }
  38% {
    transform: translateY(-14vh) rotate(3deg);
  }
  58% {
    transform: translateY(-36vh) rotate(-2deg);
  }
  64% {
    transform: translateY(-36vh) rotate(2deg);
  }
  70% {
    transform: translateY(-36vh) rotate(-1deg);
  }
  76% {
    transform: translateY(-36vh) rotate(0deg);
  }
  84%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
}

/* Sonstiges */

.confetti i {
  position: absolute;
  top: -12%;
  left: var(--x);
  font-size: var(--size);
  font-style: normal;
  line-height: 1;
  animation: fall var(--duration) cubic-bezier(0.3, 0.2, 0.6, 1) var(--delay) both;
}

@keyframes fall {
  from {
    transform: translateY(0) rotate(0deg);
  }
  to {
    transform: translateY(125vh) rotate(var(--spin));
  }
}

/* ---------- Weniger Bewegung ---------- */

@media (prefers-reduced-motion: reduce) {
  .blob,
  .step,
  .pw,
  .sun,
  .madlib,
  .field,
  .primary,
  .t-title,
  .t-sub,
  .check.nudge,
  .bubble,
  .day.selected,
  .slot.selected,
  .sport.rolled,
  .ticket-wrap,
  .ticket::after,
  .stamp,
  .done-mark circle {
    animation: none !important;
  }

  .ticket::after {
    display: none;
  }

  .transition {
    animation: t-fade 0.2s ease both;
  }

  .transition.leaving {
    animation: t-out 0.2s ease both;
  }

  .t-stage {
    display: none;
  }

  .done-mark path {
    animation: none;
    stroke-dashoffset: 0;
  }

  .progress-bar,
  .poster,
  .poster-title {
    transition: none;
  }
}

@keyframes t-fade {
  from {
    opacity: 0;
  }
}
