/* Gemeinsame Styles fuer alle Turnierseiten (index/vorrunde/gewinnerrunde/
   verliererrunde/spielplan.html). live.html hat ein eigenes, bewusst
   schlankeres Style-Set fuer die Feldansicht und nutzt diese Datei nicht. */
:root {
  --blau: #1041B7;
  --blau-dunkel: #09276D;
  --blau-tief: #08205B;
  --grau: #A9A9A9;
  --hell: #F4F6FB;
  --weiss: #FFFFFF;
  --gruen: #1E9E54;
  --rot: #C62828;
  --gold: #E8A317;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--hell);
  color: var(--blau-dunkel);
  -webkit-text-size-adjust: 100%;
}

a { color: inherit; }

header.kopf {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--blau);
  color: var(--weiss);
  padding: 10px 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}

.kopf-zeile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kopf-zeile img.wappen {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--weiss);
  padding: 3px;
  flex-shrink: 0;
}

.kopf-titel { flex: 1; min-width: 0; }
.kopf-titel h1 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
  font-weight: 700;
}
.kopf-titel .verein {
  font-size: .75rem;
  opacity: .9;
}

.phase-badge {
  display: inline-block;
  margin-top: 4px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
}

.update-zeile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  font-size: .72rem;
  opacity: .92;
}

button.refresh {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.5);
  color: var(--weiss);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: .72rem;
  cursor: pointer;
}
button.refresh:active { background: rgba(255,255,255,.3); }

nav.jump {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 12px 10px;
  background: var(--blau-dunkel);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
nav.jump::-webkit-scrollbar { display: none; }

nav.jump a {
  flex-shrink: 0;
  text-decoration: none;
  color: var(--weiss);
  background: rgba(255,255,255,.12);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
}
nav.jump a.aktiv {
  background: var(--weiss);
  color: var(--blau-tief);
}
nav.jump a.live {
  background: var(--gold);
  color: var(--blau-tief);
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 10px 60px;
}

section.abschnitt {
  margin-bottom: 26px;
  scroll-margin-top: 100px;
}

section.abschnitt > h2 {
  font-size: 1.05rem;
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 3px solid var(--blau);
  color: var(--blau-dunkel);
}

details.gruppe {
  background: var(--weiss);
  border-radius: var(--radius);
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  overflow: hidden;
}
details.gruppe[open] summary { border-bottom: 1px solid #e5e9f2; }
details.gruppe summary {
  padding: 10px 12px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
details.gruppe summary::-webkit-details-marker { display: none; }
details.gruppe summary .chevron { transition: transform .15s; color: var(--blau); }
details.gruppe[open] summary .chevron { transform: rotate(90deg); }

table.tabelle {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}
table.tabelle th, table.tabelle td {
  padding: 6px 6px;
  text-align: center;
  border-bottom: 1px solid #eef1f7;
}
table.tabelle th:first-child, table.tabelle td:first-child { width: 28px; }
table.tabelle td.team, table.tabelle th.team {
  text-align: left;
  font-weight: 600;
}
table.tabelle tr.weiter td.team { color: var(--gruen); }
table.tabelle tr.stechen { background: #fff8e6; }
table.tabelle tbody tr:last-child td { border-bottom: none; }

.stechen-badge {
  display: inline-block;
  margin-left: 4px;
  cursor: help;
  line-height: 0;
}
.stechen-badge svg {
  width: 1.1em;
  height: 1.1em;
  vertical-align: middle;
}
.stechen-badge.dringend {
  color: var(--rot);
  animation: dringend-pulse 1.6s infinite;
}
@keyframes dringend-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

.stechen-legende {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: .8rem;
  color: #666;
  margin-top: 6px;
}
.stechen-legende-eintrag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.stechen-legende .stechen-badge {
  margin-left: 0;
  cursor: default;
}

.losentscheid-banner {
  background: #fdecea;
  border: 2px solid var(--rot);
  color: var(--rot);
  border-radius: var(--radius);
  margin: 10px;
  padding: 10px 14px;
  font-size: .88rem;
}
.losentscheid-banner ul {
  margin: 6px 0 0;
  padding-left: 20px;
}

.hinweis-vorgerueckt { color: var(--gruen); font-weight: 600; }
.hinweis-ausgeschieden { color: var(--grau); }

ul.spiele {
  list-style: none;
  margin: 0;
  padding: 6px 10px 10px;
}
ul.spiele li {
  padding: 7px 2px;
  font-size: .85rem;
  border-bottom: 1px dashed #eef1f7;
}
ul.spiele li:last-child { border-bottom: none; }
.spiel-meta {
  font-size: .68rem;
  color: var(--grau);
  margin-bottom: 2px;
}
ul.spiele .spiel-paarung {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
ul.spiele .team1, ul.spiele .team2 {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
ul.spiele .team2 { text-align: right; }
ul.spiele .ergebnis {
  flex-shrink: 0;
  font-weight: 700;
  background: var(--hell);
  border-radius: 6px;
  padding: 2px 8px;
  min-width: 46px;
  text-align: center;
}
ul.spiele .ergebnis.offen {
  color: var(--grau);
  font-weight: 500;
  background: none;
}
ul.spiele li.gewonnen1 .team1, ul.spiele li.gewonnen2 .team2 { color: var(--gruen); }
ul.spiele li.istlive { background: #fff8e6; border-radius: 8px; }

.bracket-runde {
  margin-bottom: 14px;
}
.bracket-runde h3 {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--grau);
  margin: 0 0 6px;
}
.bracket-spiele {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.bracket-match {
  background: var(--weiss);
  border-radius: var(--radius);
  padding: 8px 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  font-size: .85rem;
}
.bracket-match.istlive { border: 2px solid var(--gold); }
.bracket-match .zeile {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
}
.bracket-match .zeile.gewinner { font-weight: 700; color: var(--gruen); }
.bracket-match .zeile .kubbs { font-weight: 700; color: var(--blau-dunkel); }
.finale-saetze {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--hell);
  display: flex;
  gap: 10px;
  font-size: .72rem;
  color: var(--grau);
}
.saetze-klein {
  font-size: .72rem;
  color: var(--grau);
}

table.endstand {
  width: 100%;
  border-collapse: collapse;
  background: var(--weiss);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  font-size: .85rem;
}
table.endstand td, table.endstand th {
  padding: 8px 10px;
  border-bottom: 1px solid #eef1f7;
}
table.endstand th { text-align: left; background: var(--hell); }
table.endstand td:first-child { font-weight: 700; width: 36px; color: var(--blau); }
table.endstand.platzierung tr:nth-child(-n+3) td:first-child { color: var(--gold); }

table.spielplan {
  width: 100%;
  border-collapse: collapse;
  background: var(--weiss);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  font-size: .82rem;
}
table.spielplan td, table.spielplan th {
  padding: 7px 8px;
  border-bottom: 1px solid #eef1f7;
  text-align: left;
}
table.spielplan th { background: var(--hell); }
table.spielplan td:first-child, table.spielplan th:first-child { width: 40px; color: var(--blau); font-weight: 700; }
table.spielplan td.ergebnis { text-align: center; font-weight: 700; white-space: nowrap; }
table.spielplan td.kontext { color: var(--grau); font-size: .74rem; }
table.spielplan tr.istlive { background: #fff8e6; }

.leer {
  text-align: center;
  color: var(--grau);
  font-size: .85rem;
  padding: 20px 10px;
}

.hinweis-knapp {
  color: var(--rot);
  font-weight: 700;
  margin: -4px 0 10px;
}

.hinweis-erklaerung {
  color: var(--grau);
  font-size: .82rem;
  margin: -4px 0 12px;
}

article.regeln {
  background: var(--weiss);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  font-size: .92rem;
  line-height: 1.55;
}
article.regeln h1 { font-size: 1.25rem; margin: 0 0 6px; color: var(--blau-dunkel); }
article.regeln > p:first-of-type { color: var(--grau); font-size: .8rem; }
article.regeln h2 {
  font-size: 1.05rem;
  margin: 22px 0 8px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--blau);
  color: var(--blau-dunkel);
}
article.regeln h3 { font-size: .92rem; margin: 14px 0 6px; color: var(--blau); }
article.regeln p, article.regeln ul, article.regeln ol { margin: 0 0 10px; }
article.regeln ul, article.regeln ol { padding-left: 22px; }
article.regeln li { margin-bottom: 4px; }
article.regeln blockquote {
  margin: 10px 0;
  padding: 8px 12px;
  background: var(--hell);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  font-size: .85rem;
  color: var(--blau-dunkel);
}
article.regeln blockquote p:last-child { margin-bottom: 0; }
article.regeln table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 16px;
  font-size: .8rem;
}
article.regeln table th, article.regeln table td {
  padding: 6px 8px;
  border-bottom: 1px solid #eef1f7;
  text-align: left;
}
article.regeln table th { background: var(--hell); }
article.regeln a { color: var(--blau); }
article.regeln img { display: block; width: 90px; margin: 20px auto 0; }

.team-suche {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  font-size: .95rem;
  border: 1px solid #d7ddea;
  border-radius: var(--radius);
  background: var(--weiss);
  color: var(--blau-dunkel);
}
.team-suche:focus { outline: none; border-color: var(--blau); }

.team-karte {
  margin-top: 10px;
  background: var(--weiss);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.team-karte h3 {
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--grau);
  margin: 10px 0 6px;
}
.team-karte .team-status {
  margin: 0;
  font-weight: 600;
  color: var(--blau-dunkel);
}
.team-karte ul.spiele { padding: 0; }

footer {
  text-align: center;
  font-size: .72rem;
  color: var(--grau);
  padding: 20px 10px 30px;
}
footer a { color: var(--blau); text-decoration: none; }

@media (min-width: 640px) {
  .kopf-titel h1 { font-size: 1.25rem; }
  table.tabelle, ul.spiele { font-size: .9rem; }
}
