/* Tippspiel – BCM-Palette: Anthrazit, Nachtblau, Orange (Hauptakzent), Petrol (zweiter Akzent) */
:root {
  --text: #1E2730; --nacht: #16202A; --grund: #EEF2F5; --orange: #E8692B; --petrol: #2A8C82;
  --schiefer: #5B7083; --linie: #C9D3DC; --apricot: #F2B08F; --mint: #8FC7C0; --karte: #FFFFFF;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--grund); color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
h1, h2 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.1rem; }
a { color: var(--petrol); }
.leise { color: var(--schiefer); } .klein { font-size: .85rem; } .mitte-text { text-align: center; }

.kopf { position: sticky; top: 0; z-index: 5; background: var(--nacht); color: #fff;
  display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; gap: 8px;
  padding-top: max(10px, env(safe-area-inset-top)); }
.kopf a { color: #fff; text-decoration: none; }
.marke { font-weight: 700; white-space: nowrap; }
.kopf nav { display: flex; gap: 14px; font-size: .95rem; overflow-x: auto; }
.kopf nav a { white-space: nowrap; opacity: .9; }

.inhalt { max-width: 640px; margin: 0 auto; padding: 16px 16px 40px; }
.karte { background: var(--karte); border: 1px solid var(--linie); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; }
.karte.schmal { max-width: 380px; margin: 40px auto; text-align: center; }
.gross { font-size: 3rem; }
.meldung { border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; background: #fff; border: 1px solid var(--linie); }
.meldung.gut { background: #E3F3F1; border-color: var(--mint); }
.meldung.warn { background: #FDEBDD; border-color: var(--apricot); }
.pw { font: 700 1.3rem ui-monospace, Menlo, monospace; margin: 6px 0; user-select: all; }
.fehler { color: #B42318; }

.knopf, button { font: inherit; font-weight: 600; cursor: pointer; border: 0; border-radius: 10px;
  background: var(--orange); color: #fff; padding: 11px 18px; }
.knopf.zweit, button.zweit { background: #fff; color: var(--petrol); border: 1px solid var(--linie); }
button.klein { padding: 5px 10px; font-size: .8rem; font-weight: 500; }
label { display: block; text-align: left; font-weight: 600; font-size: .9rem; margin-bottom: 12px; }
input, select { font: inherit; width: 100%; margin-top: 4px; padding: 10px 12px; border: 1px solid var(--linie);
  border-radius: 10px; background: #fff; color: var(--text); }
form.inline { display: inline; }
.zeile { display: flex; gap: 8px; margin-top: 12px; } .zeile input { margin: 0; }

/* Spieltag */
.tagwahl { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.tagwahl h1 { margin: 0; }
.pfeil { width: 44px; height: 44px; display: grid; place-items: center; font-size: 2rem; text-decoration: none;
  color: var(--petrol); background: #fff; border: 1px solid var(--linie); border-radius: 12px; }
span.pfeil { visibility: hidden; }
.stand { text-align: center; margin: 0 0 8px; }
.datum { font-size: .9rem; color: var(--schiefer); text-transform: uppercase; letter-spacing: .04em; margin: 18px 0 6px; }
.spiel { padding: 10px 12px; }
.spiel.gesperrt { background: #F7F9FA; }
.spiel.laeuft { border-color: var(--orange); }
.zeit { font-size: .8rem; color: var(--schiefer); text-align: center; margin-bottom: 4px; }
.live { color: var(--orange); font-weight: 700; }
.paarung { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.team { font-weight: 600; font-size: .95rem; line-height: 1.2; }
.team.heim { text-align: right; } .team.gast { text-align: left; }
.tipp { display: flex; align-items: center; gap: 4px; }
.trenner { font-weight: 700; font-size: 1.3rem; }
.zahl { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.zahl input { width: 48px; margin: 0; padding: 6px 0; text-align: center; font-size: 1.3rem; font-weight: 700;
  -moz-appearance: textfield; }
.zahl input::-webkit-outer-spin-button, .zahl input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pm { width: 48px; padding: 2px 0; font-size: 1.1rem; line-height: 1.2; background: var(--grund); color: var(--text);
  border: 1px solid var(--linie); border-radius: 8px; }
.ergebnis { font-size: 1.5rem; font-weight: 800; min-width: 80px; text-align: center; }
.mein { margin-top: 8px; text-align: center; font-size: .9rem; }
.punkte { display: inline-block; min-width: 26px; padding: 1px 7px; border-radius: 999px; font-weight: 700;
  font-size: .8rem; background: var(--linie); color: var(--text); margin-left: 4px; text-align: center; }
.punkte.p3 { background: var(--orange); color: #fff; } .punkte.p2 { background: var(--mint); }
.andere { margin-top: 6px; font-size: .9rem; }
.andere summary { cursor: pointer; color: var(--petrol); text-align: center; }
.andere ul { list-style: none; margin: 6px 0 0; padding: 0; }
.andere li { display: flex; justify-content: space-between; padding: 3px 4px; border-bottom: 1px dashed var(--linie); }
.andere li.ich { font-weight: 700; }
.speichern-leiste { position: sticky; bottom: 0; padding: 12px 0 max(12px, env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--grund) 30%); }
.speichern-leiste .knopf { width: 100%; font-size: 1.05rem; padding: 14px; }
#tippform.geaendert .speichern-leiste .knopf { box-shadow: 0 0 0 3px var(--apricot); }

/* Tabellen */
.tabelle-karte { padding: 0; overflow-x: auto; }
.tabelle { width: 100%; border-collapse: collapse; }
.tabelle th, .tabelle td { padding: 8px 10px; border-bottom: 1px solid var(--linie); text-align: left; }
.tabelle thead th { font-size: .8rem; color: var(--schiefer); }
.tabelle .rechts { text-align: right; }
.tabelle tr.ich td { background: #FDEBDD; font-weight: 700; }
.tabelle tr.inaktiv td { opacity: .5; }
.klein-tab th, .klein-tab td { padding: 6px 8px; font-size: .85rem; }
.rang td:first-child { width: 2.5em; color: var(--schiefer); }

/* Umschalter Tippen / Übersicht */
.umschalter { display: flex; background: #fff; border: 1px solid var(--linie); border-radius: 12px; padding: 4px; margin-bottom: 12px; }
.umschalter a { flex: 1; text-align: center; padding: 8px; border-radius: 9px; text-decoration: none; color: var(--schiefer); font-weight: 600; }
.umschalter a.aktiv { background: var(--nacht); color: #fff; }

/* Spieltagsübersicht (Matrix) */
.matrix-karte { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.matrix { border-collapse: separate; border-spacing: 0; font-size: .85rem; min-width: 100%; }
.matrix th, .matrix td { padding: 6px 7px; border-bottom: 1px solid var(--linie); text-align: center; white-space: nowrap; }
.matrix thead th { font-size: .75rem; color: var(--schiefer); position: sticky; top: 0; background: #fff; }
.matrix .spiel-spalte { position: sticky; left: 0; z-index: 2; background: #fff; text-align: left; min-width: 118px;
  max-width: 140px; white-space: normal; border-right: 1px solid var(--linie); }
.matrix thead .spiel-spalte { z-index: 3; }
.matrix .paar { display: block; font-weight: 600; font-size: .8rem; line-height: 1.2; }
.matrix .erg { display: block; font-weight: 800; font-size: .95rem; }
.matrix .erg.live { color: var(--orange); }
.matrix td .t { display: block; font-weight: 600; }
.matrix td .p { display: block; font-size: .7rem; font-weight: 700; }
.matrix th.ich, .matrix td.ich { box-shadow: inset 0 0 0 9999px rgba(242,176,143,.18); }
.matrix tfoot td, .matrix tfoot th { font-size: .95rem; border-bottom: 0; border-top: 2px solid var(--nacht); }
.a-exakt { background: var(--orange); color: #fff; }
.a-differenz { background: var(--mint); }
.a-tendenz { background: #DCEFEC; }
.a-falsch { background: #F3F5F7; color: var(--schiefer); }
.legende { display: inline-block; padding: 1px 7px; border-radius: 6px; margin: 2px 2px 0 0; }

/* Admin-Korrektur */
.korrektur .k-kopf { display: flex; flex-direction: column; margin-bottom: 8px; }
.fest { color: var(--orange); font-weight: 700; }
.k-ergebnis, .k-tipp { display: flex; align-items: center; gap: 6px; }
.k-ergebnis { padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px dashed var(--linie); font-weight: 600; }
.k-tipps { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.k-name { flex: 1; font-size: .9rem; }
.k-tipp.inaktiv { opacity: .5; }
input.tor { width: 44px; margin: 0; padding: 5px 0; text-align: center; font-weight: 700; }
.haken { display: flex; align-items: center; gap: 6px; margin: 0 0 0 auto; font-weight: 500; font-size: .85rem; }
.haken input { width: auto; margin: 0; }
.protokoll { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.protokoll li { padding: 6px 0; border-bottom: 1px dashed var(--linie); }
@media (max-width: 420px) { .k-tipps { grid-template-columns: 1fr; } }

/* Bundesliga-Tabelle */
.tabellen-wahl label { max-width: 260px; }
.bl td, .bl th { padding: 7px 6px; }
.bl td:first-child { border-left: 4px solid transparent; text-align: center; font-weight: 700; width: 2.2em; }
.bl tr.z-cl td:first-child { border-left-color: var(--petrol); }
.bl tr.z-el td:first-child { border-left-color: var(--mint); }
.bl tr.z-ecl td:first-child { border-left-color: #C7E5E1; }
.bl tr.z-rel td:first-child { border-left-color: var(--apricot); }
.bl tr.z-ab td:first-child { border-left-color: var(--orange); }
.bl .verein { font-weight: 600; }
.bl .kurz { display: none; }
.form { display: block; margin-top: 2px; }
.form i { display: inline-block; width: 15px; height: 15px; line-height: 15px; font-size: 9px; font-style: normal;
  text-align: center; border-radius: 3px; color: #fff; margin-right: 2px; font-weight: 700; }
.f-S { background: var(--petrol); } .f-U { background: var(--schiefer); } .f-N { background: var(--orange); }
.legende.z-cl { background: var(--petrol); color: #fff; } .legende.z-el { background: var(--mint); }
.legende.z-ecl { background: #C7E5E1; } .legende.z-rel { background: var(--apricot); }
.legende.z-ab { background: var(--orange); color: #fff; }
@media (max-width: 520px) {
  .bl .lang { display: none; } .bl .kurz { display: inline; }
  .bl .breit { display: none; }
  .kopf nav { gap: 10px; font-size: .88rem; }
}
@media (max-width: 520px) {
  .marke-text, .nav-name { display: none; }
  .kopf { padding-left: 12px; padding-right: 12px; }
  .kopf nav { gap: 14px; font-size: .92rem; overflow: visible; }
}
.nachhol { display: inline-block; background: var(--apricot); color: var(--text); font-weight: 700; padding: 0 6px; border-radius: 4px; }

/* Vereinslogos (klein links neben dem Namen) */
img.logo { width: 20px; height: 20px; object-fit: contain; vertical-align: middle; margin-right: 6px; flex: none; }
img.logo.mini { width: 14px; height: 14px; margin-right: 3px; }
.team { display: flex; align-items: center; gap: 0; }
.team.heim { justify-content: flex-end; text-align: right; }
.team.gast { justify-content: flex-start; }
.bl .verein img.logo { margin-top: -2px; }

/* Wer hat getippt? / Tipps aller */
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 8px; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .75rem; line-height: 1.5;
  border: 1px solid var(--linie); background: #fff; color: var(--schiefer); white-space: nowrap; }
.chip.getippt { background: #E3F3F1; border-color: var(--mint); color: #1E5E57; font-weight: 600; }
.chip.offen { background: #F3F5F7; color: #8A9AA8; }
.chip.ich { outline: 2px solid var(--apricot); outline-offset: 0; }
.tipp-chip strong { color: var(--text); margin-left: 2px; }
.tipp-chip em { font-style: normal; font-weight: 700; margin-left: 2px; }
.tipp-chip.a-exakt { background: var(--orange); border-color: var(--orange); color: #fff; }
.tipp-chip.a-exakt strong { color: #fff; }
.tipp-chip.a-differenz { background: var(--mint); border-color: var(--mint); color: var(--text); }
.tipp-chip.a-tendenz { background: #DCEFEC; border-color: #C7E5E1; color: var(--text); }
.tipp-chip.kein { opacity: .55; }
.fehlend-box { font-size: .9rem; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 10px 12px; }
.fehlend-box strong { margin-right: 2px; }
.fehlend-box .chip { font-size: .8rem; background: #FDEBDD; border-color: var(--apricot); color: var(--text); }
/* Übersicht: Heim und Gast untereinander */
.matrix .zeile-team { display: flex; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.matrix .spiel-spalte { min-width: 112px; }
