/* SIDEOUT – Aussehen. Dunkel, TVL-Blau als Akzent, Gelb für den Server, Orange für Fehler. */

@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url(/fonts/barlow-condensed-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url(/fonts/barlow-condensed-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url(/fonts/inter-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url(/fonts/inter-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url(/fonts/inter-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url(/fonts/inter-latin-700-normal.woff2) format("woff2"); }

:root {
  --grund: #0E1116;
  --tief: #07090C;
  --flaeche: #171C24;
  --flaeche2: #202835;
  --flaeche3: #131820;
  --rand: #2A313C;
  --rand2: #2C3544;
  --linie: #222832;
  --text: #F2F4F7;
  --text2: #C4CAD3;
  --leise: #9AA3AF;
  --leiser: #6B7482;
  --blau: #3B5DB6;            /* TVL-Blau (tvlunkhofen.ch) */
  --blau-hell: #8EA8EC;       /* Blau für Schrift auf Dunkel */
  --blau-rand: #9DB4F0;
  --blau-tief: #1A2440;
  --kill: #1F5FBF;
  --plus: #1B2A44;
  --plus-text: #CFE0FF;
  --gelb: #FFD23F;            /* Server */
  --orange: #B54708;          /* Fehler / Punkt Gegner */
  --orange-tief: #4A2A12;
  --orange-text: #FFB48A;
  --libero: #15283F;
  --libero-rand: #2D5A8C;
  --court: #161C26;
  --court-vorne: #1A2130;
  --courtlinie: #C9D1DC;
  --zahl: "Barlow Condensed", "Arial Narrow", sans-serif;
  --r: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--grund); }
body {
  margin: 0; min-height: 100dvh; background: var(--grund); color: var(--text);
  font: 15px/1.4 Inter, system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%; overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
button:disabled { cursor: default; opacity: 0.45; }
a { color: var(--blau-hell); text-decoration: none; }
a:hover { color: #B5C7F5; }
:focus-visible { outline: 3px solid var(--blau-hell); outline-offset: 2px; }
h1, h2, h3 { margin: 0; }
.zahl { font-family: var(--zahl); font-weight: 700; }
.leise { color: var(--leise); }
.leiser { color: var(--leiser); }
[hidden] { display: none !important; }

/* ---------- Seiten-Gerüst ---------- */

.seite {
  max-width: 1240px; margin: 0 auto; min-height: 100dvh;
  padding: max(20px, env(safe-area-inset-top)) max(28px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(28px, env(safe-area-inset-left));
  display: flex; flex-direction: column; gap: 20px;
}
.kopf { display: flex; align-items: center; gap: 16px; min-height: 52px; flex-wrap: wrap; }
.kopf .titel { font-family: var(--zahl); font-weight: 700; font-size: 32px; line-height: 1; }
.kopf .unter { font-size: 14px; color: var(--leise); }
.kopf .rechts { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.marke { font-family: var(--zahl); font-weight: 700; letter-spacing: 0.14em; color: var(--blau-hell); }
.etikett { font-size: 12px; color: var(--leise); letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500; }
.karte { background: var(--flaeche); border: 1px solid var(--rand); border-radius: 18px; padding: 20px; }
.karte.tief { background: var(--flaeche3); border-color: var(--linie); }
.zwei-spalten { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 860px) { .zwei-spalten { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Knöpfe ---------- */

.knopf {
  min-height: 48px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--rand); background: var(--flaeche);
  color: var(--text); font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.knopf.primaer { background: var(--blau); border-color: var(--blau); color: #fff; font-weight: 700; }
.knopf.primaer:disabled { background: #1E2A45; border-color: #1E2A45; color: #7F93C4; opacity: 1; }
.knopf.leer { background: transparent; color: var(--text2); }
.knopf.gestrichelt { background: transparent; border-style: dashed; color: var(--leise); font-size: 13px; }
.knopf.gefahr { background: transparent; border-color: #5A2A12; color: var(--orange-text); }
.knopf.gross { min-height: 60px; font-size: 17px; border-radius: 14px; }
.knopf.voll { width: 100%; }
.icon-knopf {
  width: 48px; height: 48px; border-radius: 12px; border: 1px solid var(--rand); background: var(--flaeche); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; flex: none; padding: 0;
}
.icon-knopf svg, .knopf svg { width: 22px; height: 22px; }
.link-knopf { background: none; border: 0; color: var(--blau-hell); padding: 8px 0; font-weight: 600; }

.segment { display: inline-flex; background: var(--flaeche); border: 1px solid var(--rand); border-radius: 14px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.segment button { min-height: 44px; padding: 0 18px; border-radius: 10px; border: 0; background: transparent; color: var(--leise); font-weight: 600; font-size: 15px; }
.segment button.an { background: var(--blau); color: #fff; font-weight: 700; }
.wahl { display: grid; gap: 8px; }
.wahl button { min-height: 50px; border-radius: 12px; border: 1px solid var(--rand); background: transparent; color: var(--text2); font-weight: 600; font-size: 15px; padding: 0 12px; }
.wahl button.an { background: var(--blau); border-color: var(--blau); color: #fff; font-weight: 700; }

/* ---------- Formulare ---------- */

.feld { display: flex; flex-direction: column; gap: 8px; }
.feld > label, .feld > .etikett { font-size: 12px; color: var(--leise); letter-spacing: 0.06em; text-transform: uppercase; }
.feld input, .feld select, input.eingabe {
  min-height: 50px; border-radius: 12px; border: 1px solid var(--rand); background: var(--grund); color: var(--text);
  font-size: 16px; padding: 0 14px; width: 100%;
}
.feld input:focus, .feld select:focus { border-color: var(--blau-hell); outline: none; }
/* iPad: Datum und Zeit sonst breiter als das Feld und mittig */
.feld input[type="date"], .feld input[type="time"] {
  -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; text-align: left; line-height: 48px;
}
.feld input::-webkit-date-and-time-value { text-align: left; margin: 0; }
.pw-feld { position: relative; }
.pw-feld input { padding-right: 52px; }
.pw-feld .auge { position: absolute; right: 4px; top: 4px; width: 44px; height: 42px; border: 0; background: none; color: var(--leise); }
.pw-feld .auge svg { width: 22px; height: 22px; }
.fehler { color: var(--orange-text); font-size: 14px; min-height: 1em; }
.tipp { font-size: 13px; color: var(--leise); margin: 0; }
.schalter { display: flex; align-items: center; justify-content: space-between; min-height: 48px; font-size: 15px; font-weight: 500; gap: 12px; }
.schalter input { appearance: none; width: 52px; height: 30px; border-radius: 999px; background: var(--rand); position: relative; flex: none; margin: 0; transition: background .15s; }
.schalter input::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 999px; background: var(--leise); transition: transform .15s, background .15s; }
.schalter input:checked { background: var(--blau); }
.schalter input:checked::after { transform: translateX(22px); background: #fff; }

/* ---------- Anmelden ---------- */

.anmeldung { max-width: 440px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: 40px 24px; }
.anmeldung .logo { width: 84px; height: 84px; }
.anmeldung h1 { font-family: var(--zahl); font-weight: 700; font-size: 48px; letter-spacing: 0.12em; color: var(--blau-hell); line-height: 1; }
.anmeldung form, .anmeldung .formular { display: flex; flex-direction: column; gap: 14px; }
.code-box { font-family: var(--zahl); font-size: 30px; letter-spacing: 0.08em; text-align: center; padding: 18px; border-radius: 14px; background: var(--flaeche); border: 1px dashed var(--blau-hell); user-select: all; -webkit-user-select: all; }
.haken { display: flex; gap: 10px; align-items: center; font-size: 15px; min-height: 44px; }
.haken input { width: 22px; height: 22px; accent-color: var(--blau); }

/* ---------- Start ---------- */

.start-raster { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .start-raster { grid-template-columns: minmax(0, 1fr); } }
.neues-match {
  height: 200px; width: 100%; border-radius: 22px; border: 0; background: var(--blau); color: #fff; text-align: left;
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; padding: 26px 28px;
}
.neues-match svg { width: 36px; height: 36px; }
.neues-match b { font-family: var(--zahl); font-weight: 700; font-size: 44px; line-height: 1; display: block; }
.neues-match span { font-size: 15px; font-weight: 500; }
.laufend-karte { display: flex; align-items: center; gap: 16px; padding: 18px 22px; border-radius: 16px; background: var(--blau-tief); border: 2px solid var(--blau-rand); color: var(--text); }
.spiel-zeile {
  display: flex; align-items: center; gap: 20px; padding: 16px 22px; border-radius: 16px; background: var(--flaeche);
  border: 1px solid var(--rand); color: var(--text); width: 100%; text-align: left;
}
.spiel-zeile .datum { width: 96px; display: flex; flex-direction: column; flex: none; }
.spiel-zeile .datum small { font-size: 13px; color: var(--leise); }
.spiel-zeile .datum b { font-size: 16px; font-weight: 600; }
.spiel-zeile .mitte { flex-grow: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.spiel-zeile .mitte b { font-size: 18px; font-weight: 600; }
.spiel-zeile .mitte small { font-size: 13px; color: var(--leise); }
.spiel-zeile .res { font-family: var(--zahl); font-weight: 700; font-size: 36px; }
.badge { padding: 6px 10px; border-radius: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; flex: none; }
.badge.sieg { background: #16325C; color: var(--plus-text); }
.badge.niederlage { background: var(--orange-tief); color: #FFD9BF; }
.badge.offen { background: #3A3420; color: #FFE7A0; }
.liste-leer { padding: 18px 22px; border-radius: 16px; border: 1px dashed var(--rand); color: var(--leiser); font-size: 14px; }
.link-karte { display: flex; align-items: center; gap: 16px; padding: 20px; border-radius: 18px; background: var(--flaeche); border: 1px solid var(--rand); color: var(--text); }
.link-karte svg { width: 28px; height: 28px; flex: none; }
.link-karte b { font-size: 17px; font-weight: 600; display: block; }
.link-karte small { font-size: 13px; color: var(--leise); }
.bilanz { font-family: var(--zahl); font-weight: 700; font-size: 56px; line-height: 1; }

.sync-pille { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border-radius: 999px; background: var(--flaeche); border: 1px solid var(--rand); font-size: 12px; color: var(--leise); }
.sync-pille i { width: 8px; height: 8px; border-radius: 999px; background: #4CAF7A; display: inline-block; }
.sync-pille.wartet i { background: var(--gelb); }
.sync-pille.offline i { background: var(--leiser); }
.sync-pille.fehler i { background: var(--orange); }

/* ---------- Kader ---------- */

.kader { display: flex; gap: 24px; align-items: flex-start; }
@media (max-width: 900px) { .kader { flex-direction: column; } .kader > * { width: 100% !important; } }
.tabelle-box { flex-grow: 1; background: var(--flaeche3); border: 1px solid var(--linie); border-radius: 18px; overflow: hidden; min-width: 0; }
.kader-zeile {
  display: grid; grid-template-columns: 70px minmax(0, 1fr) 150px 70px; align-items: center; padding: 0 20px; min-height: 52px; width: 100%;
  border: 0; border-bottom: 1px solid #1C222C; background: transparent; color: var(--text); text-align: left;
}
.kader-zeile.kopfzeile { min-height: 40px; font-size: 11px; font-weight: 600; letter-spacing: 0.1em; color: var(--leise); }
.kader-zeile.an { background: var(--flaeche2); box-shadow: inset 4px 0 0 var(--blau-hell); }
.kader-zeile.inaktiv { color: var(--leiser); }
.kader-zeile .nr { font-family: var(--zahl); font-weight: 700; font-size: 26px; }
.kader-zeile .name { font-size: 16px; font-weight: 600; }
.kader-zeile small { font-size: 12px; color: var(--leise); }
.pos { justify-self: start; padding: 5px 10px; border-radius: 8px; font-size: 12px; font-weight: 700; background: var(--flaeche2); color: var(--leise); }
.pos.Zuspiel { background: #2B2140; color: #D9C8FF; }
.pos.Aussen { background: #16325C; color: var(--plus-text); }
.pos.Mitte { background: #103B33; color: #B8F0DF; }
.pos.Diagonal { background: var(--orange-tief); color: #FFD9BF; }
.pos.Libero { background: #3D3510; color: #FFE9A3; }
.bearbeiten { width: 380px; flex: none; display: flex; flex-direction: column; gap: 18px; }
.bearbeiten .gross-nr { width: 72px; height: 72px; border-radius: 16px; background: var(--blau); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--zahl); font-weight: 700; font-size: 40px; flex: none; }

/* ---------- Match anlegen ---------- */

.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--rand); background: transparent; color: var(--text2); font-size: 13px; }
.spieler-wahl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.spieler-knopf {
  min-height: 60px; border-radius: 12px; display: flex; align-items: center; gap: 10px; padding: 0 12px; text-align: left;
  border: 2px solid var(--rand2); background: var(--flaeche2); color: var(--text);
}
.spieler-knopf .nr { font-family: var(--zahl); font-weight: 700; font-size: 24px; min-width: 30px; }
.spieler-knopf b { font-size: 15px; font-weight: 600; display: block; }
.spieler-knopf small { font-size: 11px; opacity: 0.7; }
.spieler-knopf.an { border-color: var(--blau-rand); background: var(--blau); color: #fff; }
.spieler-knopf.aus { border: 1px dashed var(--rand); background: transparent; color: var(--leiser); }
.spieler-knopf.dabei { border-color: var(--blau-hell); }

/* ---------- Live ---------- */

.live { height: 100dvh; max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; overflow: hidden;
  padding: max(14px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  --c: min(540px, calc(100dvh - 292px));
}
.live-kopf { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.live-kopf .marke { font-size: 20px; }
.stand { flex-grow: 1; display: flex; justify-content: center; align-items: center; gap: 16px; }
.stand .team { font-size: 12px; color: var(--leise); letter-spacing: 0.08em; text-transform: uppercase; }
.stand .team small { display: block; font-size: 11px; letter-spacing: 0; text-transform: none; }
.stand .team .srv { color: var(--gelb); }
.stand .punkte { font-family: var(--zahl); font-weight: 700; font-size: 64px; line-height: 1; min-width: 70px; text-align: center; }
.stand .punkte.geg { color: var(--text2); }
.stand .doppel { font-family: var(--zahl); font-size: 40px; color: #5B6472; }
.schritte { display: flex; gap: 8px; }
.schritt { flex: 1 1 0; height: 44px; border-radius: 12px; display: flex; align-items: center; gap: 8px; padding: 0 14px; font-size: 14px; font-weight: 600; border: 1px solid var(--linie); color: var(--leiser); min-width: 0; }
.schritt .n { font-family: var(--zahl); font-size: 15px; font-weight: 600; opacity: 0.7; }
.schritt .w { margin-left: auto; font-family: var(--zahl); font-size: 18px; font-weight: 700; }
.schritt.fertig { background: #1B222C; border-color: #1B222C; color: var(--text); }
.schritt.jetzt { background: var(--blau); border-color: var(--blau); color: #fff; }
.live-haupt { flex-grow: 1; display: flex; gap: 20px; min-height: 0; }
.court-spalte { width: var(--c); flex: none; display: flex; flex-direction: column; gap: 6px; }
.netz { height: 18px; margin: 0 -12px; background: repeating-linear-gradient(90deg, var(--courtlinie) 0 8px, var(--grund) 8px 16px); display: flex; align-items: center; justify-content: center; }
.netz span { background: var(--grund); color: var(--courtlinie); font-size: 11px; font-weight: 700; letter-spacing: 0.16em; padding: 0 10px; }
.court { position: relative; width: var(--c); height: var(--c); border: 3px solid var(--courtlinie); border-top-width: 4px; background: var(--court); }
.court .vorne { position: absolute; left: 0; top: 0; width: 100%; height: 33.333%; background: var(--court-vorne); }
.court .linie3 { position: absolute; left: -12px; right: -12px; top: 33.333%; height: 3px; background: var(--courtlinie); }
.court .m3 { position: absolute; right: 8px; top: calc(33.333% + 9px); font-size: 10px; font-weight: 700; letter-spacing: 0.14em; color: #7D8693; }
.kachel {
  position: absolute; width: 28%; height: 24.7%; border-radius: 14px; display: flex; flex-direction: column; align-items: flex-start;
  justify-content: space-between; padding: 8px 10px; text-align: left; border: 2px solid var(--rand2); background: var(--flaeche2); color: var(--text);
}
.kachel .oben { display: flex; justify-content: space-between; align-items: center; width: 100%; font-size: 11px; opacity: 0.8; gap: 4px; white-space: nowrap; overflow: hidden; }
.kachel .nr { font-family: var(--zahl); font-weight: 700; font-size: calc(var(--c) * 0.085); line-height: 0.9; }
.kachel .name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.kachel.p4 { left: 2.6%; top: 4.1%; } .kachel.p3 { left: 36%; top: 4.1%; } .kachel.p2 { left: 69.3%; top: 4.1%; }
.kachel.p5 { left: 2.6%; top: 56%; } .kachel.p6 { left: 36%; top: 60%; } .kachel.p1 { left: 69.3%; top: 56%; }
.kachel.libero { background: var(--libero); border-color: var(--libero-rand); }
.kachel.server { border-color: var(--gelb); }
.kachel.gedimmt { background: var(--court); color: #8A93A0; border-color: #252C38; }
.kachel.an { background: var(--blau); border-color: var(--blau-rand); color: #fff; opacity: 1; }
.kachel.leer { background: transparent; border: 2px dashed var(--blau-hell); color: var(--blau-hell); }
.kachel .ball { width: 20px; height: 20px; color: var(--gelb); flex: none; }
.court-info { font-size: 11px; color: #7D8693; display: flex; justify-content: space-between; }
.bank { width: 132px; flex: none; display: flex; flex-direction: column; gap: 8px; padding-top: 24px; overflow-y: auto; }
.bank button { min-height: 52px; border-radius: 12px; border: 1px solid var(--rand); background: transparent; color: var(--text2); display: flex; align-items: center; gap: 8px; padding: 0 12px; text-align: left; flex: none; }
.bank button.an { background: var(--blau); border-color: var(--blau-rand); color: #fff; }
.bank .nr { font-family: var(--zahl); font-weight: 700; font-size: 22px; min-width: 24px; }
.bank b { font-size: 13px; font-weight: 600; display: block; }
.bank small { font-size: 10px; opacity: 0.7; }
.wertung-spalte { flex-grow: 1; display: flex; flex-direction: column; gap: 10px; padding-top: 24px; min-width: 0; }
.wertung {
  flex-grow: 1; min-height: 64px; border-radius: 16px; display: flex; align-items: center; gap: 12px; padding: 0 16px; text-align: left; border: 0;
}
.wertung .sym { font-family: var(--zahl); font-weight: 700; font-size: 42px; width: 46px; text-align: center; flex: none; }
.wertung b { font-size: 17px; font-weight: 600; display: block; }
.wertung small { font-size: 12px; opacity: 0.8; }
.wertung.w-raute { background: var(--kill); color: #fff; }
.wertung.w-plus { background: var(--plus); color: var(--plus-text); }
.wertung.w-null { background: #1B222C; color: var(--text); }
.wertung.w-minus { background: var(--orange); color: #fff; }
.wertung.w-block { background: var(--orange-tief); color: #FFD9BF; }
.wertung:disabled { opacity: 0.35; }
.ueberspringen { min-height: 46px; border-radius: 12px; border: 1px dashed var(--rand); background: transparent; color: var(--leise); font-size: 14px; font-weight: 600; flex: none; }
.live-fuss { min-height: 50px; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--linie); padding-top: 10px; }
.live-fuss .verlauf { display: flex; gap: 8px; overflow: hidden; flex-wrap: nowrap; min-width: 0; flex: 1 1 auto; }
.pille { padding: 8px 12px; border-radius: 999px; background: var(--flaeche); font-size: 13px; white-space: nowrap; }
.pille.offen { background: transparent; border: 1px dashed var(--blau-hell); color: var(--blau-hell); }
.punkt-knopf { min-height: 48px; padding: 0 18px; border-radius: 12px; border: 0; color: #fff; font-size: 15px; font-weight: 700; flex: none; }
.punkt-knopf.wir { background: var(--kill); }
.punkt-knopf.geg { background: var(--orange); }
.quer-hinweis { display: none; }
@media (orientation: portrait) and (max-width: 1000px) {
  .live .live-haupt, .live .schritte, .live .live-fuss { display: none; }
  .quer-hinweis { display: flex; flex-grow: 1; align-items: center; justify-content: center; flex-direction: column; gap: 12px; text-align: center; color: var(--leise); }
  .quer-hinweis svg { width: 64px; height: 64px; color: var(--blau-hell); }
}

/* ---------- Dialoge und Sheets ---------- */

.dialog-hintergrund { position: fixed; inset: 0; background: rgba(7, 9, 12, 0.78); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; }
.dialog-hintergrund.sheet { align-items: flex-end; padding: 0; }
.dialog {
  width: min(940px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; background: var(--flaeche); border: 1px solid var(--rand); border-radius: 24px;
  padding: 26px; display: flex; flex-direction: column; gap: 20px;
}
.sheet .dialog { width: 100%; max-width: 1240px; border-radius: 24px 24px 0 0; border-bottom: 0; padding-bottom: max(24px, env(safe-area-inset-bottom)); max-height: 86dvh; }
.dialog.schmal { width: min(520px, 100%); }
.dialog-kopf { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.dialog-kopf h2 { font-family: var(--zahl); font-weight: 700; font-size: 30px; }
.dialog-kopf .rechts { margin-left: auto; display: flex; gap: 8px; }
.tag-wir { padding: 8px 14px; border-radius: 10px; background: var(--kill); color: #fff; font-size: 15px; font-weight: 700; }
.tag-geg { padding: 8px 14px; border-radius: 10px; background: var(--orange); color: #fff; font-size: 15px; font-weight: 700; }
.grund-raster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.grund-raster > div { display: flex; flex-direction: column; gap: 10px; }
.grund {
  min-height: 56px; border-radius: 14px; border: 1px solid var(--rand); background: var(--flaeche2); color: var(--text);
  display: flex; align-items: center; justify-content: space-between; padding: 0 18px; font-size: 16px; font-weight: 600; gap: 10px; text-align: left;
}
.grund small { font-size: 12px; color: var(--leise); font-weight: 500; }
.grund.gross { min-height: 72px; border: 2px solid var(--orange); background: #2A170A; }
.grund.gross b { font-family: var(--zahl); font-weight: 700; font-size: 30px; }
.grund.gross small { color: #FFD9BF; }
.grund.block { min-height: 64px; }
.grund.block.an { border: 2px solid var(--blau-rand); background: var(--blau-tief); }
.blocker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.blocker button { min-height: 88px; border-radius: 14px; border: 2px solid var(--rand2); background: var(--flaeche2); color: var(--text); display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 10px 12px; text-align: left; }
.blocker button small { font-size: 11px; opacity: 0.75; }
.blocker button b { font-family: var(--zahl); font-weight: 700; font-size: 30px; line-height: 1; }
.blocker button.an { background: var(--blau); border-color: var(--blau-rand); color: #fff; }
.wer { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--grund); flex-wrap: wrap; }
.wer button { min-height: 46px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--rand); background: transparent; color: var(--text2); font-size: 13px; font-weight: 600; }
.wer button.an { background: var(--blau); border-color: var(--blau-rand); color: #fff; }
.wechsel-raster { display: grid; grid-template-columns: minmax(0, 1fr) 60px minmax(0, 1fr); gap: 16px; align-items: start; }
.wechsel-raster .pfeil { align-self: center; color: var(--blau-hell); display: flex; justify-content: center; }
.wechsel-raster .pfeil svg { width: 36px; height: 36px; }
.raus { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.raus button { min-height: 100px; border-radius: 12px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 8px 10px; text-align: left; border: 2px solid var(--rand2); background: var(--flaeche2); color: var(--text); }
.raus button.an { background: var(--blau); border-color: var(--blau-rand); color: #fff; }
.raus button b { font-family: var(--zahl); font-weight: 700; font-size: 32px; line-height: 1; }
.raus button small { font-size: 11px; opacity: 0.75; }
.rein { display: flex; flex-direction: column; gap: 10px; }
.libero-zeile { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 14px; border: 1px solid var(--libero-rand); background: #111D2E; flex-wrap: wrap; }
.libero-zeile .lib { min-height: 48px; padding: 0 14px; border-radius: 10px; display: flex; align-items: center; font-size: 15px; font-weight: 600; border: 1px dashed var(--libero-rand); color: var(--leise); background: transparent; }
.libero-zeile .lib.an { background: var(--libero); border: 2px solid var(--libero-rand); color: var(--text); }
.zusammenfassung { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 14px; background: var(--grund); flex-wrap: wrap; }
.menu-liste { display: flex; flex-direction: column; gap: 10px; }
.zaehler { display: flex; align-items: center; gap: 14px; }
.zaehler button { width: 56px; height: 56px; border-radius: 14px; border: 1px solid var(--rand); background: var(--flaeche2); color: var(--text); font-size: 26px; font-weight: 700; }
.zaehler b { font-family: var(--zahl); font-weight: 700; font-size: 56px; min-width: 70px; text-align: center; }

/* ---------- Aufstellung ---------- */

.aufstellung { display: flex; gap: 56px; flex-grow: 1; min-height: 0; --c: min(540px, calc(100dvh - 190px)); }
.aufstellung .rechts { flex-grow: 1; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.hinweis-offen { padding: 16px; border-radius: 16px; background: var(--flaeche); border: 2px dashed var(--blau-hell); display: flex; align-items: center; gap: 12px; }
.hinweis-offen b { font-family: var(--zahl); font-weight: 700; font-size: 26px; color: var(--blau-hell); }
@media (max-width: 1000px) and (orientation: portrait) { .aufstellung { flex-direction: column; gap: 24px; --c: min(540px, calc(100vw - 80px)); } }

/* ---------- Satzende ---------- */

.satzende { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 40px; }
.satzende .gross-stand { display: flex; align-items: center; gap: 28px; }
.satzende .gross-stand .zahl { font-size: 140px; line-height: 1; }
.satzende .gross-stand .zahl.geg { color: var(--leise); }
.satzende .titel-klein { font-size: 14px; color: var(--blau-hell); letter-spacing: 0.16em; font-weight: 700; text-transform: uppercase; }
.satzende .titel-klein.verloren { color: var(--orange-text); }
.saetze-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.saetze-chips span { padding: 6px 12px; border-radius: 8px; background: var(--flaeche); font-size: 14px; }
.saetze-chips span.an { background: var(--blau); color: #fff; font-weight: 700; }
.kpi-reihe { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; width: 100%; max-width: 980px; }
.kpi { padding: 16px 18px; border-radius: 16px; background: var(--flaeche); border: 1px solid var(--rand); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi .etikett { font-size: 11px; }
.kpi b { font-family: var(--zahl); font-weight: 700; font-size: 40px; line-height: 1.05; }
.kpi small { font-size: 12px; color: var(--leiser); }
.knopf-reihe { display: flex; gap: 12px; width: 100%; max-width: 980px; flex-wrap: wrap; }
.knopf-reihe > :first-child { flex-grow: 1; }

/* ---------- Auswertung ---------- */

.kpi-raster { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.kpi-raster .kpi { padding: 12px 14px; border-radius: 14px; }
.kpi-raster .kpi b { font-size: 34px; }
@media (max-width: 1000px) { .kpi-raster { grid-template-columns: repeat(3, minmax(0, 1fr)); } .kpi-reihe { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.auswertung { display: flex; gap: 16px; align-items: flex-start; }
@media (max-width: 1000px) { .auswertung { flex-direction: column; } .auswertung > aside { width: 100% !important; } }
.stat-tabelle { width: 100%; border-collapse: collapse; font-size: 14px; }
.stat-tabelle th { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; color: var(--leise); text-align: right; padding: 10px 8px; border-bottom: 1px solid var(--linie); white-space: nowrap; }
.stat-tabelle td { text-align: right; padding: 0 8px; height: 44px; border-bottom: 1px solid #1A2028; white-space: nowrap; }
.stat-tabelle th:first-child, .stat-tabelle td:first-child { text-align: left; padding-left: 16px; }
.stat-tabelle td:last-child, .stat-tabelle th:last-child { padding-right: 16px; }
.stat-tabelle .nr { font-family: var(--zahl); font-weight: 700; font-size: 18px; color: var(--leise); display: inline-block; min-width: 26px; }
.stat-tabelle .f { color: var(--orange-text); }
.stat-tabelle .p { font-family: var(--zahl); font-weight: 700; font-size: 20px; color: var(--blau-hell); }
.stat-tabelle tr.summe td { font-weight: 700; border-top: 1px solid var(--rand); }
.scroll-x { overflow-x: auto; }
.balken-zeile { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.balken-zeile .n { width: 24px; color: var(--leise); }
.balken { flex-grow: 1; height: 14px; border-radius: 4px; background: var(--linie); overflow: hidden; display: flex; }
.balken span { display: block; height: 100%; background: var(--kill); }
.balken span.tief { background: #FF8A3D; }
.balken-zeile .v { width: 70px; text-align: right; font-weight: 600; }
.verteilung { display: flex; height: 26px; border-radius: 6px; overflow: hidden; gap: 2px; }
.legende { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; font-size: 12px; color: var(--text2); }
.legende i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- Saison ---------- */

.saison { display: flex; gap: 16px; align-items: stretch; flex-grow: 1; }
@media (max-width: 1000px) { .saison { flex-direction: column; } .saison > section:first-child { width: 100% !important; } }
.saison-liste { width: 300px; flex: none; display: flex; flex-direction: column; gap: 4px; background: var(--flaeche3); border: 1px solid var(--linie); border-radius: 16px; padding: 12px; }
.saison-liste button { min-height: 52px; border-radius: 10px; display: flex; align-items: center; gap: 10px; padding: 0 12px; text-align: left; width: 100%; border: 0; background: transparent; color: var(--text2); }
.saison-liste button.an { background: var(--flaeche2); color: var(--text); box-shadow: inset 4px 0 0 var(--blau-hell); }
.saison-liste .nr { font-family: var(--zahl); font-weight: 700; font-size: 20px; min-width: 26px; }
.saison-liste .name { flex-grow: 1; font-size: 15px; font-weight: 600; }
.saison-liste .p { font-family: var(--zahl); font-weight: 700; font-size: 20px; }
.diagramm { width: 100%; height: 260px; }
.diagramm text { font: 11px Inter, sans-serif; fill: var(--leiser); }

/* ---------- Mehr ---------- */

.mehr-raster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
@media (max-width: 860px) { .mehr-raster { grid-template-columns: minmax(0, 1fr); } }
.mehr-raster .karte { display: flex; flex-direction: column; gap: 14px; }
.zeile { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 10px 0; border-bottom: 1px solid var(--linie); }
.zeile:last-child { border-bottom: 0; }
.schritte-liste { padding-left: 22px; display: flex; flex-direction: column; gap: 10px; margin: 0; }
.text-seite { max-width: 760px; }
.text-seite h2 { font-size: 18px; margin-top: 18px; }
.text-seite p { color: var(--text2); }

/* ---------- Teilen-Vorschau ---------- */

.teilen-raster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.teilen-karte { border-radius: 18px; border: 2px solid var(--rand); background: var(--flaeche2); color: var(--text); padding: 18px; display: flex; flex-direction: column; gap: 14px; text-align: left; }
.teilen-karte.an { border-color: var(--blau-rand); background: var(--blau-tief); }
.teilen-karte .vorschau { height: 220px; border-radius: 12px; background: var(--grund); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.teilen-karte .vorschau img { max-width: 100%; max-height: 100%; border-radius: 6px; }
.teilen-karte .haken-box { width: 26px; height: 26px; border-radius: 7px; border: 2px solid var(--rand); display: flex; align-items: center; justify-content: center; flex: none; }
.teilen-karte.an .haken-box { background: var(--blau); border-color: var(--blau); }
.teilen-karte .haken-box svg { width: 16px; height: 16px; }

/* ---------- Meldungen ---------- */

#toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 80;
  background: #F2F4F7; color: #0E1116; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.4);
  display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 40px);
}
#toast button { border: 0; background: none; color: var(--blau); font-weight: 700; padding: 6px 4px; }
.update { position: fixed; z-index: 90; }
.update.gross { top: 0; left: 0; right: 0; background: var(--blau); color: #fff; display: flex; justify-content: center; gap: 16px; align-items: center; padding: max(10px, env(safe-area-inset-top)) 16px 10px; font-weight: 600; }
.update.gross button { border: 0; background: #fff; color: var(--blau); border-radius: 8px; padding: 8px 14px; font-weight: 700; }
.update.klein { right: 20px; bottom: max(20px, env(safe-area-inset-bottom)); background: var(--flaeche); border: 1px solid var(--rand); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; width: 320px; }
.update.klein strong { display: block; }
.update.klein span { color: var(--leise); font-size: 13px; }
.update.klein .knopfreihe { display: flex; gap: 8px; }

/* ---------- Drucken (PDF für den Trainer) ---------- */

.druck { display: none; }
@media print {
  @page { size: A4 landscape; margin: 12mm; }
  html, body { background: #fff !important; color: #000; }
  body > *:not(.druck) { display: none !important; }
  .druck { display: block; color: #000; font: 10pt Inter, sans-serif; }
  .druck h1 { font-family: var(--zahl); font-size: 22pt; }
  .druck .unter { color: #444; margin-bottom: 8pt; }
  .druck table { width: 100%; border-collapse: collapse; margin: 8pt 0; }
  .druck th, .druck td { border-bottom: 0.5pt solid #bbb; padding: 3pt 4pt; text-align: right; }
  .druck th:first-child, .druck td:first-child { text-align: left; }
  .druck th { font-size: 8pt; color: #333; }
  .druck .kpis { display: flex; gap: 14pt; flex-wrap: wrap; margin: 6pt 0 10pt; }
  .druck .kpis div { border: 0.5pt solid #bbb; border-radius: 4pt; padding: 4pt 8pt; }
  .druck .kpis b { display: block; font-size: 14pt; }
  .druck h2 { font-size: 12pt; margin-top: 10pt; }
}
