@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  font-stretch: 75% 100%;
  src: url("/fonts/bricolage-grotesque-latin-standard-normal.woff2") format("woff2-variations");
}

:root {
  --papier: #ffffff;
  --tinte: #000000;
  --grau: #6e6e73;
  --linie: #e8e8ea;
  --flaeche: #f4f4f5;
  --blau: #2b3bff;
  --bernstein: #e8a200;
  --bernstein-flaeche: #fff5db;
  --rot: #d70015;
  --rand-x: 24px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: "Bricolage Grotesque", system-ui, -apple-system, sans-serif;
  font-optical-sizing: auto;
  font-size: 17px;
  line-height: 1.5;
  color: var(--tinte);
  background: var(--papier);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button, input, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--blau); outline-offset: 3px; }

.icon { width: 24px; height: 24px; flex: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  background: var(--tinte);
  color: var(--papier);
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .1s ease, opacity .15s ease;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .35; }
.btn-voll { width: 100%; }
.btn-zweit { background: var(--flaeche); color: var(--tinte); }
.btn-klein { min-height: 44px; padding: 0 18px; font-size: 15px; }

.btn-text {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--tinte);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--linie);
  text-underline-offset: 5px;
  text-decoration-thickness: 2px;
}
.btn-text.rot { color: var(--rot); }

.btn-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--flaeche);
  color: var(--tinte);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .1s ease;
}
.btn-chip:active { transform: scale(.97); }
.btn-chip.rot { background: #fdecee; color: var(--rot); }

.seite {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(20px + var(--safe-top)) var(--rand-x) calc(20px + var(--safe-bottom));
}
.seite-kopf { display: flex; align-items: baseline; justify-content: space-between; min-height: 44px; }
.kontext { margin: 0; font-size: 15px; font-weight: 500; color: var(--grau); }
.seite-inhalt { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 32px 0; }
.seite-fuss { display: grid; gap: 12px; }
.seite-inhalt.oben { justify-content: flex-start; padding-top: 20px; }
.uhr { font-variant-numeric: tabular-nums; }

.quest {
  margin: 0;
  font-size: clamp(34px, 10.5vw, 64px);
  font-weight: 700;
  font-stretch: 88%;
  line-height: 1.02;
  letter-spacing: -.035em;
  hyphens: manual;
  overflow-wrap: break-word;
  text-wrap: balance;
}
.quest.neu { animation: auftauchen .45s cubic-bezier(.2, .7, .2, 1); }
@keyframes auftauchen {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* Sidequest erledigt */
.quest.erledigt {
  opacity: .45;
  text-decoration: line-through;
  text-decoration-color: #12b84a;
  text-decoration-thickness: .08em;
  transition: opacity .6s ease;
}
.btn.erledigt, .btn.erledigt:disabled {
  background: #12b84a;
  border-color: #12b84a;
  color: #fff;
  opacity: 1;
  animation: knopf-poppen .5s cubic-bezier(.2, 1.6, .4, 1);
}
@keyframes knopf-poppen {
  0% { transform: scale(.9); }
  100% { transform: scale(1); }
}

.fertig {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
}
.fertig.an {
  display: flex;
  background: rgba(18, 184, 74, .92);
  animation: fertig-ein 1.9s ease forwards;
}
@keyframes fertig-ein {
  0% { opacity: 0; }
  10% { opacity: 1; }
  75% { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}
.fertig-haken { width: 150px; height: 150px; overflow: visible; }
.fertig-ring, .fertig-strich {
  fill: none;
  stroke: #fff;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.fertig.an .fertig-ring { animation: zeichnen .5s ease-out .1s forwards; }
.fertig.an .fertig-strich { animation: zeichnen .35s ease-out .5s forwards; }
@keyframes zeichnen { to { stroke-dashoffset: 0; } }
.fertig.an .fertig-haken { animation: haken-pop .5s cubic-bezier(.2, 1.6, .4, 1) .75s both; }
@keyframes haken-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.18); }
  100% { transform: scale(1); }
}
.fertig-text {
  margin: 0;
  color: #fff;
  font-size: clamp(56px, 20vw, 110px);
  font-weight: 800;
  letter-spacing: -.03em;
  opacity: 0;
}
.fertig.an .fertig-text { animation: done-slam .55s cubic-bezier(.2, 1.6, .4, 1) .65s forwards; }
@keyframes done-slam {
  0% { opacity: 0; transform: scale(2.4) rotate(-6deg); }
  100% { opacity: 1; transform: scale(1) rotate(-3deg); }
}
.fertig-burst {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  margin-top: -40px;
}
.fertig-burst span {
  position: absolute;
  width: 12px;
  height: 12px;
  margin: -6px;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
}
.fertig-burst span:nth-child(3n) { background: #ffe14d; }
.fertig-burst span:nth-child(3n+1) { border-radius: 3px; }
.fertig.an .fertig-burst span { animation: funke .9s cubic-bezier(.1, .7, .3, 1) .7s forwards; }
@keyframes funke {
  0% { opacity: 1; transform: rotate(var(--winkel)) translateX(0) scale(1); }
  100% { opacity: 0; transform: rotate(var(--winkel)) translateX(var(--weite)) scale(.3); }
}

.titel {
  margin: 0;
  font-size: clamp(34px, 10vw, 56px);
  font-weight: 700;
  font-stretch: 88%;
  line-height: 1.02;
  letter-spacing: -.035em;
}
.untertitel { margin: 12px 0 0; color: var(--grau); }

textarea {
  width: 100%;
  min-height: 34vh;
  margin-top: 28px;
  padding: 18px;
  border: 0;
  border-radius: 20px;
  background: var(--flaeche);
  font-size: 22px;
  line-height: 1.35;
  letter-spacing: -.01em;
  resize: none;
}
textarea::placeholder, input::placeholder { color: #a1a1a6; }
textarea:focus, input:focus { outline: 2px solid var(--tinte); outline-offset: 0; }

input[type="password"], input[type="search"], input[type="text"], input[type="time"] {
  width: 100%;
  min-height: 56px;
  padding: 0 18px;
  border: 0;
  border-radius: 16px;
  background: var(--flaeche);
  font-size: 17px;
  -webkit-appearance: none;
  appearance: none;
  min-width: 0;
}

.zaehler { margin-top: 10px; font-size: 13px; color: var(--grau); text-align: right; font-variant-numeric: tabular-nums; }
.meldung { margin: 10px 0 0; min-height: 1.5em; font-size: 15px; color: var(--rot); }

.haken {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  margin-bottom: 28px;
  border-radius: 50%;
  background: var(--tinte);
  color: var(--papier);
}

[hidden] { display: none !important; }

.login-form { display: grid; gap: 12px; margin-top: 32px; }

.admin { padding-bottom: calc(84px + var(--safe-bottom)); }

.admin-kopf {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + var(--safe-top)) var(--rand-x) 12px;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.admin-kopf h1 { margin: 0; font-size: 30px; font-weight: 700; font-stretch: 88%; letter-spacing: -.03em; line-height: 1.1; }
.admin-kopf form { margin: 0; }

.admin-inhalt { max-width: 760px; margin: 0 auto; padding: 8px var(--rand-x) 24px; }

.abschnitt { display: grid; gap: 0; }
.abschnitt h2 { margin: 36px 0 4px; font-size: 22px; font-weight: 650; letter-spacing: -.02em; }

.neu-form { display: grid; gap: 10px; padding: 8px 0 20px; }
.neu-form textarea { min-height: 96px; margin: 0; font-size: 17px; border-radius: 16px; }

.anzahl { margin: 8px 0 0; font-size: 15px; color: var(--grau); }

.liste { list-style: none; margin: 0; padding: 0; }

.eintrag { padding: 18px 0 16px; border-bottom: 1px solid var(--linie); }
.eintrag:last-child { border-bottom: 0; }
.eintrag-text { margin: 0; font-size: 17px; white-space: pre-wrap; overflow-wrap: break-word; }
.eintrag-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; font-size: 13px; color: var(--grau); }
.eintrag-aktionen { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.eintrag textarea { min-height: 96px; margin: 0; font-size: 17px; border-radius: 16px; }
#sprueche-liste { counter-reset: nummer; }
#sprueche-liste .eintrag { counter-increment: nummer; }
#sprueche-liste .eintrag::before { content: "Nr. " counter(nummer); display: block; margin-bottom: 4px; font-size: 13px; font-weight: 600; color: var(--grau); }
.eintrag.duplikat { padding-left: 14px; box-shadow: inset 3px 0 0 var(--bernstein); }

.markierung {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--bernstein-flaeche);
  color: #7a5200;
  font-weight: 600;
}

.zahlen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 12px 0 8px; }
.zahlen strong { display: block; font-size: 34px; font-weight: 700; font-stretch: 88%; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.zahlen span { font-size: 13px; line-height: 1.3; color: var(--grau); }

.gruppe { border-bottom: 1px solid var(--linie); }
.gruppe summary {
  display: grid;
  grid-template-columns: 48px 1fr 24px;
  align-items: baseline;
  gap: 8px;
  min-height: 56px;
  padding: 14px 0;
  list-style: none;
  cursor: pointer;
}
.gruppe summary::-webkit-details-marker { display: none; }
.gruppe-zahl { font-size: 22px; font-weight: 700; color: var(--bernstein); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.gruppe summary .eintrag-text { font-weight: 600; }
.gruppe summary::after { content: "+"; font-size: 22px; line-height: 1; color: var(--grau); text-align: right; }
.gruppe[open] summary::after { content: "–"; }
.gruppe ul { list-style: none; margin: 0 0 16px 56px; padding: 0; }
.gruppe li { padding: 4px 0; color: var(--grau); overflow-wrap: break-word; }

.filter { display: grid; gap: 4px; padding: 8px 0 4px; }
.schalter { display: flex; align-items: center; gap: 12px; min-height: 48px; font-size: 16px; cursor: pointer; }
.schalter input { width: 22px; height: 22px; margin: 0; accent-color: var(--tinte); }

.leer { margin: 0; padding: 40px 0; color: var(--grau); }

.qr-raster { display: grid; gap: 8px; }
.qr-block { padding: 20px 0 28px; border-bottom: 1px solid var(--linie); }
.qr-block:last-child { border-bottom: 0; }
.qr-block h2 { margin: 0; }
.qr-block img { display: block; width: 100%; max-width: 280px; aspect-ratio: 1; margin: 16px 0 8px -10px; }
.qr-block .url { margin: 0 0 16px; font-size: 14px; color: var(--grau); overflow-wrap: anywhere; }
.qr-block .aktionen { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }

.ablauf { list-style: none; margin: 28px 0 0; padding: 0; }
.ablauf-kopf { padding: 36px 0 6px; border-bottom: 1px solid var(--tinte); }
.ablauf-kopf:first-child { padding-top: 0; }
.ablauf-kopf h2, .ablauf-kopf .ablauf-titel {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  font-stretch: 88%;
  letter-spacing: -.03em;
  line-height: 1.1;
}
.ablauf-punkt { padding: 14px 0; border-bottom: 1px solid var(--linie); }
.ablauf-zeile {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 14px;
  align-items: baseline;
}
.ablauf-zeit { font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.ablauf-titel { font-size: 19px; font-weight: 500; line-height: 1.3; overflow-wrap: break-word; }
.ablauf-unter { list-style: none; margin: 8px 0 0; padding: 0 0 0 74px; }
.ablauf-unter .ablauf-zeile { grid-template-columns: 48px 1fr; gap: 10px; padding: 3px 0; }
.ablauf-unter .ablauf-zeit { font-size: 15px; font-weight: 500; color: var(--grau); }
.ablauf-unter .ablauf-titel { font-size: 16px; font-weight: 400; }
.ablauf-ort { margin: 8px 0 0; padding-left: 74px; }
.ablauf-ort-name { margin: 0 0 8px; font-size: 15px; color: var(--grau); overflow-wrap: anywhere; }
.ablauf-karten { display: flex; flex-wrap: wrap; gap: 8px; }
.ablauf-karten .btn-chip { text-decoration: none; }
.ablauf-ort-hinweis { font-size: 14px; font-weight: 400; color: var(--grau); }
.ablauf .vorbei, .ablauf .vorbei .ablauf-zeit { color: #a1a1a6; }
.ablauf-punkt.jetzt > .ablauf-zeile .ablauf-titel { font-weight: 650; }
.jetzt-marke {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--tinte);
  color: var(--papier);
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
  vertical-align: 2px;
}

button.ablauf-zeile {
  width: 100%;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.ablauf-kopf > button.ablauf-zeile { display: block; }
.ablauf-admin .offen > .ablauf-zeile .ablauf-titel { text-decoration: underline; text-decoration-color: var(--linie); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.ablauf-admin .ablauf-unter { margin-top: 2px; }
.ablauf-admin .ablauf-unter > li { padding: 0; }
.ablauf-admin .eintrag-aktionen { margin: 6px 0 4px; }
.ordnen { display: flex; gap: 8px; margin-left: auto; }
.rund-klein {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--flaeche);
  cursor: pointer;
}
.rund-klein .icon { width: 20px; height: 20px; }
.rund-klein:disabled { opacity: .35; cursor: default; }

.ablauf-form { display: grid; gap: 10px; padding: 8px 0 12px; }
.ablauf-felder { display: grid; grid-template-columns: 112px 1fr; gap: 10px; }
.ablauf-felder.ohne-zeit { grid-template-columns: 1fr; }
.ablauf-felder.ohne-zeit input[type="time"] { display: none; }
.ablauf-form .knoepfe { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border-radius: 999px;
  background: var(--flaeche);
}
.segment label { position: relative; }
.segment input { position: absolute; opacity: 0; pointer-events: none; }
.segment span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  color: var(--grau);
  cursor: pointer;
}
.segment input:checked + span { background: var(--papier); color: var(--tinte); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.segment input:focus-visible + span { outline: 2px solid var(--blau); outline-offset: 2px; }

.oeffentlich { padding: 16px 0 0; }
.hinweis { margin: 4px 0 8px; font-size: 15px; color: var(--grau); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; overflow-wrap: anywhere; }
pre.code { margin: 0; white-space: pre-wrap; line-height: 1.55; }
.token-box { display: grid; gap: 12px; margin: 4px 0 12px; padding: 18px; border-radius: 20px; background: var(--flaeche); }
.token-box p { margin: 0; font-size: 15px; font-weight: 600; }
.token-box .code { font-size: 15px; }
.token-box .btn { justify-self: start; }
.api-hilfe { margin-top: 20px; border-top: 1px solid var(--linie); }
.api-hilfe summary { min-height: 56px; display: flex; align-items: center; font-weight: 600; cursor: pointer; }
.api-hilfe pre { padding: 16px; border-radius: 16px; background: var(--flaeche); }

.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding-bottom: var(--safe-bottom);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--linie);
}
.tabs button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 64px;
  border: 0;
  background: none;
  font-size: 12px;
  font-weight: 600;
  color: #a1a1a6;
  cursor: pointer;
}
.tabs button[aria-selected="true"] { color: var(--tinte); }
.tabs button[aria-selected="true"]::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 30%;
  right: 30%;
  height: 2px;
  background: var(--tinte);
}
.tabs .zahl {
  position: absolute;
  top: 9px;
  left: calc(50% + 8px);
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--bernstein);
  color: var(--papier);
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + var(--safe-bottom));
  z-index: 20;
  max-width: calc(100% - 48px);
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--tinte);
  color: var(--papier);
  font-size: 15px;
  transform: translateX(-50%);
}

@media (min-width: 700px) {
  :root { --rand-x: 40px; }
  .seite { max-width: 680px; margin: 0 auto; }
  .seite-fuss { justify-items: start; }
  .seite-fuss .btn-voll { width: auto; min-width: 280px; }
  .qr-raster { grid-template-columns: 1fr 1fr; gap: 40px; }
  .qr-block { border-bottom: 0; }
  .neu-form { grid-template-columns: 1fr auto; align-items: end; }
}

@media (min-width: 960px) {
  .tabs {
    left: 50%;
    right: auto;
    bottom: 20px;
    width: 500px;
    border: 1px solid var(--linie);
    border-radius: 999px;
    transform: translateX(-50%);
    overflow: hidden;
  }
  .tabs button { min-height: 58px; }
  .qr-raster { grid-template-columns: repeat(3, 1fr); }
  .tabs button[aria-selected="true"]::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .fertig.an { display: none; }
}
