/* Wartenummer · ein Stylesheet für alle Seiten.
   Hell und ruhig, grosse Zahlen, hoher Kontrast. Keine Effekte, Bewegung nur bei einem Wechsel.
   Die Akzentfarbe kommt vom Kunden (/kunde.css), Laki-Blau ist der Standard. */

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --akzent: #1f4e8c;
  --akzent-text: #ffffff;
  --akzent-dunkel: #1f4e8c;
  --akzent-hell: #e9eef4;
  --hg: #f3f4f6;
  --flaeche: #ffffff;
  --text: #111827;
  --leise: #4b5563;
  --rand: #d1d5db;
  --linie: #e5e7eb;
  --dran: #14532d;
  --dran-flaeche: #166534;
  --dran-hg: #dcfce7;
  --bald: #78350f;
  --bald-rand: #b45309;
  --bald-hg: #fef3c7;
  --warn: #991b1b;
  --warn-hg: #fee2e2;
  --radius: 14px;
  --schatten: 0 1px 2px rgba(17, 24, 39, .06);
  --fortschritt: 0;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--hg);
  color: var(--text);
  font: 18px/1.45 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-feature-settings: "tnum" 1;
}
main { max-width: 560px; margin: 0 auto; padding: 0 16px 32px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 10px; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 12px; }
a { color: var(--akzent-dunkel); }
button, input, select, textarea { font: inherit; color: inherit; }
.versteckt { display: none !important; }
.leise { color: var(--leise); }
.zentriert { text-align: center; }
.abstand { height: 12px; }

/* ---------- Kopf: Logo, Betrieb, Standort, Sprachen ---------- */
.kopf {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0; margin-bottom: 12px; border-bottom: 1px solid var(--linie);
}
.kopf .logo { width: 44px; height: 44px; object-fit: contain; flex-shrink: 0; }
.kopf-text { flex: 1; min-width: 0; }
.standort { font-size: 1.3rem; font-weight: 750; line-height: 1.2; overflow-wrap: anywhere; }
.unterzeile { color: var(--leise); font-size: .95rem; }
.sprachen { display: flex; gap: 4px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.sprachen button {
  border: 1px solid var(--rand); background: var(--flaeche); color: var(--text);
  border-radius: 8px; padding: 4px 8px; min-height: 40px; min-width: 40px; font-size: .9rem; font-weight: 650; cursor: pointer;
}
.sprachen button[aria-pressed="true"] { border-color: var(--akzent); background: var(--akzent); color: var(--akzent-text); }

.demo-band {
  background: var(--akzent-hell); color: var(--akzent-dunkel); border-bottom: 1px solid var(--rand);
  text-align: center; font-size: .9rem; font-weight: 650; padding: 6px 12px;
}

/* ---------- Flächen ---------- */
.karte {
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius);
  padding: 18px; margin-bottom: 14px; box-shadow: var(--schatten);
}
.etikett { font-size: .9rem; font-weight: 650; color: var(--leise); text-transform: uppercase; letter-spacing: .04em; }
.riesig.leer, .meine.leer { color: var(--rand); }
.riesig { font-size: clamp(4.5rem, 24vw, 7.5rem); font-weight: 800; line-height: 1; margin: 4px 0 8px; letter-spacing: -.02em; }
.gross { font-size: 2.4rem; font-weight: 800; line-height: 1.1; }
.mittel { font-size: 1.5rem; font-weight: 750; }

/* Kurzer Wechsel, wenn eine neue Nummer dran ist (erklärt: «es hat sich etwas geändert») */
.neu { animation: wechsel .35s ease-out; }
@keyframes wechsel { from { opacity: .2; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chips span {
  min-width: 3.2em; padding: 6px 10px; border-radius: 10px; text-align: center;
  background: var(--hg); border: 1px solid var(--rand); font-size: 1.4rem; font-weight: 750;
}
.chips span.ich { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); }

/* ---------- Meldungen ---------- */
.meldung {
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; font-size: 1.1rem; font-weight: 650;
  border: 2px solid var(--rand); background: var(--flaeche);
}
.meldung.info { font-weight: 550; }
.meldung.bald { background: var(--bald-hg); color: var(--bald); border-color: var(--bald-rand); }
.meldung.warn { background: var(--warn-hg); color: var(--warn); border-color: var(--warn); }
.meldung.ok { background: var(--dran-hg); color: var(--dran); border-color: var(--dran-flaeche); }
.meldung p:last-child { margin-bottom: 0; }

/* «Sie sind dran»: deutlich, aber sachlich (eine grüne Fläche, kein Vollbild) */
.dran-feld {
  background: var(--dran-flaeche); color: #fff; border-radius: var(--radius);
  padding: 18px; margin-bottom: 14px; text-align: center;
}
.dran-feld .dran-titel { font-size: 1.6rem; font-weight: 800; }
.dran-feld .dran-nummer { font-size: 4.5rem; font-weight: 800; line-height: 1; margin: 6px 0; }
.dran-feld p { margin: 0; font-size: 1.1rem; }

/* ---------- Knöpfe und Eingaben ---------- */
.knopf {
  display: block; width: 100%; min-height: 56px; border: 2px solid var(--akzent); border-radius: 12px;
  background: var(--akzent); color: var(--akzent-text); font-size: 1.15rem; font-weight: 700; padding: 12px 16px;
  cursor: pointer; text-align: center; text-decoration: none;
}
.knopf:disabled { opacity: .45; cursor: not-allowed; }
.knopf.zweit { background: var(--flaeche); color: var(--text); border-color: var(--rand); }
.knopf.klein { min-height: 48px; font-size: 1rem; padding: 10px 12px; }
.knopf.gefahr { background: var(--flaeche); color: var(--warn); border-color: var(--warn); }
.knopf.link { background: none; border: 0; color: var(--leise); text-decoration: underline; min-height: 44px; font-weight: 550; }
.knopf + .knopf { margin-top: 10px; }
.reihe { display: flex; gap: 10px; }
.reihe > * { flex: 1; min-width: 0; }
.reihe > .knopf + .knopf { margin-top: 0; }

label { display: block; font-weight: 650; margin-bottom: 6px; }
input[type="number"], input[type="password"], input[type="time"], input[type="text"], select, textarea {
  width: 100%; min-height: 52px; border: 2px solid var(--rand); border-radius: 12px;
  padding: 10px 14px; font-size: 1.2rem; background: #fff; color: var(--text);
}
input#nummer, input#setzen-nummer, input#pruefen-nummer { font-size: 1.8rem; font-weight: 700; }
textarea { font-size: 1rem; min-height: 0; resize: vertical; margin-bottom: 12px; }
select { font-size: 1rem; }
:focus-visible { outline: 3px solid #b45309; outline-offset: 2px; }
.fehler { color: var(--warn); font-weight: 650; margin-top: 8px; }
.schalter { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 550; }
.schalter input { width: 24px; height: 24px; flex-shrink: 0; accent-color: var(--akzent); }

details > summary {
  cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; list-style: none;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: "+"; margin-left: auto; font-size: 1.4rem; color: var(--leise); }
details[open] > summary::after { content: "–"; }
hr { border: 0; border-top: 1px solid var(--linie); margin: 16px 0; }

.status-zeile { color: var(--leise); font-size: .9rem; text-align: center; margin: 8px 0; }
.live { display: inline-flex; align-items: center; gap: 6px; }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dran-flaeche); }
.live.aus::before { background: var(--warn); }

footer { color: var(--leise); font-size: .85rem; text-align: center; margin-top: 24px; }
footer a { color: var(--leise); }

/* ---------- Seite für Wartende ---------- */
.mein-kopf { display: flex; align-items: center; gap: 18px; }
.ring { position: relative; width: 156px; height: 156px; flex-shrink: 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring .bahn { stroke: var(--linie); }
.ring .wert {
  stroke: var(--akzent); stroke-linecap: round;
  stroke-dasharray: 553; stroke-dashoffset: calc(553 * (1 - var(--fortschritt)));
  transition: stroke-dashoffset .6s ease;
}
.ring-innen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-innen .etikett { font-size: .72rem; }
.meine { font-size: 3.4rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.mein-text { flex: 1; min-width: 0; }
.vor { font-size: 1.25rem; font-weight: 700; margin-bottom: 6px; }
.pruefcode { margin-top: 10px; font-size: .95rem; color: var(--leise); }
.pruefcode b { display: inline-block; font-size: 1.3rem; letter-spacing: .18em; color: var(--text); background: var(--hg); border: 1px solid var(--rand); border-radius: 8px; padding: 2px 8px; margin-left: 4px; }

.kacheln { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.kachel { background: var(--hg); border-radius: 12px; padding: 10px 12px; }
.kachel span { display: block; color: var(--leise); font-size: .85rem; font-weight: 600; }
.kachel b { font-size: 1.35rem; font-weight: 750; }

body.zustand-bald #mein-block { border-color: var(--bald-rand); border-width: 2px; }
body.zustand-dran #mein-block { border-color: var(--dran-flaeche); border-width: 2px; }
body.zustand-dran .ring .wert { stroke: var(--dran-flaeche); }

/* Punktreihe von der aktuellen bis zur eigenen Nummer */
.strecke { display: flex; align-items: center; gap: 6px; margin: 14px 0 22px; padding: 0 4px; }
.strecke span { position: relative; flex: 1; height: 8px; border-radius: 4px; background: var(--linie); }
.strecke span.jetzt { background: var(--text); }
.strecke span.ich { background: var(--akzent); }
.strecke span.luecke { flex: .6; background: none; border-top: 2px dotted var(--rand); height: 0; border-radius: 0; }
.strecke span[data-n]::after {
  content: attr(data-n); position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  font-size: .8rem; font-weight: 700; color: var(--leise);
}
.strecke span.ich[data-n]::after { color: var(--akzent-dunkel); }

.ziehen { text-align: center; }
.ziehen .knopf { min-height: 72px; font-size: 1.4rem; }

/* ---------- Admin ---------- */
.admin main { max-width: 720px; padding-bottom: 210px; }
.status-raster { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; align-items: start; }
.kennzahlen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.kennzahl { background: var(--flaeche); border: 1px solid var(--rand); border-radius: 12px; padding: 10px; text-align: center; }
.kennzahl b { display: block; font-size: 1.5rem; }
.kennzahl span { color: var(--leise); font-size: .85rem; }

/* Bedienung unten: mit dem Daumen erreichbar */
.bedienleiste {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  background: var(--flaeche); border-top: 1px solid var(--rand);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 8px rgba(17, 24, 39, .06);
}
.bedienleiste > div { max-width: 688px; margin: 0 auto; }
.bedienleiste .reihe { margin-top: 10px; }
.bedienleiste .knopf.klein { font-size: .95rem; padding: 8px 6px; }
.schieber {
  position: relative; height: 84px; border-radius: 14px; background: var(--akzent); color: var(--akzent-text);
  touch-action: none; user-select: none; -webkit-user-select: none; overflow: hidden;
}
.schieber.gesperrt { opacity: .45; }
.schieber-text {
  position: absolute; inset: 0; padding-left: 96px; padding-right: 12px; display: flex; flex-direction: column;
  justify-content: center; font-size: 1.4rem; font-weight: 800; line-height: 1.15; pointer-events: none;
}
.schieber-text small { font-size: .95rem; font-weight: 600; opacity: .9; }
.schieber-knopf {
  position: absolute; left: 6px; top: 6px; width: 72px; height: 72px; border: 0; border-radius: 10px;
  background: #fff; color: var(--akzent-dunkel); font-size: 2rem; font-weight: 800; cursor: grab; touch-action: none;
  transition: transform .2s ease;
}
.schieber-knopf.zieht { transition: none; cursor: grabbing; }
.schieber-knopf:disabled { cursor: not-allowed; }

.protokoll { list-style: none; padding: 0; margin: 0; font-size: .95rem; }
.protokoll li { padding: 6px 0; border-bottom: 1px solid var(--linie); display: flex; gap: 10px; }
.protokoll time { color: var(--leise); min-width: 4.2em; }
.zahlwahl { display: flex; align-items: center; gap: 10px; }
.zahlwahl button { width: 52px; min-height: 52px; font-size: 1.6rem; font-weight: 700; border-radius: 12px; border: 2px solid var(--rand); background: #fff; cursor: pointer; }
.zahlwahl output { font-size: 1.8rem; font-weight: 800; min-width: 2.5em; text-align: center; }
.gezogen-nummer { font-size: 5rem; font-weight: 800; line-height: 1; margin: 6px 0; }
.qr { width: 100%; max-width: 300px; height: auto; display: block; margin: 8px auto; image-rendering: pixelated; }
.qr.abgelaufen { opacity: .12; }
.geheim { font-family: ui-monospace, Menlo, monospace; font-size: 1rem; word-break: break-all; background: var(--hg); border-radius: 8px; padding: 8px 10px; }
a.knopf.download { margin-top: 8px; }
.status-text { font-weight: 650; }
details label { margin-top: 10px; }

/* ---------- Bildschirm am Eingang (aus Distanz lesbar) ---------- */
body.anzeige { background: var(--hg); overflow: hidden; }
.anzeige-raster { display: grid; grid-template-columns: 1.5fr 1fr; gap: 3vw; height: 100vh; padding: 3vw; }
.anzeige-kopf { display: flex; align-items: center; gap: 1.5vw; margin-bottom: 2vw; }
.anzeige-kopf img { height: 5vw; width: auto; }
.anzeige-standort { font-size: 3vw; font-weight: 800; }
.anzeige .etikett { font-size: 2vw; text-transform: none; letter-spacing: 0; }
.anzeige .riesig { font-size: 20vw; margin: 0 0 2vw; }
.anzeige .chips span { font-size: 4vw; padding: .5vw 1.5vw; border-radius: 1vw; }
.anzeige .qr-feld { background: var(--flaeche); border: 1px solid var(--rand); border-radius: 2vw; padding: 2vw; text-align: center; align-self: center; }
.anzeige .qr-feld img { width: 100%; height: auto; display: block; }
.anzeige .qr-feld p { font-size: 1.7vw; font-weight: 700; margin: 1vw 0 0; }
.anzeige .qr-feld p.leise { font-size: 1.3vw; font-weight: 550; }
.anzeige .meldung { font-size: 2.4vw; }
.anzeige .status-zeile { font-size: 1.1vw; text-align: left; }
@media (max-width: 800px) {
  body.anzeige { overflow: auto; }
  .anzeige-raster { grid-template-columns: 1fr; height: auto; padding: 16px; }
  .anzeige-kopf img { height: 40px; }
  .anzeige-standort { font-size: 1.4rem; }
  .anzeige .etikett { font-size: 1rem; }
  .anzeige .riesig { font-size: 30vw; }
  .anzeige .chips span { font-size: 1.6rem; }
  .anzeige .qr-feld p, .anzeige .meldung { font-size: 1.1rem; }
  .anzeige .qr-feld p.leise { font-size: .95rem; }
  .anzeige .status-zeile { font-size: .9rem; }
}

@media (max-width: 480px) {
  .kopf { flex-wrap: wrap; }
  .kopf .sprachen { order: -1; width: 100%; justify-content: flex-end; }
}

@media (max-width: 380px) {
  .mein-kopf { flex-direction: column; text-align: center; }
  .status-raster { grid-template-columns: 1fr; }
}

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

@media print {
  .bedienleiste, .sprachen, footer { display: none; }
  body { background: #fff; }
}
.abstand-oben { margin-top: 12px; }
