/* ============================================================
   Hallenturnier-Manager – Designsystem
   TSV Ratekau · Rot / Blau / Weiß
   ============================================================ */

:root {
  /* Farben */
  --ink:        #0d1526;   /* dunkles Marine-Schwarz */
  --ink-soft:   #23304a;
  --paper:      #eef1f5;   /* App-Hintergrund */
  --surface:    #ffffff;
  --surface-2:  #f7f9fc;
  --border:     #e4e8ef;
  --border-2:   #d4dae4;
  --muted:      #64707f;
  --muted-2:    #8a94a3;

  --red:        #e1251e;   /* Primär (Logo-Rot) */
  --red-600:    #c11911;
  --red-50:     #fdeceb;
  --blue:       #0e6fb5;   /* Sekundär / Interaktion (Logo-Blau) */
  --blue-600:   #0a5894;
  --blue-50:    #eaf4fb;

  --zone-semi:  #10a37a;   /* Quali: Halbfinale */
  --zone-p5:    #e0a106;   /* Quali: Spiel um Platz 5 */
  --zone-out:   #c2c7d0;   /* ausgeschieden */
  --gold:       #e3b004;
  --silver:     #aab4c0;
  --bronze:     #cd7f46;

  /* Radius & Schatten */
  --r-sm: 10px;  --r: 14px;  --r-lg: 20px;  --r-xl: 28px;
  --shadow-sm: 0 1px 2px rgba(13,21,38,.06), 0 1px 3px rgba(13,21,38,.05);
  --shadow:    0 2px 4px rgba(13,21,38,.05), 0 8px 24px rgba(13,21,38,.07);
  --shadow-lg: 0 10px 30px rgba(13,21,38,.12), 0 30px 60px rgba(13,21,38,.12);

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-disp: "Barlow Condensed", "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  font-feature-settings: "cv05", "ss01";
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-600); }

h1, h2, h3 { margin: 0; }

.container { max-width: 1180px; margin: 0 auto; padding: 28px 20px 64px; }

/* ---------- Masthead ---------- */
.masthead {
  position: relative;
  background:
    radial-gradient(900px 360px at 88% -40%, rgba(225,37,30,.42), transparent 62%),
    linear-gradient(90deg, #11213d, #0b1730);
  color: #fff;
  overflow: hidden;
}
.masthead-inner {
  position: relative; z-index: 1;
  max-width: 1180px; margin: 0 auto; padding: 22px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 18px; min-width: 0; }
.brand-badge { flex: 0 0 auto; height: 66px; display: flex; align-items: center; }
.brand-badge img { height: 100%; width: auto; object-fit: contain; display: block; filter: drop-shadow(0 3px 10px rgba(0,0,0,.4)); }
.brand-text { min-width: 0; }
.brand-kicker {
  display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: #ff9d98;
}
.brand-title {
  font-family: var(--font-disp); font-weight: 700; letter-spacing: .04em;
  font-size: clamp(26px, 4.4vw, 44px); line-height: 1.02; text-transform: uppercase;
  margin: 2px 0 3px; color: #ff9d98;
}
.brand-meta { font-size: 13.5px; color: #b9c4d6; }
.brand-meta b { color: #fff; font-weight: 600; }
.masthead-nav { display: flex; gap: 10px; flex: 0 0 auto; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px;
  background: rgba(255,255,255,.1); color: #fff; font-weight: 600; font-size: 14px;
  border: 1px solid rgba(255,255,255,.18); transition: background .15s;
}
.btn-ghost:hover { background: rgba(255,255,255,.2); color: #fff; }
.masthead-accent { position: relative; z-index: 1; height: 4px;
  background: linear-gradient(90deg, var(--red) 0%, var(--red) 62%, var(--blue) 62%, var(--blue) 100%); }

/* ---------- Layout ---------- */
.grid-main { display: grid; grid-template-columns: 1.55fr 1fr; gap: 20px; align-items: start; }
.col-side { display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 860px) { .grid-main { grid-template-columns: 1fr; } }

/* ---------- Panel ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  padding: 20px 22px; margin-bottom: 20px;
}
.panel:last-child { margin-bottom: 0; }
.panel-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--red); background: var(--red-50); padding: 4px 9px; border-radius: 6px;
}
.panel-head h2 {
  font-family: var(--font-disp); font-weight: 600; text-transform: uppercase;
  letter-spacing: .02em; font-size: 23px; color: var(--ink);
}

/* ---------- Leaderboard ---------- */
.leaderboard { width: 100%; border-collapse: separate; border-spacing: 0; }
.leaderboard thead th {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted-2); padding: 0 8px 10px; text-align: center; white-space: nowrap;
}
.leaderboard thead th.l { text-align: left; }
.leaderboard tbody td {
  padding: 11px 8px; text-align: center; border-top: 1px solid var(--border);
  font-variant-numeric: tabular-nums; font-size: 15px;
}
.leaderboard tbody tr:first-child td { border-top: 0; }
.leaderboard td.rank { width: 40px; box-shadow: inset 4px 0 0 var(--zone, transparent); border-radius: 2px 0 0 2px; }
.rank-badge {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border-2);
  font-weight: 700; font-size: 13px; color: var(--ink);
}
.leaderboard td.team { text-align: left; font-weight: 600; letter-spacing: .005em; }
.leaderboard td.num { color: var(--ink-soft); }
.leaderboard td.goals { color: var(--muted); font-size: 14px; }
.leaderboard td.diff .pos { color: var(--zone-semi); }
.leaderboard td.diff .neg { color: var(--red); }
.leaderboard td.pts { font-family: var(--font-disp); font-weight: 700; font-size: 22px; color: var(--ink); }
.leaderboard tbody tr.zone-semi { --zone: var(--zone-semi); }
.leaderboard tbody tr.zone-p5   { --zone: var(--zone-p5); }
.leaderboard tbody tr.zone-out  { --zone: var(--zone-out); }
.leaderboard tbody tr:hover td { background: var(--surface-2); }

.quali-legend { display: flex; flex-wrap: wrap; gap: 14px 20px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border-2); }
.quali-legend span { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.quali-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.dot-semi { background: var(--zone-semi); }
.dot-p5 { background: var(--zone-p5); }
.dot-out { background: var(--zone-out); }

/* ---------- Fixtures (Spiellisten) ---------- */
.fixtures { list-style: none; margin: 0; padding: 0; }
.fixture {
  display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center;
  padding: 11px 0; border-top: 1px solid var(--border);
}
.fixture:first-child { border-top: 0; }
.fx-time {
  font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px; padding: 3px 8px; min-width: 52px; text-align: center;
}
.fx-teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.fx-home { text-align: right; }
.fx-away { text-align: left; }
.fx-home, .fx-away { font-weight: 500; }
.fx-home.is-winner, .fx-away.is-winner { font-weight: 700; }
.fx-vs { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--muted-2); text-transform: uppercase; }
.fx-score {
  font-family: var(--font-disp); font-weight: 700; font-size: 18px; color: #fff;
  background: var(--ink); border-radius: 8px; padding: 2px 10px; letter-spacing: .02em;
}
.fx-score i { font-style: normal; opacity: .55; margin: 0 1px; }
.empty { padding: 18px 2px; color: var(--muted); font-size: 14px; }

/* ---------- Finalrunde: Bracket-Karten ---------- */
.finals-panel .bracket {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px;
}
.ko-card {
  position: relative; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 10px;
  transition: box-shadow .15s, transform .15s;
}
.ko-card.is-played { background: #fff; box-shadow: var(--shadow-sm); }
.ko-card.is-final { border-color: var(--red); background: linear-gradient(180deg, var(--red-50), #fff); }
.ko-stage {
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--blue);
  display: flex; align-items: center; justify-content: space-between;
}
.ko-card.is-final .ko-stage { color: var(--red); }
.ko-time { font-size: 11.5px; font-weight: 600; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.ko-teams { display: flex; flex-direction: column; gap: 6px; }
.ko-team {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 14.5px; color: var(--ink-soft);
}
.ko-team span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ko-team b { font-family: var(--font-disp); font-weight: 700; font-size: 18px; min-width: 20px; text-align: right; color: var(--muted-2); }
.ko-team.is-winner { color: var(--ink); font-weight: 700; }
.ko-team.is-winner b { color: var(--ink); }
.ko-note { position: absolute; top: 12px; right: 12px; font-size: 10px; font-weight: 700; color: var(--red); background: var(--red-50); padding: 1px 6px; border-radius: 5px; }

/* ---------- Endstand ---------- */
.endstand-panel { background: linear-gradient(135deg, var(--ink), #16263f); border-color: transparent; color: #fff; }
.endstand-panel .panel-head h2 { color: #fff; }
.endstand-panel .eyebrow { color: var(--gold); background: rgba(227,176,4,.15); }
.standenlist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px 22px; }
.standenlist li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.st-pl { font-family: var(--font-disp); font-weight: 700; font-size: 20px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: rgba(255,255,255,.08); color: #cdd7e6; }
.st-name { font-weight: 600; font-size: 15.5px; }
.standenlist li.p1 .st-pl { background: var(--gold); color: #3a2c00; }
.standenlist li.p2 .st-pl { background: var(--silver); color: #26303a; }
.standenlist li.p3 .st-pl { background: var(--bronze); color: #fff; }
.standenlist li.p1 .st-name { font-size: 17px; }

/* ============================================================
   TV-Ansicht – Broadcast-Optik (16:9, skaliert bis 4K via vw/vh)
   ============================================================ */
body.tv {
  background:
    radial-gradient(1400px 700px at 80% -10%, rgba(225,37,30,.18), transparent 60%),
    linear-gradient(160deg, #0a1324 0%, #0b1730 60%, #0a1222 100%);
  color: #eef3fb; overflow: hidden;
}
.tv-screen { width: 100vw; height: 100vh; display: flex; flex-direction: column; }

.tv-header {
  position: relative; flex: 0 0 auto; height: 12vh; display: flex; align-items: center; gap: 1.6vw;
  padding: 0 2.4vw; overflow: hidden;
  background:
    radial-gradient(55vw 22vh at 90% -40%, rgba(225,37,30,.42), transparent 62%),
    linear-gradient(90deg, #11213d, #0b1730);
}
.tv-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: .45vh;
  background: linear-gradient(90deg, var(--red) 0 62%, var(--blue) 62% 100%);
}
.tv-header > * { position: relative; z-index: 1; }
.tv-badge { display: flex; align-items: center; height: 9.5vh; }
.tv-badge img { height: 100%; width: auto; object-fit: contain; filter: drop-shadow(0 .4vh 1.2vh rgba(0,0,0,.45)); }
.tv-head-text { display: flex; flex-direction: column; justify-content: center; }
.tv-header h1 { font-family: var(--font-disp); font-weight: 700; text-transform: uppercase; font-size: 3.4vw; line-height: 1; letter-spacing: .05em; color: #ff9d98; margin: 0; }
.tv-when { margin-left: auto; display: flex; align-items: center; }
.tv-clock {
  font-family: var(--font-disp); font-weight: 700; font-size: 2.8vw; color: #fff;
  font-variant-numeric: tabular-nums; letter-spacing: .03em;
}

.tv-cols { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 1.1vw; padding: 1.6vh 2.4vw; }
.tv-panel { background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.08); border-radius: 1vw; padding: 1.4vh 1.3vw; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.tv-panel h2 {
  font-family: var(--font-disp); font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  font-size: 1.6vw; color: #fff; margin: 0 0 1.2vh; padding-bottom: .8vh; position: relative;
}
.tv-panel h2::after { content: ""; position: absolute; left: 0; bottom: 0; width: 2.4vw; height: .35vh; background: var(--red); border-radius: 2px; }
.tv-panel :is(table, ul, ol) + h2 { margin-top: 1.8vh; }

.tv-standings { width: 100%; border-collapse: collapse; }
.tv-standings th { font-size: .95vw; color: #93a1b8; text-transform: uppercase; letter-spacing: .06em; padding: .5vh .4vw; }
.tv-standings td { font-size: 1.65vw; padding: .62vh .4vw; border-top: 1px solid rgba(255,255,255,.06); }
.tv-standings tbody tr:first-child td { border-top: 0; }
.tv-standings th:not(.team), .tv-standings td:not(.team) { text-align: center; }
.tv-standings th.team, .tv-standings td.team { text-align: left; font-weight: 600; }
.tv-standings td.rk { color: #8ea0ba; width: 2.4vw; font-weight: 600; }
.tv-standings td.pts { font-family: var(--font-disp); font-size: 2vw; font-weight: 700; color: #fff; }

/* Aktuelles Spiel (mittlerer Kasten, hervorgehoben) */
.tv-now {
  background: linear-gradient(120deg, rgba(225,37,30,.2), rgba(225,37,30,.04));
  border: 1px solid rgba(225,37,30,.55); border-radius: 1vw;
  padding: 1.6vh 1.4vw; margin-bottom: 1.8vh; box-shadow: 0 .6vh 2vh rgba(0,0,0,.28);
}
.tv-now-tag { display: inline-flex; align-items: center; gap: .5em; font-size: .95vw; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #ff9d98; margin-bottom: 1vh; }
.tv-now-teams { display: flex; align-items: center; gap: 1vw; font-family: var(--font-disp); font-weight: 700; text-transform: uppercase; font-size: 2.1vw; line-height: 1.05; }
.tv-now-teams .t { flex: 1; min-width: 0; font-size: 1.85vw; }
.tv-now-teams .t:first-child { text-align: right; }
.tv-now-teams .t:last-child { text-align: left; }
.tv-now-teams em { flex: 0 0 auto; font-style: normal; color: #ff9d98; font-size: 1.5vw; }

.tv-list { list-style: none; margin: 0; padding: 0; }
.tv-list li { display: flex; gap: .9vw; align-items: center; font-size: 1.32vw; padding: .68vh 0; border-top: 1px solid rgba(255,255,255,.06); }
.tv-list li:first-child { border-top: 0; }
.tv-list .time { font-variant-numeric: tabular-nums; color: #93a1b8; font-weight: 600; font-size: 1.1vw; background: rgba(255,255,255,.06); border-radius: .4vw; padding: .2vh .6vw; min-width: 4.4vw; text-align: center; }
.tv-list .teams { flex: 1; }
.tv-list strong { font-family: var(--font-disp); font-weight: 700; color: #fff; background: rgba(225,37,30,.9); border-radius: .4vw; padding: 0 .6vw; margin: 0 .3vw; }
.tv-list.finals li { flex-wrap: wrap; }
.tv-list.finals .lbl { order: -1; width: 100%; font-size: .9vw; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #6fb2e6; }
.tv-list.finals .ne { color: #ff8c86; font-style: normal; font-size: .9vw; }

.tv-endstand { list-style: none; margin: 0; padding: 0; }
.tv-endstand li { display: flex; gap: .9vw; align-items: center; font-size: 1.45vw; padding: .55vh 0; }
.tv-endstand .pl { font-family: var(--font-disp); font-weight: 700; width: 2.2vw; height: 2.2vw; display: grid; place-items: center; border-radius: .5vw; background: rgba(255,255,255,.08); color: #cdd7e6; font-size: 1.3vw; }
.tv-endstand li.p1 .pl { background: var(--gold); color: #3a2c00; }
.tv-endstand li.p2 .pl { background: var(--silver); color: #26303a; }
.tv-endstand li.p3 .pl { background: var(--bronze); color: #fff; }
.tv-endstand li.p1 { font-weight: 700; }

/* Sponsorenleiste */
.tv-sponsors { flex: 0 0 auto; height: 17vh; display: flex; flex-direction: column; gap: 1vh; padding: 1.2vh 2.4vw 1.8vh; background: rgba(0,0,0,.28); border-top: 1px solid rgba(255,255,255,.08); }
.tv-sponsors-label { flex: 0 0 auto; font-size: .9vw; font-weight: 700; text-transform: uppercase; letter-spacing: .18em; color: #7f8da5; }
.tv-sponsor-row { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; gap: 1.8vw; }
.tv-sponsor {
  flex: 1 1 0; height: 100%; min-width: 0; display: flex; align-items: center; justify-content: center;
  padding: .9vh 1.8vw; background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.14);
  border-radius: 1vw; box-shadow: 0 .5vh 1.6vh rgba(0,0,0,.25);
}
.tv-sponsor img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ============================================================
   Verwaltung (Admin)
   ============================================================ */
body.admin { background: var(--paper); }

/* Scoreboard-Hero: aktuelles Spiel */
.hero-match {
  position: relative; overflow: hidden; margin-bottom: 20px;
  background: radial-gradient(900px 300px at 90% -60%, rgba(225,37,30,.4), transparent 60%), linear-gradient(120deg, var(--ink), #13243e);
  color: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 20px 24px;
}
.hero-top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.hero-label { display: inline-flex; align-items: center; gap: .5em; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #fff; background: var(--red); padding: 5px 11px; border-radius: 999px; }
.hero-meta { font-size: 13.5px; color: #b9c4d6; font-variant-numeric: tabular-nums; }
.hero-form { display: grid; grid-template-columns: 1fr auto auto auto 1fr; align-items: center; gap: 10px 16px; }
.hero-side { font-family: var(--font-disp); font-weight: 600; text-transform: uppercase; letter-spacing: .01em; font-size: clamp(20px, 3vw, 30px); line-height: 1.05; }
.hero-side.home { text-align: right; }
.hero-side.away { text-align: left; }
.hero-score {
  width: 84px; height: 84px; text-align: center; font-family: var(--font-disp); font-weight: 700; font-size: 44px;
  color: #fff; background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.18); border-radius: 16px;
  -moz-appearance: textfield;
}
.hero-score::-webkit-outer-spin-button, .hero-score::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.hero-score:focus { outline: none; border-color: #fff; background: rgba(255,255,255,.14); }
.hero-colon { font-family: var(--font-disp); font-weight: 700; font-size: 36px; color: rgba(255,255,255,.5); }
.hero-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 4px; }
.hero-shootout { padding: 9px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: #fff; font-size: 14px; }
.hero-shootout option { color: #111; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 26px; border: 0; border-radius: 12px;
  background: var(--blue); color: #fff; font-family: var(--font-sans); font-weight: 700; font-size: 15px; cursor: pointer;
  box-shadow: 0 6px 18px rgba(14,111,181,.35); transition: background .15s, transform .05s;
}
.btn-primary:hover { background: var(--blue-600); }
.btn-primary:active { transform: translateY(1px); }

/* Turnier-Infostreifen */
.statstrip { display: flex; flex-wrap: wrap; gap: 10px; }
.stat { flex: 1 1 120px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; }
.stat .k { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); }
.stat .v { font-family: var(--font-disp); font-weight: 700; font-size: 22px; color: var(--ink); margin-top: 2px; }

/* Spielzeilen (Alle Spiele) */
.match-list { display: flex; flex-direction: column; gap: 8px; }
.match-row {
  display: grid; grid-template-columns: 30px 56px minmax(60px,1fr) auto minmax(60px,1fr) auto; gap: 12px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 9px 14px;
}
.match-row.is-done { border-color: #cfe2d9; background: #f6fbf9; }
.match-row .mr-nr { color: var(--muted-2); font-size: 12px; font-weight: 600; text-align: right; }
.match-row .mr-time { color: var(--muted); font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }
.match-row .mr-home { text-align: right; font-weight: 500; }
.match-row .mr-away { text-align: left; font-weight: 500; }
.match-row .mr-score { display: flex; align-items: center; gap: 6px; }
.score-in {
  width: 46px; height: 40px; text-align: center; font-weight: 700; font-size: 17px;
  border: 1px solid var(--border-2); border-radius: 9px; background: #fff; color: var(--ink);
  -moz-appearance: textfield;
}
.score-in::-webkit-outer-spin-button, .score-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.score-in:focus { outline: 2px solid var(--blue); outline-offset: 0; border-color: var(--blue); }
.mr-colon { color: var(--muted-2); font-weight: 700; }
.btn-save {
  padding: 8px 14px; background: var(--blue); color: #fff; border: 0; border-radius: 9px;
  font-weight: 600; font-size: 13.5px; cursor: pointer; transition: background .15s;
}
.btn-save:hover { background: var(--blue-600); }

/* K.o.-Zeile im Admin */
.match-row.ko { grid-template-columns: 30px 56px auto 1fr auto auto auto; }
.match-row.ko .mr-stage { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); background: var(--blue-50); padding: 3px 8px; border-radius: 6px; }
.match-row.ko .mr-pair { color: var(--ink-soft); }
.match-row.ko .mr-pair em { font-style: normal; color: var(--muted-2); padding: 0 4px; }
.shootout { padding: 8px 10px; border: 1px solid var(--border-2); border-radius: 9px; background: #fff; font-size: 13px; max-width: 12em; }
.mr-waiting { color: var(--muted-2); font-style: italic; font-size: 13.5px; }

/* ============================================================
   Live-Scoring
   ============================================================ */
.live-dot {
  display: inline-block; width: .6em; height: .6em; border-radius: 50%;
  background: #ff4d45; box-shadow: 0 0 0 .18em rgba(255,77,69,.3);
  animation: livepulse 1.3s infinite;
}
@keyframes livepulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* Admin-Hero: Live-Scoreboard */
.hero-match.is-live { box-shadow: 0 0 0 1px rgba(255,77,69,.55), var(--shadow); }
.hero-live { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 1rem 1.4rem; }
.hl-side { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.hl-team { font-family: var(--font-disp); font-weight: 600; text-transform: uppercase; font-size: clamp(18px, 2.3vw, 26px); text-align: center; line-height: 1.05; }
.hl-ctrl { display: flex; align-items: center; gap: .9rem; }
.hl-score { font-family: var(--font-disp); font-weight: 700; font-size: 52px; min-width: 1.3em; text-align: center; color: #fff; }
.hl-btn {
  width: 52px; height: 52px; border-radius: 12px; border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.08); color: #fff; font-size: 28px; line-height: 1;
  cursor: pointer; display: grid; place-items: center;
}
.hl-btn:hover { background: rgba(255,255,255,.18); }
.hl-plus { background: var(--blue); border-color: transparent; }
.hl-plus:hover { background: var(--blue-600); }
.hl-colon { font-family: var(--font-disp); font-weight: 700; font-size: 44px; color: rgba(255,255,255,.4); padding-bottom: .4rem; }
.btn-reset {
  padding: 12px 18px; border-radius: 12px; border: 1px solid rgba(255,255,255,.25);
  background: transparent; color: #cbd5e1; font-weight: 600; font-size: 14px; cursor: pointer;
}
.btn-reset:hover { background: rgba(255,255,255,.08); color: #fff; }

/* TV: Live-Ergebnis im aktuellen Spiel */
.tv-now.is-live { border-color: rgba(255,77,69,.7); background: linear-gradient(120deg, rgba(255,77,69,.22), rgba(255,77,69,.05)); }
.tv-now-score {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: .5vw;
  font-family: var(--font-disp); font-weight: 700; font-size: 3.4vw; line-height: 1; color: #fff;
  background: rgba(0,0,0,.34); border: 1px solid rgba(255,255,255,.1); border-radius: .7vw;
  padding: .35vh 1.1vw; box-shadow: inset 0 0 2vh rgba(0,0,0,.4);
}
.tv-now-score b { min-width: 1.1ch; text-align: center; }
.tv-now-score i { font-style: normal; color: rgba(255,255,255,.4); font-size: 2.4vw; }

/* Zuschauer: aktuelles/Live-Spiel */
.live-fixture { border: 1px solid var(--border-2); border-radius: var(--r); padding: .7rem .9rem; margin-bottom: .9rem; background: var(--surface-2); }
.live-fixture.is-live { border-color: #ff4d45; background: #fff5f4; }
.lf-tag { display: inline-flex; align-items: center; gap: .5em; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.live-fixture.is-live .lf-tag { color: #d4201b; }
.lf-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .6rem; margin-top: .35rem; }
.lf-home { text-align: right; font-weight: 600; }
.lf-away { text-align: left; font-weight: 600; }
.lf-score { font-family: var(--font-disp); font-weight: 700; font-size: 20px; color: #fff; background: var(--ink); border-radius: 8px; padding: 1px 10px; }
.live-fixture.is-live .lf-score { background: var(--red); }
.lf-score i { font-style: normal; opacity: .55; }

/* Zuschauer: aktuelles Spiel als Insel über der Tabelle */
.current-island {
  background: linear-gradient(120deg, var(--ink), #16263f); color: #fff;
  border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 16px 22px; margin-bottom: 20px; text-align: center;
}
.current-island.is-live {
  background: radial-gradient(600px 220px at 85% -70%, rgba(255,77,69,.45), transparent 60%), linear-gradient(120deg, #1a1322, #2a1620);
}
.ci-tag { display: inline-flex; align-items: center; gap: .5em; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #ff9d98; }
.ci-teams { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 10px; }
.ci-team { flex: 1; min-width: 0; font-family: var(--font-disp); font-weight: 700; text-transform: uppercase; font-size: clamp(20px, 3.2vw, 32px); line-height: 1.05; }
.ci-team.home { text-align: right; }
.ci-team.away { text-align: left; }
.ci-vs { flex: 0 0 auto; color: #ff9d98; font-family: var(--font-disp); font-size: 24px; }
.ci-score {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; line-height: 1;
  font-family: var(--font-disp); font-weight: 700; font-size: clamp(30px, 5vw, 48px);
  background: rgba(0,0,0,.3); border: 1px solid rgba(255,255,255,.14); border-radius: 12px; padding: 4px 16px;
}
.ci-score i { font-style: normal; color: rgba(255,255,255,.4); font-size: .7em; }
.ci-score b { min-width: 1ch; text-align: center; }

/* Admin: kommende Spiele – vorziehen statt Eingabe */
.match-row.scheduled { display: flex; align-items: center; gap: 12px; }
.match-row.scheduled .mr-pair { flex: 1; min-width: 0; }
.match-row.scheduled .mr-waiting { margin-left: auto; }
.mr-promote { margin-left: auto; }
.btn-promote {
  padding: 8px 14px; background: #fff; color: var(--blue); border: 1px solid var(--blue);
  border-radius: 9px; font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap;
}
.btn-promote:hover { background: var(--blue-50); }

/* ---------- Mobil ---------- */
@media (max-width: 600px) {
  .hide-sm { display: none; }
  .masthead-inner { flex-wrap: wrap; gap: 12px; padding: 16px; }
  .brand { gap: 12px; }
  .brand-badge { height: 50px; }
  .brand-title { font-size: clamp(22px, 7vw, 32px); }
  .masthead-nav { margin-left: auto; }
  .container { padding: 18px 14px 44px; }
  .panel { padding: 16px; }
  .leaderboard thead th, .leaderboard tbody td { padding: 9px 5px; font-size: 14px; }
  .leaderboard td.pts { font-size: 18px; }
  .ci-teams { gap: 10px; }
}

.note { font-size: 13px; color: var(--muted); margin-top: 14px; }
.muted { color: var(--muted); }

/* ============================================================
   /score – Story-Ansicht (9:16, zum Screenshotten für Instagram)
   ============================================================ */
body.story-page { background: #04070d; }

.story {
  position: relative;
  width: 100%;
  max-width: min(100vw, 56.25vh);   /* echtes 9:16, auf dem Handy volle Breite */
  min-height: 100vh;
  margin: 0 auto;
  padding: 7vh 7.5vw 3.5vh;
  display: flex;
  flex-direction: column;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(135% 78% at 82% -14%, rgba(225,37,30,.52), transparent 55%),
    radial-gradient(120% 66% at 8% 116%, rgba(14,111,181,.44), transparent 58%),
    radial-gradient(95% 62% at 50% 40%, rgba(40,72,130,.38), transparent 72%),
    linear-gradient(157deg, #13284f 0%, #0b1733 52%, #050b1b 100%);
}
/* Körnung – mattes Premium-Finish */
.story::before {
  content: ""; position: absolute; inset: -2%; z-index: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .06; mix-blend-mode: overlay;
}
/* Vignette + feiner Broadcast-Rahmen */
.story::after {
  content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none;
  box-shadow: inset 0 0 200px rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.06);
}
/* Dekor: großes Wappen-Wasserzeichen + diagonaler Rot-Akzent */
.story-art { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.story-art::before {
  content: ""; position: absolute; right: -26%; bottom: -8%; width: 94%; aspect-ratio: 544 / 628;
  background: url("/assets/logo.png") center / contain no-repeat;
  opacity: .05; filter: grayscale(1) brightness(1.6) contrast(.85);
  transform: rotate(-7deg);
}
.story-art::after {
  content: ""; position: absolute; top: -32%; left: -45%; width: 130%; height: 60%;
  background: linear-gradient(90deg, rgba(225,37,30,0), rgba(225,37,30,.55));
  transform: rotate(-19deg); filter: blur(46px); opacity: .5;
}
.story > *:not(.story-art) { position: relative; z-index: 2; }

/* Kopf */
.st-head { display: flex; align-items: center; gap: 13px; padding-bottom: 2.2vh; border-bottom: 1px solid rgba(255,255,255,.1); }
.st-head img { width: 54px; height: auto; filter: drop-shadow(0 6px 16px rgba(0,0,0,.5)); }
.st-head .st-title {
  font-family: var(--font-disp); font-weight: 700; text-transform: uppercase;
  font-size: clamp(15px, 4.4vw, 23px); letter-spacing: .015em; line-height: 1.0;
}
.st-head .st-sub { font-size: clamp(9px, 2.7vw, 12px); color: rgba(255,255,255,.58); margin-top: 4px; letter-spacing: .06em; text-transform: uppercase; }

/* Mittelteil */
.st-body { flex: 1; display: flex; flex-direction: column; justify-content: center; min-height: 0; padding: 2.5vh 0; }
.st-kicker {
  display: inline-flex; align-items: center; gap: .65em; width: fit-content;
  font-family: var(--font-disp); text-transform: uppercase; font-weight: 700;
  letter-spacing: .16em; color: #ff8f88; font-size: clamp(13px, 3.8vw, 18px);
}
.st-kicker::before { content: ""; width: 1.9em; height: 3px; background: currentColor; border-radius: 2px; }
.st-kicker.blue { color: #7fc4ef; }
.st-kicker.gold { color: var(--gold); }

/* --- Ansicht: letztes Ergebnis (zentrierte Broadcast-Grafik) --- */
.st-latest { align-items: center; text-align: center; justify-content: center; }
.st-latest .st-kicker { margin: 0 auto; }
.st-latest .st-kicker::after { content: ""; width: 1.9em; height: 3px; background: currentColor; border-radius: 2px; }
.st-latest .st-meta { color: rgba(255,255,255,.55); font-size: clamp(11px, 3vw, 14px); margin-top: 1vh; letter-spacing: .2em; text-transform: uppercase; }
.st-matchup { width: 100%; margin-top: 3.2vh; display: flex; flex-direction: column; align-items: center; gap: 1vh; }
.st-team-line { display: flex; flex-direction: column; align-items: center; gap: .6em; }
.st-latest .st-team {
  font-family: var(--font-disp); font-weight: 700; text-transform: uppercase;
  font-size: clamp(30px, 10.5vw, 60px); line-height: .9; letter-spacing: .004em; color: #fff;
}
.st-team-line.win .st-team { text-shadow: 0 0 36px rgba(255,255,255,.2); }
.st-team-line.lose .st-team { color: rgba(255,255,255,.48); font-weight: 600; }
.st-tag {
  font-family: var(--font-sans); font-size: clamp(9px, 2.4vw, 11px); font-weight: 800; letter-spacing: .2em;
  text-transform: uppercase; color: #fff; background: var(--red); padding: .5em .95em; border-radius: 999px;
  box-shadow: 0 8px 22px rgba(225,37,30,.45);
}
.st-scorewrap { position: relative; display: flex; justify-content: center; align-items: center; margin: .4vh 0; padding: 1vh 0; }
.st-scorewrap::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 120%; aspect-ratio: 1; transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(120,160,230,.22), transparent 70%); z-index: -1;
}
.st-latest .st-score {
  font-family: var(--font-disp); font-weight: 700; line-height: .8;
  font-size: clamp(130px, 49vw, 280px); letter-spacing: .01em;
  display: inline-flex; align-items: center; gap: .05em;
  background: linear-gradient(177deg, #ffffff 0%, #ffffff 48%, #b2c1dd 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 16px 46px rgba(0,0,0,.55)) drop-shadow(0 0 38px rgba(123,196,239,.26));
}
.st-latest .st-score .sep { -webkit-text-fill-color: var(--red); color: var(--red); font-size: .56em; margin: 0 .02em; transform: translateY(-.06em); }
.st-latest .st-ne {
  display: inline-block; margin-top: 1.8vh; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  font-size: clamp(10px, 2.9vw, 13px); color: #ffcf7a;
}
.st-latest .st-empty { font-size: clamp(18px, 5vw, 27px); color: rgba(255,255,255,.85); font-weight: 600; line-height: 1.35; margin-top: 1.4vh; }

/* --- Ansicht: alle Ergebnisse --- */
.st-list { margin-top: 1.8vh; display: flex; flex-direction: column; gap: .75vh; }
.st-row {
  display: grid; grid-template-columns: auto 1fr auto 1fr; align-items: center; gap: .55em;
  padding: .95vh 3.4vw; border-radius: 12px;
  background: linear-gradient(100deg, rgba(255,255,255,.085), rgba(255,255,255,.028));
  border: 1px solid rgba(255,255,255,.09);
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.st-row .r-time { font-variant-numeric: tabular-nums; color: rgba(255,255,255,.5); font-size: clamp(10px, 2.7vw, 12px); font-weight: 600; }
.st-row .r-home { text-align: right; }
.st-row .r-away { text-align: left; }
.st-row .r-home, .st-row .r-away { font-weight: 600; font-size: clamp(12px, 3.4vw, 16px); color: rgba(255,255,255,.86); }
.st-row .r-win { color: #fff; font-weight: 800; }
.st-row .r-score {
  font-family: var(--font-disp); font-weight: 700; font-size: clamp(17px, 5.4vw, 27px);
  background: rgba(0,0,0,.34); border: 1px solid rgba(255,255,255,.08); border-radius: 9px;
  padding: .06em .5em; white-space: nowrap; min-width: 2.1em; text-align: center;
}
.st-row.ko { background: linear-gradient(100deg, rgba(225,37,30,.22), rgba(225,37,30,.06)); border-color: rgba(255,143,136,.42); }
.st-row.ko .r-score { background: rgba(225,37,30,.3); border-color: rgba(255,143,136,.3); }
.st-row .r-lbl { grid-column: 1 / -1; font-family: var(--font-disp); font-size: clamp(9px, 2.5vw, 11px); text-transform: uppercase; letter-spacing: .14em; color: #ff8f88; margin-bottom: -.3vh; }

/* --- Ansicht: Tabelle --- */
.st-table { width: 100%; border-collapse: collapse; margin-top: 2vh; }
.st-table th {
  text-align: right; font-size: clamp(10px, 2.7vw, 12px); color: rgba(255,255,255,.5);
  text-transform: uppercase; letter-spacing: .1em; font-weight: 700; padding: 0 .35em 1.3vh;
}
.st-table th.l { text-align: left; }
.st-table td { padding: 1.25vh .35em; border-top: 1px solid rgba(255,255,255,.08); font-size: clamp(13px, 3.8vw, 18px); text-align: right; color: rgba(255,255,255,.9); }
.st-table td.rk { text-align: left; width: 2.6em; }
.st-table td.rk b {
  display: inline-flex; align-items: center; justify-content: center; width: 1.8em; height: 1.8em;
  border-radius: 8px; background: rgba(255,255,255,.08); font-family: var(--font-disp); font-weight: 700; font-size: 1em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.st-table tr.semi td.rk b { background: var(--zone-semi); color: #042812; box-shadow: 0 4px 12px rgba(16,163,122,.35); }
.st-table tr.p5 td.rk b { background: var(--zone-p5); color: #3a2a00; box-shadow: 0 4px 12px rgba(224,161,6,.3); }
.st-table td.tm { text-align: left; font-weight: 600; width: 100%; }
.st-table td.pt { font-family: var(--font-disp); font-weight: 700; font-size: 1.2em; color: #fff; }

/* --- Ansicht: Endstand --- */
.st-final { margin-top: 2vh; display: flex; flex-direction: column; gap: 1vh; }
.st-place {
  display: flex; align-items: center; gap: .85em; padding: 1.35vh 4.2vw; border-radius: 13px;
  background: linear-gradient(100deg, rgba(255,255,255,.07), rgba(255,255,255,.025));
  border: 1px solid rgba(255,255,255,.09); box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.st-place .pl { font-family: var(--font-disp); font-weight: 700; width: 1.5em; text-align: center; font-size: clamp(20px, 6vw, 30px); color: rgba(255,255,255,.7); }
.st-place .nm { font-weight: 600; font-size: clamp(16px, 4.7vw, 24px); }
.st-champ { display: block; font-family: var(--font-sans); font-weight: 800; font-size: .46em; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin-top: .25em; }
.st-place.p1 { background: linear-gradient(100deg, rgba(227,176,4,.34), rgba(227,176,4,.07)); border-color: rgba(227,176,4,.65); box-shadow: 0 8px 28px rgba(227,176,4,.22); }
.st-place.p2 { background: linear-gradient(100deg, rgba(190,200,214,.28), rgba(190,200,214,.06)); border-color: rgba(190,200,214,.55); }
.st-place.p3 { background: linear-gradient(100deg, rgba(205,127,70,.28), rgba(205,127,70,.06)); border-color: rgba(205,127,70,.55); }
.st-place.p1 .pl { color: var(--gold); } .st-place.p2 .pl { color: var(--silver); } .st-place.p3 .pl { color: var(--bronze); }
.st-place.p1 .nm { font-family: var(--font-disp); font-weight: 700; text-transform: uppercase; font-size: clamp(21px, 5.8vw, 31px); }

/* Fuß */
.st-foot { display: flex; align-items: center; justify-content: space-between; gap: 1em; margin-top: 2.5vh; padding-top: 2vh; border-top: 1px solid rgba(255,255,255,.1); }
.st-foot .f-when { font-size: clamp(10px, 2.8vw, 13px); color: rgba(255,255,255,.62); letter-spacing: .03em; }
.st-foot .f-brand { font-family: var(--font-disp); font-weight: 700; text-transform: uppercase; letter-spacing: .12em; font-size: clamp(10px, 2.8vw, 13px); color: rgba(255,255,255,.5); }

/* Umschalter – blendet sich nach kurzer Zeit aus, damit Screenshots sauber sind */
.story-switch {
  position: fixed; top: 10px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; padding: 6px; z-index: 50;
  background: rgba(8,14,28,.72); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.14); border-radius: 999px;
  transition: opacity .5s ease; opacity: 1;
}
.story-switch.hide { opacity: 0; pointer-events: none; }
.story-switch a {
  font-size: 12px; font-weight: 600; color: rgba(255,255,255,.8);
  padding: 7px 13px; border-radius: 999px; white-space: nowrap;
}
.story-switch a.on { background: var(--red); color: #fff; }
@media (max-width: 360px) { .story-switch a { padding: 7px 10px; font-size: 11px; } }
