/* ===== Variables & Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Sanfte Seitenwechsel in der WebView: kein schwarzer Flash zwischen den
   Server-gerenderten Seiten. Cross-Document View Transitions halten die alte
   Seite sichtbar, bis die neue gemalt ist (Chromium-WebView + WKWebView);
   ältere Engines ignorieren die Regel einfach (harmloser Fallback). */
@view-transition { navigation: auto; }
/* Schneller Crossfade statt Default 0.25s, damit Navigation snappy bleibt. */
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.12s; }

/* html-Hintergrund = App-Farbe: selbst ein kurzer leerer Frame (ohne View-
   Transition-Support) erscheint dann in --bg statt im WebView-Default-Schwarz. */
html { background: var(--bg); }

/* ── Soft-Nav-Animation (client-seitige Navigation, static/softnav.js) ──────
   Der Inhalt (main.page-main) wird beim Wechsel kurz aus- und wieder einge-
   blendet, mit leichtem horizontalem Versatz (Richtung = vor/zurück bzw.
   Wisch-Richtung). Kein schwarzer Frame, weiche Bewegung wie in nativen Apps. */
@media (prefers-reduced-motion: no-preference) {
  .tec-anim-out      { animation: tecOut 0.10s ease forwards; }
  /* 'both' → die from{opacity:0}-Startwerte gelten SOFORT (kein 1-Frame-Aufblitzen
     der neuen Seite bei voller Deckkraft, bevor die Einblendung greift — v.a. auf
     schweren Backend-Seiten sichtbar als „Flackern"). */
  .tec-anim-in       { animation: tecIn 0.16s ease both; }
  .tec-anim-out-back { animation: tecOutBack 0.10s ease forwards; }
  .tec-anim-in-back  { animation: tecInBack 0.16s ease both; }
  @keyframes tecOut     { to   { opacity: 0; transform: translateX(-3%); } }
  @keyframes tecIn      { from { opacity: 0; transform: translateX(4%); } }
  @keyframes tecOutBack { to   { opacity: 0; transform: translateX(3%); } }
  @keyframes tecInBack  { from { opacity: 0; transform: translateX(-4%); } }
}

/* Lade-Screen bei harter Navigation (statt Blackscreen). Nutzt App-Hintergrund,
   also automatisch hell im Lightmode / dunkel im Darkmode. */
#tec-loading {
  position: fixed; inset: 0; z-index: 100000;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg, #0d1117);
}
#tec-loading .tec-spin {
  width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid var(--border, #2a2f37);
  border-top-color: var(--blue, #2f81f7);
  animation: tecSpin 0.7s linear infinite;
}
@keyframes tecSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  #tec-loading .tec-spin { animation-duration: 1.4s; }
}

/* Einslide-Animation beim In-Page-Tab-Wisch (News/Mannschaftsdetail). */
.tec-panelslide-l { animation: tecPanelL 0.22s ease; }
.tec-panelslide-r { animation: tecPanelR 0.22s ease; }
@keyframes tecPanelL { from { opacity: .35; transform: translateX(22px); } to { opacity: 1; transform: none; } }
@keyframes tecPanelR { from { opacity: .35; transform: translateX(-22px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .tec-panelslide-l, .tec-panelslide-r { animation: none; }
}

:root {
  --bg:        #0d1117;
  --card:      #161b22;
  --border:    #30363d;
  --green:     #238636;
  --green-lt:  #2ea043;
  --blue:      #1f6feb;
  --red:       #da3633;
  --yellow:    #d29922;
  --text:      #e6edf3;
  --muted:     #8b949e;
  --radius:    10px;
  --radius-lg: 16px;
}

/* Hell-Modus (Task 10). Das früh laufende Theme-Script in base.html setzt
   data-theme=light|dark (System → aufgelöst via prefers-color-scheme), damit
   kein Flash entsteht. Komponenten nutzen die Tokens → greifen automatisch. */
:root[data-theme="light"] {
  --bg:        #f4f6f8;
  --card:      #ffffff;
  --border:    #d7dde3;
  --green:     #1a7f37;
  --green-lt:  #1f9d44;
  --blue:      #0969da;
  --red:       #cf222e;
  --yellow:    #9a6700;
  --text:      #1f2328;
  --muted:     #59636e;
}
:root[data-theme="light"] body { background: var(--bg); color: var(--text); }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif,
    'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  min-height: 100vh;
  /* Symbol-Glyphs (⚙, ✏, ✓, ⚡, ⚠ …) sollen monochrom als Text gerendert
     werden, nicht als farbiger Emoji. Browser-Support: Chrome 119+,
     Firefox 116+, Safari 16.4+ — sonst harmloser Fallback. */
  font-variant-emoji: text;
}

a { color: inherit; text-decoration: none; }

/* ===== Einheitliche Checkbox (grün, rund, weißer Haken) =====
   Global auf schlichte Checkboxen. Getunte Toggles (.push-pref-toggle input,
   .tp-check input …) sind opacity:0/width:0 mit höherer Spezifität → bleiben
   unberührt; nur die Default-„weiß mit blauem Haken" wird ersetzt. */
input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  cursor: pointer;
  position: relative;
  vertical-align: -0.22em;
  margin: 0 0.15rem 0 0;
  transition: background 0.15s, border-color 0.15s;
}
input[type="checkbox"]:checked {
  background: var(--green-lt);
  border-color: var(--green-lt);
}
input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 0.37rem;
  top: 0.1rem;
  width: 0.3rem;
  height: 0.62rem;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--green-lt);
  outline-offset: 2px;
}
input[type="checkbox"]:disabled { opacity: 0.5; cursor: default; }

/* Radio im selben Grün, damit Formulare einheitlich sind (getunte
   .tp-check-Radios sind opacity:0 mit höherer Spezifität → unberührt). */
input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  background: var(--card);
  cursor: pointer;
  position: relative;
  vertical-align: -0.22em;
  margin: 0 0.15rem 0 0;
  transition: border-color 0.15s;
}
input[type="radio"]:checked { border-color: var(--green-lt); }
input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  background: var(--green-lt);
  transform: translate(-50%, -50%);
}
input[type="radio"]:focus-visible {
  outline: 2px solid var(--green-lt);
  outline-offset: 2px;
}

/* ===== Themekonformes Formular-Set (global) =====
   Basis für alle Backend-/Feature-Formulare. Die Buchen-Seiten haben eigene
   inline .bk-* Definitionen (identisch) — die überschreiben diese hier nach
   Ladereihenfolge, also kein Konflikt. Für Training/Zahlungen etc. greifen diese. */
.bk-field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.bk-field-lbl { font-size: .74rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em; }
.bk-in { padding: .6rem .7rem; border: 1px solid var(--border); border-radius: 9px;
  background: var(--bg, var(--card)); color: var(--text); font-size: .92rem; width: 100%;
  color-scheme: dark; }
:root[data-theme="light"] .bk-in { color-scheme: light; }
.bk-in:focus { outline: none; border-color: var(--green-lt);
  box-shadow: 0 0 0 3px rgba(46,160,67,.15); }
select.bk-in { cursor: pointer; }
textarea.bk-in { resize: vertical; min-height: 3.2rem; line-height: 1.4; }
.bk-note { font-size: .82rem; color: var(--muted); margin: .3rem 0 .6rem; line-height: 1.5; }
.bk-btn { display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .85rem;
  border: 0; border-radius: 8px; background: var(--green); color: #fff; font-weight: 600;
  font-size: .82rem; cursor: pointer; transition: background .12s, border-color .12s; }
.bk-btn:hover { background: var(--green-lt); }
.bk-btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.bk-btn-ghost:hover { background: rgba(255,255,255,.05); border-color: var(--green-lt); }
/* Icon-only Button (kein Emoji, SVG aus _icons.html) — gleiche Höhe/Breite wie ein
   normaler .bk-btn, Text durch title/aria-label ersetzt. Kräftigerer Strich + etwas
   größer als die 1em-Inline-Icons, damit sie freistehend im Button klar erkennbar sind. */
.bk-btn-icon { padding: 0; width: 2.1rem; height: 2.1rem; flex: 0 0 auto; justify-content: center; box-sizing: border-box; }
.bk-btn-icon svg { width: 1.35em; height: 1.35em; stroke-width: 2.1; }

/* Einteilung: eine Toolbar-Leiste für Ansicht-Wechsel + Aktionen (trainer_schedule.html,
   trainer_plaetze.html, trainer_gesamtplan.html, trainer_athletik.html, trainer_mails.html) —
   Buttons, Selects und beschriftete Felder sitzen bündig auf einer gemeinsamen Höhe: JEDES
   Element bekommt dieselbe Zwei-Zeilen-Struktur (Beschriftungszeile + Kontrollelement) — bei
   Buttons ohne eigene Beschriftung übernimmt .ez-cap unsichtbar denselben Platz, damit die
   Kontrollen (nicht nur die Container) auf gleicher Höhe stehen, unabhängig davon ob eine
   sichtbare Überschrift wie „Ansicht"/„Raster" da ist oder nicht. */
.ez-bar { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .5rem .6rem; margin-bottom: .8rem; }
.ez-bar .bk-field-lbl, .ez-bar .ez-item { display: flex; flex-direction: column; gap: .3rem; align-items: stretch; }
.ez-cap { font-size: .74rem; font-weight: 700; line-height: 1; visibility: hidden; }
.ez-bar .bk-btn, .ez-bar select.bk-in { height: 2.3rem; box-sizing: border-box; }
.ez-bar select.bk-in { padding: 0 1.6rem 0 .6rem; font-size: .82rem; max-width: 190px; }
.ez-bar .bk-btn { padding: 0 .85rem; }
.ez-bar .bk-btn-icon { height: 2.3rem; width: 2.3rem; }

/* Reihenfolge der Trainer-Kalender-Toolbar per CSS statt DOM-Reihenfolge, damit
   Mobil (siehe Media Query unten) umsortieren kann, ohne Desktop anzufassen. */
.sc-bar.ez-bar .ez-raster { order: 2; }
.sc-bar.ez-bar .ez-settings { order: 3; }
.sc-bar.ez-bar .ez-sperr { order: 4; }
.sc-bar.ez-bar .sc-all-lbl { order: 5; }
.sc-bar.ez-bar .ez-auto { order: 6; }
.sc-bar.ez-bar .ez-undo { order: 7; }
.sc-bar.ez-bar .ez-reset { order: 8; }
.sc-bar.ez-bar .ez-mail { order: 9; margin-left: auto; }
.sc-bar.ez-bar .ez-export { order: 10; }
.ez-txt-short { display: none; }

/* Ansicht-Flyout-Menü (ersetzt das alte <select>): Klick auf den Trigger öffnet ein
   Menü, "Trainer"/"Plätze" sind Eltern-Einträge, deren Untermenü rechts daneben
   aufklappt (Desktop: zusätzlich per Hover; Mobil/Touch: die .on-Klasse wird vom
   globalen Click-Handler in app.js gesetzt, da :hover auf Touch nicht zuverlässig ist). */
.ez-menu { position: relative; display: inline-block; text-transform: none; letter-spacing: normal; }
.ez-menu-trigger { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; justify-content: space-between; font-size: .78rem; }
.ez-menu-trigger svg { flex: 0 0 auto; }
.ez-menu-pop { position: absolute; top: calc(100% + .3rem); left: 0; z-index: 70; min-width: 200px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.28); padding: .3rem; display: none; }
.ez-menu-pop.on { display: block; }
.ez-menu-item { display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  padding: .55rem .7rem; border-radius: 8px; color: var(--text); text-decoration: none;
  font-size: .84rem; cursor: pointer; position: relative; }
.ez-menu-item:hover, .ez-menu-item.on { background: rgba(255,255,255,.06); }
.ez-menu-item.cur { font-weight: 700; color: var(--green-lt); }
.ez-menu-item svg { flex: 0 0 auto; }
.ez-menu-flyout { position: absolute; left: 100%; top: -.3rem; min-width: 160px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.28); padding: .3rem; display: none; }
.ez-menu-parent:hover > .ez-menu-flyout, .ez-menu-parent.on > .ez-menu-flyout { display: block; }
.ez-menu-flyout a { display: block; padding: .55rem .7rem; border-radius: 8px; color: var(--text);
  text-decoration: none; font-size: .84rem; }
.ez-menu-flyout a:hover { background: rgba(255,255,255,.06); }
.ez-menu-flyout a.cur { font-weight: 700; color: var(--green-lt); }

/* Mobil: Erklär-Einzeiler rauben nur Platz, weniger breite Selects passen mehr pro
   Zeile in die Einteilung-Toolbar (Ziel: 2-3 statt 4+ Zeilen). */
@media (max-width: 600px) {
  .sc-wrap .bk-note, .pl-wrap .bk-note, .gp-wrap .bk-note, .at-wrap .bk-note, .tm-wrap .bk-note { display: none; }
  .ez-bar { gap: .5rem .4rem; }
  .ez-bar select.bk-in { max-width: 92px; appearance: none; -webkit-appearance: none; background-image: none; padding-right: .6rem; }
  .ez-menu-trigger { max-width: 170px; font-size: .72rem; }
  /* Mail + Export bewusst in Zeile 1 oben rechts, Zurücksetzen/Reset ans Ende von
     Zeile 2 — statt einfach nur wild umzubrechen. Etwas kompaktere Buttons/Icons,
     damit Reset dort auch tatsächlich noch reinpasst (iPhone 14/15/16-Breite). Beim
     Raster-Select fällt dafür der native Pfeil weg (appearance:none) — der Wert
     ("60 Min") braucht sonst mehr Breite als der native Pfeil zusätzlich reserviert. */
  .ez-bar .bk-btn { font-size: .76rem; padding: 0 .55rem; }
  .ez-bar .bk-btn-icon, .ez-bar .bk-btn-icon.bk-btn-icon { height: 2rem; width: 2rem; }
  .sc-bar.ez-bar .ez-mail { order: 3; margin-left: auto; }
  .sc-bar.ez-bar .ez-export { order: 4; }
  .sc-bar.ez-bar .ez-settings { order: 5; }
  .sc-bar.ez-bar .ez-sperr { order: 6; }
  .sc-bar.ez-bar .sc-all-lbl { order: 7; }
  .sc-bar.ez-bar .ez-auto { order: 8; }
  .sc-bar.ez-bar .ez-undo { order: 9; }
  .sc-bar.ez-bar .ez-reset { order: 10; margin-left: auto; }
  .ez-txt-full { display: none; }
  .ez-txt-short { display: inline; }
  /* Seitliches Flyout würde auf schmalen Screens über den Rand hinauslaufen — dort
     klappt das Untermenü stattdessen direkt unter dem Eltern-Eintrag auf (wie ein
     Akkordeon), bleibt aber dieselbe .on-Klasse/Logik. */
  .ez-menu-parent { flex-wrap: wrap; }
  .ez-menu-flyout { position: static; flex-basis: 100%; box-shadow: none; border: none; padding: 0;
    margin: .15rem 0 .3rem 1rem; min-width: 0; }
  .ez-menu-parent:hover > .ez-menu-flyout { display: none; }
  .ez-menu-parent.on > .ez-menu-flyout { display: block; }
}
.ez-bar form.ez-item { margin: 0; }

.bk-banner { padding: .7rem 1rem; border-radius: 10px; margin: .6rem 0 1rem;
  font-weight: 600; font-size: .9rem; }
.bk-banner.ok  { background: rgba(46,160,67,.14);  color: #7ee2a0; border: 1px solid rgba(46,160,67,.4); }
.bk-banner.err { background: rgba(218,54,51,.14);  color: #ff9a94; border: 1px solid rgba(218,54,51,.4); }
.bk-banner.info{ background: rgba(31,111,235,.12); color: #9ec5ff; border: 1px solid rgba(31,111,235,.35); }

/* ===== Top Navigation Bar ===== */
.top-nav-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 1rem;
  /* Safe-Area Insets für iPhone-Notch / Dynamic Island:
     iOS Status-Bar belegt oberen Bildschirm-Streifen (~47px) wenn als PWA
     installiert. Ohne safe-area-padding würde TEC-tv-Logo unter die Uhrzeit
     rutschen. env() liefert auf Desktop/Browser 0px — dort bleibt es beim
     bisherigen Spacing. */
  padding:
    calc(0.6rem + env(safe-area-inset-top, 0px))
    calc(1rem + env(safe-area-inset-right, 0px))
    0.6rem
    calc(1rem + env(safe-area-inset-left, 0px));
  background: var(--card);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.nav-brand {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex: 1;
  flex-wrap: wrap;
}

.nav-tab {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius);
  position: relative;
  white-space: nowrap;
}

.nav-tab:hover { color: var(--text); }

.nav-tab.is-active {
  color: var(--text);
  background: var(--bg);
}

.nav-tab.is-active::after {
  content: "";
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: -0.65rem;
  height: 2px;
  background: var(--blue);
  border-radius: 2px;
}

/* ===== Admin-Gruppe in der Nav: Untertabs im Hamburger-Menu ===== */
.nav-admin-group {
  /* display: contents lässt die Kinder wie direkte .top-nav-Flex-Items
     erscheinen. Die Admin-Tab sitzt auf Desktop damit horizontal neben
     den anderen Tabs, die Sub-Tabs sind per default display:none und
     werden nur im Mobile-Dropdown sichtbar. */
  display: contents;
}
.nav-admin-subtab {
  display: none;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius);
  white-space: nowrap;
}
.nav-admin-subtab:hover { color: var(--text); }
.nav-admin-subtab.is-active {
  color: var(--text);
  background: var(--bg);
  border-left: 2px solid var(--blue);
}

/* ===== Hamburger-Burger (mobile only) ===== */
.nav-burger {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  color: var(--text);
}
.nav-burger:hover,
.nav-burger[aria-expanded="true"] { background: var(--bg); }
.nav-burger-icon,
.nav-burger-icon::before,
.nav-burger-icon::after {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-burger-icon {
  position: relative;
}
.nav-burger-icon::before,
.nav-burger-icon::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-burger-icon::before { top: -6px; }
.nav-burger-icon::after  { top:  6px; }
.nav-burger[aria-expanded="true"] .nav-burger-icon {
  background: transparent;
}
.nav-burger[aria-expanded="true"] .nav-burger-icon::before {
  top: 0;
  transform: rotate(45deg);
}
.nav-burger[aria-expanded="true"] .nav-burger-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

/* ===== Help-Button + Dialog ===== */
.help-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
  padding: 0;
}
.help-btn:hover {
  background: var(--card);
  color: var(--text);
  border-color: var(--blue);
}

.help-dialog {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0;
  max-width: 92vw;
  width: 520px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.help-dialog::backdrop { background: rgba(0, 0, 0, 0.65); }

.help-dialog-body {
  position: relative;
  padding: 1.6rem 1.8rem 1.4rem;
}

.help-dialog-close {
  position: absolute;
  top: 0.6rem;
  right: 0.9rem;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.4rem;
}
.help-dialog-close:hover { color: var(--text); }

.help-dialog h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.8rem;
  padding-right: 1.5rem;
}

.help-dialog ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.help-dialog li {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 0.7rem;
  padding-left: 1.2rem;
  position: relative;
}

.help-dialog li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--blue);
  font-weight: 700;
}

.help-foot {
  margin-top: 1rem;
  font-size: 0.78rem;
  border-top: 1px solid var(--border);
  padding-top: 0.8rem;
}

.help-foot a { color: var(--blue); text-decoration: underline; }

/* Dev role switcher (Phase 0 — temporary) */
.dev-role-switcher {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem;
  border: 1px dashed var(--yellow);
  border-radius: var(--radius);
  background: rgba(210, 153, 34, 0.08);
  cursor: pointer;
  flex-shrink: 0;
}

.dev-badge {
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--yellow);
  letter-spacing: 1px;
}

.dev-role-current {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
}

.dev-role-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.3rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.3rem;
  min-width: 9rem;
  display: none;
  flex-direction: column;
  gap: 0.15rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
  z-index: 200;
}

.dev-role-switcher.is-open .dev-role-menu {
  display: flex;
}

.dev-role-link {
  font-size: 0.82rem;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius);
  color: var(--muted);
}

.dev-role-link:hover { background: var(--bg); color: var(--text); }
.dev-role-link.is-active { color: var(--text); background: var(--bg); }

/* Main content wrapper */
.page-main {
  min-height: calc(100vh - 60px);
}

/* Mobile: stack nav items + shrink dev switcher */
@media (max-width: 640px) {
  .top-nav-bar {
    padding:
      calc(0.5rem + env(safe-area-inset-top, 0px))
      calc(0.6rem + env(safe-area-inset-right, 0px))
      0.5rem
      calc(0.6rem + env(safe-area-inset-left, 0px));
    gap: 0.5rem;
    position: sticky;
  }
  .nav-brand { font-size: 0.85rem; }
  .nav-burger { display: inline-flex; }

  .top-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem;
    gap: 0.15rem;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 105;
  }
  .top-nav-bar.nav-open .top-nav { display: flex; }

  .top-nav .nav-tab {
    padding: 0.75rem 0.9rem;
    font-size: 0.95rem;
    text-align: left;
    border-radius: var(--radius);
  }
  .top-nav .nav-tab.is-active {
    background: var(--bg);
  }
  .top-nav .nav-tab.is-active::after {
    display: none;
  }

  /* Admin-Subtabs sichtbar im Mobile-Dropdown, eingerückt unter Admin */
  .top-nav .nav-admin-subtab {
    display: block;
    margin-left: 1rem;
    padding: 0.55rem 0.9rem;
    font-size: 0.9rem;
    border-left: 2px solid var(--border);
    border-radius: 0 var(--radius) var(--radius) 0;
  }
  .top-nav .nav-admin-subtab.is-active {
    border-left-color: var(--blue);
  }

  .user-menu,
  .btn-login {
    margin-left: auto;
  }

  .dev-badge { display: none; }
  .dev-role-switcher { padding: 0.3rem 0.5rem; }
  .dev-role-current { font-size: 0.72rem; }
}

/* ===== Bottom-Nav (mobile Hubs) =====
   Desktop: aus. Mobile: feste Leiste am unteren Rand mit 3 Hubs.
   Auto-hide beim Runterscrollen (.is-hidden via app.js). Auf den immersiven
   Stream-/Scoring-Seiten komplett aus. Siehe base.html + project_bottom_nav_ia. */
.bottom-nav { display: none; }

@media (max-width: 640px) {
  .bottom-nav {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 110;
    background: var(--card);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transition: transform 0.25s ease;
  }
  .bottom-nav.is-hidden { transform: translateY(110%); }

  .bottom-nav-item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 0.45rem 0.25rem 0.4rem;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.68rem;
    -webkit-tap-highlight-color: transparent;
  }
  .bottom-nav-item svg { width: 24px; height: 24px; display: block; }
  .bottom-nav-item.is-active { color: var(--blue); }
  .bottom-nav-label { line-height: 1; }

  /* Platz schaffen, damit Content nicht hinter der Leiste verschwindet —
     außer auf den immersiven Seiten, die die Leiste eh ausblenden. */
  body:not(.court-page):not(.court-scoring-page):not(.scoring-page) .page-main {
    padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  }
  body.court-page .bottom-nav,
  body.court-scoring-page .bottom-nav,
  body.scoring-page .bottom-nav { display: none; }
}

/* ===== Bereichs-/Verwaltung-Subnav =====
   Dünne, seitlich scrollbare Tabs unter der Topbar (Unterstrich-Indikator).
   - Spielbetrieb-Subnav: nur Mobile (Desktop nutzt die volle Top-Nav).
   - Verwaltung-Subnav (.section-subnav-always): IMMER (auch Desktop), weil die
     Admin-Tools keine Top-Nav-Entsprechung mehr haben. */
.section-subnav {
  display: none;
  gap: 0.2rem;
  overflow-x: auto;
  overscroll-behavior: contain;   /* horizontales Scrollen der Leiste nicht auf die Seite übertragen */
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0.5rem 0.5rem 0;   /* gleiche Höhe wie .admin-subnav (oben 0.5rem) */
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.section-subnav::-webkit-scrollbar { display: none; }
/* Scroll-Kette auch bei den anderen horizontalen Tab-Leisten unterbinden. */
.admin-subnav, .bv-tabs { overscroll-behavior: contain; }

/* Tab-Leisten bleiben beim Scrollen stehen (sticky unter der Kopfleiste) → die
   obere Navigation verschwindet nicht mehr. sticky ist zugleich Bezug für den
   beweglichen Indikator (absolutes Kind). --tn-h = Kopfleisten-Höhe (per JS gesetzt). */
.section-subnav, .admin-subnav, .bv-tabs {
  position: sticky; top: var(--tn-h, 56px); z-index: 90;
}
.admin-subnav, .bv-tabs { background: var(--bg); }   /* opak, damit Inhalt sauber drunter scrollt */
.tec-tab-ind { position: absolute; bottom: 0; height: 2px; border-radius: 2px;
  background: var(--blue); pointer-events: none; z-index: 1; }
.tec-ind-live .section-tab.is-active,
.tec-ind-live .admin-subtab.is-active,
.tec-ind-live .bv-tab.is-active,
.tec-ind-live .match-tab.is-active,
.tec-ind-live .news-tab.is-active,
.tec-ind-live .tab.is-active { border-bottom-color: transparent; }
.section-subnav-always { display: flex; }
/* Detailseiten (haben einen Back-Button): die Spielbetrieb-Tab-Reihe weg — der
   Back-Button übernimmt die Navigation. Logo-Leiste + Bottom-Nav bleiben.
   (:has() wird von aktuellen Chromium-/WebKit-WebViews unterstützt; ältere
   ignorieren die Regel → Tab-Reihe bleibt sichtbar, harmloser Fallback.) */
body:has(.back-btn, .back-btn-inline) .section-subnav:not(.section-subnav-always) {
  display: none;
}
.section-tab {
  flex: none;
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.15s;
}
.section-tab:hover { color: var(--text); }
.section-tab.is-active {
  color: var(--text);
  border-bottom-color: var(--blue);
}
@media (max-width: 640px) {
  .section-subnav { display: flex; }   /* Spielbetrieb-Subnav auf Mobile sichtbar */
  .section-tab { font-size: 0.78rem; padding: 0.4rem 0.7rem; }
}

/* ===== Site Header (legacy, still used by some pages) ===== */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.site-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 1px;
  /* Niemals 2-zeilig — bei langen Liganamen (z.B. "Regionalliga Süd")
     reduziert das JS in base.html die font-size schrittweise bis der
     Text in eine Zeile passt. Falls das JS aus irgendeinem Grund nicht
     greift, schneidet overflow:hidden statt zu wrappen. */
  white-space: nowrap;
  overflow: hidden;
  min-width: 0;
}

.admin-link {
  font-size: 0.9rem;
  color: var(--muted);
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.admin-link:hover { color: var(--text); border-color: var(--muted); }

/* ===== Page sections ===== */
.page-section {
  padding: 1.2rem 1.5rem;
}

.section-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 1rem;
}

/* ===== Streams grid (top) — 1 bis 5 Kacheln pro Reihe (--stream-cols) ===== */
.streams-grid {
  display: grid;
  grid-template-columns: repeat(var(--stream-cols, 3), minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 1100px) {
  .streams-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .streams-grid { grid-template-columns: 1fr; }
}

/* ===== Court card (stream) ===== */
.court-card {
  display: block;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: border-color 0.2s, transform 0.15s;
  cursor: pointer;
}

.court-card:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
}

.video-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

.court-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== Placeholder ===== */
.stream-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0d2618 0%, #1a3a28 100%);
  gap: 0.4rem;
}
/* Hell-Modus: leere Stream-Kacheln werden hell (Text nutzt var(--text)/--muted und
   wird dann dunkel/lesbar). Dezente Kante, damit die Kachel auf hellem Grund sichtbar
   bleibt. (Anton-Entscheidung: helle Kachel, dunkler Text.) */
:root[data-theme="light"] .stream-placeholder {
  background: linear-gradient(135deg, #eef2f6 0%, #e2e8ee 100%);
  box-shadow: inset 0 0 0 1px var(--border);
}
/* Stream-/Aufzeichnungs-Overlay im Hell-Modus GENAUSO wie im Dunkel-Modus: der Scrim
   ist immer dunkel, also müssen Namen/Scores hell bleiben. Dazu die Text-Tokens im
   Overlay-Scope auf die Dunkel-Werte setzen (color hier setzen, damit auch .ov-name,
   das die Farbe erbt, hell wird). Gilt für Live-Grid, Live-Seite und Aufzeichnungen. */
:root[data-theme="light"] .score-overlay {
  --text:  #e6edf3;
  --muted: #8b949e;
  color: var(--text);
}
/* Ausnahme: leere Platzhalter-Kachel (kein Video) → heller Grund, dunkler Text
   (Anton: „helle Kachel, dunkler Text"). Scrim auflösen + Text-Tokens zurück auf hell.
   Gilt nur solange KEIN Stream läuft — bei laufendem Video bleibt das Overlay dunkel
   mit heller Schrift (siehe .score-overlay oben). */
:root[data-theme="light"] .video-wrap:has(.stream-placeholder) .score-overlay,
:root[data-theme="light"] .court-video-wrap:has(.stream-placeholder) .score-overlay {
  background: linear-gradient(transparent, rgba(0,0,0,0.04));
  --text:  #1f2328;
  --muted: #59636e;
  color: var(--text);
}
/* Hardcodierte Weiß-Werte im Overlay (Spielernamen, Next-up, Satz-Gewinn) auf der
   hellen Platzhalter-Kachel abdunkeln — sonst weiße Schrift auf hellem Grund. */
:root[data-theme="light"] .video-wrap:has(.stream-placeholder) .score-overlay .ov-name,
:root[data-theme="light"] .video-wrap:has(.stream-placeholder) .score-overlay .ov-nextup-row .ov-name,
:root[data-theme="light"] .video-wrap:has(.stream-placeholder) .score-overlay .ov-set-win,
:root[data-theme="light"] .video-wrap:has(.stream-placeholder) .score-overlay .ov-set-cur,
:root[data-theme="light"] .court-video-wrap:has(.stream-placeholder) .score-overlay .ov-name,
:root[data-theme="light"] .court-video-wrap:has(.stream-placeholder) .score-overlay .ov-nextup-row .ov-name,
:root[data-theme="light"] .court-video-wrap:has(.stream-placeholder) .score-overlay .ov-set-win,
:root[data-theme="light"] .court-video-wrap:has(.stream-placeholder) .score-overlay .ov-set-cur {
  color: #1f2328;
}
/* Unterste Zeile: Liga/Mannschaftsname — auf der hellen Kachel dunkel + dezente
   dunkle Trennlinie statt weißer. */
:root[data-theme="light"] .video-wrap:has(.stream-placeholder) .score-overlay .overlay-team-label,
:root[data-theme="light"] .court-video-wrap:has(.stream-placeholder) .score-overlay .overlay-team-label {
  color: #59636e;
  border-top-color: rgba(0, 0, 0, 0.12);
}

.placeholder-icon { font-size: 2.5rem; }
.placeholder-text { font-size: 1rem; color: var(--text); font-weight: 700; }
.placeholder-sub  { font-size: 0.8rem; color: var(--muted); }

.fullscreen-placeholder .placeholder-icon { font-size: 5rem; }
.fullscreen-placeholder .placeholder-text { font-size: 1.5rem; }
.fullscreen-placeholder .placeholder-sub  { font-size: 1rem; }

/* ===== LIVE Badge ===== */
.live-badge {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  background: var(--red);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 1px;
  animation: pulse-live 2s infinite;
}

@keyframes pulse-live {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

/* Stream-Training: Tag unten links auf dem Video ("Training · U18").
   Nicht pulsierend, andere Position als .live-badge (oben links).
   white-space:nowrap, damit "Training · …" nicht umbricht/abschneidet. */
.training-badge {
  position: absolute;
  bottom: 0.6rem;
  left: 0.6rem;
  max-width: calc(100% - 1.2rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(15, 20, 25, 0.78);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  border-left: 3px solid var(--green, #2ea043);
  letter-spacing: 0.5px;
}

/* ===== Score overlay (stream card) ===== */
.score-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.88));
  padding: 1.5rem 0.8rem 0.6rem;
}

.overlay-court-name {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.overlay-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.1rem 0;
}

.ov-name {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ov-sets { display: flex; gap: 0.4rem; }

.ov-set {
  font-size: 1rem;
  font-weight: 700;
  color: var(--muted);
  min-width: 1rem;
  text-align: center;
}

.ov-set-win { color: #fff; }
.ov-set-cur { color: rgba(255,255,255,0.5); }   /* Zwischenstand heller */
.ov-winner  { font-size: 0.8rem; font-weight: 700; color: var(--yellow); margin-top: 0.3rem; }
.ov-idle    { font-size: 0.8rem; color: var(--muted); padding: 0.3rem 0; }

/* Next-Up im Overlay (idle Court): nächste Spieler dort wo sonst die Live-
   Namen stehen. Kleines Label + leicht gedimmte Namen → klar „noch nicht live". */
.ov-nextup-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.2rem 0 0.05rem;
}
.ov-nextup-row { padding: 0.05rem 0; }
.ov-nextup-row .ov-name {
  font-weight: 600;
  color: rgba(255,255,255,0.75);
}

/* ===== All scores grid — feste Spaltenzahl (--court-cols: 4/5/6), damit die
   letzte Reihe moeglichst voll ist; responsiv nach unten. ===== */
.scores-grid {
  display: grid;
  grid-template-columns: repeat(var(--court-cols, 4), minmax(0, 1fr));
  gap: 0.8rem;
}

@media (max-width: 1100px) {
  .scores-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .scores-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .scores-grid { grid-template-columns: 1fr; }
}

.score-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  transition: border-color 0.2s;
}

.score-card.is-active  { border-color: var(--green); }
.score-card.is-done    { border-color: var(--yellow); opacity: 0.8; }

.sc-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.sc-name {
  font-size: 0.85rem; font-weight: 700; color: var(--muted);
  flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.sc-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  letter-spacing: 1px;
  flex-shrink: 0;
  /* Badge nach rechts pushen — sorgt für maximalen Abstand zwischen
     Court-Name und Status-Pill. Bell (falls vorhanden) klebt direkt
     dahinter (siehe .sc-bell-Regel weiter unten). */
  margin-left: auto;
}

.sc-badge.live { background: var(--red);    color: #fff; }
.sc-badge.done { background: var(--yellow); color: #000; }
/* Grace-Period Badge: Match ist fertig aber noch korrigierbar (15 min).
   Visuell schwächer als LIVE, klar abgegrenzt von "done"-Status der
   bereits weggeräumten Matches. */
.sc-badge.sc-badge-grace {
  background: rgba(166, 168, 173, 0.25);
  color: var(--muted);
  letter-spacing: 0.5px;
}
.score-card.is-grace {
  opacity: 0.78;
}
.score-card.is-grace:hover { opacity: 1; }

.sc-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.15rem 0;
}

.sc-player {
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
  /* Truncate als Safety-Net wenn der Name trotz Abkürzung im Server
     (siehe _name() Threshold 22) auf sehr engen Mobile-Containern nicht
     passt. min-width:0 ist Pflicht, damit ellipsis in flex-items greift. */
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sets-Container: immer rechtsbuendig im Row. min-width reserviert
   Platz fuer 3 Saetze + Gaps, damit Karten mit 1 Satz und Karten mit
   3 Saetzen die Score-Spalte an derselben x-Position haben. Bei 4+
   Saetzen waechst der Container ueber min-width hinaus. */
.sc-sets {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  min-width: 5.5rem;
  flex-shrink: 0;
}

.sc-set {
  font-size: 1rem;
  font-weight: 700;
  color: var(--muted);
  min-width: 1.5rem;     /* 2-stellige Zahlen wie "10" passen ohne Layout-Shift */
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.sc-set-win { color: var(--text); }
.sc-set-cur { color: var(--muted); opacity: 0.6; }

.sc-winner {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--yellow);
  margin-top: 0.4rem;
}

.sc-idle {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0.2rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
/* Verwalten-Hinweis auf leeren Plätzen — nur für Spielleiter sichtbar
   (Template-gated), signalisiert die Klickbarkeit der Karte. */
.sc-idle-manage {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--blue);
}

/* ===== Court Fullscreen ===== */
/* Court-Viewer belegt den gesamten Viewport — Top-Nav ist auf dieser Seite
   ausgeblendet. page-main nimmt daher die volle Höhe, .court-fullscreen
   füllt page-main, .court-video-wrap füllt .court-fullscreen → sauberer
   Flex-Chain ohne height-Hacks. */
body.court-page {
  display: flex;
  flex-direction: column;
  background: #000;
  height: 100vh;
  height: 100dvh; /* dynamic viewport height — respektiert iOS-Browser-UI */
  overflow: hidden;
}

body.court-page .page-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.court-fullscreen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;  /* Fallback-Ref für absolut positionierte Kinder */
}

/* Pseudo-Fullscreen für iOS Safari — da der native Fullscreen-API dort nur
   auf <video> erlaubt ist (und dann unser Overlay verschluckt), simulieren
   wir Fullscreen via fixed-Positioning. Sieht im Ergebnis identisch aus:
   Overlay + Controls bleiben sichtbar, Safari-Chrome wird überdeckt. */
.court-fullscreen.is-pseudo-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
}

.court-video-wrap {
  position: relative;
  flex: 1;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Safari-Flex-Fix: ohne min-height:0 + overflow:hidden zwingt das <video>
     mit seiner intrinsischen Auflösung (720p) den Container größer als den
     Flex-Slot und läuft unten aus dem Viewport raus — Overlay + Bar
     verschwinden. Mit diesen beiden bleibt die Wrap in ihrem Flex-Slot. */
  min-height: 0;
  overflow: hidden;
  /* Fallback-Höhe für den Fall, dass der Flex-Chain in Edge-Cases (z.B.
     Safari-Tab ohne dvh-Support) nicht greift — dann zumindest Viewport-
     Höhe minus eine grobe Browser-Chrome-Schätzung. */
  max-height: 100dvh;
}

/* Buffering-Spinner — dezenter rotierender Ring zentriert im Video. Wird
   per JS bei video.waiting/stalled gezeigt, bei playing/canplay/pause
   wieder versteckt. Klein, halbtransparent, kein „kaputt"-Eindruck. */
.stream-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 4;
}
.stream-loader[hidden] { display: none; }
.stream-loader-ring {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  animation: stream-loader-spin 0.9s linear infinite;
}
@keyframes stream-loader-spin {
  to { transform: rotate(360deg); }
}

.court-video-full {
  /* Aus dem Flex-Flow nehmen — sonst kann das <video> mit seiner intrinsischen
     Größe den Flex-Container aufblähen. inset:0 + object-fit:contain hält
     das Video innerhalb der Wrap-Box und zentriert automatisch. */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ===== TV Overlay ===== */
.tv-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.9) 40%);
  padding: 3rem 1.5rem 1rem;
}

.tv-court-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.tv-scores {
  background: rgba(13, 17, 23, 0.85);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  display: inline-flex;
  flex-direction: column;
  min-width: 280px;
  border: 1px solid rgba(255,255,255,0.1);
}

.tv-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.35rem 0;
}

.tv-divider { height: 1px; background: rgba(255,255,255,0.1); }
.tv-name    { flex: 1; font-size: 1.2rem; font-weight: 700; }

.tv-set-scores { display: flex; gap: 0.6rem; }

.tv-set {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--muted);
  min-width: 1.3rem;
  text-align: center;
}

.tv-set-win { color: #fff; }
.tv-set-cur { color: rgba(255,255,255,0.45); }
.tv-winner  { margin-top: 0.5rem; font-size: 1.1rem; font-weight: 800; color: var(--yellow); }
.tv-idle    { font-size: 1rem; color: var(--muted); }

/* ===== /tv/court/<id> — standalone OBS overlay ===== */
/* Overrides for when the overlay runs on its own transparent page,
   positioned in a corner for OBS browser sources. */

body.tv-standalone .tv-root {
  position: fixed;
  max-width: 90vw;
}

body.tv-standalone.tv-pos-bl .tv-root { bottom: 40px; left: 40px; }
body.tv-standalone.tv-pos-br .tv-root { bottom: 40px; right: 40px; }
body.tv-standalone.tv-pos-tl .tv-root { top: 40px;    left: 40px; }
body.tv-standalone.tv-pos-tr .tv-root { top: 40px;    right: 40px; }

body.tv-standalone .tv-team-label {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(0, 0, 0, 0.62);
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  margin-bottom: 0.35rem;
  letter-spacing: 0.4px;
  backdrop-filter: blur(6px);
}

/* Kill the legacy full-width bottom-gradient layout — we want a compact box */
body.tv-standalone .tv-overlay {
  position: static;
  background: transparent;
  padding: 0;
}

body.tv-standalone .tv-court-label {
  font-size: 0.66rem;
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 0.25rem;
  padding: 0 0.3rem;
  letter-spacing: 1.5px;
}

body.tv-standalone .tv-scores {
  background: rgba(0, 0, 0, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0.55rem 1rem;
  min-width: 340px;
  backdrop-filter: blur(8px);
}

body.tv-standalone .tv-row {
  display: grid;
  grid-template-columns: 1.6rem 1fr auto auto auto;  /* serve | name | sets | pts | wo */
  gap: 0.8rem;
  align-items: center;
  padding: 0.35rem 0;
}

body.tv-standalone .tv-name {
  font-size: 1.08rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.tv-standalone .tv-name.is-loser { color: rgba(255, 255, 255, 0.55); }

body.tv-standalone .tv-set-scores { display: flex; gap: 0.55rem; }
body.tv-standalone .tv-set        { font-size: 1.15rem; min-width: 1.3rem; }
body.tv-standalone .tv-set-cur    { color: rgba(255, 255, 255, 0.55); }

body.tv-standalone .tv-points {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  min-width: 2.4rem;
  text-align: center;
  padding: 0.1rem 0.5rem;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}

body.tv-standalone .tv-points:empty { display: none; }

body.tv-standalone .tv-divider { background: rgba(255, 255, 255, 0.14); }

body.tv-standalone .serve-slot {
  font-size: 0.95rem;
  text-align: center;
}

body.tv-standalone .tv-wo-slot { min-width: 2rem; text-align: center; }

body.tv-standalone .tv-idle {
  background: rgba(0, 0, 0, 0.78);
  padding: 0.8rem 1.2rem;
  border-radius: 6px;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(6px);
}

/* ===== /court/<id> — Viewer Fullscreen ===== */
/* Chrome-Layer: YouTube-Style Auto-Hide für Back-Btn + zukünftige Controls.
   Das tv-overlay daneben (Scores) bleibt bewusst außerhalb → immer sichtbar. */
body.court-page .court-chrome {
  position: absolute;
  inset: 0;
  pointer-events: none;       /* Klicks durch zum Video, außer auf aktiven Kindern */
  z-index: 5;
  transition: opacity 0.35s ease;
  opacity: 1;
}

body.court-page .court-chrome > * { pointer-events: auto; }

body.court-page .court-chrome.is-hidden {
  opacity: 0;
  /* Kein translate → kein Wackeln beim Fade-out */
}

/* Video-Controls-Bar unten (Progress-Bar + Play/Pause/Mute/Fullscreen).
   YouTube-Style zweireihig: oben die Timeline, unten die Button-Zeile. Fade
   über .court-chrome.is-hidden Auto-Hide-Logik, Gradient-Backdrop für
   Lesbarkeit gegen helle Videos. Overlay unten-links wird bewusst von der
   Bar überblendet — das ist OK, die Bar verschwindet ja nach 3 Sek wieder. */
body.court-page .video-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2.2rem 1rem 0.6rem;   /* Top-Padding lässt Gradient sanft auslaufen */
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: linear-gradient(transparent 0%, rgba(0, 0, 0, 0.88) 100%);
  pointer-events: none;
  z-index: 6;
}

body.court-page .video-controls .vc-btn,
body.court-page .video-controls .vc-progress { pointer-events: auto; }

/* ── Progress-Bar ────────────────────────────────────────────────────── */
/* YouTube-Feeling: dünne Linie, beim Hover oder Scrubbing wächst sie,
   Thumb erscheint. Buffered-Range in hellerem Grau unter dem roten Fill. */
.vc-progress {
  width: 100%;
  height: 14px;          /* großer Klick-Hitbereich, Track ist visuell dünner */
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 5px 0;        /* vertikales Padding vergrößert Klick-Hitbox */
}

.vc-progress.is-hidden { visibility: hidden; }   /* bei Live-Streams */

.vc-progress-track {
  position: relative;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 2px;
  transition: height 0.12s ease;
}

.vc-progress:hover .vc-progress-track,
.vc-progress.is-scrubbing .vc-progress-track { height: 5px; }

.vc-progress-buffered,
.vc-progress-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  border-radius: 2px;
}

.vc-progress-buffered { background: rgba(255, 255, 255, 0.42); width: 0; }
.vc-progress-fill     { background: #fff;                      width: 0; }

.vc-progress-thumb {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 13px;
  height: 13px;
  background: #fff;
  border-radius: 50%;
  left: 0;
  transition: transform 0.12s ease;
  pointer-events: none;
}

.vc-progress:hover .vc-progress-thumb,
.vc-progress.is-scrubbing .vc-progress-thumb { transform: translate(-50%, -50%) scale(1); }

/* ── Button-Zeile ────────────────────────────────────────────────────── */
.vc-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.vc-time {
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  padding: 0 0.4rem;
  pointer-events: none;
}

.vc-time.is-hidden { display: none; }

.vc-live-badge {
  display: none;   /* Default versteckt, JS zeigt nur am Live-Edge */
  color: #fff;
  background: #ff3b30;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  padding: 0.25rem 0.6rem;
  border-radius: 3px;
  text-transform: uppercase;
  pointer-events: none;
  /* sanfter Puls als "live"-Affordance */
  animation: vcLivePulse 1.8s ease-in-out infinite;
}

.vc-live-badge.is-live { display: inline-block; }

@keyframes vcLivePulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.75; }
}

/* ── Zurück-zu-Live-Button (sichtbar wenn nicht am Live-Edge) ───────── */
.vc-back-live {
  display: none;
  align-items: center;
  gap: 0.4rem;
  margin-left: 0.4rem;
  padding: 0.3rem 0.7rem 0.3rem 0.55rem;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.15s, border-color 0.15s;
}

.vc-back-live.is-visible { display: inline-flex; }
.vc-back-live:hover      { background: rgba(255, 255, 255, 0.22);
                           border-color: rgba(255, 255, 255, 0.45); }
.vc-back-live:active     { transform: scale(0.97); }

.vc-bl-dot {
  width: 8px;
  height: 8px;
  background: #ff3b30;
  border-radius: 50%;
  flex-shrink: 0;
  animation: vcLivePulse 1.8s ease-in-out infinite;
}

/* ── Center-Controls (Rewind 15s · Play · Forward 15s) ──────────────── */
/* Absolut zentriert im Video-Container. Sichtbarkeit folgt der gleichen
   Auto-Hide-Logik wie .court-chrome (fade über .is-hidden). */
.vc-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 1.6rem;
  z-index: 6;
  pointer-events: none;   /* Container neutral, Buttons aktiv */
}

/* Line-art Stil: keine Kreis-Hintergründe, nur Icons. Sky/YouTube-mäßig.
   Hover = subtler Glow, kein Box. Die Icons selbst sind Stroke-SVGs (außer
   Play/Pause die filled bleiben). */
.vc-cbtn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  padding: 0;
  transition: background 0.15s, transform 0.1s, opacity 0.18s;
  /* Drop-Shadow am Icon damit es auf hellem Hintergrund lesbar bleibt */
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.55));
}

.vc-cbtn-play { width: 60px; height: 60px; }

.vc-cbtn:hover  { background: rgba(255, 255, 255, 0.14); }
.vc-cbtn:active { transform: scale(0.92); }

.vc-cbtn.is-disabled {
  opacity: 0;
  pointer-events: none;
}

/* Sekunden-Zahl mittig im Pfeil-Loop von Rewind/Forward */
.vc-cbtn-num {
  position: absolute;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -38%);
  color: #fff;
}

/* Play/Pause-Icon-Toggle im Center-Player (gespiegelt zur Bottom-Bar:
   is-playing → pause-icon zeigen, sonst play-icon). */
.vc-cbtn-play .vc-cicon-pause { display: none; }
.court-fullscreen.is-playing .vc-cbtn-play .vc-cicon-play  { display: none; }
.court-fullscreen.is-playing .vc-cbtn-play .vc-cicon-pause { display: inline-block; }

/* vc-center liegt INNERHALB von .court-chrome — fadet via Parent-Opacity
   automatisch mit der Auto-Hide-Logik. Kein eigener Transition nötig. */

.vc-btn {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s, transform 0.1s;
}

.vc-btn:hover  { background: rgba(255, 255, 255, 0.15); }
.vc-btn:active { transform: scale(0.95); }

.vc-spacer { flex: 1; }

/* Play/Pause-Icon je nach Zustand: wenn .is-playing auf .court-fullscreen
   steht, zeig das Pause-Icon; sonst Play-Icon. Gleiche Logik für Mute. */
.vc-icon-play, .vc-icon-pause { display: none; }
body.court-page .court-fullscreen:not(.is-playing) .vc-icon-play  { display: inline-block; vertical-align: middle; }
body.court-page .court-fullscreen.is-playing       .vc-icon-pause { display: inline-block; vertical-align: middle; }

.vc-icon-sound, .vc-icon-mute { display: none; }
body.court-page .court-fullscreen:not(.is-muted) .vc-icon-sound { display: inline-block; vertical-align: middle; }
body.court-page .court-fullscreen.is-muted       .vc-icon-mute  { display: inline-block; vertical-align: middle; }

/* Mute-Button + vertikaler Volume-Slider als Popup. Der Popup ist
   position:absolute, damit das Aufklappen den Button-Row nicht verschiebt.
   Erscheint bei Hover/Focus auf der Volume-Gruppe — die Hitbox reicht bis
   ins Popup hinein (padding-bottom), sodass Maus-Weg zum Slider nicht das
   Popup schließt. */
.vc-volume {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.vc-vol-popup {
  position: absolute;
  bottom: 100%;           /* direkt über dem Button */
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 0.6rem 0.4rem;
  background: rgba(20, 20, 20, 0.9);
  border-radius: 6px;
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.vc-volume:hover .vc-vol-popup,
.vc-volume:focus-within .vc-vol-popup {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(-4px);
}
/* Hover-Bridge: unsichtbarer "Steg" zwischen Button und Popup, damit der
   Hover nicht bricht wenn die Maus vom Button ins Popup wandert. */
.vc-vol-popup::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 12px;
}
/* Slider vertikal via writing-mode (moderne Browser) */
.vc-vol-slider {
  -webkit-appearance: none;
  appearance: none;
  writing-mode: vertical-lr;
  direction: rtl;           /* 0 unten, 1 oben */
  width: 4px;
  height: 90px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 2px;
  outline: none;
  margin: 0;
  cursor: pointer;
}
.vc-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
}
.vc-vol-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

/* Cursor über dem Video → Signal dass Click = Play/Pause */
body.court-page .court-video-full { cursor: pointer; }

/* Compact bottom-left overlay instead of the legacy bottom-gradient bar.
   Reuses the same visual tokens as /tv/court/ — gleicher Look auf beiden
   Oberflächen. */
body.court-page .tv-overlay {
  position: absolute;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  left: calc(24px + env(safe-area-inset-left, 0px));
  right: auto;
  background: transparent;
  padding: 0;
  max-width: 85vw;
}

/* Court-Page Safe-Area: Back-Button oben und Controls unten müssen
   iOS Notch/Status-Bar und Home-Indicator berücksichtigen, wenn als PWA
   installiert (viewport-fit=cover). */
body.court-page .back-btn {
  top: calc(1rem + env(safe-area-inset-top, 0px));
  left: calc(1rem + env(safe-area-inset-left, 0px));
}

body.court-page .video-controls {
  padding-bottom: calc(0.6rem + env(safe-area-inset-bottom, 0px));
  padding-left: calc(1rem + env(safe-area-inset-left, 0px));
  padding-right: calc(1rem + env(safe-area-inset-right, 0px));
}

body.court-page .tv-scores {
  background: rgba(0, 0, 0, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0.55rem 1rem;
  min-width: 320px;
  backdrop-filter: blur(8px);
}

body.court-page .tv-court-label {
  font-size: 0.66rem;
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 0.25rem;
  padding: 0 0.3rem;
  letter-spacing: 1.5px;
}

body.court-page .tv-row {
  display: grid;
  grid-template-columns: 1.6rem 1fr auto auto auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.35rem 0;
}

body.court-page .tv-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.court-page .tv-name.is-loser { color: rgba(255, 255, 255, 0.55); }

body.court-page .tv-set-scores { display: flex; gap: 0.55rem; }
body.court-page .tv-set        { font-size: 1.12rem; min-width: 1.3rem; }
body.court-page .tv-set-cur    { color: rgba(255, 255, 255, 0.55); }

body.court-page .tv-points {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  min-width: 2.3rem;
  text-align: center;
  padding: 0.1rem 0.5rem;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}

body.court-page .tv-points:empty { display: none; }

body.court-page .tv-divider { background: rgba(255, 255, 255, 0.14); }

body.court-page .tv-wo-slot { min-width: 2rem; text-align: center; }

body.court-page .tv-idle {
  background: rgba(0, 0, 0, 0.78);
  padding: 0.8rem 1.2rem;
  border-radius: 6px;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(6px);
}

/* ===== Back button ===== */
.back-btn {
  position: absolute;
  top: 1rem; left: 1rem;
  background: rgba(13,17,23,0.8);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 10;
  transition: background 0.2s;
}
.back-btn:hover { background: var(--card); }

/* Back-Button auf der Stream-/Court-Seite hat IMMER einen dunklen Glas-Hintergrund
   (rgba(13,17,23,.8)) über dem Video → Text muss auch im Hell-Modus hell bleiben,
   sonst dunkler Text auf dunklem Grund (Anton: „back button um stream ist weird").
   Auch den Hover fixen: var(--card) wäre im Hell-Modus weiß → hell auf hell. */
:root[data-theme="light"] body.court-page .back-btn,
:root[data-theme="light"] body.vod-page .back-btn {
  color: #e6edf3;
  background: rgba(13,17,23,0.8);
}
:root[data-theme="light"] body.court-page .back-btn:hover,
:root[data-theme="light"] body.vod-page .back-btn:hover {
  color: #fff;
  background: rgba(13,17,23,0.92);
}

/* ===== Admin pages ===== */
body.admin-page {
  /* Kein max-width: Admin-Pages spannen genauso weit wie Live / Begegnung /
     Schedule (die keinen Cap haben). Innen-Padding kommt aus .admin-section
     und .admin-header. */
  padding-bottom: 2rem;
}
/* Direkter Inhalt ohne .admin-section (Text, Grids wie QR-Codes/Reichweite)
   bekommt denselben Seitenrand wie der Header — sonst klebt er am Rand. */
body.admin-page .page-main > p,
body.admin-page .page-main > div:not(.admin-section):not(.admin-header):not(.admin-subnav) {
  padding-inline: 1.5rem;
}

.admin-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.admin-header .back-btn {
  position: absolute;
  left: 1rem; top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 1px solid var(--border);
}

.admin-header h1 { font-size: 1.1rem; font-weight: 700; }

/* Admin court list */
.admin-courts {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0 1rem;
}

.admin-court-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1rem;
}

.admin-court-card.is-active { border-color: var(--green-lt); }

.admin-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.admin-court-name { font-size: 1rem; font-weight: 700; }

.status-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  letter-spacing: 1px;
}

.status-badge.active { background: var(--green);  color: #fff; }
.status-badge.done   { background: var(--yellow); color: #000; }
.status-badge.idle   { background: var(--border); color: var(--muted); }
/* Begegnungs-Status verlegt/unterbrochen (gelb, wie Auswärts-Badge).
   In den Begegnungs-Karten kompakt wie .away-badge. */
.status-badge.status-verlegt,
.status-badge.status-unterbrochen {
  background: var(--yellow); color: #000; text-transform: uppercase;
}
.bg-card-meta-top .status-badge {
  font-size: 0.6rem; padding: 0.05rem 0.35rem; letter-spacing: 0.5px;
}
.bg-status-line {
  display: flex; align-items: center; gap: 0.4rem;
  justify-content: center; margin-top: 0.3rem;
  font-size: 0.8rem; color: var(--muted);
}

.admin-score-preview { margin-bottom: 0.6rem; }

.asp-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.1rem 0;
}

.asp-name { flex: 1; font-size: 0.95rem; font-weight: 600; }
.asp-sets { color: var(--muted); font-size: 0.9rem; font-weight: 600; display: flex; gap: 0.4rem; }
.asp-tiebreak { font-size: 0.7rem; color: var(--red); font-weight: 700; margin-top: 0.2rem; }

/* ===== Admin Court Detail ===== */
.current-score-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.2rem;
  margin: 0 1rem 1rem;
}

.current-score-box.match-over { border-color: var(--yellow); }

.score-display-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.25rem 0;
}

.sd-name { flex: 1; font-size: 1.2rem; font-weight: 700; }
.sd-sets { display: flex; gap: 0.5rem; }

.sd-set {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--muted);
  min-width: 1.5rem;
  text-align: center;
}

.sd-win { color: var(--text); }

.sd-sets-won {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.5rem;
  text-align: right;
}

.winner-display {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--yellow);
  text-align: center;
  margin-bottom: 0.6rem;
}

/* Admin sections */
.admin-section {
  margin: 0 1rem 0.8rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
}

.admin-section h2 {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.8rem;
}

.label-hint {
  font-size: 0.7rem;
  color: var(--muted);
  opacity: 0.6;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

.danger-section { border-color: rgba(218, 54, 51, 0.3); }

/* Name inputs */
.name-inputs {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
}

.name-input {
  flex: 1;
  min-width: 120px;
  font-size: 1rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  outline: none;
}

.name-input:focus { border-color: var(--blue); }
.vs-label { color: var(--muted); font-weight: 700; }

/* ===== Scoring Columns (admin_court side-by-side) ===== */
.scoring-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 0 1rem 1rem;
}

.scoring-col {
  background: var(--card);
  border-radius: var(--radius);
  padding: 0.8rem;
  border: 1px solid var(--border);
}

.col-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.6rem;
}

/* ── Satz rows (left column) ── */
.satz-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.satz-row:last-of-type { border-bottom: none; }
.satz-done { opacity: 0.7; }
.satz-locked { opacity: 0.25; pointer-events: none; }

.satz-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  min-width: 1.8rem;
}

.satz-score-done {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--muted);
}

.satz-score-done .satz-win { color: var(--text); }

.satz-check {
  color: var(--green);
  font-size: 0.9rem;
  margin-left: 0.2rem;
}

.satz-score-live {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.satz-num {
  font-size: 1.5rem;
  font-weight: 800;
  min-width: 1.3rem;
  text-align: center;
}

.satz-colon {
  color: var(--muted);
  font-size: 1.2rem;
}

.satz-locked-dash {
  color: var(--muted);
  font-size: 1.2rem;
}

.inline-form { display: inline; margin: 0; padding: 0; }

.inc-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  font-family: inherit;
}

.inc-btn:active { background: var(--border); }

/* Third set type toggle */
.third-btns {
  display: flex;
  gap: 0.3rem;
  margin-left: auto;
}

.btn-type-sm {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
}

.btn-type-sm.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

/* ── Points column (right) ── */
.pts-score-row {
  text-align: center;
  padding: 0.4rem 0 0.6rem;
}

.pts-val {
  font-size: 1.8rem;
  font-weight: 900;
}

.pts-colon {
  font-size: 1.4rem;
  color: var(--muted);
  margin: 0 0.3rem;
}

.pts-table {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pts-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.pts-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
  color: #fff;
}

.pts-btn:active { filter: brightness(0.85); }
.pts-btn-p1 { background: var(--green-lt); }
.pts-btn-p2 { background: var(--blue); }

.pts-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.tb-label-sm {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.4rem;
}

.btn-sm {
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
}

/* ── Serve slot (fixed-width ball placeholder) ── */
/* font-size:0.85em rendert das Tennisball-Emoji etwas kleiner als die
   Spielernamen — bewusst zurückgenommen damit der Ball nicht den Blick
   vom Namen klaut. tv-standalone setzt das Override drüber. */
.serve-slot {
  display: inline-block;
  width: 1.2em;
  flex-shrink: 0;
  text-align: center;
  line-height: 1;
  font-size: 0.85em;
}
/* 🎾 & Co. sollen FARB-Emoji bleiben — der globale font-variant-emoji:text
   (nur fuer Symbol-Glyphs ⚙✏ gedacht) rendert den Tennisball sonst als Text,
   was auf manchen Systemen als Tofu/"komische Buchstaben" erscheint. */
.serve-slot, .btn-serve, .empty-state-icon { font-variant-emoji: emoji; }

/* ── Serve selector ── */
.serve-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 1rem 0.8rem;
  flex-wrap: wrap;
}

.serve-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-serve {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}

.btn-serve:hover { border-color: var(--blue); }

.btn-serve.is-active {
  background: var(--green);
  border-color: var(--green-lt);
  color: #fff;
}
/* AJAX-Pending-State: Klick-Feedback bis der Server geantwortet hat. */
.btn-serve.is-pending,
.btn-undo.is-pending { filter: brightness(0.85); }

.serve-choice {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.serve-current {
  font-size: 0.9rem;
  font-weight: 700;
}

.btn-serve-switch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  font-family: inherit;
}

.btn-serve-switch:hover { color: var(--text); border-color: var(--blue); }

/* ===== Teams / Mannschaften ===== */
.team-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.team-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.8rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.team-card-main { flex: 1; min-width: 0; }

.team-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.team-card-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.team-card-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.team-create-form .name-row { margin-bottom: 0; }

.muted-hint {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0.4rem 0;
}

/* Meldeliste */
.roster-paste {
  width: 100%;
  font-family: monospace;
  font-size: 0.8rem;
  padding: 0.7rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  resize: vertical;
  outline: none;
}

.roster-paste:focus { border-color: var(--blue); }

.roster-btn-row {
  margin-top: 0.6rem;
  display: flex;
  gap: 0.4rem;
}

.roster-list {
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}

.roster-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.roster-players {
  list-style: decimal inside;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 0.8rem;
  padding-left: 0.4rem;
}

.roster-players li {
  padding: 0.15rem 0;
}

/* Match meta (team + opponent) in admin court page */
.match-meta-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.match-meta-row select.name-input,
.match-meta-row input.name-input {
  flex: 1;
  min-width: 0;
}

/* Team label on admin list */
.admin-team-line {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

/* Team label below score on index score cards */
.sc-team-label {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--border);
}

/* Team label on stream overlay (under the score rows) */
.overlay-team-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 0.4rem;
  padding-top: 0.3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

/* ===== Begegnungen ===== */

/* Aggregated score header (admin edit) */
.bg-aggregate-score {
  text-align: center;
  padding: 0.6rem;
  font-size: 2rem;
  font-weight: 900;
  color: var(--text);
}

.bg-aggregate-score .bg-as-colon {
  color: var(--muted);
  margin: 0 0.4rem;
}

/* Lineup grid (admin edit) */
.lineup-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.lineup-head {
  display: grid;
  grid-template-columns: 2.2rem 1fr 1fr auto;
  gap: 0.6rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}

.lineup-row {
  display: grid;
  grid-template-columns: 2.2rem 1fr 1fr auto;
  gap: 0.6rem;
  align-items: start;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.lineup-pos {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--muted);
  padding-top: 0.5rem;
}

.lineup-cell {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.lineup-cell .name-input {
  width: 100%;
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
}

/* Slot status (start/live/done) */
.slot-status,
.slot-start-form {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.slot-status-done .slot-result {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.slot-result .satz-win { color: var(--green); }

.slot-status-live .slot-live-link {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--blue);
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--blue);
  border-radius: 12px;
}

.court-pick {
  font-size: 0.8rem;
  padding: 0.3rem 0.5rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
}

.btn-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.btn-icon:hover { border-color: var(--blue); color: var(--blue); }

/* ===== Admin sub-tab navigation ===== */
.admin-subnav {
  display: flex;
  gap: 0.2rem;
  padding: 0.5rem 1rem 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.admin-subnav::-webkit-scrollbar { display: none; }
.admin-subnav > * { flex: 0 0 auto; }

/* Einheitlich mit .section-tab: kleine Schrift + Unterstrich-Indikator (statt
   der frueheren Box) — gleiche Optik fuer Mein-Bereich-, Spielbetrieb- und
   Verwaltung-Subnav. */
.admin-subtab {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.5rem 0.9rem;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}

.admin-subtab:hover { color: var(--text); }

.admin-subtab.is-active {
  color: var(--text);
  border-bottom-color: var(--blue);
}

/* Admin-Subnav auf Mobile: kompakt + horizontal scrollbar wenn die Tabs
   nicht alle in eine Zeile passen. (Früher: display:none mit Verweis auf
   einen Hamburger-Sub-Eintrag, der aber nie für mein-bereich gebaut wurde
   — auf Mobile waren die 4 Mein-Bereich-Subtabs damit unerreichbar.) */
@media (max-width: 640px) {
  .admin-subnav {
    padding: 0.4rem 0.6rem 0;
    gap: 0.15rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .admin-subnav .admin-subtab {
    font-size: 0.78rem;
    padding: 0.4rem 0.7rem;
  }
}

/* ===== Admin Matches: date picker ===== */
.admin-date-picker {
  padding: 0.8rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.admin-date-picker form {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.admin-date-picker label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-date-picker input[type=date] {
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
}

/* ===== Nicht zugewiesen: collapsible list with inline forms ===== */
.unassigned-section {
  margin: 0 1rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
}

.unassigned-section > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  user-select: none;
}

.unassigned-section > summary::-webkit-details-marker { display: none; }

.unassigned-section > summary::before {
  content: "▸";
  display: inline-block;
  color: var(--muted);
  font-size: 0.8rem;
  transition: transform 0.15s;
  width: 0.8rem;
}

.unassigned-section[open] > summary::before {
  transform: rotate(90deg);
}

.unassigned-section > summary .section-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  padding: 0;
  margin: 0;
}

.unassigned-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem 0 0;
}

.unassigned-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 0.9rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex-wrap: wrap;
}

.ua-info {
  flex: 1;
  min-width: 200px;
}

.ua-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.2rem;
  flex-wrap: wrap;
}

.ua-type-badge {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.1rem 0.4rem;
  border-radius: 8px;
}

.ua-type-tournament { background: var(--blue);  color: #fff; }
.ua-type-mannschaft { background: var(--green); color: #fff; }

.ua-pos {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--muted);
  background: var(--bg);
  padding: 0.1rem 0.4rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.ua-event {
  font-size: 0.75rem;
  color: var(--muted);
  flex: 1;
  min-width: 0;
}

.ua-players {
  font-size: 0.9rem;
  font-weight: 600;
}

.ua-inputs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.ua-inputs .ua-date,
.ua-inputs .ua-time,
.ua-inputs .ua-court {
  font-size: 0.8rem;
  padding: 0.35rem 0.5rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
}

.ua-inputs .ua-date  { width: 9rem; }
.ua-inputs .ua-time  { width: 6rem; }
.ua-inputs .ua-court { min-width: 7rem; }

.ua-date-fixed {
  display: inline-block;
  font-size: 0.8rem;
  padding: 0.35rem 0.5rem;
  color: var(--muted);
  width: 9rem;
}

/* ===== Meldeliste (admin tournament view) ===== */
.meldeliste-list {
  list-style: decimal inside;
  font-size: 0.9rem;
  padding-left: 0.4rem;
  margin-bottom: 0.5rem;
}

.meldeliste-list li {
  padding: 0.2rem 0;
}

.kpl-seed {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.05rem 0.3rem;
  border-radius: 6px;
  margin-right: 0.3rem;
}

.kpl-lk {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.05rem 0.35rem;
  border-radius: 6px;
  margin-left: 0.3rem;
}

.ml-name {
  font-weight: 600;
}

.meldeliste-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

/* ===== Admin tab — court tile grid with schedule + start buttons ===== */
.admin-court-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0.9rem;
  padding: 0 1rem 1rem;
}

.admin-court-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-court-tile.is-busy { border-color: var(--blue); }

.admin-court-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.admin-court-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.5px;
}

.admin-court-status {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.15rem 0.4rem;
  border-radius: 8px;
}

.admin-court-status.status-live { background: var(--blue);  color: #fff; }
.admin-court-status.status-done { background: var(--green); color: #fff; }

/* Current live state (small score box at top of tile) */
.admin-court-current {
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--border);
  background: rgba(31, 111, 235, 0.04);
}

.acc-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.15rem 0;
  font-size: 0.85rem;
  font-weight: 700;
}

.acc-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.acc-sets {
  display: flex;
  gap: 0.35rem;
}

.acc-set {
  display: inline-block;
  min-width: 1.1rem;
  text-align: center;
  font-weight: 800;
  color: var(--muted);
}

.acc-set.acc-set-win { color: var(--text); }
.acc-set.acc-set-cur { color: var(--blue); }

.acc-manage-link {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--blue);
}

/* Today's match list inside the tile */
.admin-tile-matches {
  display: flex;
  flex-direction: column;
}

.admin-tile-match {
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--border);
}

.admin-tile-match:last-child { border-bottom: none; }
.admin-tile-match.admin-tile-match-live { background: rgba(31, 111, 235, 0.06); }
.admin-tile-match.admin-tile-match-done { opacity: 0.75; }

.atm-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.atm-time {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text);
}

.atm-pos {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--muted);
  background: var(--bg);
  padding: 0.1rem 0.35rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.atm-team {
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 500;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.atm-status {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.1rem 0.35rem;
  border-radius: 8px;
  margin-left: auto;
}

.atm-status-live { background: var(--blue);  color: #fff; }
.atm-status-done { background: var(--green); color: #fff; }
.atm-status-open {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.atm-players {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.atm-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}

.atm-actions .btn-sm { padding: 0.3rem 0.7rem; font-size: 0.78rem; flex: 0 0 auto; }
.atm-actions .btn:disabled { opacity: 0.4; cursor: not-allowed; }

.atm-result {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

.atm-result .satz-win { color: var(--green); }

.admin-tile-empty {
  padding: 1rem 0.9rem;
  text-align: center;
}

/* Training-planen-Footer — auf Kamera-Courts immer sichtbar, auch wenn
   schon Matches geplant sind. Dezent unter dem Tile-Inhalt. */
.admin-tile-tp-footer {
  margin-top: auto;
  padding: 0.5rem 0.9rem 0.7rem;
  border-top: 1px solid var(--border);
  text-align: center;
}
.admin-tile-tp-footer .tp-footer-btn {
  width: 100%;
}

/* Matchday-Warnung im Training-Modal */
.tp-matchday-warn {
  margin: 0.2rem 0 0.6rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #d9a300;
  border-left: 3px solid #d9a300;
  border-radius: var(--radius-sm, 6px);
  background: rgba(217, 163, 0, 0.10);
  font-size: 0.86rem;
  line-height: 1.35;
}
.tp-matchday-warn strong { color: #b88600; }

/* Geparktes Training auf einem belegten Court-Tile */
.admin-court-parked {
  margin: 0.4rem 0.9rem 0;
  padding: 0.45rem 0.6rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm, 6px);
  background: rgba(127, 127, 127, 0.06);
}
.admin-court-parked .acp-line { font-size: 0.85rem; font-weight: 500; }
.admin-court-parked .acp-sub  { font-size: 0.78rem; margin-top: 0.1rem; }
.admin-court-parked .tp-cancel-form { margin-top: 0.35rem; }

/* Teil B — Hallen-Verlegung */
.admin-court-status.status-relocated { background: var(--yellow); color: #000; }
.sc-badge.relocated { background: var(--yellow); color: #000; }
.hall-relocated-banner {
  margin: 0.6rem 0; padding: 0.6rem 0.8rem;
  border: 1px solid var(--yellow); border-left: 3px solid var(--yellow);
  border-radius: var(--radius-sm, 6px); background: rgba(210, 153, 34, 0.10);
  font-size: 0.9rem; line-height: 1.4;
}
.hall-toggle-label {
  display: flex; align-items: center; gap: 0.5rem;
  font-weight: 500; cursor: pointer; margin-bottom: 0.2rem;
}
.hall-radio { cursor: pointer; user-select: none; }
.hall-radio.active { background: var(--green); color: #fff; border-color: var(--green); }

/* Confirm dialog */
.start-dialog {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0;
  max-width: 90vw;
  width: 360px;
}

.start-dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

/* VOD-Claim-Popup: garantiert mittig (auch im [open]-Fallback) + dezenter —
   etwas schmaler, weicherer Backdrop, ruhigere Typo. */
#vod-claim-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  width: 320px;
  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.30);
}
#vod-claim-dialog::backdrop { background: rgba(0, 0, 0, 0.38); }
#vod-claim-dialog .dialog-form { padding: 1.05rem 1.2rem; }
#vod-claim-dialog .dialog-form h3 { font-size: 0.96rem; margin-bottom: 0.45rem; }
#vod-claim-dialog .dialog-form p { margin: 0; }
#vod-claim-dialog .dialog-actions { margin-top: 0.95rem; }

.dialog-form {
  padding: 1.2rem 1.4rem;
}

.dialog-form h3 {
  font-size: 1.05rem;
  margin-bottom: 0.8rem;
}

.dialog-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.dialog-table th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.3rem 0.5rem 0.3rem 0;
  vertical-align: top;
  width: 6.5rem;
}

.dialog-table td {
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.3rem 0;
  color: var(--text);
}

.dialog-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.dialog-actions .btn { width: auto; padding: 0.5rem 1rem; }

/* ===== Training planen Modal (auf /admin + Live-Grid) ===== */
.tp-dialog { width: 420px; max-width: 92vw; max-height: 90vh; overflow-y: auto; }
/* Mobil: schmaler Viewport → Dialog zentriert (showModal zentriert nativ; die
   max-width hält ihn im Bild) und die 3 Aktions-Buttons dürfen umbrechen statt
   über den Rand zu laufen. */
@media (max-width: 560px) {
  .tp-dialog { width: 94vw; }
  .tp-dialog .dialog-actions { justify-content: stretch; }
  .tp-dialog .dialog-actions .btn { flex: 1 1 0; padding: 0.5rem 0.4rem; font-size: 0.9rem; }
}
.tp-dialog .dialog-title {
  font-size: 1rem;
  margin: 0 0 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.tp-mode-fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.7rem 0.4rem;
  margin: 0 0 0.8rem;
}
.tp-mode-fieldset legend {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  padding: 0 0.4rem;
}
/* .tp-radio-label entfernt — Mode-Toggle nutzt jetzt .tp-check.
   Innerhalb des Modus-Fieldsets etwas kompakter dargestellt. */
.tp-mode-fieldset .tp-check-toggle { margin-bottom: 0.4rem; }
.tp-mode-fieldset .tp-check-toggle:last-of-type { margin-bottom: 0; }
/* Themed Checkbox/Radio im Modal — gleicher Look wie .push-pref-toggle:
   native Input visually hidden, custom Box per CSS. Aktiv = blau gefüllt
   + Häkchen. Funktioniert für checkbox UND radio (Mode-Toggle nutzt radio
   mit demselben Look, weil Anton beide Modus-Optionen optisch wie die
   Scoring-Checkbox haben wollte). */
.tp-check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.92rem;
}
.tp-check input[type="checkbox"],
.tp-check input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.tp-check-box {
  width: 1.1rem;
  height: 1.1rem;
  flex: 0 0 auto;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  background: var(--card);
  display: inline-block;
  position: relative;
  transition: background 0.15s, border-color 0.15s;
}
.tp-check input[type="checkbox"]:checked + .tp-check-box,
.tp-check input[type="radio"]:checked + .tp-check-box {
  background: var(--blue);
  border-color: var(--blue);
}
.tp-check input[type="checkbox"]:checked + .tp-check-box::after,
.tp-check input[type="radio"]:checked + .tp-check-box::after {
  content: "";
  position: absolute;
  left: 0.32rem;
  top: 0.06rem;
  width: 0.3rem;
  height: 0.6rem;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.tp-check input[type="checkbox"]:focus-visible + .tp-check-box,
.tp-check input[type="radio"]:focus-visible + .tp-check-box {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.tp-check-label { color: var(--text); }
.tp-check-toggle {
  margin: 0 0 0.9rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.tp-view { display: block; }
.tp-view[hidden] { display: none; }

/* View Training (no scoring) */
.tp-time-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}
.tp-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.tp-field-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
}
.tp-field input {
  font: inherit;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
}
.tp-section-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.tp-section-hint {
  font-size: 0.78rem;
  margin: 0 0 0.5rem;
}
.tp-player-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.tp-player-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.55rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.tp-player-name {
  flex: 1;
  min-width: 0;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tp-player-remove {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  padding: 0 0.3rem;
  border-radius: 0.2rem;
}
.tp-player-remove:hover { color: var(--error, #c33); }
.tp-add-player {
  display: flex;
  gap: 0.4rem;
  align-items: stretch;
}
/* Plus-Button quadratisch (nicht über die volle Breite) */
#tp-player-add-btn {
  flex: 0 0 auto;
  width: 2.6rem;
  aspect-ratio: 1 / 1;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
}
.tp-add-player input {
  flex: 1;
  font: inherit;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
}

/* View Match (with scoring): Doppel-Checkbox nutzt jetzt .tp-check
   (theme-konsistent), keine eigene Styling-Klasse mehr noetig. */
.tp-team-block {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}
.tp-team-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
}
.tp-team-block input {
  font: inherit;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
}
.tp-team-block input[hidden] { display: none; }
.tp-vs {
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
  margin: 0.2rem 0 0.5rem;
}
/* Aktions-Buttons (Entfernen/Abbrechen/Starten) gleich groß, über die volle
   Breite des Dialogs (wie die Modus-Box) verteilt. */
.tp-dialog .dialog-actions { margin-top: 0.8rem; justify-content: stretch; gap: 0.5rem; }
.tp-dialog .dialog-actions .btn { flex: 1 1 0; width: auto; padding: 0.6rem 0.5rem; }

/* ===== Tournament konkurrenz overview (intermediate page) ===== */
.konkurrenz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.8rem;
  padding: 0 1.5rem;
}
.konkurrenz-grid-3col {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 760px) {
  .konkurrenz-grid-3col { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .konkurrenz-grid-3col { grid-template-columns: 1fr; }
}

/* Geschlechter-Spalten: Herren | Damen nebeneinander, jeweils mit eigenen
   gestapelten Konkurrenz-Kacheln. Auf Mobile: untereinander. */
.konkurrenz-gender-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 640px) {
  .konkurrenz-gender-cols { grid-template-columns: 1fr; }
  /* Mobile: Konkurrenz-Cards bündig mit Turnier-Titel + Glocke
     (nur das page-section-Padding bleibt — kein zusätzlicher Inset). */
  .konkurrenz-gender-col .section-title,
  .konkurrenz-gender-col .konkurrenz-grid,
  .konkurrenz-grid { padding: 0; }
}
.konkurrenz-gender-col .section-title { padding: 0 1.5rem; }
.konkurrenz-gender-col .konkurrenz-grid {
  grid-template-columns: 1fr;
}

.konkurrenz-card {
  display: block;
  padding: 1rem 1.1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
}

.konkurrenz-card:hover { border-color: var(--blue); }

.kc-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.kc-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.kc-progress {
  margin-top: 0.6rem;
  height: 4px;
  background: var(--bg);
  border-radius: 2px;
  overflow: hidden;
}

.kc-progress-bar {
  height: 100%;
  background: var(--blue);
  transition: width 0.3s ease;
}

/* Edit-dialog inputs (admin tournament bracket edit) */
.bedlg-schedule {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.bedlg-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.bedlg-row label {
  width: 5rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.bedlg-row input,
.bedlg-row select { flex: 1; min-width: 0; }

.bedlg-result {
  margin-top: 0.8rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
}

.bedlg-result label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.3rem;
}

/* Gear-Button in jeder Match-Box (Admin-Bracket-Edit). Sitzt rechts oben
   IN der Box, klein und unaufdringlich. */
.bm-editable .bm-edit-btn {
  position: absolute;
  top: 0.2rem;
  right: 0.3rem;
  width: 1.4rem;
  height: 1.4rem;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  z-index: 2;
  border-radius: 4px;
}

.bm-editable .bm-edit-btn:hover {
  background: var(--card-2, rgba(255,255,255,0.05));
  color: var(--text);
}

/* Bell-Button pro Matchbox (Public-Bracket): gleiche Ecke wie der Gear-
   Button, damit beide Sichten visuell konsistent sind. Wenn beide aktiv
   sind, sitzt der Bell links neben dem Gear. */
.bm-bell-wrap {
  position: absolute;
  top: 0.2rem;
  right: 0.3rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
}
.bm-bell-wrap .bell-btn {
  width: 1.4rem;
  height: 1.4rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 4px;
}
.bm-bell-wrap .bell-btn:hover {
  background: var(--card-2, rgba(255,255,255,0.05));
  color: var(--text);
}
.bm-bell-wrap .bell-btn.is-active { color: var(--blue); }

/* Sowohl Gear als auch Bell vorhanden -> Bell nach links versetzen. */
.bm-editable .bm-bell-wrap { right: 1.85rem; }

/* Damit der Gear-Button uebers Match-Card geheftet sitzt — Card muss
   position:relative haben (ist sie bereits). */

/* ===== Tournament KO bracket (Phase T2) ===== */
.tournament-page .tournament-header {
  padding: 1rem 1.5rem 0.4rem;
}

/* Konkurrenz-Seite (eine Ebene unter dem Turnier): eigenes Header-Layout
   damit der "← Inno Invest Cup"-Back-Btn nicht mit dem Konkurrenz-Namen
   überlappt. Back-Btn sitzt in eigener Zeile oben, dann Name + Actions
   als flex-row darunter. */
.tournament-konkurrenz-page .tournament-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
}
.tournament-konkurrenz-page .tournament-name {
  /* padding-right vom .tournament-page-Default überschreiben — die Actions
     sitzen jetzt inline NEBEN dem Namen, nicht mehr absolute drüber. */
  padding-right: 0;
}
.konkurrenz-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.konkurrenz-row .tournament-name {
  flex: 1 1 auto;
  min-width: 0;
}
.konkurrenz-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
@media (max-width: 640px) {
  /* Wie auf /tournament/<id>: mobile nur das Zahnrad anzeigen. */
  .tournament-konkurrenz-page .konkurrenz-actions .manage-btn-text { display: none; }
}

.tournament-page .empty-state {
  padding: 1.2rem 1.5rem;
}

/* Subtab-Nav (Bracket / Meldeliste auf Konkurrenz-Seite) */
.subtab-nav {
  display: flex;
  gap: 0.4rem;
  padding: 0.4rem 1.5rem 0;
  border-bottom: 1px solid var(--border);
}
.subtab {
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.subtab:hover { color: var(--text); }
.subtab.is-active {
  color: var(--text);
  border-bottom-color: var(--blue);
}

/* Entry-List (Meldeliste, public) */
.entry-list {
  list-style: decimal;
  padding-left: 1.6rem;
  margin: 0;
}
.entry-list-item {
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: baseline;
}
.entry-list-item:last-child { border-bottom: 0; }
.el-name { font-weight: 600; flex: 1 1 auto; min-width: 0; }
.el-lk {
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--bg);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-weight: 600;
  flex-shrink: 0;
}
.el-club { font-size: 0.82rem; color: var(--muted); }
.el-player-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: baseline;
  width: 100%;
}
/* Vereinsname zwingen auf eigene Zeile — sonst rendert er je nach Name-
   Länge mal auf der gleichen Zeile (kurzer Spieler-Name) und mal in der
   nächsten (langer Spieler-Name). Konsistent 2-zeilig liest sich besser
   und respektiert auch lange Vereinsnamen wie „Tennisklub Grün-Weiss
   Mannheim e.V.". */
.el-club { flex-basis: 100%; }
.el-partner-row {
  padding-left: 0.6rem;
  border-left: 2px solid var(--border);
  margin-top: 0.25rem;
}
.entry-list-item { flex-direction: column; align-items: flex-start; }

/* Auf Mobile reicht ein knapperer linker Inset — die decimal-Liste hat
   per Default 1.6rem padding-left, plus .page-section noch mal 1.5rem.
   Zusammen ~50px nur fuer Zähler+Rand. Wir senken die Liste auf 1.1rem. */
@media (max-width: 640px) {
  .entry-list { padding-left: 1.1rem; }
}

/* /live/<id> nutzt das alte court-page-CSS (court-fullscreen, court-chrome,
   vc-*-Controls). Hier nur die Hover-Animation aufs Score-Overlay drauf. */

/* Auf /live/<id> + /vod/<id>: Grid-Layout für die Score-Zeilen damit Sets
   beider Spieler PIXELGENAU übereinander stehen (auch bei unterschiedlich
   langen Namen). Spalten:
     [serve] [name 14rem] [set1] [set2] [set3] [match-pt rechts]
   Der ov-sets-Wrapper ist display:contents, damit die einzelnen .ov-set
   direkt in die Grid-Spalten 3-5 fallen. */
body.court-page .overlay-row,
body.vod-page   .overlay-row {
  display: grid;
  grid-template-columns:
    1.2rem                      /* serve-slot */
    14rem                       /* name */
    1.6rem 1.6rem 1.6rem        /* up to 3 sets, tight */
    1.8rem                      /* match-point (Game-Score 0/15/30/40/A) */
    1fr;                        /* filler, schiebt rechts auf */
  align-items: baseline;        /* Text-Baseline statt Box-Center */
  gap: 0.25rem;                 /* enger zusammen */
}
body.court-page .overlay-row .ov-set,
body.vod-page   .overlay-row .ov-set {
  font-size: 0.95rem;           /* identisch zu .ov-name → keine Höhen-Diff durch Ascent */
  line-height: 1;
}
body.court-page .overlay-row .ov-name,
body.vod-page   .overlay-row .ov-name {
  flex: none;
  width: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.court-page .overlay-row .ov-sets,
body.vod-page   .overlay-row .ov-sets {
  display: contents;            /* Sets-Children fallen direkt in die Grid-Spalten */
}
body.court-page .overlay-row .ov-set,
body.vod-page   .overlay-row .ov-set {
  text-align: center;
  min-width: 0;                 /* override base 1rem */
}
body.court-page .overlay-row .ov-wo-slot,
body.vod-page   .overlay-row .ov-wo-slot {
  text-align: center;
  margin-left: 0;               /* kein auto mehr — Grid setzt die Position */
}

/* Trainings-Overlay hat nur EIN Label ("Training · Titel") — NICHT das
   Score-Grid anwenden, sonst landet der Text in der 1.2rem-Serve-Spalte und
   wird zu "Tra" abgeschnitten. Als Flex rendern + Label voll ausschreiben. */
body.court-page .score-overlay-training .overlay-row,
body.vod-page   .score-overlay-training .overlay-row {
  display: flex;
}
body.court-page .score-overlay-training .ov-name,
body.vod-page   .score-overlay-training .ov-name {
  flex: 0 1 auto;
  width: auto;
  overflow: visible;
  text-overflow: clip;
}

/* Hover-Lift NUR auf /live/<id>: wird gekoppelt an die Auto-Hide-Logik der
   Chrome-Bar — solange .court-fullscreen die Klasse .is-chrome-visible hat
   (Maus war kürzlich aktiv) wird das Overlay nach oben geschoben, bündig
   bis direkt über die Bar. Sobald die Chrome verschwindet (3 s ohne
   Maus-Aktivität), fällt das Overlay zurück. */
body.court-page .score-overlay {
  transition: transform 0.25s ease;
  will-change: transform;
}
body.court-page .court-fullscreen.is-chrome-visible .score-overlay {
  /* Lift-Höhe wird zur Laufzeit aus der tatsächlichen Chrome-Bar-Höhe
     berechnet (JS setzt --chrome-bar-h auf .court-fullscreen). Fallback
     100 px falls JS aus ist. */
  transform: translateY(calc(-1 * var(--chrome-bar-h, 100px)));
}

/* CC-Toggle als .vc-btn-Variante in der Bottom-Bar. Off-State dimmt
   den Button (Browser-Standard für inaktive Captions-Buttons). */
.vc-btn.is-off { opacity: 0.45; }
.vc-btn-cc .vc-cc-icon {
  display: inline-block;
  padding: 0.05rem 0.3rem;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  font-size: 0.7rem;
  line-height: 1;
  font-weight: 700;
}

/* Die alte vod-page-Klasse wird nicht mehr benutzt (vod-mode ersetzt sie
   in der neuen Variante). Lassen wir die Regeln aber stehen — Browsers
   ignorieren sie still. Neue Layout-/Hover-Regeln auf body.vod-page
   greifen weiterhin für vod-mode wenn die Selektoren matchen. */

/* ═════ Player-Page (/spieler/<last>/<first>) ═════ */
.player-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 0.8rem 1.5rem 3rem;
}
.player-header {
  display: flex;
  gap: 1.2rem;
  align-items: center;
  padding: 1rem 0 1.5rem;
  position: relative;
}
.player-photo-wrap {
  flex-shrink: 0;
  width: 120px; height: 120px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--card);
  border: 2px solid var(--border);
  position: relative;   /* fuer den ✏-Hint-Overlay bei is_own_profile */
}
.player-photo {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.player-photo-placeholder svg { width: 100%; height: 100%; display: block; }

/* Photo-Spalte: Photo + Edit-Button gestapelt. Header bleibt flex-row,
   Photo+Edit als eigene Column links damit der Button DIREKT unter dem
   Photo sitzt statt rechts daneben. */
.player-photo-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
/* Edit-Button auf dem eigenen Profil — sitzt unterhalb des Photos.
   Nur Text-Label „bearbeiten", kein Icon. Visuell dezent (Outline-
   Button-Look passend zum Theme). */
.player-edit-btn {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
}
.player-edit-btn:hover { color: var(--blue); border-color: var(--blue); }

.player-name {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  /* Niemals 2-zeilig — analog .site-title / .tournament-name. Auto-Fit-JS
     aus base.html greift jetzt auch hier, overflow:hidden + nowrap
     dient als Fallback wenn das JS aus irgendeinem Grund nicht laeuft. */
  white-space: nowrap;
  overflow: hidden;
}
/* Bell sitzt rechts neben dem Namen in der gleichen Zeile. */
.player-header-bell { flex-shrink: 0; display: inline-flex; align-items: center; }
/* Heart + Bell gruppiert rechts vom Namen — beide Buttons direkt nebeneinander. */
.player-header-actions {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.player-manage-btn { white-space: nowrap; }
/* Mobil: nur das ⚙-Icon, „Verwalten"-Text raus (spart Platz). */
@media (max-width: 560px) {
  .player-manage-btn .player-manage-label { display: none; }
}
.player-nickname-line {
  margin: -0.2rem 0 0.7rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.player-nickname-line strong { color: var(--text); }

/* Inline-Profilverwaltung (Foto/Notizen/Spitzname) */
.player-manage-form {
  margin: 0.4rem 0 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 10px);
  background: var(--card);
}
.player-manage-form .pm-title {
  font-size: 1rem; font-weight: 700; margin: 0 0 0.8rem;
}
.pm-field { display: block; margin-bottom: 0.9rem; }
.pm-label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.3rem; }
.pm-field input[type="text"],
.pm-field textarea {
  width: 100%; box-sizing: border-box;
  padding: 0.5rem 0.6rem; font-size: 0.95rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm, 6px);
  background: var(--bg, var(--card)); color: var(--text);
}
.pm-field textarea { resize: vertical; }
.pm-check { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; margin-bottom: 0.9rem; }
.pm-actions { display: flex; gap: 0.6rem; justify-content: flex-end; margin-top: 0.4rem; }
.pm-error {
  margin: 0.4rem 0; padding: 0.55rem 0.7rem;
  border: 1px solid #d9534f; border-left: 3px solid #d9534f;
  border-radius: var(--radius-sm, 6px); background: rgba(217,83,79,0.10);
  font-size: 0.88rem; color: #d9534f;
}
/* Legacy: .player-head-info war frueher der Container fuer Name +
   Quick-Meta-Pills. Mit der jetzigen Struktur (Name + Bell direkt im
   .player-header) brauchen wir den Wrapper nicht mehr — falls aber irgendwo
   noch verwendet, soll er nicht das Layout brechen. */
.player-head-info { flex: 1; min-width: 0; }
.player-quick-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.player-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--muted);
}

.player-data {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.4rem 1rem;
  margin: 0;
}
.player-data dt {
  font-size: 0.82rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.player-data dd {
  margin: 0;
  font-weight: 600;
}

.player-teams { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.4rem; }
.player-team-link {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  padding: 0.55rem 0.8rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
}
.player-team-link:hover { border-color: var(--blue); }
.player-team-league { color: var(--muted); font-size: 0.82rem; font-weight: 700; }
.player-team-name   { font-weight: 700; }

.player-stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
}
.player-stat-box {
  padding: 0.8rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}
.player-stat-label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.player-stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.player-match-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.player-match {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "meta badge"
    "body result";
  gap: 0.4rem 0.8rem;
  align-items: center;
}
.player-match.is-win  { border-left-color: #2ea043; }
.player-match.is-loss { border-left-color: #c84a4a; }
.pm-meta {
  grid-area: meta;
  display: flex; gap: 0.6rem; align-items: baseline;
  font-size: 0.78rem; color: var(--muted);
  flex-wrap: wrap;
}
.pm-pos { font-weight: 800; color: var(--text); font-size: 0.85rem; }
.pm-team { color: var(--text); text-decoration: none; }
.pm-team:hover { color: var(--blue); }
.pm-side {
  grid-area: badge;
  justify-self: end;
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.pm-side.is-home { background: rgba(46,160,67,0.18); color: #2ea043; }
.pm-side.is-away { background: rgba(216,148,52,0.18); color: #d4a534; }
.pm-body {
  grid-area: body;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.pm-side-block { font-weight: 600; }
.pm-vs { color: var(--muted); font-size: 0.85rem; }
.pm-result {
  grid-area: result;
  justify-self: end;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.pm-set { margin-left: 0.2rem; }

.player-notes {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  white-space: pre-wrap;
}

@media (max-width: 540px) {
  .player-stat-row { grid-template-columns: 1fr; }
  .player-photo-wrap { width: 90px; height: 90px; }
  .player-name { font-size: 1.2rem; }
  .pm-body { grid-template-columns: 1fr; }
  .pm-result { text-align: left; }
}

/* ═════ VOD-Page ═════ */
.vod-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem 3rem;
}
.vod-header { margin-bottom: 1rem; }
.vod-title { font-size: 1.5rem; font-weight: 800; margin: .4rem 0 .2rem; }
.vod-meta  { color: var(--muted); font-size: 0.88rem; }
.vod-player-wrap {
  position: relative;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 1rem;
}
/* Score-Overlay über dem VOD-Player — identische Optik zum /live/<id>.
   Sitzt etwas höher als bottom:0, damit die HTML5-Native-Controls
   (~40 px) drunter frei bleiben. */
.vod-score-overlay {
  position: absolute;
  left: 0; right: 0;
  bottom: 2.6rem;
  pointer-events: none;
  z-index: 2;
}
.vod-score-overlay:empty { display: none; }

/* Custom Fullscreen-Button (verstreckt rechts unten an der Stelle vom
   nativen FS-Button — den wir per controlslist=nofullscreen aus dem
   Native-Controls-Layout entfernt haben). */
.vod-fs-btn {
  position: absolute;
  right: 0.6rem;
  bottom: 0.4rem;
  z-index: 3;
  width: 34px; height: 34px;
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.05rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
  pointer-events: auto;
}
.vod-fs-btn:hover { color: #fff; }

/* Im Fullscreen-Modus füllt die wrap den ganzen Screen — und unser
   Overlay + CC-Button sitzen damit AUF dem Vollbild, nicht außerhalb. */
.vod-player-wrap:fullscreen,
.vod-player-wrap:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
}
.vod-player-wrap:fullscreen .vod-player,
.vod-player-wrap:-webkit-full-screen .vod-player {
  width: 100%;
  height: 100%;
  max-height: 100vh;
  object-fit: contain;
}

/* Score-CC-Toggle: kleiner Button oben-rechts überm Player. Persistiert
   Sichtbarkeit des Score-Overlays in localStorage. */
.vod-cc-toggle {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 6px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.5px;
  backdrop-filter: blur(6px);
}
.vod-cc-toggle:hover { background: rgba(0, 0, 0, 0.85); }
.vod-cc-icon {
  display: inline-block;
  padding: 0.05rem 0.32rem;
  border: 1.5px solid #fff;
  border-radius: 3px;
  font-size: 0.7rem;
  line-height: 1;
}
.vod-cc-state {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
}
.vod-cc-toggle.is-off { opacity: 0.55; }
.vod-cc-toggle.is-off .vod-cc-icon { border-color: rgba(255,255,255,0.5); }
.vod-player {
  width: 100%;
  display: block;
  max-height: 80vh;
}
.vod-section { margin-top: 1.4rem; }
.vod-player-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.vod-player-list li {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-size: 0.92rem;
}
.vod-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}
.vod-status {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  margin-top: 1rem;
}
.vod-status-error { border-color: #c84a4a; }
.vod-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: vod-spin 1s linear infinite;
  flex-shrink: 0;
}
@keyframes vod-spin { to { transform: rotate(360deg); } }

.vod-list {
  display: grid;
  gap: 0.6rem;
}
.vod-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  color: var(--text);
  text-decoration: none;
}
.vod-card:hover { border-color: var(--blue); }
.vod-card-title { font-weight: 700; font-size: 1.05rem; }
.vod-card-meta {
  font-size: 0.83rem; color: var(--muted); margin-top: 0.2rem;
}
.vod-card-status { margin-top: 0.4rem; }
.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
}
.badge-ok { background: rgba(46,160,67,0.15); color: #2ea043; border-color: #2ea043; }
.badge-error { background: rgba(200,74,74,0.15); color: #c84a4a; border-color: #c84a4a; }

/* VOD-Liste auf /admin/vods — Card-Layout (mobile + desktop).
   Layout pro Card: links Hauptinhalt (Datum, Match-Name, Meta-Zeile),
   rechts vertikal gestapelt das verfügbar-Badge oben und das Trash-
   Icon darunter. Lange Match-Namen werden mit ellipsis abgeschnitten,
   damit die Card-Höhe konstant bleibt. */
.vod-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.vod-card {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;            /* Anker für den Stretched-Link (ganze Kachel klickbar) */
}
.vod-card.is-hidden { opacity: 0.55; }
/* Ganze Kachel klickbar: der Titel-Link spannt ein unsichtbares Overlay über
   die komplette Karte. Innere Links (Begegnung/Turnier) + der Lösch-Button
   liegen per z-index darüber und bleiben einzeln klickbar. */
.vod-card-title::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
}
.vod-card-meta a,
.vod-card-right { position: relative; z-index: 1; }
.vod-card:hover { cursor: pointer; }
.vod-card-main {
  flex: 1;
  min-width: 0; /* erlaubt text-overflow im Kind */
}
.vod-card-date {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.1rem;
}
.vod-card-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.25rem;
}
.vod-card-meta {
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
}
.vod-card-meta > span + span::before {
  content: "·";
  color: var(--muted);
  margin-right: 0.3rem;
}
.vod-card-meta a { color: inherit; }
.vod-card-hidden-tag {
  color: var(--error, #c33);
  font-weight: 500;
}
.vod-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.4rem;
  flex-shrink: 0;
}
.vod-trash-form { margin: 0; padding: 0; }
.vod-trash-btn {
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  color: var(--muted);
  padding: 0.3rem 0.4rem;
  border-radius: 0.3rem;
  line-height: 0;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.vod-trash-btn:hover,
.vod-trash-btn:focus-visible {
  color: var(--error, #c33);
  border-color: var(--border);
  background: rgba(0,0,0,0.03);
  outline: none;
}

/* Mode-Toggle (Einzel / Doppel) — pill-style segmented control,
   liegt rechts neben dem Konkurrenz-Namen im Import-Block. */
.mode-name-row {
  display: flex;
  gap: 0.6rem;
  align-items: stretch;
  flex-wrap: wrap;
}
.mode-pills {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
}
.mode-pill {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.mode-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.mode-pill span {
  display: inline-block;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  border-right: 1px solid var(--border);
}
.mode-pill:last-child span { border-right: 0; }
.mode-pill input:checked + span {
  background: var(--blue);
  color: #fff;
}

/* Admin: zwei Boxen pro Konkurrenz (Bracket + Meldeliste) */
.konkurrenz-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.6rem;
}
@media (max-width: 720px) {
  .konkurrenz-edit-grid { grid-template-columns: 1fr; }
}
.konkurrenz-edit-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem;
}
.konkurrenz-edit-box .roster-paste { width: 100%; box-sizing: border-box; }

.tournament-name {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0;
  /* Niemals 2-zeilig — bei langen Turniernamen reduziert das JS in
     base.html die font-size schrittweise (analog .site-title). overflow:
     hidden + nowrap dient als Fallback wenn das JS aus irgendeinem
     Grund nicht greift. */
  white-space: nowrap;
  overflow: hidden;
  min-width: 0;
}

.tournament-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.tournament-konkurrenz-section {
  padding: 0.8rem 0 1.2rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.tk-section-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  padding: 0 1rem 0.4rem;
}

/* Bracket horizontal scroll wrapper */
.bracket-wrap {
  overflow-x: auto;
  padding: 0.5rem 1rem 1rem;
  -webkit-overflow-scrolling: touch;
  --bracket-gap: 8rem;
  /* Stub-Anteil: wie viel des Round-Gaps der waagerechte Strich vom Match
     nimmt (Rest = kurzer Strich zum naechsten Match). Lang genug, damit
     "DD.MM. HH:MM" in einer Zeile passt. */
  --bracket-stub: 0.78;
}

.bracket {
  display: flex;
  gap: var(--bracket-gap);
  align-items: stretch;
  min-height: 360px;
}

.bracket-round {
  display: flex;
  flex-direction: column;
  min-width: 220px;
  flex-shrink: 0;
  position: relative;   /* Anker für das absolut platzierte „Spiel um Platz 3" */
}

.bracket-round-label {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding-bottom: 0.4rem;
  margin-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

/* Round body distributes its pairs evenly */
.bracket-round-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 0.5rem;
}

/* Pair wraps 2 sibling matches whose winner advances to the same next-round
   slot. justify-content: space-around centers each match in its half, so the
   midpoints sit roughly at 25 % / 75 % of the pair height — vertical connector
   spans from one midpoint to the other. Small gap adds breathing room between
   the sibling matches; the connector endpoints shift a few px but stay
   visually centered. */
.bracket-pair {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  flex: 1;
  position: relative;
  gap: 0.4rem;
}

.bracket-pair-single {
  flex: 0 0 auto;
  justify-content: center;
}

/* Each match card */
.bracket-match {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem 0.6rem;
}
/* Wenn ein Edit-Gear oder Bell-Icon im Top-Right sitzt, Match-Box rechts
   etwas freiräumen, damit die Sets-Spalte nicht unter dem Icon landet. */
.bracket-match.bm-editable { padding-right: 2rem; }

/* Spiel um den 3. Platz — UNTER dem Finale in der Finalspalte. Absolut
   positioniert (aus dem Flex-Fluss), damit es den Round-Body NICHT staucht →
   das Finale bleibt exakt da, wo es ohne Platz-3-Spiel wäre (mittig auf der
   Verbindungslinie der Halbfinals). Die Box hängt am unteren Spaltenrand. */
.bracket-round { position: relative; }
/* Platz-3-Box knapp UNTER dem (spaltenmittigen) Finale — fester Abstand zur
   Spaltenmitte statt am Spaltenboden. So bleibt der Abstand bei JEDER Bracket-
   Größe gleich (kein Auseinanderdriften bei großen Feldern). */
.bracket-third-place {
  position: absolute;
  top: calc(50% + 6rem); left: 0; right: 0;
}
/* Mindesthöhe, damit beim kleinsten Bracket (4er) unter dem Finale Platz für
   die Box bleibt. Finale + Semis-Mittelpunkt bleiben spaltenmittig → Connector
   stimmt. */
.bracket-round:has(.bracket-third-place) { min-height: 34rem; }
.bracket-match.bm-third-place { border-style: dashed; }
.bm-third-place-label {
  font-size: 0.6rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--muted); margin-bottom: 0.2rem;
}

/* ── Connector lines (only between rounds, gated by .has-next-round) ── */

/* Horizontal stub right of each match (lang, traegt das Meta-Label) */
.bracket-round.has-next-round .bracket-match::after {
  content: "";
  position: absolute;
  right: calc(-1 * var(--bracket-gap) * var(--bracket-stub));
  top: 50%;
  width: calc(var(--bracket-gap) * var(--bracket-stub));
  height: 1px;
  background: var(--border);
}

/* Vertical line connecting the two sibling stubs inside a pair.
   space-around + gap verschiebt die Match-Mittelpunkte um gap/4 nach innen,
   deshalb wird der gleiche Offset hier abgezogen — sonst stehen die End-
   punkte der Vertikalen ueber bzw. unter den Stub-Linien. */
.bracket-round.has-next-round .bracket-pair:not(.bracket-pair-single)::after {
  content: "";
  position: absolute;
  right: calc(-1 * var(--bracket-gap) * var(--bracket-stub));
  top: calc(25% - 0.1rem);
  bottom: calc(25% - 0.1rem);
  width: 1px;
  background: var(--border);
}

/* Kurzer Strich von der Vertikalen zum naechsten Match */
.bracket-round.has-next-round .bracket-pair:not(.bracket-pair-single)::before {
  content: "";
  position: absolute;
  right: calc(-1 * var(--bracket-gap));
  top: 50%;
  width: calc(var(--bracket-gap) * (1 - var(--bracket-stub)));
  height: 1px;
  background: var(--border);
}

/* Meta label sitzt ueber dem Stub — gleiche Breite wie der Strich. */
.bracket-round.has-next-round .bm-line-meta {
  position: absolute;
  bottom: 50%;
  right: calc(-1 * var(--bracket-gap) * var(--bracket-stub));
  width: calc(var(--bracket-gap) * var(--bracket-stub));
  font-size: 0.65rem;
  line-height: 1.15;
  color: var(--muted);
  text-align: center;
  pointer-events: none;
  padding: 0 6px 2px;
  z-index: 1;
}

.bm-line-time {
  display: block;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.bm-line-court { display: block; font-weight: 500; white-space: nowrap; }

.bracket-match.bm-done { opacity: 0.92; }

.bm-player {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.25rem 0;
  font-size: 0.85rem;
}

.bm-player + .bm-player {
  border-top: 1px solid var(--border);
}

.bm-player-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.5rem;
  /* Volle Breite erzwingen, damit die Sets-Spalte (auto) immer am rechten
     Box-Rand sitzt. Nötig weil die Mobile-Media-Query .bm-player auf
     align-items:flex-start setzt → ohne width:100% würde die Row auf
     Content-Breite schrumpfen und die Scores klebten am Namen. */
  width: 100%;
}

.bm-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bm-name-meta {
  font-weight: 400;
  color: var(--muted);
}

/* Doppel: zwei Spieler + LK-Meta + Slash sind zu lang fuer eine Zeile,
   deshalb Umbruch erlauben. */
.bm-player.bm-doppel .bm-name {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.35;
}

.bm-player-club {
  font-size: 0.75rem;
  color: var(--muted);
  padding-left: 0.05rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bm-tbd { color: var(--muted); font-style: italic; }
.bm-bye { color: var(--muted); font-style: italic; }

.bm-seed {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 0.05rem 0.3rem;
  border-radius: 6px;
  margin-right: 0.3rem;
  vertical-align: middle;
}

.bm-sets {
  display: flex;
  gap: 0.3rem;
  flex-shrink: 0;
}

.bm-set {
  display: inline-block;
  min-width: 1.05rem;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--muted);
}

.bm-set.bm-set-win { color: var(--text); }

.bm-meta {
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 0.3rem;
  padding-top: 0.25rem;
  border-top: 1px dashed var(--border);
  text-align: right;
}

.bm-live-tag {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 0.05rem 0.35rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.bracket-match.bm-live {
  border-color: var(--blue);
  background: rgba(31, 111, 235, 0.06);
}

.bm-actions {
  margin-top: 0.4rem;
  text-align: right;
}

.btn-start-tournament {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 12px;
  border: 1px solid var(--green-lt);
  background: transparent;
  color: var(--green-lt);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.btn-start-tournament:hover {
  background: var(--green-lt);
  color: #fff;
}

/* Mobile: breitere Matches damit Namen nicht abgeschnitten werden.
   Horizontal-Scroll durch .bracket-wrap bleibt erhalten. */
@media (max-width: 640px) {
  .bracket-wrap { --bracket-gap: 6rem; }
  .bracket { min-height: 300px; }
  .bracket-round { min-width: 200px; }

  .bm-line-meta { font-size: 0.6rem; padding: 0 4px 2px; }

  .bm-player {
    align-items: flex-start;
    font-size: 0.82rem;
    gap: 0.5rem;
  }
  .bm-name {
    font-size: 0.82rem;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
    line-height: 1.3;
  }
  .bm-sets { padding-top: 0.1rem; }
  .bm-set { font-size: 0.88rem; min-width: 1rem; }

  /* Turnier-Header: Back-Button aus absolutem Layout holen, damit er
     nicht den Titel überlappt. Titel nimmt Mobile-angepasste Größe. */
  .tournament-page .tournament-header { padding: 0.8rem 1.5rem 0.4rem; }
  .tournament-page .back-btn {
    position: static;
    display: inline-block;
    margin-bottom: 0.5rem;
  }
  .tournament-page .tournament-name { font-size: 1.2rem; line-height: 1.25; }
  .tournament-page .tournament-meta { font-size: 0.75rem; }
}

/* Mini-Phones (<400px): wieder etwas schmaler, damit 2 Matches nicht
   direkt komplett vom Screen verschwinden */
@media (max-width: 400px) {
  .bracket-round { min-width: 210px; }
}

/* ===== Schedule view (court tiles in a responsive grid) ===== */
/* Kein zusätzliches Padding — Grid sitzt direkt am page-section-Inset
   (1.5rem), damit der Header („Heute · …" + Verwalten-Button) auf der
   gleichen x-Achse beginnt wie die Court-Kacheln. */
.sched-court-grid {
  display: grid;
  grid-template-columns: repeat(var(--court-cols, 6), minmax(0, 1fr));  /* 4/5/6 je nach Platzanzahl */
  gap: 0.6rem;
}
/* Mobil kommt später — bis dahin auf schmaleren Screens weniger Spalten,
   damit die schlanken 6er-Kacheln nicht unleserlich werden. */
@media (max-width: 1200px) { .sched-court-grid { grid-template-columns: repeat(4, minmax(0,1fr)); } }
@media (max-width: 820px)  { .sched-court-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 560px)  { .sched-court-grid { grid-template-columns: 1fr; } }   /* Handy: 1 Spalte */

.sched-court-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sched-court-head {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.sched-court-name {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.3px;
}

.sched-court-matches {
  display: flex;
  flex-direction: column;
}

/* Each match row inside a court tile */
.sched-tile-match {
  display: block;
  padding: 0.4rem 0.55rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}

.sched-court-empty {
  padding: 0.8rem 0.6rem;   /* gleicher linker Einzug wie der Court-Name (0.6rem) */
  text-align: left;
  font-size: 0.78rem;
}

/* Text-Umschalter Spiele ⇄ Belegung — kein Kasten, aktive Seite hervorgehoben */
.plan-switch { display: inline-flex; align-items: center; gap: 0.9rem; }
.plan-switch-sep { color: var(--muted); opacity: 0.5; }
.plan-switch-link {
  font-size: 1.02rem; font-weight: 700; color: var(--muted);
  padding: 0.15rem 0.1rem; border-bottom: 2px solid transparent;
  transition: color .12s, border-color .12s;
}
.plan-switch-link:hover { color: var(--text); }
.plan-switch-link.is-active { color: var(--text); border-bottom-color: var(--green-lt); }

/* Mannschaftsspiel-Blöcke aus dem Buchungssystem (Add-on) — als Block-Kachel
   in der Schedule, vor Eintragen der Aufstellung. */
.sched-bmatch {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.55rem; border-left: 4px solid var(--green-lt);
  border-bottom: 1px solid var(--border);
}
.sched-bmatch-time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.78rem; white-space: nowrap; }
.sched-bmatch-label { font-weight: 750; }
.sched-bmatch-tag { margin-left: auto; font-size: 0.6rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--muted); border: 1px solid var(--border); border-radius: 5px; padding: 0.1rem 0.35rem; }

/* Belegungen aus dem Buchungssystem — schlichte Zeilen unter den Matches,
   Farbcode identisch zum Buchungs-Raster (Training blau, Sperrung rot,
   Buchung slate). Bewusst dezent: /schedule bleibt match-fokussiert. */
.sched-bel-list { border-top: 1px dashed var(--border); }
.sched-bel {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.32rem 0.55rem;
  font-size: 0.76rem;
  border-left: 3px solid transparent;
}
.sched-bel-time { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.sched-bel-label { font-weight: 650; }
.sched-bel-booking  { border-left-color: #8aa0b0; }
.sched-bel-training { border-left-color: #6bb0f5; }
.sched-bel-booking  .sched-bel-label { color: #7d909e; }
.sched-bel-training .sched-bel-label { color: #4a90d9; }
.sched-bel-block    { border-left-color: #ff7a63; }
.sched-bel-block    .sched-bel-label { color: #d1503b; }
.sched-tile-match:last-child { border-bottom: none; }
.sched-tile-match:hover { background: var(--bg); }
.sched-tile-match.sched-tile-match-live { background: rgba(31, 111, 235, 0.06); }
.sched-tile-match.sched-tile-match-done { opacity: 0.72; }

.sched-tile-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
  flex-wrap: wrap;
}

.sched-tile-time {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text);
}

.sched-tile-pos {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--muted);
  background: var(--bg);
  padding: 0.1rem 0.35rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.sched-tile-team {
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 500;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sched-tile-status {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.1rem 0.35rem;
  border-radius: 8px;
  margin-left: auto;
}

.sched-tile-status-live { background: var(--blue);   color: #fff; }
.sched-tile-status-done { background: var(--green);  color: #fff; }
.sched-tile-status-open {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.sched-tile-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.15rem 0;
  font-size: 0.8rem;
}

.sched-tile-row-open { padding: 0.3rem 0 0.1rem; font-size: 0.78rem; }

.sched-tile-pname {
  flex: 1;
  min-width: 0;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Drag-&-Drop-Schedule-Planer (/admin) ─────────────────────────────── */
.plan-hint { margin: 0.2rem 0 0.8rem; }

/* Verschiebbare Match-Kacheln (greifbar). Erben den sched-tile-Look. */
.plan-tile { cursor: grab; }
.plan-tile:active { cursor: grabbing; }
.plan-tile[draggable="false"] {
  cursor: default;
  opacity: 0.6;            /* fertige Matches sind fixiert */
}
.plan-tile.plan-dragging { opacity: 0.4; }

/* Drop-Zonen: mind. greifbare Höhe, auch wenn leer. */
/* Erfolgs-/Fehler-Toast des Schedule-Planers (unten mittig). */
.plan-toast {
  position: fixed; left: 50%; bottom: 24px;
  transform: translate(-50%, 140%);
  z-index: 2000; display: flex; align-items: center; gap: 0.6rem;
  padding: 0.7rem 1.1rem; max-width: calc(100vw - 32px);
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  font-size: 0.92rem; font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.plan-toast.is-visible { transform: translate(-50%, 0); opacity: 1; }
.plan-toast-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.35rem; height: 1.35rem; border-radius: 50%;
  background: var(--green); color: #fff; font-size: 0.8rem; font-weight: 700;
  flex-shrink: 0;
}
.plan-toast.is-error { border-color: var(--red); }
.plan-toast.is-error .plan-toast-icon { background: var(--red); }

.plan-dropzone { min-height: 2.6rem; }
/* Matches-Bereich füllt die Court-Kachel, damit auch der Leerraum unter den
   Matches (und der Kopf) als Drop-Ziel funktioniert. */
.sched-court-tile.plan-dropzone .sched-court-matches { flex: 1; min-height: 2rem; }
.plan-dropzone.drag-over {
  outline: 2px dashed var(--blue);
  outline-offset: -2px;
  background: rgba(31, 111, 235, 0.08);
}

/* Hallenplätze im Planer leicht abgesetzt (Regen-Verlegungsziel). */
.plan-court-hall .sched-court-head { background: rgba(31, 111, 235, 0.06); }

/* „Nicht zugewiesen": gleiches 6er-Raster wie das Court-Grid. */
.plan-unassigned {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.6rem;
  align-content: start;
}
.plan-unassigned .plan-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
@media (max-width: 1200px) { .plan-unassigned { grid-template-columns: repeat(4, minmax(0,1fr)); } }
@media (max-width: 820px)  { .plan-unassigned { grid-template-columns: repeat(2, minmax(0,1fr)); } }

.sched-tile-sets {
  display: flex;
  gap: 0.3rem;
  align-items: center;
}

.sched-tile-set {
  display: inline-block;
  min-width: 1.05rem;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--muted);
}

.sched-tile-set.sched-tile-set-win { color: var(--text); }
.sched-tile-set.sched-tile-set-cur { color: var(--blue); }
/* MTB-Punkte landen in /schedule + /begegnung als letzte Set-Zelle
   (kein separater Slot mehr, Anton 2026-05-18). Gelb signalisiert
   „laufender Tiebreak" — gleicher Anker-Effekt wie auf /live. */
.sched-tile-set.sched-tile-set-mtb { color: var(--yellow); }

.sched-unscheduled {
  margin-top: 1.5rem;
  padding: 0 1rem;
}

.sched-unscheduled-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.4rem;
}

.schedule-page .empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--muted);
}

/* ===== Scoring tab list ===== */
.scoring-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 0 1rem;
}

.scoring-tap-card {
  display: block;
  padding: 0.9rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}

.scoring-tap-card:hover { border-color: var(--blue); }
.scoring-tap-card:active { filter: brightness(0.92); }

.scoring-tap-card .sc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.scoring-tap-card .sc-name {
  font-size: 1rem;
  font-weight: 800;
}

.scoring-tap-card .sc-badge.tb {
  background: var(--yellow);
  color: #000;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.scoring-tap-card .sc-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.scoring-tap-card .sc-player {
  flex: 1;
  min-width: 0;
}

.scoring-tap-card .sc-sets {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.scoring-tap-card .sc-set {
  display: inline-block;
  min-width: 1.2rem;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--muted);
}

.scoring-tap-card .sc-set.sc-set-win { color: var(--text); }
.scoring-tap-card .sc-set.sc-set-cur { color: var(--blue); }

.scoring-tap-card .sc-team-label {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.5rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--border);
}

.scoring-list-page .empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--muted);
}

/* ===== Court scoring page (mobile-first) ===== */
.scoring-page .court-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem 0.4rem;
}

.court-page-head-links {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

/* Override the global absolutely-positioned .back-btn so both links flow
   side-by-side inside .court-page-head-links on the scoring page. */
.scoring-page .court-page-head-links .back-btn {
  position: static;
  top: auto;
  left: auto;
}

.back-btn.back-btn-alt {
  background: transparent;
  font-size: 0.78rem;
  padding: 0.35rem 0.75rem;
}

.court-page-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0;
}

.scoring-page .empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}

.empty-state-icon {
  /* Empty-State-Icons waren farbige Emojis (🎾, 📅, 📊, 🗓 …). Im neuen
     Design rein textlich — der Empty-State-Text ist sprechend genug. */
  display: none;
  font-size: 3rem;
  opacity: 0.4;
  margin-bottom: 0.5rem;
}

/* Score box (mobile-prominent) */
.score-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  margin: 0 1rem 1rem;
}

.score-box.match-over { border-color: var(--green); }

/* Match-Vorschau (noch nicht gestartet): Paarung mit „vs" statt Score. */
.score-box-preview { border-style: dashed; }
.score-box-preview .mp-vs {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.15rem 0;
}
.mp-sched {
  text-align: center;
  margin: -0.4rem 1rem 1rem;
  font-size: 0.85rem;
}

.score-box .score-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.score-box .sd-name {
  flex: 1;
  min-width: 0;
  font-weight: 700;
}

.score-box .sd-sets {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.score-box .sd-set {
  display: inline-block;
  min-width: 1.2rem;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--muted);
}

.score-box .sd-set.sd-win { color: var(--text); }
.score-box .sd-set.sd-cur { color: var(--blue); }

.score-box .sd-set.sd-tb {
  color: var(--yellow);
  font-size: 0.95rem;
  font-weight: 700;
  margin-left: 0.1rem;
}

.score-box .sd-pts {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--yellow);
  min-width: 3rem;
  text-align: right;
}

/* sd-wo-slot innerhalb der score-box uebernimmt jetzt die Rolle, die
   frueher sd-pts hatte (Live-Pts/MTB-Pts + W.O.-Badge + Decider).
   Gleiche Schriftgroesse/-gewicht wie sd-pts; min-width bewusst klein
   (1.5rem) damit „30" / „[8]" / „6" eng an der Sets-Reihe steht —
   Anton 2026-05-18: Sets sollen nah an Punkten kleben. W.O.-Badge
   waechst den Slot bei Bedarf ueber min-width hinaus. */
.score-box .sd-wo-slot {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--yellow);
  min-width: 1.5rem;
  text-align: right;
  margin-left: 0;
}

.score-box .sd-meta {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.4rem;
  text-align: center;
}

.score-box .winner-display {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--green);
  text-align: center;
  padding: 0.5rem 0;
}

/* Big +1 buttons — primary scoring action */
.big-points {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin: 0 1rem 1rem;
}

/* Direct-Result-Eintrag fuer laufende Matches auf /admin/court — sitzt
   zwischen Score-Box und Big-Points-Buttons. Textfeld nimmt fast die
   ganze Breite, rechts ein kleiner Haken-Button zum Bestaetigen. Margins
   sind buendig zur Score-Box und zu den Big-Points-Buttons (gleicher
   x-Achsen-Inset). */
.direct-result-form {
  display: flex;
  gap: 0.4rem;
  margin: 0 1rem 0.8rem;
  align-items: stretch;
}
.direct-result-input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.7rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.85rem;
}
.direct-result-input::placeholder { color: var(--muted); font-size: 0.8rem; }
.direct-result-submit {
  flex-shrink: 0;
  width: 2.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
}
.direct-result-submit:hover { filter: brightness(1.1); }
@media (max-width: 640px) {
  /* Bündig zur Score-Box / Big-Points die auf Mobile 0.6rem-Margin haben */
  .direct-result-form { margin: 0 0.6rem 0.8rem; }
}

.bp-col {
  margin: 0;
  display: flex;
}

.bp-btn {
  width: 100%;
  min-height: 130px;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-family: inherit;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 1rem;
  /* No transition: must be instant for fast scoring */
}

.bp-btn:active,
.bp-btn.is-pending { filter: brightness(0.85); }
.bp-btn-p1 { background: var(--green-lt); }
.bp-btn-p2 { background: var(--blue); }

.bp-plus {
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1;
}

.bp-name {
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  word-break: break-word;
}

/* Smaller "+1 Punkt" secondary buttons below the big game buttons */
.small-points {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin: 0 1rem 1rem;
}

.sp-col { margin: 0; display: flex; }

.sp-btn {
  width: 100%;
  height: 48px;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

.sp-btn:active,
.sp-btn.is-pending { filter: brightness(0.85); }

.sp-btn-p1 {
  border-color: var(--green-lt);
  color: var(--green-lt);
}
.sp-btn-p1:hover { background: rgba(46, 160, 67, 0.12); }

.sp-btn-p2 {
  border-color: var(--blue);
  color: var(--blue);
}
.sp-btn-p2:hover { background: rgba(31, 111, 235, 0.12); }

/* Secondary actions area */
.scoring-secondary {
  margin: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.serve-block {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  padding: 0.5rem 0.7rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.sb-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-right: 0.3rem;
}

/* Game-fix collapsible (rare action) */
.game-fix {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
}

.game-fix > summary {
  padding: 0.6rem 0.8rem;
  font-size: 0.8rem;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.game-fix > summary::before {
  content: "▸ ";
  display: inline-block;
  margin-right: 0.3rem;
  transition: transform 0.15s;
}

.game-fix[open] > summary::before { content: "▾ "; }

.game-fix-rows {
  padding: 0 0.8rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.game-fix-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  gap: 0.6rem;
}

.game-fix-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.game-fix-row .inc-btn {
  width: auto;
  min-width: 4.5rem;
  height: 32px;
  border-radius: var(--radius);
  font-size: 0.78rem;
  padding: 0 0.7rem;
}

.undo-set-form { margin: 0; }
.undo-set-form .btn-undo {
  width: auto;
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  padding: 0.5rem 0.9rem;
}

/* Undo-Wrapper sitzt zwischen Punkt-Buttons (darueber) und Aufschlag-Block
   (darunter). Anton: gleiche, kleine Abstaende oben+unten, damit's nicht
   aufeinander klebt aber auch nicht riesige Luecken laesst. */
.scoring-secondary-undo-only {
  margin-top: 0.6rem;
  margin-bottom: 0.6rem;
}
.scoring-secondary-undo-only .undo-set-form {
  display: flex;
}
.scoring-secondary-undo-only .undo-set-form .btn-undo {
  width: 100%;
  justify-content: center;
  padding: 0.7rem 0.9rem;
  font-size: 0.9rem;
}

/* Setup section (collapsible, spielleiter only) */
.setup-section {
  margin: 1.5rem 1rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.setup-section > summary {
  padding: 0.8rem 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.setup-section > summary::-webkit-details-marker { display: none; }

.setup-summary-icon { font-size: 1.1rem; }

.setup-summary-hint {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--yellow);
  letter-spacing: 0.5px;
  margin-left: auto;
}

.setup-section[open] > summary { border-bottom: 1px solid var(--border); }

.setup-body {
  padding: 0.6rem 1rem 1rem;
}

.setup-body .admin-section {
  margin-top: 0.8rem;
  padding: 0;
  background: transparent;
  border: none;
}

.setup-body .admin-section h2 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 0.5rem;
}

/* Mobile tweaks for scoring page */
@media (max-width: 640px) {
  .bp-btn { min-height: 110px; }
  .bp-plus { font-size: 1.7rem; }
  .score-box { margin: 0 0.6rem 0.8rem; padding: 0.7rem 0.8rem; }
  .big-points { margin: 0 0.6rem 0.8rem; gap: 0.5rem; }
  .small-points { margin: 0 0.6rem 0.8rem; gap: 0.5rem; }
  .scoring-secondary { margin: 0 0.6rem; }
}

/* Imported away roster (in begegnung edit) */
.away-roster-box {
  margin-top: 0.4rem;
}

.away-roster-list {
  list-style: decimal inside;
  font-size: 0.85rem;
  padding: 0.5rem 0.4rem;
  margin-bottom: 0.5rem;
  max-height: 250px;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.away-roster-list li { padding: 0.15rem 0.4rem; }

/* ===== Slot cards (admin begegnung edit) ===== */
.slot-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.slot-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
}

.slot-card.slot-status-live { border-color: var(--blue); }
.slot-card.slot-status-done { opacity: 0.85; }

.slot-card-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: nowrap;   /* Zahnrad bleibt in der Platz/Uhrzeit-Zeile */
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.slot-card-header .slot-pos {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--muted);
  min-width: 1.8rem;
  flex: 0 0 auto;
}

/* Zeit fix, Platz-Dropdown darf schrumpfen, damit das Zahnrad daneben passt. */
.slot-card-header .slot-time-inp { flex: 0 0 auto; }
.slot-card-header .slot-court-sel { flex: 1 1 auto; min-width: 7rem; }
.slot-card-header .slot-card-action { flex: 0 1 auto; min-width: 0; }
.slot-card-header .slot-card-action .manage-btn-icon-only { flex: 0 0 auto; padding: 0.3rem 0.4rem; }
.slot-card-header .slot-card-action .court-change-sel { min-width: 0; max-width: 8rem; }

.slot-time-inp,
.slot-court-sel {
  font-size: 0.8rem;
  padding: 0.3rem 0.5rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
}

.slot-time-inp { width: 6rem; }
.slot-court-sel { min-width: 6.5rem; }

.slot-card-action {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.slot-card-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-top: 0.6rem;
}

.slot-side {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}

.slot-side-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  width: 100%;
}

.slot-side .name-input {
  flex: 1;
  min-width: 6rem;
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
}

.slot-card-body-doubles .slot-side .name-input {
  flex: 1 1 calc(50% - 0.2rem);
}

.lineup-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.8rem;
}

.hidden-action-form {
  display: contents;
}

/* Court picker (admin edit) */
.court-picker {
  margin-top: 0.8rem;
  padding: 0.6rem 0.8rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.court-picker-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.4rem;
}

.court-picker-row {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.35rem;
}

.court-picker-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

.court-picker-row select.name-input {
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
}

/* One-click start button */
.btn-start {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
  border-radius: 14px;
  border: 1px solid var(--green-lt);
  background: transparent;
  color: var(--green-lt);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.btn-start:hover {
  background: var(--green-lt);
  color: #fff;
}

.btn-stop {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
  border-radius: 14px;
  border: 1px solid var(--red);
  background: transparent;
  color: var(--red);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.btn-stop:hover {
  background: var(--red);
  color: #fff;
}

/* Court + schedule line in public match row */
.bg-match-court {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: 0.15rem;
  white-space: nowrap;
}

/* ===== Public list of Begegnungen ===== */
/* Favoriten-Toggle (♥) — kompakter Icon-Button. Inactive=muted, Active=blau. */
.fav-form { display: inline-flex; }
.fav-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  padding: 0.3rem 0.5rem;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  font-family: inherit;
  font-variant-emoji: text;  /* monochrome ♥ statt color-emoji */
  transition: color 0.15s ease, border-color 0.15s ease;
}
.fav-btn:hover { color: var(--blue); border-color: var(--border); }
.fav-btn.is-fav { color: var(--blue); }
.fav-btn.is-fav:hover { color: var(--muted); }
.fav-icon { font-weight: bold; }
.icon-svg { width: 1.1em; height: 1.1em; display: block; vertical-align: middle; }
.fav-btn .icon-svg, .bell-btn .icon-svg { width: 1.15em; height: 1.15em; }

/* Bell-Button (Benachrichtigungs-Einstellungen pro Favorit) */
.bell-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  padding: 0.3rem 0.5rem;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  font-family: inherit;
  font-variant-emoji: text;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.bell-btn:hover:not(:disabled) { color: var(--blue); border-color: var(--border); }
.bell-btn.is-active { color: var(--blue); }
.bell-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.bell-icon { font-weight: bold; }
.fav-bell-pair { display: inline-flex; align-items: center; gap: 0.15rem; }

/* Bell-Snackbar — kurzer Banner nach Toggle. Pattern: FotMob-Stil:
   einmaliger Confirm-Banner unten, mit Inline-Bearbeiten-Link bei Activate.
   Position bottom-center, slide-up + fade. Auto-dismiss nach 4s. */
.bell-snackbar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 120%);
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  max-width: calc(100vw - 32px);
  padding: 0.7rem 1rem;
  background: var(--card, #fff);
  color: var(--text, #111);
  border: 1px solid var(--border, #d0d0d0);
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  font-size: 0.92rem;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.bell-snackbar.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}
.bell-snackbar-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue, #1e6fff);
  color: #fff;
  flex: 0 0 auto;
}
.bell-snackbar-check {
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #2ca44a;
  color: #fff;
  border: 2px solid var(--card, #fff);
}
.bell-snackbar-text {
  flex: 1 1 auto;
  line-height: 1.25;
  word-break: break-word;
}
.bell-snackbar-text strong { font-weight: 600; }
.bell-snackbar-edit {
  flex: 0 0 auto;
  background: none;
  border: none;
  color: var(--blue, #1e6fff);
  font-weight: 600;
  font-family: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
}
.bell-snackbar-edit:hover { background: rgba(30, 111, 255, 0.08); }
@media (max-width: 480px) {
  .bell-snackbar {
    left: 12px;
    right: 12px;
    transform: translateY(120%);
    max-width: none;
  }
  .bell-snackbar.is-visible { transform: translateY(0); }
}

/* Bell-Modal (Per-Favorit-Override-Dialog) */
.bell-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.bell-modal[hidden] { display: none; }
.bell-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.45);
}
.bell-modal-card {
  position: relative; z-index: 1;
  background: var(--bg, #fff);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.2rem 1.2rem 1rem;
  max-width: 420px;
  width: calc(100% - 2rem);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.bell-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.4rem;
}
.bell-modal-title { margin: 0; font-size: 1.05rem; }
.bell-modal-close {
  background: none; border: 0; font-size: 1.4rem;
  cursor: pointer; color: var(--muted); padding: 0.2rem 0.5rem;
}
.bell-modal-sub { font-size: 0.85rem; margin: 0.2rem 0 0.6rem; }
.bell-modal-events {
  list-style: none; padding: 0; margin: 0.6rem 0;
}
.bell-modal-event {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.4rem 0; border-bottom: 1px solid var(--border);
}
.bell-modal-event:last-child { border-bottom: 0; }
.bell-modal-event-label { flex: 1; }
.bell-modal-event-select {
  background: var(--bg-elev, #f6f6f6);
  border: 1px solid var(--border);
  border-radius: 6px; padding: 0.25rem 0.4rem;
  color: inherit; font-family: inherit;
}
.bell-modal-foot {
  display: flex; gap: 0.5rem; justify-content: flex-end;
  margin-top: 0.8rem;
}
body.modal-open { overflow: hidden; }

/* Push-Settings auf der Favoriten-Page */
.push-settings-section { margin-bottom: 1.6rem; }
.push-banner {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  margin: 0.6rem 0 1rem;
  background: var(--bg-elev, transparent);
}
.push-banner-ok { border-color: var(--blue); }
.push-banner-warn { border-color: #b08800; }
.push-banner-body strong { display: block; margin-bottom: 0.1rem; }
.push-global-prefs .push-prefs-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.4rem 1rem; margin-top: 0.5rem;
}
/* Custom-Checkbox-Look — native input visually hidden, eigene Box per CSS.
   Im aktiven Zustand blau gefüllt + Häkchen. Konsistent mit dem TEC-Stil. */
.push-pref-toggle {
  display: inline-flex; align-items: center; gap: 0.6rem;
  cursor: pointer; padding: 0.35rem 0; font-size: 0.92rem;
  user-select: none;
}
.push-pref-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
  pointer-events: none;
}
.push-pref-toggle-box {
  width: 1.1rem;
  height: 1.1rem;
  flex: 0 0 auto;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  background: var(--card);
  display: inline-block;
  position: relative;
  transition: background 0.15s, border-color 0.15s;
}
.push-pref-toggle input[type="checkbox"]:checked + .push-pref-toggle-box {
  background: var(--blue);
  border-color: var(--blue);
}
.push-pref-toggle input[type="checkbox"]:checked + .push-pref-toggle-box::after {
  content: "";
  position: absolute;
  left: 0.32rem;
  top: 0.06rem;
  width: 0.3rem;
  height: 0.6rem;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.push-pref-toggle input[type="checkbox"]:focus-visible + .push-pref-toggle-box {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.push-pref-toggle-label { color: var(--text); }

.push-banner-btn { display: inline-block; width: auto; margin-top: 0.6rem; }
.push-device-list { list-style: none; padding: 0; margin: 0.5rem 0 0; }
.push-device-item {
  display: flex; justify-content: space-between; align-items: center;
  gap: 0.6rem; padding: 0.4rem 0; border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.push-device-item:last-child { border-bottom: 0; }
.push-device-ua { word-break: break-all; }
.push-device-meta { white-space: nowrap; }

.fav-match-list { list-style: none; padding: 0; margin: 0; }
.fav-match-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--border);
}
.fav-match-headline { font-weight: 600; color: var(--text); }

/* Site-header rechts ggf. mehrere Aktionen (Fav-Pair + Verwalten-Button) */
.site-header-actions {
  display: inline-flex; align-items: center; gap: 0.4rem;
}

/* Bell oben rechts in Score-Cards (Live-Tab) — auf Mobile etwas größerer Tap-Target */
/* Bell sitzt direkt neben dem Badge (margin-left:auto übernimmt jetzt
   der Badge, siehe .sc-badge oben). Kleiner Gap fürs Auge. */
.sc-bell { margin-left: 0.4rem; display: inline-flex; }
.sc-bell .bell-btn { padding: 0.2rem 0.35rem; }
.bg-header-bell { display: inline-flex; margin-left: 0.5rem; }

/* Kachel-Body: Player-Rows links flex-1 + Actions rechts, gemeinsam in
   einer flex-row mit align-items:center. Bedeutet: Actions sitzen auf
   gleicher Höhe wie der vertikale Mittelpunkt der Player-Rows — bei einer
   Reihe (offenes Match) inline neben den Namen, bei zwei Reihen mittig
   dazwischen. Keine absoluten Positionswerte = kein Overlap mit Badge. */
.sched-tile-wrap { position: relative; }
.sched-tile-body {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.sched-tile-content {
  flex: 1;
  min-width: 0;
}
.sched-tile-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
.sched-tile-bell { display: inline-flex; }
.sched-tile-bell .bell-btn { padding: 0.15rem 0.25rem; }

/* Slot-Fav-Buttons im Begegnungs-Detail (klein, dezent in der Pos-Spalte) */
.bg-match-fav {
  display: inline-flex; gap: 0.1rem; margin-top: 0.2rem;
}
.bg-match-fav .fav-btn,
.bg-match-fav .bell-btn { padding: 0.15rem 0.3rem; font-size: 0.9rem; }

/* Auswärts-Karte: Fav-Pair rechts oben */
.sched-away-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.sched-away-fav { margin-left: auto; }

/* Favoriten-Liste: Spieler-Rows mit Action rechts */
.fav-player-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.fav-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
}
.fav-player-name { font-weight: 600; color: var(--text); }

/* Team-Card-Variante mit Fav-Toggle rechts */
.team-card-with-fav {
  display: flex;
  align-items: stretch;
  gap: 0;
}
.team-card-with-fav .team-card-body {
  flex: 1;
  text-decoration: none;
  color: inherit;
}
.team-card-with-fav .team-card-fav {
  padding: 0.4rem 0.6rem;
  display: flex;
  align-items: flex-start;
}
.team-card-static { cursor: default; opacity: 0.85; }

/* Card mit transparentem Link-Overlay + absolut positioniertem Fav-Button.
   Vorteil: Fav klebt rechts oben in der Card (klein, dezent), restliche
   Click-Fläche bleibt ein Link zur Mannschaft. Form-in-Anchor-Verschachtelung
   wird vermieden weil <form> und <a> Geschwister sind, nicht ineinander. */
.team-card-overlayed {
  position: relative;
}
.team-card-overlayed .team-card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.team-card-overlayed > * { position: relative; z-index: 0; }
/* Heart + Bell auf der Mannschaften-Karte vertikal gestackt (übereinander),
   damit sie nicht überlappen. Nur die OUTER Span ist absolut positioniert —
   die innere .fav-form darin bleibt statisch und ordnet sich im flex-column ein.
   Direkt-Kind-Selektor (>) damit's nicht für nested .fav-form gilt. */
.team-card-overlayed > .fav-form,
.team-card-overlayed > .team-card-fav-overlay {
  position: absolute;
  top: 0.3rem;
  right: 0.4rem;
  z-index: 2;
}
.team-card-overlayed > .team-card-fav-overlay {
  display: inline-flex;
  flex-direction: column;
  gap: 0.15rem;
  align-items: flex-end;
}
.team-card-overlayed > .team-card-fav-overlay .fav-form { position: static; }
.team-card-overlayed > .team-card-fav-overlay .fav-btn,
.team-card-overlayed > .team-card-fav-overlay .bell-btn {
  padding: 0.15rem 0.3rem;
}

/* Meldeliste Fav-Spalte */
.meldeliste-table .ml-fav { width: 2.6rem; text-align: right; }

/* Rollen-Tag in der Meldeliste (MF / Sc) — kompakt direkt hinter Name. */
.ml-role-tag {
  display: inline-block;
  padding: 0.05rem 0.4rem;
  margin-left: 0.4rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  vertical-align: middle;
}
.ml-role-tag-mf {
  background: rgba(46, 160, 67, 0.18);
  color: #2ea043;
}
.ml-role-tag-sc {
  background: rgba(32, 174, 189, 0.18);
  color: var(--blue);
}

/* Spieler-Auswahl in admin_begegnung: ein <select> pro Spieler-Slot,
   plus zwei hidden inputs für Backend-Compat. Wrap als .player-pick. */
.player-pick {
  display: block;
  margin-bottom: 0.4rem;
}
.player-pick .player-select {
  width: 100%;
  font-size: 0.9rem;
  padding: 0.4rem 0.5rem;
  font-family: inherit;
}
/* In admin_court ersetzt der Dropdown die zwei Vor/Nach-Inputs einer
   .name-row → ohne flex:1 würde das Single-Element nicht die volle Breite
   nehmen und gequetscht wirken. */
.name-row > .player-pick {
  flex: 1;
  margin-bottom: 0;
}
.player-pick .player-select-home {
  border-color: rgba(46, 160, 67, 0.4);
}
.player-pick .player-select-away {
  border-color: rgba(31, 111, 235, 0.4);
}

/* Scorekeeper-Liste auf /admin/teams/<id> — eine Zeile pro berechtigtem User. */
.sk-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}
.sk-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0.7rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.sk-row-name { min-width: 0; flex: 1; }
.sk-row-mail { font-size: 0.78rem; }
.sk-add-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.sk-add-select {
  flex: 1;
  min-width: 14rem;
  font-size: 0.9rem;
}

/* Page-Header mit Title links und Verwalten-Button rechts.
   Wird auf Listen-Pages (Begegnungen, Mannschaften, Schedule) und auf
   Detail-Pages (Mannschaft, Begegnung) verwendet. */
.page-header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  /* Standalone .section-title hat margin-bottom: 1rem; im header-row
     wird der genullt, also hier den Abstand zum nachfolgenden Content
     auf Container-Ebene setzen. */
  margin-bottom: 1rem;
}
.page-header-row .section-title { margin-bottom: 0; }
.page-header-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
/* Header-Row ohne Titel (Titel steht jetzt in der Nav) → Actions rechtsbündig. */
.page-header-row-actions { justify-content: flex-end; }

.manage-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.8rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.manage-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
}
.manage-btn-icon { font-size: 0.95em; }

/* Verwalten-Buttons mobil einheitlich: nur das Zahnrad, kein Text (Anton
   2026-06-17). Ersetzt die früheren per-Seite-Regeln durch eine globale. */
@media (max-width: 640px) {
  .manage-btn-text,
  .player-manage-label { display: none; }
  .manage-btn { padding: 0.4rem 0.55rem; gap: 0; }
}

/* Wochentag-Anzeige rechts vom Date-Picker auf /begegnungen.
   Visuell konsistent mit dem `/admin`-Picker — gleiche Klasse, nur ein
   kleines Wochentag-Tag rechts daneben damit man weiß welcher Tag das
   gerade ist (sonst zeigt der Picker nur "08.05.2026"). */
.date-picker-weekday {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
  margin-left: 0.4rem;
}
.date-picker-today-pill {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  background: rgba(32, 174, 189, 0.15);
  color: var(--blue);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 0.3rem;
}

/* ── Datum-Slider auf /begegnungen ──────────────────────────────────────
   Horizontaler Streifen mit Tag-Pills, links/rechts ein Pfeil zum Springen,
   ganz rechts ein Kalender-Icon (Label mit eingebettetem date-input) für
   freie Datumswahl. */
.date-slider-wrap {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
  position: relative;
}
/* Kalender-Icon: Label wrappt SVG + ein input[type=date]. Klick auf das
   Label triggert den nativen Picker (label-for-input-Standard). Funktioniert
   auf allen Browsern inkl. iOS-Safari, kein showPicker()-Polyfill noetig. */
.date-slider-cal {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
}
.date-slider-cal:hover { color: var(--text); background: var(--card); }
.date-slider-cal input[type=date] {
  /* Input sitzt unsichtbar ueber dem Label — Klick aufs Label triggert
     den darunter liegenden Native-Picker am gleichen Ort. */
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
  border: 0;
  padding: 0;
  /* Browser-Variation: manche zeigen einen Picker-Pfeil oder Standard-Style.
     Erzwingen wir transparenten Hintergrund. */
  background: transparent;
  color: transparent;
}
.date-slider-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  color: var(--muted);
  text-decoration: none;
  font-size: 1.4rem;
  line-height: 1;
  border-radius: 999px;
  user-select: none;
}
.date-slider-arrow:hover { color: var(--text); background: var(--card); }

/* Variante B — kompakte Datums-Navigation: „‹ Heute ›" + Kalender, ohne
   Pillenreihe, ohne Strip/Rahmen → wirkt als Teil der Seite (keine Trennlinie). */
.date-slider-wrap.date-compact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  margin: 0.2rem 0 0.6rem;
}
.date-compact-arrow { width: 34px; height: 34px; flex: none; }
.date-compact-arrow svg { width: 20px; height: 20px; }
.date-compact-current {
  width: auto; height: auto;       /* override .date-slider-cal (32px Icon-Button) */
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  border-radius: var(--radius);
}
.date-compact-cal { width: 16px; height: 16px; color: var(--muted); flex: none; }
.date-compact-label { white-space: nowrap; }

/* Datums-Toolbar: 3 Spalten (Action | Datum | Action). Das 1fr auto 1fr-Grid
   haelt den Kalender IMMER mittig, egal wie breit die Seiten-Buttons sind.
   Training planen links (mobil nur Plus, .manage-btn-text wird ausgeblendet),
   Verwalten rechts (Zahnrad). */
.date-toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.4rem;
  margin: 0.2rem 0 0.6rem;
}
.date-toolbar-left   { justify-self: start; }
.date-toolbar-right  { justify-self: end; }
.date-toolbar-center { justify-self: center; }
.date-toolbar .date-slider-wrap.date-compact { margin: 0; }
/* Einheitliche Verwalten-/Action-Icon-Groesse (Zahnrad, Plus). Etwas groesser
   (Anton mag das groessere); SVG statt Emoji → kein Clipping am Button-Rand. */
.mbtn-svg { width: 20px; height: 20px; display: block; overflow: visible; }
.manage-btn-icon { display: inline-flex; align-items: center; justify-content: center; }

.date-slider {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  /* Scrollbar ausblenden — wir steuern via Pfeile + Swipe. */
  scrollbar-width: none;
  padding: 0.2rem 0.1rem;
}
.date-slider::-webkit-scrollbar { display: none; }
.date-pill {
  flex-shrink: 0;
  padding: 0.4rem 0.85rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  scroll-snap-align: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.date-pill:hover { color: var(--text); border-color: var(--muted); }
.date-pill.is-today { color: var(--text); }
.date-pill.is-picked {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

/* Page-Swipe-Animation: wenn der User die Page seitwaerts wischt oder
   eine Pille tappt, schiebt sich die Section sanft aus dem Viewport,
   bevor die Navigation feuert. Die Klassen werden via JS gesetzt. */
.page-section.is-swipe-out-left  { transform: translateX(-100%); opacity: 0.2; transition: transform 0.22s ease, opacity 0.22s ease; }
.page-section.is-swipe-out-right { transform: translateX( 100%); opacity: 0.2; transition: transform 0.22s ease, opacity 0.22s ease; }
.page-section.is-swipe-follow {
  transition: transform 0s;  /* nur waehrend Live-Drag, kein Easing */
}

.bg-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.bg-card {
  display: block;
  padding: 0.9rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
}

.bg-card:hover { border-color: var(--blue); }

.bg-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  font-size: 1rem;
  font-weight: 700;
}

.bg-card-team {
  flex: 1;
  min-width: 0;
}

.bg-card-team:last-child { text-align: right; }

.bg-card-score {
  font-size: 1.2rem;
  font-weight: 900;
  flex-shrink: 0;
}

.bg-card-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.3rem;
}

/* 2-Zeilen-Layout: Mannschaften übereinander, Score rechts pro Zeile. Bell
   sitzt in der Meta-Row (oben) rechts via margin-left:auto, dadurch auf
   derselben X-Achse wie die Scores darunter (alle drei rechte-Enden in der
   gleichen content-area-Spalte). */
.bg-card-meta-top {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.45rem;
}
.bg-card-bell {
  margin-left: auto;
  display: inline-flex;
}
.bg-card-bell .bell-btn {
  padding: 0.05rem 0;
  margin: 0;
  border: 0;
}
.bg-card-bell .icon-svg { width: 1rem; height: 1rem; }
.bg-card-time { font-weight: 700; color: var(--text); }
.bg-card-league { color: var(--muted); }
/* 2-Spalten-Layout für /begegnungen — Heim links, Auswärts rechts.
   Auf Mobile (< 700px) stacked, eine Spalte. Turniere darunter eigene Reihe. */
.bg-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.2rem;
  margin-top: 0.4rem;
}
@media (max-width: 700px) {
  .bg-cols { grid-template-columns: 1fr; }
}
.bg-col { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.bg-col-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.2rem;
}
.bg-col-empty { font-size: 0.82rem; font-style: italic; margin: 0; padding: 0.4rem 0; }
.bg-tournaments-row { margin-top: 1.2rem; }

/* Heim und Gast übereinander, jeweils Name links + Score rechts. */
.bg-card-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.18rem 0;
  font-size: 1rem;
}
.bg-card-line .bg-card-team {
  font-weight: 700;
  flex: 1;
  min-width: 0;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bg-card-score-num {
  font-size: 1.25rem;
  font-weight: 900;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* Tournament card variant in the begegnungen list — name left-aligned, no opponent column */
.bg-card-tournament {
  display: block;
  text-align: left;
}

.bg-tournament-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  text-align: left;
}

/* ===== Public single Begegnung view ===== */
.bg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1rem 0.4rem;
  gap: 0.6rem;
}

.bg-team {
  flex: 1;
  /* min-width: 0 noetig damit flex-item shrinken kann und overflow/
     ellipsis greift. Auto-Fit-JS in base.html skaliert font-size bei
     langen Vereinsnamen (Anton 2026-05-18). */
  min-width: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
}

.bg-team-away { text-align: right; }

.bg-score {
  flex-shrink: 0;
  text-align: center;
  font-size: 2.2rem;
  font-weight: 900;
}

.bg-score .bg-score-colon {
  color: var(--muted);
  margin: 0 0.3rem;
}

.bg-date {
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.bg-section {
  padding: 0 1rem 0.5rem;
}

.bg-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 1rem 0 0.5rem;
}

.bg-matches {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* 4-Spalten-Layout: Pos | Players | Sätze | Tools (Bell + Badge).
   Alle Zellen vertikal mittig zueinander, Tools-Zelle horizontal flex mit
   Bell + Badge nebeneinander. Analog zu /live's sc-header. */
.bg-match {
  display: grid;
  grid-template-columns: 4.5rem 1fr auto auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.6rem 0.8rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.bg-match-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.bg-match-tools .bell-btn { padding: 0.2rem 0.3rem; }
.bg-match-status-pill {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.bg-match-status-live { background: var(--blue);  color: #fff; }
.bg-match-status-done { background: var(--green); color: #fff; }
.bg-match-status-open {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.bg-live-court {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.bg-match-bell {
  display: flex;
  align-items: center;
}
.bg-match-bell .bell-btn { padding: 0.25rem 0.4rem; }

.bg-match-live {
  border-color: var(--blue);
}

.bg-match-pos {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--muted);
}

.bg-match-players {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.bg-pname {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  /* Ellipsis-Fallback fuer sehr lange Namen (Doppel) auf engen Mobile-
     Containern. _name(abbrev=True) im Backend kuerzt schon ab 22 chars,
     hier ist nur das Safety-Net wenn Doppel oder ungewoehnliche Namen
     immer noch ueberlaufen. */
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Nationality-Pill: 3-Letter-Code direkt rechts vom Spielernamen
   (nur Einzel). Klein, monospaced, dezent. */
.bg-nat {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.05rem 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}

/* nuLiga-meetingReport: Spielernamen + Position-Tag im 2-Spalten-Grid,
   damit Heim- und Gast-Pos-Tag EXAKT übereinander stehen (auch bei
   unterschiedlich langen Namen). `display: contents` an den Player-Rows
   sorgt dafür dass ihre Children direkt im Grid landen. Existing
   `.bg-match-players` ohne diese Modifier bleibt 1-Spalten-Layout
   (für /begegnung wo es keinen Pos-Tag gibt). */
.bg-match-players-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  row-gap: 0.25rem;
  column-gap: 1rem;
  align-items: baseline;
}
.bg-match-players-grid .bg-player-row {
  display: contents;
}
.bg-pos-tag {
  min-width: 2.6rem;
  text-align: right;
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  white-space: nowrap;
}

.bg-match-result {
  text-align: right;
  position: relative;
}

.bg-set-row {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
  font-size: 0.95rem;
  font-weight: 700;
}

.bg-set {
  display: inline-block;
  min-width: 1.2rem;
  text-align: center;
  color: var(--muted);
}

.bg-set.bg-set-win { color: var(--text); }
.bg-set.bg-set-cur { color: var(--blue); }
/* MTB-Punkte als letzte bg-set-Zelle in /begegnung-Live (kein separater
   bg-wo-slot mehr). Gelb = „laufender Tiebreak". */
.bg-set.bg-set-mtb { color: var(--yellow); }

/* Detail-Layout (`bg-match--stacked`) auf /begegnung/<id>:
   ┌───────────────────────────────────────────────┐
   │ pos  meta(Platz · Zeit)        tools(Pill+🔔) │  ← Header-Zeile
   │      Spieler oben              Sets oben      │  ← Player ↔ Sets aligned
   │      Spieler unten             Sets unten     │
   └───────────────────────────────────────────────┘
   Realisiert mit grid-template-areas. .bg-match-players und
   .bg-match-result werden via `display: contents` aufgelöst, damit ihre
   Children direkt im Outer-Grid landen und Player ↔ Sets zeilenweise
   alignen (statt nur als 2 Blöcke vertikal mittig zueinander). */
.bg-match--stacked {
  grid-template-areas:
    "pos      meta tools"
    "pos-home p1   s1"
    "pos-away p2   s2";
  /* Pos-Spalte breit genug fuer „5/6" Doppel-Aufstellung. Anton
     2026-05-19: Meldelisten-Pos (Einzel) bzw. Aufstellungs-Pos
     (Doppel) sitzt links unter der grossen Match-Nr — eigene
     Grid-Cells pos-home/pos-away, damit's exakt mit den
     Spielerzeilen alignt. */
  grid-template-columns: 2.2rem 1fr auto;
  column-gap: 0.7rem;
  row-gap: 0.25rem;
  align-items: stretch;
}
/* Spielerposition-Sub-Label unter der D-Nr bei Doppeln (Anton
   2026-05-18). Zeigt die Einzel-Positionen der beiden Doppel-Spieler
   z.B. „2/5". Klein, muted, eigene Zeile unter der grossen Zahl. */
.bg-match-pos {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
}
.bg-match-pos-sub {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  margin-top: 0.05rem;
}

.bg-match--stacked > .bg-match-pos {
  grid-area: pos;
  /* baseline — sonst sitzt das größere "1" optisch tiefer als das kleinere
     "Platz 3 · 10:00" daneben (verschiedene Font-Sizes haben unterschiedliche
     line-height-Verteilung über/unter der Glyph-Baseline). */
  align-self: baseline;
  /* Position-Zahl jetzt prominenter (war 0.8rem klein-grau) — sie ist die
     primäre Match-ID und kein muted Hint mehr. */
  font-size: 1rem;
  color: var(--text);
}
.bg-match--stacked > .bg-match-meta {
  grid-area: meta;
  align-self: baseline;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bg-match--stacked > .bg-match-tools {
  grid-area: tools;
  align-self: start;
  justify-self: end;
}
/* Wrapper aufloesen, damit Player-Row ↔ Set-Row dieselbe Grid-Reihe teilen. */
.bg-match--stacked > .bg-match-players,
.bg-match--stacked > .bg-match-result   { display: contents; }
.bg-match--stacked .bg-player-row.bg-player-home { grid-area: p1; align-self: center; }
.bg-match--stacked .bg-player-row.bg-player-away { grid-area: p2; align-self: center; }
.bg-match--stacked .bg-set-row.bg-set-home       { grid-area: s1; align-self: center; }
.bg-match--stacked .bg-set-row.bg-set-away       { grid-area: s2; align-self: center; }
/* Anton 2026-05-19: Pos-Spalte links — unter der grossen Match-Nr
   sitzt pro Spielerzeile die Meldelistenposition (Einzel) bzw. die
   Aufstellungsposition „5/6" (Doppel). Eigene Grid-Cells damit's
   exakt mit Spielerzeile alignt. LK wandert in Klammern hinter den
   Spielernamen. */
.bg-match--stacked > .bg-player-pos-home { grid-area: pos-home; }
.bg-match--stacked > .bg-player-pos-away { grid-area: pos-away; }
.bg-player-pos {
  align-self: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: left;
  white-space: nowrap;
}
.bg-match--stacked .bg-player-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 0;
}
.bg-match--stacked .bg-player-row .bg-pname {
  flex: 1;
  min-width: 0;
}
/* LK in Klammern hinter dem Spielernamen (nur Einzel). */
.bg-lk-tag {
  margin-left: 0.4rem;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

.bg-live-tag {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.2rem;
}

.bg-pending {
  color: var(--muted);
  font-size: 1.2rem;
}

.bg-walkover-tag {
  display: inline-block;
  background: var(--yellow);
  color: #000;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  margin-left: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== Loser dimming: applied to player names on finished matches ===== */
.is-loser { color: var(--muted); }

/* Status slot column on each score row (per-row, so set numbers stay aligned).
   Holds either:
     • live game points (15/30/40/AD) in the live tab
     • a W.O. badge on the loser row if the match ended via walkover
     • empty otherwise
   Both rows render the slot span so they reserve identical width. */
.sd-wo-slot,
.sc-wo-slot,
.ov-wo-slot,
.tv-wo-slot,
.sched-tile-wo-slot,
.acc-wo-slot,
.bg-wo-slot {
  display: inline-block;
  /* Gleich breite Ziffern → „15"/„30"/„40" identisch breit, sonst verschiebt
     die proportionale Breite die Sets-Position zwischen den 2 Zeilen leicht. */
  font-variant-numeric: tabular-nums;
  /* Anton 2026-05-18: Sets sollen NAH an den Punkten kleben —
     gleicher Abstand wie zwischen den Saetzen. Frueher 2.8rem
     min-width + rechtsbuendiger Text liess „30" mit ~2rem
     Innen-Padding-Links stehen, optisch sahen Sets und Punkte weit
     auseinander. Mit min-width 1.2rem (genug fuer 2-stellige Zahlen
     wie „40"/„10") sitzt der Inhalt direkt neben der Sets-Reihe.
     W.O.-Badge (~2rem breit) waechst den Slot bei Bedarf eh ueber
     min-width hinaus, kein Layout-Shift. */
  /* Exakt 2 Ziffern breit (2ch + tabular-nums): "40" passt genau, "0" hat
     genau eine Zehner-Stelle Lücke → Einer stehen übereinander (rechtsbündig),
     kein übergroßer Leerraum, und der Slot wächst bei 1- vs 2-stellig nicht
     unterschiedlich → Sets verrutschen nicht (Anton 2026-06-04). W.O.-Badge
     (~2rem) wächst weiterhin drüber hinaus. */
  min-width: 2ch;
  text-align: right;
  margin-left: 0;
  flex-shrink: 0;
}

.tv-wo-slot { min-width: 3.5rem; }

/* wo-slots tragen jetzt einheitlich Live-Pts / MTB-Pts (gelb/800),
   Decider-Endergebnisse (Set-Farben, siehe is-set-result-Regel) oder
   W.O.-Badge. Default = Live-Pts-Optik. Gilt fuer ALLE wo-slot-
   Varianten (sc/ov auf Live-Tab, sched-tile auf /schedule, bg auf
   /begegnung, sd auf /court + /admin/court, tv auf /tv, acc).
   Anton 2026-05-18: Spalte muss einheitlich rechts unterm Bell sitzen
   und immer die „letzte Score"-Info tragen — egal ob live oder final. */
.sc-wo-slot,
.ov-wo-slot,
.sd-wo-slot,
.sched-tile-wo-slot,
.bg-wo-slot,
.acc-wo-slot,
.tv-wo-slot {
  color: var(--yellow);
  font-weight: 800;
}

/* Unified-Display (Anton 2026-05-18): wenn der wo-slot ein End-Satz-
   Ergebnis traegt (3. Satz / MTB-Result auf match_over), faerben wir
   ihn wie eine .sc-set-Zelle ein — gleiches Gewicht, gleiche Farben:
   Gewinner = Text-Weiss, Verlierer = Muted. Damit wirkt das Endergebnis
   nicht mehr wie ein „Live-Pts"-Eintrag (gelb/800) sondern wie ein
   neutraler Satz-Score auf gewohnter Spaltenposition. Gilt fuer alle
   wo-slot-Varianten (.sc-, .ov-, .sched-tile-, .bg-, .acc-, .sd-,
   .tv-) damit Schedule, Begegnung, Tournament etc. die gleiche Logik
   nutzen koennen. */
.sc-wo-slot.is-set-result,
.ov-wo-slot.is-set-result,
.sched-tile-wo-slot.is-set-result,
.bg-wo-slot.is-set-result,
.acc-wo-slot.is-set-result,
.sd-wo-slot.is-set-result,
.tv-wo-slot.is-set-result {
  color: var(--muted);
  font-weight: 700;
}
.sc-wo-slot.is-set-result.is-set-win,
.ov-wo-slot.is-set-result.is-set-win,
.sched-tile-wo-slot.is-set-result.is-set-win,
.bg-wo-slot.is-set-result.is-set-win,
.acc-wo-slot.is-set-result.is-set-win,
.sd-wo-slot.is-set-result.is-set-win,
.tv-wo-slot.is-set-result.is-set-win {
  color: var(--text);
}

/* Stream-Vorschau-Overlay auf der Startseite: Punkte-Slot soll
   visuell wie ein Satz-Score aussehen — gleiche Schriftgroesse,
   -gewicht, line-height, min-width. Wir setzen font-size am
   .overlay-row und zwingen beide Children (.ov-set, .ov-wo-slot)
   auf inherit + line-height 1, damit nichts (auch keine
   Inline-block-Baseline-Verschiebung) eine Hoehen- oder
   Groessen-Differenz erzeugt. */
.score-overlay .overlay-row {
  font-size: 1rem;
  line-height: 1;
}
.score-overlay .overlay-row .ov-set,
.score-overlay .overlay-row .ov-wo-slot {
  font-size: inherit;
  line-height: inherit;
  font-weight: 700;
  min-width: 1rem;
  text-align: center;
}
.score-overlay .overlay-row .ov-wo-slot {
  margin-left: 0;
  color: var(--yellow);
}
/* Match-fertig + 3 Saetze: Punkte-Slot zeigt 3. Satz statt Live-Pts
   und uebernimmt Set-Farben (siehe oben). Specifier-Boost noetig,
   weil .score-overlay-Default ja explizit gelb setzt. */
.score-overlay .overlay-row .ov-wo-slot.is-set-result {
  color: var(--muted);
  font-weight: 700;
}
.score-overlay .overlay-row .ov-wo-slot.is-set-result.is-set-win {
  color: #fff;
}

/* datalist dropdown arrow hint for select */
select.name-input {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 1.8rem;
}

/* ===== Player name inputs ===== */
.doubles-toggle {
  margin-bottom: 0.8rem;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
}

.toggle-label input[type=checkbox] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--blue);
}

.team-block { margin-bottom: 0.6rem; }

.team-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.3rem;
}

.name-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

/* Labeled Form-Field: kleine Uppercase-Überschrift über Input.
   Für date/time-Felder wichtig, weil Placeholder dort nicht angezeigt werden. */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  min-width: 0;
}
.form-field-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.vs-divider {
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--muted);
  margin: 0.4rem 0;
}

/* Score display box updates */
.sd-pts {
  font-size: 1.1rem;
  font-weight: 800;
  min-width: 4rem;
  text-align: right;
  color: var(--yellow);
}

.sd-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.4rem;
  text-align: right;
}


.stream-input {
  width: 100%;
  font-size: 0.85rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  outline: none;
  margin-bottom: 0.6rem;
  font-family: monospace;
}

.stream-input:focus { border-color: var(--blue); }

/* ===== Buttons ===== */
.btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  text-align: center;
  transition: filter 0.15s, transform 0.1s;
  padding: 0.75rem 1rem;
  font-size: 1rem;
}

.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn:not(:disabled):active { transform: scale(0.97); }
.btn:not(:disabled):hover  { filter: brightness(1.12); }

.btn-primary   { background: var(--blue);     color: #fff; }
.btn-manage    { background: var(--blue);     color: #fff; margin-top: 0.2rem; }
.btn-secondary { background: var(--border);   color: var(--text); }
.btn-danger    { background: var(--red);      color: #fff; }
.btn-undo      { background: var(--border);   color: var(--muted); font-size: 0.9rem; }
.btn-walkover  { background: var(--yellow);   color: #000; }
:root[data-theme="light"] .btn-walkover { color: #fff; }   /* light --yellow ist dunkles Amber → schwarz unlesbar */

.walkover-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.walkover-buttons .btn-walkover { width: 100%; }

/* ===== Schedule inline start button (spielleiter) ===== */
.sched-tile-wrap { position: relative; }

.sched-start-form {
  /* lebt jetzt im .sched-tile-actions inline-flex container, kein absolutes
     Positioning mehr nötig. Bleibt klein und mittig zur Glocke. */
  margin: 0;
  display: inline-flex;
}

.sched-start-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--green-lt);
  background: var(--green);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.sched-start-btn:hover {
  background: var(--green-lt);
  transform: scale(1.08);
}

/* ===== Admin: User & Role Management ===== */
.users-search-bar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
}

.users-search-bar input[type="search"] {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
}

.users-search-bar input[type="search"]:focus {
  outline: none;
  border-color: var(--blue);
}

.users-search-count {
  font-size: 0.75rem;
  min-width: 4rem;
  text-align: right;
  white-space: nowrap;
}

.users-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.8rem;
}

.user-card-identity {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.user-card-email {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}

.user-card-name {
  font-size: 0.82rem;
  color: var(--muted);
}

/* Rollen-Dropdown ans Theme angepasst: appearance:none, sonst zeichnet macOS
   ein helles natives Control statt unseres dunklen; Chevron als inline-SVG. */
.role-select-form { display: inline-flex; align-items: center; flex-shrink: 0; }
.role-select {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem 1.75rem 0.35rem 0.65rem;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238b949e' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.role-select:hover:not(:disabled) { border-color: var(--muted); }
.role-select:focus { outline: none; border-color: var(--green-lt); box-shadow: 0 0 0 2px rgba(46, 160, 67, 0.25); }
.role-select:disabled { opacity: 0.5; cursor: default; }
.role-select option { background: var(--card); color: var(--text); }

/* Name ist klickbar = Spieler verknuepfen/aendern. Sieht aus wie der Name
   (gedaempft), Hover als Affordanz; "nicht zugewiesen" kursiv, wenn kein Name. */
.user-card-name-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.82rem;
  color: var(--muted);
  cursor: pointer;
}
.user-card-name-btn:hover { color: var(--text); text-decoration: underline; }
.user-card-name-btn.is-unassigned { font-style: italic; }

/* Nutzer-Seite Header: Zeile 1 Titel mittig + Bulk-Button rechts, Zeile 2 Zahl. */
/* Basis-.admin-header ist display:flex — hier auf Block, damit Titelzeile und
   Meta-Zeile untereinander stehen (nicht nebeneinander). */
.admin-users-page .admin-header { display: block; text-align: center; }
.admin-users-page .admin-header-row1 {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.4rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.admin-users-page .admin-header-row1 h1 { margin: 0; }
.admin-users-page .admin-header-invite {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  font-size: 1.3rem;
  line-height: 1;
}
.admin-users-page .admin-header-count { margin: 0.35rem 0 0; }
@media (max-width: 560px) {
  .admin-users-page .admin-header-invite {
    position: static;
    transform: none;
    margin-top: 0.5rem;
  }
}

.user-card-delete {
  margin-left: auto;
  flex-shrink: 0;
}

.btn-icon-danger {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0;
  transition: all 0.15s;
}

.btn-icon-danger:hover {
  border-color: var(--red);
  color: var(--red);
  background: rgba(218, 54, 51, 0.08);
}

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.55rem;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
}

.role-badge-player              { background: rgba(139,148,158,0.15); color: var(--muted); border-color: var(--border); }
.role-badge-scorekeeper         { background: rgba(31,111,235,0.15); color: var(--blue); border-color: var(--blue); }
.role-badge-mannschaftsfuehrer  { background: rgba(210,153,34,0.15); color: var(--yellow); border-color: var(--yellow); }
.role-badge-spielleiter         { background: rgba(46,160,67,0.15); color: var(--green-lt); border-color: var(--green-lt); }
.role-badge-super_admin         { background: rgba(218,54,51,0.15); color: var(--red); border-color: var(--red); }

.role-badge:hover { filter: brightness(1.2); }
.role-badge .role-scope { font-weight: 500; opacity: 0.8; text-transform: none; }
.role-badge .role-remove { font-size: 0.9rem; opacity: 0.6; margin-left: 0.15rem; }
.role-badge:hover .role-remove { opacity: 1; }

.user-card-grant {
  /* 2×2-Grid: die vier Rollen-Controls nebeneinander/untereinander statt
     Listen-Style. Jede Zelle ist Button + Beschreibung als vertikaler Stack. */
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.7rem;
  padding-top: 0.7rem;
  margin-top: 0.7rem;
  border-top: 1px dashed var(--border);
}

.grant-line {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
}

.grant-line .inline-form { margin: 0; }

.grant-line-btn {
  width: 100%;
  justify-content: center;
  text-align: center;
  white-space: normal;
}

.grant-line-explain {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.35rem;
  line-height: 1.3;
}

@media (max-width: 640px) {
  .user-card-grant { grid-template-columns: 1fr; }
}

.user-card-link-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--blue);
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 0.3rem;
}
.user-card-link-btn:hover { border-color: var(--blue); background: rgba(31,111,235,0.08); }

.link-player-dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  background: var(--card);
  color: var(--text);
  max-width: 520px;
  width: 92vw;
}
.link-player-dialog::backdrop { background: rgba(0, 0, 0, 0.55); }
.link-player-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.4rem;
}
.link-player-header h2 { margin: 0; font-size: 1.2rem; }
.link-player-dialog .claim-list { max-height: 300px; }

/* Profil-Seite: Foto-Preview oberhalb des Upload-Felds */
.profile-photo-preview {
  margin: 0.5rem 0;
}
.profile-photo-preview img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--border);
}

/* Bulk-Invite Preview-Tabelle */
.invite-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.invite-preview-table th,
.invite-preview-table td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.invite-preview-table th { color: var(--muted); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: .5px; }
.invite-preview-table code { font-size: 0.82rem; color: var(--muted); }

.invite-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
}
.invite-badge-ok       { background: rgba(35, 134, 54, 0.18);  color: var(--green); }
.invite-badge-new      { background: rgba(31, 111, 235, 0.18); color: var(--blue); }
.invite-badge-noop     { background: rgba(180, 180, 180, 0.2); color: var(--muted); }
.invite-badge-conflict { background: rgba(218, 54, 51, 0.18);  color: var(--red); }
.invite-row-conflict td { background: rgba(218, 54, 51, 0.04); }

/* ═══ Mannschaften Public-Tab ═══ */
.team-group { margin-top: 1.6rem; }
.team-group-title {
  font-size: 1rem;
  color: var(--text);
  margin: 0 0 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.7rem;
}
.team-card {
  display: block;
  padding: 0.9rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.1s;
}
.team-card:hover {
  border-color: var(--blue);
  transform: translateY(-1px);
}
.team-card-name { font-weight: 700; font-size: 1rem; }
.team-card-league { font-size: 0.82rem; color: var(--muted); margin-top: 0.2rem; }
.team-card-meta { font-size: 0.75rem; margin-top: 0.4rem; }

/* Mannschaft-Detail Header */
/* Mannschafts-Header: zweizeiliger Aufbau (Anton 2026-05-18).
   Zeile 1: kurzer Teamname + Herz + Glocke + Zahnrad (rechts).
   Zeile 2: voller Liganame als muted Subtitle. */
.mannschaft-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1rem;
}
.mannschaft-header-row1 {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}
.mannschaft-header-row1 .section-title { margin: 0; }
/* Verwalten-Button soll IMMER rechts in der Header-Zeile sitzen — auch
   wenn die Header-Items wrappen. margin-left:auto absorbiert allen freien
   Raum vor dem Button und pusht ihn an den rechten Rand. */
.mannschaft-header-row1 .manage-btn {
  margin-left: auto;
  flex-shrink: 0;
}
.mannschaft-header-row2 {
  font-size: 0.85rem;
  color: var(--muted);
  padding-left: 0.1rem;
}
.back-btn-inline {
  display: inline-block;
  /* Override the global absolute .back-btn so der Inline-Variant im normalen
     Flow steht (sonst Viewport-Corner-Overlap mit Headlines). */
  position: static;
  top: auto;
  left: auto;
  /* In Flex-Column-Containern nicht auf 100 % stretchen. */
  align-self: flex-start;
  padding: 0.35rem 0.7rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.back-btn-inline:hover { color: var(--text); border-color: var(--blue); }
.mannschaft-league { font-size: 0.9rem; }

/* Reusable tabs (Mannschaft-Detail, evtl. später woanders) */
.tabs {
  display: flex;
  gap: 0.4rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
.tab {
  background: none;
  border: none;
  color: var(--muted);
  padding: 0.6rem 0.9rem;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: inherit;
}
.tab:hover { color: var(--text); }
.tab.is-active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}
.tab-content { display: none; }
.tab-content.is-active { display: block; }

/* Meldeliste-Tabelle */
.meldeliste-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.meldeliste-table th,
.meldeliste-table td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.meldeliste-table th {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}
.meldeliste-table .ml-pos,
.meldeliste-table .ml-lk,
.meldeliste-table .ml-year { width: 5rem; color: var(--muted); }
.meldeliste-table .player-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
.meldeliste-table .player-link:hover { color: var(--blue); }
.meldeliste-table .ml-record { width: 3.2rem; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* nuLiga-Mirror: Tabelle + Spielplan */
.nuliga-table,
.nuliga-schedule {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.nuliga-table th,
.nuliga-table td,
.nuliga-schedule th,
.nuliga-schedule td {
  padding: 0.5rem 0.55rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.nuliga-table th,
.nuliga-schedule th {
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}
.nuliga-table .nl-rank { width: 2.2rem; color: var(--muted); text-align: center; }
.nuliga-table .nl-num,
.nuliga-schedule .nl-result {
  text-align: right;
  font-variant-numeric: tabular-nums;
  width: 3rem;
}
.nuliga-table th.nl-num,
.nuliga-schedule th.nl-result { text-align: right; }
.nuliga-table .nl-team,
.nuliga-schedule .nl-team { color: var(--text); }
.nuliga-schedule .nl-date {
  width: 9rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* TEC-eigene Zeile in Tabelle dezent hervorheben */
.nuliga-table tr.nl-row-self td,
.nuliga-schedule tr.nl-row-self td {
  background: rgba(32, 174, 189, 0.08);  /* var(--blue) at 8% */
}
.nuliga-table tr.nl-row-self .nl-team,
.nuliga-schedule tr.nl-row-self .nl-team-self {
  font-weight: 700;
  color: var(--blue);
}

/* Zukünftige Begegnungen visuell zurücknehmen */
.nuliga-schedule tr.nl-future td { color: var(--muted); }
.nuliga-schedule tr.nl-future.nl-row-self td { color: var(--text); }

.nuliga-stand {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.6rem;
  padding-top: 0.4rem;
}
.nuliga-stand a { color: var(--muted); text-decoration: underline; }
.nuliga-stand a:hover { color: var(--blue); }

/* Klickbares Match-Ergebnis im Spielplan → öffnet eigenen Spielbericht */
.nl-result-link {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dotted var(--muted);
}
.nl-result-link:hover {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

/* /nuliga/meeting/<id> erbt komplett vom .bg-*-Layout der lokalen
   Begegnungs-Seite (templates/begegnung.html) — kein zusätzliches CSS
   nötig. */

/* Rang-Badge im Mannschaft-Header */
.mannschaft-rank-pill {
  display: inline-block;
  margin-left: 0.6rem;
  padding: 0.15rem 0.55rem;
  background: rgba(32, 174, 189, 0.12);
  color: var(--blue);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Mobile: Spielplan-Datum-Spalte schmaler, kleinere Schriften */
@media (max-width: 600px) {
  .nuliga-table,
  .nuliga-schedule { font-size: 0.78rem; }
  .nuliga-table th,
  .nuliga-table td,
  .nuliga-schedule th,
  .nuliga-schedule td { padding: 0.4rem 0.35rem; }
  .nuliga-schedule .nl-date { width: 5.5rem; }
  /* Drop weniger wichtige Spalten auf Mobile, Kontext bleibt erhalten */
  .nuliga-table .nl-num:nth-of-type(8),  /* MP */
  .nuliga-table .nl-num:nth-of-type(9) { display: none; }  /* Sätze */
  .meldeliste-table .ml-record:nth-of-type(5),  /* Einzel */
  .meldeliste-table .ml-record:nth-of-type(6) { display: none; }  /* Doppel */
}

.grant-form {
  display: inline-flex;
  gap: 0.3rem;
  align-items: center;
}

.grant-team-sel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.4rem;
  color: var(--text);
  font-size: 0.78rem;
  font-family: inherit;
}

/* Mannschaftsführer-Dropdown (inline unter dem Button) */
.grant-mf-wrap {
  position: relative;
}

.grant-mf-dropdown,
.grant-sk-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 16rem;
  max-width: 24rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 0.8rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
  z-index: 50;
}

.grant-mf-dropdown[hidden],
.grant-sk-dropdown[hidden] { display: none; }

.mf-scope-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  background: rgba(210, 153, 34, 0.08);
  border: 1px solid rgba(210, 153, 34, 0.3);
  border-radius: 6px;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
}

.mf-scope-name {
  font-weight: 600;
  color: var(--text);
}

.mf-scope-remove {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.3rem;
}

.mf-scope-remove:hover { color: var(--red); }

.mf-empty {
  font-size: 0.82rem;
  margin-bottom: 0.5rem;
  padding: 0.3rem 0;
}

.mf-add-row {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--border);
}

.mf-add-row .grant-team-sel { flex: 1; }

.mf-error {
  color: var(--red);
  font-size: 0.8rem;
  min-height: 1em;
  margin-top: 0.5rem;
}

/* ===== Top-nav: User chip + Login button ===== */
.btn-login {
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--blue);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
}
.btn-login:hover { background: var(--blue); color: #fff; }

.user-menu {
  /* Kein position:relative — das Account-Menu soll am Nav-Bar-Rand sitzen
     (rechte Bildschirmkante) und nicht am User-Chip, sonst schiebt der
     Dev-Role-Switcher die Menu-Box nach links ins Off-Canvas. */
  flex-shrink: 0;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 14rem;
  cursor: pointer;
  font: inherit;
  line-height: 1.2;
  color: inherit;
  transition: border-color 0.15s;
}
.user-chip:hover,
.user-chip[aria-expanded="true"] {
  border-color: var(--blue);
}
.user-chip-email {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 9rem;
}
.user-chip-role {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--green-lt);
  background: rgba(46, 160, 67, 0.1);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Gast-Account-Chip (ausgeloggt): nur ein Avatar-Icon, kein Name/Rolle. */
.user-chip-guest { padding: 0.4rem; }
.user-chip-avatar { width: 22px; height: 22px; display: block; color: var(--muted); }
.user-chip-guest:hover .user-chip-avatar,
.user-chip-guest[aria-expanded="true"] .user-chip-avatar { color: var(--text); }
.account-menu-item.account-menu-login { color: var(--blue); font-weight: 600; }

/* Login-Hinweis-Karte (Mein-Bereich-Reiter, die einen Account brauchen). */
.login-hint-card {
  max-width: 30rem;
  margin: 2rem auto;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
}
.login-hint-icon { width: 40px; height: 40px; color: var(--muted); margin: 0 auto 0.6rem; display: block; }
.login-hint-btn { margin-top: 1.2rem; display: inline-block; width: auto; }

.account-menu {
  position: absolute;
  /* Positioniert relativ zur sticky top-nav-bar — right:0 meint jetzt den
     rechten Nav-Bar-Rand, nicht den User-Chip-Rand. */
  top: 100%;
  right: calc(0.6rem + env(safe-area-inset-right, 0px));
  min-width: 14rem;
  max-width: calc(100vw - 1.2rem - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
  margin-top: 0.3rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  padding: 0.35rem;
  z-index: 110;
}
.account-menu[hidden] { display: none; }

.account-menu-header {
  padding: 0.6rem 0.75rem 0.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.25rem;
}
.account-menu-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  overflow-wrap: anywhere;
}
.account-menu-email {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.15rem;
  overflow-wrap: anywhere;
}
.account-menu-role {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--green-lt);
  background: rgba(46, 160, 67, 0.1);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 0.4rem;
}

.account-menu-item {
  display: block;
  padding: 0.6rem 0.75rem;
  font-size: 0.88rem;
  color: var(--text);
  border-radius: calc(var(--radius) - 2px);
  text-decoration: none;
}
.account-menu-item:hover { background: var(--bg); }
.account-menu-item.is-active { background: var(--bg); color: var(--blue); font-weight: 600; }
.account-menu-logout { color: var(--red); font-weight: 600; }
.account-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 0.4rem 0;
}
.account-menu-group-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 0.5rem 0.9rem 0.2rem;
}
/* Mitglieder-Import in der Nutzerverwaltung */
.admin-import-form { display: flex; flex-direction: column; gap: 0.6rem; margin: 0.5rem 0 0.8rem; }
.admin-import-area { width: 100%; min-height: 8rem; padding: 0.6rem 0.7rem; border: 1px solid var(--border);
  border-radius: 9px; background: var(--card); color: var(--text); font-size: 0.9rem; font-family: inherit; }
.admin-import-check { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.85rem; }
.admin-import-sep { border: 0; border-top: 1px solid var(--border); margin: 1.2rem 0; }
.users-search-bar #users-role-filter,
.users-search-bar #users-mbr-filter { min-width: 8.5rem; }

/* ===== Nutzerverwaltung: Tabelle ===== */
.users-table-wrap { overflow-x: auto; }
.users-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.users-table th, .users-table td {
  padding: 0.5rem 0.7rem; text-align: left; border-bottom: 1px solid var(--border);
  white-space: nowrap; vertical-align: middle;
}
.users-table thead th {
  color: var(--muted); font-weight: 700; font-size: 0.8rem; text-transform: uppercase;
  letter-spacing: 0.03em; border-bottom: 1.5px solid var(--border);
}
.users-table th.sortable { cursor: pointer; user-select: none; }
.users-table th.sortable:hover { color: var(--text); }
.users-table th.is-sorted { color: var(--text); }
.users-table .sort-arrow { opacity: 0.55; font-size: 0.82em; margin-left: 0.15rem; }
.users-table th.is-sorted .sort-arrow { opacity: 1; }
.users-table td.u-num { text-align: right; font-variant-numeric: tabular-nums; }
.users-table th.u-num { text-align: right; }
.users-table .u-email { font-weight: 600; }
.users-table .u-name.is-unassigned { color: var(--muted); font-style: italic; }
.users-table .u-open.has-open { color: var(--yellow); font-weight: 600; }
.users-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.users-table .u-actions { width: 1%; text-align: right; }
/* Pager oben rechts (Zahlen + Pfeile) */
/* Admin: Nutzer-Verlauf (Buchungshistorie + Gruppen) */
.uh-groups { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.uh-group { padding: 0.25rem 0.7rem; border: 1px solid var(--border); border-left-width: 3px;
  border-radius: 999px; font-size: 0.85rem; font-weight: 600; background: var(--card); }
.users-table tr.uh-cancelled { opacity: 0.5; text-decoration: line-through; }

.users-pager { display: flex; align-items: center; justify-content: flex-end; gap: 0.25rem;
  flex-wrap: wrap; margin: 0 0 0.6rem; }
.users-page-num, .users-page-arrow {
  min-width: 2rem; height: 2rem; padding: 0 0.5rem; border: 1px solid var(--border);
  border-radius: 8px; background: var(--card); color: var(--text); cursor: pointer;
  font-size: 0.88rem; font-variant-numeric: tabular-nums; line-height: 1; }
.users-page-num:hover:not(.is-current), .users-page-arrow:hover:not(:disabled) { border-color: var(--muted); }
.users-page-num.is-current { background: var(--green); border-color: var(--green-lt); color: #fff; font-weight: 700; cursor: default; }
.users-page-arrow:disabled { opacity: 0.35; cursor: default; }
.users-page-ellip { color: var(--muted); padding: 0 0.2rem; }
/* „Pro Seite"-Auswahl unten links */
.users-bottombar { display: flex; align-items: center; gap: 0.5rem; margin: 0.8rem 0 0.2rem;
  color: var(--muted); font-size: 0.88rem; }
.users-pagesize { min-width: 5rem; }

/* ── Mobile-Safeguards für die neuen Bereiche (Task 9) ── */
@media (max-width: 640px) {
  .bv-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .bv-tab { flex: 0 0 auto; }
  .users-pager { justify-content: center; }
  .users-search-bar input[type="search"] { flex: 1 1 100%; }
  .users-search-bar #users-role-filter,
  .users-search-bar #users-mbr-filter { flex: 1 1 auto; }
  .pay-cards { gap: 0.5rem; }
  .pay-card { flex: 1 1 42%; min-width: 0; }
  .cam-modal, .gift-modal { width: 96vw; }
  .tour-tip { max-width: 92vw; }
  .settings-form, .tour-list, .tour-list-actions { max-width: 100%; }
  .msg-toolbar { flex-direction: column; align-items: stretch; }
  .msg-toolbar .role-select { min-width: 0; width: 100%; }
}
/* Toast-Bestätigung (AJAX-Speichern ohne Reload) */
.users-toast { position: fixed; left: 50%; bottom: 1.4rem; transform: translateX(-50%) translateY(1rem);
  background: var(--green); color: #fff; padding: 0.6rem 1.1rem; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4); font-size: 0.9rem; font-weight: 600; z-index: 300;
  opacity: 0; pointer-events: none; transition: opacity 0.18s ease, transform 0.18s ease; }
.users-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.users-toast.is-err { background: var(--red); }

/* Geführte Rundgänge / Tutorials */
.tour-ov { position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 9000; }
.tour-box { position: absolute; z-index: 9001; border: 2px solid var(--green-lt); border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.55); pointer-events: none; transition: all 0.2s ease; }
.tour-tip { position: absolute; z-index: 9002; max-width: 390px; max-height: 72vh; overflow-y: auto;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.1rem;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5); }
.tour-tip-title { font-weight: 800; font-size: 1.02rem; margin-bottom: 0.3rem; }
.tour-tip-text { color: var(--text); font-size: 0.92rem; line-height: 1.5; }
.tour-tip-text b, .tour-tip-text strong { color: var(--text); font-weight: 700; }
.tour-tip-text p { margin: 0.5rem 0 0; }
.tour-tip-text ul { margin: 0.4rem 0 0; padding-left: 1.15rem; }
.tour-tip-text li { margin: 0.2rem 0; }
.tour-tip-text .tour-hl { color: var(--green-lt); font-weight: 700; }
.tour-tip-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-top: 0.9rem; flex-wrap: wrap; }
.tour-tip-count { color: var(--muted); font-size: 0.78rem; white-space: nowrap; flex: 0 0 auto; }
.tour-tip-btns { display: flex; gap: 0.4rem; flex: 0 0 auto; margin-left: auto; }
.tour-btn { padding: 0.4rem 0.8rem; border-radius: 8px; border: 1px solid var(--green-lt);
  background: var(--green); color: #fff; font-size: 0.85rem; font-weight: 700; cursor: pointer; }
.tour-btn-ghost { background: transparent; color: var(--muted); border-color: var(--border); }
.tour-btn-ghost:hover { color: var(--text); }
/* Rundgänge-Auswahlseite */
.tour-group-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); font-weight: 700; margin: 1rem 0 0.2rem; }
.tour-list { display: flex; flex-direction: column; gap: 0.6rem; margin: 0.4rem 0 1.2rem; max-width: 560px; }
.tour-choice { display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem 0.9rem;
  border: 1px solid var(--border); border-radius: 10px; background: var(--card); }
.tour-choice > span { flex: 1; font-weight: 600; }
.tour-list-actions { max-width: 560px; }
button.tour-card { width: 100%; text-align: left; cursor: pointer; color: var(--text);
  font: inherit; transition: border-color .12s, background .12s; }
button.tour-card:hover { border-color: var(--green-lt); background: var(--card-hover, var(--card)); }
button.tour-card:focus-visible { outline: 2px solid var(--green-lt); outline-offset: 2px; }
.tour-card .tour-go { flex: 0 0 auto; color: var(--muted); font-weight: 700; }
button.tour-card:hover .tour-go { color: var(--green-lt); }

/* Schiebe-Schalter (an/aus) — z. B. Formular sichtbar/versteckt */
.tv-switch { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; user-select: none; }
.tv-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.tv-switch .tv-switch-track { position: relative; flex: 0 0 auto; width: 40px; height: 22px;
  border-radius: 999px; background: var(--border); transition: background 0.15s; }
.tv-switch .tv-switch-track::after { content: ""; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.35); }
.tv-switch input:checked + .tv-switch-track { background: var(--green); }
.tv-switch input:checked + .tv-switch-track::after { transform: translateX(18px); }
.tv-switch input:focus-visible + .tv-switch-track { outline: 2px solid var(--green-lt); outline-offset: 2px; }
.tv-switch .tv-switch-lbl { font-size: 0.82rem; color: var(--muted); min-width: 62px; }

/* Nav-Tab, der nur für Super-Admins sichtbar ist (Feature noch nicht freigegeben) */
.nav-tab-adminonly { position: relative; }
.nav-adminonly-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--yellow, #d29922); margin-left: 5px; vertical-align: middle; }

/* Kebab-Menü (⋯) — kompaktes Aktions-Dropdown ohne JS (native <details>) */
.kebab { position: relative; display: inline-block; }
.kebab > summary { list-style: none; cursor: pointer; width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; line-height: 1; }
.kebab > summary::-webkit-details-marker { display: none; }
.kebab > summary:hover { border-color: var(--green-lt); }
.kebab[open] > summary { border-color: var(--green-lt); }
.kebab-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 50; min-width: 168px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 0.3rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3); display: flex; flex-direction: column; gap: 0.1rem; }
.kebab-item { display: block; width: 100%; text-align: left; padding: 0.5rem 0.7rem; border-radius: 6px;
  font-size: 0.88rem; color: var(--text); text-decoration: none; background: none; border: none; cursor: pointer; }
.kebab-item:hover { background: rgba(127,127,127,0.12); }
.kebab-item-danger { color: #d0555c; }
.kebab-item-danger:hover { background: rgba(208,85,92,0.12); }

/* Nutzer-Einstellungen */
.settings-form { max-width: 560px; }
.settings-head { margin: 1.4rem 0 0.4rem; font-size: 1.05rem; }
.settings-toggle { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0; font-size: 0.92rem; }
.settings-sub { margin: 0.2rem 0 0.4rem 0.4rem; padding-left: 0.8rem; border-left: 2px solid var(--border); }
.settings-actions { margin-top: 1.2rem; }

/* Mitteilungszentrale (Persönlich-Reiter) */
.news-unread-dot { display: inline-block; min-width: 1.1rem; padding: 0 0.3rem; border-radius: 999px;
  background: var(--red); color: #fff; font-size: 0.7rem; font-weight: 700; line-height: 1.1rem; text-align: center; }
.msg-toolbar { display: flex; gap: 0.6rem; align-items: center; justify-content: space-between;
  flex-wrap: wrap; margin-bottom: 0.8rem; }
.msg-toolbar .role-select { min-width: 9rem; }
.msg-list { display: flex; flex-direction: column; gap: 0.5rem; }
.msg-item { display: block; padding: 0.7rem 0.9rem; border: 1px solid var(--border); border-radius: 10px;
  background: var(--card); color: var(--text); }
.msg-item:hover { border-color: var(--muted); }
.msg-item.is-unread { border-left: 3px solid var(--green-lt); background: rgba(46,160,67,0.06); }
.msg-item-head { display: flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; color: var(--muted); }
.msg-type { text-transform: uppercase; letter-spacing: 0.03em; font-weight: 700; }
.msg-date { margin-left: auto; }
.msg-dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--green-lt); }
.msg-title { font-weight: 700; margin-top: 0.2rem; }
.msg-body { color: var(--muted); font-size: 0.9rem; margin-top: 0.15rem; }

/* Mein Bereich → Zahlungen */
.pay-cards { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 0.4rem 0 1rem; }
.pay-card { display: flex; flex-direction: column; gap: 0.25rem; min-width: 8rem;
  padding: 0.9rem 1.1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.pay-card-lbl { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.pay-card-val { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.pay-card-open { border-color: var(--yellow); }
.pay-card-open .pay-card-val { color: var(--yellow); }
/* Aufladen als kompakte Karte neben dem Guthaben (Input + kurzer Button, kein Umbruch) */
.pay-topup-card { justify-content: space-between; }
.pay-topup-row { display: flex; gap: 0.4rem; align-items: center; margin-top: 0.1rem; }
.pay-topup-in { width: 5.5rem; min-width: 0; padding: 0.45rem 0.5rem; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg); color: var(--text); font-size: 1.15rem; font-weight: 700;
  font-variant-numeric: tabular-nums; }
.pay-topup-btn { white-space: nowrap; flex-shrink: 0; }
.pay-subhead { margin: 1.6rem 0 0.6rem; font-size: 1.05rem; }
.pay-table-wrap { overflow-x: auto; }
.pay-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.pay-table th, .pay-table td { padding: 0.5rem 0.7rem; text-align: left; border-bottom: 1px solid var(--border); }
.pay-table thead th { color: var(--muted); font-weight: 700; font-size: 0.78rem; text-transform: uppercase; }
.pay-table .pay-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pay-date { color: var(--muted); white-space: nowrap; }
.pay-plus { color: var(--green-lt); font-weight: 700; }
.pay-minus { color: var(--text); }
.pay-beleg { color: var(--blue); font-weight: 600; }

/* Beleg (druckbar) */
.beleg-actions { display: flex; gap: 0.6rem; margin-bottom: 1.2rem; }
.beleg { max-width: 520px; border: 1px solid var(--border); border-radius: 12px; padding: 1.4rem; background: var(--card); }
.beleg-head { display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 2px solid var(--border); padding-bottom: 0.7rem; margin-bottom: 1rem; }
.beleg-club { font-weight: 800; font-size: 1.1rem; }
.beleg-title { color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.85rem; }
.beleg-tbl { width: 100%; border-collapse: collapse; }
.beleg-tbl td { padding: 0.45rem 0.2rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.beleg-tbl td:first-child { color: var(--muted); width: 38%; }
.beleg-amount td { font-weight: 800; font-size: 1.15rem; border-bottom: 0; padding-top: 0.8rem; }
.beleg-foot { margin-top: 1rem; color: var(--muted); font-size: 0.82rem; }
@media print {
  .no-print, .nav-tabs, .nav-bar, .bottom-nav, .account-menu, header, nav { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .beleg { border-color: #000; box-shadow: none; max-width: 100%; }
}

/* Mitglied/Gast-Badge (farbcodiert) */
.mbadge {
  display: inline-block; padding: 0.12rem 0.55rem; border-radius: 999px;
  font-size: 0.78rem; font-weight: 700; border: 1px solid transparent; line-height: 1.5;
}
.mbadge-mitglied { background: rgba(46,160,67,0.16);  color: var(--green-lt); border-color: var(--green-lt); }
.mbadge-inaktiv  { background: rgba(139,148,158,0.22); color: #b9c0c9;          border-color: #8b949e; }
:root[data-theme="light"] .mbadge-inaktiv { color: #59636e; }   /* helle Schrift war auf hellem Grund unlesbar */
:root[data-theme="light"] .mbadge-offen   { color: #b45309; }
.mbadge-gast     { background: rgba(31,111,235,0.16); color: var(--blue);     border-color: var(--blue); }
.mbadge-offen    { background: rgba(217,119,6,0.18);  color: #f0a04b;          border-color: #d97706; }
.mbadge-none     { background: rgba(139,148,158,0.12);color: var(--muted);     border-color: var(--border); }

/* Zeilen-Menü (⋮) */
.row-menu { position: relative; display: inline-block; }
.row-menu > summary {
  list-style: none; cursor: pointer; padding: 0.15rem 0.5rem; border-radius: 7px;
  color: var(--muted); font-size: 1.15rem; line-height: 1;
}
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu > summary:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.row-menu-pop {
  position: absolute; right: 0; top: 100%; z-index: 30; margin-top: 0.2rem;
  min-width: 12rem; background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.45); padding: 0.3rem;
  display: flex; flex-direction: column;
}
.row-menu-form { margin: 0; }
.row-menu-item {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  color: var(--text); padding: 0.5rem 0.6rem; border-radius: 7px; font-size: 0.88rem;
  cursor: pointer; font-family: inherit;
}
.row-menu-item:hover { background: rgba(255,255,255,0.07); }
.row-menu-danger { color: var(--red); }
.row-menu-danger:hover { background: rgba(218,54,51,0.14); }

/* Bearbeiten-/Guthaben-Dialog Felder */
.edit-user-form .edit-field { display: flex; flex-direction: column; gap: 0.3rem; margin: 0.7rem 0; }
.edit-user-form .edit-field > span:first-child { font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.edit-user-form input[type="text"], .edit-user-form input[type="number"] {
  padding: 0.5rem 0.6rem; border: 1px solid var(--border); border-radius: 9px;
  background: var(--card); color: var(--text); font-size: 0.92rem; font-family: inherit;
}
.edit-user-form input:focus { outline: none; border-color: var(--green-lt);
  box-shadow: 0 0 0 2px rgba(46,160,67,0.25); }

/* Inline-Badge-Dropdowns (Rolle + Mitglied/Gast) direkt in der Tabelle */
.inline-select-form { display: inline-flex; margin: 0; }
select.role-badge-select, select.mbadge-select {
  -webkit-appearance: none; appearance: none; cursor: pointer;
  padding: 0.14rem 1.35rem 0.14rem 0.55rem; line-height: 1.5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%238b949e' stroke-width='1.5'/></svg>");
  background-repeat: no-repeat; background-position: right 0.45rem center;
  max-width: 12rem;
}
select.role-badge-select:hover, select.mbadge-select:hover { filter: brightness(1.18); }
select.role-badge-select:focus, select.mbadge-select:focus {
  outline: none; box-shadow: 0 0 0 2px rgba(46,160,67,0.3);
}
select.role-badge-select:disabled, select.mbadge-select:disabled { cursor: default; opacity: 0.6; }
select.role-badge-select option, select.mbadge-select option { background: var(--card); color: var(--text); }
/* „nicht registriert"-Flag in der Rollen-Spalte (kein Dropdown) */
.role-badge-unreg { background: transparent; color: var(--muted);
  border: 1px dashed var(--border); font-weight: 600; }
/* Import: Auto-Scorekeeper-Auswahl-Zeile */
.admin-import-selrow { display: inline-flex; align-items: center; gap: 0.6rem;
  font-size: 0.9rem; color: var(--text); }
.admin-import-selrow .role-select { min-width: 9rem; }

/* CSV-Import */
.admin-file-label { display: inline-block; }
.admin-file-label input[type="file"] {
  font-size: 0.88rem; color: var(--muted); font-family: inherit;
  max-width: 100%;
}
.admin-file-label input[type="file"]::file-selector-button {
  margin-right: 0.7rem; padding: 0.5rem 0.9rem; border: 1px solid var(--green-lt);
  border-radius: 9px; background: rgba(46,160,67,0.14); color: var(--green-lt); cursor: pointer;
  font-family: inherit; font-size: 0.85rem; font-weight: 700;
  transition: filter 0.12s ease;
}
.admin-file-label input[type="file"]::-webkit-file-upload-button {
  margin-right: 0.7rem; padding: 0.5rem 0.9rem; border: 1px solid var(--green-lt);
  border-radius: 9px; background: rgba(46,160,67,0.14); color: var(--green-lt); cursor: pointer;
  font-family: inherit; font-size: 0.85rem; font-weight: 700;
}
.admin-file-label input[type="file"]::file-selector-button:hover { filter: brightness(1.25); }
.admin-file-label input[type="file"]::-webkit-file-upload-button:hover { filter: brightness(1.25); }
.import-paste-alt { margin: 0.4rem 0 0.8rem; }
.import-paste-alt > summary { cursor: pointer; color: var(--muted); font-size: 0.88rem;
  padding: 0.4rem 0; user-select: none; }
.import-paste-alt > summary:hover { color: var(--text); }

/* Import-Vorschau */
.import-preview-stats { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 0.4rem 0 2rem; }
.ips-card { display: flex; flex-direction: column; gap: 0.3rem; min-width: 6.5rem;
  padding: 0.9rem 1.1rem; border: 1px solid var(--border); border-radius: 12px;
  background: var(--card); }
.ips-num { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ips-lbl { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.ips-mitglied { border-color: var(--green-lt); }
.ips-mitglied .ips-num { color: var(--green-lt); }
.ips-gast { border-color: var(--blue); }
.ips-gast .ips-num { color: var(--blue); }
.ips-skip { border-color: #d97706; }
.ips-skip .ips-num { color: #f0a04b; }
.import-skip-details { margin: 0 0 1.6rem; }
.import-skip-details > summary { cursor: pointer; color: #f0a04b; font-size: 0.85rem; padding: 0.3rem 0; }
.import-skip-list { margin: 0.5rem 0 0; padding-left: 1.2rem; color: var(--muted); font-size: 0.82rem;
  max-height: 12rem; overflow-y: auto; line-height: 1.6; }
.import-preview-heading { margin: 2rem 0 0.8rem; }
.import-commit-form { margin-top: 2rem; padding-top: 1.4rem; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 1rem; }
.import-commit-form .admin-import-check { font-size: 0.9rem; }
.import-commit-actions { display: flex; gap: 0.7rem; align-items: center; margin-top: 0.2rem; }

/* Backend-Subnav (geteilt: Buchungs-Backend + Nutzerverwaltung) */
/* Backend-Tabs als EIN horizontaler Streifen (nicht mehr umbrechend) — konsistent
   mit .admin-subnav; scrollt seitlich statt zu stapeln. */
.bv-tabs { display:flex; gap:.3rem; border-bottom:1px solid var(--border); margin:0 0 1.2rem;
           flex-wrap:nowrap; overflow-x:auto; overscroll-behavior:contain;
           -webkit-overflow-scrolling:touch; scrollbar-width:none; }
.bv-tabs::-webkit-scrollbar { display:none; }
.bv-tab { flex:0 0 auto; padding:.55rem .9rem; font-weight:700; font-size:.92rem; color:var(--muted);
          border-bottom:2px solid transparent; margin-bottom:-1px; white-space:nowrap; }
.bv-tab:hover { color:var(--text); }
.bv-tab.is-active { color:var(--text); border-bottom-color:var(--green-lt); }
/* Abschnitts-Überschrift innerhalb eines Backend-Tabs (z. B. „Sonderregeln") */
.bv-section-title { margin: 2rem 0 0.8rem; font-size: 1.15rem; font-weight: 800;
  padding-top: 1.4rem; border-top: 1px solid var(--border); }

/* Kamera-Vorschau (Testbild im Kameras-Tab) */
.cam-preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem; margin-top: 0.6rem; }
.cam-preview { border: 1px solid var(--border); border-radius: 12px; padding: 0.8rem; background: var(--card); }
.cam-preview-head { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.6rem; }
.cam-preview-video { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 9px; display: block; }
.cam-preview-btn { width: 100%; }
.cam-controls { margin-top: 0.7rem; display: flex; flex-direction: column; gap: 0.6rem; }
.cam-ctl { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.cam-ctl-lbl { font-weight: 700; min-width: 4.5rem; }
.cam-zoom-btn { min-width: 2.6rem; font-size: 1.1rem; font-weight: 700; user-select: none; touch-action: none; }
.cam-ctl-color { flex-direction: column; align-items: stretch; }
.cam-slider { display: flex; align-items: center; justify-content: space-between; gap: 0.7rem; font-size: 0.85rem; }
.cam-slider input[type=range] { flex: 1; max-width: 60%; }
.cam-ctl-msg { min-height: 1.1em; color: var(--green-lt); }

/* Gutschein: Geschenk-Icon (FAB) + Kauf-Popup */
.gift-fab { position: fixed; right: 1.2rem; bottom: 1.4rem; z-index: 150;
  width: 3.4rem; height: 3.4rem; border-radius: 50%; border: 1px solid var(--green-lt);
  background: var(--green); color: #fff; font-size: 1.5rem; cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; }
.gift-fab:hover { filter: brightness(1.1); }
@media (max-width: 780px) { .gift-fab { bottom: 5rem; } }  /* über der Bottom-Nav */
.gift-modal-back { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 200;
  display: none; align-items: center; justify-content: center; padding: 1rem; }
.gift-modal-back.open { display: flex; }
.gift-modal { background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  width: min(460px, 96vw); max-height: 92vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.gift-modal-head { display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.2rem; border-bottom: 1px solid var(--border); }
.gift-modal-head h2 { margin: 0; font-size: 1.1rem; }
.gift-modal-head button { background: none; border: 0; color: var(--muted); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.gift-modal-head button:hover { color: var(--text); }
.gift-form { padding: 1.2rem; display: flex; flex-direction: column; gap: 0.9rem; }
.gift-field { display: flex; flex-direction: column; gap: 0.3rem; }
.gift-field > span:first-child { font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.gift-radios { display: flex; gap: 1rem; flex-wrap: wrap; }
.gift-foot { display: flex; gap: 0.6rem; align-items: center; margin-top: 0.4rem; }

/* Kamera-Konfigurations-Popup */
.cam-modal-back { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 200;
  display: none; align-items: center; justify-content: center; padding: 1rem; }
.cam-modal-back.open { display: flex; }
.cam-modal { background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  width: min(920px, 96vw); max-height: 92vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.cam-modal-head { display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.2rem; border-bottom: 1px solid var(--border); }
.cam-modal-head h2 { margin: 0; font-size: 1.15rem; }
.cam-modal-head button { background: none; border: 0; color: var(--muted); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.cam-modal-head button:hover { color: var(--text); }
.cam-modal-body { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.2rem; padding: 1.2rem; }
.cam-cfg-video { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; display: block; }
.cam-modal-right { display: flex; flex-direction: column; gap: 1rem; }
.cam-cfg-sec { display: flex; flex-direction: column; gap: 0.5rem; padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border); }
.cam-cfg-msg { min-height: 1.1em; color: var(--green-lt); }
.cam-cfg-foot { display: flex; gap: 0.6rem; margin-top: auto; }
@media (max-width: 680px) {
  .cam-modal-body { grid-template-columns: 1fr; }
}

/* Regencam (Standbilder für alle) */
.rc-wrap { max-width: 1100px; margin: 0 auto; padding: 1rem; }
.rc-head { margin-bottom: 1.2rem; }
.rc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.1rem; }
.rc-card { margin: 0; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--card); }
.rc-imgwrap { position: relative; aspect-ratio: 16 / 9; background: #0a0d12; }
.rc-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rc-img.rc-img-err { display: none; }
.rc-noimg { display: none; position: absolute; inset: 0; align-items: center; justify-content: center;
  color: var(--muted); font-size: 0.9rem; }
.rc-img-err + .rc-noimg { display: flex; }
.rc-cap { padding: 0.6rem 0.8rem; font-weight: 700; }
.rc-refnote { margin-top: 1rem; text-align: center; }

/* Sponsor-Admin-Dashboard */
.sponsor-summary-head {
  display: flex; align-items: center; gap: 0.6rem;
  margin-bottom: 0.4rem;
}
.sponsor-active-pill {
  background: var(--green); color: #fff;
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.5px;
  padding: 0.15rem 0.55rem; border-radius: 999px;
  text-transform: uppercase;
}
.sponsor-inactive-pill {
  background: var(--border); color: var(--muted);
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.5px;
  padding: 0.15rem 0.55rem; border-radius: 999px;
  text-transform: uppercase;
}
.sponsor-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.6rem;
  margin: 0.8rem 0;
}
.sponsor-stat-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
}
.sponsor-stat-label {
  font-size: 0.72rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  font-weight: 600;
}
.sponsor-stat-value {
  font-size: 1.6rem; font-weight: 800; color: var(--text);
  margin-top: 0.2rem; font-variant-numeric: tabular-nums;
}
.sponsor-daily-table {
  width: 100%; max-width: 400px;
  border-collapse: collapse; font-size: 0.88rem;
}
.sponsor-daily-table th, .sponsor-daily-table td {
  padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--border);
}
.sponsor-daily-table th { background: var(--bg); font-weight: 600; }
.sponsor-daily-table td.num, .sponsor-daily-table th.num {
  text-align: right; font-variant-numeric: tabular-nums;
}

/* Bell-Button-Position im Tournament-Header (kleiner Inline-Block rechts oben) */
.tournament-header { position: relative; }
.tournament-header-actions {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
/* Den Header-Inhalt nicht unter die absolute platzierte Actions-Box
   laufen lassen — padding-right reserviert Platz, das auto-fit-JS auf
   .tournament-name macht den Rest wenn der Name lang ist. */
.tournament-page .tournament-name { padding-right: 11rem; }
.tournament-page .tournament-meta { padding-right: 11rem; }
@media (max-width: 640px) {
  /* Auf Mobile zeigen wir nur das Zahnrad-Icon, Text ausblenden — spart
     Platz im engen Header, Funktion bleibt erhalten. */
  .tournament-page .tournament-header-actions .manage-btn-text { display: none; }
  /* Padding-Reservierung neben den Actions wird kleiner, weil ohne Text. */
  .tournament-page .tournament-name { padding-right: 5rem; }
  .tournament-page .tournament-meta { padding-right: 5rem; }
}
.tournament-header-bell {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
}

/* Featured-Tournament-Nav-Tab: dezenter Highlight (linke + rechte
   blaue Border) damit er als „besonderes Event" auffällt aber nicht schreit.
   Wird automatisch eingeblendet wenn ein Turnier in den nächsten 7 Tagen
   ansteht / läuft / vor ≤ 2 Tagen geendet hat. */
.nav-tab-featured {
  position: relative;
  font-weight: 700;
}
.nav-tab-featured.is-active {
  color: var(--blue);
}

/* Featured-Tournament-Card: prominenter Block oben auf /live wenn ein Turnier
   in den nächsten 7 Tagen startet, läuft, oder gerade beendet ist. */
.tournament-feature {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.2rem;
  margin: 1rem 0 1.5rem;
  background: linear-gradient(135deg, rgba(31,111,235,0.12), rgba(31,111,235,0.04));
  border: 1px solid var(--blue);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tournament-feature:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(31, 111, 235, 0.2);
}
.tournament-feature.is-running {
  background: linear-gradient(135deg, rgba(34,197,94,0.16), rgba(34,197,94,0.04));
  border-color: var(--green);
}
.tournament-feature.is-recent { opacity: 0.85; }
.tournament-feature-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.tournament-feature-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  margin-bottom: 0.2rem;
}
.tournament-feature.is-running .tournament-feature-badge { background: var(--green); }
.tournament-feature-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.tournament-feature-meta {
  font-size: 0.82rem;
}
.tournament-feature-arrow {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--blue);
  flex-shrink: 0;
}

/* Sponsor-Banner — bewusst dezent, schmaler Strip unter Top-Nav.
   "präsentiert von" in muted color, Sponsor-Name in Akzentfarbe. Klick führt
   zur Sponsor-Profil-Seite. */
.sponsor-bar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0.45rem 1rem;
  text-align: center;
  font-size: 0.8rem;
}
.sponsor-bar-link {
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.3px;
}
.sponsor-bar-link:hover { color: var(--text); }
.sponsor-bar-prefix {
  text-transform: uppercase;
  font-weight: 600;
  margin-right: 0.45rem;
  letter-spacing: 0.6px;
  font-size: 0.7rem;
}
.sponsor-bar-name {
  color: var(--blue);
  font-weight: 700;
  font-size: 0.9rem;
}
.sponsor-bar-img {
  max-height: 46px;
  max-width: 100%;
  vertical-align: middle;
  object-fit: contain;
}

/* ── Sponsoren-CRM (Admin) ── */
.sponsor-list { display: flex; flex-direction: column; gap: 0.6rem; }
.sponsor-card {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 0.8rem 1rem;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  text-decoration: none; color: var(--text);
}
.sponsor-card:hover { border-color: var(--blue); }
.sponsor-card-logo {
  width: 52px; height: 52px; flex: 0 0 52px;
  border-radius: 10px; overflow: hidden;
  background: var(--bg); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.sponsor-card-logo img { width: 100%; height: 100%; object-fit: contain; }
.sponsor-card-logo-fallback { font-weight: 800; color: var(--muted); font-size: 1.1rem; }
.sponsor-card-body { flex: 1 1 auto; min-width: 0; }
.sponsor-card-name { font-weight: 700; font-size: 1.02rem; }
.sponsor-card-meta { font-size: 0.8rem; margin-top: 0.15rem; }
.sponsor-card-nums { font-size: 0.78rem; text-align: right; flex: 0 0 auto; }

.order-list { display: flex; flex-direction: column; gap: 0.8rem; }
.order-card {
  padding: 0.9rem 1rem;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
}
.order-card-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.order-card-title { font-weight: 700; }
.order-type-pill {
  background: var(--blue); color: #fff;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.4px; padding: 0.15rem 0.5rem; border-radius: 999px;
}
.order-card-meta { font-size: 0.8rem; margin-top: 0.5rem; line-height: 1.5; }
.order-asset-preview {
  margin-top: 0.6rem; padding: 0.5rem; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--border); text-align: center;
}
.order-asset-preview img { max-width: 100%; max-height: 70px; object-fit: contain; }

.app-dialog {
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--card); color: var(--text);
  padding: 1.3rem; max-width: 460px; width: calc(100% - 2rem);
}
.app-dialog::backdrop { background: rgba(0,0,0,0.5); }

/* Inline-Formulare (Sponsor/Auftrag anlegen) — volle Breite, ein Feld je Angabe */
.form-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.8rem 1rem;
}
.form-field { display: flex; flex-direction: column; min-width: 0; }
.form-field > label { font-size: 0.85rem; font-weight: 600; margin-bottom: 0.25rem; }
.form-field-full { grid-column: 1 / -1; }
.form-field input, .form-field textarea, .form-field select {
  width: 100%; padding: 0.55rem 0.65rem;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text);
  font: inherit; box-sizing: border-box;
}
.form-field textarea { resize: vertical; }
.order-form-panel {
  padding: 1rem; border: 1px solid var(--border); border-radius: 12px;
  background: var(--bg);
}
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

/* Sponsor-Watermark: nicht-klickbares Logo-Overlay über Stream/VOD-Player */
.stream-watermark {
  position: absolute; z-index: 6; pointer-events: none;
  width: 9%; max-width: 110px; min-width: 56px; height: auto;
}
.stream-watermark img { display: block; width: 100%; height: auto;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.45)); }
/* Nur obere Ecken — unten läge das Mark überm Platz. Alt-Aufträge mit
   bl/br werden serverseitig auf tl gezwungen. Fester Top-Offset, damit das
   Mark NICHT mit der Live-Badge / dem „← Alle Plätze"-Button (beide oben links)
   kollidiert. */
.stream-watermark-tl { top: 3rem; left: 6%; }
.stream-watermark-tr { top: 3rem; right: 6%; }
/* Vollbild (/live, /vod): Video ist object-fit:contain → bei breiten Fenstern
   Letterbox oben/unten. Watermark weiter runter, damit's aufs Bild fällt und
   nicht über den oberen Rand ragt. */
.court-video-wrap .stream-watermark-tl,
.court-video-wrap .stream-watermark-tr { top: 9%; }

/* Preroll-Overlay über dem Player */
.preroll-layer {
  position: absolute; inset: 0; z-index: 30; background: #000;
  display: flex; align-items: center; justify-content: center;
}
.preroll-layer video { width: 100%; height: 100%; object-fit: contain; }
.preroll-bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: 0.6rem; padding: 0.7rem 1rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.65));
}
.preroll-tag { color: #fff; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.3px; }
.preroll-btn {
  background: rgba(255,255,255,0.92); color: #111; border: none; border-radius: 6px;
  padding: 0.4rem 0.75rem; font-weight: 700; font-size: 0.82rem; cursor: pointer;
}
.preroll-btn:hover { background: #fff; }

/* Court-Scoring-Page (combined view, replaces alte Fullscreen-/court/<id>) */
.court-page-head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.court-page-head .section-title { margin: 0; }
.court-page-context {
  font-size: 0.85rem;
}
/* Bell + Verwalten als Aktions-Gruppe rechts — beide bleiben auf der
   selben Zeile auch bei Wrap, weil sie ein gemeinsamer flex-Container
   sind. margin-left:auto pusht die ganze Gruppe ans rechte Ende. */
.court-page-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}
/* Icon-only-Variante des Verwalten-Buttons (auf /court/<id>): zeigt
   nur das Zahnrad, kein Text. Quadratisch, kompakt, neben der Bell. */
.manage-btn-icon-only {
  padding: 0.4rem 0.55rem;
}
.manage-btn-icon-only .manage-btn-icon {
  font-size: 1.05em;
  margin: 0;
}

.court-controls {
  margin-top: 1rem;
  padding: 0.8rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.court-controls > * + * { margin-top: 0.8rem; }

/* /court/<id>: alle Kacheln (Score-Box, Punkt-Buttons, Undo, Aufschlag,
   Aufstellung) bekommen DENSELBEN Inset = page-section-Padding. Default-
   side-margins der Klassen werden hier auf 0 geresetted; damit sind die
   Box-Kanten alle auf einer x-Achse.
   Plus uniforme vertikale Abstaende: jedes Kind 0.6rem margin-bottom,
   margin-top 0. Durch Margin-Collapse zwischen Geschwistern entstehen
   konsistente 0.6rem Luecken zwischen allen Kacheln — Undo hat dadurch
   exakt gleich viel Luft oben wie unten. */
.court-page-section .score-box,
.court-page-section .big-points,
.court-page-section .small-points,
.court-page-section .scoring-secondary,
.court-page-section .scoring-secondary-undo-only {
  margin: 0 0 0.6rem;
}

/* /admin/court/<id> (.scoring-page-body): analog zu /court, alle Boxen
   uniform breit (1rem side-margin) + symmetrische 0.6rem-Luecken via
   Margin-Collapse. Setup&Verwaltung bekommt denselben Inset wie die
   Boxen drueber (war frueher 1.5rem top + 1rem side, dadurch wirkte sie
   visuell "etwas duenner"). Anton ss4. */
body.scoring-page .score-box,
body.scoring-page .direct-result-form,
body.scoring-page .big-points,
body.scoring-page .small-points,
body.scoring-page .scoring-secondary,
body.scoring-page .scoring-secondary-undo-only,
body.scoring-page .setup-section {
  margin: 0 1rem 0.6rem;
}

/* Spieler-Gegenüberstellung */
.player-faceoff {
  margin-top: 1.5rem;
}
.faceoff-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.6rem;
}
.faceoff-side {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.8rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.faceoff-player {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.faceoff-player-empty {
  font-style: italic;
  padding: 0.4rem 0;
}
.faceoff-photo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg);
  flex-shrink: 0;
}
.faceoff-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.95rem;
  border: 1px solid var(--border);
}
.faceoff-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}
.faceoff-meta {
  display: flex;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.15rem;
}
.faceoff-lk { font-weight: 700; color: var(--text); }
.faceoff-record {
  font-size: 0.78rem;
  margin-top: 0.15rem;
}

.match-stats-placeholder {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

@media (max-width: 600px) {
  .faceoff-grid { grid-template-columns: 1fr; }
}

/* Such-Tab im Top-Nav — Text "Suchen" + Lupen-SVG nebeneinander.
   Vor Anton's Edit war nur das Icon sichtbar (.nav-tab-icon-Klasse, jetzt
   raus), sah komisch aus zwischen den text-Tabs. */
.nav-tab-suche {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.nav-tab-suche .icon-svg {
  width: 1.05rem;
  height: 1.05rem;
}
.nav-tab-suche-text {
  /* Anzeige im Burger-Menu (Mobile) — dort wirkt die Lupe alleine
     komisch zwischen den Text-Tabs. Auf Desktop wird das Label
     wieder verborgen (siehe @media unten), nur das Icon. */
}
@media (min-width: 641px) {
  .nav-tab-suche-text { display: none; }
}

/* /suche-Seite */
.suche-form {
  display: flex;
  gap: 0.5rem;
  margin: 0.6rem 0 1rem;
  position: relative;
}
.suche-input-wrap {
  flex: 1;
  position: relative;
}
.suche-input {
  width: 100%;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  font-size: 0.95rem;
  box-sizing: border-box;
}
.suche-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  z-index: 20;
  overflow: hidden;
  max-height: 60vh;
  overflow-y: auto;
}
.suche-suggestion {
  display: flex; align-items: baseline; gap: 0.6rem;
  padding: 0.5rem 0.8rem;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.suche-suggestion:last-child { border-bottom: 0; }
.suche-suggestion:hover, .suche-suggestion.is-active {
  background: var(--bg);
}
.suche-suggestion-label { font-weight: 600; }
.suche-suggestion-sub { font-size: 0.78rem; }
.suche-input:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
.suche-submit { width: auto; padding: 0.55rem 1.2rem; }
.suche-tournaments {
  list-style: none; padding: 0; margin: 0.4rem 0 0;
}
.suche-tournaments li { padding: 0.4rem 0; border-bottom: 1px solid var(--border); }
.suche-tournaments li:last-child { border-bottom: 0; }
.suche-tournament-link {
  display: block;
  color: var(--text);
  text-decoration: none;
}
.suche-tournament-link:hover { color: var(--blue); }

/* Benachrichtigungs-Seite: App-installieren-Hinweis */
.push-install-hint .push-install-steps {
  list-style: disc;
  padding-left: 1.4rem;
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
}
.push-install-hint .push-install-steps li { padding: 0.25rem 0; }

@media (max-width: 640px) {
  .user-chip-email { max-width: 6rem; font-size: 0.72rem; }
  .user-chip-role { display: none; }
  .account-menu { min-width: 16rem; }
}

/* ===== Auth pages (Login / Welcome) ===== */
body.auth-page .page-main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
  padding: 2rem 1rem;
}

.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.8rem;
  max-width: 420px;
  width: 100%;
}

.auth-card h1 {
  font-size: 1.4rem;
  margin-bottom: 0.6rem;
  color: var(--text);
}

.auth-card p {
  font-size: 0.9rem;
  margin-bottom: 0.9rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0;
}

.auth-form label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 700;
}

.auth-form input[type="email"],
.auth-form input[type="text"],
.auth-form input[type="password"] {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--green-lt);
  box-shadow: 0 0 0 2px rgba(46,160,67,0.2);
}

/* Login-/Onboarding-Dialoge auf unser App-Kit (grün) ziehen — statt Blau. */
body.auth-page .btn-primary,
body.settings-page .btn-primary { background: var(--green); }
body.auth-page .btn.btn-secondary {
  background: transparent; border: 1px solid var(--border); color: var(--text);
}
/* Konto-/Onboarding-Felder (waren ungestylt → inline/eng): App-Look, gestapelt. */
.settings-form .edit-field { display: flex; flex-direction: column; gap: .3rem; margin: .75rem 0; }
.settings-form .edit-field > span:first-child { font-size: .82rem; color: var(--muted); font-weight: 600; }
.settings-form .edit-field input,
.settings-form .edit-field textarea {
  padding: .6rem .7rem; border: 1px solid var(--border); border-radius: 9px;
  background: var(--bg, var(--card)); color: var(--text); font-size: .95rem;
  font-family: inherit; width: 100%; box-sizing: border-box;
}
.settings-form .edit-field input:focus {
  outline: none; border-color: var(--green-lt); box-shadow: 0 0 0 2px rgba(46,160,67,0.2);
}

/* Chromium/Safari tönen Autofill-Felder gelb/beige (Browser-Heuristik:
   "look, a password!"). Mit einem internen box-shadow überstempeln wir
   den gelben Background mit unserer card-dark-Farbe. Die lange Transition
   auf background-color ist der Standard-Trick damit Chrome den override
   nicht beim nächsten Autofill-Event überschreibt. */
.auth-form input:-webkit-autofill,
.auth-form input:-webkit-autofill:hover,
.auth-form input:-webkit-autofill:focus,
.auth-form input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--bg) inset;
  caret-color: var(--text);
  transition: background-color 5000s ease-in-out 0s;
}

.auth-form button {
  margin-top: 0.4rem;
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
}

.auth-error {
  background: rgba(218, 54, 51, 0.12);
  border-left: 3px solid var(--red);
  padding: 0.6rem 0.8rem;
  border-radius: 4px;
  color: var(--red);
  font-size: 0.88rem;
  margin-bottom: 0.8rem;
}
/* /login2 (neuer E-Mail-zuerst-Dialog) */
.auth-note {
  padding: 0.6rem 0.8rem; border-radius: 6px; font-size: 0.88rem;
  margin-bottom: 0.8rem; background: rgba(46,160,67,0.12);
  border: 1px solid rgba(46,160,67,0.35); color: var(--green-lt);
}
.auth-sub { color: var(--muted); font-size: 0.92rem; line-height: 1.5; margin: 0 0 1rem; }
.auth-bigname {
  font-size: 1.35rem; font-weight: 700; text-align: center; color: var(--text);
  padding: 0.8rem; margin: 0 0 1rem; border: 1px solid var(--border);
  border-radius: 10px; background: var(--card);
}
.auth-form-secondary { margin-top: 0.6rem; text-align: center; }
.auth-divider {
  text-align: center; color: var(--muted); font-size: 0.8rem; margin: 1.1rem 0 0.6rem;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.auth-success {
  background: rgba(35, 134, 54, 0.12);
  border-left: 3px solid var(--green);
  padding: 0.6rem 0.8rem;
  border-radius: 4px;
  color: var(--green);
  font-size: 0.88rem;
  margin-bottom: 0.8rem;
}
.auth-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.8rem;
  flex-wrap: wrap;
}
.auth-actions .btn { flex: 1 1 auto; }

.auth-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 1rem;
}

.auth-hint a { color: var(--blue); text-decoration: underline; }

/* "Erstregistrierung / Passwort vergessen"-Sekundärbereich unter dem
   Haupt-Login-Form. Visuell durch eine dünne Trennlinie abgesetzt. */
.auth-alt {
  margin-top: 1.6rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
}
.auth-alt-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.auth-form-compact {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
}

/* Screen-reader-only: visible for assistive tech, off-screen for sighted
   users. Used for hidden labels when the visual context is enough. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Text-styled button (no background) — wird als "Später festlegen"-Action
   benutzt, damit es visuell weniger präsent ist als der Primary-Button. */
.btn-link {
  background: none;
  border: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  text-decoration: underline;
}
.btn-link:hover { color: var(--text); }

/* Player-Claim-Seite (/welcome) */
body.claim-page .auth-card { max-width: 560px; }

.claim-search-bar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0.8rem 0 0.5rem;
}

.claim-search-bar input[type="search"] {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
}

.claim-search-bar input[type="search"]:focus {
  outline: none;
  border-color: var(--blue);
}

.claim-search-bar .muted-hint {
  font-size: 0.75rem;
  min-width: 4rem;
  text-align: right;
  white-space: nowrap;
}

.claim-list {
  list-style: none;
  padding: 0;
  margin: 0.3rem 0 1rem;
  /* Kompakter Scroll-Container, damit auf einem mittelhohen Viewport der
     „Ich bin Gast"-Block darunter noch in den ersten Scroll-Frame fällt. */
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.claim-item { border-bottom: 1px solid var(--border); }
.claim-item:last-child { border-bottom: none; }

.claim-btn {
  display: block;
  width: 100%;
  padding: 0.65rem 0.8rem;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}

.claim-btn:hover { background: rgba(31, 111, 235, 0.08); }
.claim-btn.is-selected {
  background: rgba(46, 160, 67, 0.15);
  border-left: 3px solid var(--green-lt);
  padding-left: calc(0.8rem - 3px);
}

.claim-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.claim-sources {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.claim-empty {
  margin: 1rem 0;
  text-align: center;
}

.claim-skip-form {
  margin-top: 1rem;
  text-align: center;
}

.claim-step-title {
  font-size: 1rem;
  color: var(--text);
  margin: 1.2rem 0 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}
.claim-step-title:first-of-type { margin-top: 0.5rem; }

.claim-skip-btn {
  display: block;
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.6rem;
  text-align: center;
}
.claim-skip-btn.is-selected {
  background: rgba(31, 111, 235, 0.12);
  color: var(--blue);
  text-decoration: none;
  border-radius: var(--radius);
}

/* Gast-Selbstregistrierung (aufklappbar unter der Spielerliste) */
.guest-toggle-wrap {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
.guest-toggle-btn {
  width: 100%;
  text-align: center;
  padding: 0.5rem;
}
.guest-form-wrap .name-inputs {
  display: flex;
  gap: 0.4rem;
}
.guest-form-wrap .name-input {
  flex: 1;
}

/* "Bist das du?"-Dialog — Player-Info-Card mit Roster-Details */
.guest-confirm-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 0.8rem 0;
  background: rgba(31, 111, 235, 0.05);
}
.guest-confirm-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.4rem;
}
.guest-confirm-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.8rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.guest-confirm-meta span::before {
  content: "· ";
  margin-right: 0.2rem;
}
.guest-confirm-meta span:first-child::before { content: ""; margin: 0; }
.guest-confirm-notes {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--muted);
}

.btn-link {
  background: transparent;
  border: none;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
  padding: 0.4rem;
}

.btn-link:hover { color: var(--text); }

/* ===== Scoring list: quick-result button overlay ===== */
.scoring-card-wrap {
  position: relative;
}

.quick-result-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 5;
  background: rgba(22, 27, 34, 0.85);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.3rem 0.6rem;
  border-radius: 14px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.quick-result-btn:hover {
  background: var(--card);
  border-color: var(--blue);
}

/* ── Next-Up auf /scoring + Play-Overlay auf /live ──────────────────
   Anton's KISS: pro Eintrag eine kompakte Reihe mit Meta links und
   einem grossen gruenen ▶-Button rechts. Kein full-width Starten-Knopf,
   kein verbose Card-Header — der ▶ ist die primaere Action. */
.next-up-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.next-up-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 0.9rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--green);
  border-radius: var(--radius);
}
.next-up-info { flex: 1; min-width: 0; }
.next-up-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.6rem;
  align-items: baseline;
  font-size: 0.75rem;
  color: var(--muted);
}
.next-up-time { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.next-up-court { font-weight: 700; color: var(--text); }
.next-up-pos { font-weight: 600; }
.next-up-team { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.next-up-players {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Gruener Play-Button — drei Verwendungen:
   - auf /scoring als inline-Button rechts in den Next-Up-Cards (44px,
     gross weil prominent)
   - auf /live mit Modifier .play-overlay-btn-center: kleiner (32px),
     absolute mittig zwischen den beiden Next-Up-Spielerzeilen
   Der Default .play-overlay-btn ist die 44px-Variante. */
.play-overlay-btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.05rem;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.play-overlay-btn:hover { filter: brightness(1.1); }

.score-card-wrap { position: relative; }
/* Karte füllt die Höhe des (vom Grid gestreckten) Wraps → alle Kacheln einer
   Reihe gleich hoch. Nur Höhe, kein display/flex → Breiten bleiben unberührt. */
.score-card-wrap > .score-card { height: 100%; }
/* Auf /live in der Next-Up-Variante: kleiner Button vertikal mittig
   zwischen den 2 Spielerzeilen, aber RECHTS auf der X-Achse (Anton:
   nicht mittig auf X, dort hatten frueher Zeit/Position-Tags gestanden,
   die sind jetzt raus). */
.score-card-wrap > .play-overlay-btn-center {
  position: absolute;
  top: 50%;
  right: 1rem;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  font-size: 0.85rem;
  z-index: 5;
}

/* Next-Up-Variante der Score-Karte: blauer Akzent links + spezielle
   Spielerzeilen, damit klar ist es ist ein anstehender Match (kein
   gerade laufender). Time + Position als Meta in den sc-rows rechts. */
.score-card-next-up { border-left: 3px solid var(--green); }
.sc-badge.sc-badge-next-up {
  background: var(--green);
  color: #fff;
}
.sc-row-next-up {
  /* Erste/zweite Spielerzeile in Next-Up: rechts ein kleines Meta-Tag
     statt Set-Ziffern. */
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.sc-row-next-up .sc-player {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sc-row-next-up .next-up-time,
.sc-row-next-up .next-up-pos {
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Trainings-Karte: gleicher Card-Look wie Score-Karte aber mit Orange-
   Akzent + neutraler Spielerzeile (kein klickbarer Link, kein Score). */
.score-card-training {
  border-left: 3px solid var(--orange, #d97706);
}
.sc-badge.sc-badge-training {
  background: var(--orange, #d97706);
  color: #fff;
}
.sc-row-training {
  display: flex;
  align-items: baseline;
}
.sc-row-training .sc-player {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sc-row-training-meta { margin-top: 0.15rem; }
.sc-row-training-meta .sc-player { font-size: 0.82rem; }

/* Admin-Tile Training-Karte (analog zur Court-Score-Karte oben) */
.admin-court-training {
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}
.admin-court-training .act-line { font-weight: 500; }
.admin-court-training .act-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.15rem;
}
.admin-court-status.status-training { background: var(--orange, #d97706); color: #fff; }
.admin-court-status.status-queued   { background: var(--muted); color: #fff; }

/* Verwalten-Link auf jeder Scoring-Karte (ersetzt frueheren ✏-Quick-
   Result). Position BOTTOM-rechts (statt top-rechts, weil dort die
   LIVE-Pille sitzt). Visuell wie ein dezenter Outline-Button auf
   Card-Hintergrund. */
.quick-manage-btn {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(22, 27, 34, 0.92);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.quick-manage-btn:hover {
  color: var(--blue);
  border-color: var(--blue);
}
.quick-manage-btn .manage-btn-icon { font-size: 0.9em; }

/* ===== Meine-Matches-Seite ===== */
body.my-matches-page .page-section {
  max-width: 900px;
  margin: 0 auto;
}

.mm-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.mm-who {
  font-size: 0.82rem;
}

.mm-change-link {
  color: var(--blue);
  text-decoration: underline;
}

.mm-empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
}

.mm-empty-state .btn { margin-top: 0.5rem; }

.mm-section {
  margin-bottom: 1.5rem;
}

.mm-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.6rem;
}

details.mm-section summary.mm-section-title {
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.mm-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.mm-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
}

.mm-card-live { border-left-color: var(--blue); }
.mm-card-done { border-left-color: var(--green); }
.mm-card-open { border-left-color: var(--border); }

.mm-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.3rem;
}

.mm-when {
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.mm-date { font-weight: 600; color: var(--text); }
.mm-time { font-weight: 600; color: var(--text); }
.mm-court { color: var(--muted); }

.mm-status {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  align-items: center;
}

.mm-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.mm-badge-live   { background: var(--blue); color: #fff; }
.mm-badge-win    { background: var(--green); color: #fff; }
.mm-badge-loss   { background: rgba(139,148,158,0.2); color: var(--muted); }
.mm-badge-pos    { background: var(--bg); border: 1px solid var(--border); color: var(--muted); }

.mm-context {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin: 0.25rem 0 0.45rem;
}

.mm-matchup {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
}

.mm-side-me { color: var(--text); }
.mm-side-opp { color: var(--text); }
.mm-vs {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mm-sets {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.3rem;
  font-variant-numeric: tabular-nums;
}

.mm-set {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  font-weight: 700;
  font-size: 0.82rem;
}

.mm-set-win { color: var(--green-lt); }

.mm-card-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--blue);
  text-decoration: underline;
}

/* ===== Collapsible Kommende/Vergangen sections on /begegnungen ===== */
.bg-collapsible { border: none; padding: 0; }
.bg-collapsible > summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.bg-collapsible > summary::-webkit-details-marker { display: none; }
.bg-collapsible > summary::before {
  content: '▸';
  display: inline-block;
  font-size: 0.75rem;
  color: var(--muted);
  transition: transform 0.15s;
}
.bg-collapsible[open] > summary::before { transform: rotate(90deg); }
.bg-collapsible > summary .muted-hint {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.75rem;
}

/* ===== Meldeliste order-violation warning (admin_begegnung) ===== */
.order-warn {
  margin: 0 0 0.6rem 0;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--yellow);
  border-left-width: 4px;
  background: rgba(210, 153, 34, 0.12);
  color: var(--yellow);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ===== Player card dialog (Spielerkarte) ===== */
.player-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  cursor: pointer;
}
.player-link:hover { border-bottom-color: var(--blue); }

.score-card.is-clickable { cursor: pointer; }
a.score-card { color: inherit; text-decoration: none; display: block; }
a.score-card:hover { border-color: var(--blue); }

.player-card-dialog {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0;
  max-width: 92vw;
  width: 380px;
}

.player-card-dialog::backdrop { background: rgba(0, 0, 0, 0.7); }

.player-card-dialog .pcd-close {
  position: absolute;
  top: 0.4rem;
  right: 0.6rem;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  z-index: 2;
}
.player-card-dialog .pcd-close:hover { color: var(--text); }

.player-card-dialog .pcd-body {
  padding: 1.4rem 1.4rem 1.2rem;
}

.pcd-body.is-match {
  width: auto;
}

.player-card-dialog .pcd-loading {
  padding: 1rem 0;
  color: var(--muted);
  text-align: center;
}

.pcd-card {
  display: grid;
  grid-template-columns: 88px 1fr;
  grid-template-areas:
    "photo info"
    "photo info";
  gap: 0.9rem 1rem;
  align-items: start;
  position: relative;
}

.pcd-photo-wrap {
  grid-area: photo;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--border);
  border: 1px solid var(--border);
}
.pcd-photo { width: 100%; height: 100%; object-fit: cover; display: block; }

.pcd-info { grid-area: info; min-width: 0; }

.pcd-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.5rem;
  padding-right: 1.6rem; /* space for edit pencil */
}

/* Spitzname-Zeile in der Spielerkarte */
.pcd-nick-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem;
  margin: -0.2rem 0 0.6rem;
  font-size: 0.85rem;
}
.pcd-nick-label {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--muted); font-weight: 700;
}
.pcd-nick-val { color: var(--text); font-weight: 600; }
.pcd-nick-edit {
  background: none; border: none; cursor: pointer; color: var(--muted);
  font-size: 0.85rem; padding: 0 0.2rem;
}
.pcd-nick-edit:hover { color: var(--accent, #2563eb); }
.pcd-nick-input {
  flex: 1 1 8rem; min-width: 6rem;
  padding: 0.25rem 0.4rem; font-size: 0.85rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm, 6px);
  background: var(--card); color: var(--text);
}
.pcd-nick-err { flex-basis: 100%; color: #d9534f; font-size: 0.78rem; }

.pcd-fields {
  list-style: none;
  padding: 0;
  margin: 0 0 0.5rem 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.7rem;
}
.pcd-fields li {
  display: contents;
  font-size: 0.85rem;
}
.pcd-label {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  align-self: center;
}
.pcd-value { color: var(--text); font-weight: 600; }

.pcd-notes {
  margin-top: 0.7rem;
  padding: 0.6rem 0.8rem;
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--blue);
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--text);
  white-space: pre-wrap;
  grid-column: 1 / -1;
}

.pcd-edit-btn {
  position: absolute;
  top: 0;
  right: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0.2rem 0.4rem;
  cursor: pointer;
}
.pcd-edit-btn:hover { color: var(--text); border-color: var(--blue); }

/* Edit form */
.pcd-edit-form {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.pcd-edit-form h4 {
  font-size: 0.95rem;
  margin: 0 0 0.3rem 0;
  color: var(--text);
}
.pcd-edit-row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.pcd-edit-row label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 700;
}
.pcd-edit-row input[type="text"],
.pcd-edit-row input[type="number"],
.pcd-edit-row textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.55rem;
  color: var(--text);
  font-size: 0.88rem;
  font-family: inherit;
}
.pcd-edit-row textarea { resize: vertical; min-height: 60px; }
.pcd-edit-row input[type="file"] {
  color: var(--muted);
  font-size: 0.8rem;
}
.pcd-remove-photo {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.3rem;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}

/* Circular preview cropper (drag + zoom) */
.pcd-cropper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.pcd-cropper-view {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  background: var(--bg);
  border: 2px solid var(--border);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.pcd-cropper-view:active { cursor: grabbing; }

.pcd-cropper-img {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  max-width: none;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.pcd-cropper-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 220px;
}
.pcd-cropper-zoom-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 700;
}
.pcd-cropper-zoom { flex: 1; }

.pcd-cropper-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.pcd-cropper-hint {
  font-size: 0.72rem;
  color: var(--muted);
}
.pcd-edit-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.4rem;
}
.pcd-edit-actions .btn { width: auto; padding: 0.45rem 1rem; }
.pcd-edit-error {
  color: var(--red);
  font-size: 0.8rem;
  min-height: 1em;
}

/* Match card layout — two sides face to face */
.player-card-dialog:has(.is-match) {
  width: min(92vw, 760px);
}
.pcd-match-wrap {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.9rem;
  align-items: stretch;
}
.pcd-match-side {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-width: 0;
}
.pcd-match-side .pcd-card {
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  grid-template-columns: 72px 1fr;
}
.pcd-match-side .pcd-photo-wrap { width: 72px; height: 72px; }
.pcd-match-side .pcd-name { font-size: 0.95rem; }
.pcd-match-vs {
  align-self: center;
  font-weight: 800;
  color: var(--muted);
  font-size: 0.95rem;
  padding: 0 0.3rem;
}

@media (max-width: 640px) {
  .player-card-dialog:has(.is-match) { width: 92vw; }
  .pcd-match-wrap {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto 1fr;
  }
  .pcd-match-vs { padding: 0.3rem 0; text-align: center; }
}

/* ===== Phase 1 Mobile-Fixes (Audit Findings) ===== */

/* Big-Points-Buttons im Landscape: sonst werden sie zu schmalen Streifen */
@media (max-height: 500px) and (orientation: landscape) {
  .bp-btn {
    min-height: 72px;
    padding: 0.6rem 0.8rem;
  }
  .bp-plus { font-size: 1.4rem; }
}

/* Begegnung-Grid: nuLiga-Meeting-Tiles (4-Spalten-Variante) brauchen auf
   Mini-Displays eine Stack-Reihe, sonst quetschen sich Player + Sets +
   Tools zu eng. Das neue `.bg-match--stacked`-Layout auf /begegnung/<id>
   bleibt 3-spaltig — die ist auch bei 393px viewport noch lesbar. */
@media (max-width: 460px) {
  .bg-match:not(.bg-match--stacked) {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
}

/* TV-Score-Overlay: min-width 280px überflutet 320px-Displays */
@media (max-width: 360px) {
  .tv-scores {
    min-width: 0;
    width: min(90vw, 280px);
  }
}

/* Admin-Team-/Turnier-Karten: auf Mobile vertikal stapeln, sonst quetschen
   sich Name, Datum und 3 Action-Buttons in einer Reihe und wrappen brutal. */
@media (max-width: 640px) {
  .team-card {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }
  .team-card-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .team-card-actions .btn,
  .team-card-actions .inline-form {
    flex: 1 1 auto;
  }
  .team-card-actions .inline-form .btn { width: 100%; }

  /* Admin-Forms auf Mobile: .name-row-Felder untereinander statt gequetscht
     nebeneinander (wichtig für date/time/Team-Select die sonst nicht lesbar
     sind auf 360px) */
  .name-row {
    flex-direction: column;
    gap: 0.55rem;
  }
}

/* ===== Phase 2 UX-Polish ===== */

/* Scoring "Verwalten"-Button: auf Mobile groesser und mit min-height,
   damit man ihn sicher trifft ohne versehentlich auf die Karte dahinter
   zu tippen. Auch der alte .quick-result-btn falls noch wo referenziert. */
@media (max-width: 640px) {
  .quick-result-btn,
  .quick-manage-btn {
    font-size: 0.82rem;
    padding: 0.45rem 0.75rem;
    min-height: 36px;
    background: rgba(22, 27, 34, 0.95);
  }
}

/* Bracket Horizontal-Scroll: dünne Scrollbar auf Mobile immer sichtbar
   machen, damit User merken dass es scrollt. Standard auf iOS/Android ist
   die Scrollbar unsichtbar — und ohne Indikator denkt man, der Bracket
   wäre schon zu Ende. */
@media (max-width: 640px) {
  .bracket-wrap {
    scrollbar-width: thin;
    scrollbar-color: var(--muted) transparent;
    padding-bottom: 0.5rem;
  }
  .bracket-wrap::-webkit-scrollbar { height: 6px; }
  .bracket-wrap::-webkit-scrollbar-track { background: transparent; }
  .bracket-wrap::-webkit-scrollbar-thumb {
    background: var(--muted);
    border-radius: 3px;
  }
}

/* ── Zwischenstand / Gesamtergebnis (Matchpunkte · Sätze · Spiele) ────────
   Card-Style wie Match-Ergebnisse, mit farbigem Akzent links um Einzel /
   Doppel vom Gesamtergebnis zu trennen. Drei Spalten: große Zahl oben,
   kleines Label darunter. Stacked auf Mobile. */
.bg-subscore {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  margin: 0.75rem 1rem 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
}
.bg-subscore.is-gesamt {
  border-left-color: var(--green-lt);
  margin-top: 1.25rem;
  padding: 1rem 1rem;
}
.bg-subscore-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  flex: 0 0 auto;
  min-width: 10rem;
}
.bg-subscore.is-gesamt .bg-subscore-label {
  font-size: 1.05rem;
  font-weight: 700;
}
.bg-subscore-pill {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.bg-subscore-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
}
.bg-subscore-num {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.bg-subscore.is-gesamt .bg-subscore-num {
  font-size: 1.4rem;
}
.bg-subscore-tag {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@media (max-width: 640px) {
  .bg-subscore {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
    padding: 0.75rem 0.8rem;
  }
  .bg-subscore-label {
    min-width: 0;
    text-align: center;
  }
}

/* ── Auswärts-Label (Begegnung, Card, Detail) ───────────────────────────── */
.away-badge {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  margin-left: 0.4rem;
  background: var(--yellow);
  color: #2a2200;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  vertical-align: middle;
  text-transform: uppercase;
}
/* Kompakte Variante in den Cards (nur "A") */
.bg-card-team .away-badge {
  padding: 0.05rem 0.35rem;
  font-size: 0.6rem;
  margin-left: 0.3rem;
}

/* ── "Heute auswärts"-Section auf der Startseite ──────────────────────────
   Liste von Cards, jede Card zeigt Begegnung + alle 9 Slots mit Ergebnis. */
.away-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.away-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--yellow);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s;
}
.away-card:hover { border-color: var(--blue); }

.away-card-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.6rem;
  align-items: center;
}
.away-card-team {
  font-weight: 600;
  text-align: left;
}
.away-card-score {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}
.away-card-opp {
  font-weight: 600;
  text-align: right;
}
.away-card-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.away-slots {
  margin-top: 0.6rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.3rem 0.8rem;
}
.away-slot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  padding: 0.15rem 0;
}
.away-slot-pos {
  font-weight: 700;
  color: var(--muted);
  min-width: 1.6rem;
}
.away-slot.is-done .away-slot-pos { color: var(--text); }
.away-slot-result {
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.away-slot-pending {
  color: var(--muted);
  font-style: italic;
}

@media (max-width: 640px) {
  .away-slots { grid-template-columns: repeat(2, 1fr); }
  .away-card-header { grid-template-columns: 1fr auto; }
  .away-card-opp { grid-column: 2; }
  .away-card-score { grid-column: 1 / -1; text-align: center; }
}

/* Live laufende Auswärts-Kachel im Score-Grid: eigene Reihe unter den
   physischen Courts, mit gelbem Akzent links. Score-Zahlen bewusst
   ausgespart (kein Live-Scoring bei Auswärts). */
.score-card.away-live-card {
  border-left: 4px solid var(--yellow);
}
.score-card.away-live-card .sc-player {
  font-weight: 600;
}
.scores-subtitle {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 1.25rem 0 0.5rem;
}

/* ── Auswärts-Section im Schedule-Tab ───────────────────────────────── */
.sched-away-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--yellow);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  margin-bottom: 0.6rem;
}
.sched-away-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}
.sched-away-team {
  font-weight: 600;
  color: var(--text);
}
.sched-away-meta {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.sched-away-rows {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.sched-away-row {
  display: grid;
  grid-template-columns: 2rem 1fr auto auto auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.3rem 0;
  font-size: 0.9rem;
}
.sched-away-row + .sched-away-row {
  border-top: 1px solid var(--border);
}
.sched-away-pos {
  font-weight: 700;
  color: var(--muted);
}
.sched-away-row.sched-away-row-live .sched-away-pos,
.sched-away-row.sched-away-row-done .sched-away-pos { color: var(--text); }
.sched-away-players { color: var(--text); }
.sched-away-status {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.sched-away-sets {
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
}
/* Laufender Satz (Auswärts-Live) — blau wie der live-Set-Akzent der Court-Tiles. */
.sched-away-cur { color: var(--blue); font-weight: 700; }
.sched-away-actions {
  display: flex;
  gap: 0.3rem;
}
@media (max-width: 640px) {
  .sched-away-row { grid-template-columns: 2rem 1fr auto; }
  .sched-away-sets, .sched-away-status { grid-column: 2; justify-self: start; font-size: 0.8rem; }
  .sched-away-actions { grid-column: 1 / -1; justify-self: stretch; margin-top: 0.3rem; }
}

/* Begegnungs-Card: Datum prominent oben, Mannschaft+Score mittig, Liga unten */
.bg-card-date {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}
.bg-card-date .away-badge {
  margin-left: 0;
}

/* Scoring-Tab-Variante: Slot-Buttons zum Ergebnis eintragen */
.away-slots-scoring {
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}
.away-slot-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.away-slot-btn:hover { border-color: var(--blue); background: rgba(31, 111, 235, 0.08); }
.away-slot-btn.is-done { border-color: var(--green); background: rgba(35, 134, 54, 0.08); }
.away-slot-btn.is-done:hover { border-color: var(--green-lt); }
/* Links (open/live) müssen sich wie Buttons anfühlen — Underline weg,
   Farbe erben, is-live bekommt Live-Rot-Akzent. */
a.away-slot-btn { text-decoration: none; color: inherit; }
.away-slot-btn.is-live  { border-color: #d23; background: rgba(221, 51, 51, 0.06); }
.away-slot-btn.is-live:hover { border-color: #f44; background: rgba(221, 51, 51, 0.12); }
.away-slot-btn.is-live .away-slot-pending { color: #d23; font-style: normal; font-weight: 600; }
.away-slot-btn .away-slot-pos {
  font-weight: 700;
  min-width: 1.8rem;
}
.away-slot-btn .away-slot-pending {
  color: var(--muted);
  font-style: italic;
}
@media (max-width: 640px) {
  .away-slots-scoring { grid-template-columns: 1fr; }
}

/* Checkbox-Zeile, wird als .form-field in einer .name-row verwendet.
   Layout: Checkbox links, Label rechts, vertikal zur Input-Zeile ausgerichtet
   sodass Format-Select und Checkbox eine Höhe haben. */
.checkbox-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.7rem;
  padding-top: 1.1rem;  /* gleiche Höhe wie Label oberhalb der Inputs */
  cursor: pointer;
  user-select: none;
}
.checkbox-row input[type="checkbox"] {
  width: 1.4rem;
  height: 1.4rem;
  flex: 0 0 auto;
  cursor: pointer;
  accent-color: var(--green-lt);
}
.checkbox-row span {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.2;
}

/* ═══════════════════════════════════════════════════════════════════════
   Mobile-Tauglichkeit — neue Features (Mannschaften, Auth-Flow v2,
   Admin-Invites). Auf <640px umbrechen / stapeln, Tables scrollbar.
   Phone-Test-Breakpoints: 375 (iPhone), 414 (Plus/Pro Max).
   ═══════════════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
  /* Meldeliste-Tabelle + Invite-Preview: Horizontal-Scroll statt Overflow.
     Tabellen werden nicht kleiner skaliert — Text bleibt lesbar, bei Bedarf
     kann der User zur Seite wischen. */
  .meldeliste-table,
  .invite-preview-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  .meldeliste-table td,
  .invite-preview-table td { white-space: normal; }
  .meldeliste-table .ml-pos,
  .meldeliste-table .ml-lk,
  .meldeliste-table .ml-year {
    width: auto;
    min-width: 3.5rem;
  }

  /* Team-Grid bleibt dank auto-fill/minmax sauber; nur eine dichtere Gap. */
  .team-grid { gap: 0.5rem; }
  .team-card { padding: 0.7rem 0.8rem; }

  /* Mannschaft-Header auf Mobile: bleibt flex-row, aber mit etwas
     engerem Gap. Der Verwalten-Button bleibt rechts (siehe margin-left:auto
     in der Basis-Regel). Wenn der Inhalt nicht passt, wrappt h2 / league
     unter den Back-Button — der Button bleibt aber rechts. */
  .mannschaft-header {
    gap: 0.5rem 0.6rem;
  }

  /* Tabs auf Mobile: horizontal scrollbar wenn zu viele oder zu lang. */
  .tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: thin;
  }
  .tab { flex-shrink: 0; padding: 0.6rem 0.7rem; font-size: 0.88rem; }

  /* Auth-Actions mit 2 Buttons: stacken. Single-Button bleibt 100% breit. */
  .auth-actions {
    flex-direction: column;
  }
  .auth-actions .btn {
    width: 100%;
  }

  /* Admin-Header: Bulk-Invite-Button volle Breite statt inline. */
  .admin-header .btn-secondary {
    display: block;
    width: 100%;
  }

  /* Link-Player-Dialog: volle Breite, kleinere Padding. */
  .link-player-dialog {
    padding: 1rem;
    max-width: 100%;
    width: 94vw;
  }

  /* User-Card-Meta: "Spieler: xyz" + ändern-Button wickelt um. */
  .user-card-link-btn {
    display: inline-block;
    margin-top: 0.2rem;
  }

  /* Bist-das-du Confirm-Card: Action-Buttons stacken. */
  .guest-confirm-card + .auth-actions { flex-direction: column; }

  /* Scoring-Primary-Buttons auf Mobile weiter flexible (sind schon per
     Default gut), aber Walkover-Row untereinander stapeln damit niemand
     bei engem Screen ausversehen trifft. */
  .big-points { gap: 0.5rem; }

  /* Profil-Seite Foto-Preview: 80px statt 100px damit's nicht dominiert */
  .profile-photo-preview img {
    width: 80px;
    height: 80px;
  }
}

/* Sehr schmal (≤360px, z.B. iPhone SE 1. Gen): noch aggressiver kondensieren */
@media (max-width: 360px) {
  .meldeliste-table th,
  .meldeliste-table td,
  .invite-preview-table th,
  .invite-preview-table td {
    padding: 0.3rem 0.35rem;
    font-size: 0.78rem;
  }
  .team-card-name { font-size: 0.92rem; }
  .tab { padding: 0.5rem 0.55rem; font-size: 0.82rem; }
}

/* ═══ App-Install-Seite (/auth/app) ═══ */

/* Section-Überschriften */
.app-benefits-title,
.app-install-title {
  font-size: 1.05rem;
  color: var(--text);
  margin: 2.2rem 0 1.2rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

/* Vorteile-Grid: 2×2 auf Desktop, 1-col Mobile */
.app-benefits-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.app-benefits-list > li {
  padding: 1rem 1.1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  line-height: 1.55;
}
.app-benefits-list strong {
  font-size: 0.95rem;
  color: var(--text);
}
.app-benefit-icon {
  font-size: 1.05rem;
  line-height: 1;
  margin-left: 0.2rem;
}

/* Pro-OS Accordion */
.app-install-os {
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.app-install-os summary {
  padding: 0.9rem 1.1rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--bg);
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.app-install-os summary:hover { background: rgba(31, 111, 235, 0.08); }
.app-install-os[open] summary { border-bottom: 1px solid var(--border); }
.app-os-icon {
  display: inline-block;
  width: 1.1rem;
  height: 1.1rem;
  background: var(--blue);
  border-radius: 4px;
  flex-shrink: 0;
}

/* Install-Steps mit großzügigem Vertikal-Rhythmus */
.app-install-steps {
  margin: 1.2rem 1.6rem 1.4rem;
  padding: 0 0 0 1.2rem;
  line-height: 1.7;
}
.app-install-steps > li {
  margin-bottom: 1.4rem;
  padding-left: 0.3rem;
}
.app-install-steps > li:last-child { margin-bottom: 0; }

.app-icon-placeholder {
  display: inline-block;
  padding: 0.05rem 0.4rem;
  background: var(--border);
  border-radius: 4px;
  font-family: -apple-system, monospace;
  font-size: 0.95em;
  margin: 0 0.15rem;
}

/* Screenshots deutlich kleiner — als "Beleg" für den Step, nicht als Haupt-Element. */
.app-step-screenshot {
  margin: 0.7rem 0 0;
  padding: 0;
  text-align: center;
}
.app-step-screenshot img {
  display: inline-block;
  max-width: 260px;
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Mobile */
@media (max-width: 640px) {
  .app-benefits-list { grid-template-columns: 1fr; }
  .app-install-steps { margin: 1rem 0.6rem 1.2rem; padding-left: 1rem; }
  .app-install-steps > li { margin-bottom: 1.2rem; }
  .app-step-screenshot img { max-width: 220px; }
}

/* Begegnungs-Detail: dezenter Hinweis dass Match-Start anderswo läuft. */
.bg-flow-hint {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.4rem 1rem 1rem;
}
.bg-flow-hint a { color: var(--blue); text-decoration: underline; }

/* ===== Mobile-Fixes 04.05.2026 ===== */
@media (max-width: 600px) {
  /* Admin-Header (Mannschaftsspiele Detail): back-btn war
     position:absolute und überlappte den langen Match-Title — auf Mobile
     vertikal stacken. */
  .admin-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    padding: 0.7rem 1rem;
  }
  .admin-header .back-btn {
    position: static;
    align-self: flex-start;
    transform: none;
  }
  .admin-header h1 {
    font-size: 0.98rem;
    line-height: 1.25;
    text-align: center;
    word-break: break-word;
    margin: 0;
  }
  .admin-header .admin-link { align-self: flex-end; font-size: 0.85rem; }

  /* Slot-Cards: Action-Buttons (Score + ✏ + ✕) flossen rechts aus dem
     Viewport — auf Mobile als eigene Zeile, full-width, rechts-bündig.
     `flex: 0 0 100%` zwingt eigene Zeile; ohne das Schiebt flex-wrap die
     Action manchmal zurück in Zeile 1. Slot-status hat default nowrap —
     auf Mobile aufheben damit Score+Buttons brechen können. */
  .slot-card-action {
    margin-left: 0;
    flex: 0 0 100%;
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
    padding-top: 0.3rem;
  }
  .slot-card-action .slot-status {
    flex-wrap: wrap;
    justify-content: flex-end;
    white-space: normal;
    max-width: 100%;
  }

  body.court-page .tv-wo-slot { display: none; }

  /* Mobile: Verwalten-Button auf /begegnung + /mannschaft kollabiert
     auf Zahnrad only (Anton 2026-05-18: Text dazu auf Mobile zu
     breit, schiebt Liga-Name + Bell/Heart weg). Padding etwas
     verengen damit's nicht wie ein Riesen-Button rumlungert. */
  body.begegnung-page .site-header-actions .manage-btn-text,
  body.mannschaft-detail-page .mannschaft-header .manage-btn-text,
  body.mannschaften-page .mannschaft-header .manage-btn-text { display: none; }
  body.begegnung-page .site-header-actions .manage-btn,
  body.mannschaft-detail-page .mannschaft-header .manage-btn,
  body.mannschaften-page .mannschaft-header .manage-btn {
    padding: 0.4rem 0.55rem;
  }
  body.begegnung-page .site-header-actions .manage-btn .manage-btn-icon,
  body.mannschaft-detail-page .mannschaft-header .manage-btn .manage-btn-icon,
  body.mannschaften-page .mannschaft-header .manage-btn .manage-btn-icon {
    margin: 0;
  }
}

/* Stream-Overlays kompakt halten — sowohl Portrait (max-width 600px) als
   auch Landscape-Mobile (typisch >800px breit, aber <500px hoch).
   Anton 09.05.: Querformat-Bug, Overlay war wieder Desktop-groß weil
   die alte (max-width: 600px)-Regel nicht griff. */
@media (max-width: 600px), (max-height: 500px) {
  body.court-page .tv-overlay {
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    left:   calc(8px + env(safe-area-inset-left, 0px));
    max-width: calc(100vw - 16px);
    padding: 1rem 0.6rem 0.4rem;
  }
  body.court-page .tv-scores  { min-width: 0; padding: 0.25rem 0.5rem; }
  body.court-page .tv-court-label { font-size: 0.5rem; margin-bottom: 0.2rem; }
  body.court-page .tv-row {
    grid-template-columns: 0.9rem minmax(0, 1fr) auto auto;
    gap: 0.3rem;
    padding: 0.12rem 0;
  }
  body.court-page .tv-name { font-size: 0.65rem; }
  body.court-page .tv-set-scores { gap: 0.25rem; }
  body.court-page .tv-set        { font-size: 0.7rem; min-width: 0.8rem; }
  body.court-page .tv-points {
    font-size: 0.7rem;
    min-width: 1.3rem;
    padding: 0.02rem 0.25rem;
  }

  /* Index-Page Stream-Cards (.score-overlay) — gleiche Behandlung.
     Wir setzen font-size am .score-overlay .overlay-row, damit
     beide Children (.ov-set + .ov-wo-slot via inherit) identisch
     gross sind. Sonst gewinnt der allgemeinere 3-Klassen-Selector
     auf .ov-wo-slot ggf. mit Desktop-1rem. */
  .score-overlay {
    padding: 0.8rem 0.5rem 0.4rem;
  }
  .overlay-court-name { font-size: 0.5rem; margin-bottom: 0.15rem; }
  .score-overlay .overlay-row { font-size: 0.75rem; gap: 0.25rem; padding: 0.05rem 0; }
  .score-overlay .overlay-row .ov-name { font-size: 0.7rem; }
  .score-overlay .overlay-row .ov-sets { gap: 0.25rem; }
  .score-overlay .overlay-row .ov-set,
  .score-overlay .overlay-row .ov-wo-slot { min-width: 0.9rem; }
}

/* ── Match-Seite (/match/<id>): Sieger-Zeile + Tab-Menü + Panels ─────────
   Tabs sitzen direkt unter der Score-Box; teilt sich das Look mit /court. */
.match-tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin: 1rem 0 0.75rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.match-tabs::-webkit-scrollbar { display: none; }
.match-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.55rem 0.7rem;
  margin-bottom: -1px;
  white-space: nowrap;
  cursor: pointer;
}
.match-tab.is-active {
  color: var(--text);
  border-bottom-color: var(--blue);
}
.match-panel { display: none; }
.match-panel.is-active { display: block; }

/* Spielerinfo: Head-to-Head, pro Spieler eine Spalte, Label mittig.
   --mi-label-w hält Label-Spalte (Zeilen) und Header-Spacer auf gleicher
   Breite, damit Namen über ihren Werten stehen. */
.match-panel[data-panel="info"] { --mi-label-w: 7rem; }
.mi-head {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin: 0.25rem 0 1rem;
}
.mi-h-side {
  display: flex;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}
.mi-h-right { justify-content: flex-end; }
.mi-h-spacer { flex: 0 0 var(--mi-label-w); }
.mi-h-player {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
}
.mi-h-right .mi-h-player { flex-direction: row-reverse; text-align: right; }
.mi-avatar {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--card);
}
.mi-avatar-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.8rem;
  border: 1px solid var(--border);
}
.mi-h-name {
  font-weight: 700;
  line-height: 1.2;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}
.mi-h-name:hover { color: var(--blue); text-decoration: underline; }
.mi-h-winner .mi-h-name { color: var(--green); }

/* Handy: Profilbilder raus (Einzel + Doppel) — schaffen Platz. Im Doppel
   kleinere Schrift; NAMEN brechen sauber um (kein „…"), nur der VEREIN wird
   einzeilig mit „…" gekürzt. Die DTB-ID-Zeile fällt im Doppel weg (Template). */
@media (max-width: 640px) {
  .mi-avatar { display: none; }
  .mi-doubles .mi-h-name { font-size: 0.82rem; overflow-wrap: break-word; }
  .mi-doubles .mi-v { font-size: 0.78rem; }
  .mi-doubles .mi-label { font-size: 0.72rem; }
  .mi-doubles .mi-v-side { gap: 0.3rem; }
  .mi-doubles .mi-row-verein .mi-v {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
}

/* Wert-Zeilen — bewusst OHNE sichtbare Trennlinien (Spec). */
.mi-rows { margin-top: 0.25rem; }
.mi-row {
  display: flex;
  align-items: center;
  padding: 0.55rem 0;
}
.mi-label {
  flex: 0 0 var(--mi-label-w);
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  padding: 0 0.4rem;
}
.mi-v-side {
  flex: 1;
  display: flex;
  min-width: 0;
}
.mi-v-right { justify-content: flex-end; }
.mi-v {
  flex: 1;
  font-weight: 600;
  color: var(--text);
  font-size: 0.9rem;
  min-width: 0;
}
.mi-v-left .mi-v { text-align: left; }
.mi-v-right .mi-v { text-align: right; }
.mi-row-notes .mi-v {
  font-weight: 400;
  font-size: 0.82rem;
  color: var(--muted);
}

/* Spielverlauf — Namen links/rechts oben, Score mittig */
.mv-head {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  padding: 0 0.25rem;
}
.mv-h-right { text-align: right; }
.mv-set { margin-bottom: 1.1rem; }
.mv-set-head {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-align: center;
  margin-bottom: 0.35rem;
}
.mv-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0.32rem 0.25rem;
}
.mv-row + .mv-row { border-top: 1px solid var(--border); }
.mv-score {
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text);
  font-size: 0.92rem;
}
/* Break-Badge sitzt in der Namensspalte des Breakers: links für Spieler 1,
   rechts für Spieler 2 (an den jeweiligen Namen oben angelehnt). */
.mv-side-left  { text-align: left; }
.mv-side-right { text-align: right; }
.mv-break-tag {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--green);
  border: 1px solid var(--green);
  border-radius: 999px;
  padding: 0.02rem 0.35rem;
  vertical-align: middle;
}
/* Match-Tiebreak-Zeile: leicht abgehoben (Punkte statt Spiele). */
.mv-row-mtb .mv-score { color: var(--yellow); }
.mv-row-mtb { padding-top: 0.18rem; padding-bottom: 0.18rem; }
/* Punkt-Marker (●) auf der Seite, die den MTB-Punkt gewonnen hat. */
.mv-pt-dot { color: var(--yellow); font-size: 0.7rem; vertical-align: middle; }
.mv-empty { padding: 1rem; text-align: center; }
.mv-manage-btn { display: inline-block; margin-top: 0.5rem; }

/* Klickbare Match-Karten (Begegnung/Bracket/Schedule) → Match-Seite */
.bg-match-clickable { cursor: pointer; transition: background 0.12s ease; }
.bg-match-clickable:hover { background: var(--card); }
.bm-clickable { cursor: pointer; }
.bm-clickable:hover { filter: brightness(1.08); }

/* ===========================================================================
   TV-Kiosk
   =========================================================================== */

/* ?tv=1 – Public-Einbettung in einer Kachel: keine Chrome. (Interaktion wird
   auf dem echten /tv-Display per Overlay geblockt, im Builder bleibt sie an.) */
body.tv-embed { padding-top: 0 !important; }
body.tv-embed .top-nav-bar,
body.tv-embed .sponsor-bar,
body.tv-embed .help-btn,
body.tv-embed .dev-role-switcher,
body.tv-embed .install-prompt,
body.tv-embed .back-bar { display: none !important; }

/* TV-DISPLAY (?tv=1): zusätzlich ALLE Auswahl-/Navigations-Elemente der Seite
   selbst ausblenden (reine Anzeige). Greift nur am Fernseher — der Builder
   (?tvedit=1) hat KEIN .tv-embed → dort bleiben sie sichtbar zum Navigieren. */
body.tv-embed .back-btn,
body.tv-embed .back-btn-inline,
body.tv-embed .date-slider-wrap,
body.tv-embed .match-tabs,
body.tv-embed .tabs,
body.tv-embed .subtab-nav,
body.tv-embed .manage-btn,
body.tv-embed .sched-start-btn { display: none !important; }

/* --- Anordnungen (shared: Display, Editor-Vorschau, Thumbnails) --- */
.arr-1        { grid-template-areas: "a";         grid-template-columns: 1fr;       grid-template-rows: 1fr; }
.arr-2-cols   { grid-template-areas: "a b";       grid-template-columns: 1fr 1fr;   grid-template-rows: 1fr; }
.arr-2-rows   { grid-template-areas: "a" "b";     grid-template-columns: 1fr;       grid-template-rows: 1fr 1fr; }
.arr-3-left   { grid-template-areas: "a b" "a c"; grid-template-columns: 1.5fr 1fr; grid-template-rows: 1fr 1fr; }
.arr-3-right  { grid-template-areas: "b a" "c a"; grid-template-columns: 1fr 1.5fr; grid-template-rows: 1fr 1fr; }
.arr-3-top    { grid-template-areas: "a a" "b c"; grid-template-columns: 1fr 1fr;   grid-template-rows: 1.5fr 1fr; }
.arr-3-bottom { grid-template-areas: "b c" "a a"; grid-template-columns: 1fr 1fr;   grid-template-rows: 1fr 1.5fr; }
.arr-4        { grid-template-areas: "a b" "c d"; grid-template-columns: 1fr 1fr;   grid-template-rows: 1fr 1fr; }
.kiosk-grid > :nth-child(1), .tv-preview > :nth-child(1), .tv-lay-thumb > :nth-child(1) { grid-area: a; }
.kiosk-grid > :nth-child(2), .tv-preview > :nth-child(2), .tv-lay-thumb > :nth-child(2) { grid-area: b; }
.kiosk-grid > :nth-child(3), .tv-preview > :nth-child(3), .tv-lay-thumb > :nth-child(3) { grid-area: c; }
.kiosk-grid > :nth-child(4), .tv-preview > :nth-child(4), .tv-lay-thumb > :nth-child(4) { grid-area: d; }

/* --- Display /tv/<id> --- */
.tv-kiosk-page { margin: 0; height: 100vh; overflow: hidden; background: #000; }
.kiosk-stage { position: fixed; inset: 0; overflow: hidden; background: #000; }
.kiosk-grid {
  position: absolute; inset: 0;
  display: grid; gap: 6px; padding: 6px; box-sizing: border-box;
  opacity: 1; transform: translate(0, 0) scale(1);
  transition: opacity 1s ease, transform 1s ease;
}
/* Übergänge (gestapelt: neuer Screen .enter→normal, alter Screen →.exit) */
.anim-fade.enter    { opacity: 0; }
.anim-fade.exit     { opacity: 0; }
.anim-slide-h.enter { transform: translateX(100%); }
.anim-slide-h.exit  { transform: translateX(-100%); }
.anim-slide-v.enter { transform: translateY(100%); }
.anim-slide-v.exit  { transform: translateY(-100%); }
.anim-zoom.enter    { opacity: 0; transform: scale(1.06); }
.anim-zoom.exit     { opacity: 0; transform: scale(0.96); }
.kiosk-cell { position: relative; overflow: hidden; border-radius: 10px; background: var(--card); border: 1px solid var(--border); }
.kiosk-frame { width: 100%; height: 100%; border: 0; display: block; }
/* Interaktions-Block auf dem echten Display: liegt über dem iframe, schluckt
   Klicks/Fokus (TV soll nur anzeigen, nicht navigiert werden). */
.kiosk-cell-block { position: absolute; inset: 0; z-index: 2; }
.kiosk-cell-empty { background: #0a0d12; }
/* Hochgeladenes Medium (Event-Einladung etc.): ganze Kachel, vollständig
   sichtbar (contain) auf dunklem Grund. */
/* Medien-Kachel: Bild per JS platziert (Transform) + beschnitten (Crop, clip-path) */
.kiosk-media { display: block; }
/* Video-Kachel: füllt die Kachel komplett (cover), kein JS-Transform nötig. */
.kiosk-media-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.kiosk-empty { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: #000; color: var(--muted); text-align: center; font-family: sans-serif; }
/* WICHTIG: hidden-Attribut respektieren — sonst überdeckt der schwarze
   Empty-Layer (display:flex schlägt das UA display:none von [hidden]) das Grid. */
.kiosk-empty[hidden] { display: none; }
.kiosk-empty-title { font-size: 2rem; color: var(--text); margin-bottom: 0.5rem; }
.kiosk-empty-sub { font-size: 1.1rem; line-height: 1.5; }

/* --- Builder /admin/tv --- */
.tv-saved-toast { position: fixed; top: 70px; right: 1rem; z-index: 50; padding: 0.55rem 0.9rem; border-radius: 8px; background: var(--green); color: #fff; transition: opacity 0.5s ease; }
.tv-app { display: flex; gap: 1rem; align-items: flex-start; margin: 0 1rem 5rem; }
.tv-hint, .tv-empty { color: var(--muted); }
.tv-empty { padding: 2rem 1rem; text-align: center; }

.tv-sidebar { flex: 0 0 220px; position: sticky; top: 70px; }
.tv-add-device { width: 100%; margin-bottom: 0.7rem; }
.tv-nav { display: flex; flex-direction: column; gap: 0.2rem; }
.tv-dev { display: flex; flex-direction: column; }
.tv-dev-tab, .tv-screen-tab, .tv-screen-add {
  text-align: left; padding: 0.5rem 0.6rem; border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: var(--text); cursor: pointer; font-size: 0.92rem;
}
.tv-dev-tab { font-weight: 600; display: flex; align-items: center; gap: 0.45rem; }
.tv-dev-tab:hover, .tv-screen-tab:hover, .tv-screen-add:hover { background: var(--card); }
.tv-dev-tab.is-active { background: var(--card); border-color: var(--border); }
.tv-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: 0 0 auto; }
.tv-screen-tab { font-size: 0.86rem; color: var(--muted); }
.tv-screen-tab.is-active { color: var(--text); background: rgba(35,134,54,0.12); border-color: var(--green); }
.tv-screen-add { margin-left: 1.1rem; font-size: 0.82rem; color: var(--blue); }

/* Nav-Abschnitte (Playlists / Geräte) */
.tv-nav-sec { display: flex; flex-direction: column; gap: 0.2rem; }
.tv-nav-sec + .tv-nav-sec { margin-top: 0.9rem; }
.tv-nav-head {
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); padding: 0 0.6rem 0.25rem;
}
.tv-sec-add { text-align: left; padding: 0.5rem 0.6rem; border: 1px solid transparent;
  border-radius: 8px; background: transparent; color: var(--blue); cursor: pointer;
  font-size: 0.84rem; font-weight: 600; }
.tv-sec-add:hover { background: var(--card); }
.tv-dot-dev { background: var(--blue); }
.tv-dev-tab-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.tv-dev-tab-txt > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-dev-sub { font-size: 0.72rem; font-weight: 500; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Geräte-Editor: Playlist-Zuweisung */
.tv-assign { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin: 0.6rem 0; }
.tv-assign-label { font-weight: 600; font-size: 0.9rem; }
.tv-assign-sel { padding: 0.45rem 0.6rem; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg); color: var(--text);
  font-family: inherit; font-size: 0.9rem; min-width: 12rem; }
.tv-assign-hint { font-size: 0.82rem; color: var(--muted); margin: 0.4rem 0 0; max-width: 42rem; }
.tv-topbar-title { font-weight: 700; font-size: 1.05rem; }

/* Geräte-/Screen-Reihen: runder „−"-Löschknopf INNEN rechts in der Box */
.tv-dev-row, .tv-screen-row { position: relative; }
.tv-screen-row { margin-left: 1.1rem; }
.tv-dev-row .tv-dev-tab, .tv-screen-row .tv-screen-tab { width: 100%; padding-right: 2rem; }
.tv-del-btn {
  position: absolute; right: 0.4rem; top: 50%; transform: translateY(-50%);
  width: 1.3rem; height: 1.3rem; padding: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--card);
  color: var(--muted); cursor: pointer; font-size: 0.95rem; line-height: 1; z-index: 2;
  transition: color 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.tv-del-btn:hover { border-color: var(--red); color: var(--red); box-shadow: 0 0 8px rgba(218, 54, 51, 0.55); }

/* Screen-Reihenfolge per Drag & Drop: Grip links, Tab bekommt links Platz. */
.tv-screen-row .tv-screen-tab { padding-left: 1.5rem; }
.tv-grip {
  position: absolute; left: 0.3rem; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  width: 1.1rem; height: 1.4rem; z-index: 2;
  color: var(--muted); opacity: 0.45; font-size: 0.8rem; line-height: 1;
  cursor: grab; transition: opacity 0.12s, color 0.12s;
}
.tv-grip:hover { opacity: 1; color: var(--text); }
.tv-grip:active { cursor: grabbing; }
.tv-screen-row.tv-drop-over { box-shadow: inset 0 2px 0 0 var(--green); border-radius: 6px; }

.tv-main { flex: 1 1 auto; min-width: 0; }
.tv-dev-head { display: flex; align-items: flex-end; gap: 0.8rem; flex-wrap: wrap; }
.tv-dev-head .form-field { flex: 1 1 160px; }
.tv-url { margin: 0.5rem 0 0.9rem; font-size: 0.9rem; color: var(--muted); }
.tv-url a { color: var(--blue); }

.tv-toolbar { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; padding: 0.6rem 0.8rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 0.8rem; }
.tv-tool-group { display: flex; align-items: center; gap: 0.5rem; }
.tv-tool-label { font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.tv-toolbar input[type="number"] { width: 4.5rem; }

/* Form-Controls im TV-Builder ans dunkle Theme anpassen */
.admin-tv-page { color-scheme: dark; }
.tv-toolbar select,
.tv-toolbar input[type="number"],
.tv-fit-sec input[type="number"] {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 7px;
  padding: 0.4rem 0.55rem; font-family: inherit; font-size: 0.9rem;
}
.tv-toolbar select { cursor: pointer; }
.admin-tv-page input[type="checkbox"] { accent-color: var(--green); width: 1rem; height: 1rem; }
.admin-tv-page input[type="range"] { accent-color: var(--green); }
.tv-toolbar select:focus,
.admin-tv-page input:focus {
  outline: none; border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(35, 134, 54, 0.25);
}

/* Hinweis „Querformat" — nur Handy-Hochformat; blendet quer automatisch aus */
.tv-rotate-hint { display: none; }
@media (max-width: 760px) and (orientation: portrait) {
  .tv-rotate-hint {
    display: block; margin: 0.5rem 1rem 0.8rem; padding: 0.7rem 0.9rem;
    background: rgba(35, 134, 54, 0.12); border: 1px solid var(--green);
    border-radius: 10px; color: var(--text); font-size: 0.9rem; line-height: 1.45;
  }
}

/* Builder auf schmalen Screens: Sidebar stapelt über dem Hauptbereich */
@media (max-width: 760px) {
  .tv-app { flex-direction: column; gap: 0.7rem; }
  .tv-sidebar { position: static; flex: 1 1 auto; width: 100%; }
  .tv-main { width: 100%; }
  .tv-fit-row { flex-direction: column; }
  .tv-fit-cell { flex: 1 1 auto; min-width: 0; }
  .tv-topbar { margin: 0.5rem 0.8rem 1rem; }
  .tv-save-float { right: 0.8rem; bottom: 0.8rem; padding: 0.6rem 1.1rem; }
}

.tv-lay-pick { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.tv-lay-thumb { display: grid; width: 34px; height: 26px; gap: 2px; padding: 2px; background: var(--bg); border: 1px solid var(--border); border-radius: 5px; cursor: pointer; }
.tv-lay-thumb > span { background: var(--muted); border-radius: 1.5px; }
.tv-lay-thumb:hover { border-color: var(--blue); }
.tv-lay-thumb.is-active { border-color: var(--green); }
.tv-lay-thumb.is-active > span { background: var(--green); }

.tv-preview { display: grid; gap: 6px; width: 100%; aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--border); border-radius: var(--radius); padding: 6px; box-sizing: border-box; }
.tv-cell { position: relative; overflow: hidden; border-radius: 8px; background: var(--card); border: 1px solid var(--border); display: flex; }
.tv-cell-frame { width: 100%; height: 100%; border: 0; display: block; }
.tv-cell-static { pointer-events: none; }
.tv-cell.has-url { cursor: pointer; }
.tv-cell-overlay { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: space-between; gap: 0.4rem; padding: 0.35rem 0.5rem; background: linear-gradient(transparent 55%, rgba(0,0,0,0.75)); opacity: 0; transition: opacity 0.15s; }
.tv-cell.has-url:hover .tv-cell-overlay { opacity: 1; }
.tv-cell-path { font-size: 0.75rem; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-cell-edit { font-size: 0.75rem; font-weight: 700; color: var(--green); background: #fff; padding: 0.1rem 0.4rem; border-radius: 5px; flex: 0 0 auto; }
.tv-cell.is-empty { cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem; color: var(--muted); border-style: dashed; }
.tv-cell.is-empty:hover { border-color: var(--green); color: var(--text); }
.tv-cell-plus { font-size: 1.8rem; line-height: 1; }
/* Leere Kachel: zwei Auswahl-Karten (Seite / Datei) */
.tv-empty-pick { flex-direction: row !important; gap: 0.6rem; padding: 0.6rem; }
.tv-pick-card { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.15rem; background: var(--bg-secondary, #161b22); border: 1px solid var(--border); border-radius: 10px; color: var(--muted); cursor: pointer; padding: 0.9rem 0.5rem; font: inherit; transition: border-color 0.12s, color 0.12s, transform 0.06s; }
.tv-pick-card:hover { border-color: var(--green); color: var(--text); }
.tv-pick-card:active { transform: scale(0.98); }
.tv-pick-ico { display: flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 50%; background: rgba(46,160,67,0.15); color: var(--green); font-size: 1.3rem; line-height: 1; font-weight: 700; }
.tv-pick-lbl { font-weight: 700; color: var(--text); font-size: 0.95rem; }
.tv-pick-sub { font-size: 0.72rem; }
/* Medien-Kachel: zwei Modi (Transformieren + Zuschneiden) die zusammen wirken.
   Das Bild wird in BEIDEN Modi per JS gleich platziert (F = ganzes Bild). */
.tv-cell.has-media { align-items: center; justify-content: center; background: #0a0d12; overflow: hidden; touch-action: none; }
.tv-cell.has-media:not(.tv-crop-mode) { cursor: grab; }
.tv-cell.has-media.is-grab { cursor: grabbing; }
.tv-cell-media { display: block; user-select: none; pointer-events: none; }
/* Video-Kachel im Builder: füllt die Vorschau-Kachel (cover), keine Crop-Tools. */
.tv-cell.has-video { background: #0a0d12; }
.tv-cell-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
/* Transformieren: Zoom-Ecken sitzen AM BILD (per JS positioniert, zentriert) */
.tv-zoom-h { position: absolute; width: 16px; height: 16px; margin: 0; background: var(--green); border: 2px solid #fff; border-radius: 3px; box-sizing: border-box; transform: translate(-50%, -50%); touch-action: none; z-index: 4; }
.tv-zoom-h[data-c="tl"], .tv-zoom-h[data-c="br"] { cursor: nwse-resize; }
.tv-zoom-h[data-c="tr"], .tv-zoom-h[data-c="bl"] { cursor: nesw-resize; }
/* Zuschneiden: Crop-Box (per JS platziert) mit Ecken UND Kanten, außen abgedunkelt */
.tv-crop-box { position: absolute; box-sizing: border-box; border: 2px solid var(--green); box-shadow: 0 0 0 4000px rgba(0,0,0,0.5); cursor: move; z-index: 4; }
.tv-crop-h { position: absolute; width: 14px; height: 14px; background: var(--green); border: 2px solid #fff; border-radius: 3px; box-sizing: border-box; touch-action: none; }
.tv-crop-h.tl { left: -8px; top: -8px; cursor: nwse-resize; }
.tv-crop-h.tr { right: -8px; top: -8px; cursor: nesw-resize; }
.tv-crop-h.bl { left: -8px; bottom: -8px; cursor: nesw-resize; }
.tv-crop-h.br { right: -8px; bottom: -8px; cursor: nwse-resize; }
.tv-crop-h.t { left: 50%; top: -8px; margin-left: -7px; cursor: ns-resize; }
.tv-crop-h.b { left: 50%; bottom: -8px; margin-left: -7px; cursor: ns-resize; }
.tv-crop-h.l { top: 50%; left: -8px; margin-top: -7px; cursor: ew-resize; }
.tv-crop-h.r { top: 50%; right: -8px; margin-top: -7px; cursor: ew-resize; }
.tv-media-pages { position: absolute; right: 0.4rem; bottom: 0.4rem; font-size: 0.7rem; font-weight: 700; color: #fff; background: rgba(0,0,0,0.65); padding: 0.1rem 0.4rem; border-radius: 5px; pointer-events: none; z-index: 5; }
.tv-fit-note { font-size: 0.78rem; color: var(--muted); }
.tv-fit-nostream { font-size: 0.8rem; }
.tv-blur-hint { font-size: 0.78rem; color: var(--warn, #d97706); }
.tv-media-btns { display: flex; gap: 0.4rem; align-items: center; }
.tv-seg { display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; }
.tv-seg-btn { background: none; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); cursor: pointer; padding: 0.25rem 0.5rem; font: inherit; }
.tv-seg-btn.is-on { background: var(--green); border-color: var(--green); color: #0a0d12; }
.tv-seg-btn.icon { display: inline-flex; align-items: center; line-height: 0; }
/* Icon-Buttons */
.btn-sm.icon { display: inline-flex; align-items: center; justify-content: center; padding: 0.3rem 0.45rem; line-height: 0; color: var(--text); }
.btn-sm.icon.is-on { background: var(--green); border-color: var(--green); color: #0a0d12; }
.tv-btn-sep { width: 1px; align-self: stretch; background: var(--border); margin: 0 0.15rem; }
/* Buttons auf der Seiten-Kachel (Vorschau-Toggle + Groß-Bearbeiten) */
.tv-tile-btns { position: absolute; top: 0.45rem; right: 0.45rem; display: flex; gap: 0.35rem; z-index: 6; }
.tv-tile-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.25); background: rgba(13,17,23,0.92); color: #fff; cursor: pointer; line-height: 0; box-shadow: 0 2px 8px rgba(0,0,0,0.5); }
.tv-tile-btn svg { width: 16px; height: 16px; }
.tv-tile-btn:hover { background: var(--green); border-color: var(--green); color: #0a0d12; }
.tv-cell.has-url.is-preview { outline: 2px solid var(--green); outline-offset: -2px; }
/* Groß-Bearbeiten-Modal */
.tv-modal { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,0.82); display: flex; align-items: center; justify-content: center; padding: 2vh 2vw; overscroll-behavior: contain; }
.tv-modal[hidden] { display: none; }
.tv-modal-panel { background: var(--card); border: 1px solid var(--border); border-radius: 12px; width: min(96vw, 1100px); max-height: 96vh; display: flex; flex-direction: column; overflow: hidden; }
.tv-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--border); }
/* Frame scrollt seinen (skalierten) Inhalt; Scroll bleibt im Frame (kein
   Durchschlagen auf die Seite dahinter). */
.tv-modal-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #0a0d12; flex: 0 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.tv-modal-ctrls { display: flex; flex-wrap: wrap; gap: 0.7rem 1rem; align-items: center; padding: 0.7rem 0.8rem; border-top: 1px solid var(--border); }
/* Body-Scroll sperren, solange das Modal offen ist (Hintergrund bewegt sich nicht) */
body.tv-modal-open { overflow: hidden; }
/* Expand-/Vergrößern-Icon nur auf Touch-Geräten (Mobil), nicht am Desktop */
@media (hover: hover) and (pointer: fine) { .tv-tile-expand { display: none; } }
.tv-cell.is-editing { flex-direction: column; outline: 2px solid var(--green); outline-offset: -2px; }
.tv-cell.is-editing .tv-cell-frame { flex: 1 1 auto; height: auto; min-height: 0; }
.tv-cell-bar { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.3rem 0.5rem; background: var(--bg); border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.tv-cell-hint { font-size: 0.78rem; color: var(--muted); }
.tv-cell-actions { display: flex; gap: 0.35rem; flex: 0 0 auto; }

.btn-ghost { padding: 0.4rem 0.7rem; font-size: 0.85rem; border-radius: 8px; border: 1px solid var(--border); background: transparent; color: var(--text); cursor: pointer; }
.btn-ghost:hover { background: var(--card); }
.btn-del { color: var(--red); border-color: var(--red); }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.82rem; border-radius: 7px; border: 1px solid var(--border); background: var(--card); color: var(--text); cursor: pointer; }
.btn-save { min-width: 9rem; }

/* --- Builder v2: Topbar / Toast / TV-URL / Fit-Regler --- */
.tv-topbar { display: flex; align-items: center; gap: 0.6rem; margin: 0.6rem 1rem 1.6rem; }
.tv-topbar-spacer { flex: 1 1 auto; }
/* Topbar-Buttons sollen nicht die volle Breite einnehmen (.btn ist width:100%) */
.tv-topbar .btn { width: auto; padding: 0.55rem 1.2rem; font-size: 0.95rem; }
/* Speichern schwebt unten rechts und bleibt beim Scrollen/Zoomen sichtbar */
.tv-save-float {
  position: fixed; right: 1.3rem; bottom: 1.3rem; z-index: 55;
  width: auto; padding: 0.7rem 1.6rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
.tv-app { margin: 0 1rem 2.5rem; }
.tv-sidebar { padding-top: 0.2rem; }

/* top/z-index über der Admin-Subnav (endet bei ~92px, z-index 90) — sonst
   rendert der Toast teils hinter der zweiten Tab-Zeile und die erste Zeile
   ist unlesbar. */
.tv-toast { position: fixed; top: 100px; left: 50%; transform: translateX(-50%); z-index: 200; max-width: min(90vw, 420px); text-align: center; padding: 0.6rem 1rem; border-radius: 9px; color: #fff; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,0.4); }
.tv-toast.is-ok { background: var(--green); }
.tv-toast.is-err { background: var(--red); }

.tv-dev-head { align-items: center; }
.tv-name-field { flex: 1 1 220px; max-width: 340px; }
.tv-url { margin: 0.4rem 0 1rem; font-size: 0.92rem; color: var(--text); display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.tv-url-label { color: var(--muted); font-weight: 600; }
.tv-url-val { background: var(--card); padding: 0.2rem 0.45rem; border-radius: 6px; border: 1px solid var(--border); }
.tv-url-empty { color: var(--muted); font-style: italic; }

.tv-cell.has-url { cursor: default; }

.tv-fit-row { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.7rem; }
.tv-fit-cell { flex: 1 1 200px; min-width: 180px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.55rem 0.7rem; display: flex; flex-direction: column; gap: 0.35rem; }
.tv-fit-title { font-weight: 700; font-size: 0.85rem; }
.tv-fit-ctl { display: flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; color: var(--muted); }
.tv-fit-cell input[type="range"] { width: 100%; accent-color: var(--green); }
.tv-fit-ctl input[type="range"] { flex: 1 1 auto; width: auto; }
.tv-fit-sec { font-size: 0.85rem; color: var(--muted); }
.tv-fit-sec input { width: 4rem; padding: 0.3rem 0.45rem; }
.tv-fit-nav { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.tv-chip { padding: 0.2rem 0.5rem; font-size: 0.78rem; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); cursor: pointer; }
.tv-chip:hover { border-color: var(--green); color: var(--text); }
.tv-clear { align-self: flex-start; }

/* Scrollbars in eingebetteten TV-Seiten ausblenden (Auto-Scroll soll sauber sein) */
body.tv-embed { scrollbar-width: none; }
body.tv-embed::-webkit-scrollbar { display: none; }

/* ── Mobile: Back-Buttons nur als „←" (ohne Label) ──────────────────────
   Anton 2026-06-07: auf dem Handy nimmt „← Zurück/Begegnungen/…" zu viel
   Platz weg. Wir blenden das Label per font-size:0 aus und rendern den Pfeil
   als ::before neu — funktioniert für ALLE Back-Buttons („← <Label>") ohne
   jedes Template anzufassen. Steht am Datei-Ende, damit es die font-size aus
   .back-btn-inline (0.85rem) sicher überschreibt. */
@media (max-width: 640px) {
  .back-btn,
  .back-btn-inline {
    font-size: 0;
    padding-left: 0.6rem;
    padding-right: 0.6rem;
  }
  .back-btn::before,
  .back-btn-inline::before {
    content: "←";
    font-size: 0.95rem;
    font-weight: 600;
  }
}

/* ── Vereins-News (/news) ──────────────────────────────────────────── */
.news-compose .news-body-input { margin-top: .5rem; resize: vertical; }
.news-compose-opts { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-top: .5rem; }
.news-feed { display: flex; flex-direction: column; gap: .75rem; }
.news-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .9rem 1rem;
}
.news-card.is-pinned { border-color: #caa54a; }
.news-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.news-title { margin: 0; font-size: 1.02rem; font-weight: 700; line-height: 1.3; }
.news-body { margin-top: .4rem; line-height: 1.45; white-space: pre-wrap; }
.news-meta { margin-top: .5rem; font-size: .78rem; }
.news-del-form { margin: 0; flex: none; }

/* ===== News-Seite (2 Reiter, Aufklapp-Karten, Erstell-Dialog) ===== */
/* Vereinheitlicht mit .section-subnav/.section-tab (blaue Unterstrich-Leiste,
   volle Breite), damit die News-Tableiste zum Rest der App passt. */
.news-tabbar {
  display: flex; align-items: flex-end; gap: 1rem; margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.news-tabs {
  display: flex; gap: 0.2rem; flex: 1;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.news-tabs::-webkit-scrollbar { display: none; }
.news-tab {
  background: none; border: none; cursor: pointer; font: inherit;
  font-size: 0.85rem; font-weight: 600; color: var(--muted);
  padding: 0.5rem 0.9rem; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color 0.15s;
}
.news-tab:hover { color: var(--text); }
.news-tab.is-active { color: var(--text); border-bottom-color: var(--blue); }
.news-add-btn { margin-bottom: 0.4rem; flex: none; }
.news-add-btn {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: var(--blue); color: #fff; border: none; border-radius: var(--radius);
  padding: 0.45rem 0.8rem; font: inherit; font-weight: 600; cursor: pointer;
}
.news-add-btn svg { width: 18px; height: 18px; }

.news-panel { display: none; }
.news-panel.is-active { display: block; }
.news-feed { display: flex; flex-direction: column; gap: 0.7rem; }

.news-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 0.9rem 1rem;
}
.news-card.is-pinned { border-color: var(--blue); }
.news-card.is-expandable .news-card-head { cursor: pointer; }
.news-card-head { display: flex; align-items: flex-start; gap: 0.6rem; }
.news-card-titles { flex: 1; min-width: 0; }
.news-card-toprow { display: flex; gap: 0.4rem; align-items: center; margin-bottom: 0.2rem; }
.news-title { font-size: 1rem; font-weight: 700; color: var(--text); margin: 0; }
.news-subtitle { font-size: 0.88rem; color: var(--muted); margin-top: 0.15rem; }

.news-badge {
  font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
  padding: 0.12rem 0.4rem; border-radius: 4px;
}
.news-badge-event   { color: var(--blue); background: rgba(31,111,235,0.12); }
.news-badge-bericht { color: var(--green-lt, #3fb950); background: rgba(46,160,67,0.12); }
.news-pin-tag {
  font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--muted); border: 1px solid var(--border); padding: 0.1rem 0.38rem; border-radius: 4px;
}

.news-card .news-body { display: none; margin-top: 0.7rem; font-size: 0.92rem;
  line-height: 1.5; color: var(--text); }
.news-card.is-open .news-body { display: block; }
.news-card .news-body a { color: var(--blue); }
.news-bericht-link { display: inline-block; margin-top: 0.6rem; font-size: 0.85rem;
  font-weight: 600; color: var(--blue); text-decoration: none; }

.news-del-form { flex: none; }
.news-del-btn {
  background: none; border: none; cursor: pointer; color: var(--muted);
  padding: 0.2rem; border-radius: 6px; display: inline-flex;
}
.news-del-btn:hover { color: #f85149; background: var(--bg); }
.news-del-btn svg { width: 18px; height: 18px; }

/* Event-Karte: Datums-Badge links */
.news-event-card .news-card-head { align-items: center; }
.news-event-date {
  flex: none; text-align: center; min-width: 3.2rem;
  font-size: 0.78rem; font-weight: 700; color: var(--blue);
  background: rgba(31,111,235,0.1); border-radius: var(--radius); padding: 0.4rem 0.3rem;
  white-space: nowrap;
}

/* Erstell-Dialog */
.news-dialog {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--card); color: var(--text); padding: 0;
  width: min(92vw, 32rem); max-width: 92vw;
}
.news-dialog::backdrop { background: rgba(0,0,0,0.55); }
.news-create-form { display: flex; flex-direction: column; gap: 0.6rem; padding: 1.2rem; }
.news-dialog-head { display: flex; align-items: center; justify-content: space-between; }
.news-dialog-head h2 { font-size: 1.1rem; margin: 0; }
.news-dialog-close { background: none; border: none; color: var(--muted); cursor: pointer; padding: 0.2rem; }
.news-dialog-close svg { width: 22px; height: 22px; }

.news-type-seg { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.news-type-opt {
  flex: 1 1 0; text-align: center; cursor: pointer; font-size: 0.82rem; font-weight: 600;
  color: var(--muted); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.45rem 0.4rem; white-space: nowrap;
}
.news-type-opt input { position: absolute; opacity: 0; pointer-events: none; }
.news-type-opt.is-active { color: #fff; background: var(--blue); border-color: var(--blue); }
.news-field-label { font-size: 0.82rem; color: var(--muted); display: flex; flex-direction: column; gap: 0.2rem; }

.news-editor-toolbar { display: flex; gap: 0.3rem; }
.news-editor-toolbar button {
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); cursor: pointer; min-width: 2rem; padding: 0.3rem 0.5rem; font-size: 0.85rem;
}
.news-editor-toolbar button:hover { border-color: var(--blue); }
.news-body-input { min-height: 5rem; resize: vertical; }
.news-create-opts { display: flex; gap: 1.2rem; flex-wrap: wrap; margin-top: 0.2rem; }
.news-publish-btn { width: auto; margin-top: 0.4rem; align-self: flex-start; }

/* Tab-Nav auf /begegnung/<id> (Ergebnisse | Spielbericht) */
.bg-tabnav { display: flex; gap: 0.2rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); }
.bg-tabnav-btn {
  background: none; border: none; cursor: pointer; font: inherit;
  font-size: 0.9rem; font-weight: 600; color: var(--muted);
  padding: 0.5rem 0.9rem; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.bg-tabnav-btn.is-active { color: var(--text); border-bottom-color: var(--blue); }
.news-bericht-full .news-title { font-size: 1.15rem; }

/* News-Karten-Aktionen (Bearbeiten + Löschen) */
.news-card-actions { flex: none; display: flex; gap: 0.1rem; }
.news-edit-btn {
  color: var(--muted); padding: 0.2rem; border-radius: 6px; display: inline-flex;
}
.news-edit-btn:hover { color: var(--blue); background: var(--bg); }
.news-edit-btn svg { width: 18px; height: 18px; }
.news-create-h1 { font-size: 1.2rem; margin: 0.4rem 0 1rem; }
.news-create-form-page { display: flex; flex-direction: column; gap: 0.7rem; max-width: 40rem; }

/* Mini-Kalender im Events-Reiter */
.events-cal {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 0.8rem; margin-bottom: 1rem;
  max-width: 22rem;
}
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.cal-title { font-weight: 700; font-size: 0.95rem; }
.cal-nav {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 1.3rem; line-height: 1; width: 2rem; height: 2rem; border-radius: 50%;
}
.cal-nav:hover { color: var(--text); background: var(--bg); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-wd { text-align: center; font-size: 0.68rem; font-weight: 700; color: var(--muted); padding: 0.2rem 0; }
.cal-cell {
  text-align: center; font-size: 0.8rem; color: var(--text);
  padding: 0.35rem 0; border-radius: 6px; position: relative;
}
.cal-cell.is-empty { visibility: hidden; }
/* Heute: deutlich abgesetzte Farb-Umrandung (anders als das Blau der Events). */
.cal-cell.is-today { outline: 2px solid #d29922; outline-offset: -2px; }
.cal-cell.has-event {
  background: var(--blue); color: #fff; font-weight: 700; cursor: pointer;
}
.cal-cell.has-event:hover { filter: brightness(1.12); }

/* admin_begegnung: Spielbericht-Button rechts, Slot-Zahnrad, Bestätigen-Reihe */
.admin-header .bg-bericht-btn { margin-left: auto; }
.btn-icon .mbtn-svg { width: 17px; height: 17px; }
.lineup-confirm-row { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin-top: 0.9rem; }
.lineup-confirmed-tag { color: var(--green-lt, #3fb950); font-weight: 600; font-size: 0.9rem; }
.lineup-warn-tag { color: #d29922; font-size: 0.85rem; }

/* Spielbericht-Text auf /begegnung etwas Abstand zum Rand */
.news-bericht-full { padding: 0 1rem; }

/* admin_begegnung Header: alles in EINER Reihe — ← | Titel (… bei langen Namen) | Spielbericht. */
body.admin-begegnung-page .admin-header {
  justify-content: flex-start;
  gap: 0.6rem;
  flex-wrap: nowrap;
  padding: 0.7rem 1rem;
}
body.admin-begegnung-page .admin-header .back-btn {
  position: static; transform: none; left: auto; top: auto; flex: none;
}
body.admin-begegnung-page .admin-header h1 {
  flex: 1; min-width: 0; margin: 0; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 1.05rem;
}
body.admin-begegnung-page .admin-header .bg-bericht-btn { margin-left: 0; flex: none; }

/* ===========================================================================
   Öffentliche Sponsorenseite (/sponsoren) — Logo-Grid (Logo + Name, verlinkt)
   =========================================================================== */
.sponsor-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem;
}
.sponsor-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  background: #fff;                 /* heller Grund: Logos sind meist für Weiß gemacht */
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1rem;
  text-decoration: none;
  transition: transform 0.12s, box-shadow 0.12s;
}
.sponsor-card[href]:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.35); }
.sponsor-logo-wrap {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sponsor-logo { max-width: 88%; max-height: 100%; object-fit: contain; }
.sponsor-name { color: var(--blue); font-weight: 700; text-align: center; font-size: 0.95rem; }
@media (min-width: 760px) {
  .sponsor-grid { grid-template-columns: repeat(3, 1fr); }
}
