:root {
  --grund: #F4F5F2;
  --karte: #FFFFFF;
  --text: #15171C;
  --leise: #5A606B;
  --linie: #E2E4E0;
  --blau: #1C56C9;
  --blau-hell: #E6EEFB;
  --orange: #F08A4B;
  --orange-hell: #FDEDE3;
  --dunkel: #15171C;
  --gruen: #1F8A4C;
  --rot: #C23B32;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--grund); color: var(--text);
  font-family: Barlow, system-ui, sans-serif; font-size: 17px; line-height: 1.4;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
a { color: var(--blau); }
h1, h2, h3 { font-family: 'Barlow Condensed', Barlow, sans-serif; margin: 0; line-height: 1.1; }
h1 { font-size: 30px; }
h2 { font-size: 23px; margin: 22px 0 10px; }
h3 { font-size: 19px; }

.kopf {
  position: sticky; top: 0; z-index: 5; background: var(--dunkel); color: #fff;
  display: flex; justify-content: space-between; align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
}
.marke { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; letter-spacing: .04em; font-size: 18px; }
.verbindung { width: 10px; height: 10px; border-radius: 50%; background: #777; }
.verbindung.an { background: #3CCB72; }

main { max-width: 520px; margin: 0 auto; padding: 16px; }
.leer { color: var(--leise); text-align: center; padding: 30px 0; }
.rechtliches { text-align: center; font-size: 13px; color: var(--leise); padding: 8px 16px 16px; }
.rechtliches a { color: var(--leise); }

.leiste {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: var(--karte);
  border-top: 1px solid var(--linie); display: flex; justify-content: center;
  padding-bottom: env(safe-area-inset-bottom);
}
.leiste a {
  flex: 1; max-width: 174px; text-align: center; text-decoration: none; color: var(--leise);
  font-size: 13px; font-weight: 600; padding: 8px 0 10px; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.leiste a .sym { font-size: 21px; filter: grayscale(1); opacity: .7; }
.leiste a.aktiv { color: var(--blau); }
.leiste a.aktiv .sym { filter: none; opacity: 1; }

.karte { background: var(--karte); border-radius: 14px; padding: 16px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.karte .zeile { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.unter { color: var(--leise); font-size: 15px; }
.etikett { display: inline-block; font-size: 13px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: var(--blau-hell); color: var(--blau); white-space: nowrap; }
.etikett.orange { background: var(--orange-hell); color: #A4501C; }
.etikett.gruen { background: #E3F4EA; color: var(--gruen); }
.etikett.grau { background: #ECEDEA; color: var(--leise); }

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 10px; padding: 12px 16px; font: inherit; font-weight: 700;
  background: var(--blau); color: #fff; cursor: pointer; text-decoration: none; min-height: 46px;
}
.knopf.voll { width: 100%; }
.knopf.zweit { background: var(--blau-hell); color: var(--blau); }
.knopf.orange { background: var(--orange); color: #fff; }
.knopf.gefahr { background: #FBE6E4; color: var(--rot); }
.knopf.klein { padding: 7px 11px; min-height: 36px; font-size: 15px; }
.knopf:disabled { opacity: .45; cursor: default; }
.knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.reiter { display: flex; background: #E9EBE6; border-radius: 10px; padding: 4px; margin: 14px 0; }
.reiter a { flex: 1; text-align: center; padding: 8px 0; border-radius: 8px; text-decoration: none; color: var(--leise); font-weight: 600; }
.reiter a.aktiv { background: var(--karte); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.spiel { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 12px 14px; text-decoration: none; color: inherit; }
.spiel .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spiel .name.rechts { text-align: right; }
.spiel .stand { font-family: 'Barlow Condensed', sans-serif; font-size: 24px; font-weight: 700; text-align: center; white-space: nowrap; }
.spiel .stand small { font-family: Barlow, sans-serif; font-size: 12px; font-weight: 600; color: var(--leise); }
.spiel.meins { outline: 2px solid var(--blau); }
.spiel .sieger { color: var(--gruen); }
.liste-spiele .karte { padding: 0; }
.spiel-info { grid-column: 1 / -1; text-align: center; font-size: 13px; color: var(--leise); margin-top: -4px; }

table.tabelle { width: 100%; border-collapse: collapse; font-size: 16px; }
.tabelle th { text-align: right; font-size: 13px; color: var(--leise); font-weight: 600; padding: 6px 4px; border-bottom: 1px solid var(--linie); }
.tabelle td { text-align: right; padding: 9px 4px; border-bottom: 1px solid #EEF0EC; }
.tabelle th:nth-child(2), .tabelle td:nth-child(2) { text-align: left; }
.tabelle th:first-child, .tabelle td:first-child { text-align: left; width: 26px; }
.tabelle td.pkt { font-weight: 700; }
.tabelle tr.ko-linie td { border-bottom: 2px solid var(--blau); }
.tabelle tr.ich td { background: var(--blau-hell); }

/* Spielansicht */
.anzeige { background: var(--dunkel); color: #fff; border-radius: 16px; padding: 14px 16px; }
.anzeige .namen { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; font-weight: 600; font-size: 16px; color: #DDE1E7; }
.anzeige .namen span:last-child { text-align: right; }
.anzeige .gross { text-align: center; font-family: 'Barlow Condensed', sans-serif; font-size: 54px; font-weight: 700; line-height: 1.05; }
.anzeige .gross small { font-family: Barlow, sans-serif; font-size: 15px; font-weight: 600; color: #AEB5C0; }
.anzeige .info { text-align: center; font-size: 14px; color: #AEB5C0; }

.zaehler { position: relative; height: 300px; margin: 14px 0 10px; border-radius: 18px; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.zaehler button { position: absolute; left: 0; right: 0; height: 50%; border: 0; font: inherit; cursor: pointer; color: #fff; font-weight: 700; font-size: 20px; display: flex; padding: 14px 18px; -webkit-tap-highlight-color: transparent; }
.zaehler .plus { top: 0; background: var(--blau); align-items: flex-start; }
.zaehler .minus { bottom: 0; background: #163F94; align-items: flex-end; }
.zaehler button:active { filter: brightness(1.15); }
.zaehler .zahl { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; color: #fff; }
.zaehler .zahl b { font-family: 'Barlow Condensed', sans-serif; font-size: 120px; line-height: 1; }
.zaehler .zahl span { font-size: 15px; font-weight: 600; opacity: .85; }
.zaehler.gesperrt button { background: #6B7280; cursor: default; }

.runden { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.runden button { flex: 1; min-width: 52px; border: 2px solid transparent; border-radius: 10px; background: var(--karte); padding: 6px 0; font: inherit; cursor: pointer; color: var(--text); }
.runden button small { display: block; font-size: 12px; color: var(--leise); font-weight: 600; }
.runden button b { font-size: 20px; }
.runden button.gewaehlt { border-color: var(--blau); }
.runden button.offen { opacity: .45; }
.runden button:disabled { cursor: default; }

.seitenwahl { display: flex; gap: 8px; margin-top: 12px; }
.seitenwahl .knopf { flex: 1; }

.verlauf td, .verlauf th { text-align: center !important; }

.podest { text-align: center; }
.podest .platz { padding: 8px 0; font-size: 18px; }
.podest .platz b { font-size: 22px; }

form label { display: block; font-weight: 600; font-size: 15px; margin: 12px 0 4px; }
input, select { width: 100%; font: inherit; padding: 11px 12px; border: 1px solid #CFD2CC; border-radius: 10px; background: #fff; color: var(--text); }
.wahl { display: flex; gap: 6px; flex-wrap: wrap; }
.wahl button { flex: 1; border: 1px solid #CFD2CC; background: #fff; border-radius: 10px; padding: 10px 6px; font: inherit; font-weight: 600; cursor: pointer; color: var(--text); }
.wahl button.an { background: var(--blau); border-color: var(--blau); color: #fff; }
.hinweis { font-size: 14px; color: var(--leise); margin-top: 6px; }
.eingabe-zeile { display: flex; gap: 8px; margin-top: 10px; }
.eingabe-zeile input { flex: 1; }

.spielerliste { list-style: none; padding: 0; margin: 8px 0 0; }
.spielerliste li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid #EEF0EC; }
.spielerliste li:last-child { border-bottom: 0; }

.meldung { position: fixed; left: 16px; right: 16px; bottom: calc(86px + env(safe-area-inset-bottom)); max-width: 488px; margin: 0 auto; background: var(--dunkel); color: #fff; padding: 12px 14px; border-radius: 12px; z-index: 10; font-weight: 600; }
.meldung.fehler { background: var(--rot); }
