/* Für Lesebrillen und die Dartkneipe: große Schrift, starker Kontrast, große Tasten, nichts springt. */
:root {
  --bg: #101318; --karte: #232a33; --linie: #4a5563; --text: #ffffff; --leise: #c2cad6;
  --gruen: #34d17f; --rot: #ff5a5f; --gelb: #ffc53d; --akzent: #e5484d;
  --taste: 72px;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 20px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
/* Ganze Höhe des Bildschirms, die Seite selbst scrollt nicht */
body { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom); }
button, a { font: inherit; color: inherit; }
button { background: var(--karte); border: 2px solid var(--linie); border-radius: 14px; padding: 12px 14px; cursor: pointer;
  touch-action: manipulation; user-select: none; }
button:active { transform: scale(.96); filter: brightness(1.3); }
button:disabled { opacity: .35; }
[hidden] { display: none !important; }

header { flex: none; display: flex; align-items: center; gap: 8px;
  padding: calc(6px + env(safe-area-inset-top)) 10px 6px; border-bottom: 2px solid var(--linie); }
.logo { background: none; border: 0; padding: 6px 0; font-size: 24px; font-weight: 600; }
.logo b { color: var(--akzent); }
.ampeln { margin-left: auto; display: flex; gap: 10px; align-items: center; background: none; border: 0; padding: 8px 6px; }
.ampel { display: inline-flex; align-items: center; gap: 4px; font-size: 18px; font-weight: 600; color: var(--leise); }
.ampel i { width: 22px; height: 22px; border-radius: 50%; background: var(--rot); box-shadow: 0 0 8px var(--rot); }
.ampel.gruen i { background: var(--gruen); box-shadow: 0 0 8px var(--gruen); }
.menu-knopf { background: none; border: 0; font-size: 34px; line-height: 1; padding: 4px 10px; }

/* ---------- Startseite ---------- */
.start { flex: 1; overflow-y: auto; width: 100%; max-width: 560px; margin: 0 auto; padding: 16px 14px;
  display: flex; flex-direction: column; gap: 14px; }
.kachel { flex: 1; max-height: 190px; min-height: 110px; display: flex; flex-direction: column; justify-content: center;
  align-items: flex-start; gap: 6px; text-align: left; padding: 16px 20px; border-width: 3px; }
.kachel b { font-size: 36px; }
.kachel small { font-size: 19px; color: var(--leise); }
.kachel.training { background: var(--akzent); border-color: var(--akzent); }
.kachel.training small { color: #fff; }
.zum-spiel { min-height: 84px; font-size: 28px; font-weight: 800; background: var(--gelb); border-color: var(--gelb); color: #111; }
.klein { color: var(--leise); font-size: 18px; margin: 0; }
.hinweis { color: var(--gelb); font-size: 20px; font-weight: 600; min-height: 1.3em; margin: 0; }

/* ---------- Unterseiten ---------- */
.seite { flex: 1; min-height: 0; width: 100%; max-width: 560px; margin: 0 auto; padding: 6px 12px 10px;
  display: flex; flex-direction: column; gap: 10px; }
.seite-kopf { flex: none; display: flex; align-items: center; gap: 10px; font-size: 28px; }
.zurueck { width: 64px; height: 60px; padding: 0; font-size: 40px; line-height: 1; flex: none; }
.seite-inhalt { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px; }
.seite-fuss { flex: none; display: flex; flex-direction: column; gap: 8px; }
.seite-inhalt h3 { margin: 12px 0 0; font-size: 24px; }
.seite-inhalt h3 small { color: var(--leise); font-weight: 400; font-size: 18px; }
.seite-inhalt .chip { cursor: default; }
.gruppe { display: flex; flex-direction: column; gap: 8px; }
.gruppe > label { color: var(--leise); font-size: 19px; }
.wahl { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.wahl button { min-height: 68px; font-size: 22px; font-weight: 700; position: relative; }
.wahl button small { display: block; font-size: 15px; font-weight: 400; color: var(--leise); }
.wahl button.an { background: var(--text); border-color: var(--text); color: #111; }
.wahl button.an small { color: #333; }
.stepper { display: grid; grid-template-columns: 90px 1fr 90px; gap: 8px; align-items: center; }
.stepper button { min-height: 68px; font-size: 36px; font-weight: 700; }
.stepper b { text-align: center; font-size: 40px; font-variant-numeric: tabular-nums; }
.wahl button .platz { position: absolute; top: 4px; right: 8px; font-size: 16px; font-weight: 800; color: var(--akzent); }
.neu { display: flex; gap: 8px; }
.neu input { flex: 1; min-width: 0; font: inherit; font-size: 24px; padding: 12px; border-radius: 14px; border: 2px solid var(--linie);
  background: var(--karte); color: var(--text); }
.neu input:focus { outline: none; border-color: var(--text); }
.neu button { font-weight: 700; }
.los { min-height: 92px; font-size: 32px; font-weight: 800; background: var(--akzent); border-color: var(--akzent); }
.liste { display: flex; flex-direction: column; gap: 8px; }
.liste > button, .liste > a { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left;
  text-decoration: none; min-height: 68px; font-size: 22px; background: var(--karte); border: 2px solid var(--linie);
  border-radius: 14px; padding: 10px 16px; }
.liste > button small, .liste > a small { color: var(--leise); font-size: 17px; text-align: right; }
.liste .gewonnen { color: var(--gruen); }
.tag { background: var(--karte); border: 2px solid var(--linie); border-radius: 14px; }
.tag summary { list-style: none; cursor: pointer; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.tag summary::-webkit-details-marker { display: none; }
.tag summary b { font-size: 24px; }
.tag summary b::before { content: "▸ "; color: var(--leise); }
.tag[open] summary b::before { content: "▾ "; }
.tag summary small { color: var(--leise); font-size: 18px; }
.tag .liste { padding: 0 8px 8px; }
.liste a[aria-disabled="true"] { color: var(--leise); pointer-events: none; }
.kacheln { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.wert { background: var(--karte); border: 2px solid var(--linie); border-radius: 14px; padding: 10px 12px; }
.wert b { display: block; font-size: 32px; font-variant-numeric: tabular-nums; }
.wert span { color: var(--leise); font-size: 17px; }
.loeschen { color: var(--rot); border-color: var(--rot); }

/* ---------- Spiel ---------- */
.spiel { flex: 1; min-height: 0; width: 100%; max-width: 560px; margin: 0 auto; padding: 6px 10px 8px;
  display: flex; flex-direction: column; gap: 8px; }
.oben, .unten { flex: none; display: flex; flex-direction: column; gap: 8px; }
.kopfzeile { display: flex; justify-content: space-between; gap: 8px; color: var(--leise); font-size: 30px; line-height: 1.15; }
.kopfzeile #spielerName { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rest { font-size: min(15vw, 7.5dvh, 75px); font-weight: 800; text-align: center; line-height: .95;
  font-variant-numeric: tabular-nums; }
.rest.fertig { color: var(--gruen); }
.checkout { text-align: center; min-height: 1.4em; color: var(--gelb); font-size: 26px; font-weight: 700; letter-spacing: 1px;
  background: none; border: 0; padding: 0; }
.checkout sup { font-size: 16px; color: var(--leise); margin-left: 4px; }
.leiste { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.leiste div { background: var(--karte); border: 2px solid var(--linie); border-radius: 12px; padding: 4px 6px; text-align: center; min-width: 0; }
.leiste div.an { border-color: var(--gelb); background: #33290d; }
.leiste span { display: block; font-size: 17px; color: var(--leise); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leiste b { font-size: 30px; font-variant-numeric: tabular-nums; }
.leiste small { display: block; font-size: 15px; color: var(--leise); }

.aufnahme { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dart { background: var(--karte); border: 2px solid var(--linie); border-radius: 14px; padding: 6px 2px; text-align: center;
  min-height: 86px; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.dart b { font-size: 36px; line-height: 1.05; }
.dart small { color: var(--leise); font-size: 16px; }
.dart.leer { color: var(--linie); border-style: dashed; cursor: pointer; }
.dart.zaehltnicht b { text-decoration: line-through; color: var(--leise); }
.dart.draht { border-color: var(--gelb); }
.dart.knapp { border-width: 3px; background: #33290d; }
.haken { color: var(--gruen); font-weight: 800; }

.meldung { height: 46px; display: flex; align-items: center; justify-content: center; border-radius: 12px;
  font-size: 24px; font-weight: 700; text-align: center; color: var(--leise); }
.meldung.ziehen { background: var(--gelb); color: #111; }
.meldung.bust { background: var(--rot); color: #fff; }
.meldung.fertig { background: var(--gruen); color: #111; }

/* Verlauf: der einzige Teil, der scrollt */
.verlauf { flex: 1; min-height: 70px; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 6px; border-top: 2px solid var(--linie); padding-top: 8px; }
.zeile { display: grid; grid-template-columns: 1.7em 1fr auto 2.6em; gap: 6px; align-items: center; font-size: 20px;
  padding: 6px 8px; border-radius: 12px; background: var(--karte); }
.zeile .nr { color: var(--leise); font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mehr .zeile { grid-template-columns: 3.6em 1fr auto 2.6em; }
.mehr .zeile .nr b { display: block; color: var(--text); font-size: 20px; line-height: 1.1; }
.mehr .zeile .nr small { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; }
.zeile .chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chip { padding: 6px 8px; border-radius: 10px; border: 2px solid var(--linie); background: var(--bg); font-size: 20px;
  font-weight: 600; min-height: 44px; }
.chip.zaehltnicht { text-decoration: line-through; color: var(--leise); }
.chip.knapp { border-color: var(--gelb); color: var(--gelb); }
.zeile .summe { text-align: right; font-weight: 700; font-size: 22px; min-width: 58px; min-height: 44px; padding: 4px 8px; }
.zeile .summe.bust { color: var(--rot); font-size: 18px; }
.zeile .summe.offen { border-color: var(--gruen); }
.zeile.gewaehlt { outline: 3px solid var(--gruen); }
div.summe { border: 2px solid transparent; display: flex; align-items: center; justify-content: flex-end; }
.zeile .rest-klein { text-align: right; color: var(--leise); }
.statistik { color: var(--leise); font-size: 17px; text-align: center; margin: 6px 0; }

.richtig { min-height: 156px; flex: none; background: #134d2c; border: 3px solid var(--gruen); color: #fff; font-size: 26px; font-weight: 700; }
.knoepfe { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.knoepfe button { min-height: 78px; padding: 4px; font-size: 20px; font-weight: 600; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 0; }
.knoepfe button span { font-size: 28px; line-height: 1; }
#weiter.wichtig { background: var(--gelb); color: #111; border-color: var(--gelb); }

/* ---------- Schichten (Eingabe, Menü) ---------- */
.schicht { position: fixed; inset: 0; z-index: 10; background: rgba(0,0,0,.7); display: flex; align-items: flex-end; justify-content: center; }
.feld, .menu { width: 100%; max-width: 560px; max-height: 100%; overflow-y: auto; background: var(--bg);
  border-top: 2px solid var(--linie); border-radius: 20px 20px 0 0; padding: 10px 10px calc(12px + env(safe-area-inset-bottom)); }
.feld { display: flex; flex-direction: column; gap: 8px; }
.feld-kopf { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 20px; color: var(--leise); }
.feld-kopf button { flex: none; width: 60px; height: 56px; font-size: 28px; padding: 0; }
.anzeige { height: 70px; display: flex; align-items: center; justify-content: center; border-radius: 14px;
  background: var(--karte); font-size: 44px; font-weight: 800; letter-spacing: 1px; }
.anzeige small { font-size: 22px; font-weight: 600; color: var(--leise); margin-left: 14px; }
.anzeige.ungueltig { color: var(--rot); }
.faktoren { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.faktoren button { min-height: 60px; font-size: 22px; font-weight: 700; }
.faktoren .an { background: var(--text); border-color: var(--text); color: #111; }
/* 5 Spalten: Vorschläge | 1 2 3 | Vorschläge – unten Miss | ⌫ 0 Bull | Kein Dart */
.tastatur { display: grid; grid-template-columns: 1.15fr 1fr 1fr 1fr 1.15fr; grid-auto-rows: var(--taste); gap: 7px; }
.tastatur button { padding: 0 2px; font-size: 32px; font-weight: 700; }
.tastatur .vorschlag { background: #1d3a5c; border-color: #4f8fd6; font-size: 25px; }
.tastatur .vorschlag.aktuell { background: #134d2c; border-color: var(--gruen); }
.tastatur .vorschlag:empty { visibility: hidden; }
.tastatur .sonder { font-size: 22px; }
.tastatur .kein { font-size: 18px; color: var(--rot); border-color: var(--rot); }
.ok { min-height: 76px; font-size: 30px; font-weight: 800; background: var(--gruen); border-color: var(--gruen); color: #111; }

.menu { display: flex; flex-direction: column; gap: 12px; }
.menu > button, .menu > a { display: block; text-align: left; text-decoration: none; background: var(--karte);
  border: 2px solid var(--linie); border-radius: 14px; padding: 18px; font-size: 22px; font-weight: 600; }
.menu a[aria-disabled="true"] { color: var(--leise); pointer-events: none; }
.menu .ende { color: var(--rot); border-color: var(--rot); }
.menu .zu { text-align: center; }
.kamera-liste { display: flex; flex-direction: column; gap: 8px; font-size: 20px; }
.kamera-liste div { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.kamera-liste i { flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--rot); align-self: center; }
.kamera-liste .gruen i { background: var(--gruen); }
.kamera-liste .gelb i { background: var(--gelb); }
.kamera-liste small { display: block; width: 100%; color: var(--leise); font-size: 15px; }
.kamera-liste .ueber { margin-top: 6px; color: var(--text); font-weight: 600; }
.kamera-liste .gesehen { min-height: 56px; font-size: 19px; border-color: var(--gelb); }
.kamera-liste .aus-info b { font-size: 21px; }
.pi-aus { flex: none; min-height: 56px; font-size: 20px; color: var(--leise); margin-top: 6px; }
.ampeln .warn { font-size: 28px; line-height: 1; color: var(--gelb); animation: warnen 1.2s ease-in-out infinite; }
@keyframes warnen { 50% { opacity: .35; } }
.kamera-liste span { color: var(--leise); font-size: 18px; }
.verbindung { position: fixed; left: 50%; top: 70px; transform: translateX(-50%); background: var(--rot); color: #fff;
  padding: 12px 18px; border-radius: 12px; font-size: 20px; font-weight: 700; z-index: 20; white-space: nowrap; }

.stat { width: 100%; border-collapse: collapse; font-size: 20px; }
.stat th, .stat td { padding: 9px 6px; border-bottom: 1px solid var(--linie); text-align: right; }
.stat th:first-child, .stat td:first-child { text-align: left; }
.stat thead th { color: var(--leise); font-weight: 600; font-size: 17px; }
.stat td { font-weight: 700; font-variant-numeric: tabular-nums; }
.stat td:first-child { font-weight: 400; }
.stat tr.leise td { color: var(--leise); }
.stat tr.quote td { color: var(--gruen); font-size: 24px; }
.stat small { display: block; font-size: 15px; font-weight: 400; color: var(--leise); }
.profil-knoepfe { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
