/* ==========================================================
   BSV Playhouse FFB – Gestaltung (Handy zuerst, dunkles Design)
   Mobile-first, dunkles Design. Keine externen Schriften/Skripte.

   >>> FARBEN: alles Wichtige steht hier oben in den Variablen. <<<
   Zum Umfärben (z. B. nach dem Vereinslogo) nur diese Werte ändern.
   ========================================================== */
:root {
  /* Farben aus dem Vereinslogo: Schwarz, Champagner-Gold, Billardgrün */
  --bg:            #000000;   /* Seitenhintergrund (passt nahtlos zum Logo) */
  --flaeche:       #0d1210;   /* Karten / Tabellenzeilen */
  --flaeche-2:     #151d19;   /* Tabellenkopf, Ergebnis-Feld */
  --linie:         #26312b;   /* dünne Trennlinien */
  --text:          #f2f0e8;   /* Haupttext (warmes Weiß) */
  --text-leise:    #a9a692;   /* Nebentext */
  --akzent:        #c9b27c;   /* Gold: Überschriften, Links, Hervorhebung */
  --akzent-text:   #17120a;   /* Schrift auf Goldfläche */
  --wir-hintergrund: rgba(20, 118, 66, .30);  /* eigene Mannschaft: Grün des 14er-Balls */

  --gold:          #e0b048;   /* Platz 1 (gelber 9er-Ball) */
  --silber:        #c3c6c8;
  --bronze:        #c98550;
  --absteiger:     #c8402b;   /* rote Kugeln */

  --radius:        12px;
  --abstand:       16px;      /* seitlicher Rand (Handy) */
  --max-breite:    960px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Platz für Notch / Home-Balken bei Handys und App-Ansicht */
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.seite {
  max-width: var(--max-breite);
  margin: 0 auto;
  padding: 20px var(--abstand) 40px;
}

a { color: var(--akzent); }
a:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; border-radius: 4px; }

/* ---------- Kopf mit Logo ---------- */
.kopf { background: #000; text-align: center; }
.logo-link { display: block; }
.logo { display: block; width: 100%; max-width: 560px; height: auto; margin: 0 auto; }
.logo-text { display: block; padding: 24px var(--abstand); color: var(--akzent); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- Menü ----------
   Handy: Knopf "Menü" klappt die Liste auf (Untermenü immer sichtbar, eingerückt).
   Ab 720 px: Menüleiste, Untermenü klappt beim Darüberfahren / per Tastatur auf. */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: var(--flaeche);
  border-top: 1px solid var(--linie);
  border-bottom: 1px solid var(--linie);
}
.nav-knopf {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 14px var(--abstand);
  background: none; border: 0; cursor: pointer;
  color: var(--akzent); font: inherit; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; text-align: left;
}
.nav-knopf:focus-visible { outline: 2px solid var(--akzent); outline-offset: -4px; }
.nav-symbol { width: 20px; height: 2px; background: currentColor; box-shadow: 0 -6px currentColor, 0 6px currentColor; }
.nav-liste, .untermenue { list-style: none; margin: 0; padding: 0; }
.nav a {
  display: block; padding: 13px var(--abstand);
  border-top: 1px solid var(--linie);
  color: var(--text); text-decoration: none;
}
.nav a:hover, .nav a:focus-visible { color: var(--akzent); }
.nav a[aria-current="page"], .aktiver-bereich > a { color: var(--akzent); font-weight: 700; }
.untermenue a { padding-left: calc(var(--abstand) * 2.5); color: var(--text-leise); font-size: .95rem; }
.js .nav-liste { display: none; }
.js .nav-liste.offen { display: block; }

h1 {
  margin: 0 0 4px;
  font-size: 1.4rem;
  line-height: 1.2;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--akzent);
}
.untertitel { margin: 0 0 8px; color: var(--text-leise); }

/* ---------- Karten, Auswahl, Text, Downloads ---------- */
.karten { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.karte {
  display: block; padding: 14px 16px;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius);
  color: var(--text); text-decoration: none;
}
.karte strong { display: block; color: var(--akzent); font-size: 1.1rem; }
.karte span { color: var(--text-leise); font-size: .85rem; }
.karte:hover, .karte:focus-visible { border-color: var(--akzent); }

.team-wahl { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.team-wahl a {
  display: block; padding: 8px 16px; border-radius: 999px;
  background: var(--flaeche-2); border: 1px solid var(--linie);
  color: var(--text); font-weight: 600; text-decoration: none;
}
.team-wahl a:hover { border-color: var(--akzent); }
.team-wahl a[aria-current="page"] { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); }

.text p { max-width: 65ch; }
.text-breit p { max-width: none; }   /* Startseite: Text nutzt die volle Inhaltsbreite */
.platzhalter {
  margin: 10px 0; padding: 14px 16px; max-width: 65ch;
  border: 1px dashed var(--akzent); border-radius: var(--radius); color: var(--text-leise);
}

/* Mannschaften */
.mannschaft { margin: 28px 0 36px; max-width: 65ch; }
.mannschaft h2 { margin-bottom: 2px; }
.mannschaft .liga { margin: 0 0 12px; color: var(--text-leise); }
.teamfoto { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--linie); }
.teamfoto-platzhalter {
  display: flex; align-items: center; justify-content: center; text-align: center;
  aspect-ratio: 16 / 9; padding: 12px;
  border: 1px dashed var(--akzent); border-radius: var(--radius);
  background: var(--flaeche); color: var(--text-leise);
}
.mannschaft .spieler { margin: 12px 0 0; }
.mannschaft .spieler .zeile { color: var(--akzent); font-weight: 600; }

.download-liste { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 8px; }
.download-liste a {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 16px; background: var(--flaeche);
  border: 1px solid var(--linie); border-radius: var(--radius);
  color: var(--text); text-decoration: none;
}
.download-liste a:hover, .download-liste a:focus-visible { border-color: var(--akzent); }
.download-liste .dl-name { overflow-wrap: anywhere; }
.download-liste .meta { flex: none; color: var(--text-leise); font-size: .85rem; white-space: nowrap; }

.fuss-links { margin-top: 6px; }
.fuss-links a { color: var(--text-leise); }
.fuss-links a:hover, .fuss-links a:focus-visible { color: var(--akzent); }

.fuss { margin-top: 48px; padding: 20px var(--abstand); border-top: 1px solid var(--linie); text-align: center; color: var(--text-leise); font-size: .8rem; }

h2 {
  margin: 28px 0 12px;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--akzent);
}
h2::after {              /* kleine Akzentlinie */
  content: "";
  display: block;
  width: 36px; height: 3px;
  margin-top: 6px;
  border-radius: 2px;
  background: var(--akzent);
}

.hinweis {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--flaeche);
  border-left: 4px solid var(--akzent);
}

/* ---------- Tabellen allgemein ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 8px; text-align: left; }
th {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-leise);
  background: var(--flaeche-2);
}
td { font-variant-numeric: tabular-nums; }

.tabelle-wrap { overflow-x: auto; border-radius: var(--radius); }   /* Notbremse, falls doch zu breit */

.ergebnis .fest {
  display: inline-block;
  min-width: 3.4em;
  padding: .3em .7em;
  border-radius: 999px;
  background: var(--flaeche-2);
  border: 1px solid var(--linie);
  color: var(--text);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.wir { font-weight: 700; }

/* noch nicht gespielt / verlegt */
.ergebnis .offen { color: var(--text-leise); letter-spacing: .05em; }
.badge {
  display: inline-block; padding: 0 .5em; border-radius: 999px;
  border: 1px solid var(--akzent); color: var(--akzent);
  font-size: .7rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap;
}

/* ---------- Tabelle (Rangliste) ---------- */
.tabelle { background: var(--flaeche); }
.tabelle th, .tabelle td { border-bottom: 1px solid var(--linie); }
.tabelle tbody tr:last-child td { border-bottom: 0; }
.tabelle .platz  { width: 2.6em; text-align: center; }
.tabelle .s, .tabelle .g, .tabelle .u, .tabelle .v,
.tabelle .pkt, .tabelle .diff, .tabelle .partien, .tabelle .spiele { text-align: center; white-space: nowrap; }
.tabelle .pkt { font-weight: 700; }

.tabelle tr.eigenes-team td { background: var(--wir-hintergrund); font-weight: 600; }
.tabelle tr.eigenes-team td:nth-child(2) { color: var(--akzent); }

/* farbiger Streifen links: Medaillen und Abstieg */
.tabelle tr.gold      td:first-child { box-shadow: inset 4px 0 0 var(--gold); }
.tabelle tr.silber    td:first-child { box-shadow: inset 4px 0 0 var(--silber); }
.tabelle tr.bronze    td:first-child { box-shadow: inset 4px 0 0 var(--bronze); }
.tabelle tr.absteiger td:first-child { box-shadow: inset 4px 0 0 var(--absteiger); }
.tabelle tr.aufsteiger td:first-child { box-shadow: inset 4px 0 0 var(--akzent); }

.legende, .quelle {
  margin: 10px 2px 0;
  font-size: .8rem;
  color: var(--text-leise);
}
.quelle { margin-top: 32px; }


/* ---------- Reiter (Ansichten) und Filter ---------- */
.ansichten, .filter { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 16px 0 0; padding: 0; list-style: none; }
.ansichten { border-bottom: 1px solid var(--linie); }
.ansichten a {
  display: block; padding: 10px 2px; margin-bottom: -1px;
  border-bottom: 3px solid transparent;
  color: var(--text-leise); font-weight: 600; text-decoration: none;
}
.ansichten a:hover, .ansichten a:focus-visible { color: var(--text); }
.ansichten a[aria-current="page"] { color: var(--akzent); border-bottom-color: var(--akzent); }
.filter { margin: 4px 0 14px; }
.filter a {
  display: block; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--linie); color: var(--text-leise); font-size: .85rem; text-decoration: none;
}
.filter a[aria-current="true"] { border-color: var(--akzent); color: var(--akzent); }

/* ---------- Spieler-Rangliste ---------- */
.rangliste th, .rangliste td { text-align: center; }
.rangliste .spieler, .rangliste .mannschaft { text-align: left; }
.rangliste .rang { width: 2.6em; }
.rangliste .unter { display: none; }

/* ==========================================================
   HANDY / SCHMALE ANSICHT (bis 719 px):
   Ergebnisse werden zu Karten
       Spieltag 1     12.09.2026     11:00 Uhr
       Heim         [ 4:4 ]          Gast
   ========================================================== */
@media (max-width: 719px) {
  .ergebnisse, .ergebnisse tbody { display: block; }
  .ergebnisse thead { display: none; }

  .ergebnisse tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 6px 6px;
    margin-bottom: 10px;
    padding: 12px 10px;
    background: var(--flaeche);
    border-radius: var(--radius);
    border-left: 4px solid transparent;
  }
  .ergebnisse tr.eigenes-team {
    background: linear-gradient(var(--wir-hintergrund), var(--wir-hintergrund)), var(--flaeche);
    border-left-color: var(--akzent);
  }
  .ergebnisse td { padding: 0; }

  .ergebnisse .spieltag, .ergebnisse .datum, .ergebnisse .uhrzeit {
    font-size: .8rem;
    color: var(--text-leise);
  }
  .ergebnisse .spieltag { grid-area: 1 / 1; text-align: left; }
  .ergebnisse .datum    { grid-area: 1 / 2; text-align: center; }
  .ergebnisse .uhrzeit  { grid-area: 1 / 3; text-align: right; }
  .ergebnisse .spieltag::before { content: "Spieltag "; }

  .ergebnisse .heim     { grid-area: 2 / 1; text-align: right; }
  .ergebnisse .ergebnis { grid-area: 2 / 2; text-align: center; }
  .ergebnisse .gast     { grid-area: 2 / 3; text-align: left; }
  .ergebnisse .heim, .ergebnisse .gast { font-size: .85rem; line-height: 1.3; overflow-wrap: break-word; hyphens: auto; }

  .ergebnisse .ergebnis .offen, .ergebnisse .ergebnis .fest { display: inline-block; min-width: 3.2em; padding: .4em .6em; font-size: 1.05rem; text-align: center; }
  .ergebnisse tr.leer { display: block; text-align: center; color: var(--text-leise); }
}

/* Ranglisten am Handy: Mannschaft als Zeile unter dem Namen statt eigener Spalte */
@media (max-width: 719px) {
  .rangliste th.mannschaft, .rangliste td.mannschaft { display: none; }
  .rangliste .unter { display: block; margin-top: 2px; color: var(--text-leise); font-size: .78rem; font-weight: 400; line-height: 1.25; }
}

/* Reiter auf schmalen Handys enger, damit alle vier in eine Zeile passen */
@media (max-width: 519px) {
  .ansichten { gap: 0 14px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }   /* notfalls seitlich wischen statt umbrechen */
  .ansichten::-webkit-scrollbar { display: none; }
  .ansichten a { font-size: .9rem; padding: 10px 1px; white-space: nowrap; }
}

/* Sehr schmale Handys: Rangliste kompakter, G/U/V ausblenden */
@media (max-width: 519px) {
  .tabelle th, .tabelle td { padding: 10px 4px; font-size: .9rem; }
  .tabelle th { font-size: .64rem; letter-spacing: 0; }
  .tabelle th:first-child, .tabelle td:first-child { padding-left: 8px; }
  .tabelle th:last-child,  .tabelle td:last-child  { padding-right: 8px; }
  .tabelle .platz { width: 2em; }
  .tabelle th:first-child, .tabelle td:first-child { padding-left: 6px; padding-right: 2px; }
  .tabelle .s, .tabelle .g, .tabelle .u, .tabelle .v, .tabelle .spiele { display: none; }
  .tabelle td.mannschaft { line-height: 1.3; }
  .legende { display: none; }
}

/* Winzige Handys (unter 360 px): Differenz ausblenden */
@media (max-width: 359px) {
  .tabelle .diff { display: none; }
}

/* ==========================================================
   TABLET / DESKTOP (ab 720 px)
   ========================================================== */
@media (min-width: 720px) {
  .seite { padding-top: 36px; }
  h1 { font-size: 1.6rem; }

  /* Menüleiste mit Aufklapp-Untermenü */
  .nav-knopf { display: none; }
  .nav-liste, .js .nav-liste { display: flex; justify-content: center; gap: 4px; }
  .nav-liste > li { position: relative; }
  .nav a { border-top: 0; padding: 15px 18px; text-transform: uppercase; letter-spacing: .08em; font-size: .85rem; }
  .untermenue {
    display: none; position: absolute; left: 0; top: 100%; min-width: 12rem;
    background: var(--flaeche-2); border: 1px solid var(--linie); border-top: 0;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 14px 28px rgba(0, 0, 0, .7);
    overflow: hidden;
  }
  .hat-untermenue:hover > .untermenue, .hat-untermenue:focus-within > .untermenue { display: block; }
  .untermenue a { padding: 12px 18px; border-top: 1px solid var(--linie); color: var(--text); text-transform: none; letter-spacing: 0; font-size: .95rem; }
  th, td { padding: 12px 12px; }

  .ergebnisse { background: var(--flaeche); }
  .ergebnisse td { border-bottom: 1px solid var(--linie); }
  .ergebnisse tbody tr:last-child td { border-bottom: 0; }
  .ergebnisse .heim   { text-align: right; width: 34%; }
  .ergebnisse .gast   { text-align: left;  width: 34%; }
  .ergebnisse .ergebnis { text-align: center; }
  .ergebnisse tr.eigenes-team td { background: var(--wir-hintergrund); }
  .ergebnisse tr.eigenes-team td:first-child { box-shadow: inset 4px 0 0 var(--akzent); }
  .ergebnisse .datum, .ergebnisse .uhrzeit { white-space: nowrap; }
}

/* Bewegung reduzieren, falls am Gerät so eingestellt */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}


/* ---------- Impressum ---------- */
.rechtstext { max-width: 65ch; }
.rechtstext h2 { margin-top: 32px; }
.rechtstext address { font-style: normal; }
.fehlt {
  padding: 1px 6px; border-radius: 4px;
  background: #4a3d0a; color: #ffe98a; font-size: .9em; white-space: normal;
}


/* ---------- Kontaktformular ---------- */
.formular { max-width: 36rem; margin-top: 16px; }
.formular label { display: block; margin: 16px 0 6px; font-weight: 600; }
.formular .pflicht { color: var(--akzent); }
.formular input[type="text"], .formular input[type="email"], .formular textarea {
  display: block; width: 100%; padding: 12px 14px;
  background: var(--flaeche); color: var(--text);
  border: 1px solid var(--linie); border-radius: var(--radius);
  font: inherit; font-size: 1rem;           /* mindestens 16 px, sonst zoomt iOS beim Antippen */
}
.formular textarea { min-height: 9rem; resize: vertical; }
.formular input:focus-visible, .formular textarea:focus-visible { outline: 2px solid var(--akzent); outline-offset: 1px; border-color: var(--akzent); }
.formular .zustimmung { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.formular .zustimmung input { margin-top: .3em; width: 1.1em; height: 1.1em; flex: none; accent-color: var(--akzent); }
.formular .knopf {
  margin-top: 22px; padding: 14px 26px; min-height: 48px;
  background: var(--akzent); color: var(--akzent-text);
  border: 0; border-radius: 999px; cursor: pointer;
  font: inherit; font-weight: 700; letter-spacing: .04em;
}
.formular .knopf:hover, .formular .knopf:focus-visible { filter: brightness(1.1); }
.formular .fehlermeldung { color: #ff8a7a; margin: 6px 0 0; font-size: .9rem; }
.formular .falle { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }   /* Roboter-Falle, für Menschen unsichtbar */
.erfolg { padding: 14px 16px; border-radius: var(--radius); background: var(--flaeche); border-left: 4px solid var(--akzent); max-width: 36rem; }
