/* Corporate Design wie die Vereinsapp (lib/theme/app_theme.dart):
   Alemannia-Blau, Weiß, Schwarz, kantige Formen wie die Zinnen im Wappen. */
:root {
  --blau: #0080FF;
  --blau-dunkel: #0060C0;
  --blau-hell: #E6F2FF;
  --schwarz: #111111;
  --grau: #5b6470;
  --linie: #d7dde5;
  --flaeche: #f5f8fc;
  --weiss: #ffffff;
  --rot: #c62828;
  --gruen: #1b7f3b;
  --ecke: 4px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--weiss);
  color: var(--schwarz);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; }
a { color: var(--blau-dunkel); }
h1, h2, h3 { line-height: 1.15; letter-spacing: .2px; margin: 0 0 .5em; }
h2 { font-size: 1.6rem; font-weight: 800; }
h3 { font-size: 1.1rem; font-weight: 700; }
[hidden] { display: none !important; }

.breite { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.abschnitt { padding-top: 48px; padding-bottom: 48px; }
.flaeche { background: var(--flaeche); border-top: 1px solid var(--linie); border-bottom: 1px solid var(--linie); }
.hinweis-klein { color: var(--grau); font-size: .95rem; margin-top: -.25em; }

/* ---------- Kopf ---------- */
.kopf { background: var(--weiss); border-bottom: 4px solid var(--blau); }
.kopf-innen { display: flex; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.wappen { height: 52px; width: auto; }
.verein { font-weight: 800; font-size: 1.05rem; }
.unterzeile { color: var(--grau); font-size: .85rem; }

/* ---------- Held ---------- */
.held {
  background: var(--blau);
  color: var(--weiss);
  padding: 56px 0 56px;
  border-bottom: 6px solid var(--schwarz);
}
.vorzeile { text-transform: uppercase; letter-spacing: 2px; font-weight: 700; font-size: .85rem; margin: 0 0 8px; opacity: .9; }
.held h1 { font-size: clamp(2.2rem, 7vw, 3.6rem); font-weight: 900; margin-bottom: 16px; }
.held-daten { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; padding: 0; }
.held-daten span { background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .35); padding: 4px 10px; border-radius: var(--ecke); font-weight: 600; font-size: .95rem; }
.held-text { max-width: 560px; margin: 0 0 24px; font-size: 1.05rem; }

/* ---------- Knöpfe ---------- */
.knopf {
  display: inline-block;
  background: var(--blau);
  color: var(--weiss);
  border: 2px solid var(--blau);
  border-radius: var(--ecke);
  padding: 12px 22px;
  font: inherit;
  font-weight: 700;
  letter-spacing: .4px;
  text-decoration: none;
  cursor: pointer;
}
.knopf:hover { background: var(--blau-dunkel); border-color: var(--blau-dunkel); }
.knopf:focus-visible, .wahl input:focus-visible + .wahl-inhalt, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--schwarz); outline-offset: 2px;
}
.knopf:disabled { opacity: .6; cursor: progress; }
.knopf-hell { background: var(--weiss); color: var(--blau-dunkel); border-color: var(--weiss); }
.knopf-hell:hover { background: var(--blau-hell); border-color: var(--blau-hell); }
.knopf-umriss { background: transparent; color: var(--blau-dunkel); }
.knopf-umriss:hover { background: var(--blau-hell); }
.knopf-klein { padding: 8px 14px; font-size: .95rem; }

/* ---------- Ablauf ---------- */
.schritte { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.schritte li { border: 1px solid var(--linie); border-top: 4px solid var(--blau); border-radius: var(--ecke); padding: 18px; }
.schritte p { margin: 0; color: var(--grau); }
.schritt-nr { display: inline-grid; place-items: center; width: 32px; height: 32px; background: var(--schwarz); color: var(--weiss); font-weight: 800; border-radius: var(--ecke); margin-bottom: 10px; }

/* ---------- Turniere ---------- */
.turniere { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 20px; }
.turnier-karte { background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--ecke); padding: 18px; display: flex; flex-direction: column; gap: 4px; }
.turnier-karte p { margin: 0; }
.turnier-kopf { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.altersklasse { font-size: 2rem; font-weight: 900; color: var(--blau); }
.jahrgang { color: var(--grau); font-size: .9rem; font-weight: 600; }
.turnier-datum { font-weight: 700; }
.niveau { align-self: flex-start; font-size: .8rem; font-weight: 700; padding: 2px 8px; border-radius: var(--ecke); margin-bottom: 6px !important; background: var(--blau-hell); color: var(--blau-dunkel); }
.niveau-mittel { background: var(--schwarz); color: var(--weiss); }
.turnier-zeit { color: var(--grau); }
.turnier-plaetze { color: var(--grau); font-size: .9rem; margin-bottom: 12px !important; }
.turnier-karte .knopf { margin-top: auto; text-align: center; }
.turnier-karte.geschlossen { opacity: .65; }
.geschlossen-text { margin-top: auto !important; font-weight: 700; color: var(--grau); }
.laden { color: var(--grau); }

/* ---------- Formular ---------- */
.formular { max-width: 680px; }
fieldset { border: 0; padding: 0; margin: 0 0 24px; min-width: 0; }
legend { font-weight: 800; font-size: 1.05rem; margin-bottom: 10px; padding: 0; }
.pflicht { color: var(--blau-dunkel); }
.optional { color: var(--grau); font-weight: 400; }
.feld { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; flex: 1 1 0; min-width: 0; }
.feld > span:first-child { font-weight: 600; font-size: .95rem; }
.feld-reihe { display: flex; gap: 12px; flex-wrap: wrap; }
.feld-reihe .feld { min-width: 200px; }
.feld-breit { flex: 3 1 260px; }
.feld-schmal { flex: 1 1 120px; min-width: 120px !important; }
input, textarea, select {
  font: inherit;
  color: var(--schwarz);
  background: var(--weiss);
  border: 1.5px solid #aab4c0;
  border-radius: var(--ecke);
  padding: 11px 12px;
  width: 100%;
}
input:hover, textarea:hover, select:hover { border-color: var(--grau); }
input[aria-invalid="true"] { border-color: var(--rot); }
textarea { resize: vertical; }

.turnier-wahl { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.wahl { position: relative; cursor: pointer; }
.wahl input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.wahl-inhalt { display: flex; flex-direction: column; border: 1.5px solid #aab4c0; border-radius: var(--ecke); padding: 10px 12px; background: var(--weiss); }
.wahl-inhalt strong { font-size: 1.3rem; font-weight: 900; }
.wahl-inhalt span { color: var(--grau); font-size: .9rem; }
.wahl input:checked + .wahl-inhalt { border-color: var(--blau); background: var(--blau-hell); box-shadow: inset 0 0 0 1.5px var(--blau); }
.wahl input:disabled + .wahl-inhalt { opacity: .5; cursor: not-allowed; }

.haken { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; margin: 4px 0 4px; }
.haken input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--blau); }
.honig { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.fehler { color: var(--rot); font-size: .9rem; margin: 0; min-height: 0; }
.fehler:empty { display: none; }
.fehler-gesamt { margin: 12px 0; font-weight: 600; }

.hinweis-kasten { background: var(--blau-hell); border-left: 4px solid var(--blau); padding: 12px 14px; border-radius: var(--ecke); margin: 18px 0; }

/* ---------- Bestätigung ---------- */
.bestaetigung { max-width: 680px; border: 1px solid var(--linie); border-top: 6px solid var(--gruen); border-radius: var(--ecke); padding: 24px; }
.bestaetigung:focus { outline: none; }
.bestaetigung-kopf { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.bestaetigung-kopf h3 { margin: 0; font-size: 1.35rem; }
.bestaetigung-kopf p { margin: 2px 0 0; }
.haken-gross { display: grid; place-items: center; width: 44px; height: 44px; flex: none; background: var(--gruen); color: var(--weiss); font-size: 1.5rem; font-weight: 900; border-radius: var(--ecke); }
.referenz { font: 800 1.8rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 2px; background: var(--flaeche); border: 1px dashed var(--linie); display: inline-block; padding: 8px 16px; border-radius: var(--ecke); margin: 4px 0 16px; }
.zusammenfassung { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 20px; }
.zusammenfassung dt { color: var(--grau); }
.zusammenfassung dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

/* ---------- Halle ---------- */
.halle p { margin: 0 0 6px; }
.halle-name { font-weight: 800; font-size: 1.15rem; }
.halle .knopf { margin-top: 12px; }

/* ---------- Fuß ---------- */
.fuss { background: var(--schwarz); color: #cfd6df; font-size: .9rem; }
.fuss-innen { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-top: 18px; padding-bottom: 18px; }
.fuss a { color: var(--weiss); }
.fuss-links { display: flex; gap: 16px; }

@media (max-width: 520px) {
  .abschnitt { padding-top: 36px; padding-bottom: 36px; }
  .held { padding: 40px 0 44px; }
  .zusammenfassung { grid-template-columns: 1fr; gap: 0; }
  .zusammenfassung dd { margin-bottom: 8px; }
  .knopf { width: 100%; text-align: center; }
}


/* ---------- Tabellen & Spielplan (öffentlich + Orga, planansicht.js) ---------- */
.druck-gruppen { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin: 16px 0; }
.tabelle { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tabelle caption { text-align: left; font-weight: 800; padding-bottom: 6px; }
.tabelle th, .tabelle td { border: 1px solid var(--linie); padding: 6px 8px; text-align: left; }
.tabelle th { background: var(--flaeche); font-weight: 700; }
.druck-gruppen td:not(:first-child) { width: 3.2em; }
.spielplan td:nth-child(1), .spielplan td:nth-child(2) { white-space: nowrap; width: 1%; }
.spielplan .team { font-weight: 600; }
.spielplan .ergebnis { width: 5.5em; text-align: center; color: var(--grau); }
.spielplan tr.ko td { background: var(--blau-hell); }
.runde .kurz { display: none; }
.tabelle-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.gruppen-tabelle td.platz { width: 2.2em; color: var(--grau); }
.gruppen-tabelle td.pkt { font-weight: 800; }
.gruppen-tabelle tr.unklar td { background: #fff3d6; }
.spielplan td.platzhalter { color: var(--grau); font-weight: 400; font-style: italic; }
.spielplan tr.gespielt .ergebnis { color: var(--schwarz); font-weight: 800; }
.spielplan tr.naechstes td { box-shadow: inset 0 2px 0 var(--blau), inset 0 -2px 0 var(--blau); }
.warnung { background: #fff3d6; border-left: 4px solid #c98a00; padding: 10px 12px; border-radius: var(--ecke); font-weight: 600; }
.warnung.klein { font-size: .9rem; margin: 0; }

/* ---------- Live ---------- */
.live { border-bottom: 1px solid var(--linie); }
.live .reiter { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 16px; }
.live .reiter-knopf { font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; border: 1.5px solid var(--linie); background: var(--weiss); border-radius: var(--ecke); padding: 6px 14px; }
.live .reiter-knopf strong { font-size: 1.15rem; font-weight: 900; }
.live .reiter-knopf span { font-size: .8rem; color: var(--grau); }
.live .reiter-knopf[aria-selected="true"] { border-color: var(--blau); background: var(--blau-hell); box-shadow: inset 0 0 0 1.5px var(--blau); }
.live-titel { font-size: 1.2rem; margin: 8px 0 12px; }
.naechstes-spiel { display: flex; flex-direction: column; gap: 2px; background: var(--blau); color: var(--weiss); padding: 12px 16px; border-radius: var(--ecke); margin: 0 0 16px; }
.naechstes-spiel span { font-size: .85rem; opacity: .9; }
.naechstes-spiel strong { font-size: 1.15rem; }
.endstand-box { background: var(--blau-hell); border-left: 4px solid var(--blau); padding: 12px 16px; border-radius: var(--ecke); margin-bottom: 16px; }
.endstand-box h4 { margin: 0 0 6px; }
.endstand { margin: 0; padding-left: 0; list-style: none; columns: 2; }
.endstand li { padding: 2px 0; }

/* ---------- Datenschutzhinweise ---------- */
.datenschutz dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0 0 12px; }
.datenschutz dt { font-weight: 700; }
.datenschutz dd { margin: 0; color: var(--grau); }

@media (max-width: 560px) {
  .tabelle { font-size: .85rem; }
  .tabelle th, .tabelle td { padding: 5px 5px; }
  .spielplan th:first-child, .spielplan td:first-child { display: none; }
  .runde .lang { display: none; }
  .runde .kurz { display: inline; white-space: nowrap; }
  .spielplan td.team { font-size: .82rem; }
  .datenschutz dl { grid-template-columns: 1fr; gap: 2px; }
  .datenschutz dd { margin-bottom: 8px; }
  .endstand { columns: 1; }
}
