@font-face { font-family: "Chakra Petch"; font-weight: 600; font-display: swap;
  src: url("fonts/chakra-petch-600.woff2") format("woff2"); }
@font-face { font-family: "Chakra Petch"; font-weight: 700; font-display: swap;
  src: url("fonts/chakra-petch-700.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 100 900; font-display: swap;
  src: url("fonts/outfit-variable.woff2") format("woff2"); }

:root {
  --grund: #07070d;
  --flaeche: #12121c;
  --flaeche2: #1b1b29;
  --linie: rgba(255,255,255,.09);
  --text: #f2f2f7;
  --leise: rgba(242,242,247,.62);
  --neon: #39ff14;
  --pink: #ff2d78;
  --gold: #ffd400;
  --silber: #cfd6e4;
  --bronze: #e08a4f;
  --fehler: #ff5470;
  --team: #888;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--grund); color: var(--text);
  font: 400 16px/1.45 Outfit, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  min-height: 100vh;
}
h1, h2, h3, .zahl, .schrift-tech { font-family: "Chakra Petch", Outfit, system-ui, sans-serif; }
h1 { font-size: clamp(1.5rem, 5vw, 2.4rem); line-height: 1.1; margin: 0; }
h2 { font-size: 1.15rem; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 12px;
     color: var(--leise); }
a { color: var(--neon); }
button, input, select { font: inherit; }

.rahmen { max-width: 1100px; margin: 0 auto; padding: 16px; }
.kopf {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 18px 16px 14px; border-bottom: 1px solid var(--linie);
  background: linear-gradient(180deg, rgba(57,255,20,.07), transparent);
}
.kopf img.logo { height: 26px; width: auto; }
.kopf .titel { flex: 1 1 260px; min-width: 0; }
.kopf .titel h1 { overflow-wrap: anywhere; }
.live { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--leise); }
.live::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--neon);
  box-shadow: 0 0 10px var(--neon); animation: puls 2s infinite; }
.live.aus::before { background: var(--fehler); box-shadow: none; animation: none; }
@keyframes puls { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .live::before { animation: none; } }

.abschnitt { margin: 22px 0 30px; }
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 14px; }

/* Teamtabelle */
.tabelle { width: 100%; border-collapse: collapse; }
.tabelle th, .tabelle td { padding: 10px 8px; text-align: right; white-space: nowrap; }
.tabelle th { font-size: .75rem; color: var(--leise); font-weight: 500; text-transform: uppercase;
  letter-spacing: .06em; border-bottom: 1px solid var(--linie); }
.tabelle td { border-bottom: 1px solid var(--linie); font-variant-numeric: tabular-nums; }
.tabelle tr:last-child td { border-bottom: 0; }
.tabelle .links { text-align: left; }
.tabelle .team-name { white-space: normal; overflow-wrap: anywhere; font-weight: 600; }
.tabelle .pkt { font-family: "Chakra Petch", sans-serif; font-size: 1.25rem; font-weight: 700; color: var(--neon); }
.platz { font-family: "Chakra Petch", sans-serif; font-weight: 700; font-size: 1.1rem; width: 2.2em; }
.platz-1 { color: var(--gold); } .platz-2 { color: var(--silber); } .platz-3 { color: var(--bronze); }
.punkt { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--team);
  margin-right: 8px; vertical-align: -1px; box-shadow: 0 0 8px var(--team); }
.spiel .seite.b .punkt, .paarung .punkt:last-child { margin: 0 0 0 8px; }
.nur-breit { display: none; }
@media (min-width: 620px) { .nur-breit { display: table-cell; } }
.tabelle-wrap { overflow-x: auto; }

/* Ehrungen */
.ehrungen { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.ehrung { padding: 16px; min-width: 0; }
.ehrung .oben { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ehrung .symbol { font-size: 1.7rem; line-height: 1; }
.ehrung h3 { margin: 0; font-size: 1.1rem; }
.ehrung .einheit { font-size: .8rem; color: var(--leise); }
.ehrung ol { list-style: none; margin: 0; padding: 0; }
.ehrung li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--linie); min-width: 0; }
.ehrung li .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ehrung li .wert { font-family: "Chakra Petch", sans-serif; font-weight: 700; font-variant-numeric: tabular-nums; }
.ehrung li:first-child .name { font-weight: 700; font-size: 1.12rem; }
.ehrung li:first-child .wert { color: var(--gold); font-size: 1.12rem; }
.medaille { width: 1.6em; text-align: center; font-family: "Chakra Petch", sans-serif; font-weight: 700; }
.leer { color: var(--leise); font-size: .9rem; padding: 6px 0; }

/* Spiele */
.spiele { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.spiel { padding: 12px 14px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.spiel .nr { grid-column: 1 / -1; font-size: .75rem; color: var(--leise); text-transform: uppercase; letter-spacing: .06em; }
.spiel .seite { min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.spiel .seite.b { text-align: right; }
.spiel .ergebnis { font-family: "Chakra Petch", sans-serif; font-weight: 700; font-size: 1.05rem;
  white-space: nowrap; font-variant-numeric: tabular-nums; }
.spiel .sieger { color: var(--neon); }
.spiel.offen .ergebnis { color: var(--leise); font-weight: 600; }

/* Spieler */
.suche { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--linie);
  background: var(--flaeche2); color: var(--text); margin-bottom: 10px; }
.tabelle th button { all: unset; cursor: pointer; }
.tabelle th button:focus-visible { outline: 2px solid var(--neon); }
.tabelle th.aktiv { color: var(--neon); }

.fuss { color: var(--leise); font-size: .82rem; padding: 24px 16px 40px; text-align: center; }
.fuss img { height: 18px; width: auto; vertical-align: middle; opacity: .8; }
.hinweis { padding: 40px 16px; text-align: center; color: var(--leise); }
.qr-mini { display: none; }
@media (min-width: 1000px) {
  .qr-mini { display: block; background: #fff; padding: 6px; border-radius: 8px; }
  .qr-mini img { width: 96px; height: 96px; display: block; }
}

/* ---------------- Verwaltung ---------------- */
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid var(--linie); cursor: pointer;
  background: var(--flaeche2); color: var(--text); text-decoration: none; min-height: 44px; }
.knopf:hover { border-color: rgba(255,255,255,.25); }
.knopf.haupt { background: var(--neon); color: #041000; border-color: var(--neon); font-weight: 700; }
.knopf.haupt:hover { background: #5dff40; }
.knopf.gefahr { color: var(--fehler); }
.knopf.klein { min-height: 34px; padding: 6px 10px; font-size: .9rem; }
.knopf:disabled { opacity: .5; cursor: default; }
.feld { display: block; margin-bottom: 12px; }
.feld span { display: block; font-size: .85rem; color: var(--leise); margin-bottom: 4px; }
.feld input, .feld select, select.feld-auswahl {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--linie);
  background: var(--flaeche2); color: var(--text); min-height: 44px; }
.zeile { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.zeile > .wachsen { flex: 1 1 200px; min-width: 0; }
.innen { padding: 16px; }
.liste-turniere { display: grid; gap: 10px; }
.turnier-eintrag { display: flex; gap: 12px; align-items: center; padding: 14px 16px; flex-wrap: wrap;
  text-decoration: none; color: var(--text); }
.turnier-eintrag .wachsen { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.klein-text { font-size: .85rem; color: var(--leise); }
.meldung { padding: 12px 14px; border-radius: 10px; margin: 10px 0; }
.meldung.fehler { background: rgba(255,84,112,.12); border: 1px solid rgba(255,84,112,.4); }
.meldung.ok { background: rgba(57,255,20,.1); border: 1px solid rgba(57,255,20,.35); }
.meldung.warnung { background: rgba(255,212,0,.1); border: 1px solid rgba(255,212,0,.4); }
.admin-spiel { padding: 14px; display: grid; gap: 10px; }
.admin-spiel .paarung { font-weight: 700; overflow-wrap: anywhere; }
.verborgen { display: none !important; }
.zuordnung td, .zuordnung th { text-align: left; }
.zuordnung select { padding: 6px 8px; border-radius: 8px; background: var(--flaeche2); color: var(--text);
  border: 1px solid var(--linie); min-height: 38px; max-width: 160px; }
.farbe-chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .8rem; font-weight: 700; color: #000; background: var(--team); }
.qr-gross { background: #fff; padding: 12px; border-radius: 12px; display: inline-block; }
.qr-gross img { width: 220px; height: 220px; display: block; }
.link-feld { font-family: ui-monospace, Menlo, monospace; font-size: .9rem; overflow-wrap: anywhere; }
dialog { background: var(--flaeche); color: var(--text); border: 1px solid var(--linie); border-radius: 14px;
  width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; }
dialog::backdrop { background: rgba(0,0,0,.7); }
.team-eingaben { display: grid; gap: 8px; margin-bottom: 10px; }
