@font-face {
  font-family: "Gabarito";
  src: url("/assets/fonts/gabarito.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --grund: #fbf8fb;
  --tinte: #2b1830;
  --tinte-leise: #5e4864;
  --plum: #aa4098;
  --plum-tief: #8a2f7b;
  --bauch: #d08cca;
  --bauch-hell: #f2e2ef;
  --linie: #e6d3e2;
  --beispiel: #9a8396; /* Platzhalter, 3.3:1, reicht für großen fetten Text */
  --fehler: #b3261e;
  --rand: clamp(20px, 5vw, 48px);
  --schnell: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }

html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
  background: var(--grund);
  scrollbar-color: var(--bauch) var(--grund);
}

body {
  font-family: "Gabarito", "Segoe UI", system-ui, sans-serif;
  color: var(--tinte);
  background: var(--grund);
  line-height: 1.5;
}

::selection { background: var(--bauch); color: var(--tinte); }

a { color: var(--plum-tief); text-underline-offset: 0.18em; text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--plum); outline-offset: 3px; border-radius: 6px; }

button, a, [role="button"] { touch-action: manipulation; }
button { font: inherit; color: inherit; cursor: pointer; user-select: none; -webkit-user-select: none; }

input { font: inherit; font-size: max(16px, 1em); color: var(--tinte); caret-color: var(--plum); }

.nur-vorlesen {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Kopf */
.kopf {
  display: flex; justify-content: space-between; align-items: center;
  padding: calc(14px + env(safe-area-inset-top, 0px)) var(--rand) 14px;
  max-width: 1200px; margin: 0 auto;
}
.marke { font-weight: 800; font-size: 18px; letter-spacing: -0.02em; color: var(--plum); text-decoration: none; }
.kanaele { display: flex; gap: 18px; }
.kanaele a { font-weight: 600; font-size: 15px; color: var(--tinte-leise); text-decoration: none; padding: 8px 0; }

/* Bühne: der Satz ist die Seite */
.buehne {
  position: relative;
  max-width: 1200px; margin: 0 auto;
  padding: clamp(24px, 6vh, 72px) var(--rand) 28px;
  overflow-x: clip;
}
.satz-form, .geschafft { position: relative; z-index: 1; max-width: 860px; }

.satz {
  font-size: clamp(2.6rem, 11.5vw, 6rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.satz .fix { display: block; }

.luecke {
  display: block;
  width: 100%;
  margin: 0.08em 0 0.22em;
  padding: 0.05em 0 0.12em;
  border: 0;
  border-bottom: 4px solid var(--plum);
  border-radius: 0;
  background: transparent;
  font-size: 0.68em;
  font-weight: 700;
  color: var(--plum);
  letter-spacing: -0.02em;
  line-height: 1.15;
  transition: border-color 160ms var(--schnell);
}
.luecke::placeholder { color: var(--beispiel); opacity: 1; font-weight: 600; }
.luecke:placeholder-shown { border-bottom-color: var(--bauch); }
.luecke:focus { outline: none; border-bottom-color: var(--tinte); }
.luecke:focus::placeholder { opacity: 0.6; }
.luecke[aria-invalid="true"] { border-bottom-color: var(--fehler); }

.aktion { display: flex; align-items: center; gap: 16px; margin-top: 22px; flex-wrap: wrap; }

.knopf {
  border: 0;
  border-radius: 14px;
  padding: 16px 26px;
  background: var(--plum);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.01em;
  box-shadow: 0 6px 18px rgb(138 47 123 / 0.28);
  transition: transform 120ms var(--schnell), background 120ms, box-shadow 120ms;
}
.knopf:active { transform: scale(0.97); background: var(--plum-tief); box-shadow: 0 2px 8px rgb(138 47 123 / 0.3); }
.knopf:disabled { opacity: 0.6; cursor: progress; }
.knopf.klein { padding: 12px 18px; font-size: 16px; border-radius: 12px; box-shadow: none; }

.zaehler { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--tinte-leise); font-size: 15px; }
.zaehler.voll { color: var(--fehler); }

.fehler { color: var(--fehler); font-weight: 600; margin-top: 12px; min-height: 1.5em; max-width: 46ch; }
.satz-form .fehler { max-width: min(46ch, calc(100% - 128px)); }
.fehler:empty { min-height: 0; margin: 0; }

.hinweis { margin-top: 18px; max-width: min(34ch, calc(100% - 128px)); color: var(--tinte-leise); font-size: 17px; }

/* Happs lugt vom Rand rein */
.happs {
  position: absolute;
  z-index: 0;
  right: -26px;
  bottom: 0;
  width: clamp(140px, 38vw, 200px);
  height: auto;
  transform: rotate(-10deg);
  transform-origin: 80% 90%;
  pointer-events: none;
  transition: transform 300ms var(--schnell);
}

/* Erfolg */
.geschafft { padding-top: 8px; max-width: 560px; }
.geschafft:focus { outline: none; }
.geschafft .geschafft-titel { font-size: clamp(2.2rem, 9vw, 4rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; margin-bottom: 14px; }
.geschafft > p { font-size: 18px; max-width: 40ch; }
.geschafft .warte-form { margin-top: 22px; }
/* Auf dem Handy steht Happs nach dem Abschicken unter dem Text, nicht daneben */
.buehne:has(.geschafft:not([hidden])) { padding-bottom: 200px; }

/* Die Lücken fliegen ins Maul */
.satz-form.frisst .satz { transform: translate(18vw, 10vh) scale(0.25); opacity: 0; transition: transform 420ms cubic-bezier(0.55, 0, 0.75, 0.2), opacity 380ms ease-in; }

/* Warteliste */
.warte-form label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.warte-zeile { display: flex; gap: 8px; flex-wrap: wrap; }
.warte-zeile input {
  flex: 1 1 200px; min-width: 0;
  border: 2px solid var(--linie); border-radius: 12px; padding: 11px 14px; background: #fff;
}
.warte-zeile input:focus { outline: none; border-color: var(--plum); }
.warte-meldung { margin-top: 8px; font-weight: 600; min-height: 1.5em; color: var(--tinte-leise); }
.warte-klein { font-size: 14px; color: var(--tinte-leise); margin-top: 6px; max-width: 44ch; }
.warte-meldung:empty { min-height: 0; margin: 0; }
.warte-meldung.fehler-text { color: var(--fehler); }

.link-knopf {
  background: none; border: 0; padding: 10px 0; font-weight: 700; color: var(--plum-tief);
  text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 2px;
}

/* Rangliste */
.liste-bereich, .ablauf { max-width: 1200px; margin: 0 auto; padding: 56px var(--rand) 24px; }
.liste-bereich h2, .ablauf h2 { font-size: clamp(1.8rem, 6vw, 2.6rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }

.liste { list-style: none; padding: 0; margin-top: 22px; max-width: 860px; }
.idee {
  display: grid; grid-template-columns: 76px 1fr; gap: 12px; align-items: start;
  padding: 20px 0; border-top: 2px solid var(--bauch-hell);
}
.stimme { display: flex; flex-direction: column; align-items: flex-start; padding-top: 4px; }
.stimme .zahl { font-size: 38px; font-weight: 800; color: var(--plum); letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.stimme .stimme-text { font-size: 12px; font-weight: 700; color: var(--tinte-leise); margin-top: 4px; }

.idee-aktionen { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin-top: 12px; }
.dafuer {
  display: inline-flex; align-items: center; gap: 8px;
  border: 2px solid var(--plum); border-radius: 12px; padding: 10px 16px;
  background: transparent; color: var(--plum-tief); font-weight: 800; font-size: 16px;
  transition: transform 120ms var(--schnell), background 120ms, color 120ms;
}
.dafuer .icon {
  width: 18px; height: 18px; background: currentColor;
  -webkit-mask: url("/assets/icons/arrow-fat-up.svg") center / contain no-repeat;
  mask: url("/assets/icons/arrow-fat-up.svg") center / contain no-repeat;
}
.dafuer:active { transform: scale(0.96); }
.dafuer[aria-pressed="true"] { background: var(--plum); color: #fff; cursor: default; }
.dafuer[aria-pressed="true"] .icon { -webkit-mask-image: url("/assets/icons/check.svg"); mask-image: url("/assets/icons/check.svg"); }
.stimme.hupf .zahl { animation: hupf 360ms var(--schnell); }
@keyframes hupf { 40% { transform: translateY(-8px) scale(1.12); } }

.idee-satz { font-size: clamp(1.3rem, 5.4vw, 1.9rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.idee-satz em { font-style: normal; color: var(--plum); }
.idee .warte-form { margin-top: 10px; }

.laden { display: grid; grid-template-columns: 76px 1fr; gap: 12px; padding: 20px 0; border-top: 2px solid var(--bauch-hell); }
.laden span { display: block; height: 34px; border-radius: 8px; background: var(--bauch-hell); }
.laden span + span { height: 56px; }

.leer { display: flex; gap: 18px; align-items: center; margin-top: 22px; max-width: 560px; }
.leer img { width: 96px; height: auto; flex: none; }
.leer p { font-size: 19px; font-weight: 600; }

.ablauf p { margin-top: 10px; font-size: 18px; max-width: 52ch; }

.fuss {
  display: flex; gap: 22px; max-width: 1200px; margin: 40px auto 0;
  padding: 24px var(--rand) calc(28px + env(safe-area-inset-bottom, 0px));
  border-top: 2px solid var(--bauch-hell);
}
.fuss a { color: var(--tinte-leise); font-weight: 600; padding: 8px 0; }

.turnstile { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 10; }

/* Breite Bildschirme: Happs größer und weiter im Bild */
@media (min-width: 900px) {
  .buehne, .buehne:has(.geschafft:not([hidden])) { min-height: calc(100svh - 64px); padding-bottom: 48px; }
  .hinweis { max-width: 34ch; }
  .satz-form .fehler { max-width: 46ch; }
  .happs { right: 2%; bottom: 40px; width: 380px; transform: rotate(-8deg); }
  .satz { font-size: clamp(4rem, 7vw, 6rem); }
}

@media (hover: hover) and (pointer: fine) {
  .knopf:hover { background: var(--plum-tief); }
  .dafuer:not([aria-pressed="true"]):hover { background: var(--bauch-hell); }
  .kanaele a:hover, .fuss a:hover { color: var(--plum-tief); }
  .link-knopf:hover { color: var(--tinte); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .satz-form.frisst .satz { transform: none; }
}
