/* WIS Hallenanzeige – 16:9, ohne Scrollleisten, aus der Entfernung lesbar (Full HD und 4K).
   Maße in vw/vh, damit 1920×1080 und 3840×2160 gleich aussehen. Branding: Österreichische Bundesliga / ÖSB. */
:root {
    --bg: #0b1f14; --bg-karte: #112b1c; --bg-karte2: #0e2417; --linie: rgba(255,255,255,.14);
    --text: #f4f7f5; --muted: #a9b8af; --gruen: #1f9d55; --gruen-hell: #37c46f; --gelb: #f5c531; --rot: #d8342c; --blau: #2a6fb0; --grau: #9aa3ab;
    --sieg: #2f8f4e; --live: #e5352b;
    --kopf-h: 7.2vh; --fuss-h: 3.6vh;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
body.anzeige { display: grid; grid-template-rows: var(--kopf-h) minmax(0, 1fr) var(--fuss-h); height: 100vh; }

/* ---------- Kopf ---------- */
.kopf { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 1.2vw; border-bottom: 1px solid var(--linie); background: #0a1a11; }
.kopf-marke { display: flex; align-items: center; gap: 0.8vw; min-width: 0; }
.kopf-logo { height: 5.6vh; width: 5.6vh; object-fit: contain; background: #fff; border-radius: 0.6vh; }
.kopf-logo.rund { border-radius: 50%; }
.kopf-titel .t1 { font-size: 2.4vh; font-weight: 800; letter-spacing: .02em; white-space: nowrap; }
.kopf-titel .t2 { font-size: 1.7vh; color: var(--muted); white-space: nowrap; }
.kopf-mitte { font-size: 2vh; color: var(--muted); text-align: center; white-space: nowrap; }
body.demo .kopf-mitte { color: var(--gelb); font-weight: 800; }
.kopf-rechts { display: flex; align-items: center; justify-content: flex-end; gap: 1vw; }
.uhr { font-size: 4.2vh; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .03em; }
.verbindung { display: flex; flex-direction: column; align-items: flex-end; gap: 0.3vh; font-size: 1.6vh; color: var(--muted); }
.verbindung .punkt { display: inline-block; width: 1.2vh; height: 1.2vh; border-radius: 50%; background: var(--grau); margin-right: 0.4vw; vertical-align: middle; }
.verbindung .punkt.ok { background: var(--gruen-hell); }
.verbindung .punkt.warn { background: var(--gelb); }
.verbindung .punkt.aus { background: var(--rot); }

/* ---------- Begegnungen ---------- */
.begegnungen { display: grid; gap: 0.6vh; padding: 0.6vh 0.8vw; min-height: 0; }
body[data-modus="8"] .begegnungen { grid-template-columns: 1fr; }
body[data-modus="16"] .begegnungen { grid-template-columns: 1fr 1fr; gap: 0.6vw; }
.begegnung { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto minmax(0, 1fr); gap: 0.4vh; min-height: 0; border: 1px solid var(--linie); border-radius: 1vh; padding: 0.5vh 0.6vw; background: rgba(255,255,255,.02); }
.begegnung.freilos { grid-template-rows: auto auto minmax(0, 1fr) auto; }
.beg-kopf { display: flex; align-items: center; justify-content: space-between; gap: 1vw; font-size: 1.9vh; color: var(--muted); white-space: nowrap; overflow: hidden; }
.beg-kopf .beg-liga { font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.beg-kopf .beg-abschnitt { font-weight: 800; padding: 0.2vh 0.8vw; border-radius: 2vh; background: rgba(255,255,255,.08); color: var(--text); text-transform: uppercase; letter-spacing: .06em; font-size: 1.7vh; }
.beg-kopf .beg-abschnitt.stechen { background: var(--gelb); color: #1c2530; }
.beg-kopf .beg-abschnitt.probe { background: var(--blau); }
.beg-kopf .beg-status { display: inline-flex; align-items: center; gap: 0.4vw; }
.beg-kopf .beg-status .live-dot { width: 1.2vh; height: 1.2vh; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 0 rgba(229,53,43,.6); animation: puls 1.6s infinite; }
@keyframes puls { 0% { box-shadow: 0 0 0 0 rgba(229,53,43,.6); } 70% { box-shadow: 0 0 0 1vh rgba(229,53,43,0); } 100% { box-shadow: 0 0 0 0 rgba(229,53,43,0); } }

/* Mannschaftsleiste mit Punktestand */
.team { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; gap: 0.8vw; padding: 0.5vh 0.8vw; border-radius: 0.8vh; background: rgba(255,255,255,.06); font-size: 2.6vh; font-weight: 800; }
.team.sieger { background: rgba(47,143,78,.35); box-shadow: inset 0 0 0 2px var(--sieg); }
.team .team-logo { height: 4.4vh; width: 4.4vh; object-fit: contain; background: #fff; border-radius: 0.6vh; }
.team .team-logo.leer { visibility: hidden; }
.team .team-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team .team-seite { font-size: 1.6vh; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-right: 0.3vw; }
.team .wert { display: flex; flex-direction: column; align-items: center; min-width: 5.5vw; line-height: 1.05; }
.team .wert b { font-size: 3.4vh; font-variant-numeric: tabular-nums; }
.team .wert span { font-size: 1.4vh; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.team .wert.mp b { color: var(--gelb); }
.team.freilos-leer { font-size: 2vh; color: var(--muted); font-weight: 600; grid-template-columns: 1fr; text-align: center; }

/* Schützenkarten – 8 Scheiben: Scheibe links, Werte rechts (breite Karten); 16 Scheiben: Scheibe oben, Werte darunter (hohe, schmale Karten) */
.reihe { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5vw; min-height: 0; }
.karte { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 0.3vh; min-height: 0; padding: 0.4vh 0.5vw; border-radius: 0.9vh; background: var(--bg-karte); border: 1px solid var(--linie); position: relative; }
.karte.ohne-daten { opacity: .75; }
.karte.hervor { animation: blitz 1.2s ease-out; }
@keyframes blitz { 0% { box-shadow: 0 0 0 0.4vh var(--gruen-hell); } 100% { box-shadow: 0 0 0 0 transparent; } }
.karte-kopf { display: flex; align-items: baseline; gap: 0.5vw; min-width: 0; }
.karte-kopf .stand { flex: 0 0 auto; font-size: 1.9vh; font-weight: 800; padding: 0.1vh 0.6vw; border-radius: 0.6vh; background: rgba(255,255,255,.12); font-variant-numeric: tabular-nums; white-space: nowrap; }
.karte-kopf .name { flex: 1 1 auto; min-width: 0; font-size: 2.4vh; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.karte-kopf .pos { flex: 0 0 auto; font-size: 1.6vh; color: var(--muted); white-space: nowrap; }
.karte-mitte { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.5vw; min-height: 0; min-width: 0; align-items: stretch; }
.scheibe-wrap { display: flex; align-items: center; justify-content: center; min-height: 0; min-width: 0; }
.scheibe { width: 100%; height: 100%; display: block; }
.scheibe text { font-family: inherit; }
.karte-werte { display: flex; flex-direction: column; justify-content: center; align-items: stretch; gap: 0.5vh; min-width: 8vw; }
.letzter { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0.4vh 0.6vw; border-radius: 0.8vh; background: rgba(255,255,255,.08); }
.letzter b { font-size: 5.2vh; line-height: 1; font-variant-numeric: tabular-nums; }
.letzter.zehn b { color: #ff6b63; }
.letzter.neun b { color: var(--gelb); }
.letzter.rest b { color: #7fb3e8; }
.letzter span { font-size: 1.4vh; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-top: 0.3vh; }
.letzter.hervor { animation: blitz 1.2s ease-out; }
.laufend { font-size: 1.7vh; color: var(--muted); text-align: center; white-space: nowrap; }
.laufend b { color: var(--text); }
.summe { display: grid; grid-template-columns: 1fr 1fr; gap: 0.3vw; }
.ringe, .ep { text-align: center; font-size: 2.6vh; font-weight: 800; font-variant-numeric: tabular-nums; border-radius: 0.6vh; background: rgba(255,255,255,.05); padding: 0.2vh 0; }
.ringe small, .ep small { display: block; font-size: 1.3vh; color: var(--muted); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.ep { color: var(--muted); }
.ep.sieg { color: var(--gruen-hell); }
.ep.gleich { color: var(--gelb); }
.karte-fuss { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.3vw; align-items: stretch; }
.serie { text-align: center; border-radius: 0.5vh; background: rgba(255,255,255,.06); padding: 0.2vh 0; font-size: 2.1vh; font-weight: 700; font-variant-numeric: tabular-nums; position: relative; overflow: hidden; }
.serie.leer { color: var(--muted); font-weight: 400; }
.serie.laeuft { box-shadow: inset 0 0 0 2px var(--gruen-hell); }
.serie.gewinnt { background: rgba(47,143,78,.5); }
.serie.gleich { background: rgba(245,197,49,.45); color: #fff; }
.serie small { display: block; font-size: 1.3vh; color: var(--muted); font-weight: 600; letter-spacing: .05em; }
.serie .dp { position: absolute; top: 0.1vh; right: 0.3vw; font-size: 1.3vh; color: var(--muted); }
.karte .hinweis { position: absolute; left: 0.5vw; bottom: 0.3vh; font-size: 1.4vh; color: var(--gelb); }
.karte .fehlt { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); font-size: 1.8vh; text-align: center; padding: 0 1vw; }

/* Stechen */
.stechen { grid-column: 1 / -1; display: grid; grid-template-columns: auto repeat(4, minmax(0, 1fr)) auto; gap: 0.4vw; align-items: center; font-size: 1.9vh; padding: 0.4vh 0.8vw; border-radius: 0.8vh; background: rgba(245,197,49,.12); border: 1px solid rgba(245,197,49,.5); }
.stechen .st-titel { font-weight: 800; color: var(--gelb); }
.stechen .st-paar { text-align: center; font-variant-numeric: tabular-nums; }
.stechen .st-paar b.gewinnt { color: var(--gruen-hell); }
.stechen .st-punkte { font-weight: 800; }

/* 16 Scheiben: schmale Karten – Name in eigener Zeile, Scheibe oben, Werte darunter */
body[data-modus="16"] .team { font-size: 2vh; padding: 0.3vh 0.6vw; }
body[data-modus="16"] .team .wert b { font-size: 2.6vh; }
body[data-modus="16"] .team .wert { min-width: 3.6vw; }
body[data-modus="16"] .team .team-logo { height: 3.4vh; width: 3.4vh; }
body[data-modus="16"] .karte-kopf { flex-wrap: wrap; gap: 0.2vh 0.4vw; align-items: center; }
body[data-modus="16"] .karte-kopf .name { order: -1; flex: 1 0 100%; font-size: 2vh; }
body[data-modus="16"] .karte-kopf .stand { font-size: 1.5vh; }
body[data-modus="16"] .karte-kopf .pos { margin-left: auto; font-size: 1.4vh; }
body[data-modus="16"] .karte-mitte { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: 0.4vh; }
body[data-modus="16"] .karte-werte { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: stretch; gap: 0.3vw; min-width: 0; }
body[data-modus="16"] .letzter { min-width: 4.4vw; padding: 0.3vh 0.4vw; }
body[data-modus="16"] .letzter b { font-size: 3.4vh; }
body[data-modus="16"] .letzter span { font-size: 1.3vh; }
body[data-modus="16"] .laufend { display: none; }   /* laufende Serie steht im Serienfeld (z. B. „66 · P3 · 7/10“) */
body[data-modus="16"] .summe { gap: 0.2vw; align-items: stretch; }
body[data-modus="16"] .ringe, body[data-modus="16"] .ep { font-size: 2.2vh; display: flex; flex-direction: column; justify-content: center; padding: 0.2vh 0.1vw; }
body[data-modus="16"] .ringe small, body[data-modus="16"] .ep small { font-size: 1.3vh; }
body[data-modus="16"] .serie { font-size: 1.7vh; }
body[data-modus="16"] .serie small, body[data-modus="16"] .serie .dp { font-size: 1.3vh; }
body[data-modus="16"] .beg-kopf { font-size: 1.6vh; }
body[data-modus="16"] .beg-kopf .beg-abschnitt { font-size: 1.5vh; }

/* ---------- Fuß ---------- */
.fuss { display: flex; align-items: center; justify-content: space-between; gap: 1vw; padding: 0 1.2vw; border-top: 1px solid var(--linie); font-size: 1.6vh; color: var(--muted); white-space: nowrap; overflow: hidden; background: #0a1a11; }
.fuss-status { display: flex; gap: 1.6vw; }
.fuss-status .punkt { display: inline-block; width: 1vh; height: 1vh; border-radius: 50%; background: var(--grau); margin-right: 0.3vw; vertical-align: middle; }
.fuss-status .punkt.ok { background: var(--gruen-hell); }
.fuss-status .punkt.warn { background: var(--gelb); }
.fuss-status .punkt.aus { background: var(--rot); }
.fuss-hinweise { overflow: hidden; text-overflow: ellipsis; color: var(--gelb); }
.offline-band { position: fixed; top: var(--kopf-h); left: 50%; transform: translateX(-50%); padding: 0.4vh 1.4vw; border-radius: 0 0 1vh 1vh; background: rgba(245,197,49,.92); color: #1c2530; font-size: 1.7vh; font-weight: 700; z-index: 5; }
.offline-band.aus { background: rgba(216,52,44,.92); color: #fff; }

/* Leerzustand */
.leerzustand { position: fixed; inset: var(--kopf-h) 0 var(--fuss-h) 0; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.leerzustand[hidden] { display: none; }
.leer-inhalt { text-align: center; max-width: 60vw; }
.leer-titel { font-size: 4vh; font-weight: 800; margin-bottom: 1vh; }
.leer-text { font-size: 2vh; color: var(--muted); }
