:root {
    box-sizing: border-box;
    --tp-font-scale: 1;

    /* SPALTEN DER SPIELPLAN-TABELLENZEILE (.match-tabular-row) — EINE Quelle.
       Es gab die Aufteilung zweimal: in schedule-view.js und in standings-templates.js,
       beide mit gleicher Auszeichnungskraft und !important. Welche gewann, entschied
       allein die Reihenfolge des Einhaengens — die Kopie aus standings-templates.js.
       Jede Aenderung an der Spielplan-Datei blieb dadurch wirkungslos. Deshalb steht die
       Aufteilung jetzt hier, in der immer geladenen Datei, und beide Stellen verweisen
       nur noch darauf. Wer die Spalten aendert, aendert sie hier.

       Zur Aufteilung selbst — die REIHENFOLGE der Zuteilung ist das Entscheidende.
       Das Raster verteilt in drei Schritten: (1) Sockel aller Spalten, (2) inhalts-
       abhaengige Spalten bis zu ihrer Grenze, (3) der Rest an die 1fr-Spalten. Daraus
       folgt die gewuenschte Rangfolge von selbst:
         - Die Teamspalten haben einen SOCKEL (7rem). Den bekommen sie in Schritt 1,
           noch bevor die Gruppenspalte waechst — der Gruppenname kann den Teamnamen
           also nie den Grundplatz wegnehmen.
         - Die Gruppenspalte ist fit-content: sie nimmt in Schritt 2 nur, was ihr Name
           WIRKLICH braucht (leer = 0, "Gr 1" = vier Zeichen), hoechstens 24 Zeichen.
         - Was danach uebrig ist, geht in Schritt 3 vollstaendig an die Teamspalten.
       NICHT min(24ch, max-content) schreiben — Schluesselwoerter wie max-content sind
       in min() nicht erlaubt, die GANZE Regel faellt dann aus und die Zeile bricht.

       Spalte 1 (Nr./Live-Punkt) und Spalte 3 (Gruppe) stehen bewusst NICHT hier drin:
       beide haengen an Merkmalen, die die einzelne Tabellenkarte setzt. Ein var() in
       einem eigenen Merkmal wird dort aufgeloest, wo das Merkmal DEKLARIERT ist — also
       hier an :root, wo die Karten-Merkmale niemand kennt. Sie waeren stumm auf ihre
       Vorgabe eingefroren. Deshalb setzen die Regeln sie selbst davor:
           grid-template-columns: var(--col1-width, 34px) 56px
                                  var(--tp-group-track) var(--tp-schedule-rest); */
    --tp-schedule-rest: minmax(7rem, 1fr) 58px minmax(7rem, 1fr) 32px 30px;

    /* SPALTEN DER PLANUNG (Gruppenkarten UND Lostoepfe) — EINE Quelle.
       Beide Raster muessen zeichengleich sein, sonst steht Topf 1 nicht ueber Gruppe 1.
       Sie stehen in zwei verschiedenen Dateien (labs-groups.js, plan-algorithms.js) und
       liefen genau deshalb schon einmal auseinander.

       Die 340px sind gemessen, nicht geschaetzt: Bei 280px Kartenbreite blieben fuer den
       Teamnamen 65px (die Knoepfe der Slot-Zeile brauchen 130px, Wappen/Kuerzel/Abstaende
       weitere 83px) — selbst zweizeilig reichte das fuer laengere Namen nicht. Ab 340px
       stehen auch 20-Zeichen-Namen vollstaendig.
       Folge fuer den Umbruch: zwei Karten nebeneinander erst ab 2x340 + 10 Abstand = 690px
       Seitenbreite. Vorher lag die Schwelle bei 570px — dort standen zwar zwei Karten
       nebeneinander, aber jede nur ~280px breit, also zu schmal zum Lesen. Genau der
       Bereich, in dem Namen abgeschnitten waren. */
    --tp-planning-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));

    /* Die Gruppenspalte — Vorgabe fuer den Fall, dass noch nichts gemessen wurde.
       Sie MUSS in allen Zeilen einer Karte gleich breit sein, sonst wandert alles
       rechts davon (Ergebnis, Teamnamen) von Zeile zu Zeile — genau das ist am
       11.08.2026 passiert, als hier fit-content pro Zeile wirkte. tpGruppenspalteAngleichen()
       in schedule-view.js misst deshalb den laengsten Gruppennamen JE KARTE und setzt
       dort eine feste Breite. Diese Vorgabe greift nur bis zur ersten Messung. */
    --tp-group-track: fit-content(24ch);
}

html.tp-font-large { --tp-font-scale: 1.12; }
html.tp-font-xlarge { --tp-font-scale: 1.25; }

/* GRUNDGRÖSSE FÜR BEDIENELEMENTE — der Grund, warum Knöpfe „zu groß" wirkten.
   Gezählt am 09.08.2026: 683 Knöpfe, Auswahllisten und Eingabefelder im Programm
   bringen KEINE eigene Schriftgröße mit, 620 bringen eine mit. Ohne Angabe erben
   sie 16 px (Auswahllisten sogar die Browser-Vorgabe 13,33 px) — während die
   Elemente ringsum bei 11–13 px liegen. Genau deshalb stachen „Weiter →" und
   „Planung abschließen" aus der Planungshilfe heraus.

   Eine Regel statt 683 Inline-Angaben. Wer eine eigene Größe mitbringt, behält sie:
   Ein Inline-Style schlägt jede Regel, und diese hier hat bewusst die niedrigste
   Spezifität (0,0,1), damit auch jede Klassenregel gewinnt.

   WARUM 12 UND NICHT 13 PX (09.08.2026 nachgezogen): Mit --fs-md (13px) wirkten
   Knopfbeschriftungen und Auswahlfelder weiterhin zu schwer — sie stehen fett
   (600/700) neben Erläuterungen in 11px und lagen damit ÜBER den Schrittnamen
   der Planungshilfe (12px). Jetzt liegen Bedienelemente auf derselben Stufe wie
   diese und eine Stufe unter den Feldbeschriftungen (13px). Auf kleinen
   Bildschirmen passt dadurch spürbar mehr auf eine Seite.

   NICHT VERWECHSELN: Die Bedienelemente wachsen sehr wohl mit dem
   Vergrößerungsschalter — an der ausgelieferten Fassung nachgemessen, 100 → 125 %
   ergibt bei allen exakt Faktor 1,25. Dass der Knopf dabei kaum größer AUSSIEHT,
   liegt an seinen festen Innenabständen (10/20px): Der Kasten bleibt fast gleich,
   während die Schriftleiste daneben sichtbar umbricht. */
/* Das `html` davor ist KEIN Schmuck — ohne es ist die Regel wirkungslos.
   Tailwinds Preflight bringt mit
       button,input,optgroup,select,textarea { … font-size:100% … }
   dieselbe Spezifität (0,0,1) mit, wird von Tailwind Play aber ZUR LAUFZEIT
   hinter style_v2.css in den Kopf gehängt. Bei Gleichstand gewinnt das spätere
   Stylesheet — `font-size:100%` heißt „erbe vom Elternteil", also 16px.
   Mit `html` davor steht die Regel bei (0,0,2) und gewinnt. Klassenregeln
   (0,1,0) und Inline-Styles schlagen sie weiterhin, wie beabsichtigt.

   ACHTUNG BEIM PRÜFEN: Ohne geladenes Tailwind ist der Fehler NICHT
   reproduzierbar — ein Messaufbau ohne `vendor/tailwind-play-3.4.js` zeigt
   fälschlich die richtige Größe. Gleiches Muster wie beim `svg{display:block}`
   aus demselben Preflight. */
html button,
html select,
html input,
html textarea {
    font-size: var(--fs-sm);
}

/* ============================================================================
   ÜBERSCHRIFTEN-SKALA

   ZUM ÄNDERN: Nur die sechs Zeilen unten anfassen. Jede Ebene besteht aus
   GRÖSSE (ein --fs-*-Token) und GEWICHT (ein --weight-*-Token). Beide Skalen
   sind im :root-Block weiter unten dokumentiert. Keine Zahlen hier eintragen —
   sonst wächst die Überschrift nicht mit dem Schriftgrößen-Schalter mit.

   WARUM ES DIESE REGEL BRAUCHT: Tailwinds Preflight setzt
       h1,h2,h3,h4,h5,h6 { font-size:inherit; font-weight:inherit }
   und wird zur Laufzeit HINTER style_v2.css geladen. Ohne Gegenregel rendern
   alle Überschriften mit 16px und Gewicht 400 — also wie Fließtext. Gemessen am
   09.08.2026: von 123 Überschriften im Programm brachten 61 eine eigene Größe
   mit, die übrigen 62 sahen aus wie normaler Text.
   Das `html` davor ist Pflicht: (0,0,2) schlägt Preflight (0,0,1). Klassenregeln
   und Inline-Styles gewinnen weiterhin — bestehende Überschriften mit eigener
   Größe bleiben also unberührt.

   WARUM KLEINER STATT GRÖSSER: Eine Überschrift muss nicht groß sein, um als
   Überschrift zu lesen — das Gewicht trägt die Hierarchie. Der Fließtext liegt
   hier bei 13px, Hinweise bei 11px; 16px sind in diesem Umfeld bereits viel.
   h3 (35 der 62 Fälle) geht deshalb von 16px/400 auf 15px/600: deutlicher als
   Überschrift erkennbar UND platzsparender als vorher. Dasselbe bei h4.

       Ebene   Größe            Gewicht   px    Verwendung
       h1      --fs-3xl         strong    20    Seitentitel (3×)
       h2      --fs-2xl         strong    18    Dialogtitel (17×)
       h3      --fs-lg          bold      15    Abschnittstitel (35×)
       h4      --fs-base        bold      14    Untertitel (7×)
       h5      --fs-md          bold      13    wie Fließtext, nur fett
       h6      --fs-sm          bold      12    kleinste Ebene

   ABSTÄNDE BLEIBEN BEI NULL. Preflight setzt zusätzlich `margin:0` auf alle
   Überschriften; das ist hier absichtlich NICHT zurückgenommen. Die Abstände
   kommen im ganzen Programm von den umgebenden Behältern (flex/grid mit gap).
   Wer hier Ränder ergänzt, verschiebt Layouts an 123 Stellen gleichzeitig.
   ============================================================================ */
html h1 { font-size: var(--fs-3xl); font-weight: var(--weight-strong); }
html h2 { font-size: var(--fs-2xl); font-weight: var(--weight-strong); }
html h3 { font-size: var(--fs-lg); font-weight: var(--weight-bold); }
html h4 { font-size: var(--fs-base); font-weight: var(--weight-bold); }
html h5 { font-size: var(--fs-md); font-weight: var(--weight-bold); }
html h6 { font-size: var(--fs-sm); font-weight: var(--weight-bold); }

/* BEREICHE, DIE NICHT MITWACHSEN.
   Kopfzeile, Navigation, Seitenleiste und die scrollenden Listen haben eine feste
   Höhe; wachsende Schrift bricht dort das Gerüst.

   Das ersetzt `TP_FONT_SCALE_STABLE_LAYOUT_SELECTOR` aus script.js, wo dieselbe
   Liste als Zeichenkette stand und bei JEDEM Element per el.matches() geprüft wurde.
   `#phase-wizard-modal` stand dort ebenfalls drin, gehört hier aber NICHT hinein:
   Die Planungshilfe SOLL mitwachsen — sie war nur vom Laufzeit-Durchlauf
   ausgenommen, weil sie ihre Vergrößerung über eigene CSS-Regeln bekam.

   WARUM HIER ALLE ZWÖLF TOKEN NOCH EINMAL STEHEN — und `--tp-font-scale: 1` allein
   NICHT genügt (im Browser nachgemessen, erster Versuch ist daran gescheitert):
   Der Wert einer benutzerdefinierten Eigenschaft wird DORT ausgerechnet, wo sie
   deklariert ist. `--fs-sm` steht in `:root`, wird also mit dem Faktor des
   Wurzelelements zu `calc(0.75rem * 1.25)` aufgelöst — und dieser fertige Wert wird
   vererbt. Ein späteres `--tp-font-scale: 1` weiter unten im Baum ändert daran
   nichts mehr, weil `--fs-sm` nicht neu ausgerechnet wird. Deshalb setzen diese
   Container die Größen selbst, ohne Faktor. Bei Änderungen an der Skala: beide
   Blöcke anfassen. */
.app-header,
.main-nav,
#desktop-sidebar,
.tp-no-font-scale,
.tournament-list-scroll,
.template-list-scroll,
.hierarchy-team {
    --tp-font-scale: 1;
    --fs-3xs: 0.5625rem;
    --fs-2xs: 0.625rem;
    --fs-xs: 0.6875rem;
    --fs-sm: 0.75rem;
    --fs-md: 0.8125rem;
    --fs-base: 0.875rem;
    --fs-lg: 0.9375rem;
    --fs-xl: 1rem;
    --fs-2xl: 1.125rem;
    --fs-3xl: 1.25rem;
    --fs-4xl: 1.375rem;
    --fs-5xl: 1.5rem;
}

.first-phase-next-step-card {
    scroll-margin-top: 120px;
}

body.dark-mode .first-phase-next-step-card {
    background: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .first-phase-next-step-card h3 {
    color: #f1f5f9 !important;
}

body.dark-mode .first-phase-next-step-card p {
    color: #94a3b8 !important;
}

body.dark-mode .first-phase-secondary-action {
    background: rgba(15, 23, 42, 0.55) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #cbd5e1 !important;
}

@media (max-width: 700px) {
    .first-phase-next-step-card {
        flex-direction: column !important;
        align-items: stretch !important;
        margin-left: 10px !important;
        margin-right: 10px !important;
    }

    .first-phase-next-step-card > div:last-child {
        flex-wrap: wrap !important;
    }

    .first-phase-next-step-card button {
        flex: 1 1 180px !important;
        justify-content: center !important;
    }
}

#guest-mode-banner {
    box-sizing: border-box !important;
    background: #ede9fe !important;
    opacity: 1 !important;
    z-index: 1200 !important;
    box-shadow: 0 1px 8px rgba(15, 23, 42, 0.08) !important;
    isolation: isolate;
}

body.dark-mode #guest-mode-banner {
    background: #211b3d !important;
}

#guest-mode-banner > span {
    min-width: 0;
    text-align: center;
}

@media (min-width: 900px) {
    #guest-mode-banner {
        margin-left: var(--seitenleiste-breite) !important;
        width: calc(100% - var(--seitenleiste-breite)) !important;
    }
}

.tp-font-size-control {
    width: 100%;
    border: 1px solid var(--border-color, #e2e8f0);
    background-color: var(--bg-card, #ffffff);
    color: var(--text-main, #1e293b);
    border-radius: 8px;
    padding: 7px 10px;
    font-size: var(--fs-md);
    font-weight: var(--weight-bold);
    outline: none;
    cursor: pointer;
    text-align: center;
    /* Kein Aufklapp-Pfeil – schafft vollen Platz für die Zahl. Das Dropdown öffnet
       trotzdem weiterhin per Klick (appearance:none entfernt nur die Pfeil-Grafik). */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

body.dark-mode .tp-font-size-control {
    background-color: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}
.dark-mode .tp-segmented-control { background: rgba(15, 23, 42, 0.9); border: 1px solid rgba(255,255,255,0.07); padding: 3px; border-radius: 10px; }
body.dark-mode .tp-segmented-item { color: var(--text-body) !important; background: transparent !important; border: none !important; }
body.dark-mode .tp-segmented-item.active { background: var(--primary-fill-bg) !important; color: var(--primary-fill-fg) !important; border: 1px solid var(--primary-fill-border) !important; }

*,
*::before,
*::after {
    box-sizing: inherit;
}

body {
    font-weight: var(--weight-normal);
    -moz-osx-font-smoothing: grayscale;
    user-select: none;
    -webkit-user-select: none;
    caret-color: transparent;
}

input, textarea, .inline-input, [contenteditable="true"] {
    user-select: text !important;
    -webkit-user-select: text !important;
    caret-color: auto !important;
}

button,
input,
select,
textarea {
    font-family: inherit;
    font-weight: inherit;
}

:root {
    /* ============================================================================
       EBENEN (z-index) — DIE LEITER
       ============================================================================
       Gemessen am 31.08.2026: 216 z-index-Angaben mit 51 verschiedenen Werten, davon
       93 ueber 100.000, Hoechstwert 2147483647 (das Maximum eines 32-Bit-Ganzwerts).
       Ursache ist keine Absicht, sondern ein Fehlen: Es gab keine Leiter, also hat sich
       jede neue Funktion ihre eigene Zahl fuer „ganz sicher oben" ausgedacht.

       DIESE WERTE SIND NICHT FREI GEWAEHLT. Jeder entspricht genau dem Anker der
       Gruppe, die heute schon dort liegt — neuer Code, der ein Token benutzt, landet
       damit zwischen dem Bestand an der richtigen Stelle, ohne dass eine einzige alte
       Zahl angefasst werden muss.

       NEUER CODE NIMMT AUSSCHLIESSLICH DIESE TOKEN. `pruefe-ebenen.js` haelt fest,
       wie viele rohe Zahlen jede Datei noch hat; die Zahl darf nur fallen.

       Der Bestand ist BEWUSST noch nicht umgestellt: Zwischen 99.999 und 320.000 und
       zwischen 999.997 und 1.000.002 liegen Werte, deren Reihenfolge garantiert ist
       (ein Toast MUSS ueber dem Dialog liegen, aus dem er kommt). Sie auf eine Sprosse
       zusammenzuziehen wuerde diese Garantie durch die DOM-Reihenfolge ersetzen — eine
       Aenderung, die sich erst im Betrieb zeigt. Das gehoert einzeln gemessen.
       ============================================================================ */
    /* Breite der Seitenleiste. Als Token, weil DREI Stellen sie kennen muessen:
       die Leiste selbst, der Inhaltsbereich daneben und das Gast-Banner. Vorher
       stand die 220 dreimal fest im Blatt — eine davon zu aendern haette den
       Inhalt unter die Leiste geschoben. Der schmale Zustand aendert nur dieses
       eine Token (siehe body.seitenleiste-schmal). */
    --seitenleiste-breite: 220px;
    /* Gemeinsame Box der drei Symbole am rechten Rand der Seitenleiste
       (Einklappen, Stift, Abmelden) — sie haelt sie auf einer Achse. */
    --tp-rechte-symbolbox: 28px;
    --z-inhalt: 10;
    /* im Fluss gestapelt: Spalten, Marker, Statusstreifen */
    --z-haftend: 100;
    /* haftende Kopfzeilen und Leisten */
    --z-rahmen: 1000;
    /* Kopfzeile, Seitenleiste, Gast-Banner, Fusszeilen-Kennzeichen */
    --z-menue: 10000;
    /* Aufklapper, Untermenues, Tooltips */
    --z-dialog: 100000;
    /* Dialoge */
    --z-dialog-2: 200000;
    /* Waehler, die AUS einem Dialog aufgehen (Phasenwahl, Farbwahl) */
    --z-antwort: 400000;
    /* Antworten, die ueber JEDEM Dialog liegen muessen: Freigabe-Hinweis,
       Anmelde-Aufforderung. Gemessen am 31.08.2026 lagen sie auf 100000 und
       verschwanden damit hinter der Planungshilfe (100050) und hinter den
       Druckdialogen (200000) - der Nutzer klickte auf einen Pro-Hinweis oder auf
       "Excel" und es passierte SCHEINBAR nichts, obwohl der Dialog im Dokument
       stand. 400000 raeumt jeden Dialog (hoechster Bestand: 320000), bleibt aber
       unter Toasts und Meldungen: Ein Hinweis, der WAEHREND der Aufforderung
       kommt, soll weiter obenauf liegen. */
    --z-schwebend: 1000002;
    /* Toasts und Popover — liegen ueber JEDEM Dialog */
    --z-meldung: 10000000;
    /* Alerts, Bestaetigungen, Zahlenfelder — die oberste Ebene */

    /* Color Palette - Fresh Mint (Teal) Theme */
    --primary-hue: 175;
    /* Teal */
    --color-primary: #0f8378;
    --accent-hue: 35;
    /* Soft Gold */

    /* Backgrounds */
    --bg-app: #ffffff;
    --bg-header: #ffffff;
    --bg-card: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-subtle: #f1f5f9;
    --bg-base: #f8fafc;
    --bg-elevated: #ffffff;
    --bg-hover: #f1f5f9;
    --bg-input: #ffffff;

    /* Borders */
    --border-subtle: #f1f5f9;

    /* Text */
    --text-main: #1e293b;
    /* Neutral Dark Slate */
    --text-secondary: #334155;
    /* Neutral Slate 500 */
    --text-inverted: #ffffff;

    /* Brand Colors */
    --brand-primary: var(--primary-strong);
    /* Rich Teal */
    --brand-secondary: hsl(var(--primary-hue), 25%, 90%);
    /* Light Mint accents */

    --accent-gold: hsl(var(--accent-hue), 90%, 55%);

    /* Semantic Status Colors */
    --color-success: #16a34a;
    --bg-success: #f0fdf4;
    --text-success-bold: #166534;
    --border-success-subtle: #bbf7d0;
    --color-danger: #dc2626;
    --bg-danger: #fef2f2;

    /* Rot und Grün als SCHRIFT brauchen eigene Token: --color-danger wird im
       Dunkelmodus dunkler (#dc2626) – als Knopffläche richtig, als Text auf
       dunklem Grund aber schlechter lesbar. */
    --accent-red-text: #dc2626;
    --text-success: #16a34a;

    /* ------------------------------------------------------------------
       ZIELPALETTE — sieben Familien, je vier Rollen.
       Jede Familie hat GENAU EINEN Ton pro Rolle. Wer eine fünfte Nuance
       zu brauchen glaubt, hat in Wirklichkeit eine Bedeutung übersehen.

         Vollfläche  --color-<rolle>          kräftig, für Knöpfe
         Fläche      --accent-<farbe>-bg      getönt, für Kästen
         Rahmen      --accent-<farbe>-border
         Schrift     --accent-<farbe>-text

       Marke   Türkis   --color-primary / --primary-strong / --primary-soft-bg
                        / --primary-soft-border          ← EINZIGE AUSNAHME beim Namen

       TÜRKIS: FLÄCHE UND SCHRIFT SIND ZWEI ROLLEN — nicht vermischen.
         --color-primary  #0f8378   NUR als Fläche (Knöpfe, gefüllte Marken-Flächen)
         --primary-strong #0f766e / dunkel #5eead4   NUR als Schrift und Symbole

       Bis 09.08.2026 trug beides #0d9488 und erreichte in BEIDEN Rollen nur 3,74:1.
       Ein einziger Wert kann das nicht lösen: Im Dunkelmodus muss eine Fläche unter
       weißer Schrift DUNKLER werden, Schrift auf dunklem Grund aber HELLER. 189
       Stellen benutzten die Fläche als Schrift und sind auf --primary-strong
       umgestellt; danach durfte die Fläche dunkler werden.

       Gemessen:
         Fläche #0f8378   weiße Schrift 4,63:1
                          hebt sich ab von heller Seite 4,42 · dunkler Karte 3,16
         Schrift --primary-strong   hell 5,47 auf Weiß · dunkel 9,89 auf der Karte

       Ein Wert für BEIDE Modi ist Absicht: #0f7d72 wäre bei weißer Schrift etwas
       besser (5,00), höbe sich im Dunkelmodus aber nur mit 2,92 ab — unter den 3:1
       für Bedienelemente. #0f8378 schafft beide Schwellen in beiden Modi.

       WER HIER ETWAS ÄNDERT prüft bitte drei Zahlen: weiße Schrift auf der Fläche
       (≥4,5), Abhebung der Fläche vom Grund (≥3), und --primary-strong als Schrift
       (≥4,5 in beiden Modi).

         Türkis ist die Marke und heißt durchgängig `--primary-*`, nicht `-teal-`.
         Bis 09.08.2026 gab es BEIDES nebeneinander und damit ZWEI Töne pro Rolle:
         Fläche #f0fdfa neben #ccfbf1, Rahmen #99f6e4 neben #5eead4. Genau das
         verletzte die Regel oben, und im Programm sah es nach „verschiedensten
         Grüntönen" aus. Der blassere Ton hat jeweils gewonnen (Entscheidung des
         Nutzers), `--accent-teal-bg` und `--accent-teal-border` sind entfallen —
         51 Verweise umgestellt. NICHT wieder einführen.
       Erfolg  Grün     --color-success  / -green-
       Hinweis Bernstein --color-warning / -amber-   (Gelb und Orange gehen hier auf)
       Gefahr  Rot      --color-danger   / -red-     (Pink geht hier auf)
       Info    Blau     --color-info     / -blue-
       Beta    Violett  --color-violet   / -violet-
       Neutral          --surface-* / --border-* / --text-*
       ------------------------------------------------------------------ */
    --color-warning: #f59e0b;
    --color-info: #3b82f6;
    --color-violet: #7c3aed;
    --accent-amber-text: #b45309;
    /* Die Zahl im Stepper – EINE Stelle für alle Stepper (Phasen-Editor, Planungshilfe,
       Schiri-Bereich). Vorher trugen einige `--text-strong`, wodurch sie im Dunkelmodus
       weiß statt grün waren, während alle anderen grün blieben. */
    --stepper-value: #0f766e;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);

    /* Light mode card shadow for visibility */
    --card-shadow-light: 0 1px 3px rgba(0, 0, 0, 0.1);

    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 8px;

    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* SCHRIFTSTÄRKEN — es gibt GENAU DIESE VIER, mehr kann die Schrift nicht.
       In fonts/ liegen vier Inter-Schnitte (Regular 400, Medium 500, SemiBold 600,
       Bold 700), keine variable Schrift. Gemessen (Inter, 20px, gleicher Text):
       400 → 301,44 px · 500 → 304,76 · 600 → 308,05 · 700 → 311,35.
       Alles über 700 fällt nach der CSS-Zuordnungsregel auf 700 zurück: 800, 850,
       900 und 950 sehen IDENTISCH aus wie 700 — sie sehen im Quelltext nur nach
       einer Abstufung aus, die es auf dem Bildschirm nicht gibt. Ebenso 650 → 700.
       Wer eine fünfte Stufe zu brauchen glaubt, braucht in Wahrheit eine andere
       Größe oder Farbe. Neue Zahlenwerte bitte NICHT einführen — `node
       pruefe-schrift.js` meldet sie. */
    --weight-normal: 400;
    --weight-medium: 500;
    --weight-bold: 600;
    --weight-strong: 700;

    /* SCHRIFTGRÖSSEN — zwölf Stufen für Text, 9 bis 24 px.
       Vor der Umstellung standen hier 177 verschiedene Werte an 3.306 Stellen, kein
       einziger über ein Token, dazu px und rem gemischt (11,5px neben 0,72rem).

       WARUM rem UND WARUM calc: Die Größen tragen den Vergrößerungsfaktor selbst.
       Vorher konnte `--tp-font-scale` gar nicht wirken, weil die Größen fest im
       style-Attribut standen — die Vergrößerung war deshalb DREIFACH gebaut: eine
       Prozentregel, 24 Textsuch-Regeln mit !important (nur für die Planungshilfe)
       und ein Laufzeit-Durchlauf durch den DOM. Alle drei sind entfallen.
       ACHTUNG: rem reagiert NICHT auf die Schriftgröße eines Containers; eine Regel
       wie `.dialog { font-size: 112% }` vergrößert rem-Kinder nicht. Der Faktor MUSS
       deshalb im Token stecken.

       Bereiche, die NICHT mitwachsen sollen, setzen `--tp-font-scale: 1` (siehe
       unten bei .tp-no-font-scale) — die Kinder erben das.

       Über 24 px wird bewusst NICHT tokenisiert: Das sind Emoji (📺 📝 ⚠️),
       Timer-Ziffern und Ergebniszahlen, keine Fließtexte. Sie gehören nicht auf eine
       Textskala; eine Zwölf-Stufen-Skala hätte 4rem auf 24 px gestaucht (−62 %).

       Neue Zwischengrößen bitte NICHT einführen — `node pruefe-schrift.js` meldet sie. */
    --fs-3xs: calc(0.5625rem * var(--tp-font-scale));  /*  9px */
    --fs-2xs: calc(0.625rem * var(--tp-font-scale));   /* 10px */
    --fs-xs: calc(0.6875rem * var(--tp-font-scale));   /* 11px */
    --fs-sm: calc(0.75rem * var(--tp-font-scale));     /* 12px */
    --fs-md: calc(0.8125rem * var(--tp-font-scale));   /* 13px */
    --fs-base: calc(0.875rem * var(--tp-font-scale));  /* 14px */
    --fs-lg: calc(0.9375rem * var(--tp-font-scale));   /* 15px */
    --fs-xl: calc(1rem * var(--tp-font-scale));        /* 16px */
    --fs-2xl: calc(1.125rem * var(--tp-font-scale));   /* 18px */
    --fs-3xl: calc(1.25rem * var(--tp-font-scale));    /* 20px */
    --fs-4xl: calc(1.375rem * var(--tp-font-scale));   /* 22px */
    --fs-5xl: calc(1.5rem * var(--tp-font-scale));     /* 24px */

    --header-item-height: 44px;
    --border-color: #e2e8f0;
    --stripe-width: 6px;

    /* ===================================================================
       FARB-TOKEN FÜR INLINE-STYLES  (angelegt 02.08.2026)
       -------------------------------------------------------------------
       In den JS-Dateien stecken rund 3.000 fest eingebaute Farben in
       style="…"-Attributen. Ein Inline-Style schlägt JEDE Regel aus dieser
       Datei – der einzige Weg dagegen war bisher !important (davon gibt es
       inzwischen über 1.600). Die Werte hier unten sind der Ausweg: Die
       Inline-Styles verweisen künftig auf diese Variablen statt auf feste
       Farben. Sie gewinnen weiterhin gegen alles, der WERT kommt aber aus
       genau einer Zeile – und der Dunkelmodus greift automatisch.

       REGEL: Der Hellwert ist exakt das Literal, das er ersetzt. Damit ist
       jede Umstellung im Hellmodus nachweislich wirkungslos; nur der
       Dunkelmodus ändert sich (zum Besseren).

       Warum eigene Flächen-Token statt --bg-subtle/--bg-secondary: Deren
       Dunkelwert ist `transparent`. Sie zu verwenden würde im Dunkelmodus
       über 570 Flächen durchsichtig machen. Deshalb --surface-*.
       =================================================================== */
    /* ===================================================================
       GRAUSTUFEN FÜR TEXT — fünf, nicht sechs (seit 09.08.2026).

       `--text-muted` (#64748b) ist entfallen und in `--text-body` (#475569)
       aufgegangen. Beide trugen im DUNKELMODUS ohnehin denselben Wert (#94a3b8),
       im Hellmodus lagen sie eine Rampenstufe auseinander und wurden für dieselbe
       Rolle benutzt — Erläuterungstexte unter einer Beschriftung.

       Der dunklere Ton hat gewonnen (Entscheidung des Nutzers). Damit steigt der
       Kontrast dieser 593 Stellen auf weißem Grund von 4,76:1 auf 7,58:1.
       Begründung: Erläuterungen wie „Wie viele Gruppen gespielt werden." liest
       gerade, wer unsicher ist — da ist Lesbarkeit wichtiger als Leichtigkeit.

       Die verbleibende Rampe, jeweils Kontrast auf Weiß:
         --text-strong    #0f172a   17,85:1   Überschriften, Werte
         --text-main      #1e293b   14,63:1   Fließtext im Hauptbereich
         --text-secondary #334155   10,35:1   Beschriftungen
         --text-body      #475569    7,58:1   Erläuterungen, Bedienelemente
         --text-subtle    #647186    4,94:1   Labels, inaktive Zustände

       `--text-subtle` trug bis 09.08.2026 #94a3b8 und erreichte damit nur 2,56:1 —
       unter den 3:1, die selbst für große Schrift gefordert sind, bei 601 Stellen
       (u. a. den noch nicht erreichten Schritten der Planungshilfe, 12px).
       Der neue Wert ist der HELLSTE, der auf allen gängigen Flächen 4,5:1 schafft:
         weiß 4,94  ·  --surface-page 4,72  ·  --surface-soft 4,51  ·  --primary-soft-bg 4,74
       Dunkelmodus entsprechend #64748b → #8b98ab (auf --bg-card 5,00, auf der
       Seitenfläche 6,10; vorher 3,07 bzw. 3,76).

       FOLGE FÜRS AUGE: Der Ton ist deutlich kräftiger als vorher, die Abstufung zu
       `--text-body` dadurch geringer. Das ist der Preis der Lesbarkeit. Wer ihn
       zurücknehmen will, findet die Zwischenstufen hier: #818da0 = 3,36:1,
       #78849a = 3,77:1 — beide reichen nur für Schrift ab 18px.

       ACHTUNG: Eigene Dokumente (reports-print.js, live-display-control-center.html,
       auth.js/schedule-view.js-Druckfenster, Landingpage) bringen ihr EIGENES
       --text-muted mit und wurden bewusst nicht angefasst.
       =================================================================== */
    --text-subtle: #647186;          /* schwächster Text, Labels        (645×) */
    --text-body: #475569;            /* Erläuterungen + Bedienelemente  (689×) */
    --text-strong: #0f172a;          /* betonte Überschrift             (200×) */
    --border-strong: #cbd5e1;        /* kräftigere Trennlinie           (198×) */
    --surface-soft: #f1f5f9;         /* leicht abgesetzte Fläche        (308×) */
    --surface-page: #f8fafc;         /* Seitenhintergrund               (268×) */
    --primary-strong: #0d6b63;       /* dunkles Teal, Text auf hell     (157×); 26.09.2026 von #0f766e abgedunkelt: 4,48 -> 5,2:1 bei Protanopie (PLANUNG_Design.md) */
    --primary-soft-bg: #f0fdfa;      /* blasse Teal-Fläche              (124×) */
    --primary-soft-border: #99f6e4;  /* blasse Teal-Linie                (64×) */

    /* ===================================================================
       ROLLEN-EBENE: DIE GEFÜLLTE MARKENFLÄCHE  (angelegt 10.08.2026)
       -------------------------------------------------------------------
       Die Token oben legen WERTE fest. Diese hier legen eine ROLLE fest:
       „satt gefüllte Markenfläche mit Beschriftung" — Knöpfe, Badges,
       aktive Segmente. 109 Stellen in 16 Dateien verweisen darauf.

       WARUM ES SIE BRAUCHT: Vorher stand die Entscheidung „dieser Knopf ist
       die Hauptaktion" 109-mal ausbuchstabiert im style-Attribut
       (`background:var(--color-primary); color:white`) — in sechs
       Schreibweisen für Weiß. Eine Gestaltungsänderung war deshalb keine
       Farbänderung, sondern eine Änderung an 109 Kopien derselben
       Entscheidung. Genau das hat die Token-Umstellung von 08/2026 für
       WERTE gelöst und für ROLLEN offen gelassen.

       WAS DAS BRINGT: Der komplette Wechsel von „satt gefüllt" auf den
       weichen Schiri-Look sind jetzt diese drei Zeilen:

           --primary-fill-bg:    var(--primary-soft-bg);
           --primary-fill-fg:    var(--primary-strong);
           --primary-fill-hover: var(--primary-soft-border);

       Die Hellwerte unten sind ABSICHTLICH exakt der bisherige Zustand
       (--color-primary + Weiß, Hover auf --primary-strong). Damit ist die
       Einführung im Hellmodus beweisbar wirkungslos; sichtbar wird erst,
       wer die drei Zeilen ändert.

       DUNKELMODUS BRAUCHT EINE EIGENE FASSUNG — und zwar zwingend.
       `--primary-fill-bg: var(--primary-soft-bg)` wird dort aufgelöst, wo es
       DEFINIERT ist, also auf :root. `body.dark-mode` überschreibt
       --primary-soft-bg erst eine Ebene tiefer (auf <body>); der bereits
       eingesetzte Hellwert wird von dort nur noch weitervererbt. Ohne den
       Zwillingsblock in `body.dark-mode` weiter unten bekäme der
       Dunkelmodus die HELLEN Werte — gemessen: Fläche #f0fdfa statt
       rgba(13,148,136,.15), Schrift #0f766e statt #5eead4.
       WER HIER EINE ZEILE ÄNDERT, ändert sie unten mit.

       NICHT ERFASST und mit Absicht: Flächen OHNE Beschriftung, die
       dieselbe Farbe tragen — Schalter-Kugeln, der 6px-Statusstreifen an
       Spielkarten, die 4px-Unterstreichung am aktiven Reiter. Sie sind
       Zustand, nicht Handlung, und dürfen satt bleiben.
       =================================================================== */
    /* WEICHE FASSUNG aktiv seit 10.08.2026. Die satte Fassung stand hier:
           --primary-fill-bg: var(--color-primary);
           --primary-fill-fg: #ffffff;
           --primary-fill-hover: var(--primary-strong);
           --primary-fill-border: transparent;
       Zum Zurückschalten diese vier Zeilen wieder eintragen. */
    --primary-fill-bg: var(--primary-soft-bg);
    --primary-fill-fg: var(--primary-strong);
    --primary-fill-hover: var(--primary-soft-border);
    --primary-fill-border: var(--primary-soft-border);

    /* Blasse Akzent-Töne (03.08.2026). Sie färben Hinweis-, Warn- und Erfolgsflächen.
       Im Dunkelmodus wird daraus jeweils eine TÖNUNG derselben Farbfamilie auf dunklem
       Grund – dieselbe Bedeutung, nur nicht mehr leuchtend hell. */
    --accent-amber-bg: #fffbeb;
    --accent-amber-bg-strong: #fef3c7;
    --accent-amber-border: #fde68a;
    --accent-red-bg: #fef2f2;
    --accent-red-bg-strong: #fee2e2;
    --accent-red-border: #fecaca;
    --accent-blue-bg: #dbeafe;
    --accent-blue-bg-soft: #eff6ff;
    --accent-green-bg: #f0fdf4;
    --accent-green-bg-strong: #d1fae5;
    --accent-orange-bg: #fff7ed;
    --accent-orange-border: #fed7aa;
    --accent-pink-bg: #fce7f3;
    --surface-muted: #fafafa;        /* sehr helle Nebenfläche */
    --border-soft: #e8eef4;          /* zarte Linie, u. a. Vorlagen-Karten */

    /* Akzent-RAHMEN und -SCHRIFT. Ohne diese blieben Infokästen mit dunkelblauer
       oder violetter Schrift im Dunkelmodus unlesbar – die Fläche wurde dunkel,
       die Schrift blieb dunkelblau. */
    --accent-blue-border: #bfdbfe;
    --accent-blue-text: #1e3a8a;
    --accent-violet-bg: #f5f3ff;
    --accent-violet-border: #ddd6fe;
    --accent-violet-text: #5b21b6;
    --accent-violet-bg-soft: #faf5ff;
    --accent-green-text: #065f46;


    /* Referee Mode Specific */
    --ref-bg-app: hsl(var(--primary-hue), 20%, 90%);
    --ref-bg-overlay: hsla(var(--primary-hue), 20%, 90%, 0.7);
    --ref-card-bg: #ffffff;
    --ref-card-border: rgba(226, 232, 240, 0.8);
    --ref-card-shadow: 0 15px 35px rgba(0, 0, 0, 0.06);
    --ref-text-main: #1e293b;
    --ref-text-muted: #64748b;
}

/* KONTUR DER WEICHEN KNÖPFE.
   Gemessen: die weiche Fläche (#f0fdfa) hebt sich von einer weißen Karte mit
   1,04:1 ab und vom Seitenhintergrund (#f8fafc) mit 1,00:1 — also gar nicht.
   Ohne Kontur wäre nur die Schrift zu sehen und der Knopf sähe nicht mehr
   nach Knopf aus. Deshalb trägt der Rahmen hier die Form, nicht die Fläche.

   WARUM box-shadow statt border: 92 der 125 Stellen bringen `border:none`
   im style-Attribut mit (Spezifität 1000) — eine border-Regel käme dagegen
   nicht an. `box-shadow: inset` ist davon unberührt und ändert die Größe
   nicht, ein echter Rahmen würde jeden Knopf um 2px wachsen lassen.

   WARUM Textsuche ausnahmsweise in Ordnung: Dieser Selektor sucht keine
   Farbe, sondern das TOKEN — er trifft genau die Elemente, die sich selbst
   als gefüllte Markenfläche ausgewiesen haben. Das ist eine Klasse in
   anderer Schreibweise, nicht das Raten aus einem Farbliteral.

   In der satten Fassung ist --primary-fill-border `transparent`, die Regel
   also wirkungslos — sie darf beim Zurückschalten stehen bleiben.
   11 Stellen bringen einen eigenen box-shadow mit und behalten ihn.

   AUSNAHME `data-fill-flat`: Segment-Schalter („Direkt zuweisen | Lostöpfe",
   „Fest | Zufällig") sitzen bereits in einem gerahmten Behälter mit
   `overflow:hidden`. Dort ergäbe die Kontur eine zweite Kante dicht neben
   der ersten — sie sah aus wie ein Fehler. Wer weitere solche Schalter
   baut, setzt das Attribut mit; wer die Kontur überall loswerden will,
   setzt stattdessen --primary-fill-border auf `transparent`. */
[style*="var(--primary-fill-bg)"]:not([data-fill-flat]) {
    box-shadow: inset 0 0 0 1px var(--primary-fill-border);
}

body.dark-mode {
    /* Referee Mode Overrides */
    --ref-bg-app: linear-gradient(135deg, #1e293b 0%, #0f172a 50%, #1e293b 100%);
    --ref-bg-overlay: rgba(15, 23, 42, 0.7);
    --ref-card-bg: #1e293b;
    --ref-card-border: rgba(255, 255, 255, 0.1);
    --ref-card-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    --ref-text-main: #f1f5f9;
    --ref-text-muted: #94a3b8;
}

/* Labs View Placeholder Standardization */
.labs-input::placeholder,
#labs-cat-input::placeholder,
#labs-tournament-name::placeholder {
    color: #577c79 !important;
    opacity: 1 !important;
}

body.dark-mode .labs-input::placeholder,
body.dark-mode #labs-cat-input::placeholder,
body.dark-mode #labs-tournament-name::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
    opacity: 1 !important;
}

.labs-input {
    color: #577c79 !important;
    border: none !important;
    background: transparent !important;
    outline: none !important;
}

body.dark-mode .labs-input {
    color: #ffffff !important;
    border: none !important;
    background: transparent !important;
}

.labs-bordered-input {
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 12px !important;
    background: white !important;
    padding: 10px 15px !important;
    transition: all 0.2s !important;
    color: var(--text-main) !important;
    opacity: 0.8 !important;
}

body.dark-mode .labs-bordered-input {
    border-color: rgba(255, 255, 255, 0.1) !important;
    background: rgba(15, 23, 42, 0.5) !important;
    color: white !important;
    opacity: 1 !important;
}

.labs-select.no-arrow {
    background-image: none !important;
    padding-right: 16px !important;
}

/* Labs Group Cards & Stripes */
.labs-group-card {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid rgba(13,148,136,0.2);
    box-shadow: none;
}

.labs-card-stripe {
    background: rgba(13, 148, 136, 0.2);
}

body.dark-mode .labs-card-stripe {
    background: var(--color-primary) !important;
}

/* Labs Add Button (Manual Add) */
.labs-add-btn {
    border: 1.5px solid #e2e8f0;
    color: #64748b;
    background: transparent;
}

body.dark-mode .labs-add-btn {
    border: none !important;
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

.labs-add-btn:hover {
    border-color: #cbd5e1;
    background: rgba(0, 0, 0, 0.02);
}

.labs-add-grp-btn:hover {
    transform: translateY(-2px);
}

.labs-add-btn:active {
    transform: scale(0.98);
}

body.dark-mode .labs-add-btn:hover {
    background: rgba(255, 255, 255, 0.12) !important;
}

/* Info Icons (v2.2.27) */
.wiz-info-i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e2e8f0;
    /* War #64748b — auf der grauen Flaeche des Kreises nur 2,45:1. */
    color: var(--text-body);
    font-size: var(--fs-xs);
    font-weight: var(--weight-strong);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #cbd5e1;
    text-decoration: none !important;
    line-height: 1;
    padding: 0;
    box-sizing: border-box;
}

.wiz-info-i:hover {
    background: var(--primary-fill-bg);
    color: var(--primary-fill-fg);
    border-color: var(--color-primary);
}

body.dark-mode .wiz-info-i {
    background: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    border-color: rgba(255, 255, 255, 0.2);
}

/* Labs Wheel Picker & Settings UI */
.micro-wheel {
    height: 80px;
    overflow-y: auto;
    scrollbar-width: none;
    mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
    cursor: grab;
    scroll-snap-type: y mandatory;
    scroll-padding: 0;
    scroll-behavior: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
}

.micro-wheel::-webkit-scrollbar {
    display: none;
}

.micro-num {
    height: 28px;
    min-height: 28px;
    line-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-base);
    font-weight: var(--weight-medium);
    color: #94a3b8;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    scroll-snap-align: center;
    scroll-snap-stop: always;
    opacity: 0.5;
    overflow: hidden;
    white-space: nowrap;
    box-sizing: border-box;
    margin: 0 !important;
}

.micro-num.active {
    color: var(--primary-strong);
    font-size: var(--fs-2xl);
    font-weight: var(--weight-medium);
    opacity: 1;
}

/* Score Wheel Mode */
.score-wheel-mode .micro-wheel {
    height: 92px;
}

.score-wheel-mode .micro-num {
    height: 32px;
    min-height: 32px;
    line-height: 32px;
    font-size: var(--fs-lg);
}

.score-wheel-mode .micro-num.active {
    font-size: var(--fs-3xl);
    font-weight: var(--weight-medium);
}

.score-input-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.score-grid-wheel-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.score-grid-label {
    text-align: center;
    font-weight: var(--weight-medium);
    font-size: var(--fs-lg);
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.score-grid-wheel {
    display: flex;
    justify-content: center;
}

.score-grid-colon {
    font-size: var(--fs-5xl);
    font-weight: var(--weight-bold);
    color: #64748b;
    padding-bottom: 2px;
}

.score-wheel-inline .labs-wheel-container {
    padding: 5px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 12px;
    height: 92px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.labs-wheel-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 10px;
    width: 100%;
    box-sizing: border-box;
}

.labs-wheel-btn {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: var(--weight-medium);
    font-size: var(--fs-2xl);
    flex-shrink: 0;
}

.labs-wheel-controls {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px;
}

@media (max-width: 599px) {
    .wiz-scoring-grid .labs-wheel-btn {
        display: none !important;
    }

    .wiz-scoring-grid .labs-wheel-controls {
        gap: 0 !important;
    }
}

.labs-wheel-btn:hover {
    border-color: var(--color-primary);
    color: var(--primary-strong);
}

.labs-time-display {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: var(--weight-medium);
    background: white;
    padding: 5px 12px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.labs-time-colon {
    color: #cbd5e1;
    font-weight: var(--weight-strong);
}

/* iOS Switch */
.ios-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.ios-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ios-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e2e8f0;
    transition: .4s;
    border-radius: 24px;
}

.ios-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked+.ios-slider {
    background-color: rgba(13, 148, 136, 0.2);
}

input:checked+.ios-slider:before {
    transform: translateX(20px);
}

/* Labs Settings Cards */
.labs-settings-card {
    background: white;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: none;
    border: 1px solid #e8eef4;
    overflow: hidden;
    transition: all 0.3s;
}

.wiz-card-frame {
    background: #ffffff;
    border: 1px solid #e8eef4;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: none;
}

.labs-settings-header {
    padding: 16px 20px 8px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: default;
}

.labs-settings-body {
    padding: 12px 20px 20px 20px;
}

.labs-settings-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: var(--weight-medium);
    color: var(--text-main);
    font-family: var(--font-heading);
    font-size: var(--fs-lg);
}

.labs-label {
    display: block;
    opacity: 0.8;
}

/* Quick-Pool (High-Density Player Chips) */
.quick-pool-container {
    padding: 10px;
    animation: slideUpFade 0.3s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.quick-pool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    margin-bottom: 10px;
    padding: 6px 12px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    background: #f8fafc;
    border-radius: 8px;
    transition: all 0.2s;
}

.quick-pool-header:hover {
    background: #f1f5f9;
}

.quick-pool-header:hover span:first-child {
    color: var(--primary-strong);
}

.quick-pool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
    gap: 8px;
    margin-bottom: 20px;
    padding: 0 5px;
}

.quick-pool-chip {
    padding: 8px 6px;
    border-radius: 10px;
    font-size: var(--fs-xs);
    font-weight: var(--weight-bold);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1.5px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.quick-pool-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.quick-pool-chip:active {
    transform: scale(0.92);
}

.quick-pool-chip.inactive {
    background: #ffffff !important;
    color: #475569 !important;
    border: 1.5px solid #e2e8f0 !important;
    font-weight: var(--weight-bold);
}

.quick-pool-chip.active {
    border-color: rgba(0, 0, 0, 0.05);
}

.quick-pool-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px white;
}

.status-dot-playing {
    background: #22c55e;
}

.status-dot-waiting {
    background: #f59e0b;
}

.quick-pool-dashboard {
    max-height: 250px;
    overflow-y: auto;
    scrollbar-width: thin;
    padding: 12px;
}

.quick-pool-dashboard::-webkit-scrollbar {
    width: 4px;
}

.quick-pool-dashboard::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

body.dark-mode .quick-pool-header {
    background: rgba(255, 255, 255, 0.03);
}

/* Fix drag flickering: when a parent has .drag-over, ignore its children */
.drag-over * {
    pointer-events: none !important;
}

/* Specific body class added during drag to disable pointer events on elements causing flicker */
body.is-dragging .quick-pool-grid,
body.is-dragging .quick-pool-chip:not(.dragging),
body.is-dragging .quick-pool-chip:not(.dragging) *,
body.is-dragging .player-card:not(.dragging),
body.is-dragging .player-card:not(.dragging) * {
    pointer-events: none !important;
}

/* The dragged item itself MUST retain pointer events to keep the drag operation alive */
body.is-dragging .quick-pool-chip.dragging,
body.is-dragging .player-card.dragging {
    pointer-events: auto !important;
}

body.dark-mode .quick-pool-header:hover {
    background: rgba(255, 255, 255, 0.06);
}

body.dark-mode .quick-pool-chip.inactive {
    background: rgba(30, 41, 59, 0.8) !important;
    color: #94a3b8 !important;
    border: 1.5px solid rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .quick-pool-chip.active {
    border-color: rgba(255, 255, 255, 0.15);
}

body.dark-mode .quick-pool-status-dot {
    box-shadow: 0 0 0 2px #1e293b;
}

.labs-field-group {
    margin-top: 12px;
    margin-bottom: 24px;
}

.labs-select {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    font-family: var(--font-heading);
    font-weight: var(--weight-medium);
    font-size: var(--fs-lg);
    outline: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: white !important;
    color: var(--text-main);
    opacity: 0.8;
    appearance: none !important;
    -webkit-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 18px !important;
    cursor: pointer;
}

.labs-text-input {
    width: 100%;
    padding: 12px 15px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    font-family: var(--font-body);
    font-weight: var(--weight-medium);
    font-size: var(--fs-lg);
    outline: none;
    transition: all 0.2s;
    background: white;
    color: var(--text-main);
    opacity: 0.8;
}

.labs-select:focus,
.labs-text-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(30, 148, 136, 0.1);
}

.labs-hint {
    font-size: var(--fs-sm);
    color: #94a3b8;
    margin-top: 6px;
    display: block;
}

.labs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Dark Mode Overrides */
body.dark-mode .micro-num.active {
    color: #ffffff;
}

body.dark-mode .labs-wheel-container {
    background: rgba(15, 23, 42, 0.3);
    border-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode .labs-wheel-btn {
    background: rgba(15, 23, 42, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
}

body.dark-mode .labs-time-display {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

body.dark-mode .ios-slider {
    background-color: #475569 !important;
}

body.dark-mode input:checked+.ios-slider {
    background-color: var(--color-primary) !important;
}

body.dark-mode .labs-settings-card {
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
}

body.dark-mode .wiz-card-frame {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .labs-settings-header {
    background: rgba(15, 23, 42, 0.5);
}

body.dark-mode .labs-settings-title {
    color: #f1f5f9;
}

body.dark-mode .labs-select {
    background-color: rgba(15, 23, 42, 0.6) !important;
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    opacity: 0.8;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
}

body.dark-mode .labs-text-input {
    background: rgba(15, 23, 42, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    opacity: 0.8;
}

body.dark-mode .labs-select:focus,
body.dark-mode .labs-text-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
}

.wiz-inline-select {
    appearance: none !important;
    -webkit-appearance: none !important;
    background: transparent !important;
    background-image: none !important;
    background-color: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    padding-right: 4px !important;
}

body.dark-mode select {
    color-scheme: dark;
}

body.dark-mode .wiz-inline-select {
    color-scheme: dark;
    background: var(--bg-card) !important;
    background-color: var(--bg-card) !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
}

.card-stripe {
    align-self: stretch;
}

/* Match status styling - Now handled via .card-stripe div in JS */
.match-row.match-live,
.hall-field-card.match-live,
.ref-field-card.match-live,
.match-row.match-finished,
.hall-field-card.match-finished,
.ref-field-card.match-finished,
.match-row.match-pending,
.hall-field-card.match-pending,
.ref-field-card.match-pending {
    box-shadow: none !important;
    border-left: none !important;
}

/* ============================================
   DARK MODE - Premium gradient like landing page
   ============================================ */
body.dark-mode {
    /* Native Bedienelemente EINMAL zentral auf dunkel stellen (02.08.2026).
       color-scheme vererbt sich, deshalb genügt diese eine Zeile für Datums- und
       Zeitwähler samt Aufklapp-Kalender, Auswahllisten, Bildlaufleisten und
       Browser-Ausfüllhilfen. Vorher stand color-scheme an fünf Einzelstellen
       (select, .wiz-inline-select, input[type=date|time|datetime-local],
       #phase-wizard-modal select) – jedes neue Feld brauchte eine weitere Ausnahme. */
    color-scheme: dark;

    /* Unified Design Tokens */
    --radius-sm: 6px;
    /* Tags, Badges, kleine Elemente */
    --radius-md: 8px;
    /* Buttons, Inputs, Selects */
    --radius-lg: 8px;
    /* Karten, Modals, Accordions */

    /* Primary Colors — Teal accent (Variant C) */
    --color-primary: #0f8378;
    --color-primary-hover: #0f766e;
    --color-secondary: #374151;
    --color-secondary-hover: #4b5563;
    --color-danger: #dc2626;
    --color-danger-hover: #b91c1c;

    /* Elevation system — 3 tiers */
    --bg-base: #0f172a;
    --bg-elevated: #1e293b;
    --bg-hover: #263244;

    /* Background Colors */
    --bg-app: #0f172a;
    --bg-header: rgba(15, 23, 42, 0.95);
    --bg-card: rgba(30, 41, 59, 0.9);
    --bg-secondary: transparent;
    --bg-subtle: transparent;
    --bg-input: rgba(30, 41, 59, 0.9);
    --bg-button-secondary: rgba(51, 65, 85, 0.9);

    /* Border Colors */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-subtle: rgba(255, 255, 255, 0.1);
    --border-input: rgba(255, 255, 255, 0.2);

    /* Text Colors */
    --text-main: #e2e8f0;
    --text-secondary: #cbd5e1;
    --text-inverted: #1e293b;

    /* Dunkel-Fassung der Inline-Style-Token (Gegenstück zum Block im :root).
       Hier – und nur hier – wird künftig entschieden, wie die App im
       Dunkelmodus aussieht. */
    --text-subtle: #8b98ab;
    --text-body: #94a3b8;
    --text-strong: #f8fafc;
    --border-strong: rgba(255, 255, 255, 0.16);
    --surface-soft: #1e293b;
    --surface-page: #0f172a;
    --primary-strong: #5eead4;
    --primary-soft-bg: rgba(13, 148, 136, 0.15);
    --primary-soft-border: rgba(45, 212, 191, 0.35);

    /* ZWILLING zur Rollen-Ebene aus dem :root (dort ausführlich erklärt).
       Er MUSS hier stehen: ein `var(--primary-soft-bg)` im :root wird schon
       dort eingesetzt, mit dem Hellwert — die drei Zeilen darüber kämen nie
       an. Ohne diesen Block sähe der Dunkelmodus aus wie der Hellmodus.
       Die Werte sind absichtlich dieselben VERWEISE wie oben; nur lösen sie
       sich hier gegen die Dunkelwerte auf. Immer beide Blöcke ändern. */
    --primary-fill-bg: var(--primary-soft-bg);
    --primary-fill-fg: var(--primary-strong);
    --primary-fill-hover: var(--primary-soft-border);
    --primary-fill-border: var(--primary-soft-border);

    /* Dunkel-Fassung der Akzent-Töne: getönte Flächen statt leuchtender Pastelltöne. */
    --accent-amber-bg: rgba(245, 158, 11, 0.14);
    --accent-amber-bg-strong: rgba(245, 158, 11, 0.22);
    --accent-amber-border: rgba(245, 158, 11, 0.40);
    --accent-red-bg: rgba(239, 68, 68, 0.14);
    --accent-red-bg-strong: rgba(239, 68, 68, 0.22);
    --accent-red-border: rgba(239, 68, 68, 0.40);
    --accent-blue-bg: rgba(59, 130, 246, 0.16);
    --accent-blue-bg-soft: rgba(59, 130, 246, 0.10);
    --accent-green-bg: rgba(34, 197, 94, 0.12);
    --accent-green-bg-strong: rgba(34, 197, 94, 0.20);
    --accent-orange-bg: rgba(234, 88, 12, 0.14);
    --accent-orange-border: rgba(234, 88, 12, 0.40);
    --accent-pink-bg: rgba(236, 72, 153, 0.16);
    --surface-muted: #1a2434;
    --border-soft: rgba(255, 255, 255, 0.10);
    --accent-blue-border: rgba(59, 130, 246, 0.35);
    --accent-blue-text: #93c5fd;
    --accent-violet-bg: rgba(139, 92, 246, 0.16);
    --accent-violet-border: rgba(139, 92, 246, 0.40);
    --accent-violet-text: #c4b5fd;
    --accent-violet-bg-soft: rgba(139, 92, 246, 0.10);
    --accent-green-text: #6ee7b7;
    --accent-red-text: #fca5a5;
    --text-success: #4ade80;
    /* Zielpalette, Dunkel-Fassung: Schrift wird heller, Flächen bleiben getönt. */
    --color-warning: #fbbf24;
    --color-info: #60a5fa;
    --color-violet: #a78bfa;
    --accent-amber-text: #fcd34d;
    --stepper-value: #2dd4bf;
    /* Diese beiden hatten bisher GAR KEINE Dunkel-Fassung – dunkelgrüne Schrift
       bzw. ein fast weißer Rahmen auf dunklem Grund. */
    --text-success-bold: #86efac;
    --border-success-subtle: rgba(34, 197, 94, 0.40);


    --brand-primary: var(--primary-strong);
    --brand-secondary: rgba(51, 65, 85, 0.9);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);

    /* Disable light mode card shadow in dark mode */
    --card-shadow-light: none;
}

body.dark-mode .app-header {
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

body.dark-mode .card:not(.settings-card) {
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

body.dark-mode .card-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .main-nav {
    background: rgba(30, 41, 59, 0.98) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

/* Hier standen bis zum 21.09.2026 auch `font-size: var(--fs-lg)` und
   `font-weight: var(--weight-medium)` — beides Wiederholungen der Grundregel und
   beides ohne Bezug zum Dunkelmodus. Sie sind dann auch prompt auseinandergelaufen:
   `@media (max-width: 640px)` setzte `.nav-btn` auf --fs-xl (16 px), aber diese Regel
   hier ist spezifischer (0,2,1 gegen 0,1,0) — im Dunkelmodus stand das Burger-Menue
   auf einem Handy also auf 15 px, im Hellmodus auf 16. Entfernt: Der Dunkelmodus
   faerbt, er misst nicht. */
body.dark-mode .nav-btn {
    color: #e2e8f0;
    background: transparent !important;
}

body.dark-mode .nav-btn:hover {
    background: transparent !important; /* schlägt body.dark-mode button:hover (0,2,2) !important */
    color: #2dd4bf;
}

body.dark-mode .nav-btn.active {
    background: rgba(13, 148, 136, 0.15);
    color: #2dd4bf;
}

/* Hamburger-Button: transparent mit dezenter Rahmung */
body.dark-mode .nav-toggle {
    background: transparent !important;
    color: #94a3b8 !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

/* Sidebar-Buttons: transparenter Hintergrund — auch auf :hover
   Spezifität (0,3,1) schlägt body.dark-mode button:hover (0,2,2) mit !important */
body.dark-mode .sidebar-nav-btn,
body.dark-mode .sidebar-submenu-btn,
body.dark-mode .sidebar-tournament-nav-btn {
    background: transparent !important;
}

/* Nur Nav-Buttons innerhalb sidebar-item-row brauchen transparenten Hover —
   sidebar-submenu-btn steht außerhalb der Row und soll eigenen Hover-Hintergrund behalten. */
body.dark-mode .sidebar-nav-btn:hover,
body.dark-mode .sidebar-tournament-nav-btn:hover {
    background: transparent !important;
}

/* Desktop-Icon-Nav-Buttons (inkl. Dark-Mode-Toggle): transparent im Ruhezustand */

body.dark-mode .auth-btn {
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .logo-area h1,
body.dark-mode .logo-area .mobile-logo,
body.dark-mode .app-logo-text {
    color: #ffffff !important;
}

body.dark-mode .current-tournament-display {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .tournament-name {
    color: #e2e8f0;
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background: rgba(30, 41, 59, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #e2e8f0 !important;
}

/* Specific overrides for form elements that may have browser defaults */
body.dark-mode .form-group input,
body.dark-mode .form-group select,
body.dark-mode .form-section input,
body.dark-mode .form-section select,
body.dark-mode input[type="time"],
body.dark-mode input[type="date"],
body.dark-mode input[type="datetime-local"] {
    background: rgba(30, 41, 59, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #e2e8f0 !important;
    color-scheme: dark !important;
}

/* Kalender-/Uhr-Symbol in Datums- und Zeitfeldern.
   `filter: invert(1)` ist hier BEWUSST ENTFERNT (02.08.2026): Seit `color-scheme: dark`
   zeichnet der Browser das Symbol von sich aus hell. Das zusätzliche Invertieren drehte
   es wieder auf Schwarz – genau deshalb waren Kalender- und Uhrensymbol im Dunkelmodus
   dunkel. Zwei Mechanismen für dieselbe Sache; color-scheme ist der richtige. */
body.dark-mode input[type="time"]::-webkit-calendar-picker-indicator,
body.dark-mode input[type="date"]::-webkit-calendar-picker-indicator,
body.dark-mode input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
}

/* Force dark color scheme for all date/time inputs - affects the popup */
body.dark-mode input[type="time"],
body.dark-mode input[type="date"],
body.dark-mode input[type="datetime-local"] {
    color-scheme: dark;
}

body.dark-mode input::placeholder {
    color: #64748b;
}

body.dark-mode .btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
}

body.dark-mode .btn.primary {
    background: var(--primary-fill-bg) !important;
    color: var(--primary-fill-fg) !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

body.dark-mode .table th {
    color: #94a3b8;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .table td {
    color: #e2e8f0;
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode .match-row {
    /* Inline styles control background, border, and box-shadow */
    visibility: inherit;
}

body.dark-mode .match-row.played {
    opacity: 1 !important;
}

body.dark-mode .match-row:hover {
    filter: brightness(1.1);
}

/* Live match row — subtle yellow tint in dark mode */
body.dark-mode .match-tabular-row.match-live,
body.dark-mode .mobile-only-card.match-live {
    background: rgba(251, 191, 36, 0.06) !important;
}

/* Abgeschlossene Zeile im Dunkelmodus: Sie soll zurücktreten — aber NICHT über
   Durchsichtigkeit.
   Bis 22.08.2026 stand hier `opacity: 0.75`. Das dimmt die ganze Zeile mitsamt allem,
   was seine Farben selbst mitbringt: Der Niveau-/Gruppen-Chip fiel dadurch von 8,0–10,4:1
   auf 2,9–3,1:1 — unlesbar, und zwar erst NACH dem Eintragen des Ergebnisses. Ein
   Nachziehen am Chip hilft nicht: opacity auf dem Vorfahren bildet eine eigene Ebene,
   ein Kind kann darin nicht wieder deckender werden. Und Rechnen hilft auch nicht —
   erst ab etwa 0,9 käme der Chip über 4,5:1, und dann sieht man von der Abdunklung
   nichts mehr. Beides zusammen geht nicht.
   Das Zurücktreten tragen jetzt die Mittel, die es im Hellmodus ohnehin allein tragen:
   der teal Kantenstreifen und der Statuspunkt (schedule-view.js, `stripeColor`). Die
   Tabellenansicht im Hellmodus kennt gar keine Abdunklung — die Modi sind damit gleich.
   Wer den Effekt zurückwill, muss ihn in FARBE ausdrücken (etwas gedämpftere
   Flächen- und Textfarbe für die Zeile), nicht in Deckkraft. */

/* Empty State / Welcome Card */
body.dark-mode #empty-state-view,
body.dark-mode .empty-state-card {
    background: rgba(30, 41, 59, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode #empty-state-view h2,
body.dark-mode .empty-state-card h2 {
    color: #e2e8f0 !important;
}

body.dark-mode #empty-state-view p,
body.dark-mode .empty-state-card p {
    color: #94a3b8 !important;
}

/* ============================================
   SCHEDULE GROUPING & HEADERS (NullNull-Plan)
   ============================================ */

.phase-section {
    margin-bottom: 30px;
    background: transparent;
}

.phase-header {
    font-size: var(--fs-2xl);
    font-weight: var(--weight-medium);
    color: var(--primary-strong);
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(13, 148, 136, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

body.dark-mode .phase-header {
    color: #2dd4bf;
    border-bottom-color: rgba(13, 148, 136, 0.25);
}

.round-section {
    margin-bottom: 20px;
}

.round-header {
    font-size: var(--fs-base);
    font-weight: var(--weight-medium);
    color: #64748b;
    margin-bottom: 10px;
    margin-top: 15px;
    padding-left: 10px;
    border-left: 3px solid #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

body.dark-mode .round-header {
    color: #94a3b8;
    border-left-color: #475569;
}

/* Schedule Controls Toolbar (Embedded in Phase) */
.schedule-controls-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    align-items: center;
    flex-wrap: wrap;
}

body.dark-mode .schedule-controls-toolbar {
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
}

.schedule-control-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: var(--fs-base);
    font-weight: var(--weight-medium);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    background: white;
    color: #475569;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

body.dark-mode .schedule-control-btn {
    background: rgba(30, 41, 59, 1);
    color: #cbd5e1;
    border-color: rgba(255, 255, 255, 0.05);
}

.schedule-control-btn:hover {
    border-color: var(--color-primary);
    color: var(--primary-strong);
    transform: translateY(-1px);
}

.schedule-control-btn.primary {
    background: var(--primary-fill-bg);
    color: var(--primary-fill-fg);
}

.schedule-control-btn.primary:hover {
    filter: brightness(1.1);
    border-color: transparent;
    color: white;
}

/* Section Headers and Labels */
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode label {
    color: #e2e8f0;
    font-weight: var(--weight-medium);
}

body.dark-mode .card-header h2 {
    color: #f1f5f9;
    font-weight: var(--weight-medium);
}

body.dark-mode .form-label,
body.dark-mode .form-group label {
    color: #cbd5e1;
}

/* Group Cards */
body.dark-mode .group-card {
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

body.dark-mode .group-card input {
    background: rgba(15, 23, 42, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #e2e8f0 !important;
    border-radius: 8px !important;
}

/* Group name input specific styling */
body.dark-mode .group-name-input {
    border-radius: 8px !important;
}

/* Team name input in group cards */
body.dark-mode .group-card .team-row-card input {
    border-radius: 8px !important;
}

/* Class select dropdown - full width, less height, rounded corners */
body.dark-mode .class-select,
body.dark-mode .group-card select {
    background: rgba(15, 23, 42, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 0.35rem 0.5rem !important;
}

/* Global dropdown/select styling - rounded corners for ALL selects */
select {
    border-radius: 8px !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 32px !important;
}

body.dark-mode select {
    background-color: rgba(15, 23, 42, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #e2e8f0 !important;
    border-radius: 8px !important;
}

/* Team Rows */
body.dark-mode .team-row {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Team Row Cards - transparent background in groups */
body.dark-mode .team-row-card {
    background: transparent !important;
}

body.dark-mode .team-row input,
body.dark-mode .team-row select {
    background: rgba(15, 23, 42, 0.9) !important;
    color: #e2e8f0 !important;
}

/* Ranking Criteria */
body.dark-mode .ranking-criteria-list,
body.dark-mode .ranking-criteria-item {
    background: rgba(30, 41, 59, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

body.dark-mode .ranking-criteria-item select {
    background: rgba(51, 65, 85, 0.9) !important;
    color: #e2e8f0 !important;
}

/* Form Sections - Transparent with rounded border */
body.dark-mode .form-section,
body.dark-mode .settings-section {
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 12px !important;
    padding: 16px !important;
    margin-bottom: 16px;
}

body.dark-mode [style*="background:#f8fafc"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode [style*="background: #f8fafc"]:not(:where([style*="background:var("],[style*="background: var("])) {
    background: rgba(30, 41, 59, 0.8) !important;
}

body.dark-mode [style*="background:white"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode [style*="background: white"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode [style*="background:#ffffff"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode [style*="background: #ffffff"]:not(:where([style*="background:var("],[style*="background: var("])) {
    background: rgba(30, 41, 59, 0.9) !important;
}

/* Text in colored cards */
body.dark-mode [style*="color:#15803d"]:not(:where([style*="color:var("],[style*="color: var("])) {
    color: #2dd4bf !important;
}

body.dark-mode [style*="color:#92400e"]:not(:where([style*="color:var("],[style*="color: var("])) {
    color: #fbbf24 !important;
}

body.dark-mode [style*="color:#64748b"]:not(:where([style*="color:var("],[style*="color: var("])) {
    color: #94a3b8 !important;
}

/* Dividers and borders */
body.dark-mode hr,
body.dark-mode .divider {
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode [style*="border:1px solid #e2e8f0"],
body.dark-mode [style*="border: 1px solid #e2e8f0"] {
    border-color: rgba(255, 255, 255, 0.15) !important;
}

/* Modals and Keypads */
body.dark-mode .modal,
body.dark-mode .keypad-content,
body.dark-mode .keypad-modal .keypad-content {
    background: rgba(30, 41, 59, 0.98) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #e2e8f0 !important;
}

body.dark-mode .keypad-header,
body.dark-mode .modal-header {
    background: rgba(15, 23, 42, 0.9) !important;
    color: #e2e8f0 !important;
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .keypad-header h3,
body.dark-mode .modal-header h3 {
    color: #f1f5f9 !important;
}

body.dark-mode .modal-overlay {
    background: rgba(0, 0, 0, 0.8);
}body.dark-mode .wheel-container,
body.dark-mode .wheel-item{
    background: rgba(30, 41, 59, 0.95) !important;
    color: #e2e8f0 !important;
}

body.dark-mode .wheel-item.selected {
    background: rgba(13, 148, 136, 0.3) !important;
    color: #2dd4bf !important;
}

body.dark-mode .keypad-body {
    background: rgba(30, 41, 59, 0.9) !important;
}

/* Card headers with white backgrounds - EXCEPT groups-section which should be transparent */
body.dark-mode .card-header,
body.dark-mode .section-header {
    background: rgba(30, 41, 59, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 8px !important;
    padding: 15px !important;
    font-weight: var(--weight-medium);
}

/* Groups section header should be transparent with more spacing */
body.dark-mode .groups-section .section-header {
    background: transparent !important;
    border: none !important;
    padding: 0 0 16px 0 !important;
}

/* Schedule / Match Cards */
body.dark-mode .schedule-card,
body.dark-mode .match-card,
body.dark-mode .schedule-item {
    background: rgba(30, 41, 59, 0.85) !important;
    /* border controlled by inline JS styles for glow effects */
    color: #e2e8f0 !important;
}

/* Hier stand eine Pauschalregel (Abbau 22.08.2026) — Begruendung bei .match-finished. */

/* Tournament list rows - dark mode */
body.dark-mode .tournament-row {
    background: rgba(30, 41, 59, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

body.dark-mode .tournament-row.active-row {
    background: rgba(30, 41, 59, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: none !important;
}

/* Hier stand eine Pauschalregel (Abbau 22.08.2026) — Begruendung bei .match-finished. */

body.dark-mode .schedule-card .team-name,
body.dark-mode .match-card .team-name {
    color: #2dd4bf !important;
}

/* Small buttons (btn-xs) - dark mode */
body.dark-mode .btn-xs {
    background: rgba(51, 65, 85, 0.95) !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

body.dark-mode .btn-xs:hover {
    background: rgba(71, 85, 105, 0.95) !important;
}

body.dark-mode .btn-xs.primary {
    background: var(--primary-fill-bg) !important;
    color: var(--primary-fill-fg) !important;
    border-color: var(--primary-fill-border) !important;
}

body.dark-mode .btn-xs.danger {
    background: rgba(220, 38, 38, 0.2) !important;
    color: #fca5a5 !important;
    border-color: rgba(220, 38, 38, 0.5) !important;
}

/* Danger icon buttons (delete icons) */
body.dark-mode .btn-icon.danger,
body.dark-mode .danger {
    color: #fca5a5 !important;
    opacity: 0.8;
}

body.dark-mode .btn-icon.danger:hover,
body.dark-mode .danger:hover {
    color: var(--accent-red-text) !important;
    opacity: 1;
}/* Regel entfernt 23.08.2026 — .field-card wird im Projekt nirgends gesetzt (nur
   field-card-header, field-card-body und hall-field-card). */

/* Hall Field Cards - Minimal dark mode styling - inline JS handles bg, border, box-shadow */
body.dark-mode .hall-field-card {
    /* background, border, box-shadow controlled by inline styles in script.js */
    /* Fallback only */
}/* Regel entfernt 23.08.2026 — .field-card wird im Projekt nirgends gesetzt (nur
   field-card-header, field-card-body und hall-field-card). */

body.dark-mode .time-badge.active,
body.dark-mode .time-slot.active {
    background: var(--primary-fill-bg) !important;
    color: var(--primary-fill-fg) !important;
}

/* Standings / Tabellen headers */
body.dark-mode .standings-card,
body.dark-mode .standings-header {
    background: rgba(30, 41, 59, 0.9) !important;
}

body.dark-mode .standings-card h3,
body.dark-mode .standings-header h3 {
    color: #f1f5f9 !important;
}

/* Buttons with light backgrounds */
body.dark-mode .btn-light,
body.dark-mode .btn-outline {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #e2e8f0 !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

/* Override ANY element with inline white/light background */
body.dark-mode [style*="background:#f0fdf4"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode [style*="background: #f0fdf4"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode [style*="background:#e0f2fe"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode [style*="background: #e0f2fe"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode [style*="background:#eff6ff"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode [style*="background: #eff6ff"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode [style*="background:#f0f9ff"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode [style*="background: #f0f9ff"]:not(:where([style*="background:var("],[style*="background: var("])) {
    background: rgba(22, 163, 74, 0.15) !important;
}

/* Light gray backgrounds */
body.dark-mode [style*="background:#f1f5f9"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode [style*="background: #f1f5f9"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode [style*="background:#f8fafc"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode [style*="background: #f8fafc"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode [style*="background:#e2e8f0"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode [style*="background: #e2e8f0"]:not(:where([style*="background:var("],[style*="background: var("])) {
    background: rgba(30, 41, 59, 0.8) !important;
}

/* Make text in these containers readable */
body.dark-mode [style*="background:#f0fdf4"]:not(:where([style*="background:var("],[style*="background: var("])) *,
body.dark-mode [style*="background: #f0fdf4"]:not(:where([style*="background:var("],[style*="background: var("])) *,
body.dark-mode [style*="background:#e0f2fe"]:not(:where([style*="background:var("],[style*="background: var("])) *,
body.dark-mode [style*="background: #e0f2fe"]:not(:where([style*="background:var("],[style*="background: var("])) *,
body.dark-mode [style*="background:#eff6ff"]:not(:where([style*="background:var("],[style*="background: var("])) *,
body.dark-mode [style*="background: #eff6ff"]:not(:where([style*="background:var("],[style*="background: var("])) *,
body.dark-mode [style*="background:#f0f9ff"]:not(:where([style*="background:var("],[style*="background: var("])) *,
body.dark-mode [style*="background: #f0f9ff"]:not(:where([style*="background:var("],[style*="background: var("])) * {
    color: #e2e8f0 !important;
}

/* Purple gradient (time slider) stays as-is but ensure text is readable */
body.dark-mode [style*="background:linear-gradient"] *:not(:where([style*="color:var("],[style*="color: var("])) {
    color: white !important;
}

/* Ensure all cards have dark background (except settings-card) */
body.dark-mode section.card:not(.settings-card),
body.dark-mode div.card:not(.settings-card),
body.dark-mode article.card:not(.settings-card),
body.dark-mode .tab-content .card:not(.settings-card) {
    background: rgba(30, 41, 59, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Settings card - transparent so accordions stand out */
body.dark-mode .settings-card,
body.dark-mode #schedule>.card,
body.dark-mode #standings>.card,
body.dark-mode #hall-view>.card {
    background: transparent !important;
    border: none !important;
}

/* Menu items in dropdowns */
body.dark-mode .dropdown-menu,
body.dark-mode .dropdown-item {
    background: rgba(30, 41, 59, 0.98) !important;
    color: #e2e8f0 !important;
}

body.dark-mode .dropdown-item:hover {
    background: rgba(51, 65, 85, 0.9) !important;
}

/* Placeholder text */
body.dark-mode .placeholder-text {
    color: #64748b;
}

/* ============================================
   JAVASCRIPT-APPLIED DARK MODE CLASSES
   These classes are added by JS to inline-styled elements
   ============================================ */

/* Override for any element with light inline background */
body.dark-mode .dark-mode-override {
    background: rgba(30, 41, 59, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

/* Pauschalregel entfernt 23.08.2026 (`.dark-mode-override, .dark-mode-override *`).
   Belegt durch `node pruefe-lesbarkeit.js --pauschal`: Die Flaeche war 8× sichtbar mit
   Text, und ohne die Regel aendert sich KEINE einzige Schriftfarbe — die Farbtoken
   liefern im Dunkelmodus laengst denselben Ton. Die Ueberschriften-Regel darunter
   bleibt: die setzt einen anderen, helleren Ton. */

body.dark-mode .dark-mode-override h1,
body.dark-mode .dark-mode-override h2,
body.dark-mode .dark-mode-override h3,
body.dark-mode .dark-mode-override h4 {
    color: #f1f5f9 !important;
}

/* Standings Toolbar Separator (Dark Mode) */
body.dark-mode .standings-toolbar .toolbar-tabs {
    border-color: rgba(255, 255, 255, 0.15) !important;
}

/* Styled modals and keypads */
body.dark-mode .dark-mode-styled {
    background: rgba(30, 41, 59, 0.98) !important;
    color: #e2e8f0 !important;
}

/* .keypad-modal is the full-screen overlay — must stay transparent so
   backdrop-filter blur is visible. Higher specificity (3 vs 2 classes) wins. */
body.dark-mode .keypad-modal.dark-mode-styled {
    background: rgba(0, 0, 0, 0.3) !important;
    color: inherit !important;
}

body.dark-mode .dark-mode-styled * {
    color: #e2e8f0 !important;
}body.dark-mode .wheel-item,
body.dark-mode [class*="wheel"]{
    background: rgba(30, 41, 59, 0.95) !important;
    color: #e2e8f0 !important;
}

body.dark-mode .wheel-item {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Match/Schedule card text - ensure readability */
/* NOTE: background for .match-row is controlled by inline styles in script.js */
body.dark-mode .schedule-list>div,
body.dark-mode .match-card {
    background: rgba(30, 41, 59, 0.85) !important;
}

/* Note: body.dark-mode .match-row styles are controlled by inline JS */

/* Hier stand eine Pauschalregel (Abbau 22.08.2026) — Begruendung bei .match-finished. */

/* Team names in schedule */
body.dark-mode .team-a,
body.dark-mode .team-b,
body.dark-mode [style*="color:#16a34a"]:not(:where([style*="color:var("],[style*="color: var("])),
body.dark-mode [style*="color: #16a34a"]:not(:where([style*="color:var("],[style*="color: var("])),
body.dark-mode [style*="color:#15803d"]:not(:where([style*="color:var("],[style*="color: var("])),
body.dark-mode [style*="color: #15803d"]:not(:where([style*="color:var("],[style*="color: var("])) {
    color: #2dd4bf !important;
}

/* Score inputs and displays */
body.dark-mode .score-input,
body.dark-mode .score-display {
    background: rgba(15, 23, 42, 0.9) !important;
    color: #e2e8f0 !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

/* Labs Dark Mode Fix — [style] erhöht Spezifität auf 0,3,1 und schlägt die globale
   div[style*="background:white"]-Regel (0,2,2), die sonst den weißen Rand setzt */
body.dark-mode .labs-group-card,
body.dark-mode .labs-group-card[style] {
    background: rgba(30, 41, 59, 0.9) !important;
    border: 1px solid rgba(45, 212, 191, 0.35) !important;
    backdrop-filter: blur(10px);
}

body.dark-mode .labs-group-card input {
    background: transparent !important;
    border: none !important;
    color: #e2e8f0 !important;
}

body.dark-mode .labs-group-card .team-class-tag {
    background: rgba(13, 148, 136, 0.15);
    border: 1px solid rgba(13, 148, 136, 0.35);
    color: #2dd4bf !important;
}

body.dark-mode div[style*="background: white"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode div[style*="background:white"]:not(:where([style*="background:var("],[style*="background: var("])) {
    background: rgba(30, 41, 59, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .keypad-header h2,
body.dark-mode .keypad-header h3 {
    color: #f1f5f9 !important;
}

body.dark-mode .keypad-content p,
body.dark-mode .keypad-content span,
body.dark-mode .print-options-body label {
    color: #cbd5e1 !important;
}

/* ============================================
   MOBILE RESPONSIVENESS TWEAKS
   ============================================ */
.group-card {
    overflow-x: auto !important;
}

/* Reduce internal padding for table cards to fit content */
.group-card>div,
.group-card>div {
    padding: 4px 4px !important;
}

/* COMPACT TABLE - Fixed Layout for Alignment */
.mock-table {
    width: auto !important;
    max-width: 100% !important;
    table-layout: auto !important;
    border-collapse: collapse !important;
    margin: 0 auto !important;
}

.mock-table th,
.mock-table td {
    padding: 2px 1px !important;
    font-size: var(--fs-sm) !important;
    white-space: nowrap !important;
    text-align: center !important;
    overflow: hidden !important;
    border-bottom: 1px solid var(--border-color) !important;
    /* Separator line between rows */
}

/* Remove border from the last row to avoid double border at bottom of card */
.mock-table tr:last-child th,
.mock-table tr:last-child td {
    border-bottom: none !important;
}

/* COLUMN CONFIGURATION (1-based indices) */

/* 1. Rank (#) */
.mock-table th:nth-child(1),
.mock-table td:nth-child(1) {
    width: 24px !important;
}

/* 2. Team Name - Takes remaining space */
.mock-table th:nth-child(2),
.mock-table td:nth-child(2) {
    width: auto !important;
    text-align: left !important;
    text-overflow: ellipsis !important;
    padding-left: 2px !important;
}

/* 3. Played (Sp) */
.mock-table th:nth-child(3),
.mock-table td:nth-child(3) {
    width: 28px !important;
}

/* 4. Goals (Tore) */
.mock-table th:nth-child(4),
.mock-table td:nth-child(4) {
    width: 44px !important;
}

/* 5. Diff */
.mock-table th:nth-child(5),
.mock-table td:nth-child(5) {
    width: 28px !important;
}

/* 6. Points (Pkt) */
.mock-table th:nth-child(6),
.mock-table td:nth-child(6) {
    width: 28px !important;
}

/* Target last two columns generically */
.mock-table th:last-child,
.mock-table td:last-child {
    width: 28px !important;
    /* Stats button */
}

.mock-table th:nth-last-child(2),
.mock-table td:nth-last-child(2) {
    width: 30px !important;
}

body.dark-mode .keypad-content label {
    color: #cbd5e1 !important;
}

/* Green match cards (completed) */
body.dark-mode .dark-mode-override[style*="background:#f0fdf4"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode .dark-mode-override[style*="background:#dcfce7"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode .dark-mode-override[style*="background: #f0fdf4"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode .dark-mode-override[style*="background: #dcfce7"]:not(:where([style*="background:var("],[style*="background: var("])) {
    background: rgba(34, 197, 94, 0.2) !important;
    border-color: rgba(34, 197, 94, 0.4) !important;
}body.dark-mode [class*="fairplay"]{
    background: rgba(30, 41, 59, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}
/* Hier stand `body.dark-mode [class*="fairplay"] * { color: #e2e8f0 !important }`
   (Abbau 23.08.2026) — Begruendung bei .match-finished.
   Sie war bis heute nicht pruefbar: Ohne ein Turnier MIT Fairplay-Wertung gibt es weder
   .fairplay-badge in den Tabellen noch .fairplay-active an der Karte, der Waechter mass
   also ins Leere. Seit der Fairplay-Fall in FAELLE steht, sind es 52 sichtbare Ziele —
   und ohne diese Regel bleiben alle lesbar. */

/* Fairplay points table in settings (white box) */
body.dark-mode table,
body.dark-mode .table-wrapper {
    background: rgba(30, 41, 59, 0.8) !important;
}

/* Explicitly transparent for Mock Tables (Standings) in Dark Mode */
body.dark-mode .mock-table {
    background: transparent !important;
}

body.dark-mode .btn-stats {
    background: transparent !important;
}

/* Print dialogs - checkbox labels and options */
body.dark-mode .print-option,
body.dark-mode .print-checkbox,
body.dark-mode label[for],
body.dark-mode input[type="checkbox"]+label,
body.dark-mode input[type="radio"]+label {
    color: #e2e8f0 !important;
}

body.dark-mode .print-option,
body.dark-mode .checkbox-option {
    background: rgba(30, 41, 59, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

/* All nested white div containers */
body.dark-mode div[style*="background:white"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode div[style*="background: white"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode div[style*="background:#fff"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode div[style*="background: #fff"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode div[style*="background:#ffffff"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode div[style*="background: #ffffff"]:not(:where([style*="background:var("],[style*="background: var("])) {
    background: rgba(30, 41, 59, 0.95) !important;
}

/* Pauschalregel entfernt 23.08.2026 (weisse Inline-Flaechen, 6 Schreibweisen).
   Sie war die groesste von allen und faerbte jeden Nachfahren einer weiss gesetzten
   Flaeche um. Belegt durch `node pruefe-lesbarkeit.js --pauschal`: 390× sichtbar mit
   Text, und ohne sie aendert sich KEINE Schriftfarbe. Die Regel darueber, die solche
   Flaechen selbst dunkel einfaerbt, bleibt — sie ist der Grund, warum die Schrift
   inzwischen von allein stimmt. *//* Regel entfernt 23.08.2026 — Selektoren ohne Ziel: body.dark-mode .extended-input, body.dark-mode .fairplay-input, body.d *//* Regel entfernt 23.08.2026 — Selektoren ohne Ziel: body.dark-mode .extended-input *, body.dark-mode .fairplay-input *, bo */

/* Counter rows in fairplay modal */
body.dark-mode .counter-row,
body.dark-mode .violation-row {
    background: rgba(51, 65, 85, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Ensure ALL white/light grey elements inside modals get dark treatment.
   :not(.keypad-content) schützt das Content-Wrapper-Div selbst vor dem Transparent-Override,
   damit body.dark-mode .keypad-content { background: rgba(30,41,59,0.98) } greift. */
body.dark-mode .keypad-content div[style],
body.dark-mode .modal-content div[style],
body.dark-mode .keypad-modal div[style]:not(.keypad-content) {
    background: transparent !important;
}

/* Force all text inside modals to be light */
body.dark-mode .keypad-content,
body.dark-mode .keypad-content *:not(button):not(.btn):not([class*="primary"]) {
    color: #e2e8f0 !important;
}

/* Fix input fields inside modals */
/* Specific dark mode overrides for teal and light-green backgrounds frequently used in Labs */
/* Specific dark mode overrides for teal and light-green backgrounds frequently used in Labs -> Blue Harmonization */

/* Glassmorphism for Labs sections */
body.dark-mode .labs-section-container,
body.dark-mode div[style*="border: 1px solid #e2e8f0"] {
    background: rgba(30, 41, 59, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Fairplay Punkte/Striche input boxes in settings */
body.dark-mode input[type="number"],
body.dark-mode .fairplay-point-input,
body.dark-mode .striche-input {
    background: rgba(30, 41, 59, 0.9) !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

/* Any remaining white input boxes */
body.dark-mode input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not(.btn):not(.labs-input) {
    background: rgba(30, 41, 59, 0.9) !important;
    color: #e2e8f0 !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
}

/* Basis-Stil für alle Buttons im Dunkelmodus.
   Spezifischere Regeln (mit Klasse oder ID) überschreiben dies automatisch — kein :not() nötig.
   Spezifität (0,1,2) — bewusst niedrig, damit Klassen-Overrides (0,3,1) weiterhin greifen.

   AUSNAHMEN (ergänzt 02.08.2026): Knöpfe, die ihre Farbe SELBST mitbringen, werden hier
   nicht mehr übermalt. Das betrifft zwei Fälle:
     1. `background:var(--…)` – seit der Token-Umstellung ist so ein Hintergrund bereits
        dunkelmodus-tauglich; ihn grau zu übermalen war der Grund, warum „Bestätigen" und
        „Auswahl fertig" im Dunkelmodus grau statt grün waren – samt fremdem Rahmen.
     2. `background:none` / `background:transparent` – ausdrücklich KEIN Hintergrund. Genau
        deshalb hatte das X oben rechts in „Zeitplan verschieben" plötzlich eine Kachel.
   Knöpfe mit noch fest verdrahteter Farbe bleiben bewusst beim alten Verhalten: Sie werden
   erst ausgenommen, wenn ihre Datei auf Token umgestellt ist. Damit wächst die Ausnahme
   automatisch mit der Umstellung mit, statt auf einen Schlag Risiko zu erzeugen.

   Die Ausnahmen stehen bewusst in `:not(:where(…))` und NICHT in einer Kette aus sechs
   einzelnen `:not(…)`. Grund: `:where()` steuert null Spezifität bei, die Regel bleibt
   also bei (0,1,2) wie oben dokumentiert. Mit der Kette wäre sie auf (0,8,2) gesprungen
   und hätte Regeln überfahren, die sich auf die niedrige Spezifität verlassen – konkret
   `body.dark-mode .sidebar-nav-btn/.sidebar-submenu-btn` (0,3,1) weiter oben, wodurch
   sämtliche Menüpunkte samt Pfeilen plötzlich einen grauen Kasten bekamen. */
body.dark-mode button:not(:where([style*="background:var("], [style*="background: var("], [style*="background:none"], [style*="background: none"], [style*="background:transparent"], [style*="background: transparent"])),
body.dark-mode .btn-secondary,
body.dark-mode .btn-outline,
body.dark-mode .btn-generate {
    background: rgba(51, 65, 85, 0.9) !important;
    color: #e2e8f0 !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

/* Dieselben Ausnahmen wie oben – sonst wird ein eigenfarbiger Knopf beim Überfahren
   doch wieder grau, was noch verwirrender wäre als durchgehend grau. */
body.dark-mode button:not(:where([style*="background:var("], [style*="background: var("], [style*="background:none"], [style*="background: none"], [style*="background:transparent"], [style*="background: transparent"])):hover {
    background: rgba(71, 85, 105, 0.9) !important;
}

/* Social-Theme-Farbkreise: ID-Selektor (Spezifität 1,1,1) schlägt alle Klassen-Regeln.
   Inline-background würde durch body.dark-mode button !important überschrieben,
   daher hier explizit die jeweilige Themenfarbe erzwingen. */

/* Spielplan erstellen + Turnierphase: teal Hintergrund beibehalten (ID-Spezifität schlägt globale button-Regel) */
/* #labs-action-generate ist seit 26.09.2026 ein Hauptschritt (.tp-knopf-haupt) — die ID-Regel hier
   hätte die Knopfart überstimmt; deshalb trägt sie dieselben Werte. */
body.dark-mode #labs-action-generate {
    background: var(--gestalt-haupt-bg) !important;
    color: var(--gestalt-haupt-fg) !important;
    border-color: transparent !important;
}
body.dark-mode #labs-action-generate:hover {
    background: var(--gestalt-haupt-hover) !important;
}
body.dark-mode #add-phase-btn {
    background: var(--primary-fill-bg) !important;
    color: var(--primary-fill-fg) !important;
    border-color: transparent !important;
}

body.dark-mode #add-phase-btn:hover {
    background: #0f766e !important;
}

/* Delete/Danger buttons - Same grey as input fields with white text (both modes) */
.btn-delete,
.btn-danger,
button.danger,
.btn-icon.danger {
    background: rgba(15, 23, 42, 0.8) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.btn-delete:hover,
.btn-danger:hover,
button.danger:hover,
.btn-icon.danger:hover {
    background: rgba(30, 41, 59, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

body.dark-mode .btn-delete,
body.dark-mode .btn-danger,
body.dark-mode button.danger,
body.dark-mode .btn-icon.danger {
    background: rgba(15, 23, 42, 0.8) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

body.dark-mode .btn-delete:hover,
body.dark-mode .btn-danger:hover,
body.dark-mode button.danger:hover,
body.dark-mode .btn-icon.danger:hover {
    background: rgba(30, 41, 59, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

/* Dark mode toggle buttons - spielplan/felderplan */
body.dark-mode #toggle-spielplan,
body.dark-mode #toggle-felderplan {
    background: transparent !important;
}

/* Active toggle button in dark mode */
body.dark-mode #toggle-spielplan.active,
body.dark-mode #toggle-felderplan.active {
    background: rgba(13, 148, 136, 0.22) !important;
    border: 1px solid rgba(45, 212, 191, 0.55) !important;
    box-shadow: 0 0 0 1px rgba(13, 148, 136, 0.2) inset !important;
}

/* Light mode toggle buttons */

#toggle-spielplan.active,
#toggle-felderplan.active {
    background: rgba(13, 148, 136, 0.1);
}

/* Toggle container background for dark mode */
body.dark-mode #schedule-view-toggle>div:first-child {
    background: rgba(15, 23, 42, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 10px !important;
    padding: 3px !important;
}

/* Burger menu button in dark mode */
body.dark-mode #schedule-burger-btn {
    background: transparent !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: #94a3b8 !important;
}

body.dark-mode #schedule-burger-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #e2e8f0 !important;
}

/* Generieren button and similar styled buttons - FORCE WHITE TEXT
   TOKEN-VORRANG: Die Textsuche trifft JEDEN Knopf, dessen Inline-Style irgendwo das
   Wort "background" enthält – also auch Mülleimer- und ✕-Knöpfe mit transparentem
   Grund. Deren Symbolfarbe wurde dadurch weiß statt grau bzw. rot. Wer seine
   Schriftfarbe selbst als Token mitbringt, behält sie jetzt. `:where()` steuert null
   Spezifität bei, die Regel bleibt also bei (0,2,1). */
body.dark-mode button[style*="background"]:not(:where([style*="color:var("], [style*="color: var("])),
body.dark-mode button.btn-generate,
body.dark-mode button.btn-secondary,
body.dark-mode .btn-outline {
    color: #ffffff !important;
}

/* Wheelpicker - COMPREHENSIVE DARK MODE FIX */
body.dark-mode .wheel-picker-content {
    background: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6) !important;
}

/* body.dark-mode .keypad-modal div[style] { background: transparent } has
   specificity (0,3,2) and beats the rule above (0,2,1). Override with ID
   selector (1,x,x) to guarantee the card keeps its dark background. */

/* ===== PHASE-WIZARD-MODAL: Dunkler Hintergrund ===== */
/* Haupt-Modalbox (spec 1,1,2 > 0,3,2) */
body.dark-mode #phase-wizard-modal > div {
    background: #1e293b !important;
}
/* Header, Tab-Leiste, Footer (spec 1,1,3 > 0,3,2) */
body.dark-mode #phase-wizard-modal > div > div {
    background: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}
/* Inhaltsbereich (spec 2,1,1 > 0,3,2) — etwas dunkler als Header */
body.dark-mode #phase-wizard-modal #wiz-tabbed-content {
    /* Wie die Tab-Leiste (var(--bg-card)) – einheitlich wie im Wizard (kein separater grauer/dunkler
       Content-Hintergrund mehr). */
    background: var(--bg-card) !important;
}
/* Tab-Buttons: transparent im Ruhezustand, Teal wenn aktiv */
body.dark-mode #phase-wizard-modal button[id^="tab-btn-"] {
    background: transparent !important;
    color: #94a3b8 !important;
    border: none !important;
}
body.dark-mode #phase-wizard-modal button[id^="tab-btn-"].active-tab {
    background: rgba(13, 148, 136, 0.2) !important;
    color: #2dd4bf !important;
}
/* Close-Button, Nav-Buttons (‹ ›) und + Niveau / X-Buttons: transparent halten.
   Nach JS-Manipulation via this.style.opacity normalisiert der Browser
   "background:none" → "background: none" (mit Leerzeichen), deshalb beide Varianten
   abdecken. Hover + Focus explizit, um body.dark-mode button:hover zu überschreiben. */
body.dark-mode #phase-wizard-modal button[style*="background:none"],
body.dark-mode #phase-wizard-modal button[style*="background: none"],
body.dark-mode #phase-wizard-modal button[style*="background:none"]:hover,
body.dark-mode #phase-wizard-modal button[style*="background: none"]:hover,
body.dark-mode #phase-wizard-modal button[style*="background:none"]:focus,
body.dark-mode #phase-wizard-modal button[style*="background: none"]:focus,
body.dark-mode #phase-wizard-modal button[style*="background:transparent"],
body.dark-mode #phase-wizard-modal button[style*="background: transparent"],
body.dark-mode #phase-wizard-modal button[style*="background:transparent"]:hover,
body.dark-mode #phase-wizard-modal button[style*="background: transparent"]:hover,
body.dark-mode #phase-wizard-modal button[style*="background:transparent"]:focus,
body.dark-mode #phase-wizard-modal button[style*="background: transparent"]:focus {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}
/* "Speichern & Schließen" Teal-Button beibehalten */
body.dark-mode #phase-wizard-modal button[style*="background:#0d9488"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode #phase-wizard-modal button[style*="background: #0d9488"]:not(:where([style*="background:var("],[style*="background: var("])) {
    background: var(--primary-fill-bg) !important;
    color: var(--primary-fill-fg) !important;
}
/* ── PHASE-WIZARD: Trennlinien dezent ──────────────────────────────── */
/* Robust: greift sowohl bei Original-Syntax als auch nach JS-Normalisierung
   (Browser schreibt "height: 0px" wenn display via JS geändert wird) */
body.dark-mode #phase-wizard-modal [style*="height:0"],
body.dark-mode #phase-wizard-modal [style*="height: 0"] {
    border-color: rgba(255, 255, 255, 0.08) !important;
}
/* Trennlinien mit border-bottom-Inline-Style */
body.dark-mode #phase-wizard-modal [style*="border-bottom:1px solid #f1f5f9"],
body.dark-mode #phase-wizard-modal [style*="border-bottom:1px solid #e2e8f0"] {
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}
/* Spezifische Trennlinien, die via JS ihren display-Wert ändern */
body.dark-mode #wiz-row-pairing-divider,
body.dark-mode #wiz-row-standard-rounds-sep {
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* ── PHASE-WIZARD: Zeilenbeschriftungen & allgemeine Textfarben ───── */
body.dark-mode #phase-wizard-modal [style*="color:#334155"]:not(:where([style*="color:var("],[style*="color: var("])),
body.dark-mode #phase-wizard-modal [style*="color: #334155"]:not(:where([style*="color:var("],[style*="color: var("])) {
    color: #cbd5e1 !important;
}
body.dark-mode #phase-wizard-modal [style*="color:#64748b"]:not(:where([style*="color:var("],[style*="color: var("])),
body.dark-mode #phase-wizard-modal [style*="color: #64748b"]:not(:where([style*="color:var("],[style*="color: var("])) {
    color: #94a3b8 !important;
}

/* ── PHASE-WIZARD: Einheitlicher Hintergrund (Dark Mode) ─────────── */
/* Alle Karten, Selects, Inputs und helle Bereiche → einheitliches var(--bg-card) */
body.dark-mode #phase-wizard-modal .wiz-card-frame {
    background: var(--bg-card) !important;
    border: none !important;
}
body.dark-mode #phase-wizard-modal .labs-settings-header {
    background: transparent !important;
}
body.dark-mode #phase-wizard-modal .labs-settings-title {
    color: var(--text-main) !important;
}
body.dark-mode #phase-wizard-modal select {
    background: #1e293b !important;
    background-color: #1e293b !important;
    border: none !important;
    color-scheme: dark;
}

/* Native Dropdown-Popup: Optionen dunkel rendern */
body.dark-mode select option {
    background-color: #1e293b;
    color: #e2e8f0;
}

/* ── PHASE-WIZARD: Info-Box K.O.-Planung ─────────────────────────── */

/* ── PHASE-WIZARD: Radio-Cards (Teilnehmer & Herkunft) ────────────── */
body.dark-mode #phase-wizard-modal .wiz-radio-card {
    background: rgba(30, 41, 59, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}
body.dark-mode #phase-wizard-modal .wiz-radio-card:hover {
    background: rgba(13, 148, 136, 0.1) !important;
    border-color: rgba(13, 148, 136, 0.5) !important;
}
body.dark-mode #phase-wizard-modal .wiz-radio-card.active {
    background: rgba(13, 148, 136, 0.12) !important;
    border-color: var(--color-primary) !important;
}
body.dark-mode #phase-wizard-modal .wiz-radio-card-title {
    color: #e2e8f0 !important;
}
body.dark-mode #phase-wizard-modal .wiz-radio-card.active .wiz-radio-card-title {
    color: #2dd4bf !important;
}
body.dark-mode #phase-wizard-modal .wiz-radio-card-desc {
    color: #94a3b8 !important;
}
body.dark-mode #phase-wizard-modal .wiz-radio-card-icon {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #94a3b8 !important;
}
body.dark-mode #phase-wizard-modal .wiz-radio-card.active .wiz-radio-card-icon {
    background: var(--primary-fill-bg) !important;
    color: var(--primary-fill-fg) !important;
}

/* ── PHASE-WIZARD: Smart-Info-Box ────────────────────────────────── */
body.dark-mode #phase-wizard-modal .wiz-smart-info {
    background: rgba(13, 148, 136, 0.08) !important;
    border-color: rgba(13, 148, 136, 0.25) !important;
}

/* ── PHASE-WIZARD: Klassen-Chips ─────────────────────────────────── */
body.dark-mode #phase-wizard-modal .wiz-plan-class-chip {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #cbd5e1 !important;
}

/* HIER STANDEN 26 REGELN für die Schriftvergrößerung der Planungshilfe
   (entfernt 08.08.2026). Zwei Prozentregeln und 24 Textsuch-Regeln der Form
       html.tp-font-large #phase-wizard-modal [style*='font-size:12px']
           { font-size: 13.5px !important; }
   — eine je Größenwert, und nur für die Planungshilfe. Alle übrigen der damals
   177 Größen wuchsen gar nicht mit.

   Sie sind überflüssig, seit die Größen über Token laufen: --fs-* trägt
   calc(… * var(--tp-font-scale)) und wirkt damit ÜBERALL, nicht nur hier.
   Die beiden Prozentregeln hätten ohnehin nichts genutzt — rem reagiert nicht auf
   die Schriftgröße eines Containers. NICHT wieder hinzufügen. */

/* Phase editor: mobile layout that survives the largest font size at ~350px. */
@media (max-width: 760px) {
    #phase-wizard-modal {
        padding: 6px !important;
        align-items: stretch !important;
        justify-content: center !important;
    }

    #phase-wizard-modal > div {
        width: calc(100vw - 12px) !important;
        max-width: calc(100vw - 12px) !important;
        height: calc(100dvh - 12px) !important;
        max-height: calc(100dvh - 12px) !important;
        border-radius: 14px !important;
    }

    /* Kopfzeile. Diese sechs Regeln hingen vorher an `> div > div:first-child` und griffen
       KEINE EINZIGE: erstes Kind der Dialogkarte ist ein verstecktes <input type="hidden">,
       also gibt es dort gar kein div:first-child. Jetzt an den Klassen, die der Editor selbst
       vergibt (.wiz-head-row / .wiz-head-main) – unabhängig von der Kindreihenfolge. */
    #phase-wizard-modal .wiz-head-row {
        padding: 10px 12px !important;
        gap: 8px !important;
    }

    #phase-wizard-modal .wiz-head-main {
        min-width: 0 !important;
        flex: 1 1 auto !important;
    }

    /* Phasenname und Modus kürzen, statt die Zeile zu sprengen. */
    #phase-wizard-modal .wiz-head-row input,
    #phase-wizard-modal .wiz-head-mode {
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    #phase-wizard-modal .wiz-head-row button {
        min-width: 36px !important;
        min-height: 36px !important;
    }

    #phase-wizard-modal button[title*="Einstellungen auf alle"] {
        padding: 6px 8px !important;
        max-width: 118px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    /* Schrittleiste. Stand als `> div > div:nth-child(3)` da – das zählte das versteckte
       <input> mit und kippt, sobald jemand ein Element im Kopf ergänzt. Jetzt an der Klasse. */
    #phase-wizard-modal .wiz-tabbar-wrap {
        padding: 0 12px !important;
    }

    #phase-wizard-modal .wizard-tab-bar {
        gap: 4px !important;
        overflow-x: auto !important;
        scrollbar-width: none !important;
    }

    /* 8px 12px stammen aus der Zeit, als jeder Schritt seine Beschriftung trug – bei sechs
       Kreisen sind das 144px reiner Innenabstand und die Leiste muss scrollen. 6px ringsum
       ergeben immer noch ein 36px hohes Tippziel, aber die Leiste passt bei 375px in eine Zeile. */
    #phase-wizard-modal button[id^="tab-btn-"] {
        padding: 6px !important;
        min-width: max-content !important;
        flex: 0 0 auto !important;
    }

    /* Sehr schmal: die Modus-Angabe im Kopf weglassen. Sie drängt dort das Namensfeld
       zusammen, obwohl sie im Einstellungen-Tab ohnehin ausgeschrieben steht. */
    @media (max-width: 480px) {
        #phase-wizard-modal .wiz-head-mode {
            display: none !important;
        }
    }

    #phase-wizard-modal #wiz-tabbed-content {
        padding: 16px 12px !important;
    }

    #phase-wizard-modal .labs-settings-header {
        padding-left: 0 !important;
    }

    #phase-wizard-modal .wiz-card-frame {
        overflow: hidden !important;
        border-radius: 12px !important;
    }

    /* NUR Legacy-Zeilen (.wiz-responsive-row): Die neuen Wizard-Stil-Zeilen (Label links,
       Control rechts, inline geflext) handhaben schmale Breiten selbst und dürfen NICHT
       aufgebrochen werden — sonst rutschen Stepper/Selects unters Label. */
    #phase-wizard-modal .wiz-responsive-row,
    #phase-wizard-modal [id*="wrapper"] > div[style*="display:flex"] {
        height: auto !important;
        min-height: 0 !important;
        padding: 12px 16px !important;
        align-items: stretch !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    #phase-wizard-modal .wiz-responsive-label,
    #phase-wizard-modal .wiz-card-frame .wiz-responsive-label {
        width: 100% !important;
        flex: 0 0 100% !important;
        padding-right: 0 !important;
        justify-content: flex-start !important;
        gap: 8px !important;
        min-width: 0 !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
    }

    #phase-wizard-modal .wiz-responsive-row > div:not(.wiz-responsive-label) {
        flex: 1 1 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        justify-content: flex-start !important;
        align-items: center !important;
        flex-wrap: wrap !important;
    }

    /* 100%-Breite NUR in Legacy-Zeilen: Die Wizard-Stil-Felder (width:220px, rechtsbündig)
       sollen wie im Wizard einheitlich breit bleiben. */
    #phase-wizard-modal .wiz-responsive-row select,
    #phase-wizard-modal .wiz-responsive-row input:not([type="checkbox"]),
    #phase-wizard-modal .wiz-responsive-row textarea {
        width: 100% !important;
        min-width: 0 !important;
        white-space: normal !important;
        text-overflow: clip !important;
    }

    /* Checkboxen (Niveau-/Klassen-Matrix) behalten ihre feste Größe – 100%-Breite
       zentriert das Kästchen und drängt die restliche Zeile aus dem Sichtbereich. */
    #phase-wizard-modal .wiz-card-frame input[type="checkbox"] {
        width: 18px !important;
        height: 18px !important;
        flex: 0 0 18px !important;
    }

    /* Niveau-Matrix-Zeilen dürfen bei schmaler Breite sauber umbrechen. */
    #phase-wizard-modal #wiz-plan-levels-list > div,
    #phase-wizard-modal #dd-plan-levels-list > div {
        flex-wrap: wrap !important;
    }

    #phase-wizard-modal .labs-stepper-compact {
        max-width: 100% !important;
        background-color: var(--bg-card);
    }

    #phase-wizard-modal [style*="width:96px"],
    #phase-wizard-modal [style*="width: 96px"] {
        width: auto !important;
        max-width: 100% !important;
        flex: 0 0 auto !important;
    }

    #phase-wizard-modal div[style*="width:40px"],
    #phase-wizard-modal div[style*="width: 40px"] {
        display: none !important;
        width: 0 !important;
        flex: 0 0 0 !important;
    }

    #phase-wizard-modal [id*="wheel"][style*="display:flex"],
    #phase-wizard-modal [id*="wheel"][style*="display: flex"],
    #phase-wizard-modal [id*="stepper"][style*="display:flex"],
    #phase-wizard-modal [id*="stepper"][style*="display: flex"],
    #phase-wizard-modal .labs-stepper-compact {
        display: inline-flex !important;
        flex: 0 0 auto !important;
        align-self: flex-start !important;
    }

    #phase-wizard-modal .wiz-card-frame [style*="justify-content:start"],
    #phase-wizard-modal .wiz-card-frame [style*="justify-content:flex-start"],
    #phase-wizard-modal .wiz-card-frame [style*="justify-content: flex-start"] {
        justify-content: flex-start !important;
    }

    #phase-wizard-modal .wiz-card-frame [style*="flex:1; display:flex"],
    #phase-wizard-modal .wiz-card-frame [style*="flex: 1; display: flex"],
    #phase-wizard-modal .wiz-card-frame [style*="flex:1;display:flex"],
    #phase-wizard-modal .wiz-card-frame [style*="flex: 1; display:flex"] {
        flex: 1 1 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        justify-content: flex-start !important;
        align-items: center !important;
        flex-wrap: wrap !important;
    }

    #phase-wizard-modal .wiz-card-frame [style*="gap:16px"],
    #phase-wizard-modal .wiz-card-frame [style*="gap: 16px"],
    #phase-wizard-modal .wiz-card-frame [style*="gap:12px"],
    #phase-wizard-modal .wiz-card-frame [style*="gap: 12px"] {
        gap: 8px !important;
    }

    #phase-wizard-modal button[onclick*="onWizPenaltyRemove"] {
        display: inline-flex !important;
        width: 44px !important;
        min-width: 44px !important;
        flex: 0 0 44px !important;
        align-self: center !important;
        margin-left: auto !important;
    }

    #phase-wizard-modal [style*="display:flex"] > button[onclick*="onWizPenaltyRemove"] {
        order: 3 !important;
    }

    #phase-wizard-modal .wiz-card-frame > div:has(> button[onclick*="onWizPenaltyRemove"]) {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 44px !important;
        align-items: center !important;
        gap: 8px !important;
        height: auto !important;
        min-height: 0 !important;
        padding: 12px 16px !important;
    }

    #phase-wizard-modal .wiz-card-frame > div:has(> button[onclick*="onWizPenaltyRemove"]) > div:first-child {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        flex: none !important;
    }

    #phase-wizard-modal .wiz-card-frame > div:has(> button[onclick*="onWizPenaltyRemove"]) > div:nth-child(2) {
        grid-column: 1 !important;
        width: auto !important;
        flex: none !important;
        justify-content: flex-start !important;
    }

    #phase-wizard-modal .wiz-card-frame > div:has(> button[onclick*="onWizPenaltyRemove"]) > button {
        grid-column: 2 !important;
    }

    #phase-wizard-modal button[onclick*="onLabsClassRemove"],
    #phase-wizard-modal button[onclick*="onLabsLevelRemove"] {
        display: inline-flex !important;
        width: 44px !important;
        min-width: 44px !important;
        flex: 0 0 44px !important;
        align-self: center !important;
        margin-left: auto !important;
    }

    #phase-wizard-modal #wiz-tab-classes [style*="display:grid"],
    #phase-wizard-modal #wiz-tab-classes [style*="display: grid"] {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }

    #phase-wizard-modal #wiz-tab-classes [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    #phase-wizard-modal #wiz-tab-classes p,
    #phase-wizard-modal #wiz-tab-classes div,
    #phase-wizard-modal #wiz-tab-classes span {
        max-width: 100% !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
    }

    /* Unified info cards (header icon + bullet rows) keep their row layout on mobile;
       the old badge-row overrides were removed with the redesign (v2.3.x). */

    /* wiz-wheel-phase-fields-wrapper + rounds-container-standard entfernt: sind jetzt
       Wizard-Stil-Zeilen (Stepper rechts) und dürfen nicht auf 100% gezogen werden.
       ppteam + rounds-alt ebenfalls entfernt (2026-07-03): sind jetzt Wizard-Zeilen
       (Label links, Stepper rechts via space-between, ohne .wiz-responsive-label) – der
       alte 100%-Zwang stapelte Label und Stepper übereinander. advancing-row ist dauerhaft
       ausgeblendet (auto-berechnet), braucht die Regel nicht mehr. */

    /* Feld-Namen: nebeneinander wie im Wizard (Inputs bringen flex:1 1 140px inline mit);
       die alte Stapel-Regel (ein Input pro Zeile) wurde mit dem Redesign entfernt. */

    #phase-wizard-modal .wiz-mode-cards {
        grid-template-columns: 1fr !important;
    }

    #phase-wizard-modal .wiz-mode-card-title,
    #phase-wizard-modal .wiz-mode-card-desc {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
        line-height: 1.25 !important;
    }

    #phase-wizard-modal .wiz-radio-card {
        padding: 12px !important;
        gap: 10px !important;
    }

    #phase-wizard-modal .wiz-radio-card-content {
        min-width: 0 !important;
    }

    #phase-wizard-modal #wiz-plan-status-pinned-container {
        padding: 8px 12px !important;
    }

    #phase-wizard-modal > div > div:last-child {
        padding: 12px !important;
        gap: 10px !important;
        justify-content: stretch !important;
    }

    #phase-wizard-modal > div > div:last-child button {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        padding: 12px 10px !important;
        line-height: 1.15 !important;
        white-space: normal !important;
    }
}

@media (max-width: 380px) {
    #phase-wizard-modal {
        padding: 4px !important;
    }

    #phase-wizard-modal > div {
        width: calc(100vw - 8px) !important;
        max-width: calc(100vw - 8px) !important;
        height: calc(100dvh - 8px) !important;
        max-height: calc(100dvh - 8px) !important;
    }

    #phase-wizard-modal #wiz-tabbed-content {
        padding: 14px 10px !important;
    }

    #phase-wizard-modal .wiz-card-frame > div[style*="display:flex"],
    #phase-wizard-modal [id^="wiz-row-"][style*="display:flex"],
    #phase-wizard-modal [id*="wrapper"] > div[style*="display:flex"] {
        padding: 12px !important;
    }

    #phase-wizard-modal button[title*="Einstellungen auf alle"] {
        max-width: 98px !important;
    }
}

/* ── BESCHRIFTUNG + AUSWAHLFELD: auf schmalen Geräten untereinander ──────────────
   Beide Assistenten setzen ihre Zeilen als
       <div display:flex; justify-content:space-between>
           <div min-width:0>Überschrift + Erklärung</div>
           <select flex-shrink:0>…</select>
   Das `flex-shrink:0` am Auswahlfeld ist der Fehler: Ein <select> ist so breit wie
   seine LÄNGSTE Option — „Pro Gruppe (z.B. Top 2 je Gruppe)" sind rund 280 px. Bei
   350 px Fensterbreite bleiben der Beschriftung dann etwa 70 px. `min-width:0`
   erlaubt ihr, genau so weit zu schrumpfen, ohne dass irgendetwas den Text davon
   abhält, aus seinem Kasten UNTER das Auswahlfeld zu laufen. Beides zusammen ergibt
   die zwei Bilder, die am 31.08.2026 gemeldet wurden: „Optimieru" mit dem Auswahlfeld
   darüber (Phasen-Editor) und „Form / der / K.O.- / Runde." mit einem Wort je Zeile
   (Planungshilfe, K.-o.-Schritt).

   Ab hier bricht die Zeile um: Beschriftung oben in voller Breite, Auswahlfeld
   darunter in voller Breite. `:has(> select)` trifft dabei GENAU die Zeile, die ein
   Auswahlfeld unmittelbar enthält — nicht deren Vorfahren und nicht die Zeilen mit
   Zahlenrad oder Schalter, die nebeneinander passen und passen sollen.

   Bewusst NICHT über [style*="justify-content:space-between"]: Genau so ein Selektor
   ist im Wappen-Editor schon einmal still gebrochen, als sich der Inline-Style
   änderte (siehe Anmerkung an .wc-body in wappen.js). Die Struktur ist haltbarer als
   die Zeichenkette.

   560 px statt 760: Darüber ist der Dialog breit genug, dass beides nebeneinander
   passt — gemessen bei 700 px, dort gibt es keinen Überstand. */
@media (max-width: 560px) {
    #planning-wizard-body div:has(> select),
    #phase-wizard-modal div:has(> select) {
        flex-wrap: wrap !important;
        row-gap: 8px !important;
        /* Die Zeilen im Phasen-Editor tragen `height:52px` inline. Ohne diese Zeile
           bricht der Inhalt um und ragt anschließend unten aus seiner Zeile heraus. */
        height: auto !important;
        min-height: 0 !important;
    }

    /* WICHTIG: hier KEIN `flex-basis: 100%`. Das erzwaenge den Umbruch immer — auch in
       Zeilen, in denen beides bequem nebeneinander passt („Platzierung bei
       Punktgleichheit“: die Beschriftung ist dort nur „2.“). Genau das war der
       erste Anlauf, und er sah in der Rangfolge-Liste albern aus.

       Stattdessen entscheidet flex-wrap selbst: Es bricht um, wenn die UNGEBROCHENEN
       Groessen beider Teile nicht in die Zeile passen. Die Beschriftung bringt dabei
       ihre eigene Textbreite mit — „2.“ sind 14 px und passen neben jedes Auswahlfeld,
       „Top-Platzierte jeder Gruppe – oder die Besten …“ sind ueber 500 px und passen nie.
       Damit bricht genau das um, was umbrechen muss, und sonst nichts. */
    #planning-wizard-body div:has(> select) > select,
    #phase-wizard-modal div:has(> select) > select {
        /* wachsen, um die eigene Zeile zu fuellen; schrumpfen, wenn sie geteilt wird */
        flex: 1 1 auto !important;
        width: auto !important;
        max-width: 100% !important;
        min-width: 0 !important;
        /* Der Phasen-Editor schiebt sein Auswahlfeld inline mit `margin-left:auto` nach
           rechts. Nach einem Umbruch klebte es dadurch rechts an der Kante, statt die
           Zeile zu fuellen. */
        margin-left: 0 !important;
    }
}

/* ── FUSSZEILEN-KNÖPFE: groß genug für einen Finger ──────────────────────────────
   Die Knöpfe „Abbrechen" / „Speichern & Schließen" waren bei 350 px 38 px hoch und
   endeten 8 px über dem unteren Fensterrand. Beides zusammen macht sie auf dem
   Telefon schwer zu treffen: 38 px liegen unter den 44 px, die iOS und Android als
   Mindestgröße einer Schaltfläche nennen, und die letzten Pixel über der Kante
   gehören auf dem Telefon der Wischgeste des Browsers, nicht der Seite. Gemeldet am
   31.08.2026 als „Abbrechen lässt sich teilweise nicht anklicken".
   Die Höhe steht an den Knöpfen, der Abstand am Dialog — so bleibt der Fuß dort, wo
   er ist, und wächst nur nach innen. */
@media (max-width: 760px) {
    #phase-wizard-modal > div > div:last-child button {
        min-height: 48px !important;
    }

    #phase-wizard-modal > div {
        height: calc(100dvh - 24px) !important;
        max-height: calc(100dvh - 24px) !important;
    }
}

@media (max-width: 380px) {
    #phase-wizard-modal > div {
        height: calc(100dvh - 20px) !important;
        max-height: calc(100dvh - 20px) !important;
    }
}

/* ── PHASE-WIZARD: Grüne Verfügbar-in-Badges (klassen-basiert) ────── */
.wiz-avail-badge {
    background: #d1fae5;
    color: #065f46;
}
body.dark-mode .wiz-avail-badge {
    background: rgba(13, 148, 136, 0.2) !important;
    color: #5eead4 !important;
}

/* ── MODE-CAROUSEL-MODAL: Dark Mode – via JS patchCarouselPreviewForDarkMode ──
   Helle Hintergründe werden nach dem Rendern per getComputedStyle gepatcht.
   Kein CSS-Filter nötig – JS liest echte Farben und ersetzt farbtreu. */

body.dark-mode #match-input-modal .wheel-picker-content,
body.dark-mode .wheel-picker-header,
body.dark-mode .wheel-picker-body {
    background: transparent !important;
}

body.dark-mode .wheel-picker-header h3 {
    color: #f1f5f9 !important;
}

/* The actual wheel drum with scrollable numbers */
body.dark-mode .wheel-drum {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.98) 50%, rgba(15, 23, 42, 0.98) 100%) !important;
}

/* Individual number items - PURE WHITE */
body.dark-mode .wheel-item {
    color: #ffffff !important;
    font-weight: var(--weight-bold) !important;
    background: transparent !important;
}

body.dark-mode .wheel-item:hover {
    background: rgba(22, 163, 74, 0.2) !important;
}

/* Selection mask overlay - dark gradient instead of white */
body.dark-mode .wheel-selection-mask {
    background: linear-gradient(180deg,
            rgba(15, 23, 42, 0.95) 0%,
            rgba(15, 23, 42, 0.6) 30%,
            rgba(15, 23, 42, 0) 40%,
            rgba(15, 23, 42, 0) 60%,
            rgba(15, 23, 42, 0.6) 70%,
            rgba(15, 23, 42, 0.95) 100%) !important;
}

/* Selection indicator */
body.dark-mode .wheel-selection-indicator {
    border-color: var(--color-primary) !important;
    background: rgba(13, 148, 136, 0.15) !important;
}

/* Manual input mode */
body.dark-mode .wheel-manual-input {
    background: rgba(15, 23, 42, 0.9) !important;
    color: #ffffff !important;
    border-color: var(--color-primary) !important;
}

/* ============================================
   MODAL ACTION BUTTONS — light + dark, no !important
   ============================================ */

/* Wheel picker generic action buttons */
body.dark-mode .wheel-toggle-btn {
    background: rgba(51, 65, 85, 0.9);
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.2);
}
body.dark-mode .wheel-btn-clear {
    border-color: rgba(255, 255, 255, 0.2);
}
body.dark-mode .wheel-btn-confirm {
    background: var(--primary-fill-bg) !important;
    border-color: var(--primary-fill-border) !important;
    color: var(--primary-fill-fg) !important;
}

/* Speichern & Beenden — solides Teal in beiden Modi */
.match-save-btn {
    background: var(--primary-fill-bg);
    color: var(--primary-fill-fg);
    border: none;
}
.match-save-btn:hover {
    background: var(--primary-fill-hover);
}
body.dark-mode .match-save-btn {
    background: var(--primary-fill-bg) !important; /* !important schlägt body.dark-mode button (0,1,2) */
    color: var(--primary-fill-fg) !important;
    border: none !important;
}
body.dark-mode .match-save-btn:hover {
    background: var(--primary-fill-hover) !important;
}
/* Spezifität 0,3,0: schlägt tp-action-btn (0,2,1) wenn beide Klassen gesetzt */
body.dark-mode .match-save-btn.tp-action-btn {
    background: var(--primary-fill-bg) !important;
    color: var(--primary-fill-fg) !important;
    border: none !important;
    box-shadow: none !important;
}
body.dark-mode .match-save-btn.tp-action-btn:hover {
    background: var(--primary-fill-hover) !important;
}

/* Live-Modus — secondary */
.match-live-btn {
    background: rgba(241, 245, 249, 0.9);
    color: #475569;
    border: 1px solid rgba(0, 0, 0, 0.1);
}
body.dark-mode .match-live-btn {
    background: rgba(51, 65, 85, 0.9);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Löschen — danger */
.wheel-btn-delete {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}
.wheel-btn-delete:hover {
    background: #fecaca;
}
body.dark-mode .wheel-btn-delete {
    background: rgba(51, 65, 85, 0.9);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.15);
}
body.dark-mode .wheel-btn-delete:hover {
    background: rgba(71, 85, 105, 0.9);
}body.dark-mode [class*="wheel-drum"] *{
    color: #ffffff !important;
}

body.dark-mode .wheel-item.selected,
body.dark-mode .wheel-item.active,
body.dark-mode .picker-item.selected {
    background: rgba(13, 148, 136, 0.35) !important;
    color: #ffffff !important;
    font-weight: var(--weight-medium);
}

/* Wheelpicker container and borders */
body.dark-mode .wheel-container,
body.dark-mode .picker-container,
body.dark-mode .wheel-drum-wrapper {
    background: rgba(15, 23, 42, 0.98) !important;
    border-color: rgba(13, 148, 136, 0.4) !important;
}

/* ============================================
   MINI-WHEEL (Match Input Modal) - Dark Mode
   These are the smaller wheels used in result entry
   ============================================ */
body.dark-mode .mini-wheel,
body.dark-mode .mini-wheel-wrapper,
body.dark-mode .mini-wheel-inner {
    background: rgba(30, 41, 59, 0.98) !important;
    background-image: none !important;
}

body.dark-mode .mini-wheel {
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* Mini-wheel number items - FORCE WHITE */
body.dark-mode .mini-wheel-inner div,
body.dark-mode .mini-wheel-inner span,
body.dark-mode [class*="mini-wheel"] div,
body.dark-mode [class*="mini-wheel"] span {
    color: #ffffff !important;
    font-weight: var(--weight-bold) !important;
}

/* Mini-wheel mask overlay - HIDE in dark mode (it obscures the white numbers) */
body.dark-mode .mini-wheel-mask {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Mini-wheel selection indicator */
body.dark-mode .mini-wheel-indicator {
    border-color: var(--color-primary) !important;
    background: rgba(13, 148, 136, 0.15) !important;
}

/* Match input modal overall styling */
body.dark-mode .match-input-modal,
body.dark-mode .match-input-grid,
body.dark-mode .match-input-header,
body.dark-mode .match-input-row-with-icon {
    background: transparent !important;
}

body.dark-mode .match-input-header h3,
body.dark-mode .match-input-matchup .team-name,
body.dark-mode .match-input-matchup .vs,
body.dark-mode .wheel-colon {
    color: #f1f5f9 !important;
}

body.dark-mode .match-subtitle {
    color: #94a3b8 !important;
}

/* CRITICAL: Force white color on mini-wheel-item numbers */
body.dark-mode .mini-wheel-item {
    color: #ffffff !important;
}

/* ============================================
   REFEREE MODE - Same dark design as Turnierplan
   ============================================ */

/* Referee mode base styling */
body.dark-mode #referee-mode-container,
body.dark-mode .referee-container,
body.dark-mode [class*="referee"] {
    background: transparent !important;
}

/* Referee match cards - dark background with colored borders */
/* Only apply to actual match cards, not list items or settings */
body.dark-mode .referee-match-card {
    background: rgba(30, 41, 59, 0.9) !important;
    border: 3px solid rgba(22, 163, 74, 0.6);
    border-radius: 12px !important;
}

/* Referee list items (tournament list, not match cards) - subtle white border */
body.dark-mode .schiri-list-item {
    background: rgba(30, 41, 59, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

/* Hier stand eine Pauschalregel (Abbau 23.08.2026) — Begruendung bei .match-finished. */

/* Legacy selectors for referee cards */
body.dark-mode .referee-card,
body.dark-mode #referee-mode-container>div[style*="background"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode .referee-container>div[style*="background"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode .card-body>div[style*="#f0fdf4"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode .card-body>div[style*="#86efac"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode .card-body>div[style*="#fef3c7"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode .card-body>div[style*="#fcd34d"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode .card-body>div[style*="#eff6ff"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode .card-body>div[style*="#86efac"]:not(:where([style*="background:var("],[style*="background: var("])) {
    background: rgba(30, 41, 59, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 8px !important;
}

/* Referee green match cards (completed) - only for actual match cards */
body.dark-mode .referee-match-card.completed {
    background: rgba(30, 41, 59, 0.9) !important;
    border: 3px solid rgba(34, 197, 94, 0.8);
}

/* Referee yellow match cards (pending) - only for actual match cards */
body.dark-mode .referee-match-card.pending {
    background: rgba(30, 41, 59, 0.9) !important;
    border: 3px solid rgba(251, 191, 36, 0.8);
}

/* Referee blue match cards (no result) - only for actual match cards */
body.dark-mode .referee-match-card:not(.completed):not(.pending) {
    background: rgba(30, 41, 59, 0.9) !important;
    border: 3px solid rgba(22, 163, 74, 0.6);
}

/* Hier stand eine Pauschalregel (Abbau 23.08.2026) — Begruendung bei .match-finished. */
   /* `#referee-mode-container` gibt es im ganzen Projekt nicht — die Regel zielte
      seit jeher teilweise ins Leere. */

/* Referee navigation tabs */
body.dark-mode .referee-tabs,
body.dark-mode .referee-nav {
    background: rgba(30, 41, 59, 0.9) !important;
}

body.dark-mode .referee-tab,
body.dark-mode .referee-nav-btn {
    background: rgba(51, 65, 85, 0.8) !important;
    color: #e2e8f0 !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

body.dark-mode .referee-tab.active,
body.dark-mode .referee-nav-btn.active {
    background: var(--primary-fill-bg) !important;
    color: var(--primary-fill-fg) !important;
}

/* ============================================
   MATCH CARD DARK MODE STYLING
   Background, border-radius only - border/box-shadow handled by inline JS
   ============================================ */

/* Base match card in dark mode - NO border !important, let JS control it */
body.dark-mode .schedule-list>div,
body.dark-mode .schedule-card,
body.dark-mode .match-card {
    background: rgba(30, 41, 59, 0.85) !important;
    border-radius: 12px !important;
    /* border and box-shadow controlled by inline styles in script.js */
}/* Regel entfernt 23.08.2026 — .field-card wird im Projekt nirgends gesetzt (nur
   field-card-header, field-card-body und hall-field-card). */

/* NOTE: Green/Red borders and glow effects are set via inline styles
   in renderHallView() function - see script.js for styling logic */

/* Ensure all text in these cards is readable */
/* Hier stand eine Pauschalregel (Abbau 22.08.2026) — Begruendung bei .match-finished. */

/* ============================================
   HALL VIEW (Felderplan) - Force dark backgrounds
   ============================================ */

/* Target hall-view container and its children */
body.dark-mode #hall-view,
body.dark-mode [id*="hall"] {
    background: transparent !important;
}

/* Hall view field cards - inline JS handles background, border, box-shadow based on match state */
body.dark-mode .hall-field-card {
    /* Fallback only - JS inline styles take precedence */
    border-radius: 12px;
}

/* Hier stand eine Pauschalregel (Abbau 22.08.2026) — Begruendung bei .match-finished. */

/* Hall time navigation - dark background instead of purple gradient */
body.dark-mode .hall-time-nav {
    background: rgba(30, 41, 59, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

/* Animations */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.icon-spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
    font-size: var(--fs-3xl);
    line-height: 1;
    transform-origin: center;
}

.icon-check {
    display: inline-block;
    font-size: var(--fs-3xl);
    line-height: 1;
    color: #10b981;
    /* Green */
}

/* Unified Navigation Notification Badge */
.tp-nav-badge {
    display: none;
    position: absolute;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--color-danger);
    border-radius: 10px;
    color: white;
    font-size: var(--fs-2xs);
    font-weight: var(--weight-strong);
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-sizing: border-box;
    z-index: 10;
    pointer-events: none;
    animation: pulse 2s infinite;
}

/* Sync Badge - Icon Style */
.sync-badge {
    margin-right: 4px;
    flex-shrink: 0;
}

/* Base Mobile Logo - Hidden on Desktop */
.mobile-logo {
    display: none;
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-app);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
    /* clip instead of hidden: prevents horizontal scroll without creating a scroll
       container, which would otherwise break backdrop-filter on fixed descendants */
}


/* ===================================================================
   TAUSCH-MODUS: Markierung der Spiele und der Hinweisbalken
   ===================================================================
   Die Markierung stand früher als Inline-Stil im JS (`el.style.background =
   'rgba(239,68,68,0.05)'`). Im Dunkelmodus war davon nichts zu sehen, und zwar
   aus zwei Gründen:

     1. Fünf Prozent Deckkraft reichen auf dunklem Grund nicht.
     2. `body.dark-mode div[style*="radius:12px"]` setzt für JEDEN Kasten mit
        diesem Text im Stil `background: #1e293b !important` UND
        `border-right-color: rgba(255,255,255,0.1) !important` — beides hat die
        Markierung und den roten Streifen überschrieben.

   Deshalb als KLASSEN mit `!important`: Sie stehen später und schlagen damit die
   Textsuch-Regel. Und die Werte stehen an einer Stelle statt im JS verteilt.

   SPEZIFITÄT BEACHTEN: Die Textsuch-Regel liegt bei (0,2,2) — `body` + `.dark-mode`
   + `div` + `[style*=…]`. Eine Regel aus zwei Klassen (0,2,0) verliert gegen sie
   trotz `!important`. Genau daran ist der rote Randstreifen zuerst gescheitert:
   Der Hintergrund kam durch (die Regel trug `body.dark-mode`), der Rand nicht.
   Deshalb steht JEDE Angabe in einem Selektor mit `body.dark-mode` (0,3,1). */
.match-row.tp-swap-conflict,
.match-row.tp-swap-caution,
.match-row.tp-swap-optimal,
body.dark-mode .match-row.tp-swap-conflict,
body.dark-mode .match-row.tp-swap-caution,
body.dark-mode .match-row.tp-swap-optimal {
    border-right-width: 4px !important;
    border-right-style: solid !important;
}

.match-row.tp-swap-conflict { background: var(--accent-red-bg-strong) !important;   border-right-color: var(--color-danger) !important; }
.match-row.tp-swap-caution  { background: var(--accent-amber-bg-strong) !important; border-right-color: var(--color-warning) !important; }
.match-row.tp-swap-optimal  { background: var(--accent-green-bg-strong) !important; border-right-color: var(--color-success) !important; }

/* Im Dunkelmodus kräftiger tönen – sonst verschwindet die Aussage im Hintergrund –
   und den Rand hier ERNEUT setzen, damit er die Textsuch-Regel schlägt. */
body.dark-mode .match-row.tp-swap-conflict { background: rgba(239, 68, 68, 0.22) !important;  border-right-color: #f87171 !important; }
body.dark-mode .match-row.tp-swap-caution  { background: rgba(245, 158, 11, 0.22) !important; border-right-color: #fbbf24 !important; }
body.dark-mode .match-row.tp-swap-optimal  { background: rgba(16, 185, 129, 0.20) !important; border-right-color: #34d399 !important; }

/* Der Hinweisbalken „Tausch-Modus aktiv" scrollte aus dem Bild. Wer weiter unten
   im Spielplan tauscht, sah dann nicht mehr, dass der Modus läuft — und erst
   recht nicht, was als Nächstes zu tun ist. Bleibt jetzt am oberen Rand stehen;
   60px entspricht der Höhe der App-Kopfzeile (wie .player-view-sticky-header). */
.tp-editmode-banner {
    position: sticky;
    top: 60px;
    z-index: 90;
    box-shadow: 0 4px 10px -4px rgba(0, 0, 0, 0.25);
}

/* --- Players View Sticky Header --- */
.player-view-sticky-header {
    position: sticky;
    top: 60px;
    /* Default for mobile (matches .app-header approx height) */
    z-index: 100;
    background: var(--bg-app);
    padding-bottom: 5px;
    margin-bottom: 10px;
    transition: top 0.3s ease;
}

@media (min-width: 900px) {
    .player-view-sticky-header {
        top: 0;
        /* Header is hidden in sidebar mode */
    }
}

.player-bulk-toolbar {
    padding: 7px 15px;
    background: rgba(13, 148, 136, 0.07);
    border-top: 1px solid rgba(13, 148, 136, 0.2);
    color: var(--primary-strong);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    animation: slideDown 0.15s ease-out;
}

.player-bulk-toolbar .btn-xs {
    background: white !important;
    border: 1px solid rgba(13, 148, 136, 0.2) !important;
    color: var(--primary-strong) !important;
}

.player-bulk-toolbar .btn-xs:hover {
    background: #f0fdfa !important;
}

.player-bulk-toolbar .btn-xs.danger {
    background: #fef2f2 !important;
    border-color: rgba(239, 68, 68, 0.2) !important;
    color: var(--accent-red-text) !important;
}

.player-bulk-toolbar .btn-xs.danger:hover {
    background: #fee2e2 !important;
}

.player-bulk-toolbar .toolbar-close-btn {
    background: transparent !important;
    border: 1px solid rgba(13, 148, 136, 0.3) !important;
    color: var(--primary-strong) !important;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.player-bulk-toolbar .toolbar-close-btn:hover {
    background: rgba(13, 148, 136, 0.05) !important;
    transform: rotate(90deg);
}

/* Dark Mode Overrides for Bulk Toolbar */
body.dark-mode .player-bulk-toolbar {
    background: rgba(13, 148, 136, 0.12) !important;
    border-top-color: rgba(13, 148, 136, 0.3) !important;
    color: #5eead4 !important;
}

body.dark-mode .player-bulk-toolbar .btn-xs {
    background: rgba(51, 65, 85, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #e2e8f0 !important;
}

body.dark-mode .player-bulk-toolbar .btn-xs:hover {
    background: rgba(71, 85, 105, 0.9) !important;
}

body.dark-mode .player-bulk-toolbar .btn-xs.danger {
    background: #dc2626 !important;
    /* High contrast red */
    border-color: var(--color-danger) !important;
    color: #ffffff !important;
}

body.dark-mode .player-bulk-toolbar .btn-xs.danger:hover {
    background: #b91c1c !important;
}

body.dark-mode .player-bulk-toolbar .toolbar-close-btn {
    color: #94a3b8 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Ensure Player Selection Fields (Checkboxes) are visible in Dark Mode */
body.dark-mode .player-card input[type="checkbox"] {
    border-color: rgba(255, 255, 255, 0.3) !important;
    background: rgba(15, 23, 42, 0.6) !important;
}

/* Layout */

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-header {
    background: var(--bg-header);
    padding: 0.4rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    z-index: 10;
    position: sticky;
    top: 0;
    gap: 1rem;
    flex-wrap: nowrap;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
    /* Allow shrinking on mobile */
    overflow: hidden;
    /* Prevent overflow */
}

.user-auth-area {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: var(--header-item-height);
}

.logo-area h1 {
    font-family: var(--font-heading);
    font-size: var(--fs-3xl);
    font-weight: var(--weight-medium);
    color: var(--text-main);
}

.logo-area .highlight {
    color: var(--brand-primary);
}

.logo-area .subtitle {
    font-size: var(--fs-sm);
    color: var(--text-body);
    font-weight: var(--weight-medium);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.nav-toggle {
    /* Always show burger menu */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 0, 0, 0.05);
    background: var(--primary-fill-bg);
    color: var(--primary-fill-fg);
    font-size: var(--fs-3xl);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    flex: 0 0 42px;
    transition: all 0.2s;
}

#mobile-nav-toggle-wrapper {
    display: none; /* Hidden on desktop by default */
}

/* Main nav - always dropdown mode */
.main-nav {
    position: absolute;
    top: calc(100% + 5px);
    left: 0.5rem; /* Changed from right: 0.5rem */
    flex-direction: column;
    align-items: stretch;
    width: min(300px, calc(100% - 1rem));
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: var(--shadow-lg);
    background: #ffffff;
    padding: 0.25rem;
    border-radius: var(--radius-md);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10000;
}

.nav-btn {
    border: none;
    background: none;
    font-family: var(--font-heading);
    font-weight: var(--weight-medium);
    font-size: var(--fs-lg);
    height: var(--header-item-height);
    padding: 0 1.1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-main);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    white-space: nowrap;
    line-height: 1;
    width: 100%;
}

.nav-btn:hover {
    color: var(--brand-primary);
    background: transparent;
}

.nav-btn.active {
    background: #ffffff;
    color: var(--brand-primary);
    box-shadow: var(--shadow-sm);
    font-weight: var(--weight-medium);
}

body.nav-open .main-nav {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 9999;
}

body.nav-open .nav-backdrop {
    opacity: 1;
    pointer-events: auto;
}

body.nav-open .app-header {
    z-index: 10001;
}

@media (max-width: 1100px) {
    .app-header {
        align-items: center;
        padding: 0.5rem;
        gap: 8px;
    }

    /* Logo Handling */
    .logo-area {
        flex: 0 0 auto;
        min-width: auto;
    }

    .logo-area .desktop-logo {
        display: none;
    }

    .logo-area .mobile-logo {
        display: block;
        font-size: var(--fs-5xl);
        font-weight: var(--weight-medium);
        font-family: var(--font-heading);
        color: var(--text-main);
        line-height: 1;
    }

    .logo-area .subtitle,
    .app-header .app-logo-text {
        display: none;
    }

    #mobile-nav-toggle-wrapper {
        display: block;
        order: -1; /* Far left */
    }

    /* Action Area (Tournament, Auth, Burger) */
    .header-actions {
        width: 100%;
        justify-content: flex-end;
        align-items: center;
        flex-wrap: nowrap;
        gap: 8px;
    }

    .current-tournament-display {
        order: 1;
        width: auto;
        flex: 1 1 auto;
        min-width: 0;
        height: 42px;
        /* Keep mobile height compact */
        margin: 0;
        padding: 0 10px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: flex;
        align-items: center;
    }

    /* Ensure hierarchy inside tournament display text handles truncation */
    .current-tournament-display .tournament-name {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .current-tournament-display .tournament-label {
        display: none;
        /* Save space: Hide "Turnier:" text on mobile? User wanted "Links das Turnier..." maybe just name */
    }

    /* Auth Button */
    .user-auth-area {
        order: 2;
        flex: 0 0 auto;
        margin: 0;
    }

    .auth-btn {
        height: 42px;
        width: auto;
        padding: 0 12px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Hide Text on very small screens? User wanted "Accountname" so keep it. */
    #auth-btn-text {
        max-width: 80px;
        /* Limit width */
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline-block;
    }

    /* Burger Menu */
    .nav-toggle {
        display: inline-flex;
        width: 42px;
        height: 42px;
        flex: 0 0 42px;
    }

    .main-nav {
        display: none;
        flex-direction: column;
        padding: 10px;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border-color);
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 10000;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
        border-radius: 0 0 16px 16px;
        width: 100%;
        /* Auf kleinen Displays (oder bei großer Schrift) das Menü intern scrollbar machen,
           damit die unteren Einträge erreichbar bleiben. Header ist ~58px hoch. */
        max-height: calc(100dvh - 64px);
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    /* Mobile Nav Buttons */
    .main-nav .nav-btn {
        width: 100%;
        justify-content: flex-start;
        padding: 12px 16px;
        margin: 4px 0;
        border-radius: 8px;
        font-weight: var(--weight-medium);
        font-size: var(--fs-lg);
        color: var(--text-main);
        opacity: 1; /* Row-Opacity übernimmt das Dimmen */
        transition: color 0.2s; /* kein background-transition → keine Artefakte */
        display: flex;
        align-items: center;
        gap: 8px;
        background: transparent !important; /* nie eigener Hintergrund */
    }

    .main-nav .nav-btn:hover {
        background-color: transparent; /* Row übernimmt Hover-Hintergrund */
        opacity: 1;
    }

    .main-nav .nav-btn.active {
        background-color: rgba(13, 148, 136, 0.1);
        color: var(--primary-strong);
        opacity: 1;
        font-weight: var(--weight-medium);
    }

    /* When nav-btn is inside nav-item-row, highlight the whole row instead */
    .main-nav .nav-item-row .nav-btn:hover {
        background-color: transparent;
    }

    .main-nav .nav-item-row .nav-btn.active {
        background-color: transparent;
    }

    .main-nav .nav-btn .icon,
    .main-nav .nav-row-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        min-width: 36px;
        flex-shrink: 0;
        color: var(--text-main);
        opacity: 1; /* Row-Opacity übernimmt das Dimmen */
    }

    /* Nav Item Row: flex container für Chevron + Icon + Button
       Opacity wird auf Row-Ebene gesteuert — einheitliches Dimmen aller Kindelemente */
    .main-nav .nav-item-row {
        display: flex;
        align-items: stretch;
        border-radius: 8px;
        margin: 4px 0;
        transition: background-color 0.2s, opacity 0.2s;
        opacity: 0.7; /* gesamte Zeile gedimmt */
    }

    .main-nav .nav-item-row:hover {
        background-color: rgba(0, 0, 0, 0.05);
        opacity: 1; /* gesamte Zeile auf einmal aufgehellt */
    }

    /* Hover: Icon wird grün — Hintergrund und Opacity übernimmt die Row */
    .main-nav .nav-item-row:hover .nav-row-icon {
        color: var(--primary-strong);
    }

    .main-nav .nav-item-row:has(.nav-btn.active) {
        background-color: rgba(13, 148, 136, 0.1);
        opacity: 1; /* aktive Zeile immer voll sichtbar */
    }

    /* Active: Icon und Chevron ebenfalls grün */
    .main-nav .nav-item-row:has(.nav-btn.active) .nav-row-icon {
        color: var(--primary-strong);
    }

    .main-nav .nav-item-row:has(.nav-btn.active) .nav-chevron-toggle {
        color: var(--primary-strong);
    }

    .main-nav .nav-item-row .nav-btn {
        flex: 1;
        min-width: 0;
        padding-left: 0; /* Text starts after icon */
        margin: 0; /* margin is now on nav-item-row */
    }

    /* Chevron Toggle Button - Now on the left */
    .main-nav .nav-chevron-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        min-width: 36px;
        background: transparent !important; /* Kein eigener Hintergrund */
        border: none;
        -webkit-appearance: none;
        appearance: none;
        cursor: pointer;
        color: var(--text-main);
        opacity: 1; /* Row-Opacity übernimmt das Dimmen */
        transition: color 0.2s;
        border-radius: 8px;
        padding: 0;
        margin-right: 2px;
    }

    /* Spacer for items without submenus */
    .main-nav .nav-chevron-spacer {
        width: 36px;
        min-width: 36px;
        flex-shrink: 0;
        margin-right: 2px;
    }

    .main-nav .nav-chevron-toggle:hover {
        background: transparent !important;
        color: var(--text-main);
    }

    .main-nav .nav-chevron-toggle svg {
        transition: transform 0.25s ease;
    }

    .main-nav .nav-chevron-toggle.open svg {
        transform: rotate(90deg);
    }

    /* Mobile Submenu Styling */
    .main-nav .sidebar-submenu {
        display: none;
        padding-left: 12px;
        margin-bottom: 8px;
        margin-top: -2px;
        position: relative;
    }

    /* Show submenu when toggled open via chevron */
    .main-nav .sidebar-submenu.open {
        display: block;
        animation: slideDown 0.2s ease-out;
    }

    .main-nav .sidebar-submenu-btn {
        padding: 10px 12px 10px 48px;
        font-size: var(--fs-md);
        font-weight: var(--weight-medium);
        color: var(--text-main);
        opacity: 0.7;
        border-radius: 6px;
        width: 100%;
        text-align: left;
        background: transparent;
        border: none;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 10px;
        transition: all 0.2s;
    }

    .main-nav .sidebar-submenu-btn:hover {
        color: var(--primary-strong);
        opacity: 1;
        background: rgba(0, 0, 0, 0.04);
    }

    body.dark-mode .main-nav .sidebar-submenu-btn:hover {
        background: rgba(255, 255, 255, 0.06) !important; /* (0,4,1) schlägt button:hover (0,2,2) */
        color: #2dd4bf;
        opacity: 1;
    }

    .main-nav .sidebar-submenu-btn .icon {
        width: 16px;
        opacity: 0.7;
    }

    /* Dark mode chevron styling */
    body.dark-mode .main-nav .nav-chevron-toggle {
        border-left-color: rgba(255, 255, 255, 0.1);
        color: #94a3b8;
    }

    body.dark-mode .main-nav .nav-chevron-toggle:hover {
        background: transparent !important;
        color: #e2e8f0;
    }

    body.dark-mode .main-nav .nav-item-row:hover {
        background-color: rgba(255, 255, 255, 0.05);
        opacity: 1; /* Row-Ebene */
    }

    /* Dark Mode Hover: Icon wird teal — Rest übernimmt die Row */
    body.dark-mode .main-nav .nav-item-row:hover .nav-row-icon {
        color: #2dd4bf;
    }

    body.dark-mode .main-nav .nav-item-row:has(.nav-btn.active) {
        background-color: rgba(13, 148, 136, 0.15);
        opacity: 1; /* Row-Ebene */
    }

    /* Dark Mode Active: Icon und Chevron teal */
    body.dark-mode .main-nav .nav-item-row:has(.nav-btn.active) .nav-row-icon {
        color: #2dd4bf !important;
    }

    body.dark-mode .main-nav .nav-item-row:has(.nav-btn.active) .nav-chevron-toggle {
        color: #2dd4bf !important;
    }

    body.nav-open .main-nav {
        display: flex;
        opacity: 1;
        pointer-events: auto;
        transform: none;
    }

    .nav-backdrop {
        display: block;
    }

    .content-area {
        padding: 1rem 0.5rem;
    }

    .card-header {
        padding: 1rem;
    }

    .card-body {
        padding: 1rem;
    }
}

@media (max-width: 640px) {
    .content-area {
        max-width: 100%;
        margin: 0;
    }

    .logo-area h1 {
        font-size: var(--fs-4xl);
    }

    .logo-area .subtitle {
        font-size: var(--fs-xs);
    }

    .match-row {
        font-size: var(--fs-2xl);
    }

    .inputs input,
    .inputs .input-score {
        width: 48px;
    }

    .card-body {
        /* Reduced horizontal padding to 0.25rem to make cards wider */
    }

    .standings-card table th,
    .standings-card table td {
        padding: 0.4rem;
    }

    .table-responsive {
        margin: 0 -0.5rem;
        padding: 0 0.5rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }/* Regel entfernt 23.08.2026 — Selektoren ohne Ziel: .fairplay-rule-item */

    .fairplay-rule-item input[type="text"],
    .fairplay-rule-item .points-input {
        flex: 1 1 140px;
        min-width: 140px;
    }

    .team-row {
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .team-row input {
        min-width: 160px;
    }

    .team-row .class-select,
    .team-row select {
        min-width: 120px;
    }

    /* --- Mobile Optimization for Modals (Tournaments/Templates) --- */
    .wide-modal {
        width: 100% !important;
        max-width: 100% !important;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .keypad-content {
        width: 100%;
        max-width: 100%;
        height: 100%;
        /* Full screen on mobile */
        max-height: 100vh;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        padding: 0.75rem;
    }

    .manager-body {
        flex: 1;
        max-height: none;
        /* Let flex handle it */
    }

    .tournament-list-scroll {
        max-height: none;
        /* Let flex handle it */
        flex: 1;
    }

    /* Stack list items vertically */
    .tournament-row,
    .template-li {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .t-info,
    .template-li span {
        width: 100%;
        margin-bottom: 0.25rem;
    }

    .t-actions,
    .template-actions {
        width: 100%;
        display: flex;
        justify-content: space-between;
        /* Spread buttons */
        gap: 0.5rem;
    }

    .t-actions button,
    .template-actions button {
        flex: 1;
        /* Big hit targets */
        justify-content: center;
    }

    /* Adjust header */
    .keypad-header {
        margin-bottom: 1rem;
    }

    .keypad-header h3 {
        font-size: var(--fs-3xl);
    }

    /* Auth Form on Mobile */
    .auth-form .input-field {
        font-size: var(--fs-xl);
        /* Stop iOS zoom */
    }

    .ranking-criteria-list {
        gap: 0.35rem;
    }

    .tabs-sub {
        display: none;
    }

    .tab-switch-select {
        display: block;
        font-size: var(--fs-xl);
        padding: 0.5rem;
    }
}

/* Compact iPhone Portrait Mode */
@media (max-width: 640px) {

    /* Tighter base layout */
    body {
        font-size: var(--fs-xl);
    }

    .content-area {
        padding: 2px !important;
        /* Force minimal outer padding */
    }

    .card {
        border-radius: 8px;
    }

    .card-body {
        padding: 0.5rem 0;
        /* Remove horizontal padding completely */
    }

    .card-header {
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .card-header h2 {
        font-size: var(--fs-2xl);
    }

    /* Navigation - compact */
    .nav-btn {
        font-size: var(--fs-xl);
        padding: 0.6rem 0.75rem;
    }

    /* Buttons - smaller but tappable */
    .btn {
        font-size: var(--fs-lg);
        padding: 0.6rem 1rem;
        min-height: 42px;
    }

    .btn-xs {
        font-size: var(--fs-base);
        padding: 0.4rem 0.6rem;
        min-height: 36px;
    }

    /* Schedule - COMPACT horizontal layout */

    /* Schedule - consistent stacked layout for mobile too */
    .schedule-list {
        gap: 0.5rem;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .match-row {
        padding: 0.5rem !important;
        /* Force tight padding on small screens */
        margin: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
        border-radius: 4px !important;
    }
}

/* Badges - compact */

/* Form elements */

.form-group input,
.form-group select {
    font-size: var(--fs-xl);
    padding: 0.6rem;
    min-height: 42px;
}

.input-field {
    font-size: var(--fs-xl);
    padding: 0.6rem;
    min-height: 42px;
}

/* Form grid */

/* Tables - compact */

/* Auth button */

/* Template/Tournament manager */
.tournament-row,
.template-li {
    padding: 0.6rem;
}

/* Groups - compact */

/* KICKER-STYLE TABLES - AUTO WIDTH, MINIMAL GAPS */

.table-responsive {
    margin: 0;
    padding: 0;
}

.table {
    min-width: auto;
}

.table th,
.table td {
    padding: 0.2rem 0.25rem;
    white-space: nowrap;
    border: none;
}

.table th {
    text-transform: none;
    letter-spacing: 0;
    padding-bottom: 0.3rem;
}

.table td {
    font-size: var(--fs-base);
    font-weight: var(--weight-medium);
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

/* Rank column - tight */
.table td:first-child,
.table th:first-child {
    padding-left: 0.15rem;
    padding-right: 0.15rem;
    font-weight: var(--weight-medium);
}

/* Team name column */
.table .text-left {
    font-size: var(--fs-base);
    font-weight: var(--weight-medium);
    /* max-width: 100px;  Removed to allow full width */
    /* overflow: hidden; */
    /* text-overflow: ellipsis; */
    white-space: nowrap;
    /* Keep on one line for cleaner look */
}

/* Number columns - minimal width */
.table td:not(:first-child):not(.text-left) {
    text-align: center;
    min-width: 20px;
    padding-left: 0.15rem;
    padding-right: 0.15rem;
}

/* Last column (points) - emphasized */
.table td:last-child {
    font-weight: var(--weight-medium);
    padding-right: 0.2rem;
}

/* Tabs compact */

.tab-btn {
    font-size: var(--fs-base);
}

/* Sub views */
.sub-view .hint {
    font-size: var(--fs-xs);
    margin-top: 0.35rem;
}


/* Extra small screens (iPhone SE etc) */
@media (max-width: 380px) {
    .match-row .matchup {
        font-size: var(--fs-base);
    }

    .input-score-display {
        font-size: var(--fs-xl);
        min-width: 24px;
    }

    /* Even more compact tables */
    .table {
        font-size: var(--fs-xs);
        min-width: 280px;
    }

    .table th {
        font-size: var(--fs-2xs);
        padding: 0.2rem 0.1rem;
    }

    .table td {
        padding: 0.25rem 0.1rem;
    }

    .standings-card h3 {
        font-size: var(--fs-base);
    }
}

/* Content Area */
.content-area {
    padding: 1.25rem;
    max-width: none;
    margin: 0;
    width: 100%;
    flex: 1;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: 8px;
    box-shadow: none;
    border: 1px solid #e8eef4;
    overflow: visible;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--brand-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, #ffffff, #fafbfc);
    gap: 0.75rem;
    flex-wrap: wrap;
}

.card-header h2 {
    font-family: var(--font-heading);
    font-size: var(--fs-3xl);
    font-weight: var(--weight-medium);
    color: var(--text-main);
}

.card-body {
    padding: 2rem;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-md);
    font-weight: var(--weight-medium);
    font-family: var(--font-body);
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-size: var(--fs-base);
}

/* WURZELKORREKTUR: Tailwind-Preflight setzt `svg { display:block }`. In Buttons drückt ein
   Block-SVG den Text in eine neue Zeile (Icon oben, Text darunter) – auf ALLEN Bildschirmen.
   Icons in Buttons wieder inline stellen, damit Icon + Text in einer Zeile stehen. */
.btn svg,
button.btn svg,
.tp-action-btn svg {
    display: inline-block !important;
    vertical-align: middle;
}

.btn.primary {
    background: var(--primary-fill-bg);
    color: var(--primary-fill-fg);
    box-shadow: 0 4px 6px -1px rgba(13, 148, 136, 0.25);
}

.btn.primary:hover {
    background: var(--primary-fill-hover);
    transform: translateY(-1px);
}

.btn.secondary {
    background: var(--brand-secondary);
    color: var(--text-main);
}

.btn.secondary:hover {
    background: hsl(var(--primary-hue), 10%, 85%);
}

/* ── Auswahl-Dialog: senkrechte Knopfreihe und Warnfarbe ──────────────
   Beides am 06.09.2026 dazugekommen, als die zwei von Hand gebauten
   Rueckfragen der Ergebnis-Eingabe in showOptionDialog hereingezogen wurden.

   SENKRECHT: Vier Knoepfe mit Beschriftungen wie „Ergebnis speichern & Spiel
   beenden (3:2)" brechen in der waagerechten, rechtsbuendigen Reihe unschoen um.

   GEFAHR: .btn kannte nur `primary` und `secondary` — gar kein Rot. „Löschen &
   Wechseln" und „Selbst live schalten" haetten ihre Warnung verloren. Dieselbe
   Bedeutung drueckt showConfirm mit .tp-rueckfrage-ja.ist-gefahr schon aus. */
.dialog-footer.ist-senkrecht {
    flex-direction: column;
    align-items: stretch;
}

.dialog-footer.ist-senkrecht .btn {
    width: 100%;
    justify-content: center;
    padding: 0.8rem 1.2rem;
}

.btn.gefahr {
    background: var(--accent-red-bg);
    color: var(--accent-red-text);
}

.btn.gefahr:hover {
    background: var(--accent-red-text);
    color: white;
}

/* NOETIG, weil `body.dark-mode button` jeden Knopf ohne Inline-`background:var(`
   grau uebermalt — .btn wird ueber Klassen gestaltet. */
body.dark-mode .btn.gefahr { background: var(--accent-red-bg) !important; color: var(--accent-red-text) !important; }
body.dark-mode .btn.gefahr:hover { background: var(--accent-red-text) !important; color: white !important; }

/* ── Platzierung bei Punktgleichheit: erst der Satz, dann die Felder ───
   Gemessen am 06.09.2026: Der Block war 402 px hoch — 40 % des ganzen Reiters
   „Einstellungen" (995 px) — für drei Auswahlfelder. Es ist eine Einstellung,
   die man einmal je Phase trifft.

   Zugeklappt steht sie als Satz da („Punkte, dann Trefferdifferenz, dann
   Erzielte Treffer"), aufgeklappt sind es dieselben vier Zeilen wie vorher.
   Verschwunden ist also nichts — nur die Höhe im Ruhezustand. */
.tp-rangfolge > summary {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    /* Der Rand kommt vom Block: Im Editor sitzt er direkt in der Karte (20 px),
       in der Planungshilfe schon in einer Karte MIT Rand (0). */
    padding: 12px var(--tp-rang-rand, 20px);
    cursor: pointer;
    list-style: none;
}

.tp-rangfolge > summary::-webkit-details-marker { display: none; }

.tp-rangfolge-titel {
    font-size: var(--fs-sm);
    font-weight: var(--weight-strong);
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Was gerade gilt — ausgeschrieben, damit die Angabe nicht mit dem
   Bedienelement verschwindet. Dieselbe Regel wie beim „nacheinander" in der
   Zeitzeile des Rhythmus-Dialogs. */
.tp-rangfolge-satz {
    /* `flex: 1 1 220px` statt `flex: 1`: Auf schmalen Geraeten rutscht der Satz auf
       eine eigene Zeile, statt zwischen Titel und „Ändern" zerquetscht zu werden.
       pruefe-ueberdeckung.js hat genau das gemeldet — bei 350 px ragte er um
       69 px heraus und blieb 35 px breit. */
    flex: 1 1 220px;
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: var(--fs-md);
    font-weight: var(--weight-strong);
    color: var(--text-secondary);
}

.tp-rangfolge-mehr {
    flex-shrink: 0;
    font-size: var(--fs-sm);
    font-weight: var(--weight-strong);
    color: var(--primary-strong);
}

.tp-rangfolge[open] .tp-rangfolge-mehr { color: var(--text-subtle); }
.tp-rangfolge[open] .tp-rangfolge-satz { display: none; }

/* Utilities */
.placeholder-text {
    text-align: center;
    color: var(--text-body);
    padding: 3rem;
    border: 2px dashed var(--brand-secondary);
    border-radius: var(--radius-md);
}

/* Forms & Inputs */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.form-section h3 {
    margin-bottom: 1rem;
    color: var(--text-main);
    font-size: var(--fs-2xl);
}

.form-group {
    margin-bottom: 1rem;
}

/* Dark mode: make form-group containers transparent - override inline styles too */
body.dark-mode .form-group,
body.dark-mode .form-group[style],
body.dark-mode .settings-accordion-inner .form-group,
body.dark-mode .settings-accordion-inner .form-group[style] {
    background: transparent !important;
    border: none !important;
}

/* Gruppen & Teams section header spacing */
body.dark-mode .groups-section .section-header {
    margin-bottom: 16px;
}

body.dark-mode .groups-section .group-buttons-wrapper {
    margin-top: 12px;
}

.form-group.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: var(--weight-medium);
    color: var(--text-main);
}

.form-group.checkbox-group input {
    width: auto;
}

.ranking-criteria-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: var(--bg-card, #f8fafc);
    padding: 0.75rem 0.75rem 0.75rem 1rem;
    border-radius: var(--radius-sm);
}


.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: var(--fs-base);
    font-weight: var(--weight-medium);
    color: var(--text-body);
}

.form-group input {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--brand-secondary);
    border-radius: var(--radius-sm);
    font-size: var(--fs-lg);
    font-family: var(--font-body);
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.flex-row {
    display: flex;
    gap: 1rem;
}

/* Schmale Zahlen-Eingabefelder für Fairplay-Einstellungen */
.number-input-small {
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
    text-align: center;
}

.fairplay-rule-item input[type="text"]:not(.number-input-small) {
    flex: 1;
    min-width: 120px;
}

.fairplay-rules-list {
    background: #f8fafc;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
}/* Regel entfernt 23.08.2026 — Selektoren ohne Ziel: .fairplay-table */

.fairplay-table-header {
    display: grid;
    grid-template-columns: 1fr 80px 32px;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--brand-secondary);
    margin-bottom: 0.5rem;
    font-weight: var(--weight-medium);
    font-size: var(--fs-base);
    color: var(--text-body);
}

.fairplay-table-row {
    display: grid;
    grid-template-columns: 1fr 80px 32px;
    gap: 0.5rem;
    padding: 0.35rem 0;
    align-items: center;
}

.fairplay-table-row input.col-vergehen {
    width: 100%;
}

.fairplay-table-header .col-striche {
    text-align: left;
}

.fairplay-table-row .col-striche {
    text-align: center;
}

.fairplay-table-header .col-action {
    width: 32px;
}

/* Punkteskala-Tabelle (kompakter) */
.fairplay-table-header.scale-header,
.fairplay-table-row.scale-row {
    grid-template-columns: 90px 90px 32px;
}

/* Weiße Hintergrundfarbe für Fairplay-Eingabefelder */
.fairplay-table-row input.number-input-small {
    background: #fff;
}


/* Limit width of standings content on large screens */
#standings>.standings-toolbar,
#standings>.group-card {
    max-width: 1320px;
    margin-left: auto;
    margin-right: auto;
}

.col-striche-max,
.col-punkte {
    text-align: left;
}

/* Inputs in der Tabelle bleiben zentriert */
.fairplay-table-row input.col-striche-max,
.fairplay-table-row input.col-punkte {
    text-align: center;
}

.nowrap {
    white-space: nowrap;
}


.field-names-container {
    padding-left: 1rem;
    border-left: 2px solid var(--brand-secondary);
    margin-top: 1rem;
}

.divider {
    border: none;
}

/* Groups Grid */
.groups-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.group-card {
    padding: 1rem;
}

.group-header {
    align-items: center;
    gap: 0.5rem;
}

.group-name-input {
    font-weight: var(--weight-medium);
    padding: 0.3rem;
    border: 1px solid transparent;
    background: transparent;
    font-size: var(--fs-xl);
    width: 100%;
}

.group-name-input:hover,
.group-name-input:focus {
    background: #fff;
    border-color: #cbd5e1;
}

.team-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.team-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.team-num {
    font-size: var(--fs-md);
    color: var(--text-body);
    width: 20px;
}

.team-row input {
    flex: 1;
    padding: 0.4rem;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    font-size: var(--fs-base);
}

.btn-icon {
    opacity: 0.7;
    /* Slightly increased opacity */
}

.btn-icon:hover {
    opacity: 1;
    /* Red for delete on hover */
}

/* Specific override for visibility on mobile/light mode where background is gray */
.btn-icon.danger,
button.btn-icon.danger,
.btn-icon.danger i,
.btn-icon.danger svg {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    fill: #ffffff !important;
    opacity: 1 !important;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    /* Remove iOS button styling */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    /* Add shadow to improve visibility if white-on-white */

    /* CRITICAL: Force Icons to be white by inverting them (Black -> White) */
    /* Check if user uses Dark Mode, but this rule is for general 'danger' buttons which might be dark */
    /* Since we want WHITE, we start with Black emoji and invert? */
    /* Actually, 'grayscale(100%) brightness(200%)' usually makes things white */
    filter: grayscale(100%) brightness(500%);
}

.btn-add-team {
    margin-top: 0.5rem;
    width: 100%;
    padding: 0.4rem;
    border: 1px dashed #cbd5e1;
    background: none;
    color: var(--text-body);
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: var(--fs-base);
}

.btn-add-team:hover {
    background: #fff;
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

/* Schedule View */
.schedule-list {
    display: flex;
    flex-direction: column;
}

.schedule-header-row {
    grid-template-columns: 80px 100px 100px 1fr 120px;
    gap: 1rem;
    padding: 0.5rem 1rem;
    font-weight: var(--weight-medium);
    color: var(--text-body);
    font-size: var(--fs-base);
    text-transform: none;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e2e8f0;
}

.match-row {
    grid-template-columns: 80px 100px 100px 1fr 120px;
    transition: all 0.2s;
}

.match-row:hover {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-sm);
}

/* Gespielte Karte in der schmalen Ansicht. Bis 22.08.2026 stand hier zusätzlich
   `opacity: 0.8`, und die traf ALLES in der Karte: Uhrzeit und Feld fielen auf 3,22:1,
   die Teamnamen auf 3,93:1, der Spielstand auf 3,85:1 — und beim Trennpunkt, der selbst
   schon durchsichtig war, multiplizierte es sich auf 1,53:1. 222 Fundstellen aus dieser
   einen Zeile.
   Dass die Karte gespielt ist, sagt schon die eigene Fläche (#f8fafc gegen das Weiß der
   offenen Karten) und der Spielstand darin. Gleiche Entscheidung wie bei der
   Tabellenzeile im Dunkelmodus weiter oben: Zustand über Farbe, nicht über Deckkraft. */
.match-row.played {
    background: #f8fafc;
    border-color: transparent;
}

.matchup-col {
    text-align: center;
}

.team-right {
    text-align: right;
    flex: 1;
}

.team-left {
    text-align: left;
    flex: 1;
}

.vs {
    color: var(--text-body);
    font-weight: var(--weight-normal);
    font-size: var(--fs-base);
    /* Slightly larger matching badget size relative */
}

.inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.inputs input {
    width: 50px;
    /* Increased width for larger font */
    text-align: center;
    padding: 0.25rem;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-weight: var(--weight-medium);
    font-family: var(--font-heading);
    font-size: var(--fs-4xl);
    /* Increased from default */
    height: 40px;
    /* Ensure height matches */
    color: var(--text-main);
    /* Explicitly use main text color (handle dark mode) */
}

.inputs input:focus {
    border-color: var(--brand-primary);
    outline: none;
    background: #eff6ff;
}

/* --- GLOBAL FAIRPLAY GREEN STYLING --- */
.input-fairplay,
.fairplay-value,
.fairplay-mode .wheel-display-value,
.fairplay-mode .wheel-item.selected,
.fairplay-row-input .input-box,
.pm-fairplay-row .pm-val-col,
.match-input-row-with-icon.fairplay .mini-wheel-item {
    color: var(--text-main) !important;
    /* Unify color with team names */
}

/* Backgrounds & Borders for Inputs */
.input-fairplay,
.fairplay-row-input .input-box {
    border-color: #86efac !important;
    background-color: #f0fdf4 !important;
}

.input-fairplay:focus,
.fairplay-row-input .input-box:focus {
    border-color: #16a34a !important;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2) !important;
    background-color: #dcfce7 !important;
}

/* Wheel Picker Indicator for Fairplay */
.match-input-row-with-icon.fairplay .mini-wheel-indicator {
    border-color: #16a34a !important;
    background: rgba(22, 163, 74, 0.1) !important;
}

/* Old Wheel Picker Support */
.wheel-container.fairplay-mode .wheel-item.selected {
    color: #15803d;
    background: #f0fdf4;
    border-color: #86efac;
}

/* Responsive adjustment for schedule */
@media (max-width: 1024px) {
    .schedule-header-row {
        display: none;
    }

    .match-row {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
        text-align: center;
        padding: 0.75rem;
    }

    .match-row>* {
        width: 100%;
        text-align: center;
    }

    .badget,
    .matchup,
    .inputs {
        justify-content: center;
    }

    .matchup {
        margin: 0.5rem 0;
        font-size: var(--fs-3xl);
        flex-direction: column;
        gap: 0.35rem;
    }

    .inputs {
        width: 100%;
        gap: 0.35rem;
        flex-wrap: nowrap;
    }

    .inputs input {
        width: 64px;
        font-size: var(--fs-xl);
    }

    .inputs .input-score {
        width: 64px;
        font-size: var(--fs-xl);
    }

    .inputs .input-fairplay {
        width: 64px !important;
        font-size: var(--fs-2xl) !important;
    }

    .fairplay-inputs {
        justify-content: center;
        flex-wrap: nowrap;
        gap: 0.35rem;
    }
}

/* Standings View */
.standings-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: flex-start;
}

.table-responsive {
    width: 100%;
    max-width: 100vw;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
}

/* Custom scrollbar for better visibility */
.table-responsive::-webkit-scrollbar {
    height: 12px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 6px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 6px;
    border: 2px solid #f1f5f9;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

.standings-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 0.75rem;
    box-shadow: var(--shadow-sm);
    display: inline-block;
    width: auto;
    max-width: 100%;
}

.standings-card h3 {
    margin-bottom: 1rem;
    font-size: var(--fs-2xl);
    color: var(--brand-primary);
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 0.5rem;
}

.table {
    width: auto;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: var(--fs-base);
}

.table th {
    text-align: center;
    padding: 0.3rem 0.35rem;
    color: var(--text-body);
    font-weight: var(--weight-medium);
    font-size: var(--fs-sm);
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.table td {
    text-align: center;
    padding: 0.35rem 0.35rem;
    border-bottom: 1px solid #f8fafc;
    white-space: nowrap;
}

.table tr:last-child td {
    border-bottom: none;
}

.table .text-left {
    text-align: left;
    padding-right: 0.5rem;
}

.table .font-bold {
    font-weight: var(--weight-medium);
    color: var(--text-main);
}

/* --- Templates --- */
.template-ul {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.template-li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    font-size: var(--fs-base);
}

.template-li:last-child {
    border-bottom: none;
}

.template-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-xs {
    padding: 0.25rem 0.6rem;
    font-size: var(--fs-sm);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-input, #cbd5e1);
    background: var(--bg-button-secondary, white);
    color: var(--text-main, #1e293b);
    cursor: pointer;
    font-weight: var(--weight-medium);
    transition: all 0.15s ease;
}

.btn-xs.danger {
    color: var(--color-danger, var(--accent-red-text));
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.1);
}

.btn-xs:hover {
    background: var(--color-secondary-hover, #f8fafc);
}

/* --- Keypad Modal (Base Class) --- */
.keypad-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200000;
    -webkit-backdrop-filter: blur(16px);
}

.keypad-modal.hidden {
    display: none !important;
}

/* --- Modal Z-Index Hierarchy --- */
/* Base modal (match input) - lowest */
#match-input-modal.keypad-modal {
    z-index: 9000;
}

/* Overlay modal (fairplay detail) - middle */
/* Wheelpicker modal - highest (uses base .keypad-modal z-index 200000) */
#wheel-modal.keypad-modal {
    z-index: 2000000; /* Increased to 2M to stay above modern overlays (999999) */
}

.center-modal {
    display: flex;
}

.keypad-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.keypad-header span {
    font-weight: var(--weight-medium);
    font-size: var(--fs-2xl);
}

.btn-close-keypad {
    background: none;
    border: none;
    font-size: var(--fs-3xl);
    cursor: pointer;
    color: var(--text-body);
}

body.dark-mode .btn-close-keypad {
    background: none !important;
    border: none !important;
}

/* Size picker buttons for print dialogs */
.size-picker-btn {
    background: #f8fafc !important;
    border: 2px solid #e2e8f0 !important;
}
.size-picker-btn.size-selected {
    background: var(--primary-fill-bg) !important;
    border-color: var(--primary-fill-border) !important;
}
.size-picker-btn .size-label { color: #64748b; }
.size-picker-btn .size-sub { color: #94a3b8; }
.size-picker-btn .size-bar { background: #cbd5e1; }
.size-picker-btn .size-check { display: none; color: var(--primary-fill-fg); }
.size-picker-btn.size-selected .size-label { color: var(--primary-fill-fg); }
.size-picker-btn.size-selected .size-sub { color: var(--primary-fill-fg); }
.size-picker-btn.size-selected .size-bar { background: var(--primary-fill-fg); }
.size-picker-btn.size-selected .size-check { display: block; }
body.dark-mode .size-picker-btn {
    background: rgba(30,41,59,0.9) !important;
    border-color: rgba(255,255,255,0.12) !important;
}
body.dark-mode .size-picker-btn.size-selected {
    background: var(--primary-fill-bg) !important;
    border-color: var(--primary-fill-border) !important;
}
body.dark-mode .size-picker-btn .size-label { color: #94a3b8; }
body.dark-mode .size-picker-btn .size-sub { color: rgba(148,163,184,0.75); }
body.dark-mode .size-picker-btn.size-selected .size-label { color: var(--primary-fill-fg); }
body.dark-mode .size-picker-btn.size-selected .size-sub { color: var(--primary-fill-fg); }
body.dark-mode .keypad-modal .size-picker-btn .size-bar { background: rgba(255,255,255,0.15) !important; }
body.dark-mode .keypad-modal .size-picker-btn.size-selected .size-bar { background: var(--primary-fill-fg) !important; }

.keypad-display {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    font-size: 2rem;
    font-weight: var(--weight-medium);
    text-align: center;
    margin-bottom: 1.5rem;
    min-height: 60px;
    letter-spacing: 2px;
}

.keypad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.keypad-grid button {
    padding: 1rem;
    font-size: var(--fs-3xl);
    font-weight: var(--weight-medium);
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.1s;
}

.keypad-grid button:active {
    background: #f1f5f9;
    transform: scale(0.95);
}

/* --- Standard Icon Buttons --- */
.btn-icon {
    border: none;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    color: var(--text-body);
    font-size: var(--fs-xl);
    padding: 4px;
}

.btn-icon:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-main);
}

.btn-icon.danger {
    color: var(--color-danger);
    opacity: 0.8;
}

.btn-icon.danger:hover {
    background: var(--bg-danger);
    color: var(--color-danger-hover);
    opacity: 1;
}

.keypad-grid .btn-clear {
    background-color: #fef2f2;
    color: var(--accent-red-text);
    border-color: #fee2e2;
}

.keypad-grid .btn-ok {
    background-color: var(--primary-fill-bg);
    color: var(--primary-fill-fg);
    border-color: var(--primary-fill-border);
}

/* --- New Sub-View Tabs --- */
.tabs-sub {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.5rem;
    overflow-x: auto;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    color: var(--text-body);
    font-weight: var(--weight-medium);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn:hover {
    background: #f1f5f9;
    color: var(--text-main);
}

.tab-btn.active {
    background: #e0e7ff;
    /* brand-light */
    color: var(--brand-primary);
}

.tab-switch-select {
    display: none;
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid #cbd5e1;
    background: #fff;
}

/* --- Fairplay Inputs & Columns --- */
.fairplay-inputs {
    margin-left: 0.5rem;
    border-left: 1px solid #e2e8f0;
    padding-left: 0.5rem;
}

.input-fairplay {
    width: 35px !important;
    font-size: 0.8em !important;
    border-color: #a7f3d0 !important;
    /* Green tint */
}

.fairplay-active {
    grid-template-columns: 80px 80px 80px 1fr 110px 90px !important;
}

.match-row.fairplay-row {
    grid-template-columns: 80px 80px 80px 1fr 110px 90px !important;
}

.fp-col {
    color: #059669;
    /* Green-600 */
    font-weight: var(--weight-medium);
}

/* --- Combined Table --- */
.badge-class {
    display: inline-block;
    font-size: 0.7em;
    padding: 1px 4px;
    border-radius: 3px;
    background: #f3f4f6;
    color: #64748b;
    margin-left: 6px;
    vertical-align: middle;
}

.full-width {
    max-width: 1100px;
    margin: 0 auto;
}

.highlight {
    background: #f0fdf4;
    /* Green-50 */
    color: #15803d;
    /* Green-700 */
}

.text-lg {
    font-size: var(--fs-2xl);
}

/* --- Tournament Manager Styles --- */

.wide-modal {
    /* Width handled inline by script.js */
    display: block;
}

.manager-body {
    display: flex;
    flex-direction: column;
}

.manager-actions {
    justify-content: space-between;
    align-items: center;
}

.clickable-label {
    display: inline-flex;
    align-items: center;
}

.tournament-list-scroll {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.tournament-row {
    border: 1px solid #e8eef4;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    transition: all 0.2s;
}

.tournament-row.active-row {
    border-color: var(--brand-primary);
    box-shadow: none;
}

.t-info {
    display: flex;
    flex-direction: column;
}

.badge-active {
    text-transform: uppercase;
    vertical-align: middle;
}

.t-actions {
    flex: 0 0 auto;
}

/* --- Current Tournament Display --- */
.current-tournament-display {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(22, 163, 74, 0.1));
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: var(--radius-md);
    gap: 0.5rem;
    font-size: var(--fs-base);
}

.tournament-label {
    color: var(--text-body);
    font-weight: var(--weight-medium);
}

.tournament-name {
    color: var(--brand-primary);
    font-weight: var(--weight-medium);
    font-family: var(--font-heading);
}

/* --- Fairplay Rules Configuration --- */
.fairplay-rules-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}/* Regel entfernt 23.08.2026 — Selektoren ohne Ziel: .fairplay-rule-item */

.fairplay-rule-item input[type="text"] {
    flex: 1;
    min-width: 150px;
}

.fairplay-rule-item .points-input {
    width: 60px;
    text-align: center;
}

.fairplay-rule-item .btn-icon {
    margin-left: auto;
}

.fairplay-rule-item .points-label {
    font-size: var(--fs-md);
    color: var(--text-body);
}

.input-fixed-criteria {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    color: var(--text-body);
    font-weight: var(--weight-medium);
}

/* --- Print Options Modal --- */
.print-options-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 0;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.checkbox-option:hover {
    background: #f1f5f9;
}

.checkbox-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* --- Textarea for Rules --- */
textarea {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--brand-secondary);
    border-radius: var(--radius-md);
    font-size: var(--fs-lg);
    font-family: var(--font-body);
    resize: vertical;
    min-height: 80px;
}

textarea:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

/* --- Scale Item --- */
.scale-item span {
    font-size: var(--fs-base);
    color: var(--text-body);
}

/* --- Wheel Picker Component --- */
.wheel-picker-content {
    background: white;
    padding: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 320px;
    max-width: 90%;
    overflow: hidden;
}

.wheel-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
}

.wheel-picker-header h3 {
    margin: 0;
    font-size: var(--fs-2xl);
}

.wheel-picker-body {
    position: relative;
    margin: 1.5rem 0;
}

.wheel-drum {
    height: 200px;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    position: relative;
    border-radius: 12px;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 50%, #f8fafc 100%);
}

.wheel-drum::-webkit-scrollbar {
    display: none;
}

.wheel-drum-inner {
    padding: 80px 0;
}

.wheel-item {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: var(--weight-medium);
    scroll-snap-align: center;
    cursor: pointer;
    font-family: var(--font-heading);
}

.wheel-item:hover {
    background: rgba(22, 163, 74, 0.05);
}

/* Selection highlight overlay */
.wheel-selection-mask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.wheel-selection-indicator {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 44px;
    transform: translateY(-50%);
    pointer-events: none;
    border-radius: 8px;
}

/* Manual input mode */
.wheel-manual-container {
    display: none;
    flex-direction: column;
    align-items: center;
}

.wheel-manual-container.active {
    display: flex;
}

.wheel-drum-wrapper.hidden {
    display: none;
}

.wheel-manual-input {
    font-size: 2.5rem;
    text-align: center;
    padding: 0.75rem;
    outline: none;
    font-family: var(--font-heading);
}

.wheel-manual-input:focus {
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.2);
}

/* Toggle and action buttons */
.wheel-toggle-btn {
    display: block;
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 1rem;
    background: none;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: var(--text-body);
    font-size: var(--fs-base);
    cursor: pointer;
    transition: all 0.2s;
}

.wheel-toggle-btn:hover {
    background: #f8fafc;
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.wheel-actions {
    display: flex;
}

.wheel-actions button {
    flex: 1;
    font-weight: var(--weight-medium);
    cursor: pointer;
    transition: all 0.2s;
}

.wheel-btn-clear {
    border: 1px solid #fecaca;
}

.wheel-btn-clear:hover {
    background: #fee2e2;
}

.wheel-btn-confirm {
    border: none;
}

.wheel-btn-confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* --- Combined Match Input Modal --- */
.match-input-modal {
    width: 95%;
    max-width: 600px;
    padding: 15px 10px !important;
}

.match-input-header {
    text-align: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0;
    border-bottom: none;
}

.match-input-header h3 {
    margin: 0 0 0.25rem 0;
    color: var(--text-main);
}

.match-input-header .match-subtitle {
    color: var(--text-body);
    font-size: var(--fs-base);
}

.match-input-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Matchup Header - "a1 vs b1" */
/* Matchup Header - "a1 vs b1" - Grid for perfect center vs */
.match-input-matchup {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    margin-bottom: 0.5rem;
    width: 100%;
}

.match-input-matchup .team-name {
    font-size: var(--fs-2xl);
    font-weight: var(--weight-medium);
    color: var(--brand-primary);
    min-width: 0;
    /* Prevent overflow issues */
    overflow-wrap: break-word;
    /* Handle long names gracefully */
}

.match-input-matchup .team-name:first-child {
    text-align: right;
    justify-self: end;
}

.match-input-matchup .team-name:last-child {
    text-align: left;
    justify-self: start;
}

.match-input-matchup .vs {
    font-size: var(--fs-base);
    color: var(--text-body);
    font-weight: var(--weight-medium);
}

/* Row with Icon on left */
.match-input-row-with-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0;
}

.match-input-row-with-icon .row-icon {
    font-size: var(--fs-5xl);
    width: 40px;
    text-align: center;
    flex-shrink: 0;
}

/* Invisible spacer to balance the icon and keep wheels centered */
.match-input-row-with-icon .row-spacer {
    width: 40px;
    flex-shrink: 0;
}

.match-input-row-with-icon .wheel-colon {
    font-size: var(--fs-5xl);
    font-weight: var(--weight-medium);
    color: var(--text-main);
    padding: 0 0.25rem;
}

/* Treffer row - Blue theme */

/* Fairplay row - Gold/Orange theme */
.match-input-row-with-icon.fairplay .mini-wheel-indicator {
    border-color: #b45309;
    background: rgba(180, 83, 9, 0.06);
}

.mini-wheel-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.mini-wheel-label {
    font-size: var(--fs-md);
    font-weight: var(--weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.mini-wheel {
    height: 140px;
    width: 70px;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-radius: 10px;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 50%, #f8fafc 100%);
    border: 2px solid #e2e8f0;
    position: relative;
}

.mini-wheel::-webkit-scrollbar {
    display: none;
}

.mini-wheel.active {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.mini-wheel-inner {
    padding: 50px 0;
}

.mini-wheel-item {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-5xl);
    font-weight: var(--weight-medium);
    color: var(--text-main);
    scroll-snap-align: center;
    cursor: pointer;
    font-family: var(--font-heading);
}

.mini-wheel-item:hover {
    background: rgba(22, 163, 74, 0.08);
}

/* Mini wheel selection indicator */
.mini-wheel-wrapper {
    position: relative;
}

.mini-wheel-indicator {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 42px;
    transform: translateY(-50%);
    border-top: 2px solid var(--brand-primary);
    border-bottom: 2px solid var(--brand-primary);
    background: rgba(22, 163, 74, 0.06);
    pointer-events: none;
    border-radius: 6px;
}

.mini-wheel-mask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.9) 0%,
            rgba(255, 255, 255, 0) 30%,
            rgba(255, 255, 255, 0) 70%,
            rgba(255, 255, 255, 0.9) 100%);
    border-radius: 10px;
}

/* Responsive for mobile */
@media (max-width: 480px) {
    .mini-wheel {
        width: 60px;
        height: 120px;
    }

    .mini-wheel-item {
        font-size: var(--fs-3xl);
        height: 35px;
    }

    .mini-wheel-inner {
        padding: 42px 0;
    }
}

/* Match Result Inputs (View Mode) */
.input-box {
    display: inline-block;
    min-width: 32px;
    text-align: center;
    font-weight: var(--weight-medium);
    padding: 0.1rem 0.2rem;
    border-radius: 4px;
    color: var(--text-main);
    font-size: var(--fs-4xl);
    /* Increased size */
    line-height: 1.2;
}

/* Score display in match row */
.input-score-display,
.input-fairplay-display {
    display: inline-block;
    min-width: 30px;
    text-align: center;
    font-weight: var(--weight-medium);
    font-size: var(--fs-xl);
    font-family: var(--font-heading);
    padding: 0.25rem 0.5rem;
    background: #f8fafc;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.input-fairplay-display {
    border-color: #a7f3d0;
    color: #059669;
}

.match-row:hover .input-score-display,
.match-row:hover .input-fairplay-display {
    background: #fff;
    border-color: var(--brand-primary);
}

/* --- Manager Modals (Tournament & Template) --- */
.wide-modal {
    width: 95%;
    max-width: 550px;
}

.manager-body {
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

.manager-section {
    margin-bottom: 1rem;
}

.manager-section h4 {
    font-size: var(--fs-lg);
    color: var(--text-main);
    margin-bottom: 0.75rem;
    font-weight: var(--weight-medium);
}

.manager-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.template-save-row .input-field {
    flex: 1;
    padding: 0.6rem 0.8rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: var(--fs-lg);
}

.template-list-scroll,
.tournament-list-scroll {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.tournament-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f8fafc;
}

.tournament-row.active-row {
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.08), rgba(79, 70, 229, 0.08));
}

.t-info {
    flex: 1;
    min-width: 0;
}

.t-name {
    font-weight: var(--weight-medium);
    color: var(--text-main);
    font-size: var(--fs-lg);
    display: block;
    min-width: 0;
    overflow: visible;
    white-space: normal;
    overflow-wrap: anywhere;
}

.t-date {
    font-size: var(--fs-md);
    color: var(--text-body);
    margin-top: 0.2rem;
}

.t-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.badge-active {
    display: inline-block;
    background: var(--primary-fill-bg);
    color: var(--primary-fill-fg);
    font-size: var(--fs-xs);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    margin-left: 0.5rem;
    font-weight: var(--weight-medium);
}

.divider {
    height: 1px;
    background: #e2e8f0;
    margin: 1.25rem 0;
}

.clickable-label {
    cursor: pointer;
}

.hidden-input {
    display: none;
}

/* --- Landing Page / Login Gate --- */
.landing-page {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: linear-gradient(135deg, var(--bg-app) 0%, #eef2ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
}

.landing-content {
    background: #ffffff;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
    max-width: 450px;
    width: 100%;
}

.landing-logo h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.landing-logo .highlight {
    color: var(--brand-primary);
}

.version-tag {
    display: inline-block;
    background: var(--brand-secondary);
    color: var(--text-body);
    font-size: var(--fs-sm);
    padding: 0.2rem 0.5rem;
    border-radius: 1rem;
    margin-bottom: 1.5rem;
}

.landing-subtitle {
    font-size: var(--fs-2xl);
    color: var(--text-body);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.landing-actions {
    margin-bottom: 2.5rem;
}

.landing-features {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-top: 1px solid var(--brand-secondary);
    padding-top: 1.5rem;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-body);
    font-size: var(--fs-base);
    font-weight: var(--weight-medium);
}

.feature-item .icon {
    font-size: var(--fs-5xl);
}

@media (max-width: 480px) {
    .landing-content {
        padding: 1.5rem;
    }

    .landing-logo h1 {
        font-size: 2rem;
    }
}

/* --- Auth/Keypad Modal Fixes --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s;
    backdrop-filter: blur(4px);
}

/* [Fix v2.14.86] Lighter overlay for Referee Mode to maintain glass transparency */
body.referee-mode .modal-overlay {
    background: rgba(15, 23, 42, 0.3) !important;
    backdrop-filter: blur(2px); /* Reduce secondary blur to keep dashboard sharp-ish */
}


.keypad-content {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    /* Width controlled by JS template (v2.5.56) */
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ==========================================================================
   DIE RUECKFRAGE — EINE Fassung                     (Aufbau: modal-dialogs.js)

   Es gab zwei, und der Quelltext bat selbst darum, sie gemeinsam zu pflegen:
   „Aufbau, Masse und Farben sind absichtlich zeichengleich zu showConfirm; wer
   den einen aendert, aendert bitte den anderen mit." (modal-dialogs.js, alt)
   showConfirm hatte 65 Aufrufe, showConfirmDialog 28.

   Auseinandergelaufen waren sie trotzdem an drei Stellen:
     - showConfirm erzwang `font-family: sans-serif` auf der Karte und benutzte
       damit als einziger Dialog NICHT die Hausschrift.
     - Ihr fehlte `white-space: pre-line`; vier Aufrufe mit Zeilenumbruch im Text
       (darunter die Cloud-Ueberschreib-Warnung) verloren ihre Absaetze.
     - showConfirm nahm einen `type` entgegen und benutzte ihn NIE.

   Die Farben standen als isDark-Ternaere im Quelltext; im Dunkelmodus stimmten
   sie nur zufaellig, weil sie von Hand gepflegt wurden. Jetzt Token.
   ========================================================================== */

/* Einmal statt zehnmal: @keyframes popIn wurde bei JEDEM Dialogaufruf als
   eigener <style>-Block in die Seite gespritzt — an zehn Stellen in drei
   Dateien. Zwei davon (die beiden Rueckfragen) sind hier abgeloest; die
   uebrigen acht sind damit ueberfluessig geworden. */
@keyframes popIn {
    from { transform: scale(0.95); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.tp-rueckfrage-schale {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    /* Derselbe Zahlenwert wie vorher (10000000), nur als Sprosse benannt. Eine
       Rueckfrage kann AUS jedem Dialog aufgehen und muss darueber liegen. */
    z-index: var(--z-meldung);
    padding: 1rem;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.tp-rueckfrage {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 320px;
    width: 100%;
    overflow: hidden;
    padding: 1.25rem;
    text-align: center;
    animation: popIn 0.2s ease-out;
}

.tp-rueckfrage h3 {
    margin: 0 0 8px;
    font-size: var(--fs-xl);
    font-weight: var(--weight-bold);
    color: var(--text-main);
}

/* pre-line: Zeilenumbrueche im Text bleiben stehen. showConfirm hatte das nicht;
   die Cloud-Ueberschreib-Warnung verlor dadurch ihren Absatz und stand als ein
   Block da. Vier Aufrufe sind betroffen. */
.tp-rueckfrage-text {
    font-size: var(--fs-base);
    line-height: 1.5;
    color: var(--text-subtle);
    margin-bottom: 1.25rem;
    white-space: pre-line;
}

.tp-rueckfrage-knoepfe {
    display: flex;
    gap: 10px;
}

.tp-rueckfrage-knoepfe button {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    font-weight: var(--weight-bold);
    font-size: var(--fs-base);
    cursor: pointer;
    transition: all 0.2s;
}

/* Seit 26.09.2026 die Knopfarten der Gestaltung: „Nein“ = Nebenschritt (grau), „Ja“ = Hauptschritt
   (Türkis gefüllt, Token --gestalt-haupt-* weiter unten im Abschnitt „Knopfarten“). */
.tp-rueckfrage-nein {
    border: none;
    background: var(--surface-soft);
    color: var(--text-body);
}

.tp-rueckfrage-ja {
    border: none;
    background: var(--gestalt-haupt-bg);
    color: var(--gestalt-haupt-fg);
}

/* Rot nur, wo es wirklich etwas sagt. Bis 04.09.2026 galt das ausschliesslich
   fuer `type === 'error'` (2 Aufrufe) — die 8 Aufrufe mit 'danger' bekamen den
   normalen Knopf, obwohl es dort um Klasse loeschen, Cloud ueberschreiben und
   K.O.-Runde zuruecksetzen geht. Zwei Woerter fuer dieselbe Sache, eines davon
   wirkungslos. */
.tp-rueckfrage-ja.ist-gefahr {
    background: var(--color-danger);
    /* Schlicht `white`, NICHT --primary-fill-fg: Das ist im Hausstil Tuerkis
       (#0f766e) und ergab auf Rot einen Kontrast von 1,13 — nachgemessen, und
       genau die Falle, die weiter oben schon einmal notiert ist. --color-danger
       ist in beiden Modi #dc2626, also traegt Weiss hier ueberall (5,9:1); die
       Zaehler-Blase in derselben Datei macht es genauso. */
    color: white;
}

/* Im Dunkelmodus faerbt `body.dark-mode button:not(:where([style*="background:var("], …))`
   JEDEN Knopf grau — MIT !important. Seine Ausnahmeliste prueft ausschliesslich
   INLINE-Stile: Der alte Dialog trug `background:${jaFarbe}` mit
   `var(--color-danger)` direkt am Element und fiel deshalb heraus. Mit einer
   Klasse faellt er nicht mehr heraus — nachgemessen waren nach der Umstellung
   ALLE DREI Knoepfe grau, „Ja" und „Nein" nicht mehr zu unterscheiden und der
   Gefahr-Knopf nicht mehr rot.

   Hoehere Spezifitaet plus !important holt sie zurueck; dasselbe Vorgehen wie
   bei body.dark-mode #labs-action-generate weiter oben. */
body.dark-mode .tp-rueckfrage-ja {
    background: var(--gestalt-haupt-bg) !important;
    color: var(--gestalt-haupt-fg) !important;
    border-color: transparent !important;
}

body.dark-mode .tp-rueckfrage-ja.ist-gefahr {
    background: var(--color-danger) !important;
    color: white !important;
    border-color: transparent !important;
}

body.dark-mode .tp-rueckfrage-nein {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #e2e8f0 !important;
    border-color: transparent !important;
}

/* ==========================================================================
   DIE KURZMELDUNG — EINE Fassung                    (Aufbau: modal-dialogs.js)

   Bis zum 04.09.2026 gab es zwei: showNotification (132 Aufrufe, pastellige
   Kachel, stapelt) und showToast (118 Aufrufe, vollfarbige Pille, stapelt
   nicht). Beide sassen unten mittig, sahen aber verschieden aus, und zwei
   gleichzeitige Meldungen lagen uebereinander.

   Die Pille kannte ausserdem kein „warning": ihre Farbwahl war
   `error ? rot : (info ? #16a34a : #10b981)` — Warnung UND Hinweis fielen auf
   Gruen durch. Gezaehlt: 5 Warnungen und 8 Hinweise erschienen dadurch wie
   Erfolgsmeldungen, darunter „Bitte ein gueltiges Datum waehlen."

   Geblieben ist die Kachel — sie ist die zurueckhaltendere, sie stapelt schon,
   und sie kann alle vier Zustaende. Ihre Farben standen als feste Hex-Werte im
   Quelltext (#059669, #dc2626 …); im Dunkelmodus aenderte sich dort nichts.
   Jetzt Token-Paare, die die App an anderen farbigen Flaechen ohnehin benutzt.
   ========================================================================== */

/* Der Sammelbehaelter. --z-meldung ist die oberste Sprosse der Leiter; vorher
   stand hier eine rohe 9999999 (und an der Pille eine rohe 1000002, was
   zufaellig genau --z-schwebend ist). */
#notification-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-meldung);
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: calc(100vw - 32px);
}

.tp-meldung {
    padding: 12px 24px;
    border-radius: 12px;
    border: 1px solid transparent;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    font-size: var(--fs-base);
    font-weight: var(--weight-bold);
    pointer-events: auto;
    animation: slideUp 0.3s ease-out;
    transition: opacity 0.3s, transform 0.3s;
}

.tp-meldung.ist-weg {
    opacity: 0;
    transform: translateY(10px);
}

/* Die vier Zustaende. Fuer Gruen gibt es kein eigenes Rahmen-Token; genommen
   ist --accent-green-text, wie es .tp-pick-row.ist-gewaehlt schon tut. */
.tp-meldung.ist-erfolg {
    background: var(--accent-green-bg);
    color: var(--accent-green-text);
    border-color: var(--accent-green-text);
}

.tp-meldung.ist-fehler {
    background: var(--accent-red-bg);
    color: var(--accent-red-text);
    border-color: var(--accent-red-border);
}

.tp-meldung.ist-warnung {
    background: var(--accent-amber-bg);
    color: var(--accent-amber-text);
    border-color: var(--accent-amber-border);
}

.tp-meldung.ist-hinweis {
    background: var(--primary-soft-bg);
    color: var(--primary-strong);
    border-color: var(--primary-soft-border);
}

/* --- Authentication UI --- */
.user-auth-area {
    margin-right: 0.75rem;
}

.auth-btn {
    gap: 0.5rem;
    transition: all 0.2s;
}

.auth-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.auth-btn.logged-in {
    background: rgba(34, 197, 94, 0.3);
    border-color: rgba(34, 197, 94, 0.5);
}

.auth-form {
    padding: 1.5rem !important;
}

.auth-form .form-group {
    margin-bottom: 1rem;
}

.auth-form .form-group label {
    display: block;
    font-size: var(--fs-base);
    font-weight: var(--weight-medium);
    color: var(--text-body);
    margin-bottom: 0.4rem;
}

.auth-form .input-field {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: var(--fs-xl);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-form .input-field:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.auth-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: var(--fs-base);
    margin-bottom: 1rem;
}

.auth-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: var(--fs-base);
    margin-bottom: 1rem;
}

.auth-actions {
    margin-top: 1rem;
}

.full-width {
    width: 100%;
}

.auth-switch {
    text-align: center;
    font-size: var(--fs-base);
    color: var(--text-body);
    margin-top: 0.75rem;
}

.auth-switch a {
    color: var(--brand-primary);
    text-decoration: none;
    font-weight: var(--weight-medium);
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* User Profile */
.user-profile-info {
    text-align: center;
    padding: 1rem 0;
}

.user-avatar {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.user-email {
    font-size: var(--fs-2xl);
    font-weight: var(--weight-medium);
    color: var(--text-main);
}

.user-status {
    font-size: var(--fs-base);
    margin-top: 0.25rem;
}

.user-status.online {
    color: #16a34a;
}

.sync-status-section {
    margin: 1rem 0;
}

.sync-status-section h4 {
    font-size: var(--fs-lg);
    font-weight: var(--weight-medium);
    margin-bottom: 0.5rem;
}

.badge-public {
    display: inline-block;
    font-size: var(--fs-sm);
    margin-left: 0.4rem;
}

.center {
    text-align: center;
}

/* Hint text - left aligned under content */
.hint {
    display: block;
    font-size: var(--fs-md);
    color: var(--text-body);
    margin-top: 0.5rem;
    text-align: left;
}

/* Match Input Modal - Subtitle styling */
.match-subtitle {
    font-size: var(--fs-4xl);
    font-weight: var(--weight-medium);
    color: var(--text-main);
    margin-top: 0.35rem;
}

.match-input-header h3 {
    font-size: var(--fs-3xl);
    margin-bottom: 0.25rem;
}

/* Content Container - limit max width for better readability */
.card {
    max-width: 965px;
    margin-left: auto;
    margin-right: auto;
}

/* Schedule Card - narrower */
#schedule .card {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

/* Schedule list compact */
.schedule-list {
    gap: 0.5rem;
}

/* Match row - vertical stacked for all sizes, compact */
.match-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    text-align: center;
    padding: 0.75rem 0.5rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.match-row>* {
    width: 100%;
    text-align: center;
}

/* Hide the grid header since we use stacked layout */
.schedule-header-row {
    display: none;
}

.match-card-header {
    display: flex;
    justify-content: center;
    gap: 1rem;
    color: var(--text-body);
    font-size: var(--fs-2xl);
    font-weight: var(--weight-medium);
}

.match-card-group {
    background: #f1f5f9;
    color: #475569;
    padding: 3px 14px;
    border-radius: 12px;
    font-size: var(--fs-lg);
    font-weight: var(--weight-medium);
    display: inline-block;
    width: auto !important;
}

/* Matchup inline */
.matchup {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: var(--fs-2xl);
    font-weight: var(--weight-medium);
    margin: 0.2rem 0;
}

.matchup .vs {
    font-size: var(--fs-base);
    color: var(--text-body);
    font-weight: var(--weight-normal);
}

/* Input Section */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.2rem;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    /* Center inputs, icon on left */
    align-items: center;
    width: 100%;
    max-width: 280px;
    /* Constrain grid width */
    margin: 0 auto;
}

/* Fairplay specific adjustments */
.fairplay-row-input {
    margin-top: -0.2rem;
    padding-top: 0;
    width: 80%;
}

.fairplay-row-input .input-box {
    width: 36px;
    height: 32px;
    font-size: var(--fs-xl);
    background: #fff;
    border: 1px solid #e2e8f0;
}

/* Fairplay inputs below */
.fairplay-inputs {
    justify-content: center;
    gap: 0.3rem;
}

/* Clickable Readonly Inputs */
/* --surface-hover / --surface-active / --primary gab es NIE: Das Feld war
   unauffaellig wie jedes andere, und beim Zeigen passierte gar nichts — obwohl
   genau das hier ankuendigen sollte, dass es anklickbar ist. Aufgefallen erst,
   als pruefe-variablen.js am 04.09.2026 auch die Stilvorlagen selbst las. */
.input-clickable {
    cursor: pointer;
    background-color: var(--surface-soft);
    caret-color: transparent;
}

.input-clickable:hover {
    background-color: var(--primary-soft-bg);
    border-color: var(--color-primary);
}

/* --- Mobile Fix for Template Save Button (Only this!) --- */
.template-save-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

@media (max-width: 640px) {
}

/* Group buttons wrapper - mobile stacking */
.group-buttons-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

@media (max-width: 640px) {
    .group-buttons-wrapper {
        flex-direction: column;
        width: 100%;
    }

    .group-buttons-wrapper button,
    .group-buttons-wrapper .smart-group-btn-wrapper {
        width: 100%;
    }

    .group-buttons-wrapper .smart-group-btn-wrapper button {
        width: 100%;
    }
}

/* --- Match Swap/Move UI --- */

.swap-mode-banner {
    gap: 1rem;
    flex-wrap: wrap;
}

.swap-mode-banner .btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: white;
}

.swap-mode-banner .btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Match action buttons */
.match-actions {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed #e2e8f0;
}

.btn-icon-small {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    font-size: var(--fs-xl);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon-small:hover {
    background: #e2e8f0;
    transform: scale(1.05);
}

.btn-icon-small.active {
    background: var(--primary-fill-bg);
    border-color: var(--primary-fill-border);
    color: var(--primary-fill-fg);
}

.btn-icon-small.danger:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

/* Swap selected state */
.match-row.swap-selected,
.match-tabular-row.swap-selected {
    border: 2px solid var(--brand-primary) !important;
    background: hsl(var(--primary-hue), 90%, 97%) !important;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
}

/* Empty slot styling */
.match-row.empty-slot {
    background: repeating-linear-gradient(45deg,
            #f8fafc,
            #f8fafc 10px,
            #f1f5f9 10px,
            #f1f5f9 20px);
    border: 2px dashed #cbd5e1;
    opacity: 0.7;
}

.empty-slot-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    color: var(--text-body);
}

.empty-label {
    font-weight: var(--weight-medium);
    font-size: var(--fs-2xl);
    color: #94a3b8;
}

/* Mobile adjustments */
@media (max-width: 640px) {
    .swap-mode-banner {
        font-size: var(--fs-base);
        text-align: center;
    }

    .match-actions {
        flex-wrap: wrap;
    }
}

/* --- Visual Polish Overrides (FINAL) --- */

/* 1. Header Height Fix (Desktop) */
.current-tournament-display {
    height: var(--header-item-height) !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 1rem !important;
    /* Ensure padding doesn't collapse height */
    box-sizing: border-box !important;
}

/* 2. Sync Icon Fix */
.sync-badge {
    display: inline-flex !important;
    /* Force flex for centering */
    align-items: center !important;
    justify-content: center !important;
    height: var(--header-item-height) !important;
    /* Match header height */
    width: 32px !important;
    margin: 0 4px 0 0 !important;
    /* Reset vertical margins */
    vertical-align: middle !important;
    margin-top: -2px;
    /* Slight optical correction if needed */
}

/* 3. Desktop Buttons Equal Width */
/* 3. Desktop Buttons Equal Width */
@media (min-width: 641px) {
    .card-actions {
        display: flex;
        width: 100%;
        gap: 0.5rem;
    }

    .card-actions button,
    .card-actions .btn {
        flex: 1 1 0px !important;
        /* Strict equal width */
        width: 0 !important;
        /* Reset width for flex grow */
        justify-content: center;
    }

    /* Specific fix for settings buttons container if they are wrapped differently */
    .template-save-row {
        display: flex !important;
        width: 100% !important;
        gap: 0.5rem !important;
        align-items: stretch !important;
    }

    .template-save-row button,
    .template-save-row .input-field {
        flex: 1 1 0px !important;
        /* Force equal width */
        width: 0 !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    .manager-actions {
        display: flex !important;
        width: 100% !important;
        gap: 0.5rem !important;
        align-items: stretch !important;
    }

    .manager-actions .btn,
    .manager-actions .clickable-label {
        flex: 1 1 0px !important;
        /* Force equal width */
        width: 0 !important;
        min-width: 0 !important;
        justify-content: center;
        text-align: center;
        display: flex !important;
        align-items: center !important;
        margin: 0 !important;
    }
}

/* --- Mobile Consistency Fixes (Templates & Manager) --- */
@media (max-width: 640px) {

    /* 1. Settings Buttons (Existing) */
    .card-actions {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }

    .card-actions button,
    .card-actions .btn {
        width: 100%;
        margin: 0;
    }

    /* 2. Templates (Save Configuration) */
    .template-save-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.5rem !important;
    }

    .template-save-row .input-field {
        width: 100% !important;
        margin-bottom: 0 !important;
        height: 44px !important;
    }

    .template-save-row button {
        width: 100% !important;
        margin-top: 0 !important;
        height: 44px !important;
    }


    /* 3. Manager (New Tournament / Import) */
    .manager-actions {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }

    .manager-actions .btn,
    .manager-actions .clickable-label {
        width: 100% !important;
        justify-content: center !important;
        margin: 0 !important;
        text-align: center !important;
        display: flex !important;
        align-items: center !important;
    }
}

/* Light Mode Modal Overrides */
body:not(.dark-mode) .keypad-content,
body:not(.dark-mode) .modal-content,
body:not(.dark-mode) .auth-content {
    background: white;
    color: var(--text-main);
}

body:not(.dark-mode) .keypad-header h3,
body:not(.dark-mode) .modal-header h3 {
    color: var(--text-main);
}

body:not(.dark-mode) .btn-close-keypad {
    color: var(--text-body);
}

/* ============================================
   APP LOGO - Responsive Styles
   ============================================ */
.app-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 6px;
}

.app-logo-img {
    display: block;
    height: 40px;
    width: auto;
}

.app-logo-text {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: var(--fs-2xl);
    font-weight: var(--weight-medium);
    color: #64748b;
    letter-spacing: -0.02em;
}

/* Dark mode logo text */
body.dark-mode .app-logo-text {
    color: #94a3b8;
}

/* Mobile: Hide Plan text when space is tight */
@media (max-width: 599px) {
    .app-logo-text {
        font-size: var(--fs-lg);
    }

    .app-logo-img {
        height: 32px;
    }
}

/* ============================================
   LANDING PAGE LOGO TEXT
   ============================================ */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-logo-text {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: var(--fs-3xl);
    font-weight: var(--weight-medium);
    color: #64748b;
    letter-spacing: -0.02em;
}

/* Hide Plan text on mobile */
@media (max-width: 768px) {
    .nav-logo-text {
        display: none;
    }

    /* Fix overflow for all form elements on mobile - EXCLUDE checkboxes */
    .settings-accordion select,
    .settings-accordion input:not([type="checkbox"]),
    .settings-accordion-inner select,
    .settings-accordion-inner input:not([type="checkbox"]),
    .form-group select,
    .form-group input:not([type="checkbox"]),
    .form-section select,
    .form-section input:not([type="checkbox"]) {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Fix group-card width on mobile */
    .group-card,
    .groups-grid {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Ensure accordion content doesn't overflow */
    .settings-accordion-inner {
        max-width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }

    /* Form section should not overflow */
    .form-section {
        max-width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
}

/* Hier stand die Gestaltung der Verstoss-Knoepfe der alten
   Fairplay-Detaileingabe (.btn-violation-row und ihr Umfeld, 114 Zeilen).
   Sie ist am 06.09.2026 mit dieser Eingabe entfallen — siehe den Block in
   match-input.js, wo openFairplayDetailModal stand. Gemessen war sie ohnehin
   wirkungslos: Das JavaScript ueberschrieb jede Regel mit einem Inline-Stil
   und vergab die Klasse .violation-badge gar nicht erst.

   Mit weg ist der Korrekturmodus dieser Knoepfe (.correction-active
   .btn-violation-row, 30 Zeilen): Er zielte auf #violations-container, den
   es ohne diese Eingabe nicht mehr gibt. Der Korrekturmodus des
   Schiri-Dialogs ist etwas anderes und bleibt — er steht in referee-hub.js
   und faerbt .tally-btn. */

/* Referee Light Mode Button Fixes */
.tally-btn {
    width: 100%;
    margin-bottom: 5px;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;
    cursor: pointer;
    font-size: var(--fs-xl);
    font-weight: var(--weight-medium);
    touch-action: manipulation;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.tally-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

body.dark-mode .tally-btn {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

body.dark-mode .tally-btn:hover {
    background: rgba(51, 65, 85, 0.8);
}

/* ============================================
   SETTINGS ACCORDION SYSTEM
   ============================================ */

.settings-accordion {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 12px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.settings-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    min-height: 52px;
    background: #f8fafc;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    transition: background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.settings-accordion-header:hover {
    background: #f1f5f9;
}

.settings-accordion-header:active {
    background: #e2e8f0;
}

.settings-accordion-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.settings-accordion-icon {
    font-size: var(--fs-3xl);
    flex-shrink: 0;
}

.settings-accordion-text {
    font-weight: var(--weight-medium);
    font-size: var(--fs-lg);
    color: #1e293b;
}

.settings-accordion-summary {
    font-size: var(--fs-md);
    color: #64748b;
    margin-left: auto;
    padding-left: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 50%;
}

.settings-accordion-arrow {
    font-size: var(--fs-base);
    color: #94a3b8;
    transition: transform 0.25s ease;
    margin-left: 8px;
    flex-shrink: 0;
}

.settings-accordion.open .settings-accordion-arrow {
    transform: rotate(180deg);
}

.settings-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.settings-accordion.open .settings-accordion-content {
    max-height: 2000px;
    transition: max-height 0.4s ease-in;
}

.settings-accordion-inner {
    padding: 16px;
    border-top: 1px solid #e2e8f0;
}

/* Dark Mode Accordion */
body.dark-mode .settings-accordion {
    background: transparent !important;
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .settings-accordion-header {
    background: rgba(30, 41, 59, 0.95);
}

body.dark-mode .settings-accordion-header:hover {
    background: rgba(51, 65, 85, 0.9);
}

body.dark-mode .settings-accordion-header:active {
    background: rgba(71, 85, 105, 0.9);
}

body.dark-mode .settings-accordion-text {
    color: #e2e8f0;
}

body.dark-mode .settings-accordion-summary {
    color: #94a3b8;
}

body.dark-mode .settings-accordion-arrow {
    color: #64748b;
}

body.dark-mode .settings-accordion-inner {
    border-top-color: rgba(255, 255, 255, 0.1);
    background: transparent !important;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .settings-accordion-header {
        padding: 12px 14px;
    }

    .settings-accordion-summary {
        display: none;
    }

    .settings-accordion-inner {
        padding: 14px;
    }
}

/* Player Dashboard Refinements */
.badge-clickable {
    user-select: none;
}

.player-card .inline-input {
    transition: all 0.2s;
}

.player-card .inline-input:focus {
    background: white;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.1);
    opacity: 1 !important;
}

.player-card .player-delete-btn {
    opacity: 0.2;
    background: transparent !important;
    color: var(--accent-red-text) !important;
    border: none !important;
}

.player-card:hover .player-delete-btn {
    opacity: 1;
    background: rgba(239, 68, 68, 0.1) !important;
}

.player-card .player-badge {
    pointer-events: auto;
}

/* „Fehlt heute" — der Spieler-Status hatte projektweit KEINE eigene Optik (nur die Klasse
   `inactive` wurde gesetzt, ohne dass eine Regel darauf reagierte). Bewusst zurueckhaltend:
   erkennbar abwesend, aber weiter les- und bedienbar (Zurueckholen bleibt ein Klick). */
.player-card.player-absent {
    background: var(--surface-page);
    border-style: dashed;
}

.player-card.player-absent .player-name-input {
    text-decoration: line-through;
    color: var(--text-subtle);
}

body.dark-mode .player-card.player-absent {
    background: rgba(255, 255, 255, 0.03);
}

/* Wie im hellen Modus rahmenlos, bis man das Feld anfasst (siehe .inline-input weiter unten). */
body.dark-mode .player-card .inline-input {
    background: transparent;
    border-color: transparent;
    color: #f1f5f9;
}

body.dark-mode .player-card .inline-input:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .player-card .inline-input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: #2dd4bf;
}

body.dark-mode .badge-clickable:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

/* ============================================
   SCHEDULE BURGER MENU
   ============================================ */

.schedule-burger-item {
    font-size: var(--fs-md);
    font-weight: var(--weight-medium);
    opacity: 0.7;
}

.schedule-burger-item:hover {
    opacity: 1;
}

.schedule-burger-item span {
    font-size: inherit;
}

.schedule-burger-item.danger:hover {
    background: #fef2f2;
}

/* Dark mode */
body.dark-mode .schedule-burger-item {
    color: #e2e8f0;
}

body.dark-mode .schedule-burger-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .schedule-burger-item.danger {
    color: #fca5a5;
}

body.dark-mode .schedule-burger-item.danger:hover {
    background: rgba(220, 38, 38, 0.2);
}

body.dark-mode #schedule-burger-dropdown {
    background: rgba(30, 41, 59, 0.98) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

/* Schedule edit mode - card highlighting */
.schedule-edit-selectable {
    cursor: pointer !important;
}

.schedule-edit-selectable:hover {
    transform: scale(1.01);
    box-shadow: 0 0 0 2px var(--color-primary) !important;
}

/* ============================================
   STATUS INDICATORS (Light & Dark Mode)
   Left Accent Line Design - Consistent across modes
   ============================================ */
/* Live Matches - Light Mode: Red left accent */
.match-live,
.status-live {
    background-color: #ffffff !important;
    border: none !important;
    box-shadow: none !important;
    animation: none !important;
}

/* Force text colors in Live cards to be standard */
.match-live input,
.status-live input,
.match-live .input-score,
.status-live .input-score,
.match-live .fairplay-value,
.status-live .fairplay-value {
    color: var(--text-main) !important;
}

/* Finished Matches - Light Mode: Green left accent */
.match-finished,
.status-finished {
    background-color: #ffffff !important;
    border: none !important;
    box-shadow: none !important;
}

/* Pending Proposals - Light Mode: Amber left accent */
.match-pending {
    background-color: #ffffff !important;
    border: none !important;
    box-shadow: none !important;
    animation: none !important;
}

/* Ensure text contrast in finished cards */
/* ABGEBAUT 22.08.2026 — hier stand: .match-finished *, .status-finished * { color: var(--text-main) !important }
   Eine Pauschalregel, die ALLES in ihrem Bereich mit einem Einheitston uebermalte,
   auch Elemente, die ihre Farben als geprueftes Paar mitbringen (Chips, Marken,
   Zustandspillen). Sie war der Grund fuer drei Reparaturregeln und den Fehler vom
   22.08.2026 (Chip-Schrift kippte nach dem Ergebnis auf 2,33:1).
   Gemessen vor dem Abbau: 452 von 584 Textstellen behalten ihre Farbe exakt, 132
   bekommen ihren EIGENEN Token zurueck (#1e293b -> --text-subtle/--text-body), und
   der Kontrast bleibt ueberall ueber der Grenze. pruefe-lesbarkeit.js wacht darueber. */

/* --color-success-text gab es nie; der Untertitel eines beendeten Spiels erbte
   deshalb seine Farbe. --accent-green-text ist das Token, das die App fuer Text
   auf gruener Bedeutung benutzt, und es hat eine Dunkelfassung. */
.match-finished .item-sub,
.status-finished .item-sub {
    color: var(--accent-green-text) !important;
}

/* Pulse Animation - Light Mode only */
@keyframes livePulse {
    0% {
        box-shadow: 0 0 5px var(--color-danger);
        border-color: var(--color-danger);
    }

    50% {
        box-shadow: 0 0 15px var(--color-danger);
        border-color: rgba(239, 68, 68, 0.5);
    }

    100% {
        box-shadow: 0 0 5px var(--color-danger);
        border-color: var(--color-danger);
    }
}

/* ============================================
   DARK MODE - Left Accent Line Design
   Clean, professional look without glowing borders
   ============================================ */
body.dark-mode .match-live,
body.dark-mode .status-live {
    background-color: #1e293b !important;
    border: none !important;
    box-shadow: none !important;
    animation: none !important;
}

body.dark-mode .match-finished,
body.dark-mode .status-finished {
    background-color: #1e293b !important;
    border: none !important;
    box-shadow: none !important;
}

/* Pending Proposals - Amber accent overrides live/finished status */
body.dark-mode .match-pending {
    background-color: #1e293b !important;
    border: none !important;
    box-shadow: none !important;
    animation: none !important;
}

/* ============================================
   ADMIN THEME OVERRIDES (Teal)
   ============================================ */
/* Force Teal for Schedule View Toggles */
#toggle-spielplan.active,
#toggle-felderplan.active {
    background-color: rgba(13, 148, 136, 0.1) !important;
    color: var(--primary-strong) !important;
    border: none !important;
    border-radius: 12px !important;
}

#toggle-spielplan,
#toggle-felderplan {
    border: 2px solid #e2e8f0;
    color: #64748b;
    background: white;
}

/* Dark Mode support for toggles */
body.dark-mode #toggle-spielplan.active,
body.dark-mode #toggle-felderplan.active {
    background-color: var(--primary-fill-bg) !important;
    border-color: var(--primary-fill-border) !important;
    color: var(--primary-fill-fg) !important;
}

body.dark-mode #toggle-spielplan,
body.dark-mode #toggle-felderplan {
    background-color: rgba(30, 41, 59, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #94a3b8 !important;
}

/* ============================================
   SWEETALERT THEME OVERRIDES (Global)
   ============================================ */

/* ===========================================
   THEME REFINEMENT: Swap Banner & Popups
   ============================================ */
.swap-mode-banner {
    background: var(--primary-fill-bg);
    /* Teal */
    color: var(--primary-fill-fg);
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    animation: slideInDown 0.3s ease-out;
    font-weight: var(--weight-medium);
}

.swap-mode-banner button {
    background: rgba(255, 255, 255, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    color: white !important;
    margin-left: 10px;
}

.swap-mode-banner button:hover {
    background: rgba(255, 255, 255, 0.3) !important;
}

/* Dark Mode Override for Swap Banner */
body.dark-mode .swap-mode-banner {
    background: rgba(13, 148, 136, 0.2);
    /* Darker Teal transparent */
    border: 1px solid rgba(13, 148, 136, 0.5);
    color: #2dd4bf;
    /* Teal 400 */
}

/* ============================================
   FINAL OVERRIDES - Match Card Shadows (Light Mode Only)
   These rules are at the END of the file to ensure highest priority
   ============================================ */
body:not(.dark-mode) .match-row,
body:not(.dark-mode) .hall-field-card,
body:not(.dark-mode) .ref-field-card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

body:not(.dark-mode) .match-row.match-live,
body:not(.dark-mode) .hall-field-card.match-live,
body:not(.dark-mode) .ref-field-card.match-live {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

body:not(.dark-mode) .match-row.match-finished,
body:not(.dark-mode) .hall-field-card.match-finished,
body:not(.dark-mode) .ref-field-card.match-finished {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

body:not(.dark-mode) .match-row.match-pending,
body:not(.dark-mode) .hall-field-card.match-pending,
body:not(.dark-mode) .ref-field-card.match-pending {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

/* ============================================
   LIGHT MODE HEADER STYLING
   ============================================ */
body:not(.dark-mode) .app-header {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

body:not(.dark-mode) .app-logo-text {
    color: var(--primary-strong) !important;
}

body:not(.dark-mode) .tournament-title-centered .tournament-name {
    color: #1e293b !important;
}

body:not(.dark-mode) .nav-toggle {
    color: #64748b !important;
    background: transparent !important;
}

body:not(.dark-mode) .auth-btn {
    color: var(--primary-fill-fg) !important;
}

/* ============================================
   SCHEDULE TOOLBAR STYLING
   ============================================ */
.schedule-toolbar-new {
    background: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.toolbar-tab-btn:hover {
    color: var(--primary-strong) !important;
}

.toolbar-tab-btn svg {
    display: block;
}

.filter-chip:hover {
    border-color: var(--color-primary) !important;
}

/* Dark mode overrides for toolbar */
body.dark-mode .schedule-toolbar-new {
    background: rgba(30, 41, 59, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .toolbar-tab-btn {
    color: #94a3b8;
}

body.dark-mode .toolbar-tab-btn.active {
    color: #2dd4bf !important;
}

body.dark-mode .tab-indicator {
    background: #2dd4bf !important;
}

body.dark-mode .filter-chip {
    background: rgba(30, 41, 59, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #e2e8f0 !important;
}

body.dark-mode .filter-chip.active {
    background: var(--primary-fill-bg) !important;
    border-color: var(--primary-fill-border) !important;
    color: var(--primary-fill-fg) !important;
}

body.dark-mode #schedule-filter-type,
body.dark-mode #schedule-filter-value {
    background: rgba(30, 41, 59, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #e2e8f0 !important;
}

/* ============================================
   AUTH BUTTON / AVATAR STYLING
   ============================================ */
.auth-btn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: var(--fs-sm) !important;
    font-weight: var(--weight-bold) !important;
    background: var(--primary-fill-bg) !important;
    color: var(--primary-fill-fg) !important;
    border: none !important;
    cursor: pointer !important;
}

.auth-btn #auth-btn-text {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: clip;
}

/* When logged in, show only initials */
body:not(.dark-mode) .auth-btn {
    background: var(--primary-fill-bg) !important;
}

body.dark-mode .auth-btn {
    background: var(--primary-fill-bg) !important;
}

/* ============================================
   SCHEDULE BURGER MENU ITEMS WITH SVG ICONS
   ============================================ */
.schedule-burger-item {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 10px 16px !important;
    cursor: pointer;
    transition: background 0.15s ease;
    color: #374151;
}

.schedule-burger-item:hover {
    background: #f1f5f9;
}

.schedule-burger-item svg {
    flex-shrink: 0;
    color: #64748b;
}

.schedule-burger-item.danger {
    color: var(--accent-red-text);
}

.schedule-burger-item.danger svg {
    color: var(--accent-red-text);
}

/* ============================================
   HEADER LAYOUT - AVATAR NEXT TO BURGER
   ============================================ */
.app-header .user-auth-area {
    order: 998 !important;
    /* Place before nav-toggle (order: 999) */
    margin-left: auto !important;
    margin-right: 0.5rem !important;
}

/* Fix: Prevent title from overlapping with avatar/burger */
.tournament-title-centered {
    max-width: calc(100% - 180px) !important;
    /* Leave space for logo + avatar + burger */
    left: 50% !important;
    transform: translateX(-50%) !important;
}

/* ============================================
   REDUCE TOOLBAR TO CARD SPACING (HALVED AGAIN)
   ============================================ */

.schedule-toolbar-new {
    margin-bottom: 6px !important;
    /* Reduced from 12px */
}

/* ============================================
   CONSISTENT MATCH CARD METADATA TEXT COLORS
   Time, Field, Group, "vs" - always same color (darker for readability)
   ============================================ */
/* Das Sternchen ist am 22.08.2026 entfallen: Es uebermalte alles im Kartenkopf, auch
   den Trennpunkt und die Niveau-Angabe, die ihre Farbe selbst mitbringen. Der Kopf gibt
   seine Schriftfarbe jetzt nur noch WEITER (Vererbung), statt sie zu erzwingen. */
.match-row .match-card-header {
    color: var(--text-body) !important;
    font-size: var(--fs-base);
    font-weight: var(--weight-medium);
}

.match-row .vs {
    color: #94a3b8 !important;
    font-size: var(--fs-md);
    font-weight: var(--weight-medium);
}

.match-row .teams-display,
.hall-field-card .teams {
    font-family: var(--font-heading) !important;
    font-weight: var(--weight-medium) !important;
    color: var(--text-main) !important;
}

.match-row .team-name {
    font-size: var(--fs-lg) !important;
    font-weight: var(--weight-medium) !important;
    color: var(--text-main) !important;
}

.match-row .score-display {
    font-family: var(--font-heading) !important;
    font-weight: var(--weight-medium) !important;
    color: var(--text-main) !important;
}

/* Hier stand eine Pauschalregel (Abbau 22.08.2026) — Begruendung bei .match-finished. */

body.dark-mode .match-row .match-card-header,
body.dark-mode .match-row .vs {
    color: #94a3b8 !important;
    /* Lighter gray for dark mode */
}

/* ============================================
   MATCH CARD BURGER BUTTON STYLING
   Same style as main nav dropdown
   ============================================ */
.match-card-menu-btn {
    background: transparent !important;
    border-radius: 6px !important;
    transition: background 0.15s ease;
}

.match-card-menu-btn:hover {
    background: rgba(100, 116, 139, 0.15) !important;
}

.match-card-menu-btn svg {
    display: block;
}

/* Match card menu dropdown styling (like main nav) */
.match-card-menu-dropdown {
    background: white !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
    padding: 8px !important;
}

body.dark-mode .match-card-menu-dropdown {
    background: rgba(30, 41, 59, 0.98) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* ============================================
   FILTER CHIP STYLING
   Base and active states for schedule filter chips
   ============================================ */
.filter-chip {
    background: white;
    opacity: 0.7;
    font-family: var(--font-heading);
    white-space: nowrap;
}

.filter-chip:hover {
    background: #f1f5f9;
}

.filter-chip.active,
.filter-pill.active {
    background: var(--primary-fill-bg) !important;
    border: none !important;
    color: var(--primary-fill-fg) !important;
    border-radius: var(--gestalt-knopf-radius) !important;
    opacity: 1 !important;
}

.filter-chip.active:hover,
.filter-pill.active:hover {
    background: var(--primary-fill-hover) !important;
    border: none !important;
}

/* ============================================
   FILTER NAVIGATION BUTTONS (< > arrows)
   ============================================ */
.filter-nav-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--color-primary);
    background: white;
    color: var(--primary-strong);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.filter-nav-btn:hover {
    background: var(--primary-fill-bg);
    color: var(--primary-fill-fg);
}

.filter-nav-btn:active {
    transform: scale(0.95);
}

.filter-nav-btn svg {
    display: block;
}

/* Dark mode */
body.dark-mode .filter-nav-btn {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(13, 148, 136, 0.5);
    color: #2dd4bf;
}

body.dark-mode .filter-nav-btn:hover {
    background: var(--primary-fill-bg);
    color: var(--primary-fill-fg);
}

/* ============================================
   HALL VIEW DRAG HANDLES
   ============================================ */
.hall-field-drag-handle {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    color: #94a3b8;
    border-radius: 4px;
    transition: all 0.15s ease;
    z-index: 5;
}

.hall-field-drag-handle:hover {
    color: #64748b;
    background: rgba(100, 116, 139, 0.15);
}

.hall-field-drag-handle:active {
    cursor: grabbing;
}

.hall-field-card.dragging {
    opacity: 0.5;
    transform: scale(0.98);
}

.hall-field-card.drag-over {
    outline: 2px dashed var(--color-primary) !important;
    outline-offset: 2px;
}

/* Phasen & Team Drag & Drop Feedback */
.drag-over {
    background: rgba(22, 163, 74, 0.05) !important;
    border: 1.5px dashed #16a34a !important;
}

.drag-over-team {
    background: rgba(22, 163, 74, 0.08) !important;
    box-shadow: 0 0 0 2px #16a34a inset !important;
    border-radius: 12px;
}

.dragging-team {
    opacity: 0.4;
    transform: scale(0.98);
}

/* Dark mode */
body.dark-mode .hall-field-drag-handle {
    color: #64748b;
}

body.dark-mode .hall-field-drag-handle:hover {
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .hall-field-card.drag-over {
    outline-color: #2dd4bf !important;
}

/* ============================================
   REFEREE VIEW - COMPREHENSIVE DARK MODE
   Override all inline styles for referee elements
   ============================================ */

/* Referee Head Card & Navbar */
body.dark-mode .ref-head-card {
    background: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .ref-navbar {
    background: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .ref-title-container h2 {
    color: #f1f5f9 !important;
}

/* Referee Tabs */
body.dark-mode .ref-tab {
    background: transparent !important;
    color: #94a3b8 !important;
}

body.dark-mode .ref-tab.active {
    color: #14b8a6 !important;
}

body.dark-mode .ref-tab:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Das Zahnradmenue der Schiri-Ansicht ist am 08.09.2026 entfallen; seine vier
   Regeln standen hier ins Leere. */

/* Referee Burger Menu */
body.dark-mode .ref-burger-menu,
body.dark-mode #ref-burger-menu {
    background: rgba(30, 41, 59, 0.98) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

body.dark-mode .ref-burger-menu button {
    color: #e2e8f0 !important;
}

body.dark-mode .ref-burger-menu button:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Referee Match Cards */
body.dark-mode .ref-match-card,
body.dark-mode [class*="ref-match"] {
    background: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Hier stand eine Pauschalregel (Abbau 23.08.2026) — Begruendung bei .match-finished. */

body.dark-mode .ref-match-card .item-sub,
body.dark-mode .ref-match-card [style*="color:#64748b"]:not(:where([style*="color:var("],[style*="color: var("])),
body.dark-mode .ref-match-card [style*="color: #64748b"]:not(:where([style*="color:var("],[style*="color: var("])) {
    color: #94a3b8 !important;
}

/* Filter Chips in Referee View */
body.dark-mode .ref-filter-chip,
body.dark-mode .referee-filter-chip {
    background: rgba(30, 41, 59, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #e2e8f0 !important;
}

body.dark-mode .ref-filter-chip.active,
body.dark-mode .referee-filter-chip.active {
    background: var(--primary-fill-bg) !important;
    border-color: var(--primary-fill-border) !important;
    color: var(--primary-fill-fg) !important;
}

/* Override ALL white backgrounds in referee mode */
body.dark-mode [style*="background: white"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode [style*="background:white"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode [style*="background: #fff"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode [style*="background:#fff"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode [style*="background: #ffffff"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode [style*="background:#ffffff"]:not(:where([style*="background:var("],[style*="background: var("])) {
    background: #1e293b !important;
}

/* Override light gray backgrounds */
body.dark-mode [style*="background: #f8fafc"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode [style*="background:#f8fafc"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode [style*="background: #f1f5f9"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode [style*="background:#f1f5f9"]:not(:where([style*="background:var("],[style*="background: var("])) {
    background: rgba(30, 41, 59, 0.8) !important;
}

/* Override dark text colors */

/* Override muted text colors */
body.dark-mode [style*="color: #64748b"]:not(:where([style*="color:var("],[style*="color: var("])),
body.dark-mode [style*="color:#64748b"]:not(:where([style*="color:var("],[style*="color: var("])),
body.dark-mode [style*="color: #475569"]:not(:where([style*="color:var("],[style*="color: var("])),
body.dark-mode [style*="color:#475569"]:not(:where([style*="color:var("],[style*="color: var("])) {
    color: #94a3b8 !important;
}

/* Override light borders */
body.dark-mode [style*="border-color: #e2e8f0"],
body.dark-mode [style*="border-color:#e2e8f0"],
body.dark-mode [style*="border: 1px solid #e2e8f0"],
body.dark-mode [style*="border:1px solid #e2e8f0"] {
    border-color: rgba(255, 255, 255, 0.15) !important;
}

/* Referee Toolbar */
body.dark-mode .ref-toolbar {
    background: rgba(30, 41, 59, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* ============================================
   REFEREE HUB STYLES (New Design)
   ============================================ */
.ref-hub-section {
    position: relative;
    padding: 12px 0;
}

.ref-hub-section+.ref-hub-section {
    border-top: 1px solid #e2e8f0;
}

body.dark-mode .ref-hub-section+.ref-hub-section {
    border-color: rgba(255, 255, 255, 0.1);
}

.ref-hub-label {
    font-size: var(--fs-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 8px;
    font-weight: var(--weight-medium);
}

/* Access Input */
.ref-access-input-container {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 50px;
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
}

body.dark-mode .ref-access-input-container {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(255, 255, 255, 0.15);
}

.ref-access-link {
    font-size: var(--fs-md);
    color: #64748b;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    margin-right: 10px;
    font-family: monospace;
    scrollbar-width: none;
    /* Firefox */
}

.ref-access-link::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

body.dark-mode .ref-access-link {
    color: #94a3b8;
}

/* Base Pill Button */
.btn-pill {
    border: none;
    border-radius: 50px;
    padding: 8px 16px;
    font-size: var(--fs-base);
    font-weight: var(--weight-medium);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-pill.primary {
    background: var(--primary-fill-bg);
    color: var(--primary-fill-fg);
}

.btn-pill.primary:hover {
    filter: brightness(1.1);
}

.popover-menu {
    position: fixed;
    /* Fixed to ensure it floats above modal */
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    padding: 6px;
    display: flex;
    flex-direction: column;
    z-index: 1000001;
    /* Above modal (z-index 1000000) */
    min-width: 200px;
    opacity: 0;
    transform: translateY(-10px);
    animation: popoverFadeIn 0.2s forwards ease-out;
}

@keyframes popoverFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.popover-item {
    padding: 10px 16px;
    border-radius: 8px;
    color: #1e293b;
    font-size: var(--fs-lg);
    font-weight: var(--weight-medium);
    cursor: pointer;
    transition: background 0.1s;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.popover-item:hover {
    background: #f1f5f9;
    color: var(--brand-primary);
}

.popover-item.text-danger {
    color: var(--accent-red-text);
}

.popover-item.text-danger:hover {
    background: #fef2f2;
}

.btn-pill-icon {
    width: 44px;
    height: 44px;
    border-radius: 22px;
    border: 1px solid #e2e8f0;
    background: white;
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

body.dark-mode .btn-pill-icon {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
}

/* Plan / List Row */
.ref-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    min-height: 48px;
}

.ref-row-left {
    display: flex;
    flex-direction: column;
}

.ref-name {
    font-weight: var(--weight-medium);
    color: var(--text-main);
    font-size: var(--fs-lg);
}

.ref-badge {
    font-size: var(--fs-xs);
    color: var(--text-body);
    background: rgba(0, 0, 0, 0.05);
    padding: 1px 6px;
    border-radius: 4px;
    margin-top: 2px;
    display: inline-block;
}

body.dark-mode .ref-badge {
    background: rgba(255, 255, 255, 0.1);
}

/* Pill Toggles (flatter than circles, but same width) */
.toggle-group {
    display: flex;
    gap: 6px;
    align-items: center;
}

.circle-toggle {
    width: 32px;
    height: 22px;
    border-radius: 11px;
    border: 1px solid #e2e8f0;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-sm);
    font-weight: var(--weight-medium);
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s;
}

body.dark-mode .circle-toggle {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(255, 255, 255, 0.2);
    color: #64748b;
}

.circle-toggle.active {
    background: var(--bg-success);
    color: var(--text-success-bold);
    border-color: var(--border-success-subtle);
}

body.dark-mode .circle-toggle.active {
    background: rgba(13, 148, 136, 0.15);
    border-color: rgba(13, 148, 136, 0.45);
    color: #2dd4bf;
}

.circle-toggle.infinite {
    font-size: var(--fs-xl);
    line-height: 1;
}

/* Schiri-Anfrage „… möchte mitmachen“ — Tinte wie die gemeldeten Ergebnisse: Sie wartet auf deine Entscheidung
   (Farbrollen 28.09.2026: Tuerkis = weiter, Tinte = wartet auf dich, Bernstein = hier stimmt etwas nicht, Rot = loeschen).
   Vorher ein gelber Kasten mit Pillenknoepfen. */
.pending-row {
    background: #1e293b;
    border: none;
    border-radius: var(--gestalt-karte-radius);
    padding: 8px 8px 8px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
body.dark-mode .pending-row { background: #e2e8f0; }

.pending-name {
    font-weight: var(--weight-bold);
    color: #f1f5f9 !important;
    font-size: var(--fs-base);
}
.pending-name span { color: #cbd5e1 !important; }
body.dark-mode .pending-name { color: #0f172a !important; }
body.dark-mode .pending-name span { color: #334155 !important; }

.pending-row > div { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.btn-xs-pill {
    padding: 6px 12px;
    border-radius: var(--gestalt-knopf-radius);
    font-size: var(--fs-sm);
    font-weight: var(--weight-strong);
    border: none !important;
    cursor: pointer;
}
.btn-xs-pill.tp-anfrage-ja { background: #5eead4 !important; color: #042f2e !important; }
.btn-xs-pill.tp-anfrage-ja:hover { background: #99f6e4 !important; }
body.dark-mode .btn-xs-pill.tp-anfrage-ja { background: #0d6b63 !important; color: #ffffff !important; }

.btn-accept {
    background: var(--color-success);
    color: white;
}

/* Ablehnen: nur Text (Knopfarten) — auf Tinte hellrot, im Dunkelmodus (heller Grund) dunkelrot */
.btn-deny {
    background: transparent !important;
    color: #fca5a5 !important;
}
body.dark-mode .btn-deny { color: #b91c1c !important; }
/* In der Schiri-Liste (Anfragen) ist der Grund auch im Dunkelmodus dunkel (#334155) —
   dort hellrot, sonst 1.6:1 (pruefe-lesbarkeit.js, 30.09.2026) */
body.dark-mode .pending-row .btn-deny { color: #fca5a5 !important; }

/* Referee Hall View Cards */
body.dark-mode .ref-field-card {
    background: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Hier stand eine Pauschalregel (Abbau 23.08.2026) — Begruendung bei .match-finished. */

body.dark-mode .ref-field-card .item-sub {
    color: #94a3b8 !important;
}

/* Referee Modal (Input Dialog) */
#referee-modal .ref-section-panel,
.ref-section-panel {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    margin-bottom: 0;
    transition: all 0.2s ease;
}

#referee-modal-wrapper {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    /* clip statt hidden: siehe die haftende Uhr weiter unten. hidden bleibt als
       Rueckfall fuer Browser ohne clip stehen. */
    overflow: clip;
    /* kein Doppeltipp-Zoom im Schiri-Fenster, siehe .labs-stepper-btn */
    touch-action: manipulation;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#sortable-sections {
    display: flex;
    flex-direction: column;
}

/* [Fix v2.14.86] Glassmorphism for Referee Input Modal */
body.referee-mode #referee-modal-wrapper {
    background: #ffffff !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-color: rgba(255, 255, 255, 0.2) !important;
}

body.dark-mode.referee-mode #referee-modal-wrapper {
    background: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.draggable-section {
    display: flex !important;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
    width: 100%;
}

body.referee-mode .draggable-section {
    background: transparent !important;
    border-bottom-color: rgba(0, 0, 0, 0.05) !important;
}

body.dark-mode.referee-mode .draggable-section {
    border-bottom-color: rgba(255, 255, 255, 0.05) !important;
}

.draggable-section:last-child {
    border-bottom: none;
}

/* Uhr bleibt beim Scrollen oben stehen (Wunsch David, 06.10.2026). Gescrollt wird in
   .modal; der Rahmen #referee-modal-wrapper hatte overflow:hidden und waere damit selbst
   der Bezugsrahmen fuer sticky gewesen – die Uhr klebte dann an etwas, das nie scrollt.
   clip schneidet die runden Ecken genauso ab, ohne einen Scroll-Rahmen zu bilden.
   Browser ohne clip behalten hidden: dann scrollt die Uhr einfach mit wie bisher.
   Die Flaeche muss deckend sein, sonst scheint der Inhalt durch – referee-mode setzt die
   Abschnitte sonst auf transparent. Gilt auch, wenn der Schiri die Uhr weiter nach
   unten verschoben hat: sie klebt dann, sobald sie oben ankommt.
   overflow:clip steht im Grundblock von #referee-modal-wrapper oben. */
#referee-modal-wrapper .draggable-section[data-section-id="timer"],
body.referee-mode #referee-modal-wrapper .draggable-section[data-section-id="timer"] {
    position: sticky;
    top: 0;
    z-index: var(--z-haftend);
    background: var(--ref-card-bg) !important;
    border-bottom-color: var(--gestalt-haarlinie, rgba(0, 0, 0, 0.08)) !important;
}

.draggable-section .drag-handle {
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-subtle);
    cursor: grab;
    flex-shrink: 0;
    user-select: none;
}

.draggable-section .drag-handle:hover {
    color: var(--text-body);
}

.stepper-btn {
    width: 34px !important;
    height: 34px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: var(--fs-2xl) !important;
    border-radius: 8px !important;
}

#referee-modal .modal-footer-frame {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    margin-top: 16px;
}

body.dark-mode #referee-modal .modal,
body.dark-mode .referee-modal .modal {
    background: #1e293b !important;
    color: #f1f5f9 !important;
    border: none !important;
}

body.dark-mode #referee-modal .ref-section-panel,
body.dark-mode .ref-section-panel,
body.dark-mode #referee-modal .modal-footer-frame {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

body.dark-mode #referee-modal-wrapper {
    background: rgba(30, 41, 59, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Injected \3c style> sets body.dark-mode .modal { background:#1f2937 !important }
   which beats inline background:none. Override via ID specificity. */
body.dark-mode #referee-modal .modal {
    background: transparent !important;
    box-shadow: none !important;
}

body.dark-mode .draggable-section {
    background: transparent !important;
    border-bottom-color: rgba(255, 255, 255, 0.05) !important;
}

body.dark-mode .draggable-section .drag-handle {
    color: var(--text-subtle);
}

/* Remove green shadow and hover animation from primary footer button in referee modal */
body.dark-mode #btn-submit-referee,
body.dark-mode .ref-btn-footer.primary {
    box-shadow: none !important;
}
body.dark-mode #btn-submit-referee:hover,
body.dark-mode .ref-btn-footer.primary:hover {
    background: var(--primary-fill-hover) !important;
    transform: none !important;
}

body.dark-mode #referee-modal .tally-btn,
body.dark-mode .tally-btn {
    background: rgba(30, 41, 59, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #f1f5f9 !important;
}

body.dark-mode #referee-modal .stepper-btn,
body.dark-mode #referee-modal .stepper-val,
body.dark-mode .stepper-btn,
body.dark-mode .stepper-val {
    background: rgba(30, 41, 59, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #f1f5f9 !important;
}

body.dark-mode #referee-modal .split-header,
body.dark-mode .split-header {
    color: #f1f5f9 !important;
}

body.dark-mode #match-timer-display {
    color: #f1f5f9 !important;
}

body.dark-mode #match-period-display {
    color: #94a3b8 !important;
}

/* Referee View Container Background */
body.dark-mode [style*="background: #f8fafc"]:not(:where([style*="background:var("],[style*="background: var("])) {
    background: transparent !important;
}

/* ============================================
   REFEREE MATCH CARDS - FORCE DARK MODE
   Target all referee match card containers directly
   ============================================ */

/* Dark mode - force ALL match cards to dark background */
body.dark-mode .ref-match-list>div,
body.dark-mode .ref-match-list>div[style],
body.dark-mode div[style*="padding:16px"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode div[style*="padding: 16px"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode div[style*="radius:12px"]:not(:where([style*="background:var("], [style*="background: var("])),
body.dark-mode div[style*="radius: 12px"]:not(:where([style*="background:var("], [style*="background: var("])) {
    background: #1e293b !important;
    border-top-color: rgba(255, 255, 255, 0.1) !important;
    border-right-color: rgba(255, 255, 255, 0.1) !important;
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

/* Match cards that look like referee cards */
/* Gleiche Eingrenzung wie bei der Regel darüber: Wer seinen Hintergrund als Token
   mitbringt, hat sich bewusst für eine Farbe entschieden und wird nicht übermalt.
   Ohne das war z. B. die ausgewählte Karte „An einem Tag" in der Planungshilfe grau
   statt türkis getönt – sie hat `cursor:pointer` und einen Hintergrund. */
body.dark-mode div[style*="margin-bottom:10px"][style*="background"]:not(:where([style*="background:var("], [style*="background: var("])),
body.dark-mode div[style*="margin-bottom: 10px"][style*="background"]:not(:where([style*="background:var("], [style*="background: var("])),
body.dark-mode div[style*="cursor:pointer"][style*="background"]:not(:where([style*="background:var("], [style*="background: var("])) {
    background: #1e293b !important;
}

/* Force text colors in dark mode */
body.dark-mode div[style*="padding:16px"] *:not(:where([style*="color:var("],[style*="color: var("],.tp-knopf-haupt,.tp-knopf-haupt *)),
body.dark-mode div[style*="padding: 16px"] *:not(:where([style*="color:var("],[style*="color: var("],.tp-knopf-haupt,.tp-knopf-haupt *)) {
    color: #e2e8f0 !important;
}

body.dark-mode div[style*="padding:16px"] [style*="color:#64748b"]:not(:where([style*="color:var("],[style*="color: var("],.tp-knopf-haupt,.tp-knopf-haupt *)),
body.dark-mode div[style*="padding: 16px"] [style*="color: #64748b"]:not(:where([style*="color:var("],[style*="color: var("],.tp-knopf-haupt,.tp-knopf-haupt *)) {
    color: #94a3b8 !important;
}

/* ============================================
   LIGHT MODE RESTORATION
   When switching back to light mode, restore white backgrounds
   ============================================ */

/* Light mode - restore match cards to white */
body:not(.dark-mode) .ref-match-list>div,
body:not(.dark-mode) .ref-match-list>div[style] {
    background: #ffffff !important;
}

body:not(.dark-mode) div[style*="padding:16px"]:not(:where([style*="background:var("],[style*="background: var("])),
body:not(.dark-mode) div[style*="padding: 16px"]:not(:where([style*="background:var("],[style*="background: var("])) {
    background: #ffffff !important;
}

body:not(.dark-mode) .ref-head-card {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

body:not(.dark-mode) .ref-navbar {
    background: #ffffff !important;
}

body:not(.dark-mode) .ref-title-container h2 {
    color: var(--text-main) !important;
}

body:not(.dark-mode) .ref-tab {
    color: #64748b !important;
}

body:not(.dark-mode) .ref-tab.active {
    color: var(--primary-strong) !important;
}

body:not(.dark-mode) .ref-burger-menu,
body:not(.dark-mode) #ref-burger-menu {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

body:not(.dark-mode) .ref-burger-menu button {
    color: #334155 !important;
}

/* Light mode text colors restoration. Der Hauptknopf (.tp-knopf-haupt) ist ausgenommen (04.10.2026): Sonst stand
   „OK“ unter „Aktuelles Turnier sichern“ dunkel auf dunklem Tuerkis — der Notausgang „color: var(...) !important“
   inline schlug dann die Klasse. */
body:not(.dark-mode) div[style*="padding:16px"] *:not(:where([style*="color:var("],[style*="color: var("],.tp-knopf-haupt,.tp-knopf-haupt *)),
body:not(.dark-mode) div[style*="padding: 16px"] *:not(:where([style*="color:var("],[style*="color: var("],.tp-knopf-haupt,.tp-knopf-haupt *)) {
    color: #1e293b !important;
}

body:not(.dark-mode) div[style*="padding:16px"] [style*="color"]:not(:where([style*="color:var("],[style*="color: var("],.tp-knopf-haupt,.tp-knopf-haupt *)),
body:not(.dark-mode) div[style*="padding: 16px"] [style*="color"]:not(:where([style*="color:var("],[style*="color: var("],.tp-knopf-haupt,.tp-knopf-haupt *)) {
    color: #1e293b !important;
}

/* ============================================
   STANDINGS TOOLBAR TABS - FORCE OVERRIDES
   ============================================ */
.toolbar-tab-btn {
    /* Base styles */
    border-bottom: 4px solid transparent;
    font-size: var(--fs-lg);
    padding-bottom: 12px;
}

.toolbar-tab-btn.active {
    /* Light mode active */
    color: var(--primary-strong) !important;
    /* Green */
    border-bottom-color: var(--color-primary) !important;
}

body.dark-mode .toolbar-tab-btn.active {
    color: #2dd4bf !important;
    border-bottom-color: #2dd4bf !important;
}

/* Let inline styles work in light mode */

/* ============================================
   MAIN WRAPPER BACKGROUND
   ============================================ */
body.dark-mode div[style*="max-width: 800px"],
body.dark-mode div[style*="max-width:800px"] {
    background: transparent !important;
}

body.dark-mode #app-content {
    background: transparent !important;
}

/* Force overall body background.
   background-attachment: fixed intentionally removed — it breaks backdrop-filter
   on fixed descendants in Chromium (compositing layer conflict). */
body.dark-mode {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 50%, #1e293b 100%) !important;
}

/* ============================================
   UNIFIED DASHBOARD STYLES (New)
   ============================================ */
.dashboard-toolbar {
    background: #ffffff;
    border-radius: 12px;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

body.dark-mode .dashboard-toolbar {
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dashboard-tabs {
    display: flex;
    justify-content: center;
    gap: 60px;
    position: relative;
    /* border-bottom: 1px solid #f1f5f9; REMOVED to fix double line with new tabs */
    padding-bottom: 0;
}


.dash-tab {
    font-size: var(--fs-lg);
    font-weight: var(--weight-medium);
    color: #64748b;
    /* Neutral gray for inactive tabs - not teal */
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
    /* border-bottom: 1px solid #f1f5f9; REMOVED to fix double line with new tabs */
    padding-bottom: 12px;
    background: none;
    border: none;
}

.dash-tab svg {
    display: none !important;
    /* Hide icons as requested */
}

.dash-tab.active {
    color: #1e293b;
    /* Dark gray/black for active tab text and icon */
}

body.dark-mode .dash-tab.active {
    color: #e2e8f0;
}

.dash-tab.active::after {
    display: none !important;
    /* Disable CSS pseudo-element as we use inline border-bottom */
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--primary-fill-bg);
    border-radius: 3px;
}

.dashboard-actions {
    padding-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Dashboard Cards */
.dash-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin: 0 0 20px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    /* border-left moved to internal .card-stripe div */
    position: relative;
    display: flex;
    flex-direction: row;
    /* Changed to row for stripe layout */
    gap: 0;
    /* Gap handled by inner padding */
    overflow: hidden;
}

body.dark-mode .dash-card {
    border-color: rgba(255, 255, 255, 0.1);
}

/* Card Stripe - Base & Colors */
.card-stripe {
    width: 6px !important;
    padding: 0 !important;
    margin: 0 !important;
    flex-shrink: 0;
}

.stripe-active {
    background-color: rgba(13, 148, 136, 0.2);
    /* Light Teal (Light Mode) */
}

body.dark-mode .stripe-active {
    background-color: var(--color-primary);
}

.stripe-inactive {
    background-color: #cbd5e1;
    /* Gray (Light Mode) */
}

body.dark-mode .stripe-inactive {
    background-color: #475569;
    /* Dark Gray (Dark Mode) */
}

/* Old border-left colors removed - handled .card-stripe classes */

.dash-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.dash-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.dash-card-title {
    font-size: var(--fs-2xl);
    font-weight: var(--weight-medium);
    color: var(--text-main);
    margin: 0;
    min-width: 0;
    line-height: 1.2;
    white-space: normal;
    overflow: visible;
    /* break-word + Silbentrennung statt anywhere: „anywhere" trennte lange Namen mitten im Wort
       („Überdeckungspro/be"). So bricht ein Wort nur, wenn es allein nicht passt, und dann an
       einer Silbe (html lang="de"). */
    overflow-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
}

body.dark-mode .dash-card-title {
    color: #f8fafc !important;
}

.dash-edit-icon {
    color: #cbd5e1;
    cursor: pointer;
    transition: color 0.2s;
}

.dash-edit-icon:hover {
    color: var(--brand-primary);
}

.dash-card-meta {
    font-size: var(--fs-md);
    color: var(--text-body);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dash-badges {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.dash-badge {
    font-size: var(--fs-sm);
    background: #f1f5f9;
    color: #64748b;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: var(--weight-medium);
}

body.dark-mode .dash-badge {
    background: rgba(51, 65, 85, 0.5);
    color: #94a3b8;
}

/* Footer Buttons */
.btn-dashboard-row {
    display: flex;
    gap: 10px;
}

.btn-dash {
    padding: 0 16px;
    border-radius: 8px;
    font-size: var(--fs-base);
    font-weight: var(--weight-medium);
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 40px;
}

/* Variants */
.btn-dash-active-state {
    flex: 1;
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
    cursor: default;
}

body.dark-mode .btn-dash-active-state {
    background: var(--primary-fill-bg) !important;
    color: var(--primary-fill-fg) !important;
    border-color: var(--primary-fill-border) !important;
}

.btn-dash-open {
    flex: 1;
    background: #f0fdfa;
    color: #0f766e;
    border: 1px solid #ccfbf1;
}

body.dark-mode .btn-dash-open {
    background: rgba(15, 118, 110, 0.2);
    color: #2dd4bf;
    border-color: rgba(15, 118, 110, 0.4);
}

.btn-dash-icon {
    flex: 0 0 40px;
    background: white;
    border: 1px solid #e2e8f0;
    color: #64748b;
}

body.dark-mode .btn-dash-icon {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(255, 255, 255, 0.15);
    color: #94a3b8;
}

.btn-dash-ref {
    flex: 0 0 40px;
    background: white;
    border: 1px solid #e2e8f0;
    color: #64748b;
}

body.dark-mode .btn-dash-ref {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(255, 255, 255, 0.15);
    color: #94a3b8;
}

/* ============================================
   DARK MODE - Transparent Button Backgrounds
   Removes gray boxes from tab buttons
   ============================================ */
body.dark-mode .dash-tab,
body.dark-mode .toolbar-tab-btn,
body.dark-mode .ref-tab {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* ============================================
   DARK MODE - Blue Active Filter Pills
   Override green with blue for filter pills
   ============================================ */
body.dark-mode .filter-pill.active,
body.dark-mode .ref-toolbar .filter-pill.active {
    background: var(--primary-fill-bg) !important;
    background-color: var(--primary-fill-bg) !important;
    border-color: var(--primary-fill-border) !important;
    color: var(--primary-fill-fg) !important;
}


/* Hall view time pills - base styles */
.time-pill {
    padding: 5px 12px;
    font-size: var(--fs-md);
    font-family: var(--font-heading);
    font-weight: var(--weight-medium);
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: white;
    color: var(--text-main);
    opacity: 0.7;
    cursor: pointer;
    transition: all 0.2s;
}

.time-pill:hover {
    background: #f1f5f9;
}

.time-pill.active {
    background: var(--primary-fill-bg) !important;
    border: none !important;
    color: var(--primary-fill-fg) !important;
    border-radius: var(--gestalt-knopf-radius) !important;
    opacity: 1 !important;
}

/* Hall view time pills - dark mode styling */
body.dark-mode .time-pill {
    border-color: #475569;
    background: #1e293b;
    color: #94a3b8;
}

body.dark-mode .time-pill:hover {
    background: #334155;
}

body.dark-mode .time-pill.active {
    background: var(--primary-fill-bg) !important;
    border-color: var(--primary-fill-border) !important;
    color: var(--primary-fill-fg) !important;
}

/* Dashboard active tournament card - blue left border in dark mode */

/* ============================================
   STANDINGS V5 MODERN DESIGN
   ============================================ */
:root {
    --brand-teal: #14b8a6;
    --bg-toolbar: #ffffff;
    --pill-bg-inactive: #ffffff;
    --pill-border-inactive: #e2e8f0;
    --pill-text-inactive: #1e293b;
    --active-indicator-light: #14b8a6;
    --active-pill-bg-light: rgba(13, 148, 136, 0.1);
}

body.dark-mode {
    --bg-toolbar: #1e293b;
    --active-indicator-dark: #0d9488;
    --active-pill-bg-dark: #0d9488;
    --pill-bg-inactive: transparent;
    --pill-border-inactive: #475569;
    --pill-text-inactive: #e2e8f0;
}

/* TOOLBAR */
.standings-toolbar {
    background: var(--bg-toolbar);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: background 0.3s;
    margin-bottom: 20px;
}

/* 1. ICONS ROW */
.toolbar-tabs {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.tab-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
}

.toolbar-tab-btn {
    background: none;
    border: none;
    padding: 10px;
    cursor: pointer;
    position: relative;
    color: var(--text-main);
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--weight-medium);
}

.toolbar-tab-btn:not(.active) {
    opacity: 0.7;
}

.toolbar-tab-btn.active {
    opacity: 1;
    color: var(--brand-teal);
}

body.dark-mode .toolbar-tab-btn.active {
    color: var(--active-indicator-dark);
}

.toolbar-tab-btn svg {
    stroke-width: 2px;
}

/* ACTIVE INDICATOR BAR */
.tab-indicator {
    position: absolute;
    bottom: -13px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    border-radius: 2px;
    display: none;
}

.toolbar-tab-btn.active .tab-indicator {
    display: block;
}

body:not(.dark-mode) .tab-indicator {
    background-color: var(--active-indicator-light);
}

body.dark-mode .tab-indicator {
    background-color: var(--active-indicator-dark);
}

/* 2. PILLS ROW */
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
    padding-top: 4px;
}

.filter-chip {
    padding: 6px 16px;
    border-radius: 12px;
    font-size: var(--fs-base);
    font-weight: var(--weight-medium);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: var(--pill-bg-inactive);
    border: 1px solid var(--pill-border-inactive);
    color: var(--pill-text-inactive);
}

.filter-chip:hover {
    opacity: 0.9;
    border-color: #cbd5e1;
}

/* ACTIVE PILL STATES */
body:not(.dark-mode) .filter-chip.active {
    background-color: var(--primary-fill-bg);
    color: var(--primary-fill-fg);
    border-color: transparent !important;
}

body.dark-mode .filter-chip.active {
    background-color: var(--active-pill-bg-dark);
    color: var(--primary-fill-fg);
    border-color: var(--active-pill-bg-dark);
}

/* Red Dot in Live Button */
.live-dot {
    width: 8px;
    height: 8px;
    background: var(--color-danger);
    border-radius: 50%;
    display: inline-block;
}

/* 3. BURGER MENU */
.burger-menu-content {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-toolbar);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
    color: var(--text-main);
    display: none;
    width: 200px;
    z-index: 50;
}

.burger-item {
    padding: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
    cursor: pointer;
    border-radius: 6px;
    font-size: var(--fs-base);
}

.burger-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

body.dark-mode .burger-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* CARDS */
.group-card {
    background: var(--bg-toolbar);
    border-radius: 8px;
    box-shadow: none;
    border: 1px solid #e8eef4;
    margin-top: 20px;
    margin-left: 20px !important;
    margin-right: 20px !important;
    width: auto !important;
    max-width: 100% !important;
    overflow: hidden;
    display: flex;
}

body.dark-mode .group-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--border-color);
}

.group-card-content {
    padding: 16px;
}

.group-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    color: var(--text-main);
    font-weight: var(--weight-medium);
}

.mock-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-base);
    color: var(--text-main);
}

.mock-table th {
    text-align: left;
    color: var(--text-secondary);
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
    font-weight: var(--weight-medium);
}

.mock-table td {
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
}

/* Responsive improvements for Table */
@media (max-width: 640px) {


    .mock-table th,
    .mock-table td {
        padding: 6px 4px;
        font-size: var(--fs-base);
    }
}

/* Desktop/Tablet Responsive Table Improvements */
@media (min-width: 641px) {

    .mock-table th,
    .mock-table td {
        font-size: var(--fs-xl) !important;
        padding: 6px 8px !important;
    }

    /* Adjust Column Widths for larger font */
    .mock-table th:nth-child(1),
    .mock-table td:nth-child(1) {
        width: 32px !important;
    }

    .mock-table th:nth-child(3),
    .mock-table td:nth-child(3) {
        width: 40px !important;
    }

    .mock-table th:nth-child(4),
    .mock-table td:nth-child(4) {
        width: 60px !important;
    }

    .mock-table th:nth-child(5),
    .mock-table td:nth-child(5) {
        width: 40px !important;
    }

    .mock-table th:nth-child(6),
    .mock-table td:nth-child(6) {
        width: 40px !important;
    }

    .mock-table th:last-child,
    .mock-table td:last-child {
        width: 40px !important;
    }

    .mock-table th:nth-last-child(2),
    .mock-table td:nth-last-child(2) {
        width: 40px !important;
    }
}

/* ============================================
   UNIFIED TOOLBAR STYLES (v1.5.10)
   ============================================ */
.app-toolbar,
.dashboard-toolbar,
.standings-toolbar,
.schedule-toolbar-new {
    background: white;
    border-radius: 16px;
    /* margin: 16px; REMOVED - DEFINED BELOW */
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Specific margins */
.app-toolbar,
.standings-toolbar {
    margin: 16px;
}

/* Dashboard & Schedule are contained in padded wrappers, so margin:0 */
.dashboard-toolbar,
.schedule-toolbar-new {
    margin: 0 !important;
    width: 100%;
    box-sizing: border-box;
}

/* Unified Toolbar Tabs (Dashboard, Standings, Schedule) */
.standings-toolbar .toolbar-tabs,
.schedule-toolbar-new .toolbar-tabs,
.dashboard-toolbar .dashboard-tabs {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding-bottom: 12px;
    /* border-bottom: 1px solid var(--border-color); REMOVED to fix double line in Standings/Schedule */
    margin-bottom: 12px;
}

/* Dark Mode Overrides for Toolbars */
body.dark-mode .app-toolbar,
body.dark-mode .dashboard-toolbar,
body.dark-mode .standings-toolbar,
body.dark-mode .schedule-toolbar-new {
    background: rgba(30, 41, 59, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: none !important;
}

body.dark-mode .standings-toolbar .toolbar-tabs,
body.dark-mode .schedule-toolbar-new .toolbar-tabs,
body.dark-mode .dashboard-toolbar .dashboard-tabs {
    border-color: rgba(255, 255, 255, 0.15) !important;
}

/* ============================================
   CIRCULAR TRIAL BADGE
   ============================================ */
.circular-badge {
    display: none;
    /* Controlled by JS via inline style */
    width: 34px;
    height: 34px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-sm);
    font-weight: var(--weight-medium);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    -webkit-user-select: none;
    user-select: none;
    line-height: 1;
}

.circular-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.circular-badge svg {
    margin: 0 !important;
    /* Center the icon */
}

/* Adjustments for header alignment */
#license-badge {
    margin-left: 8px;
}

/* ============================================
   DESKTOP NAVIGATION (Icon Bar)
   ============================================ */

/* Tooltip Implementation */

/* Dark Mode Tooltip adjustments */

/* ============================================
   RESPONSIVE SWITCHING (Breakpoint: 1024px)
   ============================================ */

/* Fix for Desktop Navigation Buttons */

/* Fix for truncated Gear Icon */

/* Theme Toggle Visibility Fix */

/* ============================================
   SIDEBAR LAYOUT (Desktop >= 900px)
   ============================================ */

/* Default: Sidebar hidden on mobile */
#desktop-sidebar {
    display: none;
}

@media (min-width: 900px) {

    /* Hide default header */
    .app-header {
        display: none !important;
    }

    /* Show Sidebar */
    #desktop-sidebar {
        display: flex !important;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: var(--seitenleiste-breite);
        /* KEINE transition auf width. Sie war zuerst da (0.18s) und hat das
           Einklappen VOLLSTAENDIG verhindert: Aendert sich die Breite ueber eine
           CSS-Variable, startet die Ueberblendung nicht neu, und das Element behaelt
           seinen alten Wert. Gemessen am 08.09.2026: mit transition blieb die Leiste
           bei 220 px, waehrend der Inhaltsbereich daneben schon auf 64 px gerueckt
           war - die Leiste lag also ueber dem Inhalt. Ohne transition stimmt es
           sofort. Der Fehler war nur im laufenden Browser zu sehen: Beim Laden mit
           bereits gesetzter Klasse war die Breite richtig, weil dann nichts
           ueberblendet wird. */
        background: var(--bg-card);
        /* Use card background for consistency */
        border-right: 1px solid var(--border-color);
        z-index: 1000;
        padding: 0 !important;
        box-shadow: var(--shadow-md);
    }


    /* Die Turnier-Zeile sitzt im Kopf, nicht mehr in der Liste. Der Kopf hat 16 px
       linkes Padding, die Liste 21 px - ohne den Ausgleich staende die Krone um
       5 px versetzt zu den Symbolen darunter. */
    .sidebar-turnier-zeile {
        margin-top: 6px;
        margin-left: 5px;
    }

    /* Fusszeile: Konto links, Abmelden rechts. */
    .sidebar-footer {
        display: flex;
        align-items: center;
        gap: 4px;
    }

    /* Der Konto-Knopf MUSS schrumpfen duerfen.

       Er trug `width: 100%` und (wie jedes Flex-Kind) `min-width: auto` — er wurde
       damit nie schmaler als sein Inhalt. Bei einer langen Anmelde-Adresse belegte er
       die vollen 183 px der Fusszeile und schob den Abmelden-Knopf aus der Leiste:
       gemessen am 08.09.2026 endete dieser bei x=237, die Leiste bei x=220 — 17 px
       ausserhalb, und damit unerreichbar.

       `min-width: 0` ist der eigentliche Schalter: Ohne ihn greift das `overflow:
       hidden` am Namen nicht, weil der Knopf gar nicht erst schmaler wird. */
    .sidebar-user-btn {
        flex: 1 1 auto;
        min-width: 0;
    }

    #sidebar-user-name {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* ── Die drei Symbole am rechten Rand ──────────────────────────────────

       Einklappen (oben), Stift am Turniernamen und Abmelden (unten) stehen
       untereinander und sollen auf EINER senkrechten Achse sitzen. Ihre
       Behaelter endeten schon alle bei derselben Kante — die Symbole darin
       aber nicht, weil jedes eine andere Groesse und einen anderen
       Innenabstand hatte: gemessen am 08.09.2026 lagen die Mitten bei 187
       (Einklappen, 16 px), 172 (Stift, 14 px) und 182 (Abmelden, 18 px).
       Der Stift fiel am weitesten heraus, weil der Turnier-Knopf 20 px
       Innenabstand rechts trug.

       Loesung: eine gemeinsame Box von 28 px, rechtsbuendig. Darin zentriert
       sich jedes Symbol selbst — die Achse haengt dann nicht mehr an der
       Groesse des einzelnen Symbols. --tp-rechte-symbolbox ist die eine
       Stelle, an der diese Groesse steht. */
    .sidebar-abmelden-btn,
    #sidebar-schmal-schalter {
        display: flex;
        align-items: center;
        justify-content: center;
        width: var(--tp-rechte-symbolbox);
        height: var(--tp-rechte-symbolbox);
        padding: 0;
        flex-shrink: 0;
        background: transparent;
        border: none;
        cursor: pointer;
        border-radius: 8px;
        color: var(--text-body);
    }

    .sidebar-abmelden-btn {
        font-size: var(--fs-sm);
        font-weight: var(--weight-medium);
    }

    /* Der Stift ist kein Knopf, sondern ein SVG im Turnier-Knopf. Er bekommt
       keine Box, sondern den Abstand, der ihn auf dieselbe Achse schiebt:
       halbe Box minus halbes Symbol. Dafuer faellt der Innenabstand des
       Knopfes rechts weg, der ihn vorher 20 px nach links schob. */
    .sidebar-turnier-zeile .sidebar-tournament-nav-btn {
        padding-right: 0;
    }

    .sidebar-turnier-zeile .sidebar-pencil-icon {
        margin-right: calc((var(--tp-rechte-symbolbox) - 14px) / 2);
        flex-shrink: 0;
    }

    .sidebar-abmelden-btn:hover {
        background: var(--surface-soft);
    }

    /* Ausgeklappt genuegt das Symbol - der Kurzhinweis sagt, was es tut. Der Name
       daneben braucht den Platz. auth.js schreibt trotzdem in den span (er ist nur
       nicht sichtbar), damit „Zur Startseite" im Gastmodus im title landet. */
    .sidebar-abmelden-btn span {
        display: none;
    }

    /* Sidebar Header */
    .sidebar-header {
        margin-bottom: 8px;
        width: 100%;
        display: flex;
        flex-direction: column;
        /* Oben 20 -> 12 px (21.09.2026). Ueber dem Zeichen sass mehr Luft als zwischen
           zwei Menuepunkten; das Fenster hat oben ohnehin schon die Leiste des Browsers.
           Links bleiben die 16 px: Sie setzen das 32-px-Zeichen auf seine Achse. */
        padding: 12px 20px 0 16px;
    }

    .sidebar-logo {
        display: flex;
        align-items: center;
        margin-bottom: 4px;
    }

    /* Tournament Slot: compact label + name below the logo */
    .sidebar-tournament-slot {
        display: flex;
        flex-direction: column;
        gap: 2px;
        padding: 8px 20px 8px 10px;
        border-radius: 8px;
        cursor: pointer;
        transition: background 0.18s ease;
    }

    .sidebar-tournament-slot:hover {
        background: rgba(13, 148, 136, 0.07);
    }

    .sidebar-tournament-slot:hover .edit-icon-hover {
        opacity: 0.8;
        color: var(--primary-strong);
    }

    .sidebar-tournament-label {
        font-size: var(--fs-2xs);
        font-weight: var(--weight-bold);
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--text-body);
    }

    .sidebar-tournament-row {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .sidebar-tournament-name-text {
        font-size: var(--fs-base);
        font-weight: var(--weight-bold);
        color: var(--text-main);
        flex: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px;
    }

    .sidebar-tournament-slot .edit-icon-hover {
        opacity: 0.2;
        transition: all 0.18s ease;
        flex-shrink: 0;
        color: var(--text-body);
    }

    body.dark-mode .sidebar-tournament-slot:hover {
        background: rgba(255, 255, 255, 0.05);
    }

    body.dark-mode .sidebar-tournament-name-text {
        color: #f1f5f9;
    }

    /* Tournament as Nav Item */
    .sidebar-tournament-nav-btn {
        width: 100%;
        display: flex;
        align-items: center;
        padding: 10px 20px 10px 0; /* Reduced from 5px to 0 for flush alignment */
        background: rgba(13, 148, 136, 0.08);
        border: none;
        border-radius: 8px;
        cursor: pointer;
        color: var(--text-main);
        opacity: 0.85;
        font-size: var(--fs-lg);
        font-weight: var(--weight-medium);
        transition: all 0.2s;
        text-align: left;
        gap: 0;
    }

    .sidebar-tournament-nav-btn:hover {
        background: rgba(13, 148, 136, 0.15);
    }

    .sidebar-tournament-nav-btn .icon {
        margin-right: 10px;
        display: flex;
        align-items: center;
        min-width: 20px;
        flex-shrink: 0;
        color: var(--text-main);
    }

    .sidebar-tournament-nav-name {
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: var(--text-main);
    }

    .sidebar-pencil-icon {
        opacity: 0.5;
        flex-shrink: 0;
        margin-left: 6px;
        color: var(--text-body);
        transition: opacity 0.18s ease;
    }

    .sidebar-tournament-nav-btn:hover .sidebar-pencil-icon {
        opacity: 1;
    }

    body.dark-mode .sidebar-tournament-nav-btn {
        background: rgba(13, 148, 136, 0.12);
    }

    body.dark-mode .sidebar-tournament-nav-btn:hover {
        background: rgba(13, 148, 136, 0.2);
    }


    .sidebar-tournament-name {
        font-size: var(--fs-base);
        font-weight: var(--weight-medium);
        color: var(--text-main);
        text-align: center;
        margin: 0;
        word-break: break-all;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        box-shadow: none !important;
    }

    /* Sidebar Navigation */
    .sidebar-nav {
        display: flex;
        flex-direction: column;
        /* 4 statt 8 px. Die Liste war gemessen 789 px hoch und scrollte schon bei
           900 px Fensterhoehe. Gespart wird am ABSTAND, nicht an der Zeilenhoehe.
           (Die Zeile stand damals auf 43 px; seit dem 21.09.2026 auf 36 — die
           Begruendung fuer die Untergrenze steht bei „SEITENLEISTE ENG".) */
        gap: 4px;
        flex: 1;
        /* Pushes footer down */
        min-height: 0;
        /* Required for overflow-y:auto inside flex-column to work correctly */
        overflow-y: auto;
        /* Allow scrolling if menu is tall */
        width: 100%;
        /* Unten 8 statt 16 px: In einem Bereich, der ohnehin scrollen kann, ist ein
           hoher Abschlussrand nur Luft — und die fehlte oben an anderer Stelle. */
        padding: 0 0 8px 21px;
    }


/* Die Regeln fuer .menue-namenschutz, .menue-gruppe und das enge Burger-Menue standen
   bis zum 21.09.2026 HIER — mitten in @media (min-width: 900px), und damit nur fuer die
   Seitenleiste. Auf dem Handy gab es die Gruppen-Ueberschriften also unformatiert: gross,
   in Grundschrift, statt klein und gesperrt. Sie stehen jetzt am Dateiende, ausserhalb
   jedes Medienblocks (Abschnitt MENUE-GRUPPEN UND DICHTE). */


    /* SEITENLEISTE ENG (21.09.2026).
       Die Beschriftung stand auf --fs-lg (15px) — zwei Stufen ueber den Bedienelementen
       der App, die bei 12px liegen, und eine ueber den Feldbeschriftungen (13px). Sie war
       nicht gross, sie war aus der Reihe. Jetzt --fs-md, dieselbe Stufe wie die
       Feldbeschriftungen, und 8 statt 10px Innenabstand.
       GEMESSEN: 43 -> 36px je Zeile. Das ist der Puffer, der Entwurf A (drei Eintraege und
       drei Ueberschriften mehr) bezahlt.
       UNTERGRENZEN, an denen das geprueft wurde: WCAG 2.2 AA verlangt 24px Zielgroesse
       (Erfolgskriterium 2.5.8), Apple und Google empfehlen 44px fuer Finger. 36px liegt
       dazwischen und gilt NUR hier: Die Seitenleiste erscheint erst ab 900px, also Maus,
       Trackpad oder Tablet quer. Das Burger-Menue des Handys bleibt unveraendert.
       KORREKTUR VOM 22.09.2026: Hier stand „und der Vergroesserungsschalter wirkt weiter
       (bis 125%): 13 -> 16,25px". Das war falsch und ist nachgemessen worden — bei 100,
       112 und 125 % steht die Beschriftung unveraendert auf 13 px. Der Grund liegt nicht
       an dieser Regel: `#desktop-sidebar` und `.app-header` stehen beide in der Liste
       weiter oben, die `--tp-font-scale: 1` setzt. BEIDE Menuefassungen sind vom Schalter
       also ausgenommen, und zwar schon lange vor dieser Aenderung — die Leiste ist fest
       220 px breit, eine mitwachsende Schrift wuerde die Beschriftungen umbrechen.
       Wer das aendern will, aendert jene Liste, nicht diese Regel. */
    .sidebar-nav-btn {
        display: flex;
        align-items: center;
        /* NACHTRAG 21.09.2026 — wo die Hoehe einer Zeile wirklich herkam.
           Beim Suchen nach weiteren Pixeln lag der Verdacht auf dem Symbol (20 px) und
           auf der Schrift. Gemessen war es keins von beidem: Der Knopf war 35,5 px hoch,
           weil er 19,5 px Zeilenhoehe trug — 1,5 x 13 px, geerbt vom Fliesstext der
           Seite. Eine Menuebeschriftung ist aber nie mehrzeilig; 1,5 ist der Wert fuer
           Absaetze, nicht fuer einzeilige Etiketten.
           1,25 + 7 px Polster = 30,3 px je Zeile. Das Symbol passt mit seinen 20 px
           weiter hinein und musste nicht schrumpfen.
           GEMESSEN: 11 Zeilen sparen damit 57 px. Eine Schrift von 12 statt 13 px haette
           dagegen nur 1,5 px je Zeile gebracht und die Beschriftung kleiner gemacht als
           die Feldbeschriftungen der App — viel Verlust fuer wenig Gewinn.
           30 px liegen ueber der WCAG-2.2-AA-Grenze von 24 px (Erfolgskriterium 2.5.8)
           und gelten nur hier: Die Leiste erscheint erst ab 900 px. */
        line-height: 1.25;
        padding: 7px 20px 7px 5px;
        background: transparent !important; /* Kein eigener Hintergrund */
        border: none;
        -webkit-appearance: none;
        appearance: none;
        border-radius: 8px;
        cursor: pointer;
        color: var(--text-main);
        opacity: 1; /* Row-Opacity übernimmt das Dimmen */
        font-size: var(--fs-md);
        font-weight: var(--weight-medium);
        transition: color 0.2s;
        text-align: left;
        width: 100%;
    }

    .sidebar-nav-btn span {
        font-size: inherit;
        font-weight: inherit;
    }

    .sidebar-nav-btn:hover {
        background: transparent !important;
        opacity: 1;
    }

    .sidebar-item-row:hover {
        background: rgba(0, 0, 0, 0.03);
        opacity: 1; /* gesamte Zeile auf einmal aufgehellt */
    }

    /* Hover: Icon + Chevron werden grün */
    .sidebar-item-row:hover > .sidebar-row-icon {
        color: var(--primary-strong);
    }

    .sidebar-item-row:hover .sidebar-chevron-toggle {
        color: var(--primary-strong);
    }

    .sidebar-item-row:has(.sidebar-nav-btn.active) {
        background: rgba(13, 148, 136, 0.1);
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        opacity: 1; /* aktive Zeile immer voll sichtbar */
    }

    .sidebar-item-row:has(.sidebar-nav-btn.active) > .sidebar-row-icon {
        opacity: 1;
        color: var(--primary-strong);
    }

    .sidebar-item-row:has(.sidebar-nav-btn.active) .sidebar-chevron-toggle {
        color: var(--primary-strong);
    }

    .sidebar-nav-btn.active {
        background: transparent;
        color: var(--primary-strong);
        opacity: 1;
        font-weight: var(--weight-medium);
    }

    .sidebar-nav-btn .icon {
        margin-right: 10px;
        display: flex;
        align-items: center;
        min-width: 20px;
        /* Prevent icon shrinking */
    }

    /* Dark mode adjustments for sidebar */
    body.dark-mode #desktop-sidebar {
        background: #1e293b !important;
        border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.4) !important;
    }

    body.dark-mode .sidebar-footer {
        border-top-color: rgba(255, 255, 255, 0.08) !important;
    }

    body.dark-mode .sidebar-item-row:has(.sidebar-nav-btn.active) {
        background: rgba(13, 148, 136, 0.12) !important;
        opacity: 1;
    }

    body.dark-mode .sidebar-item-row:hover {
        background: rgba(255, 255, 255, 0.04) !important;
        opacity: 1;
    }

    body.dark-mode .sidebar-item-row:hover > .sidebar-row-icon {
        color: #2dd4bf !important;
    }

    body.dark-mode .sidebar-item-row:hover .sidebar-chevron-toggle {
        color: #2dd4bf !important;
    }

    body.dark-mode .sidebar-nav-btn.active {
        color: #2dd4bf;
    }

    body.dark-mode .sidebar-nav-btn {
        color: #cbd5e1;
    }

    body.dark-mode .sidebar-row-icon {
        color: #64748b !important;
    }

    body.dark-mode .sidebar-item-row:has(.sidebar-nav-btn.active) .sidebar-row-icon {
        color: #2dd4bf !important;
    }

    body.dark-mode .sidebar-item-row:has(.sidebar-nav-btn.active) .sidebar-chevron-toggle {
        color: #2dd4bf !important;
    }

    body.dark-mode .sidebar-chevron-toggle {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        color: #475569 !important;
    }

    body.dark-mode .sidebar-chevron-toggle:hover {
        color: #94a3b8 !important;
        background: transparent !important;
    }

    body.dark-mode .sidebar-user-btn {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    body.dark-mode .sidebar-user-btn:hover {
        background: rgba(255, 255, 255, 0.05) !important;
    }

    body.dark-mode .sidebar-tournament-name {
        color: #f1f5f9;
    }

    /* Sidebar Footer (User Account) */
    .sidebar-footer {
        margin-top: auto;
        /* 15/20 -> 9/12 px (21.09.2026). Gemessen war die Fusszeile 84 px hoch fuer EINE
           Zeile mit Kuerzel, Adresse und Abmelden — 35 px davon waren Polster. Sie sitzt
           ohnehin am unteren Rand; ein breiter Abschluss unter ihr traegt nichts und geht
           dem Menue darueber ab (84 -> 70 px). Links bleiben die 16 px, damit das Kuerzel
           auf derselben Achse steht wie das Zeichen im Kopf. */
        padding: 9px 20px 12px 16px;
        border-top: 1px solid var(--border-color);
    }

    .sidebar-user-btn {
        display: flex;
        align-items: center;
        width: 100%;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 8px 20px 8px 0; /* Reduced from 5px to 0 */
        border-radius: 8px;
        transition: background 0.2s;
        text-align: left;
    }

    .sidebar-user-btn:hover {
        background: rgba(0, 0, 0, 0.05);
    }

    .sidebar-user-btn span {
        color: var(--text-main);
        font-weight: var(--weight-normal);
        font-size: var(--fs-md);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    body.dark-mode .sidebar-user-btn:hover {
        background: rgba(255, 255, 255, 0.05);
    }

    body.dark-mode .sidebar-user-btn span {
        color: #e2e8f0;
    }

    .user-avatar-placeholder {
        width: 32px;
        height: 32px;
        min-width: 32px;
        background: var(--primary-fill-bg);
        color: var(--primary-fill-fg);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: var(--weight-medium);
        margin-right: 10px;
        font-size: var(--fs-md);
    }

    /* Sidebar Item Row — icon | chevron | text in one flex row
       Opacity auf Row-Ebene — alle Kinder dimmen/aufhellen gemeinsam */
    .sidebar-item-row {
        display: flex;
        align-items: center;
        border-radius: 8px;
        opacity: 0.7;
        transition: opacity 0.2s, background 0.2s;
    }

    /* Icon sits outside the nav-btn as first flex child */
    .sidebar-item-row > .sidebar-row-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        width: 36px;
        min-width: 36px;
        color: var(--text-main);
        opacity: 1; /* Row-Opacity übernimmt das Dimmen */
        pointer-events: none; /* icon is purely visual; nav-btn and chevron handle clicks */
    }

    /* Inline Chevron Toggle Button (between icon and text) */
    .sidebar-chevron-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 18px;
        min-width: 18px;
        background: transparent !important; /* Kein eigener Hintergrund */
        border: none;
        -webkit-appearance: none;
        appearance: none;
        cursor: pointer;
        color: var(--text-main);
        opacity: 1; /* Row-Opacity übernimmt das Dimmen */
        transition: color 0.2s;
        border-radius: 4px;
        padding: 0;
        margin-right: 4px; /* Increased from 2px */
    }

    /* Spacer for items without submenus to maintain alignment */
    .sidebar-chevron-spacer {
        width: 18px;
        min-width: 18px;
        margin-right: 4px; /* Increased from 2px */
        flex-shrink: 0;
    }

    .sidebar-chevron-toggle:hover {
        opacity: 1;
        color: var(--text-main);
    }

    .sidebar-chevron-toggle svg {
        transition: transform 0.25s ease;
    }

    .sidebar-chevron-toggle.open svg {
        transform: rotate(90deg);
    }

    body.dark-mode .sidebar-chevron-toggle {
        color: #94a3b8;
    }

    body.dark-mode .sidebar-chevron-toggle:hover {
        color: #e2e8f0;
    }

    /* Nav button inside an item-row: takes remaining space, no left icon padding */
    .sidebar-item-row .sidebar-nav-btn {
        flex: 1;
        min-width: 0;
        padding-left: 0;
    }

    /* Submenu Styling — no vertical line, slightly indented from parent icons */
    .sidebar-submenu {
        display: none;
        flex-direction: column;
        margin-left: 28px; /* Slightly indented (6px) from parent icons for hierarchy */
        margin-bottom: 8px;
        border-left: none;
        padding-left: 0;
    }

    /* Show submenu when toggled open via chevron */
    .sidebar-submenu.open {
        display: flex;
        animation: slideDown 0.2s ease-out;
    }

    .sidebar-submenu-btn {
        display: flex;
        align-items: center;
        width: 100%;
        background: transparent;
        border: none;
        border-radius: 6px;
        margin-bottom: 2px;
        transition: all 0.2s;
        text-align: left;
        color: var(--text-main);
        opacity: 0.7;
        font-size: var(--fs-md);
        font-weight: var(--weight-medium);
        gap: 8px;
        cursor: pointer;
        padding: 6px 8px;
    }

    .sidebar-submenu-btn span {
        font-size: inherit;
        font-weight: inherit;
    }

    .sidebar-submenu-btn:hover {
        background: rgba(0, 0, 0, 0.05);
        color: var(--primary-strong);
        opacity: 1;
    }

    body.dark-mode .sidebar-submenu-btn:hover {
        background: rgba(255, 255, 255, 0.06) !important; /* (0,3,1) schlägt button:hover (0,2,2) */
        color: #2dd4bf;
    }

    body.dark-mode .sidebar-submenu {
        border-left: none;
    }

    /* Adjust Main Content Area - Grid Layout Success */
    .content-area {
        /* Genau der Platz rechts neben der Seitenleiste — Breite aus dem Token,
           damit der Inhalt beim Einklappen mitwandert. */
        margin-left: var(--seitenleiste-breite) !important;
        width: calc(100% - var(--seitenleiste-breite)) !important;
        padding: 0 !important;

        display: flex !important;
        justify-content: center !important;
        align-items: flex-start !important;

        min-height: 100vh;
        box-sizing: border-box;
        /* overflow-x: hidden; <-- REMOVED: This breaks position: sticky on children */
        background: transparent !important;
    }

    #app-content {
        /* This column is now strictly centered in the remaining space */
        width: 100% !important;
        max-width: 1040px !important;
        margin: 0 !important;
        padding: 0 10px !important;

        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        box-sizing: border-box;
    }

    /* Force all major containers to respect width and center */
    #dashboard-view,
    #schedule,
    #standings,
    #setup-view,
    .tab-content,
    .labs-card,
    .match-row-container,
    #view-tournament-center>div {
        width: 100% !important;
        max-width: 1040px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
        box-sizing: border-box !important;
    }


    /* Adjust floating version tag */
    #version-tag-bottom {
        position: fixed !important;
        left: 215px !important;
        right: auto !important;
        bottom: 15px !important;
        font-size: var(--fs-sm);
        z-index: 1000;
        pointer-events: none;
    }
}

/* Dedicated Timer Play Button Styles (Refined) */
.timer-play-btn {
    --tp-bg: rgba(13, 148, 136, 0.1);
    --tp-color: #0d9488;
    --tp-hover-bg: rgba(13, 148, 136, 0.15);

    background-color: var(--tp-bg) !important;
    color: var(--tp-color) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border: none !important;
    cursor: pointer;
    box-shadow: none !important;
}

.timer-play-btn:hover {
    background-color: var(--tp-hover-bg) !important;
    transform: scale(1.05);
}

.timer-play-btn:active {
    transform: scale(0.95);
}

.timer-play-btn.is-running {
    --tp-bg: #ef4444;
    --tp-color: #ffffff;
    --tp-hover-bg: #dc2626;
}

/* ============================================
   PLAYER MANAGEMENT UI
   ============================================ */

.players-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    align-items: center;
}


.players-bulk-actions {
    display: flex;
    gap: 8px;
}

.player-list-container {
    padding: 20px;
}

.player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.player-card {
    background: var(--bg-card);
    border: 1px solid rgba(13,148,136,0.2);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.player-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.player-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--brand-secondary);
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--weight-strong);
    font-size: var(--fs-3xl);
    flex-shrink: 0;
}

.player-info {
    flex: 1;
    min-width: 0;
}

.player-name {
    font-weight: var(--weight-bold);
    font-size: var(--fs-xl);
    color: var(--text-main);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-meta {
    font-size: var(--fs-base);
    color: var(--text-body);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.player-badge {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: var(--fs-sm);
    font-weight: var(--weight-bold);
}

.badge-gender-m {
    background: #e0f2fe;
    color: #0369a1;
}

.badge-gender-f {
    background: #fce7f3;
    color: #be185d;
}

.badge-gender-d {
    background: #f3f4f6;
    color: #374151;
}

.player-actions {
    display: flex;
    gap: 4px;
}

/* Team Player Badge in Labs View */
.team-player-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--brand-secondary);
    color: var(--brand-primary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: var(--fs-md);
    font-weight: var(--weight-bold);
    cursor: pointer;
    transition: opacity 0.2s;
}

.team-player-badge:hover {
    opacity: 0.8;
}

/* Modal styles for Player Edit */
.player-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 599px) {
    .player-modal-grid {
        grid-template-columns: 1fr;
    }

    .players-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .player-grid {
        grid-template-columns: 1fr;
    }
}

body.dark-mode .player-card {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(45, 212, 191, 0.35);
}

/* Compact single-row player card */
.player-card-compact {
    padding: 5px 10px;
    border-radius: 8px;
    flex-wrap: nowrap;
    gap: 6px;
    min-height: 0;
}

.player-card-compact:hover {
    transform: none;
    background: #f8fafc;
    box-shadow: var(--shadow-sm);
}

/* Zwei Namensfelder in der Teilnehmer-Zeile. Sie teilen sich den Platz, den vorher
   das eine Namensfeld hatte. */
.player-card-compact .player-name-input.pc-teil {
    /* FESTER Anteil, kein Wachsen: sonst richtet sich die Breite nach dem, was
       rechts daneben steht — und die Zusammenfassung ist je Zeile verschieden lang
       („nur in: Gruppenphase · männlich" gegen gar nichts). Die Nachnamen standen
       dadurch in jeder Zeile woanders. Gleicher Anteil = gleiche Spalte. */
    flex: 0 0 28%;
    min-width: 70px;
}

.player-card-compact .player-name-input {
    flex: 1;
    min-width: 60px;
    font-weight: var(--weight-bold);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-checkbox {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.player-checkbox:checked::after {
    content: '✓';
    color: var(--brand-primary);
    font-weight: var(--weight-strong);
    font-size: var(--fs-md);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.pc-badges {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

/* Mobile: name stays on line 1, badges wrap to line 2 */
@media (max-width: 480px) {
    .player-card-compact {
        flex-wrap: wrap;
        padding: 5px 8px;
    }
    .player-card-compact .player-checkbox { order: 0; }
    .player-card-compact .player-name-input {
        order: 1;
        flex: 1;
        min-width: 80px;
    }
    .player-card-compact .player-delete-btn {
        order: 2;
        margin-left: auto;
    }
    .player-card-compact .pc-badges {
        order: 3;
        flex-basis: 100%;
        padding-left: 28px;
        flex-wrap: wrap;
    }
    .pc-class-badge { display: none; }
}

body.dark-mode .player-card-compact:hover {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-mode .player-checkbox {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .badge-gender-m {
    background: rgba(3, 105, 161, 0.2);
    color: #7dd3fc;
}

body.dark-mode .badge-gender-f {
    background: rgba(190, 24, 93, 0.2);
    color: #f9a8d4;
}

body.dark-mode .badge-gender-d {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

/* In-line Player Editing Styles */
.badge-clickable {
    cursor: pointer;
    transition: transform 0.1s, filter 0.2s;
}

.badge-clickable:hover {
    filter: brightness(0.95);
    transform: translateY(-1px);
}

.badge-clickable:active {
    transform: translateY(0);
}

/* Gender Selection Grid */
.gender-selection-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 4px;
}

.gender-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 10px 6px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.gender-btn:hover {
    background: rgba(13,148,136,0.07);
    border-color: var(--color-primary);
}

.gender-btn.active {
    background: var(--brand-secondary);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.gender-icon {
    font-size: var(--fs-xl);
    font-weight: var(--weight-strong);
}

.gender-label {
    font-size: var(--fs-xs);
    font-weight: var(--weight-medium);
    color: #64748b;
}

/* Gender active state – unified brand color */
.gender-btn.active .gender-icon,
.gender-btn.active .gender-label {
    color: inherit;
}

.gender-btn.active .gender-label {
    color: inherit;
    opacity: 0.85;
}

/* M */
.gender-btn:nth-child(1).active {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1d4ed8;
}

/* W */
.gender-btn:nth-child(2).active {
    background: #fff1f2;
    border-color: #f43f5e;
    color: #be123c;
}

/* D */
.gender-btn:nth-child(3).active {
    background: #f5f3ff;
    border-color: #7c3aed;
    color: #5b21b6;
}

/* ? */
.gender-btn:nth-child(4).active {
    background: #f1f5f9;
    border-color: #64748b;
    color: #334155;
}

/* Dark Mode: gender-btn */
body.dark-mode .gender-btn {
    background: rgba(30,41,59,0.9) !important;
    border-color: rgba(255,255,255,0.1) !important;
    color: #e2e8f0 !important;
}
body.dark-mode .gender-btn:hover {
    background: rgba(13,148,136,0.15) !important;
    border-color: rgba(45,212,191,0.5) !important;
}
body.dark-mode .gender-label {
    color: #94a3b8 !important;
}
/* Active states in dark mode */
body.dark-mode .gender-btn:nth-child(1).active {
    background: rgba(59,130,246,0.2) !important;
    border-color: #3b82f6 !important;
    color: #93c5fd !important;
}
body.dark-mode .gender-btn:nth-child(2).active {
    background: rgba(244,63,94,0.2) !important;
    border-color: #f43f5e !important;
    color: #fda4af !important;
}
body.dark-mode .gender-btn:nth-child(3).active {
    background: rgba(124,58,237,0.2) !important;
    border-color: #7c3aed !important;
    color: #c4b5fd !important;
}
body.dark-mode .gender-btn:nth-child(4).active {
    background: rgba(100,116,139,0.2) !important;
    border-color: #64748b !important;
    color: #cbd5e1 !important;
}

/* Dashbord Specific Styles */
.player-dashboard-outer {
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(-10px);
    position: relative;
    z-index: 1001; /* Higher than player-view-sticky-header to stay visible during opening transition */
    scroll-margin-top: 150px; /* Offset for scrollIntoView fallback */
}

.player-dashboard-outer.open {
    max-height: calc(100vh - 140px);
    /* Limit height to stay within viewport */
    overflow-y: auto;
    /* Enable internal scrolling */
    overscroll-behavior: contain;
    /* Prevent background scrolling */
    opacity: 1;
    transform: translateY(0);
    margin: 15px;
    padding-right: 5px;
    /* Room for scrollbar */

    /* Scrollbar Styling */
    scrollbar-width: thin;
    scrollbar-color: rgba(13, 148, 136, 0.3) transparent;
}

.player-dashboard-outer.open::-webkit-scrollbar {
    width: 6px;
}

.player-dashboard-outer.open::-webkit-scrollbar-track {
    background: transparent;
}

.player-dashboard-outer.open::-webkit-scrollbar-thumb {
    background-color: rgba(13, 148, 136, 0.3);
    border-radius: 10px;
}

body.dark-mode .player-dashboard-outer.open::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.1);
}

.player-dashboard-inner {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
}

body.dark-mode .player-dashboard-inner {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Standardized Dashboard Indicators */
.dashboard-indicator-banner {
    background: rgba(13, 148, 136, 0.1);
    color: var(--primary-strong);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: var(--fs-base);
    font-weight: var(--weight-strong);
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(13, 148, 136, 0.2);
}

body.dark-mode .dashboard-indicator-banner {
    background: rgba(13, 148, 136, 0.15);
    color: #2dd4bf;
    border-color: rgba(13, 148, 136, 0.3);
}

.dashboard-dot {
    width: 10px;
    height: 10px;
    background: var(--color-primary);
    border-radius: 50%;
    flex-shrink: 0;
}

body.dark-mode .dashboard-dot {
    background: var(--color-primary);
    box-shadow: 0 0 10px rgba(13, 148, 136, 0.5);
}

.dashboard-input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
    background: rgba(248, 250, 252, 0.5);
    transition: all 0.2s;
}

body.dark-mode .dashboard-input-group {
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(255, 255, 255, 0.1);
}

.dashboard-input-group:focus-within {
    border-color: var(--brand-primary);
    background: white;
}

body.dark-mode .dashboard-input-group:focus-within {
    background: rgba(15, 23, 42, 0.6);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.dashboard-textarea {
    width: 100%;
    height: 90px;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: var(--fs-base);
    resize: none;
    transition: all 0.2s;
}

.dashboard-textarea:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
    outline: none;
}

.anon-title {
    display: block;
    font-size: var(--fs-xs);
    font-weight: var(--weight-bold);
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}/* Regel entfernt 23.08.2026 — Selektoren ohne Ziel: .wheel-picker */

.wheel-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: white;
    color: var(--brand-primary);
    font-size: var(--fs-3xl);
    font-weight: var(--weight-bold);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.wheel-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.wheel-value {
    font-size: var(--fs-3xl);
    font-weight: var(--weight-strong);
    color: var(--brand-primary);
    min-width: 30px;
    text-align: center;
}

.dashboard-chips-outer {
    border-top: 1px solid #f1f5f9;
    padding-top: 10px;
    margin-top: 10px;
}

.chips-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.chips-title {
    font-size: var(--fs-sm);
    font-weight: var(--weight-strong);
    color: #64748b;
    letter-spacing: 0.05em;
}

.dashboard-batch-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
}

.bulk-actions-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s;
    pointer-events: none;
}

.bulk-actions-group.visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.dashboard-main-actions {
    display: flex;
    gap: 10px;
}

#finalize-dashboard-btn {
    background: rgba(13, 148, 136, 0.1) !important;
    color: var(--primary-strong) !important;
    border: 1px solid rgba(13, 148, 136, 0.2) !important;
    font-weight: var(--weight-strong) !important;
    transition: all 0.2s;
}

#finalize-dashboard-btn:hover:not(:disabled) {
    background: rgba(13, 148, 136, 0.2) !important;
    transform: translateY(-1px);
}

body.dark-mode #finalize-dashboard-btn {
    background: rgba(13, 148, 136, 0.15) !important;
    color: #2dd4bf !important;
    border-color: rgba(13, 148, 136, 0.4) !important;
}

body.dark-mode #finalize-dashboard-btn:hover:not(:disabled) {
    background: rgba(13, 148, 136, 0.25) !important;
}

#add-player-main-btn {
    background: rgba(13, 148, 136, 0.1) !important;
    color: var(--primary-strong) !important;
    border: 1px solid rgba(13, 148, 136, 0.2) !important;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#add-player-main-btn:hover {
    background: rgba(13, 148, 136, 0.2) !important;
    transform: scale(1.05);
}

body.dark-mode #add-player-main-btn {
    background: rgba(13, 148, 136, 0.15) !important;
    color: #2dd4bf !important;
    border-color: rgba(13, 148, 136, 0.4) !important;
}

body.dark-mode #add-player-main-btn:hover {
    background: rgba(13, 148, 136, 0.25) !important;
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Enhanced Dashboard Selects */
.prominent-options {
    background: transparent;
    border: none;
    box-shadow: none;
}

.dashboard-select {
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background-color: white;
    font-size: var(--fs-lg);
    color: #334155;
    font-weight: var(--weight-medium);
    transition: all 0.2s;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

.dashboard-select:hover {
    border-color: #94a3b8;
    background-color: #ffffff;
}

.dashboard-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.dashboard-select:disabled {
    background-color: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.7;
}

body.dark-mode .prominent-options {
    background: transparent;
    border: none;
}

body.dark-mode .dashboard-select {
    background-color: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

body.dark-mode .dashboard-select:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background-color: rgba(30, 41, 59, 0.8);
}

body.dark-mode .dashboard-select:focus {
    border-color: var(--brand-primary);
    background-color: rgba(30, 41, 59, 1);
}

@media (max-width: 768px) {
    .prominent-options {
        grid-template-columns: 1fr !important;
    }
}


/* Phase 11: True Overlay Search (Absolute Detachment) */

/* 1. Global Reset for Filter Chips */
.filter-chip {
    margin: 0 !important;
    /* Remove browser default margins */
}

/* 2. Anchor Wrapper */
.players-search-wrapper {
    display: flex !important;
    align-items: center;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    position: relative !important;
    /* Anchor for absolute input */
    overflow: visible !important;
}

/* 3. Mobile Overlay Logic (< 900px) */
@media (max-width: 899px) {

    /* Wrapper: Strictly Icon Width */
    .players-search-wrapper {
        width: 24px !important;
        flex: 0 0 24px !important;
    }

    /* Icon: Always visible on top (z-index 101) */
    .players-search-icon {
        position: absolute !important;
        left: 2px !important;
        z-index: 101 !important;
        /* Above the input background */
        pointer-events: none !important;
        /* Clicks pass to input */
    }

    /* Input: Ghost Layer (Absolute) */

    /* Active State: Expansion */
}

/* Player Search Dropdown (v2.0.9) */
.search-trigger-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-body);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-right: 4px;
    /* Space from Team button */
}

.search-trigger-btn:hover {
    background: var(--bg-hover);
    color: var(--brand-primary);
    border-color: var(--brand-primary);
    transform: translateY(-1px);
}

.search-trigger-btn.active {
    background: var(--primary-fill-bg);
    color: var(--primary-fill-fg);
    border-color: var(--primary-fill-border);
    box-shadow: 0 4px 6px -1px rgba(13, 148, 136, 0.2);
}

.player-search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 280px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.player-search-dropdown.open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.search-dropdown-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: var(--fs-lg);
    outline: none;
    transition: border-color 0.2s;
    background: #f8fafc;
}

.search-dropdown-input:focus {
    background: white;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

/* Dark mode support */
body.dark-mode .player-search-dropdown {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

body.dark-mode .search-trigger-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
}

body.dark-mode .search-trigger-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--brand-primary);
}

body.dark-mode .search-trigger-btn.active {
    background: var(--primary-fill-bg);
    color: var(--primary-fill-fg);
}

body.dark-mode .search-dropdown-input {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
    color: white;
}

body.dark-mode .search-dropdown-input:focus {
    background: rgba(15, 23, 42, 0.8);
    border-color: var(--brand-primary);
}

/* Premium Phase UI Redesign */
.phase-wiz-green-section {
    background: #f0fdf4 !important;
    border: 1px solid #bbf7d0 !important;
    border-radius: 12px !important;
    padding: 15px !important;
}

body.dark-mode .phase-wiz-green-section {
    background: rgba(16, 185, 129, 0.05) !important;
    border-color: rgba(16, 185, 129, 0.2) !important;
}

.phase-wiz-green-header {
    color: var(--primary-strong) !important;
    font-weight: var(--weight-strong) !important;
    font-size: var(--fs-xs) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    margin-bottom: 12px !important;
    display: block !important;
    border-bottom: 1px solid rgba(13, 148, 136, 0.1);
    padding-bottom: 6px;
}

.wiz-part-desc {
    font-size: var(--fs-xs);
    color: #64748b;
    margin-top: 2px;
    margin-left: 24px;
    display: block;
    line-height: 1.3;
}

body.dark-mode .phase-wiz-green-header {
    color: #34d399 !important;
}

/* Premium Toggle Switch ("Regler") */

/* Round Header Toolbar */
.round-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding-right: 8px !important;
}

.round-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
}

.round-tool-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: var(--fs-xs);
    font-weight: var(--weight-bold);
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(13, 148, 136, 0.08);
    color: var(--primary-strong);
    border: 1px solid rgba(13, 148, 136, 0.15);
}

.round-tool-btn:hover {
    background: rgba(13, 148, 136, 0.15);
    transform: translateY(-1px);
}

.round-tool-btn:active {
    transform: translateY(0);
}

.round-tool-btn svg {
    opacity: 0.8;
}

.round-tool-btn.accent {
    background: rgba(139, 92, 246, 0.08);
    color: var(--primary-strong);
    border-color: rgba(139, 92, 246, 0.15);
}

.round-tool-btn.accent:hover {
    background: rgba(139, 92, 246, 0.15);
}

body.dark-mode .round-tool-btn {
    background: rgba(45, 212, 191, 0.12);
    color: #2dd4bf;
    border-color: rgba(45, 212, 191, 0.2);
}

body.dark-mode .round-tool-btn.accent {
    background: rgba(167, 139, 250, 0.12);
    color: #a78bfa;
    border-color: rgba(167, 139, 250, 0.2);
}

/* ============================================
   GLOBAL STEPPER & LABS UI COMPONENTS
   ============================================ */
.labs-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 0;
    border: 1px solid var(--border-color);
    height: 40px !important;
    box-sizing: border-box !important;
    overflow: hidden;
}

.labs-stepper-btn {
    width: 28px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #64748b;
    font-size: var(--fs-2xl);
    font-weight: var(--weight-strong) !important;
    line-height: 1 !important;
    cursor: pointer;
    transition: all 0.2s;
    /* Ohne das wertet iPhone-Safari zwei schnelle Tipper als Doppeltipp und zoomt hinein
       (gemeldet 06.10.2026 im Schiri-Ergebnis). manipulation laesst Rollen und
       Zwei-Finger-Zoom zu und schaltet nur den Doppeltipp-Zoom ab. */
    touch-action: manipulation;
}

/* Auch Wert und Zwischenraeume: Wer schnell tippt, trifft nicht immer den Knopf. */
.labs-stepper-compact {
    touch-action: manipulation;
}

.labs-stepper-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.labs-stepper-btn:active {
    transform: scale(0.9);
}

.labs-stepper-value {
    font-size: var(--fs-xl);
    font-weight: var(--weight-strong);
    color: var(--stepper-value);
    flex: 1;
    text-align: center;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    line-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.labs-label {
    font-size: var(--fs-2xs) !important;
    font-weight: var(--weight-strong) !important;
    color: #94a3b8 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 8px !important;
}

.no-margin {
    margin: 0 !important;
    padding: 0 !important;
}

/* DARK MODE SUPPORT FOR STEPPERS */
body.dark-mode .labs-stepper {
    background: var(--bg-card);
    border-color: var(--border-color);
}

body.dark-mode .labs-stepper-btn {
    color: #94a3b8;
    background: transparent !important;
    border-color: transparent !important;
}

body.dark-mode .labs-stepper-btn:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #f1f5f9;
}

/* Die Zahl im Stepper. `!important` und der zusätzliche Modal-Selektor sind nötig, weil
   im Phasen-Editor spezifischere Regeln (#phase-wizard-modal …) die Farbe sonst
   überschreiben – dort standen die Zahlen dunkelgrau auf dunklem Grund.
   Der Wert kommt aus --stepper-value, damit Phasen-Editor und Planungshilfe
   nicht auseinanderlaufen. */
body.dark-mode .labs-stepper-value,
body.dark-mode #phase-wizard-modal .labs-stepper-value {
    color: var(--stepper-value) !important;
}

body.dark-mode .labs-label {
    color: rgba(255, 255, 255, 0.4) !important;
}

/* ── labs-stepper-compact: Inline-Stepper aus renderLabsStepperField ── */
.labs-stepper-compact {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
}
body.dark-mode .labs-stepper-compact {
    background-color: var(--bg-card);
    border-color: var(--border-color);
}

/* Phasen-Editor-Modal: Inline-Stepper (renderLabsStepperField) auf die Wizard-Maße bringen
   (stepperRow im Wizard: 32px-Buttons, radius 10, Wert 15px/800, weißer Grund, 1.5px-Rahmen).
   Gilt fürs GANZE Editor-Modal, damit alle Stepper (Struktur, Punkte, Planung) gleich groß
   sind wie im Wizard – die 24px-Inline-Maße von renderLabsStepperField werden überschrieben. */
#phase-wizard-modal .labs-stepper-compact {
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 10px !important;
    background-color: var(--bg-card) !important;
    padding: 3px !important;
}
#phase-wizard-modal .labs-stepper-compact .labs-stepper-btn {
    width: 32px !important;
    height: 32px !important;
    font-size: var(--fs-2xl) !important;
    color: var(--text-body) !important;
}
#phase-wizard-modal .labs-stepper-compact .labs-stepper-value {
    min-width: 36px !important;
    font-size: var(--fs-lg) !important;
    font-weight: var(--weight-strong) !important;
}
body.dark-mode #phase-wizard-modal .labs-stepper-compact {
    background-color: var(--bg-card) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

/* Schiedsrichter-Modal Dunkelmodus: Stepper-Werte hell wie der übrige Text (bis 26.09.2026 türkis;
   seit der Gestaltung „Kacheln auf ruhigem Grund“ ist die Zahl der große, ruhige Wert und Türkis
   bleibt dem Hauptschritt). Schlägt die globale Regel `.dark-mode-styled * { color:#e2e8f0!important }`. */
body.dark-mode #referee-modal .labs-stepper-value {
    color: #f1f5f9 !important;
}
/* Stepper-Kasten: nur dezenter Rahmen, keine graue Füllung hinter den +/- */
body.dark-mode #referee-modal .labs-stepper-compact {
    background-color: transparent !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}
/* Vergehen-Zusammenfassung (1. Satz / Gesamt): nur die Beschriftung leise — die Zahlen sind
   seit 26.09.2026 auch im Hellmodus gut lesbar (vorher #cbd5e1 auf Weiß, 1,5:1). */
body.dark-mode #referee-modal #ref-violation-period-label {
    color: #8b98ab !important;
}

/* ── labs-field-wrapper-bordered: Bordered-Variante von renderLabsStepperField ── */
.labs-field-wrapper-bordered {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}
body.dark-mode .labs-field-wrapper-bordered {
    background: var(--bg-card);
    border-color: rgba(255, 255, 255, 0.1);
}

/* ── wiz-list-container: Weiße Tabellen/Listen im Wizard ───────────── */
.wiz-list-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}
body.dark-mode .wiz-list-container {
    background: var(--bg-card);
    border-color: rgba(255, 255, 255, 0.08);
}

/* ── wiz-info-box: Graue Info-Karten im Wizard ─────────────────────── */
.wiz-info-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}
body.dark-mode .wiz-info-box {
    background: rgba(15, 23, 42, 0.5);
    border-color: rgba(255, 255, 255, 0.08);
}

/* ── wiz-plan-class-chip: Klassen-Chips ────────────────────────────── */
.wiz-plan-class-chip {
    background: #f8fafc;
    color: #334155;
    border: 1.5px solid #e2e8f0;
}
body.dark-mode .wiz-plan-class-chip {
    background: rgba(15, 23, 42, 0.5);
    color: #94a3b8;
    border-color: rgba(255, 255, 255, 0.1);
}

/* ── wiz-plan-level-card: Karten in der Level-Planung ──────────────── */
.wiz-plan-level-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}
body.dark-mode .wiz-plan-level-card {
    background: var(--bg-card);
    border-color: rgba(255, 255, 255, 0.08);
}

/* ── wiz-suggestion-card: Vorschlagskarten im Schleifchen-Planer ────── */
.wiz-suggestion-card {
    background: #ffffff;
    border: 2px solid #e2e8f0;
}
.wiz-suggestion-card.active {
    background: rgba(13, 148, 136, 0.08);
    border-color: var(--color-primary);
}
body.dark-mode .wiz-suggestion-card {
    background: var(--bg-card);
    border-color: rgba(255, 255, 255, 0.1);
}
body.dark-mode .wiz-suggestion-card.active {
    background: rgba(13, 148, 136, 0.12);
    border-color: var(--color-primary);
}

/* ── wiz-placeholder-box: Leerer Platzhalter-Bereich ────────────────── */
.wiz-placeholder-box {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
}
body.dark-mode .wiz-placeholder-box {
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(255, 255, 255, 0.15);
}

/* ── wiz-breakdown-thead-row: Tabellenkopfzeile im Breakdown ─────────── */
.wiz-breakdown-thead-row {
    background: #f8fafc;
}
body.dark-mode .wiz-breakdown-thead-row {
    background: rgba(15, 23, 42, 0.5);
}

/* ── wiz-rule-item: Regelzeile in der Fairplay-/Regelkarte ──────────── */
.wiz-rule-item {
    background: #ffffff;
}
body.dark-mode .wiz-rule-item {
    background: var(--bg-card);
}

/* ── quick-pool-assignment-badge: Einsatz-Zähler auf Pool-Chip ───────── */
.quick-pool-assignment-badge {
    background: #ffffff;
    color: #64748b;
    border: 1px solid #e2e8f0;
}
body.dark-mode .quick-pool-assignment-badge {
    background: var(--bg-card);
    color: #94a3b8;
    border-color: rgba(255, 255, 255, 0.15);
}

/* ── wiz-ko-pot: LosTopf im K.O.-Seeding ────────────────────────────── */
.wiz-ko-pot {
    background: #f8fafc;
}
body.dark-mode .wiz-ko-pot {
    background: rgba(15, 23, 42, 0.5);
}

/* ── wiz-ko-team-item: Teilnehmer-Karte im K.O.-Topf ────────────────── */
.wiz-ko-team-item {
    background: #ffffff;
    border: 1px solid #e8eef4;
}
body.dark-mode .wiz-ko-team-item {
    background: var(--bg-card);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e2e8f0 !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   PHASE 2+: Body-Level Modal Dark-Mode-Klassen
   ═══════════════════════════════════════════════════════════════════════ */

/* ── wiz-modal-card: Weißes Modal-Fenster (body-level Overlays) ─────── */
.wiz-modal-card {
    background: #ffffff;
}
body.dark-mode .wiz-modal-card {
    background: var(--bg-card);
}

/* ── wiz-modal-header: Grauer Modal-Header-Streifen ─────────────────── */
.wiz-modal-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
body.dark-mode .wiz-modal-header {
    background: rgba(15, 23, 42, 0.6);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

/* ── tp-modal-head: EIN kompakter Kopf für die Anmeldelink-Dialoge ──────
   Vorher setzte jeder Dialog Polsterung und Aufbau inline — gemessen 59 px,
   69 px und 72 px hohe Köpfe für dieselbe Sache. Untertitel steht jetzt in
   DERSELBEN Zeile (spart eine Zeile) und entfällt auf schmalen Geräten,
   wo der Zusammenhang ohnehin aus dem Kontext kommt. */
.tp-modal-head {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 9px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-shrink: 0;
}
body.dark-mode .tp-modal-head {
    background: rgba(15, 23, 42, 0.6);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}
.tp-modal-head .tp-modal-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
    font-size: var(--fs-lg);
    font-weight: var(--weight-strong);
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tp-modal-head .tp-modal-sub {
    font-size: var(--fs-xs);
    font-weight: var(--weight-medium);
    color: var(--text-subtle);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.tp-modal-head .tp-modal-close {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-subtle);
    font-size: var(--fs-xl);
    line-height: 1;
    border-radius: 8px;
}
.tp-modal-head .tp-modal-close:hover {
    background: rgba(148, 163, 184, 0.15);
}

/* ── tp-steps: Schrittleiste des Anmeldelink-Assistenten ──────────────
   Auf schmalen Geräten bleibt nur der Titel des AKTIVEN Schritts stehen;
   die übrigen Schritte sind an ihren Nummern erkennbar. Das verhindert
   waagerechtes Scrollen und spart eine gute Zeile Höhe. */
.tp-steps {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-bottom: 1px solid var(--surface-soft);
    overflow-x: auto;
    flex-shrink: 0;
}
.tp-steps .tp-step {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 2px;
    flex-shrink: 0;
    cursor: pointer;
}
.tp-steps .tp-step-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: var(--fs-xs);
    font-weight: var(--weight-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tp-steps .tp-step-title {
    font-size: var(--fs-sm);
    white-space: nowrap;
}

@media (max-width: 430px) {
    .tp-modal-head { padding: 8px 12px; }
    .tp-modal-head .tp-modal-sub { display: none; }
    .tp-steps { padding: 5px 12px; gap: 6px; }
    .tp-steps .tp-step-title { display: none; }
    .tp-steps .tp-step-title.is-active { display: inline; }
    /* Platz-Kacheln einspaltig — zweispaltig blieben bei 375 px nur 125 px
       je Kachel, in denen jeder Teamname abgeschnitten wurde. */
    .tp-slot-grid { grid-template-columns: 1fr !important; }
}

/* ── Rhythmus-Dialog des Terminkalenders ───────────────────────────────
   Am 06.09.2026 aufgeräumt. Gemessen vorher, zwei Spieltage, 900 px Fenster:
   Dialog 857 px, Mittwoch-Block 200 px (50 Inhalt, 150 Rahmen), Samstag-Block
   215 px (107 Inhalt, 108 Rahmen). Der Rahmen kostete mehr als der Inhalt.

   Weggefallen ist nur Rahmenwerk: die Karte je Wochentag und die Karte je
   Zeitzeile. Alles, was vorher zu lesen war, steht weiterhin da. */
.tp-rhy-frage {
    font-size: var(--fs-base);
    font-weight: var(--weight-strong);
    color: var(--text-strong);
}

.tp-rhy-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.tp-rhy-chip {
    min-width: 46px;
    height: 36px;
    border: 1px solid var(--border-strong);
    border-radius: var(--gestalt-knopf-radius);
    background: var(--bg-card);
    color: var(--text-body);
    font-size: var(--fs-md);
    font-weight: var(--weight-strong);
    cursor: pointer;
}

.tp-rhy-chip.ist-an {
    border-color: var(--primary-strong);
    background: var(--primary-fill-bg);
    color: var(--primary-fill-fg);
}

/* Ein Wochentag ist ein Abschnitt, keine Karte mehr. Die dünne Linie oben
   trennt ausreichend — der Kartenrand kostete Rand, Polster und Grundfarbe. */
.tp-rhy-tag { border-top: 1px solid var(--border-color); padding-top: 10px; }

.tp-rhy-kopf {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.tp-rhy-name {
    font-size: var(--fs-base);
    font-weight: var(--weight-strong);
    color: var(--text-strong);
}

/* Takt und Startpunkt stehen in der Kopfzeile des Wochentags statt in zwei
   eigenen Zeilen darunter. */
.tp-rhy-takt {
    height: 30px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-secondary);
    padding: 0 7px;
    font-size: var(--fs-sm);
    font-weight: var(--weight-strong);
    cursor: pointer;
}

.tp-rhy-abzeile {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: var(--fs-sm);
    font-weight: var(--weight-strong);
    color: var(--text-subtle);
}

.tp-rhy-ab {
    height: 30px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    padding: 0 7px;
    font-size: var(--fs-sm);
    font-weight: var(--weight-strong);
    color: var(--text-strong);
    background: var(--bg-card);
}

.tp-rhy-zeiten { display: flex; flex-direction: column; }

/* Zwei feste Griffe — Uhrzeit und Anzahl — und ein „…" für das Seltene. */
.tp-rhy-zeile {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    min-height: 34px;
}

.tp-rhy-zeit {
    width: 92px;
    height: 32px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    padding: 0 7px;
    font-size: var(--fs-md);
    font-weight: var(--weight-strong);
    color: var(--text-secondary);
    background: var(--bg-card);
    flex-shrink: 0;
}

.tp-rhy-zaehler {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-card);
    flex-shrink: 0;
}

.tp-rhy-zaehler button {
    width: 28px;
    height: 30px;
    border: none;
    background: var(--surface-page);
    color: var(--text-body);
    font-weight: var(--weight-strong);
    cursor: pointer;
}

.tp-rhy-zaehler button:first-child { border-right: 1px solid var(--border-color); }
.tp-rhy-zaehler button:last-child { border-left: 1px solid var(--border-color); }

.tp-rhy-zaehler > span {
    width: 32px;
    text-align: center;
    font-size: var(--fs-md);
    font-weight: var(--weight-strong);
    color: var(--primary-strong);
}

/* „nacheinander" steht als Wort in der Zeile, sobald es von der Vorgabe
   abweicht — die Angabe verschwindet also nicht mit dem Bedienelement.
   Dieselbe Regel wie beim Kader-Chip: nur zeigen, wo es etwas sagt. */
.tp-rhy-wort {
    flex: 1;
    min-width: 0;
    font-size: var(--fs-sm);
    font-weight: var(--weight-strong);
    color: var(--text-subtle);
}

.tp-rhy-mehr {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--text-body);
    font-size: var(--fs-lg);
    font-weight: var(--weight-strong);
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.tp-rhy-plus {
    margin-top: 2px;
    border: none;
    background: transparent;
    color: var(--primary-strong);
    padding: 4px 2px;
    font-size: var(--fs-md);
    font-weight: var(--weight-strong);
    cursor: pointer;
}

.tp-rhy-leer {
    border: 1px dashed var(--border-strong);
    border-radius: var(--gestalt-karte-radius);
    padding: 14px;
    text-align: center;
    font-size: var(--fs-md);
    font-weight: var(--weight-strong);
    color: var(--text-body);
}

.tp-rhy-bis {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
    font-size: var(--fs-sm);
    font-weight: var(--weight-strong);
    color: var(--text-body);
}

.tp-rhy-fussnote {
    font-size: var(--fs-sm);
    font-weight: var(--weight-strong);
    color: var(--text-body);
    line-height: 1.5;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

/* Dunkelmodus. NOETIG, weil `body.dark-mode button` jeden Knopf ohne
   Inline-`background:var(` grau uebermalt — hier wird alles ueber Klassen
   gestaltet. Diese Ausnahme ist beim Umstellen auf CSS-Klassen schon dreimal
   verlorengegangen; deshalb steht sie diesmal gleich mit da. */
body.dark-mode .tp-rhy-chip { background: var(--bg-card) !important; color: var(--text-body) !important; }
body.dark-mode .tp-rhy-chip.ist-an { background: var(--primary-fill-bg) !important; color: var(--primary-fill-fg) !important; }
body.dark-mode .tp-rhy-zaehler button { background: var(--surface-page) !important; color: var(--text-body) !important; }
body.dark-mode .tp-rhy-mehr { background: var(--surface-soft) !important; color: var(--text-body) !important; }
body.dark-mode .tp-rhy-plus { background: transparent !important; color: var(--primary-strong) !important; }

/* ── tp-link-row: Zeile eines erstellten Anmeldelinks ──────────────────
   Am 06.09.2026 aufgeräumt. Vorher: 10 Bedienelemente je Link (5 in der Zeile,
   3 in einem eingebauten Aufklapper, dazu Aufklapp-Pfeil und Antworten-Knopf)
   und bis zu fünf gestapelte Textzeilen — gemessen 149 px je Zeile im echten
   Dialog. Jetzt zwei Griffe, „Teilen" und „…", und zwei Textzeilen.

   Der Aufklapp-Pfeil und der Antworten-Knopf bleiben in der Zeile: Sie führen
   zum INHALT des Links, nicht zu seiner Verwaltung. */
.tp-link-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 4px;
    transition: background 0.2s;
}

/* Ein gesperrter Link ist nicht kaputt, nur still — gedimmt statt eingefärbt.
   Vorher trug er eine eigene Hintergrundfarbe und sah aus wie eine Warnung. */
.tp-link-row.ist-gesperrt { opacity: 0.62; }

.tp-link-pfeil {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tp-link-mitte { flex: 1; min-width: 0; }

.tp-link-kopf { display: flex; align-items: center; gap: 7px; min-width: 0; }

.tp-link-name {
    font-weight: var(--weight-strong);
    font-size: var(--fs-base);
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tp-link-art {
    flex-shrink: 0;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: var(--fs-xs);
    font-weight: var(--weight-strong);
    color: var(--text-body);
    background: var(--surface-soft);
}

.tp-link-art.ist-topf {
    color: var(--primary-strong);
    background: var(--primary-soft-bg);
}

/* Status, Datum, Code, Anmeldeschluss und Antworten stehen in EINER Zeile und
   umbrechen erst, wenn der Platz wirklich nicht reicht. */
.tp-link-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 2px;
    font-size: var(--fs-xs);
    color: var(--text-subtle);
}

.tp-link-punkt {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-primary);
    display: inline-block;
}

.tp-link-punkt.ist-aus { background: var(--text-subtle); }

.tp-link-antworten {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 9px;
    border: 1px solid var(--border-color);
    background: transparent;
    border-radius: var(--gestalt-knopf-radius);
    cursor: pointer;
    font-size: var(--fs-xs);
    font-weight: var(--weight-strong);
    color: var(--text-body);
}

/* Wartet etwas auf Prüfung, ist das die einzige Stelle der Zeile, die ruft — in Tinte (wartet auf dich, 28.09.2026). */
.tp-link-antworten.ist-offen {
    border-color: #1e293b;
    background: #1e293b;
    color: #ffffff;
}

.tp-link-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.tp-link-teilen {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1px solid var(--border-success-subtle);
    border-radius: 9px;
    background: var(--accent-green-bg);
    color: var(--text-success);
    font-size: var(--fs-sm);
    font-weight: var(--weight-strong);
    cursor: pointer;
}

.tp-link-mehr {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--text-body);
    font-size: var(--fs-lg);
    font-weight: var(--weight-strong);
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Auf schmalen Geräten drängten früher fünf Knöpfe den Namen auf 64 px
   zusammen (gemessen bei 375 px). Mit zwei Griffen passt die Zeile — nur die
   Beschriftung „Teilen" weicht dem Symbol (.tp-btn-label-wide). */
@media (max-width: 520px) {
    .tp-link-teilen { padding: 7px 9px; }
}

/* ── Teilen-Blatt: Link, QR und fertige Nachricht an einer Stelle ──────
   Ersetzt den eingebauten `position:absolute`-Aufklapper der Zeile, der einen
   rohen z-index (100) an der Leiter vorbei trug und beim Scrollen mitwanderte.
   Es geht AUS einem Dialog auf, also --z-dialog-2. */
.tp-teilen-schale {
    position: fixed;
    inset: 0;
    z-index: var(--z-dialog-2);
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.tp-teilen {
    width: 340px;
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-card);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    text-align: center;
}

.tp-teilen-kopf {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    text-align: left;
    margin-bottom: 12px;
}

.tp-teilen-kopf h3 {
    margin: 0;
    font-size: var(--fs-lg);
    font-weight: var(--weight-strong);
    color: var(--text-main);
}

.tp-teilen-unterzeile {
    font-size: var(--fs-xs);
    color: var(--text-subtle);
    margin-top: 1px;
}

.tp-teilen-zu {
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: var(--text-subtle);
    font-size: var(--fs-3xl);
    line-height: 1;
    padding: 0 2px;
    cursor: pointer;
}

.tp-teilen-feld {
    width: 100%;
    box-sizing: border-box;
    padding: 9px;
    font-family: monospace;
    font-size: var(--fs-xs);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: var(--surface-page);
    color: var(--text-body);
    outline: none;
}

/* Der QR-Code braucht seinen weissen Grund, auch im Dunkelmodus — sonst liest
   ihn keine Kamera mehr. Das ist kein vergessener Dunkelmodus, sondern Absicht. */
.tp-teilen-qr {
    display: inline-block;
    background: #ffffff;
    padding: 7px;
    border-radius: 10px;
    line-height: 0;
    margin: 12px 0 6px;
}

.tp-teilen-hinweis {
    font-size: var(--fs-2xs);
    color: var(--text-subtle);
    margin-bottom: 12px;
}

.tp-teilen-tat {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--text-body);
    font-size: var(--fs-sm);
    font-weight: var(--weight-strong);
    cursor: pointer;
    margin-top: 7px;
}

/* Der nackte Link ist der haeufigere Griff und steht deshalb zuerst und kraeftiger. */
.tp-teilen-tat.ist-erste {
    background: var(--primary-fill-bg);
    color: var(--primary-fill-fg);
}

/* Dunkelmodus fuer die Anmeldelink-Zeile und das Teilen-Blatt.
   NOETIG, weil `body.dark-mode button` jeden Knopf ohne Inline-`background:var(`
   grau uebermalt — die Knoepfe hier werden ueber Klassen gestaltet. Genau diese
   Ausnahme ist beim Umstellen auf CSS-Klassen schon dreimal verlorengegangen. */
body.dark-mode .tp-link-pfeil { background: transparent !important; color: var(--text-subtle) !important; }
body.dark-mode .tp-link-mehr { background: var(--surface-soft) !important; color: var(--text-body) !important; }
body.dark-mode .tp-link-teilen { background: var(--accent-green-bg) !important; color: var(--text-success) !important; }
body.dark-mode .tp-link-antworten { background: transparent !important; color: var(--text-body) !important; }
body.dark-mode .tp-link-antworten.ist-offen { background: #e2e8f0 !important; border-color: #e2e8f0 !important; color: #0f172a !important; }
body.dark-mode .tp-teilen-zu { background: transparent !important; color: var(--text-subtle) !important; }
body.dark-mode .tp-teilen-tat { background: var(--surface-soft) !important; color: var(--text-body) !important; }
body.dark-mode .tp-teilen-tat.ist-erste { background: var(--primary-fill-bg) !important; color: var(--primary-fill-fg) !important; }

/* ── wiz-selectable-item: Auswählbare Zeile in Modal-Listen ─────────── */
.wiz-selectable-item {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
}
body.dark-mode .wiz-selectable-item {
    background: var(--bg-card);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}
body.dark-mode .wiz-selectable-item .wiz-selectable-title,
body.dark-mode .wiz-selectable-item > div {
    color: #e2e8f0;
}

/* ── tp-pick: der gemeinsame Auswahl-Dialog (entity-picker.js) ──────────
   Loest die vier handgebauten „Team waehlen"-Dialoge ab. Deren Farben standen
   als 18 isDarkMode-Hexpaare IM JavaScript — unsichtbar fuer pruefe-farben.js,
   das jedes style="…" mit isDark/darkMode/dark-mode ueberspringt. Hier stehen
   sie als Token, damit der Waechter sie wieder sieht. */
.tp-pick-overlay {
    /* Sprosse „Waehler, die AUS einem Dialog aufgehen" — der Picker geht z.B. aus
       dem Phasen-Editor auf. Die Loeschwarnung darueber liegt auf --z-meldung. */
    position: fixed; inset: 0; z-index: var(--z-dialog-2);
    display: flex; align-items: center; justify-content: center;
    padding: 20px; box-sizing: border-box;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
}
.tp-pick-card {
    display: flex; flex-direction: column;
    width: 100%; max-width: 460px; max-height: 80vh;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px; overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Kopf */
.tp-pick-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-color);
}
.tp-pick-head-text { min-width: 0; }
.tp-pick-title { font-size: var(--fs-lg); font-weight: var(--weight-bold); color: var(--text-main); }
.tp-pick-sub {
    margin-top: 2px; font-size: var(--fs-xs); font-weight: var(--weight-medium);
    color: var(--text-subtle);
}
.tp-pick-x {
    flex-shrink: 0; width: 32px; height: 32px; line-height: 1;
    background: none; border: none; cursor: pointer;
    font-size: var(--fs-3xl); color: var(--text-subtle);
    border-radius: 8px; transition: background 0.15s, color 0.15s;
}
.tp-pick-x:hover { background: var(--surface-soft); color: var(--text-main); }

/* Werkzeugleiste: Suche + Mehrfach-Schalter */
.tp-pick-tools {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 16px 8px;
    border-bottom: 1px solid var(--border-color);
}
.tp-pick-tools-spacer { flex: 1; }
.tp-pick-search { position: relative; flex: 1; min-width: 0; }
.tp-pick-search svg {
    position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
    color: var(--text-subtle); pointer-events: none;
}
.tp-pick-search-input {
    width: 100%; box-sizing: border-box;
    padding: 9px 12px 9px 34px;
    border: 1.5px solid var(--border-color); border-radius: 10px;
    background: var(--surface-page); color: var(--text-main);
    font-size: var(--fs-base); outline: none;
    transition: border-color 0.15s;
}
.tp-pick-search-input:focus { border-color: var(--color-primary); }
.tp-pick-mode {
    flex-shrink: 0; padding: 9px 14px;
    border: 1.5px solid var(--border-color); border-radius: 10px;
    background: var(--surface-page); color: var(--text-body);
    font-size: var(--fs-sm); font-weight: var(--weight-bold);
    cursor: pointer; white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.tp-pick-mode:hover { border-color: var(--color-primary); color: var(--primary-strong); }
.tp-pick-mode.ist-an {
    background: var(--primary-fill-bg); border-color: var(--primary-fill-bg);
    color: var(--primary-fill-fg);
}

/* Filter — eingeklappt, bis er gebraucht wird */
.tp-pick-filterwrap { padding: 8px 16px; border-bottom: 1px solid var(--border-color); }
.tp-pick-filter-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    background: none; border: none; padding: 2px 0; cursor: pointer;
    font-size: var(--fs-sm); font-weight: var(--weight-bold); color: var(--text-subtle);
}
.tp-pick-filter-toggle:hover { color: var(--primary-strong); }
.tp-pick-caret { font-size: var(--fs-xs); }
.tp-pick-filter-punkt {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--color-primary); display: inline-block;
}
.tp-pick-filterrow {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-top: 8px;
}
.tp-pick-filterrow select {
    height: 34px; padding: 0 10px;
    border: 1.5px solid var(--border-color); border-radius: 8px;
    background: var(--surface-page); color: var(--text-main);
    font-size: var(--fs-sm); font-weight: var(--weight-bold);
    outline: none; cursor: pointer;
}
.tp-pick-check {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: var(--fs-sm); color: var(--text-body); cursor: pointer;
}

/* Liste */
.tp-pick-list { flex: 1; min-height: 0; overflow-y: auto; padding: 8px; }
.tp-pick-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; margin-bottom: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-color); border-radius: 10px;
    cursor: pointer; outline: none;
    transition: background 0.15s, border-color 0.15s;
}
.tp-pick-row:hover,
.tp-pick-row:focus-visible { background: var(--primary-soft-bg); border-color: var(--color-primary); }
.tp-pick-row.ist-aktuell { background: var(--primary-soft-bg); border-color: var(--color-primary); }
.tp-pick-row.ist-gewaehlt { background: var(--accent-green-bg); border-color: var(--accent-green-text); }
/* Gedimmt wird nur, was die Zeile AUSSAGT — nicht ihre Aktionen: umbenennen und
   loeschen muessen auch bei einem schon vergebenen Team moeglich bleiben. */
.tp-pick-row.ist-vergeben,
.tp-pick-row.ist-gesperrt { cursor: not-allowed; }
.tp-pick-row.ist-vergeben .tp-pick-sym, .tp-pick-row.ist-vergeben .tp-pick-body,
.tp-pick-row.ist-gesperrt .tp-pick-sym, .tp-pick-row.ist-gesperrt .tp-pick-body,
.tp-pick-row.ist-gesperrt .tp-pick-mark { opacity: 0.45; }
.tp-pick-row.ist-vergeben:hover,
.tp-pick-row.ist-gesperrt:hover { background: var(--bg-card); border-color: var(--border-color); }
/* Tauschbar: der Verbots-Cursor war das Missverstaendnis — er sagte „geht nicht“,
   obwohl ein Klick hier TAUSCHT. Zeigefinger, ein Hinweis in der Nebenzeile und ein
   Tauschpfeil rechts machen es sichtbar; beim Ueberfahren hebt sich die Zeile wieder. */
.tp-pick-row.kann-tauschen { cursor: pointer; }
.tp-pick-row.kann-tauschen:hover { background: var(--primary-soft-bg); border-color: var(--primary-soft-border); }
.tp-pick-row.kann-tauschen:hover .tp-pick-sym,
.tp-pick-row.kann-tauschen:hover .tp-pick-body { opacity: 0.75; }
.tp-pick-tausch { color: var(--primary-strong); font-weight: var(--weight-strong); }
.tp-pick-tauschpfeil { color: var(--primary-strong); flex-shrink: 0; opacity: 0.7; }
.tp-pick-row.kann-tauschen:hover .tp-pick-tauschpfeil { opacity: 1; }

.tp-pick-mark {
    flex-shrink: 0;
    width: 22px; height: 22px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 1.5px solid var(--border-strong);
    font-size: var(--fs-xs); font-weight: var(--weight-bold);
    color: var(--text-subtle); background: transparent;
}
/* Die Ziffer sitzt auf der Flaeche von --accent-green-text. Zwei Tokens waren
   hier schon falsch, beide erst durch Messen aufgefallen:
   --primary-fill-fg ist im Hausstil Tuerkis (#0f766e), nicht Weiss → 1,3:1 auf
   Dunkelgruen. Und --accent-green-bg DREHT sich im Dunkelmodus zu einem fast
   durchsichtigen Gruen (rgba(34,197,94,0.12)), waehrend die Kreisflaeche dort
   hell wird — also wieder unsichtbar, nur andersherum.
   --bg-card kippt mit dem Modus GEGENLAEUFIG zur Kreisflaeche und traegt
   deshalb als einziges in beiden Modi. */
.tp-pick-row.ist-gewaehlt .tp-pick-mark {
    background: var(--accent-green-text); border-color: var(--accent-green-text);
    color: var(--bg-card);
}
.tp-pick-sym {
    flex-shrink: 0;
    width: 32px; height: 32px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-soft); color: var(--text-subtle);
    overflow: hidden;
}
.tp-pick-sym svg { display: block; }
.tp-pick-initial { font-size: var(--fs-md); font-weight: var(--weight-bold); color: var(--text-body); }
.tp-pick-body { flex: 1; min-width: 0; }
.tp-pick-name {
    font-size: var(--fs-md); font-weight: var(--weight-bold); color: var(--text-main);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tp-pick-neben {
    margin-top: 1px;
    font-size: var(--fs-2xs); font-weight: var(--weight-medium); color: var(--text-subtle);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tp-pick-haken { flex-shrink: 0; color: var(--primary-strong); }

/* Zeilenaktionen: erst bei Hover/Fokus. Das ist der Grund, warum die Liste trotz
   Umbenennen und Loeschen ruhig bleibt. */
.tp-pick-acts { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.tp-pick-act {
    width: 28px; height: 28px; border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    background: none; border: none; cursor: pointer;
    color: var(--text-subtle);
    opacity: 0; transition: opacity 0.15s, background 0.15s, color 0.15s;
}
.tp-pick-row:hover .tp-pick-act,
.tp-pick-row:focus-within .tp-pick-act { opacity: 1; }
.tp-pick-act:focus-visible { opacity: 1; }
.tp-pick-act:hover { background: var(--surface-soft); color: var(--text-main); }
/* Rot erst beim Zeigen — nie vorher. */
.tp-pick-act-weg:hover { background: var(--accent-red-bg); color: var(--accent-red-text); }
/* Ohne Hover (Finger) dauerhaft sichtbar, aber zurueckhaltend. */
@media (hover: none) {
    .tp-pick-act { opacity: 1; }
}

/* Umbenennen an Ort und Stelle — gleiches Muster wie Gruppen- und Topfname */
.tp-pick-row.ist-bearbeitung { cursor: default; border-color: var(--color-primary); }
.tp-pick-rename {
    width: 100%; box-sizing: border-box;
    padding: 0 0 2px;
    border: none; border-bottom: 1px solid var(--color-primary);
    background: transparent; color: var(--text-main);
    font-size: var(--fs-md); font-weight: var(--weight-bold);
    outline: none;
}
.tp-pick-fehler { margin-top: 3px; font-size: var(--fs-2xs); color: var(--accent-red-text); }

.tp-pick-leer {
    padding: 28px 12px; text-align: center;
    font-size: var(--fs-sm); color: var(--text-subtle);
}

/* Neu anlegen — eine Zeile am Listenende statt eines Dauer-Kastens im Kopf */
.tp-pick-neu {
    display: flex; align-items: center; gap: 8px; width: 100%; box-sizing: border-box;
    padding: 10px 12px; margin-top: 2px;
    background: none; border: 1px dashed var(--border-strong); border-radius: 10px;
    color: var(--text-subtle); font-size: var(--fs-sm); font-weight: var(--weight-bold);
    cursor: pointer; text-align: left;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.tp-pick-neu:hover {
    color: var(--primary-strong); border-color: var(--color-primary);
    background: var(--primary-soft-bg);
}
.tp-pick-neu.ist-vorschlag {
    margin: 0 0 8px; border-style: solid;
    border-color: var(--color-primary); color: var(--primary-strong);
    background: var(--primary-soft-bg);
}
.tp-pick-neuzeile { display: flex; gap: 8px; align-items: center; margin-top: 2px; }
.tp-pick-neu-input,
.tp-pick-neu-vorname {
    flex: 1; min-width: 0; padding: 9px 12px; box-sizing: border-box;
    border: 1.5px solid var(--color-primary); border-radius: 10px;
    background: var(--surface-page); color: var(--text-main);
    font-size: var(--fs-md); outline: none;
}
.tp-pick-neu-ok {
    flex-shrink: 0; padding: 9px 15px;
    background: var(--primary-fill-bg); color: var(--primary-fill-fg);
    border: none; border-radius: 10px;
    font-size: var(--fs-sm); font-weight: var(--weight-bold); cursor: pointer;
}
.tp-pick-neu-ok:hover { background: var(--primary-fill-hover); }

/* Fussleiste — ZWEI Zeilen.
   Einzeilig standen Zaehler, zwei Textknoepfe und der Hauptknopf nebeneinander;
   auf der Kartenbreite (460 px) brach der Zaehler in vier Zeilen um und
   „Alle restlichen (1)" in zwei. Oben steht jetzt die Aussage und die EINE
   Handlung, unten die Nebenwege. */
.tp-pick-foot {
    display: flex; flex-direction: column; gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
}
.tp-pick-foot-haupt {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.tp-pick-foot-neben {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.tp-pick-foot-still { justify-content: center; border-top-color: transparent; }
.tp-pick-zaehler {
    font-size: var(--fs-sm); font-weight: var(--weight-bold); color: var(--text-subtle);
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tp-pick-zaehler.ist-voll { color: var(--accent-amber-text); }
.tp-pick-go {
    flex-shrink: 0;
    padding: 9px 18px; border: none; border-radius: 10px;
    background: var(--primary-fill-bg); color: var(--primary-fill-fg);
    font-size: var(--fs-sm); font-weight: var(--weight-bold); cursor: pointer;
    transition: background 0.15s;
}
/* Nebenwege bewusst als Text, nicht als Flaeche — in der Leiste soll genau
   EIN Knopf nach Handlung aussehen. */
.tp-pick-alle,
.tp-pick-verteilen {
    background: none; border: none; padding: 2px 0; cursor: pointer;
    font-size: var(--fs-sm); font-weight: var(--weight-bold); color: var(--primary-strong);
    text-decoration: underline; text-underline-offset: 3px;
    white-space: nowrap;
}
.tp-pick-alle:hover,
.tp-pick-verteilen:hover { color: var(--text-main); }
.tp-pick-go:hover:not(:disabled) { background: var(--primary-fill-hover); }
.tp-pick-go:disabled {
    background: var(--surface-soft); color: var(--text-subtle); cursor: not-allowed;
}
.tp-pick-aufheben {
    background: none; border: none; padding: 8px 12px; border-radius: 8px;
    font-size: var(--fs-sm); font-weight: var(--weight-bold);
    color: var(--text-subtle); cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.tp-pick-aufheben:hover { background: var(--accent-red-bg); color: var(--accent-red-text); }

@media (max-width: 520px) {
    .tp-pick-overlay { padding: 0; align-items: flex-end; }
    .tp-pick-card { max-width: none; max-height: 92vh; border-radius: 16px 16px 0 0; }
}

/* ── wiz-sheet-card: Unterer Bottom-Sheet ───────────────────────────── */
.wiz-sheet-card {
    background: #ffffff;
}
body.dark-mode .wiz-sheet-card {
    background: var(--bg-card);
}
body.dark-mode .wiz-sheet-card > div:first-child {
    background: rgba(255, 255, 255, 0.2) !important; /* Drag-Handle */
}

/* ── wiz-checkbox-label: Checkbox-Label-Karte ───────────────────────── */
.wiz-checkbox-label {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
}
body.dark-mode .wiz-checkbox-label {
    background: rgba(15, 23, 42, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
}

/* ── wiz-cancel-btn: Abbrechen-Button in Modals ─────────────────────── */
.wiz-cancel-btn {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #64748b;
}
body.dark-mode .wiz-cancel-btn {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
}

/* ── wiz-modal-content: Scrollbarer Inhaltsbereich in Modals ───────── */
.wiz-modal-content {
    background: #ffffff;
}
body.dark-mode .wiz-modal-content {
    background: var(--bg-card);
}

/* ── wiz-numpad-btn: Numpad Zifferntasten ───────────────────────────── */
.wiz-numpad-btn {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}
body.dark-mode .wiz-numpad-btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
}

/* ── wiz-lock-badge: Gesperrte-Phase-Overlay ────────────────────────── */
.wiz-lock-badge {
    background: #ffffff;
}
body.dark-mode .wiz-lock-badge {
    background: var(--bg-card);
    border-color: rgba(255, 255, 255, 0.12) !important;
}

/* ── labs-dropdown-menu: Schwebende Dropdown-Menüs ─────────────────── */
body.dark-mode .labs-dropdown-menu {
    /* --bg-card is rgba(30,41,59,0.9) in dark mode → 10 % transparent → content bleeds through.
       Use solid colour instead. */
    background: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45) !important;
}
body.dark-mode .labs-dropdown-menu .labs-dropdown-item {
    color: #e2e8f0;
}
/* Hover: inline onmouseover sets #f8fafc (almost white) – override with dark teal tint */
body.dark-mode .labs-dropdown-menu .labs-dropdown-item:hover {
    background: rgba(13, 148, 136, 0.12) !important;
    color: #2dd4bf !important;
}
/* Selected state: inline #f0fdfa looks harsh on dark bg → override to dark teal tint */
body.dark-mode .labs-dropdown-menu .labs-dropdown-item.labs-dropdown-selected {
    background: rgba(13, 148, 136, 0.22) !important;
    color: #2dd4bf !important;
    font-weight: var(--weight-strong);
}
body.dark-mode .labs-dropdown-menu .labs-dropdown-item.labs-dropdown-selected:hover {
    background: rgba(13, 148, 136, 0.30) !important;
}

/* ── setup-check-details: Einrichtungs-Checklisten-Dropdown ────────── */
.setup-check-details-panel {
    background: #ffffff;
}
body.dark-mode .setup-check-details-panel {
    background: var(--bg-card);
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* ── app-secondary-btn: Sekundär-/Abbrechen-Button in App-Dialogen ─── */
.app-secondary-btn {
    background: #ffffff;
}
body.dark-mode .app-secondary-btn {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #94a3b8 !important;
}

/* ── btn-icon-sq: Kleine quadratische Buttons (Tor-Stepper, etc.) ─── */
body.dark-mode .btn-icon-sq {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #e2e8f0;
}

/* ── detail-timer-row: Timer-Zeile in der Spieldetail-Ansicht ───────── */
body.dark-mode .detail-timer-row {
    background: rgba(15, 23, 42, 0.4) !important;
}
body.dark-mode .detail-timer-row button:not(.timer-play-btn) {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #e2e8f0 !important;
}

.labs-valign-wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 42px !important;
    height: 42px !important;
}

/* Tournament Name Interactivity Enhancements */
/* --- TOURNAMENT UI REFACTOR v2.2.27 --- */
.tournament-interactive-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    max-width: 100%;
}

.tournament-interactive-container:hover {
    background: rgba(13, 148, 136, 0.08);
    border-color: rgba(13, 148, 136, 0.2);
}

.tournament-interactive-container:hover .edit-icon-hover {
    opacity: 1;
    color: var(--primary-strong);
    transform: scale(1.1);
}

.edit-icon-hover {
    opacity: 0.2;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

/* Custom Tooltip for Tournament Name */
[data-tournament-tooltip] {
    position: relative;
}

[data-tournament-tooltip]::after {
    content: attr(data-tournament-tooltip);
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background: #1e293b;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: var(--fs-sm);
    font-weight: var(--weight-medium);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

[data-tournament-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Phase Wizard Sub-Info Responsive Labels */
.wiz-subinfo-full {
    display: inline;
}

.wiz-subinfo-abbr {
    display: none;
}

@media (max-width: 599px) {
    .wiz-subinfo-full {
        display: none;
    }

    .wiz-subinfo-abbr {
        display: inline;
    }
}

body.dark-mode .tournament-interactive-container:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}
/* ── wiz-phase-badge: Quellphasen-Badges (renderWizSourcePhaseSelection) ── */
.wiz-phase-badge {
    background: transparent;
    color: #94a3b8;
    border: 2px dashed #e2e8f0;
}
.wiz-phase-badge.active {
    background: var(--primary-fill-bg);
    color: var(--primary-fill-fg);
    border: 2px solid var(--primary-fill-border);
}
body.dark-mode .wiz-phase-badge {
    color: #64748b;
    border-color: rgba(255, 255, 255, 0.15);
}
body.dark-mode .wiz-phase-badge.active {
    background: var(--primary-fill-bg) !important;
    color: var(--primary-fill-fg) !important;
    border-color: var(--primary-fill-border) !important;
}

/* Smart Lock Styles (v2.13.5) */
.wiz-phase-badge.locked {
    filter: grayscale(1);
    opacity: 0.5;
    pointer-events: none !important;
}

/* Weiß auf Weiß bis 26.09.2026: Die Regel stammt aus der satten Füllung (Türkis, weiße Schrift).
   Seit der weichen Fassung vom 10.08.2026 ist die aktive Fläche blass (#f0fdfa) — „Gruppenturnier
   (Teams)“ war damit unsichtbar. Jetzt folgt die Marke der Schriftfarbe des Abzeichens. */
.wiz-phase-badge.active .wiz-mode-tag {
    background: rgba(13, 107, 99, 0.08) !important;
    color: var(--primary-fill-fg) !important;
}

.wiz-mode-tag {
    font-size: var(--fs-3xs);
    background: rgba(0,0,0,0.05);
    padding: 1px 4px;
    border-radius: 4px;
    margin-right: 4px;
    text-transform: uppercase;
    font-weight: var(--weight-strong);
    color: #64748b;
    vertical-align: middle;
}

.wiz-lock-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    /* Hinweisart „Erklärung“ (26.09.2026, vorher Grün mit Rahmen — die einzige grüne Fläche im Editor) */
    background: var(--surface-page);
    border: none;
    padding: 10px 14px;
    border-radius: var(--gestalt-karte-radius);
    margin-bottom: 12px;
    animation: wizSlideInDown 0.3s ease-out;
}

.wiz-lock-banner-text {
    font-size: var(--fs-md);
    font-weight: var(--weight-strong);
    color: var(--text-body);
}

@keyframes wizSlideInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

body.dark-mode .wiz-mode-tag {
    background: rgba(255,255,255,0.1);
    color: #94a3b8;
}

body.dark-mode .wiz-lock-banner {
    background: var(--surface-page);
}

body.dark-mode .wiz-lock-banner-text {
    color: var(--text-body);
}
$content

/* Segmented Control (Dynamischer Wähler) */
.segmented-control {
    display: flex;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 9px;
    width: fit-content;
    min-width: min-content;
    border: 1px solid #e2e8f0;
}

body.dark-mode .segmented-control {
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(255, 255, 255, 0.1);
}

.segmented-item {
    padding: 6px 14px;
    border-radius: 7px;
    font-size: var(--fs-md);
    font-weight: var(--weight-bold);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.dark-mode .segmented-item {
    color: #94a3b8;
}

.segmented-item.active {
    background: white;
    color: var(--primary-strong);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

body.dark-mode .segmented-item.active {
    background: var(--primary-fill-bg) !important;
    color: var(--primary-fill-fg) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}


/* GLOBAL TIMER LOCK (Suppression of local referee controls) */
.global-timer-locked #timer-play-btn,
.global-timer-locked #detail-timer-play-btn,
.global-timer-locked .timer-play-btn,
.global-timer-locked #timer-reset-btn,
.global-timer-locked .timer-reset-btn,
.global-timer-locked #btn-prev-period-ref,
.global-timer-locked #btn-next-period-ref,
.global-timer-locked [onclick*='confirmPreviousPeriod'],
.global-timer-locked [onclick*='confirmNextPeriod'] {
    display: none !important;
}

/* Global Lock Notice */
.global-timer-locked #timer-row::before,
.global-timer-locked .detail-timer-row::before {
    content: "Zentraler Timer über Live-Displays";
    font-size: var(--fs-2xs);
    background: #f8fafc;
    color: #64748b;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    margin-right: 8px;
    font-weight: var(--weight-strong);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

/* ==================================
   REFEREE HUB RESPONSIVE OVERRIDES
   Target: Width < 470px (Mobile Refined)
   v2.5.77 Deployment
   ================================== */
@media (max-width: 470px) {
    /* Notice: Zentraler Timer (Wrapped but horizontal) */
    .global-timer-locked #timer-row::before,
    .global-timer-locked .detail-timer-row::before {
        white-space: normal !important;
        text-align: center !important;
        display: inline-block !important;
        width: 85px !important;
        margin: 0 8px 0 0 !important;
        font-size: var(--fs-3xs) !important;
        padding: 4px !important;
        line-height: 1.1 !important;
        vertical-align: middle !important;
        flex-shrink: 0 !important;
    }

    /* Timer Row Layout */
    #timer-row {
        flex-wrap: nowrap !important;
        gap: 6px !important;
        padding-left: 8px !important;
        justify-content: center !important;
    }

    /* Timer Buttons Scaling (Progressive) */
    .timer-play-btn {
        width: 48px !important;
        height: 48px !important;
        flex-shrink: 0 !important;
    }
    .timer-play-btn svg {
        width: 24px !important;
        height: 24px !important;
    }
    
    .timer-reset-btn, 
    #btn-prev-period-ref, 
    #btn-next-period-ref {
        width: 34px !important;
        height: 34px !important;
        flex-shrink: 0 !important;
    }

    #match-timer-display {
        font-size: var(--fs-4xl) !important;
    }
}

/* Specific Stack logic for scores at even narrower widths */
@media (max-width: 380px) {
    .ref-score-row {
        flex-direction: column !important;
        gap: 12px !important;
        padding-left: 12px !important;
        align-items: center !important;
    }

    .ref-score-row > div:not(.drag-handle) {
        width: 100% !important;
        padding-bottom: 8px;
    }
}

/* ==========================================================================
   V2.5.79 MODERN DIALOGS & PICKERS (Referee Hub)
   ========================================================================== */

/* Modern Overlay with Blur */
#timer-editor-overlay {
    backdrop-filter: blur(8px) !important;
    background: rgba(15, 23, 42, 0.4) !important;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 999999;
}

/* Modern Timer Modal */
.timer-modern-modal {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 340px;
    overflow: hidden;
    animation: modalPopIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPopIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.timer-edit-header {
    padding: 1.25rem;
    font-size: var(--fs-2xl);
    display: flex;
    align-items: center;
}

.timer-edit-body {
    padding: 1.5rem;
}

/* Stylish Digit Boxes */
.timer-edit-digit-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.timer-edit-digit-box {
    width: 85px;
    height: 90px;
    background: #f1f5f9;
    border: 2px solid transparent;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}


.timer-edit-digit-box:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
}

.timer-edit-digit-box .digit-value {
    font-size: 2.25rem;
    font-weight: var(--weight-strong);
    color: #1e293b;
    line-height: 1;
}

.timer-edit-digit-box .digit-label {
    font-size: var(--fs-sm);
    color: #64748b;
    text-transform: uppercase;
    margin-top: 4px;
}

.timer-separator {
    font-size: 2.5rem;
    font-weight: var(--weight-strong);
    color: #cbd5e1;
    margin-top: -15px;
}

/* Modern Wheel Picker Refinement */
.wheel-picker-modern {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 24px !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.wheel-drum-modern {
    position: relative;
    overflow: hidden;
}

/* 3D Wheel Masking */
.wheel-drum-modern::before,
.wheel-drum-modern::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    height: 40px;
    z-index: 2;
    pointer-events: none;
}

.wheel-drum-modern::before {
    top: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,0.9), rgba(255,255,255,0));
}

.wheel-drum-modern::after {
    bottom: 0;
    background: linear-gradient(to top, rgba(255,255,255,0.9), rgba(255,255,255,0));
}

/* DARK MODE OVERRIDES */
body.dark-mode .timer-modern-modal {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .timer-edit-digit-box {
    background: rgba(15, 23, 42, 0.5);
    border-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode .timer-edit-digit-box:hover {
    background: rgba(15, 23, 42, 0.8);
}

body.dark-mode .timer-edit-digit-box .digit-value {
    color: #f1f5f9;
}

body.dark-mode .timer-edit-digit-box .digit-label {
    color: #94a3b8;
}

body.dark-mode .timer-separator {
    color: #475569;
}

body.dark-mode #timer-edit-period {
    background: rgba(15, 23, 42, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #f1f5f9 !important;
}

body.dark-mode .wheel-picker-modern {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .wheel-drum-modern::before {
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0));
}

/* --- Referee Mode Glassmorphism Overrides (v2.14.88) --- */
body.referee-mode, 
html.referee-mode {
    background: hsl(175, 20%, 90%) !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Dark mode specific body background */
body.dark-mode.referee-mode,
html.dark-mode.referee-mode {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 50%, #1e293b 100%) !important;
}

body.referee-mode .modal-overlay,
body.referee-mode .keypad-modal {
    background: rgba(0, 0, 0, 0.35) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
}

body.referee-mode .wheel-picker-content,
body.referee-mode .modal-content,
body.referee-mode .referee-admin-overlay .modal {
    background: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2) !important;
}

/* Dark Mode Overrides for Referee Glass */
body.dark-mode.referee-mode .wheel-picker-content,
body.dark-mode.referee-mode .modal-content,
body.dark-mode.referee-mode .referee-admin-overlay .modal {
    background: rgba(15, 23, 42, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #f1f5f9 !important;
}

/* Ensure underlying dashboard content is visible but interaction is blocked */
body.referee-mode #app-content {
    opacity: 1; /* Keep full opacity for clarity through overlay blur */
    pointer-events: none;
}
/* NEBENANGABEN IN DER SPIELPLANZEILE — Klassenkürzel, Feld, Trennpunkt, Niveau.
   -------------------------------------------------------------------
   Bis 22.08.2026 waren sie mit `opacity` leiser gemacht (0,6 bis 0,8) und kamen dadurch
   auf 2,27:1 bis 3,93:1. Sie tragen jetzt einen eigenen Ton statt Durchsichtigkeit —
   `--text-subtle` ist der HELLSTE der Rampe, der auf allen üblichen Flächen noch 4,5:1
   schafft. Der Größen- und Stärkeunterschied trägt die Nebenrolle ohnehin mit.

   HIER STANDEN VIER REGELN MIT DREIFACHEM KLASSENNAMEN UND !important. Sie mussten sich
   gegen die Pauschalregeln durchsetzen (`.match-finished *`, `body.dark-mode .match-row *`
   und Verwandte), die alles in ihrem Bereich mit einem Einheitston übermalten. Diese
   Pauschalregeln sind am 22.08.2026 abgebaut — damit ist der Trick überflüssig, und es
   bleiben gewöhnliche Regeln. Gemessen: ohne den Trick 0 unlesbare Stellen von 5.780.
   Der Chip braucht hier gar nichts mehr; farbachse.css setzt seine Farbe selbst. */
.schedule-class-badge,
.match-row-field,
.match-card-trenner,
.match-card-nebenangabe,
.tp-klassen-zusatz {
    color: var(--text-subtle);
}

/* Responsive Utilities */
@media (max-width: 500px) {
    .hide-mobile-text {
        display: none !important;
    }
}

/* Mode Cards (visuelle Modus-Auswahl) */
.wiz-mode-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.wiz-mode-card {
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 10px 8px;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    background: white;
    user-select: none;
    min-width: 0;
}
.wiz-mode-card:hover {
    border-color: var(--color-primary);
    background: #f0fdfa;
}
.wiz-mode-card.active {
    border-color: var(--color-primary);
    background: #f0fdfa;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}
.wiz-mode-card-icon {
    color: var(--text-subtle);
    margin-bottom: 6px;
    line-height: 1;
}
.wiz-mode-card.active .wiz-mode-card-icon {
    color: var(--primary-strong);
}
.wiz-mode-card-title {
    font-size: var(--fs-sm);
    font-weight: var(--weight-bold);
    color: #334155;
    /* Frueher `white-space:nowrap` + `text-overflow:ellipsis`. Das verbarg den Fehler,
       statt ihn zu loesen: In der Vierer-Reihe steht bis rund 1000 px Fensterbreite
       nur „Trost-/Qualifikatio…“ — der Nutzer kann die Karte dann nicht mehr
       auseinanderhalten. Zwei Zeilen sind besser als ein halbes Wort. */
    white-space: normal;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.25;
}
.wiz-mode-card.active .wiz-mode-card-title {
    color: var(--primary-strong);
}
/* DIE NUMMER AUF DER MODUS-KARTE — sie sagt „gewaehlt" UND „an welcher Stelle".

   Bewusst IM Titel und nicht absolut positioniert: Oben rechts sitzt schon der
   Erklaer-Pfeil, oben links das Bildzeichen, und die Karte ist in der
   Vierer-Reihe schmal. Im Textfluss rutscht die Nummer bei zwei Zeilen einfach
   mit, statt etwas zu verdecken. */
.wiz-mode-card-nummern {
    display: inline-flex;
    gap: 3px;
    margin-right: 5px;
    vertical-align: baseline;
}
.wiz-mode-card-nummer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    box-sizing: border-box;
    border-radius: 999px;
    background: var(--primary-fill-bg);
    color: var(--primary-fill-fg);
    font-size: var(--fs-2xs);
    font-weight: var(--weight-strong);
    line-height: 1;
}

.wiz-mode-card-desc {
    font-size: var(--fs-2xs);
    color: var(--text-subtle);
    margin-top: 1px;
    white-space: normal;
    overflow-wrap: break-word;
    line-height: 1.25;
}
/* Die Ecke der Moduskarte erklaert den Modus. Bis zum 09.09.2026 stand dort ein
   Pfeil „↗" — dieselbe Handlung wie das „i" in der Phasen-Kopfzeile, aber ein
   anderes Zeichen. Jetzt steht auch hier das Info-Zeichen aus TP_SYMBOLE.
   18 auf 24 px vergroessert: Bei 350 px Fensterbreite ist die Karte rund 140 px
   breit, die Ecke bleibt also frei, und 24 px sind mit dem Finger zu treffen.
   Der gruene Anstrich bleibt: Anders als die freistehenden Info-Knoepfe sitzt
   dieser IN einer anklickbaren Karte und muss sich von ihr abheben. */
.wiz-mode-card-preview-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: rgba(13, 148, 136, 0.08);
    color: var(--primary-strong);
    font-size: var(--fs-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1;
    border: 1px solid rgba(13, 148, 136, 0.2);
}
.wiz-mode-card-preview-btn:hover {
    background: var(--primary-fill-bg);
    color: var(--primary-fill-fg);
    border-color: var(--color-primary);
}
.wiz-mode-card-locked {
    opacity: 0.65;
    cursor: pointer;
}
.wiz-mode-card-locked:hover {
    border-color: var(--border-strong) !important;
    background: var(--surface-soft) !important;
}
.wiz-mode-card-pro-badge {
    position: absolute;
    top: 6px;
    left: 8px;
    /* Ein Hinweis auf den Zugang, keine Warnung: grau, normal geschrieben (28.09.2026) */
    background: var(--surface-soft);
    color: var(--text-body);
    border: 1px solid var(--border-color);
    font-size: var(--fs-2xs);
    font-weight: var(--weight-bold);
    padding: 1px 6px;
    border-radius: var(--gestalt-marke-radius);
    pointer-events: auto;
    z-index: 1;
}
.wiz-mode-card-pro-badge::before { content: "🔒"; font-size: 0.9em; margin-right: 3px; }
body.dark-mode .wiz-mode-card-locked:hover {
    border-color: rgba(255, 255, 255, 0.25) !important;
    background: rgba(255, 255, 255, 0.06) !important;
}
body.dark-mode .wiz-mode-card {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}
body.dark-mode .wiz-mode-card:hover {
    background: rgba(13, 148, 136, 0.12);
    border-color: var(--color-primary);
}
body.dark-mode .wiz-mode-card.active {
    background: rgba(13, 148, 136, 0.15);
    border-color: var(--color-primary);
}
body.dark-mode .wiz-mode-card-title {
    color: #e2e8f0;
}
/* Im Dunkelmodus ist `--primary-fill-bg` KEINE Fuellung, sondern ein Hauch
   (rgba(13,148,136,0.15)) — und genau der liegt auch auf der gewaehlten Karte.
   Die Nummer waere damit kein Plaettchen mehr, sondern nur farbiger Text auf
   gleichem Grund. Deshalb hier gedreht: helles Tuerkis als Flaeche, die dunkle
   Seitenfarbe als Schrift. */
body.dark-mode .wiz-mode-card-nummer {
    background: var(--primary-strong);
    color: var(--surface-page);
}
body.dark-mode .wiz-mode-card.active .wiz-mode-card-title {
    color: #2dd4bf;
}
body.dark-mode .wiz-mode-card.active .wiz-mode-card-icon {
    color: #2dd4bf;
}
@media (max-width: 599px) {
    .wiz-mode-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mode Carousel (Modus-Vorschau) */
.wiz-mode-preview-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: 12px;
    background: #f0fdfa;
    color: var(--primary-strong);
    font-size: var(--fs-xs);
    font-weight: var(--weight-bold);
    cursor: pointer;
    border: 1px solid #99f6e4;
    transition: all 0.15s;
    white-space: nowrap;
    user-select: none;
}
.wiz-mode-preview-btn:hover {
    background: var(--primary-fill-bg);
    color: var(--primary-fill-fg);
    border-color: var(--color-primary);
}
body.dark-mode .wiz-mode-preview-btn {
    background: rgba(13, 148, 136, 0.15);
    color: #2dd4bf;
    border-color: rgba(13, 148, 136, 0.3);
}
body.dark-mode .wiz-mode-preview-btn:hover {
    background: var(--primary-fill-bg);
    color: var(--primary-fill-fg);
}

.mode-carousel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300000;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s;
    padding: 16px;
    box-sizing: border-box;
}

.mode-carousel-modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: mcSlideUp 0.25s ease-out;
    box-sizing: border-box;
    max-height: 90vh;
    overflow-y: auto;
}
body.dark-mode .mode-carousel-modal {
    background: #1e293b;
}

@keyframes mcSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.mode-carousel-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: var(--text-body);
    cursor: pointer;
    font-size: var(--fs-md);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s;
}
.mode-carousel-close:hover {
    background: #e2e8f0;
}
body.dark-mode .mode-carousel-close {
    background: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
}
body.dark-mode .mode-carousel-close:hover {
    background: rgba(255, 255, 255, 0.18);
}

.mode-carousel-header {
    margin-bottom: 14px;
    padding-right: 32px;
}

.mode-carousel-title {
    font-size: var(--fs-3xl);
    font-weight: var(--weight-strong);
    color: #0f172a;
    line-height: 1.2;
}
body.dark-mode .mode-carousel-title {
    color: #f1f5f9;
}

.mode-carousel-subtitle {
    font-size: var(--fs-md);
    color: #64748b;
    margin-top: 3px;
}
body.dark-mode .mode-carousel-subtitle {
    color: #94a3b8;
}

.mode-carousel-badge {
    padding: 3px 10px;
    border-radius: 20px;
    color: white;
    font-size: var(--fs-xs);
    font-weight: var(--weight-bold);
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 2px;
}

.mode-preview-widget {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 14px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
body.dark-mode .mode-preview-widget {
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.mode-carousel-features {
    list-style: none;
    padding: 0;
    margin: 0 0 14px 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.mode-carousel-features li {
    font-size: var(--fs-md);
    color: #475569;
    padding-left: 20px;
    position: relative;
    line-height: 1.4;
}
.mode-carousel-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary-strong);
    font-weight: var(--weight-strong);
}
body.dark-mode .mode-carousel-features li {
    color: #94a3b8;
}

.mode-carousel-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.mode-carousel-btn {
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #475569;
    font-size: var(--fs-md);
    cursor: pointer;
    transition: all 0.15s;
}
.mode-carousel-btn:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: #cbd5e1;
}
.mode-carousel-btn:disabled {
    opacity: 0.3;
    cursor: default;
}
body.dark-mode .mode-carousel-btn {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.12);
    color: #94a3b8;
}
body.dark-mode .mode-carousel-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
}

.mode-carousel-dots {
    display: flex;
    gap: 6px;
    align-items: center;
}
.mode-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e2e8f0;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}
.mode-carousel-dot.active {
    background: var(--color-primary);
    width: 22px;
    border-radius: 4px;
}
body.dark-mode .mode-carousel-dot {
    background: rgba(255, 255, 255, 0.2);
}
body.dark-mode .mode-carousel-dot.active {
    background: #2dd4bf;
}

.mode-select-btn {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: none;
    background: var(--primary-fill-bg);
    color: var(--primary-fill-fg);
    font-size: var(--fs-base);
    font-weight: var(--weight-bold);
    cursor: pointer;
    transition: background 0.15s;
    letter-spacing: 0.2px;
}
.mode-select-btn:hover {
    background: #0f766e;
}

@media (max-width: 520px) {
    .mode-carousel-modal {
        padding: 18px 14px;
    }
    .mode-carousel-title {
        font-size: var(--fs-xl);
    }
    .mode-preview-widget {
        padding: 12px 8px;
        min-height: 100px;
    }
}

/* Team slot: players icon button */
.tp-slot-players:hover {
    background: #f0fdfa !important;
    color: var(--primary-strong) !important;
}
[data-theme="dark"] .tp-slot-players {
    background: rgba(13,148,136,0.08) !important;
    border-color: rgba(255,255,255,0.08) !important;
}
[data-theme="dark"] .tp-slot-players:hover {
    background: rgba(13,148,136,0.18) !important;
}

/* === Tabellen (Standings) Dark Mode Fixes === */

/* Row dividers: inline border-bottom:#f8fafc is near-white in dark mode */
body.dark-mode .tp-standings-row {
    border-bottom-color: rgba(255, 255, 255, 0.06) !important;
}

/* === Planung (Planning) Dark Mode Fixes === */

/* 1. General Phase Cards in Planning view */
body.dark-mode .phase-card {
    background: rgba(30, 41, 59, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Two-Tone Header Row of Phase Cards */
body.dark-mode .phase-card > div:first-of-type {
    background: rgba(15, 23, 42, 0.4) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Text styles inside Phase Card Header Row */
body.dark-mode .phase-card > div:first-of-type span {
    color: #cbd5e1 !important;
}

/* Phase Card Title and Label texts */
.phase-card .phase-card-title {
    min-width: 0;
    line-height: 1.2;
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
}

body.dark-mode .phase-card .phase-card-title {
    color: #f8fafc !important;
}

/* Phase Group and Hierarchy Cards */
body.dark-mode .phase-hierarchy-card {
    background: rgba(30, 41, 59, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .phase-hierarchy-card > div:first-of-type {
    background: rgba(15, 23, 42, 0.4) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .phase-hierarchy-card button[style*="background:white"]:not(:where([style*="background:var("],[style*="background: var("])) {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #cbd5e1 !important;
}

/* Hierarchy Team Card in phase groups view */
body.dark-mode .hierarchy-team {
    background: rgba(15, 23, 42, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .hierarchy-team > div:first-of-type {
    border-bottom-color: rgba(255, 255, 255, 0.05) !important;
}

body.dark-mode .hierarchy-team span[style*="color:#334155"]:not(:where([style*="color:var("],[style*="color: var("])),
body.dark-mode .hierarchy-team span[style*="color: #334155"]:not(:where([style*="color:var("],[style*="color: var("])) {
    color: #e2e8f0 !important;
}

body.dark-mode .tournament-list-scroll .t-name,
body.dark-mode .template-list-scroll .t-name,
body.dark-mode .hierarchy-team > div:first-of-type > div:first-child > span:first-child {
    color: #f8fafc !important;
}

body.dark-mode .hierarchy-team button[style*="background:#f8fafc"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode .hierarchy-team button[style*="background: #f8fafc"]:not(:where([style*="background:var("],[style*="background: var("])) {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #cbd5e1 !important;
}

/* Font-size accessibility: keep long names visible in collection and fixed-team cards. */
.tournament-list-scroll .tournament-row,
.template-list-scroll .tournament-row {
    align-items: flex-start !important;
    min-height: auto !important;
    height: auto !important;
    overflow: visible !important;
}

.tournament-list-scroll .t-info,
.template-list-scroll .t-info {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    overflow: visible !important;
}

.tournament-list-scroll .t-name,
.template-list-scroll .t-name {
    display: block !important;
    min-height: 1.35em !important;
    height: auto !important;
    line-height: 1.25 !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
}

.hierarchy-team,
.hierarchy-team > div:first-of-type {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
}

.hierarchy-team > div:first-of-type {
    align-items: flex-start !important;
}

.hierarchy-team > div:first-of-type > div:first-child {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    overflow: visible !important;
}

.hierarchy-team > div:first-of-type > div:first-child > span:first-child {
    display: block !important;
    min-height: 1.3em !important;
    height: auto !important;
    line-height: 1.25 !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    color: inherit;
}

body.dark-mode .hierarchy-team > div:first-of-type > div:first-child > span:first-child {
    color: #f8fafc !important;
}

/* 2. Doppel-Duell Mode Planning Cards */
body.dark-mode .labs-group-card > div > div {
    background: transparent !important;
}

body.dark-mode .labs-group-card div[style*="background:white"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode .labs-group-card div[style*="background: white"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode .labs-group-card div[style*="background:rgb(255, 255, 255)"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode .labs-group-card div[style*="background: rgb(255, 255, 255)"]:not(:where([style*="background:var("],[style*="background: var("])) {
    background: #1e293b !important;
}

body.dark-mode .labs-group-card div[style*="color:#64748b"]:not(:where([style*="color:var("],[style*="color: var("])),
body.dark-mode .labs-group-card div[style*="color: #64748b"]:not(:where([style*="color:var("],[style*="color: var("])) {
    color: #94a3b8 !important;
}

/* 3. Schleifchen Mode Planning Cards (Setzkasten / Slots) */

/* General background for the main Setzkasten wrapper inside the card */
body.dark-mode div[id^="schleifchen-setzkasten-"] {
    background: transparent !important;
}

/* Kompensation-Bereich: oranger Wrapper → dezentes Dunkel */
body.dark-mode div[id^="schleifchen-setzkasten-"] div[style*="rgba(255,247,237"] {
    background: rgba(30, 41, 59, 0.85) !important;
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

/* Doppel-Duell: Trennlinien via border-bottom auf jeder Zelle (inkl. letzter Zeile).
   Grid-Hintergrund kaschiert leere Zellen in unvollständigen Zeilen. */
.dd-pair-grid {
    background: white;
}
.dd-pair-cell {
    background: white;
    border-bottom: 1px solid #e2e8f0;
}
body.dark-mode .dd-pair-grid {
    background: #1e293b;
}
body.dark-mode .dd-pair-cell {
    background: #1e293b;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* Schleifchen: Kategoriezeile (Kompensationsstatus + Zähler) */
body.dark-mode div[id^="schleifchen-setzkasten-"] div[style*="rgba(255,247,237"] span[style*="color:#c2410c"]:not(:where([style*="color:var("],[style*="color: var("])),
body.dark-mode div[id^="schleifchen-setzkasten-"] div[style*="rgba(255,247,237"] span[style*="color:#ea580c"]:not(:where([style*="color:var("],[style*="color: var("])) {
    color: #fca5a5 !important;
}

/* Auto-Auffüllen / Manuell: seit 28.09.2026 der Umschalter der App (.tp-segmented-control) — seine Dunkelmodus-Regeln
   gelten; die drei Sonderregeln fuer .tp-comp-btn sind entfallen. Die Klasse bleibt, script.js erkennt die Knoepfe daran. */

/* "Kompensation erforderlich" Badge: gelb → dunkel-bernstein */
body.dark-mode div[style*="rgba(254,243,199"] {
    background: rgba(120, 53, 15, 0.35) !important;
    border-color: rgba(251, 191, 36, 0.4) !important;
    color: #fbbf24 !important;
}

/* "Perfekte Auslastung" Badge: gleicher Teal-Stil wie aktiver Comp-Button */
body.dark-mode div[style*="rgba(209,250,229"] {
    background: rgba(13, 148, 136, 0.22) !important;
    border-color: rgba(45, 212, 191, 0.55) !important;
    color: #2dd4bf !important;
}

/* Category headers inside Schleifchen & Doppel-Duell (Structural & Padding Selection) */
body.dark-mode .labs-group-card div[style*="width:100%"] > div > div:first-child:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode .labs-group-card div[style*="width: 100%"] > div > div:first-child:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode div[id^="schleifchen-setzkasten-"] > div > div:first-child,
body.dark-mode .labs-group-card div[style*="padding:8px 16px"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode .labs-group-card div[style*="padding: 8px 16px"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode .labs-group-card div[style*="padding:6px 12px"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode .labs-group-card div[style*="padding: 6px 12px"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode div[id^="schleifchen-setzkasten-"] div[style*="padding:6px 12px"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode div[id^="schleifchen-setzkasten-"] div[style*="padding: 6px 12px"]:not(:where([style*="background:var("],[style*="background: var("])) {
    background-color: rgba(15, 23, 42, 0.4) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .labs-group-card div[style*="width:100%"] > div > div:first-child span:not(:where([style*="color:var("],[style*="color: var("])),
body.dark-mode .labs-group-card div[style*="width:100%"] > div > div:first-child div:not(:where([style*="color:var("],[style*="color: var("])),
body.dark-mode div[id^="schleifchen-setzkasten-"] > div > div:first-child span,
body.dark-mode div[id^="schleifchen-setzkasten-"] > div > div:first-child div,
body.dark-mode .labs-group-card div[style*="padding:8px 16px"] span:not(:where([style*="color:var("],[style*="color: var("])),
body.dark-mode .labs-group-card div[style*="padding:8px 16px"] div:not(:where([style*="color:var("],[style*="color: var("])),
body.dark-mode .labs-group-card div[style*="padding:6px 12px"] span:not(:where([style*="color:var("],[style*="color: var("])),
body.dark-mode .labs-group-card div[style*="padding:6px 12px"] div:not(:where([style*="color:var("],[style*="color: var("])),
body.dark-mode div[id^="schleifchen-setzkasten-"] div[style*="padding:6px 12px"] span:not(:where([style*="color:var("],[style*="color: var("])),
body.dark-mode div[id^="schleifchen-setzkasten-"] div[style*="padding:6px 12px"] div:not(:where([style*="color:var("],[style*="color: var("])) {
    color: #cbd5e1 !important;
}

body.dark-mode .labs-group-card div[style*="width:100%"] > div > div:first-child span[style*="background"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode div[id^="schleifchen-setzkasten-"] > div > div:first-child span[style*="background"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode .labs-group-card div[style*="padding:8px 16px"] span[style*="background"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode .labs-group-card div[style*="padding:6px 12px"] span[style*="background"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode div[id^="schleifchen-setzkasten-"] div[style*="padding:6px 12px"] span[style*="background"]:not(:where([style*="background:var("],[style*="background: var("])) {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #cbd5e1 !important;
}


/* Grid separation lines (gap: 1px) */
body.dark-mode .labs-group-card div[style*="gap:1px"],
body.dark-mode .labs-group-card div[style*="gap: 1px"],
body.dark-mode div[id^="schleifchen-setzkasten-"] div[style*="gap:1px"],
body.dark-mode div[id^="schleifchen-setzkasten-"] div[style*="gap: 1px"] {
    background: rgba(15, 23, 42, 0.6) !important;
}

/* Setzkasten & Doppel-Duell Grid cells (slots and fillers) */
body.dark-mode .labs-group-card div[style*="display:grid"] > div:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode .labs-group-card div[style*="display: grid"] > div:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode div[id^="schleifchen-setzkasten-"] div[style*="display:grid"] > div:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode div[id^="schleifchen-setzkasten-"] div[style*="display: grid"] > div:not(:where([style*="background:var("],[style*="background: var("])) {
    background: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Setzkasten Slots */
body.dark-mode .setzkasten-slot {
    background: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Inactive slots (Chrome/Edge RGB compatible) */
body.dark-mode .setzkasten-slot[style*="background:#f8fafc"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode .setzkasten-slot[style*="background: #f8fafc"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode .setzkasten-slot[style*="248, 250, 252"],
body.dark-mode .setzkasten-slot[style*="248,250,252"] {
    background: rgba(15, 23, 42, 0.3) !important;
}

/* Gender theme backgrounds in Dark Mode (Chrome/Edge RGB compatible) */
body.dark-mode .setzkasten-slot[style*="#3b82f6"],
body.dark-mode .setzkasten-slot[style*="59, 130, 246"],
body.dark-mode .setzkasten-slot[style*="59,130,246"] {
    background: linear-gradient(to right, #3b82f6 4px, #1e293b 4px) !important;
}
body.dark-mode .setzkasten-slot[style*="#94a3b8"],
body.dark-mode .setzkasten-slot[style*="148, 163, 184"],
body.dark-mode .setzkasten-slot[style*="148,163,184"] {
    background: linear-gradient(to right, #94a3b8 4px, #1e293b 4px) !important;
}

/* Inner slot items (Doppel-Duell player card containers and hover effects) */
body.dark-mode .labs-group-card div[style*="gap:1px"] > div,
body.dark-mode .labs-group-card div[style*="gap: 1px"] > div {
    background: #1e293b !important;
}

body.dark-mode .labs-group-card div[style*="gap:1px"] > div:hover,
body.dark-mode .labs-group-card div[style*="gap: 1px"] > div:hover {
    background: rgba(13, 148, 136, 0.15) !important;
}

/* Slot text colors */
body.dark-mode .setzkasten-slot div[style*="color:#1e293b"]:not(:where([style*="color:var("],[style*="color: var("])),
body.dark-mode .setzkasten-slot div[style*="color: #1e293b"]:not(:where([style*="color:var("],[style*="color: var("])),
body.dark-mode .setzkasten-slot div[style*="30, 41, 59"] {
    color: #e2e8f0 !important;
}

/* Slot side panel (toggle background) */
body.dark-mode .setzkasten-slot > div[style*="width:40px"]:not(:where([style*="background:var("],[style*="background: var("])) {
    background: rgba(15, 23, 42, 0.4) !important;
    border-left: 1px dashed rgba(255, 255, 255, 0.1) !important;
}

/* Slot remove buttons */
body.dark-mode .setzkasten-slot button.tp-slot-remove {
    border-left: 1px dashed rgba(255, 255, 255, 0.1) !important;
}

/* Compensation dialog panel inside Schleifchen */
body.dark-mode div[style*="background:rgba(255,247,237,0.5)"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode div[style*="background: rgba(255, 247, 237, 0.5)"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode div[style*="255, 247, 237"] {
    background: rgba(251, 146, 60, 0.1) !important;
    border-bottom-color: rgba(251, 146, 60, 0.2) !important;
}

body.dark-mode div[style*="background:rgba(255,247,237,0.5)"] span[style*="color:#c2410c"]:not(:where([style*="color:var("],[style*="color: var("])),
body.dark-mode div[style*="background:rgba(255,247,237,0.5)"] span[style*="color: #c2410c"]:not(:where([style*="color:var("],[style*="color: var("])),
body.dark-mode div[style*="255, 247, 237"] span {
    color: #fdba74 !important;
}

body.dark-mode div[style*="background:rgba(255,255,255,0.7)"]:not(:where([style*="background:var("],[style*="background: var("])):not(.tp-comp-btn-wrapper),
body.dark-mode div[style*="background: rgba(255, 255, 255, 0.7)"]:not(:where([style*="background:var("],[style*="background: var("])):not(.tp-comp-btn-wrapper),
body.dark-mode div[style*="255, 255, 255, 0.7"]:not(.tp-comp-btn-wrapper) {
    background: rgba(15, 23, 42, 0.6) !important;
    border-color: rgba(251, 146, 60, 0.2) !important;
}

body.dark-mode div[style*="background:rgba(255,255,255,0.7)"]:not(.tp-comp-btn-wrapper) button[style*="color:#c2410c"]:not(:where([style*="color:var("],[style*="color: var("])),
body.dark-mode div[style*="background:rgba(255,255,255,0.7)"]:not(.tp-comp-btn-wrapper) button[style*="color: #c2410c"]:not(:where([style*="color:var("],[style*="color: var("])),
body.dark-mode div[style*="255, 255, 255, 0.7"]:not(.tp-comp-btn-wrapper) button {
    color: #fdba74 !important;
}

/* === Standard Mode (Gruppe) Card - Dark Mode Fixes === */

/* Outer card border */
body.dark-mode .labs-group-card {
    border-color: rgba(255, 255, 255, 0.1) !important;
    background: #1e293b !important;
}

/* Grid separator (the #e2e8f0 background shows through 1px gaps between rows) */

/* Standard Mode grid: Gap-Hintergrund = gleiche Farbe wie Slot-Hintergrund → Lücken unsichtbar */
body.dark-mode .labs-group-card div[style*="grid-template-columns:1fr auto"][style*="background:#e2e8f0"]:not(:where([style*="background:var("],[style*="background: var("])) {
    background: #1e293b !important;
}

/* Standard Mode: Slot-Wrapper explizit ohne Border — verhindert jegliche sichtbare Umrahmung */
body.dark-mode .labs-group-card div[style*="grid-template-columns:1fr auto"] > div[style*="height:38px"] {
    border: none !important;
    outline: none !important;
}

/* Group name input text */
body.dark-mode .labs-group-card .labs-input {
    color: #f1f5f9 !important;
    background: transparent !important;
}

/* Allgemein: tp-action-btn / tp-delete-btn überall transparent (Phase-Header, etc.)
   Spezifität 0,2,1 > Basis-Buttonregel 0,1,2 → kein grauer Hintergrund */
body.dark-mode .tp-action-btn,
body.dark-mode .tp-delete-btn {
    background: transparent !important;
    border: none !important;
    color: #94a3b8 !important;
}
body.dark-mode .tp-action-btn:hover,
body.dark-mode .tp-delete-btn:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #cbd5e1 !important;
}

/* Die fuenf Regeln fuer #labs-action-add-phase und .labs-action-row.is-wrapped
   sind am 06.09.2026 entfernt worden: Den Knopf gibt es nicht mehr, und die
   Klasse `is-wrapped` wurde nie gesetzt (Begruendung in labs-view-calendar.js,
   dort wo die Mechanik stand). */

/* Innerhalb Gruppenkarte: #1e293b statt transparent (passt zum Kartenhintergrund)
   Spezifität 0,3,1 > allgemeine Regel 0,2,1 → überschreibt nur in Gruppenkarten */
body.dark-mode .labs-group-card .tp-action-btn {
    background: #1e293b !important;
    border: none !important;
    color: #94a3b8 !important;
}
body.dark-mode .labs-group-card .tp-delete-btn {
    background: #1e293b !important;
    border: none !important;
    color: #94a3b8 !important;
}
body.dark-mode .labs-group-card .tp-action-btn:hover,
body.dark-mode .labs-group-card .tp-delete-btn:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #cbd5e1 !important;
}

/* Slot card outer wrapper (background:white, height:38px) */
body.dark-mode .labs-group-card div[style*="height:38px"]:not(:where([style*="background:var("],[style*="background: var("])),
body.dark-mode .labs-group-card div[style*="height: 38px"]:not(:where([style*="background:var("],[style*="background: var("])) {
    background: #1e293b !important;
}

/* Slot left clickable area (background:white) —
   border:none überschreibt die globale div[style*="background:white"]-Regel (Zeile ~1742)
   die border:1px solid rgba(255,255,255,0.1) auf alle white-background-Divs setzt */
body.dark-mode .labs-group-card .tp-slot-left {
    background: #1e293b !important;
    border: none !important;
}
body.dark-mode .labs-group-card .tp-slot-left:hover {
    background: rgba(13, 148, 136, 0.08) !important;
}

/* Slot name text */
body.dark-mode .labs-group-card .tp-slot-left div[style*="color:#1e293b"]:not(:where([style*="color:var("],[style*="color: var("])),
body.dark-mode .labs-group-card .tp-slot-left div[style*="color: #1e293b"]:not(:where([style*="color:var("],[style*="color: var("])),
body.dark-mode .labs-group-card .tp-slot-left div[style*="30, 41, 59"] {
    color: #f1f5f9 !important;
}

/* Slot side buttons (players, class badge) — transparent: zeigen Slot-Hintergrund (#1e293b) */
body.dark-mode .labs-group-card .tp-slot-players,
body.dark-mode .labs-group-card .tp-slot-class {
    background: transparent !important;
    border-left-color: rgba(255, 255, 255, 0.08) !important;
}
body.dark-mode .labs-group-card .tp-slot-players:hover,
body.dark-mode .labs-group-card .tp-slot-class:hover {
    background: rgba(255, 255, 255, 0.06) !important;
}

/* Remove button */
body.dark-mode .labs-group-card .tp-slot-remove {
    border-left-color: rgba(255, 255, 255, 0.08) !important;
}

/* Slot-Zeile × Buttons (jetzt Klasse tp-slot-delete-btn) */
body.dark-mode .labs-group-card .tp-slot-delete-btn {
    background: #1e293b !important;
    color: rgba(255, 255, 255, 0.2) !important;
    border: none !important;
}
body.dark-mode .labs-group-card .tp-slot-delete-btn:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #94a3b8 !important;
}

/* Schleifchen/DD-Kategorie-Header-Regel trifft versehentlich das "Team wählen"-Text-Div
   im Standard-Modus — hier zurücksetzen */
body.dark-mode .labs-group-card .tp-slot-left div[style*="width:100%"] > div > div:first-child {
    background-color: transparent !important;
    border-bottom: none !important;
}

/* Header-Zeile col 1 (Div mit inline background:#f1f5f9) — Spezifität (0,4,3) schlägt
   sicher alle anderen Regeln; gleicher Ton wie Slots und Mülleimer-Button */
body.dark-mode .labs-group-card div[style*="display:grid"] > div[style*="background:#f1f5f9"]:not(:where([style*="background:var("],[style*="background: var("])) {
    background: #1e293b !important;
}

/* ── labs-header-card: Karten-Überschriften in Laboransicht ─────────── */
.labs-header-card { background: #ffffff; }
body.dark-mode .labs-header-card {
    background: var(--bg-card) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* ── dash-card: Inline background:white überschreiben für Dark Mode ─── */
body.dark-mode .dash-card {
    background: rgba(30, 41, 59, 0.9) !important;
}

/* Dark mode scrollbars for app modals and scrollable panels */
body.dark-mode,
body.dark-mode .keypad-content,
body.dark-mode .modal,
body.dark-mode .modal-content,
body.dark-mode [style*="overflow-y:auto"],
body.dark-mode [style*="overflow-y: auto"],
body.dark-mode [style*="overflow:auto"],
body.dark-mode [style*="overflow: auto"] {
    scrollbar-width: thin;
    scrollbar-color: #64748b #0f172a;
}

body.dark-mode ::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

body.dark-mode ::-webkit-scrollbar-track {
    background: #0f172a;
}

body.dark-mode ::-webkit-scrollbar-thumb {
    background-color: #64748b;
    border: 3px solid #0f172a;
    border-radius: 999px;
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}


/* ═══════════════════════════════════════════════════════════════════════
   LIVE-DISPLAY: BLEIBT IMMER DUNKEL
   ═══════════════════════════════════════════════════════════════════════
   Das Live-Display nimmt `dark-mode` von body und html herunter und legt die
   dunkle Palette abgegrenzt auf #display-mode-container (siehe display-mode.js).
   Jedes var(--…) darin löst sich deshalb dunkel auf.

   ABER: Klassen, deren HELLE Fassung eine feste Farbe mitbringt und die nur
   über `body.dark-mode` umgestellt werden, hören darauf nicht — body trägt die
   Klasse hier ja gerade nicht. Sie blieben weiß mitten im dunklen Bild (so das
   Burger-Menü). Sie bekommen hier dieselbe Ausnahme wie im Dunkelmodus, nur an
   den Container gebunden statt an body. */

#display-mode-container .wiz-modal-card {
    background: var(--bg-elevated);
}

#display-mode-container .app-secondary-btn {
    background: rgba(255, 255, 255, 0.06);
}

/* Rollbalken im Menü — hell waere hier ein Fremdkoerper. NICHT ueber
   [style*="overflow-y:auto"] gehen wie die dark-mode-Regeln weiter oben: Sobald
   JavaScript ein style.xyz setzt, schreibt der Browser das ganze Attribut neu
   (aus `overflow-y:auto` wird `overflow: hidden auto`) und der Treffer faellt
   weg — beim Burger-Menue passiert genau das beim Aufklappen. scrollbar-color
   vererbt sich, eine Regel auf dem Container genuegt also. */
#display-mode-container {
    scrollbar-width: thin;
    scrollbar-color: #64748b #0f172a;
}

#display-mode-container ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

#display-mode-container ::-webkit-scrollbar-track {
    background: #0f172a;
}

#display-mode-container ::-webkit-scrollbar-thumb {
    background-color: #64748b;
    border: 3px solid #0f172a;
    border-radius: 999px;
}


/* ============================================================================
   PLATZ AUF KLEINEN DISPLAYS (v2.6.98)

   Die Planungsansicht wird in JS-Vorlagen mit INLINE-Styles gebaut
   (labs-groups.js, labs-view-calendar.js). Alles, was sich hier nach
   Bildschirmbreite aendern soll, musste deshalb AUS dem style-Attribut heraus in
   diese Klassen — inline schlaegt Stylesheet, dagegen kaeme sonst nur
   !important an.

   ERST VERSUCHT, DANN VERWORFEN: die Masse als Token (`--tp-slot-minh`) im
   style-Attribut stehen lassen und nur den Token-Wert je Mediaquery umschalten.
   Sieht sauberer aus, liess sich aber nicht sauber nachweisen: Beim Messen am
   10.08.2026 meldeten Elemente nach dem Verkleinern von 1280px auf 375px noch
   den alten Wert (min-height 46px statt 40px) und sprangen erst beim naechsten
   Neuzeichnen um. Bei frischem Laden auf 375px stimmte dagegen alles — der
   veraltete Wert kam also vermutlich von der Viewport-Emulation des Testwerk-
   zeugs und nicht von var() selbst. Nachgewiesen ist es aber eben nicht, und
   mit gewoehnlichen Klassen stellt sich die Frage gar nicht erst.

   Beim Verschieben ins Stylesheet war zu pruefen, ob eine Dark-Mode-Regel auf
   der Inline-Zeichenkette sitzt (`div[style*="padding:8px 16px"]` und
   Verwandte gibt es in dieser Datei reichlich). Fuer die hier verschobenen
   Werte trifft das nachweislich keine Regel.

   ZWEI SCHWELLEN, mehr braucht es nicht:
     <= 899px  Tablet hochkant und Handy: Masse enger, Zusatzzeilen weg
     <= 599px  Handy: Beschriftungen, die das Symbol mittraegt, entfallen
   ============================================================================ */

/* --- Phasenkarte ---------------------------------------------------------- */
.phase-card {
    margin: 10px 0 12px;
}

.tp-phase-head {
    padding: 4px 16px;
}

.tp-phase-body {
    padding: 12px 16px;
    gap: 12px;
}

.phase-card .phase-card-title {
    letter-spacing: 0.08em;
}

/* Modus-Schalter "Direkt zuweisen | Lostoepfe" */
.tp-mode-btn {
    padding: 0 12px;
}

/* --- Slot-Zeile in den Gruppenkarten -------------------------------------- */
.tp-slot-row {
    min-height: 46px;
}

.tp-slot-left {
    padding: 6px 10px;
    /* Ohne min-width:0 kann dieser Flex-Baustein NICHT unter seinen Inhalt schrumpfen
       (Vorgabe ist min-width:auto). Bei einem langen Teamnamen wurde die Zeile dadurch
       breiter als der Platz, und weil .tp-slot-row overflow:hidden hat, verschwanden die
       Knoepfe rechts — Klasse, Spieler, Entfernen — einfach am Rand. Gemessen bei 224px
       Zeilenbreite: 112px Ueberlauf, mit dieser Zeile 0. Der Name selbst kuerzt sich
       ohnehin schon per text-overflow, sobald er darf. */
    min-width: 0;
}

/* Der Teamname im Planungs-Slot — darf ZWEI Zeilen nutzen.
   Gemessen bei einer 280px-Gruppenkarte: von der Breite gehen 130px an die vier Knoepfe
   rechts und 67px an Wappen/Kuerzel/Abstaende links — fuer den Namen bleiben 65px, also
   rund neun Zeichen. Einzeilig war deshalb selbst "Werder Bremen" abgeschnitten.
   Zwei Zeilen verdoppeln den Vorrat, ohne irgendwo Platz wegzunehmen: die Schwelle, ab
   der ein 20-Zeichen-Name vollstaendig steht, faellt von 450px auf 340px Kartenbreite.
   Bewusst NICHT gemacht: kleinere Schrift (senkt genau die Lesbarkeit, um die es geht)
   und schmalere Knoepfe (die sind mit 26-38px schon unter der bequemen Antippgroesse).
   line-clamp deckelt bei zwei Zeilen — danach wird gekuerzt, statt die Zeile wachsen zu
   lassen. overflow-wrap: anywhere, damit ein einzelnes langes Wort umbricht statt zu
   verschwinden. */
/* --- Wappen und Klasse in den Lostoepfen ----------------------------------
   Gemeldet am 06.09.2026: Der Gruppen-Platz zeigt beides, der Topf daneben
   nichts — dasselbe Team sah je nach Flaeche anders aus. Gebaut wird die Zeile
   jetzt an EINER Stelle (window.topfZeileHtml, plan-algorithms.js), fuer die
   Toepfe der Standardphase und die des K.O. gemeinsam.

   Kleiner als am Gruppen-Platz (26 statt 30 px): Ein Topf ist eine Liste zum
   Ueberfliegen, kein Platz zum Einrichten. Der Knopf traegt zusaetzlich ein
   Inline-`background:transparent` — ohne das faerbt `body.dark-mode button`
   ihn grau um, dessen Ausnahmeliste prueft genau auf dieses Muster. */
.tp-topf-wappen {
    width: 26px;
    height: 26px;
    padding: 2px;
    border: 1px dashed var(--border-color);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    color: var(--primary-strong);
}

/* Liegt ein Wappen vor, soll es fuer sich stehen — der gestrichelte Rahmen ist
   die Einladung, eines zu setzen, und danach nur noch Rauschen. */
.tp-topf-wappen.ist-gesetzt {
    border-color: transparent;
}

/* Ein Doppel hat kein eigenes Wappen zum Bearbeiten: gezeigt ja, angeboten nein. */
.tp-topf-wappen.ist-fest {
    cursor: default;
}

.tp-topf-klasse {
    flex-shrink: 0;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: var(--fs-2xs);
    font-weight: var(--weight-strong);
    line-height: 1;
    white-space: nowrap;
    color: var(--text-body);
    background: var(--surface-soft);
}


.tp-slot-name {
    flex: 1;
    min-width: 0;
    /* Schriftgroesse bewusst NICHT hier: die Slot-Arten setzen sie unterschiedlich
       (Gruppen --fs-base, Setzkasten/Doppel --fs-md). Die Klasse regelt nur, wie der
       Name bei Platzmangel umbricht — sonst waere sie an einer Stelle nicht nutzbar. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

/* Platzhalter-Kuerzel (A1, B2 …) NEBEN dem Namen statt darunter: als eigene
   Zeile machte es jeden Slot zweizeilig, ohne mehr auszusagen.
   Aussehen und Dunkelmodus stehen seit v2.7.6 gemeinsam mit .tp-name--frei weiter
   unten — die Planung hatte vorher eine eigene Fassung, und dadurch war ihr
   Schildchen als einziges 10 statt 11 px gross. */

/* --- Platzhalter: ein unbesetzter Platz -----------------------------------
   DASSELBE SCHILDCHEN wie in der Planung — dort steht „S1" als graue Pille neben
   dem Namen (.tp-slot-tag), und genau diese Form gilt jetzt in allen Ansichten.
   Die Werte sind absichtlich Zeichen fuer Zeichen dieselben wie in .tp-slot-tag;
   getrennt gehalten sind die beiden nur, weil .tp-slot-tag zusaetzlich
   `flex: 0 0 auto` fuer das Planungs-Raster mitbringt, das anderswo stoert.
   Wer die Optik aendert, muss BEIDE Regeln anfassen.

   Bewusst NICHT: blasse Schrift in Normalstaerke. Das sah aus wie das ausgegraute
   Wort „Spieler waehlen" und nicht wie das Kuerzel — und opacity als Aus-Zustand
   ist im Projekt ohnehin abgeschafft.

   NICHT hier: Beamer, Schiri, Druck und Share-Bilder. Dort IST der Platzhalter die
   ganze Information und niemand kann etwas daran aendern; die Klasse wird dort gar
   nicht erst gesetzt (noPlaceholderEmphasis). */
/* === DIE OPTIK ALLER TEILNEHMER-NAMEN =====================================
   Hier und NUR hier. Jeder Name im Programm kommt als <span class="tp-name">
   heraus, freie Plaetze zusaetzlich mit --frei. Wer das Aussehen aendern will,
   aendert diese drei Regeln — keine Ansicht, kein JavaScript.

   .tp-name ist absichtlich LEER: So erbt ein echter Name weiterhin genau das
   Aussehen seiner Umgebung (Spielplan fett, Tabelle halbfett, Beamer gross).
   Wer echten Namen ein eigenes Aussehen geben will, traegt es hier ein — eine
   Regel am Element schlaegt jeden geerbten Wert, unabhaengig von der Spezifitaet.
   ========================================================================== */
.tp-name {
    /* EINE Groesse fuer ALLE Ansichten — wie beim Platzhalter darunter.
       Relativ (em) war es vorher, und dadurch war derselbe Name je Umgebung anders
       gross: Planung-Gruppen 16, Tabelle 14,1, Spielplan 13,2, Felderplan 12,2,
       Zentrale 15 px. Genau diese Uneinheitlichkeit fiel auf.
       Ueber das Token statt fester Pixel, damit die Schrifteinstellung des Nutzers
       (--tp-font-scale) weiterhin wirkt. --fs-md sind 13px, der Platzhalter 11px —
       der Abstand von 2px bleibt damit ueberall gleich.
       Alles ausser der Groesse bleibt geerbt (Staerke, Farbe der jeweiligen Ansicht).

       BEAMER/SCHIRI sind ausgenommen: Dort tragen auch echte Namen die Marke
       --schlicht (siehe window.nameHtml), und die stellt `font-size: inherit` wieder
       her. In der Halle zaehlt Lesbarkeit mehr als die Angleichung.
       DRUCK und Share-Bilder sind nicht betroffen: Sie zeichnen ueber
       extractTeamString und tragen die Marke gar nicht. */
    font-size: var(--fs-md);
}

/* Freier Platz: graue Pille. Groesse RELATIV (0.75em), damit sie in jeder Umgebung
   unter dem Zeilenkasten des Namens daneben bleibt  eine feste Stufe passt nur zu
   genau EINER Namensgroesse. */
/* HOEHE IM BLICK BEHALTEN: Die Pille ist so hoch wie Schriftgroesse x line-height
   plus 2px Polster. Als die Schrift von 0.75 auf 0.80em stieg, musste line-height von
   1.3 auf 1.15 sinken — sonst waere sie hoeher als der Zeilenkasten des Namens daneben
   und wuerde die Zeile auseinanderdruecken.

   FARBE: --text-subtle ergab auf der Pille nur 4,51:1 (hell) und 4,29:1 (dunkel). Die
   dunkle Fassung lag damit UNTER der Lesbarkeitsgrenze von 4,5:1 — und zwar fuer kleine
   Schrift, wo die 3:1-Ausnahme fuer Grosstext nicht greift. Eine Stufe kraeftiger bringt
   6,92:1 bzw. 7,40:1. Die Unterscheidung leidet nicht: Sie traegt sich ueber die Pille,
   die kleinere Schrift und die Staerke. */
.tp-name--frei,
.tp-slot-tag {
    display: inline-block;
    /* EINE Groesse fuer ALLE Ansichten. Relativ (em) war fuer die Hoehe richtig, ergab aber
       je Umgebung eine andere Groesse: Spielplan 11,2 — Tabelle 12,0 — Felderplan 10,4 —
       Planung 10,0 px. Das fiel als Uneinheitlichkeit auf.
       Nicht als feste px-Angabe, sondern ueber das Schrift-Token: So folgt das Schildchen
       weiterhin der Schrifteinstellung des Nutzers (--tp-font-scale), die auf feste Pixel
       keine Wirkung haette.
       24.08.2026: von calc(--fs-2xs x1.1)=11px auf --fs-sm=12px angehoben (Wunsch: die
       Platzhalter wirkten in der Live-Zentrale zu klein). Weil es EINE Regel ist, gilt es
       sofort ueberall gleich — genau dafuer war die Vereinheitlichung gedacht. Die Pillen-
       hoehe darunter musste dafuer nachgezogen werden. */
    font-size: var(--fs-sm);
    font-weight: var(--weight-strong);
    color: var(--text-body);
    /* 13.09.2026: eine Stufe dunkler (vorher --surface-soft #f1f5f9). Mit der Textmarker-Form
       war der Umriss auf weissem Grund kaum zu sehen. Schrift --text-body darauf: 6,2:1. */
    background: var(--border-color);
    /* FORM „TEXTMARKER" (13.09.2026, Wunsch: weniger generisch, handgemacht, asymmetrisch).
       Die Form schneidet eine Maske aus drei Teilen aus — NICHT eine einzige gestreckte:
         links  feste Breite .42em, ausgefranst, unten weiter ausgreifend
         Mitte  waechst mit dem Text, faellt nach rechts leicht ab (Schraege)
         rechts feste Breite .42em, ausgefranst, oben weiter ausgreifend
       Eine gestreckte Gesamtform zog die Fransen bei „Sieger Gruppe A" flach und breit.
       Die Mitte ist .8em statt .84em schmaler als das Ganze: Die Teile ueberlappen um
       .02em, sonst blitzt an den Stoessen eine Haarlinie auf.
       Farbe und Dunkelmodus bleiben unberuehrt — die Maske aendert nur den Umriss.
       border-radius ist 0, weil eine Rundung die Spitzen der Enden abschnitt.
       padding .55em: Der tiefste Einschnitt liegt ~3,3px im linken Ende; mit 5px stand
       die Schrift auf der Kante. Hoehe unveraendert (siehe HOEHE unten). */
    -webkit-mask:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 30' preserveAspectRatio='none'%3E%3Cpath d='M9 3.5L10 3.45L10 28.9L3 29L6.5 23.5L1 18.5L5.5 13L2 8.5Z'/%3E%3C/svg%3E") left / .42em 100% no-repeat,
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 30' preserveAspectRatio='none'%3E%3Cpath d='M0 3.45L100 1.15L100 27.05L0 28.9Z'/%3E%3C/svg%3E") center / calc(100% - .8em) 100% no-repeat,
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 30' preserveAspectRatio='none'%3E%3Cpath d='M0 1.15L8 1L5.5 7L9 11.5L4.5 17L7 21.5L2.5 27L0 27.05Z'/%3E%3C/svg%3E") right / .42em 100% no-repeat;
    mask:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 30' preserveAspectRatio='none'%3E%3Cpath d='M9 3.5L10 3.45L10 28.9L3 29L6.5 23.5L1 18.5L5.5 13L2 8.5Z'/%3E%3C/svg%3E") left / .42em 100% no-repeat,
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 30' preserveAspectRatio='none'%3E%3Cpath d='M0 3.45L100 1.15L100 27.05L0 28.9Z'/%3E%3C/svg%3E") center / calc(100% - .8em) 100% no-repeat,
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 30' preserveAspectRatio='none'%3E%3Cpath d='M0 1.15L8 1L5.5 7L9 11.5L4.5 17L7 21.5L2.5 27L0 27.05Z'/%3E%3C/svg%3E") right / .42em 100% no-repeat;
    border-radius: 0;
    padding: 1px .55em;
    /* Die Pille ist so hoch wie Schriftgroesse x line-height + 2px Polster und muss unter
       den ENGSTEN Zeilenkasten passen — den Felderplan mit line-height 1.12 auf --fs-md
       (14,6 px). Bei 12px Schrift bleiben mit line-height 1.0 genau 12+2=14 px; 1.05 waeren
       14,6 und damit auf Kante. Deshalb 1.0 statt frueher 1.1. */
    line-height: 1.0;
    letter-spacing: 0.02em;
    vertical-align: middle;
    white-space: nowrap;
}

/* Die Planung braucht zusaetzlich, dass das Schildchen im Raster nicht mitwaechst.
   Sonst ist es dieselbe Darstellung — deshalb teilt es sich oben die Regel. */
.tp-slot-tag {
    flex: 0 0 auto;
}

body.dark-mode .tp-name--frei,
body.dark-mode .tp-slot-tag {
    background: rgba(148, 163, 184, 0.16);
    color: #cbd5e1;
}

/* Beamer, Schiri, Druck: Der NAME bleibt gekuerzt („S3"), aber ohne Pille —
   dort ist der Platzhalter die ganze Information und niemand kann etwas daran
   aendern. Setzt die Pille zurueck, statt eine zweite Darstellung zu pflegen. */
.tp-name--schlicht {
    display: inline;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    background: none;
    -webkit-mask: none;
    mask: none;
    border-radius: 0;
    padding: 0;
    line-height: inherit;
    letter-spacing: inherit;
}

/* GROESSE AUF DEM LIVE DISPLAY UND BEIM SCHIRI  warum hier eine staerkere Regel noetig ist:

   1. referee-hub.js spritzt zur LAUFZEIT ein style-Element ein, das allen Nachfahren von
      .stacked-team sowie der .player-line die Groesse --fs-base mit !important aufzwingt.
      Das landet NACH dieser Datei im Dokument; bei gleicher Spezifitaet und beidem
      !important gewinnt die SPAETERE Regel. Ein blosses inherit-!important weiter oben
      reichte deshalb nicht  nachgemessen, es blieb wirkungslos.
   2. Der Nachfahren-Stern trifft den span.tp-name erst, seit die Namen in ein eigenes
      Element gewickelt sind; vorher stand dort blanker Text und die Regel lief ins Leere.

   Zwei Klassen am SELBEN Element ergeben (0,2,0) und schlagen den Nachfahren-Stern (0,1,0)
   unabhaengig von der Reihenfolge. Ohne das klebte der Teamname auf dem Live Display bei
   14px, waehrend der Regler fuer Teamnamen die Elternknoten bis 250 % vergroesserte.
   Beide Regler  der im Display-Menue und der in der Zentrale  enden in derselben
   Funktion updateTeamNameFontSize (display-mode.js), deshalb genuegt diese eine Regel. */
.tp-name.tp-name--schlicht {
    font-size: inherit !important;
}

body.dark-mode .tp-name--schlicht {
    background: none;
    color: inherit;
}


/* --- Naechste-Schritte-Leiste ---------------------------------------------
   Frueher eine Karte mit ~265px Hoehe plus, nach dem Wegklicken, eine zweite
   Zeile als Rueckweg. Jetzt EIN Element mit drei Zustaenden:
     data-state="auto"    noch nie angefasst -> Desktop offen, Handy zu
     data-state="open"    ausdruecklich aufgeklappt
     data-state="closed"  ausdruecklich zugeklappt (ersetzt das alte Ausblenden)
   Der Zustand steckt im Attribut statt in einer JS-Breitenabfrage, damit
   Drehen des Geraets sofort wirkt — _renderLabsGroupsInternal laeuft zwar per
   Heartbeat, zeichnet aber ohne Aenderung nicht neu. */
.tp-nextstep {
    padding: 14px 18px;
}

.tp-nextstep[data-state="closed"] {
    display: none;
}

/* EIN Info-Knopf fuer die ganze App.

   Das „i" in der Aktionszeile (tp-nextstep-toggle) sah schon so aus: gerahmter
   Symbolknopf, gleiche Hoehe wie die Knoepfe daneben. In der Phasen-Kopfzeile
   (Gruppenphase, K.O.-Phase) stand dagegen ein 14 px grosses graues Kreischen aus
   der Klasse wiz-info-i — dieselbe Bedeutung, aber so klein, dass es uebersehen
   wurde. Beide teilen sich jetzt diese Regel; tp-info-btn ist der Name fuer neue
   Stellen. Der Dunkelmodus kommt bei beiden aus .tp-action-btn, das an beiden
   Knoepfen mit dransteht. */
.tp-info-btn,
.tp-nextstep-toggle {
    padding: 9px 11px;
    background: var(--surface-page);
    color: var(--text-body);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.tp-info-btn:hover,
.tp-nextstep-toggle:hover {
    border-color: var(--primary-soft-border);
    color: var(--primary-strong);
    background: var(--primary-soft-bg);
}

.tp-nextstep-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    min-height: 26px;
    border: none;
    background: var(--surface-soft);
    color: var(--text-body);
    border-radius: 8px;
    cursor: pointer;
    font-weight: var(--weight-strong);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Schleifchen-/Doppel-Duell-Slots ---------------------------------------
   Standen bis v2.6.98 zweizeilig (Name, darunter „SLOT 1") in fest 56px hohen
   Zellen. Einzeilig mit vorangestelltem Kuerzel reichen 44px. Fuellzellen am
   Rasterende teilen sich die Regel, sonst laufen die Hoehen auseinander. */
/* min-height statt height: Ein zweizeiliger Spielername braucht mehr als 44px. Bei fester
   Hoehe waere die zweite Zeile abgeschnitten gewesen. Die Fueller ziehen als Rasterzellen
   automatisch mit, die Reihen bleiben also buendig. */
.setzkasten-slot,
.setzkasten-slot-filler {
    min-height: 44px;
}

.setzkasten-slot .tp-slot-left {
    padding: 4px 10px;
}

/* --- Menue: Trennlinie statt vierter Abschnittsueberschrift ---------------- */
.sidebar-submenu-sep {
    height: 1px;
    margin: 7px 10px 5px;
    background: var(--border-color);
}

body.dark-mode .sidebar-submenu-sep {
    background: rgba(255, 255, 255, 0.1);
}

/* --- Schwelle 1: Tablet hochkant und Handy -------------------------------- */
@media (max-width: 899px) {
    .phase-card {
        margin: 6px 0 8px;
    }

    .tp-phase-head {
        padding: 3px 10px;
    }

    .tp-phase-body {
        padding: 8px 10px;
        gap: 8px;
    }

    .phase-card .phase-card-title {
        letter-spacing: 0.03em;
    }

    .tp-slot-row {
        min-height: 40px;
    }

    .tp-slot-left {
        padding: 5px 8px;
    }

    .tp-nextstep {
        padding: 12px 14px;
    }

    .tp-nextstep[data-state="auto"] {
        display: none;
    }

    /* min-height statt height — siehe Begruendung bei der Grundregel weiter oben. */
    .setzkasten-slot,
    .setzkasten-slot-filler {
        min-height: 40px;
    }

    .setzkasten-slot .tp-slot-left {
        padding: 3px 8px;
    }

    /* Untertitel im Primaerknopf ("Ohne Ergebnisse zu loeschen") kostet eine
       zweite Zeile IM Knopf. updateScheduleActionLabels() setzt dort nur
       display:'' — ein leerer Inline-Wert, gegen den diese Regel gewinnt. */
    [data-schedule-action-sublabel] {
        display: none;
    }
}

/* --- Schwelle 2: Handy ----------------------------------------------------
   Das Wort verschwindet, title/aria-label bleiben am Knopf stehen. */
@media (max-width: 599px) {
    .tp-btn-label-wide {
        display: none;
    }

    .tp-mode-btn {
        padding: 0 9px;
    }
}

/* =========================================================================
   OFFLINE-STATUS — Chip statt Band                    (Aufbau: pwa-offline.js)
   Der Hinweis sitzt in der Kopfzeile (unter 900px) bzw. in der Seitenleisten-
   Fußzeile (ab 900px) und kostet dadurch keine eigene Höhe. Der frühere
   Streifen über die volle Breite wurde auf 355px drei Zeilen hoch.
   ========================================================================= */

.tp-offline-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid var(--accent-amber-border);
    /* background und color setzt pwa-offline.js inline auf die Bernstein-Token –
       nur so nehmen die beiden globalen Dunkelmodus-Regeln für <button> den
       Chip aus (siehe Begründung dort). */
    font-family: inherit;
    font-size: var(--fs-xs);
    font-weight: var(--weight-bold);
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
}

.tp-offline-chip:hover {
    border-color: var(--color-warning);
}

.tp-offline-chip-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-warning);
    flex-shrink: 0;
}

/* "lokal gespeichert" ist die Beruhigung zum Wort "Offline". Sie erscheint
   nur dort, wo Platz dafür ist — in der Kopfzeile bleibt es beim Wort. */
.tp-offline-chip-note {
    display: none;
    font-weight: var(--weight-medium);
}

/* --- Kopfzeile (unter 900px) --- */
.app-header .tp-offline-chip {
    margin-right: 8px;
}

/* Der mittig schwebende Turniername darf nicht unter den Chip laufen. Die
   Grundregel reserviert 180px für Logo, Avatar und Burger — mit Chip kommen
   rund 95px dazu. Gilt nur, solange der Chip wirklich hängt. */
body.is-offline .tournament-title-centered {
    max-width: calc(100% - 275px) !important;
}

/* Auf dem Handy zählt jeder Punkt: Der Turniername steht mittig, der Chip nur
   rechts — jedes Pixel Chip kostet den Namen also zwei. Deshalb hier ein
   knapperer Chip und eine entsprechend kleinere Reserve. */
@media (max-width: 599px) {
    .app-header .tp-offline-chip {
        gap: 5px;
        padding: 4px 8px;
        font-size: var(--fs-2xs);
    }

    body.is-offline .tournament-title-centered {
        max-width: calc(100% - 258px) !important;
    }
}

/* --- Seitenleisten-Fußzeile (ab 900px) --- */
.sidebar-footer .tp-offline-chip {
    display: flex;
    width: 100%;
    justify-content: flex-start;
    margin-bottom: 10px;
    padding: 8px 10px;
    border-radius: 10px;
}

.sidebar-footer .tp-offline-chip-note {
    display: inline;
}

.sidebar-footer .tp-offline-chip-note::before {
    content: "· ";
}

/* --- Notnagel: keine der beiden Leisten vorhanden (siehe pwa-offline.js) --- */
.tp-offline-chip-floating {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 999997;
    box-shadow: var(--shadow-sm);
}

@media print {
    .tp-offline-chip {
        display: none !important;
    }
}

/* ============================================================================
   FARBACHSE — Kantenstreifen, Chip, Legende

   Der KANTENSTREIFEN ist die eigentliche Suchhilfe, nicht der Chip. Ein
   10x10-Punkt ist zum Ueberfliegen zu klein; eine durchgehende Kante ueber die
   volle Zeilenhoehe bildet ueber mehrere Zeilen hinweg ein Muster, das man aus
   zwei Metern noch sieht — auf dem Beamer und auf dem ausgedruckten Aushang,
   wo niemand filtern kann. Der Chip traegt weiterhin den NAMEN und ist die
   Absicherung fuer alle, die Farben schlecht unterscheiden: Farbe beschleunigt,
   sie ersetzt nichts.

   WARUM ::before UND NICHT border-left ODER EINE EIGENE SPALTE:
   Die Zeile ist ein Raster, dessen Spaltenaufteilung an EINER Stelle steht
   (--tp-schedule-rest, ganz oben) und von zwei Dateien benutzt wird. Eine
   neunte Spalte muesste dort hinein und beide Aufrufer treffen. Ein
   border-left wiederum aendert die Zeilenbreite. Das Pseudo-Element liegt
   ueber dem vorhandenen Innenabstand und kostet kein Layout.

   Die Farbe kommt als --tp-axis-fill VOM ELEMENT (farbachse.js setzt sie als
   Token-VERWEIS, nicht als fester Wert). Deshalb steht hier absichtlich keine
   einzige Farbe. */
.match-tabular-row.tp-axis-on,
.mobile-only-card.tp-axis-on {
    position: relative;
}

/* STREIFEN NUR OHNE CHIP (13.09.2026). Steht Gruppe oder Niveau schon als farbiger
   Chip in der Zeile, waere der Streifen eine Doppelung  die Chips stehen untereinander
   in derselben Spalte und bilden das Suchmuster selbst. Er bleibt, wo er das EINZIGE
   Farbzeichen ist (z. B. Liga-Spiele mit Gruppenfarbe: dort zeigt die Zeile keinen Chip).
   :has() statt einer Klasse aus dem JavaScript: Die Regel folgt damit dem, was wirklich
   gezeichnet wurde, und kann nicht mit einer Bedingung im Code auseinanderlaufen. */
.match-tabular-row.tp-axis-on:not(:has(.tp-axis-chip))::before,
.mobile-only-card.tp-axis-on:not(:has(.tp-axis-chip))::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: var(--tp-axis-kante, var(--tp-axis-fill, transparent));
    pointer-events: none;
}

/* Plaetze 9 bis 12: derselbe Ton, gestreifte Kante. Harte Farbstopps, kein
   Verlauf — der Streifen soll gezaehlt, nicht bewundert werden. Er ueberlebt
   damit auch den Graustufendruck und jede Farbsehschwaeche. */
.match-tabular-row.tp-axis-on.tp-axis-striped:not(:has(.tp-axis-chip))::before,
.mobile-only-card.tp-axis-on.tp-axis-striped:not(:has(.tp-axis-chip))::before {
    background: repeating-linear-gradient(135deg,
        var(--tp-axis-kante, var(--tp-axis-fill, transparent)) 0 4px,
        transparent 4px 8px);
}


/* KLASSE UND NIVEAU IN DEN VERWALTUNGSANSICHTEN — bis 18.08.2026 trugen beide
   Chips dieselbe tuerkise Toenung und standen in derselben Zeile nebeneinander.
   Zwei Bedeutungen, ein Aussehen.

   Der Unterschied liegt jetzt in der BEHANDLUNG, nicht in der Farbe:
     Klasse  = gefuellt, neutral      (eine Zugehoerigkeit)
     Niveau  = umrandet, offen        (eine Einstufung)
   Damit sind beide auch dann auseinanderzuhalten, wenn die Farbachse auf
   "Gruppe" oder "aus" steht und gar keine Farbe im Spiel ist. Farbe kommt
   obendrauf, sie traegt die Unterscheidung nicht allein. */
.tp-class-chip {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 6px;
    background: var(--surface-soft);
    color: var(--text-body);
    font-size: var(--fs-xs);
    font-weight: var(--weight-bold);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tp-level-chip {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: transparent;
    color: var(--text-body);
    font-size: var(--fs-xs);
    font-weight: var(--weight-bold);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mit aktiver Niveau-Achse wird aus der Umrandung eine Flaeche — dieselbe Farbe
   wie im Spielplan, im Aushang und in der Halle. */
.tp-level-chip.tp-axis-on {
    border-color: transparent;
    background: var(--tp-axis-fill);
    color: var(--tp-axis-text);
}

.tp-level-chip.tp-axis-on.tp-axis-striped {
    background-image: repeating-linear-gradient(135deg,
        var(--axis-stripe-overlay) 0 3px,
        transparent 3px 6px);
}

/* Noch kein Niveau gesetzt: gestrichelt statt gefuellt — eine offene Stelle, kein Wert. */
.tp-level-chip.tp-level-leer {
    border-style: dashed;
    color: var(--text-subtle);
}

/* NIVEAU-ZEILE (Planungshilfe UND Bereich "Aendern") — eine Zeile je Niveau mit
   Haekchen, Farbtupfer, Reihenfolge-Pfeilen, Namensfeld, Stepper, "je Klasse" und
   Loeschknopf. Nebeneinander braucht das rund 400px; gemessen am 20.08.2026 bei
   350px Fensterbreite: 380px Inhalt in einer 268px breiten Zeile — Stepper, Zahl
   und Loeschknopf lagen hinter dem rechten Rand und waren nur ueber einen
   Querbalken erreichbar.

   KEIN BREAKPOINT, sondern Umbruch nach Bedarf: Die rechte Gruppe (Stepper,
   "je Klasse", Loeschknopf) ist EIN Flex-Element und rutscht als Ganzes in die
   zweite Zeile, sobald der Platz nicht reicht. Eine Pixelgrenze muesste die
   Zeilenbreite raten, und die haengt hier an drei geschachtelten Innenabstaenden
   (Modal, Body, Karte), die je nach Ansicht verschieden sind — der Wizard misst
   bei 350px Fenster 268px Zeile, der Editor einen anderen Wert.

   Beide Ansichten teilen sich diese Regel bewusst: Die Zeilen sind in Aufbau und
   Bedienung identisch, zwei Fassungen wuerden beim naechsten Umbau auseinander-
   laufen. */
/* --- DIE NIVEAU-ZEILE — ein Bauplan  (Aufbau: window.niveauZeileHtml) --------

   Sie stand bis zum 04.09.2026 ZWEIMAL fast wortgleich im Quelltext: im
   Phasen-Editor (_rerenderWizPlanLevels) und in der Planungshilfe (levelMatrix).
   Nach Normierung der Aufrufziele stimmten die beiden zu 86 % ueberein — und
   waren doch schon auseinandergelaufen: Namensfeld 34 gegen 36 px, Loeschknopf
   28 gegen 30 px, und derselbe Tooltip einmal mit Umlauten, einmal ohne
   („Farbe waehlen" / „Farbe wählen").
   ------------------------------------------------------------------------- */
.tp-niveau-zeile {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Ausgeschaltet: Farbe, Name und Zähler treten zurück. Pfeile und Löschkreuz NICHT — sie bleiben
   bedienbar und müssen lesbar sein (bis 26.09.2026 dämpfte die ganze Zeile, ✕ kam auf 1,9:1). */
.tp-niveau-zeile.ist-aus .tp-niveau-farbe,
.tp-niveau-zeile.ist-aus .tp-niveau-name,
.tp-niveau-zeile.ist-aus .tp-niveau-werte > :not(.tp-niveau-weg) {
    opacity: 0.6;
}

.tp-niveau-haken {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
    cursor: pointer;
    flex-shrink: 0;
}

/* Der Farbtupfer traegt seine Farbe als Variable am Element (nivChip.vars) —
   deshalb steht hier nur der Rahmen fuer den ungefaerbten Fall. */
.tp-niveau-farbe {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    flex-shrink: 0;
    cursor: pointer;
    background: transparent;
    border: 1px dashed var(--border-strong);
}

.tp-niveau-farbe.ist-gefaerbt {
    background: var(--tp-axis-fill);
    border: 1px solid transparent;
}

.tp-niveau-pfeile {
    display: inline-flex;
    flex-direction: column;
    flex-shrink: 0;
}

.tp-niveau-pfeil {
    border: none;
    background: transparent;
    color: var(--text-subtle);
    width: 20px;
    height: 15px;
    padding: 0;
    line-height: 1;
    cursor: pointer;
    font-size: var(--fs-2xs);
}

.tp-niveau-pfeil:disabled {
    color: var(--border-strong);
    cursor: default;
}

.tp-niveau-name {
    flex: 1;
    min-width: 80px;
    height: 34px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0 9px;
    font-weight: var(--weight-strong);
    color: var(--text-strong);
    background: var(--bg-card);
    box-sizing: border-box;
    outline: none;
}

.tp-niveau-weg {
    border: none;
    background: transparent;
    color: var(--accent-red-text);
    width: 28px;
    height: 28px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: var(--weight-strong);
    flex-shrink: 0;
}

/* Die drei Knopf-Arten hatten ihre Farben bisher INLINE und fielen damit unter
   die Ausnahmeliste von `body.dark-mode button` (die prueft auf
   `[style*="background:transparent"]` und `[style*="background:var("]`). Als
   Klasse fallen sie nicht mehr darunter und wuerden grau uebermalt — Pfeile und
   Loeschkreuz saessen dann in einem grauen Kasten, der Farbtupfer verloere seine
   Farbe. Dieselbe Falle wie bei der Rueckfrage weiter unten. */
body.dark-mode .tp-niveau-pfeil,
body.dark-mode .tp-niveau-weg,
body.dark-mode .tp-niveau-farbe {
    background: transparent !important;
    border-color: transparent !important;
}

body.dark-mode .tp-niveau-farbe {
    border: 1px dashed var(--border-strong) !important;
}

body.dark-mode .tp-niveau-farbe.ist-gefaerbt {
    background: var(--tp-axis-fill) !important;
    border: 1px solid transparent !important;
}

body.dark-mode .tp-niveau-pfeil {
    color: var(--text-subtle) !important;
}

body.dark-mode .tp-niveau-pfeil:disabled {
    color: var(--border-strong) !important;
}

body.dark-mode .tp-niveau-weg {
    color: var(--accent-red-text) !important;
}

.tp-niveau-werte {
    display: flex;
    align-items: center;
    gap: 6px;
    /* Nicht mitwachsen und nicht schrumpfen: Der Stepper hat eine Mindestgroesse,
       unter der er nicht mehr zu treffen ist. Lieber umbrechen als quetschen. */
    flex: 0 0 auto;
    /* Rechtsbuendig — in einer Zeile wie in zwei. */
    margin-left: auto;
}

/* Auf sehr schmalen Bildschirmen blendet Zeile 11025 den Klassen-Chip der Spielerkarte
   aus (.pc-class-badge { display: none }). Diese Regel steht WEITER OBEN in der Datei;
   .tp-class-chip mit display:inline-block wuerde sie bei gleicher Auszeichnungskraft
   ueberstimmen und den Chip zurueckholen. Deshalb hier dieselbe Grenze noch einmal —
   NICHT loeschen, ohne dort nachzusehen. */
@media (max-width: 480px) {
    .pc-class-badge.tp-class-chip { display: none; }
}


/* ===================================================================
   SPIELPLAN, TABELLEN UND TEILNEHMER — EINE STELLE (22.08.2026)
   -------------------------------------------------------------------
   Diese Regeln standen bis heute DREIMAL im Projekt, als eingespritzte
   \3c style>-Bloecke in schedule-view.js, standings-templates.js und
   players-teams.js. Alle drei haengten sie in denselben <head> — wer
   gewann, entschied allein, welche Ansicht zuletzt gezeichnet wurde.

   Gemessen vor dem Zusammenlegen: 149 Regel-Vorkommen unter 81
   verschiedenen Selektoren. 61 Selektoren standen in mehr als einer
   Datei, 55 davon wortgleich.

   WAS DIE DOPPELUNG ANGERICHTET HAT — fuenf Fassungen waren
   auseinandergelaufen, und keine Ansicht konnte etwas dafuer:
     .tp-segmented-item              Teilnehmer fett, sonst mittel
     .tp-filter-toggle               Teilnehmer fett, sonst mittel; die
                                     Spielplan-Fassung setzte `border`
                                     ZWEIMAL und nahm dem Knopf dabei
                                     seinen Rahmen (entfaellt)
     .btn-live-pill.active           Schatten nur in einer Fassung
     .dark-mode .tp-segmented-item.active   dito
     .dark-mode .btn-live-pill.active       dito
   Uebernommen wurde jeweils die Fassung aus schedule-view.js; die
   Ausnahme steht als Kommentar an der Regel.

   ZWEI REGELN WAREN NICHT STATISCH: `.league-date-divider` und deren
   ::after trugen `${isDarkMode ? … : …}` mitten im CSS. Sie stehen
   jetzt als gewoehnliche Regel plus `body.dark-mode`-Zwilling darunter.

   WARUM HIERHER und nicht in eine gemeinsame Funktion: Die App laedt
   style_v2.css ohnehin, und nach ihr redet keine Datei mehr mit (nur
   tp-ui-modern.css, und die kennt keinen dieser Selektoren). Eine
   Farbaenderung ist damit wieder EINE Aenderung.

   ACHTUNG: Weiter oben in dieser Datei stehen aeltere Fassungen von
   etwa 20 dieser Selektoren. Sie sind ab hier wirkungslos (gleiche
   Spezifitaet, spaetere Stelle) — genau wie vorher, als die JS-Bloecke
   sie ueberschrieben. Ihr Abbau ist der naechste Schritt.
   =================================================================== */
/*  */
/* SCHMALE LEISTEN (seit 13.09.2026): Reicht die Breite nicht, zeigen „Filter" und „Ansicht" nur
   ihr Sinnbild. Ihr Name bleibt als aria-label und title. Bei 350 px stand der Knopf sonst halb
   ausserhalb des Bildschirms (pruefe-ueberdeckung.js, „Kind ragt heraus"). Die Grenzen sind die
   gemessene Breite, ab der alles mit Beschriftung in eine Zeile passt, plus etwas Luft. */
.tp-schedule-nav,
.tp-standings-nav {
    container-type: inline-size;
}

@container (max-width: 400px) {
    .tp-schedule-nav .tp-knopf-text,
    .tp-standings-nav .tp-knopf-text {
        display: none;
    }
}

/* PHASENKOPF: Die Uhrzeit bricht nie um. Wird es eng, faellt nur das Wort „Uhr" weg. Bis
   13.09.2026 stand „UHR" bei 350 px allein in der zweiten Zeile. */
.tp-phase-head {
    container-type: inline-size;
}

@container (max-width: 420px) {
    .tp-phase-head .tp-uhr-wort {
        display: none;
    }
}

.tp-schedule-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: transparent;
    margin-top: 7px;
}

.tp-segmented-control {
    background: #f1f5f9;
    padding: 2px;
    border-radius: 10px;
    display: flex;
    gap: 2px;
    flex: 0 0 auto;
}

.tp-segmented-item {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: var(--fs-md);
    font-weight: var(--weight-medium);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    background: transparent;
    color: var(--text-body);
    display: flex;
    align-items: center;
    gap: 6px;
}

.tp-segmented-item:hover {
    color: #334155;
}

.tp-segmented-item.active {
    background: white;
    color: #0e7490;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

/* Der zweite border-Wert der Spielplan-Fassung ueberschrieb den ersten und nahm dem Knopf seinen Rahmen — entfallen. */
.tp-filter-toggle {
    padding: 7px 14px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    color: #475569;
    font-size: var(--fs-md);
    font-weight: var(--weight-medium);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.tp-filter-toggle:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.tp-filter-toggle.active {
    background: var(--primary-fill-bg);
    border-color: var(--primary-fill-border);
    color: var(--primary-fill-fg);
}

.tp-filter-drawer {
    max-height: 0;
    overflow: hidden;
    background: #f8fafc;
    border-bottom: 1px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 15px;
}

.tp-filter-drawer.open {
    max-height: 500px;
    padding: 12px 15px;
    border-bottom: 1px solid #e2e8f0;
}

.filter-row-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.dark-mode .tp-segmented-control {
    background: #0f172a;
}

.dark-mode .tp-segmented-item {
    color: var(--text-body);
}

.dark-mode .tp-segmented-item.active {
    background: #1e293b;
    color: #38bdf8;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.dark-mode .tp-filter-toggle {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

.dark-mode .tp-filter-toggle:hover {
    background: #334155;
}

.dark-mode .tp-filter-drawer {
    background: #0f172a;
}

.dark-mode .tp-filter-drawer.open {
    border-color: #334155;
}

.league-matchday-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 15px 12px;
    background: transparent;
    flex-wrap: wrap;
}

.league-matchday-nav-inner {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 4px;
}

.league-matchday-nav-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.league-matchday-nav-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.league-matchday-select {
    border: none;
    outline: none;
    background: transparent;
    color: #0f172a;
    font-size: var(--fs-sm);
    font-weight: var(--weight-strong);
    min-width: 220px;
    cursor: pointer;
}

.dark-mode .league-matchday-nav-inner {
    background: #0f172a;
    border-color: #334155;
}

.dark-mode .league-matchday-nav-btn {
    color: #94a3b8;
}

.dark-mode .league-matchday-nav-btn:hover {
    background: #1e293b;
    color: #e2e8f0;
}

.dark-mode .league-matchday-select {
    color: #e2e8f0;
}

/*  */
.tp-standings-row {
    transition: background-color 0.15s;
}

.tp-standings-row:hover {
    background-color: #e2e8f0;
}

.tp-standings-row.clickable {
    cursor: pointer;
}

.dark-mode .tp-standings-row:hover {
    background-color: rgba(255,255,255,0.05);
}

.tp-standings-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: transparent;
    margin-top: 7px;
}

.btn-live-pill {
    padding: 6px 14px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    color: #64748b;
    font-size: var(--fs-xs);
    font-weight: var(--weight-strong);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-live-pill:hover {
    background: #e2e8f0;
}

.btn-live-pill.active {
    background: var(--primary-fill-bg) !important;
    border: 1px solid var(--primary-fill-border) !important;
    color: var(--primary-fill-fg) !important;
    box-shadow: none !important;
}

.dark-mode .btn-live-pill {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

.dark-mode .btn-live-pill:hover {
    background: #334155;
}

.dark-mode .btn-live-pill.active {
    background: var(--primary-fill-bg) !important;
    border-color: var(--primary-fill-border) !important;
    color: var(--primary-fill-fg) !important;
}

.live-pulse-dot {
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
    animation: tp-pulse 1.5s infinite;
}

0% {
    transform: scale(1);
    opacity: 1;
}

50% {
    transform: scale(1.5);
    opacity: 0.5;
}

100% {
    transform: scale(1);
    opacity: 1;
}

.drawer-section-label {
    font-size: var(--fs-2xs);
    font-weight: var(--weight-strong);
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
    display: block;
}

/*  */
.match-score-box {
    min-width: 44px;
    width: auto;
    padding: 0 4px;
    height: 30px;
    margin: 0 auto;
    background: #f1f5f9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--weight-bold);
    font-size: var(--fs-lg);
    color: #1e293b;
    font-family: 'Inter', sans-serif;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.dark-mode .match-score-box {
    background: #0f172a;
    color: #f1f5f9;
    border: 1px solid #334155;
}

/* OFFENES SPIEL: vs" statt - : -" im grauen Kasten (13.09.2026). Der Kasten gehoert dem
   ERGEBNIS  steht er auch bei offenen Spielen, sehen gespielte und offene Zeilen gleich
   schwer aus, und der Blick findet die Ergebnisse nicht. Gilt ueberall, wo ein offenes Spiel
   im Kasten stand: Spielplan (Zeile und Karte), Felderplan, Schiri-Listen.
   Laufende Spiele ohne Stand behalten den Kasten (0 : 0)  sie sind nicht offen.
   Hoehe und Breite bleiben, damit die Namen links und rechts nicht springen. */
.match-score-box.ist-offen,
.dark-mode .match-score-box.ist-offen {
    background: transparent;
    border-color: transparent;
}

.tp-vs {
    font-size: var(--fs-sm);
    font-weight: var(--weight-medium);
    font-style: normal;
    color: var(--text-subtle);
    letter-spacing: 0.04em;
}

.match-fp-box {
    min-width: 36px;
    width: auto;
    padding: 0 3px;
    height: 24px;
    margin-left: auto;
    background: #f0fdf4;
    /* War #16a34a — auf der blassen gruenen Flaeche nur 3,15:1. #166534 ist derselbe
       Farbton, zwei Stufen dunkler, und schafft dort 7,4:1. */
    color: #166534;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--weight-medium);
    font-size: var(--fs-md);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.dark-mode .match-fp-box {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.set-detail-row {
    font-size: var(--fs-xs);
    color: #94a3b8;
    font-weight: var(--weight-medium);
    text-align: center;
    margin-top: 2px;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.dark-mode .set-detail-row {
    color: #64748b;
}

.match-row-nr {
    font-weight: var(--weight-bold);
    font-size: var(--fs-sm);
    color: #94a3b8;
}

.match-row-meta {
    font-size: var(--fs-sm);
    font-weight: var(--weight-medium);
    color: #64748b;
}

.match-row-group {
    font-size: var(--fs-sm);
    font-weight: var(--weight-medium);
    /* War #94a3b8 = 2,56:1 auf Weiss. Jahrelang unsichtbar, weil die Pauschalregel .match-finished * es uebermalte;
    bei deren Abbau am 22.08.2026 kam es zum Vorschein. --text-subtle ist der hellste Ton, der auf allen ueblichen Flaechen noch traegt. */ color: var(--text-subtle);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 4px;
}

.match-row-team {
    font-weight: var(--weight-bold);
    font-size: var(--fs-base);
    color: #1e293b;
    line-height: 1.25;
    display: flex;
    align-items: center;
    overflow: hidden;
    word-break: normal;
    overflow-wrap: normal;
    min-width: 0;
}

.match-row-team[style*="right"] {
    justify-content: flex-end;
}

.match-row-team[style*="left"] {
    justify-content: flex-start;
}

.match-row-team .schedule-team-inline {
    display: flex;
    align-items: center;
    column-gap: 7px;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    white-space: normal;
    flex-wrap: nowrap;
}

.match-row-team[style*="right"] .schedule-team-inline {
    justify-content: flex-end;
}

.match-row-team[style*="left"] .schedule-team-inline {
    justify-content: flex-start;
}

.match-row-team .schedule-team-inline > span:not(.schedule-team-name) {
    flex: 0 0 auto;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.match-row-team .schedule-crest-placeholder {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    visibility: hidden;
}

.match-row-team .schedule-team-name {
    min-width: 0;
    flex: 0 1 auto;
    max-width: 100%;
    display: block;
    overflow: hidden;
    text-overflow: clip;
    white-space: normal;
    line-height: 1.15;
    overflow-wrap: normal;
    word-break: normal;
}

.match-row-team[style*="right"] .schedule-team-name {
    text-align: right;
}

.match-row-team[style*="left"] .schedule-team-name {
    text-align: left;
}

.match-row-team .schedule-team-inline.has-crest .schedule-team-name {
    max-width: calc(100% - 37px);
}

.match-row-team .schedule-team-name .stacked-team, .match-row-team .schedule-team-name .player-line {
    white-space: normal !important;
    overflow: hidden !important;
    text-overflow: clip !important;
    max-width: 100%;
}

.match-row-team .schedule-class-badge {
    white-space: nowrap;
}

.dark-mode .match-row-team {
    color: #f1f5f9;
}

/*  */
[data-match-index].schedule-filtered-out {
    display: none !important;
}

.round-header.schedule-filtered-out, .match-table-card.schedule-filtered-out {
    display: none !important;
}

.match-table-card {
    background: white;
    border-radius: 8px;
    border: 1px solid rgba(13,148,136,0.2);
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: none;
}

.dark-mode .match-table-card {
    background: #1e293b;
    border-color: rgba(45,212,191,0.35);
}

/*  */
.match-tabular-row {
    display: grid !important;
    grid-template-columns: var(--col1-width, 34px) 56px var(--tp-group-track) var(--tp-schedule-rest) !important;
    column-gap: 4px !important;
    align-items: center !important;
    box-sizing: border-box !important;
    padding: 4px 8px !important;
    background: white !important;
    box-shadow: inset 0 -1px 0 0 #e2e8f0 !important;
    transition: background 0.15s ease !important;
    cursor: pointer !important;
}

.dark-mode .match-tabular-row {
    background: #1e293b !important;
    box-shadow: inset 0 -1px 0 0 #334155 !important;
}

.match-tabular-row:hover {
    background: #f8fafc;
}

.dark-mode .match-tabular-row:hover {
    background: #1e293b;
    filter: brightness(1.1);
}

/*  */
.live-matches-card .match-tabular-row:last-child {
    box-shadow: none !important;
}

.filter-chip {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: var(--fs-sm);
    font-weight: var(--weight-bold);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #64748b;
}

.filter-chip.active {
    background: var(--primary-fill-bg);
    border-color: var(--primary-fill-border);
    color: var(--primary-fill-fg);
}

.dark-mode .tp-filter-toggle.active {
    background: var(--primary-fill-bg);
    border-color: var(--primary-fill-border);
    color: var(--primary-fill-fg);
}

.dark-mode .filter-chip {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

.dark-mode .filter-chip.active {
    background: var(--primary-fill-bg);
    border-color: var(--primary-fill-border);
    color: var(--primary-fill-fg);
}

@media (min-width: 600px) {
                .match-table-card {
                    background: white;
                    border-radius: 8px;
                    border: 1px solid rgba(13,148,136,0.2);
                    overflow: hidden;
                    margin-bottom: 24px;
                    box-shadow: none;
                }
                .dark-mode .match-table-card {
                    background: #1e293b;
                    border-color: rgba(45,212,191,0.35);
                }
            /* Spaltenaufteilung: --tp-schedule-columns in style_v2.css. NICHT hier
               ausschreiben — dieselbe Aufteilung stand einmal zusaetzlich in
               standings-templates.js, und weil beide gleich stark und mit !important
               ausgezeichnet waren, entschied allein die Reihenfolge des Einhaengens.
               Aenderungen an dieser Datei blieben dadurch unsichtbar. */
            .match-tabular-row {
                display: grid;
                grid-template-columns: var(--col1-width, 34px) 56px var(--tp-group-track) var(--tp-schedule-rest) !important;
                column-gap: 4px !important;
                row-gap: 2px !important;
                align-items: center !important;
                box-sizing: border-box !important;
            }
            .match-tabular-row {
                padding: 4px 8px !important;
                background: white !important;
                box-shadow: inset 0 -1px 0 0 #e2e8f0 !important;
                transition: background 0.15s ease !important;
                cursor: pointer !important;
            }
            .dark-mode .match-tabular-row {
                background: #1e293b !important;
                box-shadow: inset 0 -1px 0 0 #334155 !important;
            }
            .match-tabular-row:last-child { border-bottom: none; box-shadow: none !important; }
            .match-tabular-row:hover { background: #f8fafc; }
            .dark-mode .match-tabular-row:hover { background: #1e293b; filter: brightness(1.1); }
            .league-date-divider {
                display: flex;
                align-items: center;
                gap: 10px;
                padding: 12px 14px 8px;
                background: #ffffff;
                color: #0f172a;
                font-size: var(--fs-sm);
                font-weight: var(--weight-strong);
                text-transform: uppercase;
                letter-spacing: 0.04em;
                border-bottom: 1px solid #f1f5f9;
            }
            .league-date-divider::after {
                content: "";
                height: 1px;
                flex: 1;
                background: #e2e8f0;
            }
            
            .match-tabular-row .set-detail-row {
                grid-column: 4 / 7 !important;
                width: 100% !important;
                margin: 0 0 4px 0 !important;
            }

            .mobile-only-card { display: none !important; }
        }

@media (max-width: 599px) {
            .desktop-only-table { display: none !important; }
        }

@media (max-width: 599px) {
            .desktop-only-table { display: none !important; }
            .mobile-only-card {
                display: flex !important;
                background: white;
                border-radius: 8px;
                border: 1px solid #e2e8f0;
                margin-bottom: 12px;
                overflow: hidden;
                box-shadow: none;
            }
            .dark-mode .mobile-only-card {
                background: #1e293b;
                border-color: #334155;
            }
            .card-stripe {
                width: 6px;
                flex-shrink: 0;
            }
        }

@media (min-width: 600px) {
            .mobile-only-card { display: none !important; }
        }

/* Dunkelmodus-Zwillinge der beiden Regeln, die vorher `${isDarkMode ? … : …}`
   mitten im CSS trugen. */
body.dark-mode .league-date-divider {
    background: #1e293b;
    color: #e2e8f0;
    border-bottom: 1px solid #334155;
}

body.dark-mode .league-date-divider::after {
    background: #334155;
}


/* Aus referee-hub.js hierher geholt (23.08.2026).
   Weiter oben steht eine aeltere, FLACHE Fassung von `.ref-section-panel` (transparent,
   randlos, padding 0) mit dem Kommentar „Referee Modal". Sichtbar war sie nie: Die hier
   folgende Fassung wurde aus referee-hub.js nachgeladen und gewann bei gleicher
   Spezifitaet durch die spaetere Stelle. Uebernommen ist deshalb der SICHTBARE Zustand.
   Die aeltere Fassung bleibt stehen, weil sie `padding`, `margin-bottom` und `transition`
   setzt, die diese hier nicht anfasst — ihr Abbau waere eine eigene Entscheidung. */
.ref-section-panel {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}


/* ===================================================================
   TEILNEHMER UND PHASEN-ASSISTENT — EINE STELLE (23.08.2026)
   -------------------------------------------------------------------
   Zweite Haelfte der Zusammenlegung. Diese Regeln standen als \3c style>
   MITTEN IM HTML: zweimal in players-teams.js (Werkzeugleiste 34 Regeln,
   Spielerkarten 37) und einmal in phase-editor.js (Assistent, 75 Regeln,
   444 Zeilen). Alle drei sind vollstaendig statisch — kein Platzhalter.

   WARUM DAS MEHR IST ALS AUFRAEUMEN: Sie kamen erst ins Dokument, wenn
   die Ansicht GEZEICHNET wurde. Bis dahin galten die aelteren Fassungen
   weiter oben in dieser Datei — 36 Eigenschaften mit abweichenden
   Werten. Die Ansicht sah vor und nach ihrem ersten Aufruf anders aus.
   Von hier an gilt ueberall dasselbe.

   Drei Selektoren standen in phase-editor.js ZWEIMAL mit verschiedenen
   Werten (.labs-settings-card, .labs-label, .active-tab); uebernommen
   ist jeweils die erste — dieselbe, die auch vorher gewann.

   @keyframes und @media stehen am Ende und sind UNANGETASTET uebernommen.
   Sie duerfen nicht zusammengefasst werden: `from`/`to` zweier
   verschiedener Animationen sehen gleich aus und sind es nicht.
   =================================================================== */
.players-toolbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 15px;
    flex-wrap: wrap;
    background: transparent;
    position: relative;
}

/* Sagt in Worten, was die Teilnehmer-Liste gerade zeigt. Der Ansicht-Waehler daneben
   ist kein Filter, sondern ein Wechsel der Bedeutung ALLER Ueberschriften — ohne
   diesen Satz war das nirgends abzulesen. */
.pt-kontext-satz {
    padding: 6px 15px 12px;
    font-size: var(--fs-md);
    line-height: 1.5;
    color: var(--text-subtle);
    max-width: 70ch;
}

.pt-kontext-satz b {
    color: var(--text-body);
    font-weight: var(--weight-bold);
}

/*  */
.pt-dropdown-popover {
    position: absolute;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    z-index: 1000;
    min-width: 180px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    animation: pt-dropdown-in 0.2s cubic-bezier(0, 0, 0.2, 1);
}

.dark-mode .pt-dropdown-popover {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.3);
}

.pt-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: var(--fs-base);
    font-weight: var(--weight-bold);
    color: #475569;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.dark-mode .pt-dropdown-item {
    color: #cbd5e1;
}

.pt-dropdown-item:hover {
    background: #f1f5f9;
    color: var(--primary-strong);
}

.dark-mode .pt-dropdown-item:hover {
    background: rgba(13, 148, 136, 0.12);
    color: #2dd4bf;
}

.pt-dropdown-item.active {
    background: rgba(13, 148, 136, 0.08);
    color: var(--primary-strong);
}

.dark-mode .pt-dropdown-item.active {
    background: rgba(13, 148, 136, 0.15);
    color: #2dd4bf;
}

/*  */
.pt-action-island {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    height: 38px;
    padding: 0 4px;
    transition: all 0.2s;
}

.dark-mode .pt-action-island {
    background: #0f172a;
    border-color: #334155;
}

.pt-island-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    height: 100%;
    cursor: pointer;
    font-size: var(--fs-base);
    font-weight: var(--weight-strong);
    color: var(--primary-strong);
    white-space: nowrap;
    border-radius: 8px;
    transition: all 0.2s;
}

.dark-mode .pt-island-item {
    color: #2dd4bf;
}

.pt-island-item:hover {
    background: rgba(13, 148, 136, 0.08);
}

.pt-island-divider {
    width: 1px;
    height: 18px;
    background: #e2e8f0;
    margin: 0 4px;
}

.dark-mode .pt-island-divider {
    background: #334155;
}

/*  */
.pt-search-input {
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    height: 38px !important;
    padding-left: 38px !important;
    font-weight: var(--weight-bold);
    color: #475569 !important;
}

.dark-mode .pt-search-input {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

.pt-tabs-wrap {
    order: 1;
    display: flex;
    align-items: center;
}

.pt-search-wrap {
    order: 2;
    flex: 1;
    max-width: 300px;
    position: relative;
}

.pt-filter-wrap {
    order: 3;
    display: flex;
    align-items: center;
}

.pt-add-wrap {
    order: 4;
    display: flex;
    align-items: center;
    gap: 8px;
}

/*  */
.player-seg-control {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.dark-mode .player-seg-control {
    background: #0f172a;
    border-color: #334155;
}

.filter-chip-new {
    background: transparent;
    border: none;
    padding: 6px 12px;
    border-radius: 7px;
    color: #64748b;
    font-size: var(--fs-md);
    font-weight: var(--weight-bold);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.filter-chip-new.active {
    background: white;
    color: var(--primary-strong);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.filter-chip-new:hover:not(.active) {
    background: rgba(255,255,255,0.5);
}

.dark-mode .filter-chip-new.active {
    background: #1e293b;
    color: #2dd4bf;
}

.player-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-height: 40px;
}

.player-inner-grid {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.player-list-header {
    grid-column: 1 / -1;
    padding: 10px 15px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    color: #64748b;
    font-weight: var(--weight-strong);
    font-size: var(--fs-base);
    text-transform: uppercase;
    letter-spacing: 0.025em;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    border-radius: 8px;
}

/*  */
.player-phase-selector-container {
    padding: 0 15px 15px 15px;
    margin-top: 7px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.player-phase-selector-container::-webkit-scrollbar {
    display: none;
}

.player-phase-selector {
    display: inline-flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 12px;
    gap: 2px;
    border: 1px solid #e2e8f0;
    min-width: min-content;
}

.phase-selector-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: var(--fs-base);
    font-weight: var(--weight-bold);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.phase-selector-item:hover {
    background: rgba(255,255,255,0.5);
    color: #1e293b;
}

.phase-selector-item.active {
    background: white;
    color: var(--brand-primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05), 0 0 0 1px rgba(0,0,0,0.02);
}

.dark-mode .phase-selector-item.active {
    background: #1e293b;
}

.phase-icon {
    font-size: var(--fs-xl);
}

/* ── Listenköpfe im Teilnehmer-Raster ──────────────────────────────────
   Am 06.09.2026 zusammengelegt. Es gab NEUN Stück in renderPlayerGrid:
   sechs .player-group-header und drei .player-sub-header, jeder mit seinem
   vollen Inline-Stil ausgeschrieben, die Unterschiede zufällig — mal mit
   `margin-left:10px`, mal ohne; mal `--weight-bold`, mal `--weight-strong`;
   mal mit `display:flex`, mal ohne, obwohl ein Knopf darin stand.

   Im CSS stand für beide bis dahin NUR die :hover-Regel fürs Ziehen —
   das Aussehen selbst hing komplett an neun Kopien im JavaScript. */
.player-sub-header {
    padding: 4px 0 2px;
    font-size: var(--fs-base);
    font-weight: var(--weight-bold);
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 4px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Der Kopf eines TEAMS trägt die Hausfarbe, „Kein Team" und die Klassen-Köpfe
   bleiben still. Vorher entschied das jede Kopie für sich. */
.player-sub-header.ist-team { color: var(--brand-primary); }

.player-group-header {
    padding: 4px 10px;
    font-size: var(--fs-md);
    font-weight: var(--weight-strong);
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 4px;
    transition: background 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Kader-Abschnitte innerhalb eines Teams rücken ein; die Köpfe der obersten
   Ebene nicht. Das war der einzige echte Unterschied zwischen den sechs. */
.player-group-header.ist-eingerueckt { margin-left: 10px; }

.player-inner-grid > .player-sub-header, .player-inner-grid > .player-group-header, .player-inner-grid > .labs-add-btn {
    grid-column: 1 / -1;
}

.player-card.selected {
    background: rgba(13, 148, 136, 0.05) !important;
}

.player-card.drag-over, .player-list-header.drag-over, .player-sub-header.drag-over, .player-group-header.drag-over {
    border: 2px dashed var(--brand-primary) !important;
    background: rgba(13, 148, 136, 0.1) !important;
    transform: scale(1.01);
    z-index: 10;
}

.labs-card-stripe {
    display: none !important;
}

.player-card {
    position: relative;
    transition: background 0.15s ease;
    padding: 10px 14px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid #f1f5f9 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: none !important;
    width: 100%;
    box-sizing: border-box;
}

.player-card:last-child {
    border-bottom: none !important;
}

.player-card:hover {
    background: rgba(13, 148, 136, 0.03) !important;
    transform: none !important;
    box-shadow: none !important;
}

body.dark-mode .player-card {
    border-bottom-color: rgba(255, 255, 255, 0.06) !important;
}

body.dark-mode .player-card:hover {
    background: rgba(255, 255, 255, 0.03) !important;
}

/* .inline-input — das rahmenlose Feld im Teilnehmer-Raster.

   Es stand bis zum 06.09.2026 ZWEIMAL in dieser Datei, rund 5.800 Zeilen
   auseinander. Gewirkt hat immer nur diese, die spaetere; die erste war seit
   ihrer Entstehung wirkungslos und wich trotzdem ab:

       Polster       2/4   gegen 2/5
       geerbt        font-family gegen font-weight
       :hover        Flaeche rgba(0,0,0,.05) + Rand rgba(0,0,0,.1)
                     gegen Rand #e2e8f0 + weisse Flaeche
       :focus        Schein 2px gegen 3px

   Wer die erste anpasste, sah nichts passieren. Sie ist weg; hier steht, was
   ohnehin galt. Der fehlende Rahmen ist ABSICHT: Im Raster soll der Name wie
   Text aussehen, bis man ihn anfasst. */
.inline-input {
    border: 1px solid transparent;
    background: transparent;
    border-radius: 4px;
    padding: 2px 5px;
    font-size: inherit;
    /* font-family fehlt hier bewusst nicht — `inherit` ist bei Eingabefeldern
       noetig, weil der Browser sonst seine eigene Schrift nimmt. */
    font-family: inherit;
    font-weight: inherit;
    color: inherit;
    width: 100%;
    transition: all 0.2s;
}

.inline-input:hover {
    border-color: #e2e8f0;
    background: white;
}

.inline-input:focus {
    border-color: var(--brand-primary);
    background: white;
    outline: none;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.badge-clickable {
    cursor: pointer;
    transition: all 0.2s;
}

.badge-clickable:hover {
    transform: translateY(-1px);
    filter: brightness(0.95);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.player-delete-btn {
    background: #ffffff !important;
    color: #94a3b8 !important;
    border: 1px solid #e2e8f0 !important;
}

body.dark-mode .player-delete-btn {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #fca5a5 !important;
    border: none !important;
}

.player-delete-btn:hover {
    color: var(--accent-red-text) !important;
    border-color: #fecaca !important;
    background: #fef2f2 !important;
}

body.dark-mode .player-delete-btn:hover {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #f87171 !important;
    border: none !important;
}

.wizard-tab-bar::-webkit-scrollbar {
    display: none;
}

.active-tab {
    background:var(--primary-fill-bg) !important;
    color:var(--primary-fill-fg) !important;
}

/*  */
.active-tab .wiz-step-lbl {
    color: #ffffff !important;
}

.active-tab .wiz-step-num {
    color: #ffffff !important;
    background: rgba(255,255,255,0.28) !important;
}

.dark-mode .tab-fade-indicator {
    background: linear-gradient(to right, transparent, #1e293b);
}

/*  */
input[type="time"]::-webkit-calendar-picker-indicator {
    display: none !important;
    -webkit-appearance: none !important;
    margin: 0 !important;
}

input[type="time"] {
    -moz-appearance: textfield;
}

.wiz-info-i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f8fafc;
    /* War #94a3b8 — auf der fast weissen Flaeche des Kreises nur 2,45:1. */
    color: var(--text-body);
    font-size: var(--fs-xs);
    font-weight: var(--weight-bold);
    cursor: pointer;
    margin-left: 10px;
    transition: all 0.2s;
    vertical-align: middle;
    border: 1px solid #e2e8f0;
    font-family: serif;
    flex-shrink: 0;
}

.wiz-info-i:hover {
    background: var(--primary-fill-bg);
    color: var(--primary-fill-fg);
    border-color: var(--primary-fill-border);
}

.dark-mode .wiz-info-i {
    background: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    border-color: rgba(255, 255, 255, 0.2);
}

/*  */
.labs-settings-card {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.labs-settings-header {
    padding: 0 0 15px 0 !important;
    border-bottom: none !important;
    background: transparent !important;
}

.labs-settings-title {
    font-size: var(--fs-base) !important;
    font-weight: var(--weight-bold) !important;
    color: #0f172a !important;
    letter-spacing: 0.5px !important;
}

.labs-settings-title svg {
    color: var(--primary-strong) !important;
    margin-right: 8px !important;
}

.labs-settings-body {
    padding: 0 !important;
}

.labs-label {
    font-size: var(--fs-2xs) !important;
    font-weight: var(--weight-medium) !important;
    color: #94a3b8 !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 8px !important;
}

/*  */
.wiz-step-tab.active-tab {
    background: transparent !important;
    color: inherit !important;
    border-radius: 0 !important;
}

.wiz-step-tab.active-tab .wiz-step-num {
    background: var(--primary-fill-bg) !important;
    color: var(--primary-fill-fg) !important;
}

/*  */
.wiz-step-tab.active-tab .wiz-step-lbl {
    color: var(--text-strong) !important;
    font-weight: var(--weight-strong) !important;
}

/*  */
.wizard-tab-bar .wiz-step-tab:not(.active-tab) .wiz-step-lbl {
    display: none;
}

.labs-icon-circle {
    width: 32px;
    height: 32px;
    background: rgba(13, 148, 136, 0.08);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-strong);
    flex-shrink: 0;
}

.labs-bordered-input, .labs-select {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 0 16px !important;
    height: 44px !important;
    font-size: var(--fs-base) !important;
    font-weight: var(--weight-medium) !important;
    color: #1e293b !important;
    transition: all 0.2s !important;
    box-sizing: border-box !important;
}

.labs-bordered-input:focus, .labs-select:focus {
    background: white !important;
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.06) !important;
}

.no-margin {
    margin: 0 !important;
    padding: 0 !important;
}

.labs-fp-remove-btn {
    position: absolute !important;
    top: 2px !important;
    right: 2px !important;
    background: transparent !important;
    border: none;
    color: #cbd5e1;
    cursor: pointer;
    padding: 8px;
    z-index: 10;
    display: flex !important;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.labs-fp-remove-btn:hover {
    opacity: 1;
    color: var(--accent-red-text);
}

/*  */
.wiz-responsive-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: stretch;
}

.wiz-responsive-label {
    width: 100%;
    text-align: left;
}

/*  */
#phase-wizard-modal .labs-stepper-compact {
    background: #fff !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 10px !important;
    box-shadow: none !important;
}

#phase-wizard-modal .labs-stepper-compact .labs-stepper-value {
    color: #0f172a !important;
    font-weight: var(--weight-strong) !important;
}

#phase-wizard-modal .labs-stepper-compact .labs-stepper-btn {
    color: var(--text-body) !important;
    background: transparent !important;
}

/*  */
.wiz-radio-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
}

.wiz-radio-card:hover {
    border-color: var(--color-primary);
    background: #f0fdfa;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.wiz-radio-card.active {
    border-color: var(--color-primary);
    background: #f0fdfa;
    border-width: 1.5px;
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.08);
}

.wiz-radio-card-icon {
    width: 38px;
    height: 38px;
    background: var(--bg-secondary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-body);
    flex-shrink: 0;
    transition: all 0.2s;
}

.wiz-radio-card.active .wiz-radio-card-icon {
    background: var(--primary-fill-bg);
    color: var(--primary-fill-fg);
}

.wiz-radio-card-content {
    flex: 1;
}

.wiz-radio-card-title {
    font-size: var(--fs-base);
    font-weight: var(--weight-bold);
    color: var(--text-main);
    margin-bottom: 2px;
}

.wiz-radio-card-desc {
    font-size: var(--fs-sm);
    color: var(--text-body);
    line-height: 1.4;
}

.wiz-radio-card.active .wiz-radio-card-title {
    color: var(--primary-strong);
}

/*  */
.wiz-smart-info {
    background: #f0fdfa;
    border: 1px solid #99f6e4;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 12px;
    margin: 14px 20px 0 20px;
}

.wiz-smart-info-icon {
    color: var(--primary-strong);
    flex-shrink: 0;
    margin-top: 2px;
}

.wiz-smart-info-title {
    font-weight: var(--weight-bold);
    font-size: var(--fs-md);
    color: #134e4a;
    margin-bottom: 4px;
}

.wiz-smart-info-text {
    font-size: var(--fs-sm);
    color: #0f766e;
    line-height: 1.5;
}

.wiz-smart-badge-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.wiz-smart-badge {
    background: var(--bg-card);
    border: 1px solid #ccfbf1;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: var(--fs-xs);
    font-weight: var(--weight-medium);
    color: #115e59;
}

.wiz-smart-badge.used {
    text-decoration: line-through;
    opacity: 0.6;
    background: var(--bg-subtle);
    border-color: var(--border-color);
    color: var(--text-body);
}

.wiz-smart-badge.start {
    background: var(--primary-fill-bg);
    color: var(--primary-fill-fg);
    border: none;
}

.wiz-smart-arrow {
    color: #5eead4;
}

@keyframes pt-dropdown-in {
                    from { opacity: 0; transform: translateY(-8px) scale(0.95); }
                    to { opacity: 1; transform: translateY(0) scale(1); }
                }

@media (max-width: 800px) {
                    .pt-search-wrap { max-width: 200px; }
                }

@media (max-width: 640px) {
                    .players-toolbar {
                        padding: 10px 12px;
                        gap: 10px;
                    }
                    .pt-tabs-wrap { order: 1; flex: 1; }
                    .pt-add-wrap { order: 2; flex: 0; }
                    .pt-search-wrap { order: 3; flex: 1 1 100%; max-width: 100%; }
                    .pt-filter-wrap { order: 4; flex: 1 1 100%; }
                    
                    .pt-action-island { width: 100%; justify-content: space-between; }
                    .pt-island-item { flex: 1; justify-content: center; }
                }

@media (max-width: 599px) {
                .hide-mobile { display: none; }
            }

@media (max-width: 599px) {
                .phase-selector-item {
                    padding: 8px 12px;
                    font-size: var(--fs-md);
                }
            }

@keyframes slideDown {
                from { transform: translateY(-10px); opacity: 0; }
                to { transform: translateY(0); opacity: 1; }
            }

@media (max-width: 480px) {
            .labs-grid-responsive {
                grid-template-columns: 1fr !important;
            }
            .labs-fp-row, .labs-fp-scale-row {
                flex-direction: column !important;
                align-items: stretch !important;
                gap: 8px !important;
                padding-top: 28px !important; /* Raum für das absolute X */
                padding-right: 0 !important; /* X ist absolut oben */
            }
            .labs-fp-row > div:not(.labs-fp-remove-btn), .labs-fp-scale-row > div:not(.labs-fp-remove-btn) {
                width: 100% !important;
                justify-content: space-between !important;
                display: flex !important;
                align-items: center !important;
            }
            .labs-fp-row input {
                width: 100% !important;
                margin-bottom: 2px !important;
            }
            .labs-fp-label-fix {
                font-size: var(--fs-2xs) !important;
                flex: 1;
                text-align: right;
                margin-right: 8px;
                line-height: 1 !important;
                display: flex !important;
                align-items: center !important;
                height: 42px !important; /* Force parent height for centering */
            }
        }

@media (max-width: 599px) {
            .wiz-responsive-label:empty { display: none; }
            .wiz-responsive-row { padding-top: 10px !important; padding-bottom: 10px !important; }
            /* [Fix v2.16.1] Small display support (min 350 px)
               Without an explicit width, wiz-responsive-label claims 100 % of the flex row
               and leaves 0 px for the adjacent stepper / dropdown.
               Fix: give it a fixed narrow width so the control stays visible. */
            #phase-wizard-modal .wiz-responsive-label {
                width: 110px !important;
                min-width: 110px !important;
                flex-shrink: 0 !important;
                font-size: var(--fs-sm) !important;
                white-space: normal !important;
                line-height: 1.3 !important;
            }
            /* wiz-responsive-row labels keep full width (they are in column layout) */
            #phase-wizard-modal .wiz-responsive-row .wiz-responsive-label {
                width: 100% !important;
                min-width: unset !important;
                font-size: inherit !important;
                white-space: inherit !important;
                line-height: inherit !important;
            }
            /* Rows that should stack label above control at narrow widths */
            #phase-wizard-modal .wiz-stacked-row {
                flex-direction: column !important;
                height: auto !important;
                min-height: 56px !important;
                align-items: flex-start !important;
                padding-top: 12px !important;
                padding-bottom: 12px !important;
                gap: 8px !important;
            }
            #phase-wizard-modal .wiz-stacked-row .wiz-responsive-label {
                width: 100% !important;
                min-width: unset !important;
                font-size: var(--fs-base) !important;
            }
            /* Trailing spacer div is only needed for horizontal alignment; hide in stacked mode */
            #phase-wizard-modal .wiz-stacked-row .wiz-row-spacer {
                display: none !important;
            }
            /* Control wrapper inside stacked row fills full width */
            #phase-wizard-modal .wiz-stacked-row > div:not(.wiz-responsive-label):not(.wiz-row-spacer) {
                width: 100% !important;
                min-width: 0 !important;
                flex: none !important;
            }
            /* select inside stacked row fills its wrapper */
            #phase-wizard-modal .wiz-stacked-row select {
                width: 100% !important;
                min-width: 0 !important;
                box-sizing: border-box !important;
            }
        }

@media (min-width: 600px) {
            .wiz-responsive-row {
                flex-direction: row;
                align-items: center;
                gap: 0;
            }
            .wiz-responsive-label {
                width: 120px !important;
                flex-shrink: 0;
            }
        }

@media (max-width: 760px) {
            #phase-wizard-modal .wiz-add-level-spacer {
                display: none !important;
            }
            /* Grid-Inhalt in wiz-stacked-row füllt volle Breite */
            #phase-wizard-modal .wiz-stacked-row > div > div[style*="display:grid"],
            #phase-wizard-modal .wiz-stacked-row > div > div[style*="display: grid"] {
                width: 100% !important;
            }
        }

@media (min-width: 600px) and (max-width: 760px) {
            #phase-wizard-modal .wiz-stacked-row {
                flex-direction: column !important;
                height: auto !important;
                min-height: 56px !important;
                align-items: flex-start !important;
                padding-top: 12px !important;
                padding-bottom: 12px !important;
                gap: 8px !important;
            }
            #phase-wizard-modal .wiz-stacked-row .wiz-responsive-label {
                width: 100% !important;
                min-width: unset !important;
                font-size: var(--fs-base) !important;
                flex-shrink: unset !important;
            }
            #phase-wizard-modal .wiz-stacked-row .wiz-row-spacer {
                display: none !important;
            }
            #phase-wizard-modal .wiz-stacked-row > div:not(.wiz-responsive-label):not(.wiz-row-spacer) {
                width: 100% !important;
                min-width: 0 !important;
                flex: none !important;
            }
            #phase-wizard-modal .wiz-stacked-row select {
                width: 100% !important;
                min-width: 0 !important;
                box-sizing: border-box !important;
            }
        }


/* ===========================================================================
   SPIELERZEILE UND KARTEIKARTE

   Die Zeile trug bis zum 01.09.2026 sieben unbeschriftete Bedienelemente. Jetzt
   nennt sie in Worten, was gesetzt ist, und hat zwei beschriftete Knoepfe:
   Anwesenheit (der einzige Griff, den man am Turniertag im Sekundentakt braucht)
   und „Bearbeiten", das die Karteikarte oeffnet. Alle Farben kommen aus Token,
   damit der Dunkelmodus ohne zweite Regelmenge stimmt.
   =========================================================================== */

/* FESTE Breite, auch wenn kein Wappen da ist. Der Platz wird immer gezeichnet
   (renderPlayerCard); ohne feste Breite waere er in Zeilen ohne Wappen 0 breit,
   und Vorname und Nachname staenden dort in einer anderen Spalte als daneben. */
.pc-wappen {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 22px;
    height: 22px;
    line-height: 0;
}

.pc-zusammenfassung {
    flex: 1 1 auto;
    min-width: 0;
    min-width: 0;
    text-align: right;
    font-size: var(--fs-md);
    color: var(--text-subtle);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pc-anwesenheit,
.pc-bearbeiten {
    flex-shrink: 0;
    border: none;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 7px;
    font-size: var(--fs-sm);
    font-weight: var(--weight-bold);
    line-height: 1.3;
    white-space: nowrap;
}

.pc-anwesenheit {
    background: var(--primary-soft-bg);
    color: var(--primary-strong);
}

.pc-anwesenheit.fehlt {
    background: var(--surface-soft);
    color: var(--text-subtle);
    text-decoration: line-through;
}

.pc-bearbeiten {
    background: var(--surface-soft);
    color: var(--text-body);
}

.pc-bearbeiten:hover,
.pc-anwesenheit:hover {
    filter: brightness(0.95);
}

/* --- Die Karteikarte selbst --------------------------------------------- */

.tp-karte-schale {
    position: fixed;
    inset: 0;
    /* Auf der Leiter, nicht darueber: der Wappen-Editor legt sich mit 300000
       ueber die Karte. Eine rohe Zahl hier haette ihn unsichtbar gemacht. */
    z-index: var(--z-dialog);
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

/* Das Anlege-Formular traegt zwei Namensfelder je Zeile und braucht mehr Breite
   als eine Karteikarte. */
/* Das Anlege-Formular wird auch AUS dem Kader-Panel geoeffnet und muss darueber
   liegen — sonst erscheint es dahinter und wirkt, als sei nichts passiert. */
.tp-karte-schale.ueber {
    z-index: var(--z-dialog-2);
}

.tp-karte.breit {
    max-width: 660px;
}

.tp-karte {
    background: var(--surface-page);
    color: var(--text-body);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 520px;
    max-height: 88vh;
    overflow-y: auto;
    padding: 18px 20px 16px;
    box-sizing: border-box;
}

.tp-karte-kopf {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.tp-karte-wappenknopf {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border: 1px dashed var(--border-strong);
    border-radius: 12px;
    background: var(--surface-soft);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 2px;
}

.tp-karte-wappenleer {
    font-size: var(--fs-2xs);
    font-weight: var(--weight-bold);
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tp-karte-nameeingabe {
    flex: 1;
    min-width: 0;
    font-size: var(--fs-2xl);
    font-weight: var(--weight-strong);
    color: var(--text-main);
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-color);
    padding: 4px 2px;
}

/* Stehen Vor- und Nachname getrennt fest, ist der volle Name deren ERGEBNIS —
   er wird angezeigt, nicht eingetippt. Sonst stuenden zwei Wahrheiten nebeneinander. */
.tp-karte-nameergebnis {
    border-bottom-color: transparent;
    padding-bottom: 5px;
}

.tp-karte-nameeingabe:focus {
    outline: none;
    border-bottom-color: var(--primary-strong);
}

.tp-karte-zu {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--surface-soft);
    color: var(--text-body);
    border-radius: 9px;
    font-size: var(--fs-xl);
    line-height: 1;
    cursor: pointer;
}

.tp-karte-abschnitt {
    margin: 18px 0 6px;
    font-size: var(--fs-sm);
    font-weight: var(--weight-bold);
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 4px;
}

.tp-karte-zeile {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 7px 0;
}

.tp-karte-name {
    flex: 0 0 130px;
    padding-top: 7px;
    font-size: var(--fs-base);
    font-weight: var(--weight-bold);
    color: var(--text-body);
}

.tp-karte-feld {
    flex: 1;
    min-width: 0;
}

.tp-karte-hinweis {
    margin-top: 4px;
    font-size: var(--fs-sm);
    line-height: 1.4;
    color: var(--text-subtle);
}

.tp-karte-select,
.tp-karte-eingabe {
    width: 100%;
    box-sizing: border-box;
    padding: 7px 10px;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: var(--surface-page);
    color: var(--text-main);
    font-size: var(--fs-base);
}

.tp-karte-eingabe.schmal {
    width: 90px;
}

.tp-karte-knopfreihe {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tp-karte-wahl {
    border: 1px solid var(--border-color);
    background: var(--surface-page);
    color: var(--text-body);
    border-radius: 9px;
    padding: 6px 12px;
    font-size: var(--fs-base);
    cursor: pointer;
}

.tp-karte-wahl.aktiv {
    background: var(--primary-fill-bg);
    color: var(--primary-fill-fg);
    border-color: var(--primary-fill-bg);
    font-weight: var(--weight-bold);
}

.tp-karte-schalter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: var(--fs-base);
    color: var(--text-body);
}

.tp-karte-schalter input {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.tp-karte-fuss {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 22px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

.tp-karte-loeschen {
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--accent-red-text);
    border-radius: 9px;
    padding: 8px 14px;
    font-size: var(--fs-base);
    cursor: pointer;
}

.tp-karte-fertig {
    border: none;
    background: var(--primary-fill-bg);
    color: var(--primary-fill-fg);
    border-radius: 9px;
    padding: 9px 22px;
    font-size: var(--fs-base);
    font-weight: var(--weight-bold);
    cursor: pointer;
}

/* --- Vorschau im Sammelformular: dieselbe Zeilenform, aber mit den Feldern,
       die man VOR dem Anlegen setzt (die Personen gibt es noch nicht). ------ */

.pc-vorschau-feld {
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    background: var(--surface-page);
    color: var(--text-body);
    border-radius: 7px;
    padding: 4px 10px;
    font-size: var(--fs-sm);
    font-weight: var(--weight-bold);
    white-space: nowrap;
    cursor: pointer;
}

.pc-vorschau-feld.leer {
    color: var(--text-subtle);
    font-weight: var(--weight-medium);
    border-style: dashed;
}

.pc-vorschau-nummer {
    flex-shrink: 0;
    width: 56px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    background: var(--surface-page);
    color: var(--text-main);
    padding: 4px 6px;
    font-size: var(--fs-sm);
}

/* Zwei Namensfelder in der Vorschau, wenn Vor- und Nachname getrennt getippt werden */
/* Eine Person = eine Zeile mit zwei Feldern. Keine Aufteilung, kein Raten.
   Beschriftet wird ueber die Platzhalter IM Feld — eine Kopfzeile darueber konnte
   nicht buendig bleiben, weil rechts die Knoepfe unterschiedlich breit sind. */
.pa-zeilen {
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-height: 42vh;
    overflow-y: auto;
}

/* EINE Zeile je Person.

   Bis zum 04.09.2026 lief die Zeile um: Die beiden Namensfelder trugen
   `flex: 1 1 45%` und fuellten damit die erste Zeile, die fuenf Chips daneben
   standen darunter. Seit dort nur noch zwei Symbolknoepfe stehen („…" und „×"),
   passen sie nebeneinander — gemessen 44 statt 69 px je Zeile, bei zwanzig
   Personen 800 statt 1.380 px Dialoghoehe.

   Hier stand ausserdem eine zweite, WORTGLEICHE Fassung von .pa-teilname unter
   dem Selektor `.pa-zeile.player-absent .pa-teilname` — acht von neun Angaben
   identisch, abweichend nur die Flex-Angabe. Der Selektor war offenbar dafuer
   gedacht, „fehlt heute" ANZUZEIGEN, hat aber nie eine entsprechende Angabe
   bekommen; solange der „Fehlt"-Knopf noch in der Zeile stand, fiel das nicht auf.
   Er steht jetzt im „…"-Menue — deshalb traegt der Selektor unten das, wofuer es
   ihn gab, und zwar in derselben Sprache wie ueberall sonst
   (.pa-person.ist-abwesend, .player-card.player-absent). */
.pa-zeile {
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

/* Gleicher Name (S18 E39, 30.09.2026): unter der Zeile, VOR dem Anlegen — was mit ihr geschieht. Bernstein wie andere
   Hinweise „bitte ansehen“, keine Pille. */
.pa-gleich {
    margin: 4px 0 6px;
    padding: 6px 8px;
    border-radius: 6px;
    background: var(--accent-amber-bg);
    border: 1px solid var(--accent-amber-border);
    color: var(--text-main);
    font-size: var(--fs-sm);
    line-height: 1.4;
}
.pa-gleich-wahl {
    display: block;
    margin-top: 3px;
    cursor: pointer;
}
/* Nachnamen gekuerzt (S18 Etappe 3): nur eine leise Zeile, was gespeichert wird — kein Hinweis „bitte ansehen“. */
.pa-kurz {
    margin: 2px 0 6px;
    font-size: var(--fs-sm);
    color: var(--text-subtle);
    line-height: 1.4;
}
.pa-kurz b { color: var(--text-main); font-weight: var(--weight-strong); }

/* „Fehlt heute" — dieselbe Sprache wie in jeder anderen Liste der App:
   durchgestrichen und zurueckgenommen. Ohne das haette eine als fehlend markierte
   Zeile seit dem Umzug des Knopfes ins Menue GAR KEINEN sichtbaren Hinweis mehr. */
.pa-zeile.player-absent .pa-teilname {
    text-decoration: line-through;
    color: var(--text-subtle);
}

.pa-teilname {
    /* `1 1 0` statt einer festen Grundbreite: Die Namen teilen sich, was nach den
       zwei Knoepfen uebrig bleibt. min-width:0 haelt sie schrumpffaehig — mit den
       frueheren 90px bestuende jedes Feld auf seiner Mindestbreite und die Zeile
       liefe auf dem Handy doch wieder um. Gemessen bei 375px: 125px je Feld. */
    flex: 1 1 0;
    min-width: 0;
    padding: 7px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-page);
    color: var(--text-main);
    font-size: var(--fs-base);
    font-weight: var(--weight-bold);
}

/* ---------------------------------------------------------------------------
   SCHNELL-KASTEN: zwei Felder fuer genau eine Person, ueberall gleich.
   Erzeugt von window.schnellAnlageHtml (personen-anlegen.js). Vorher sah dieser
   Kasten an jeder Stelle anders aus — im Kader-Panel ein grauer Block, im
   Auswahl-Pool ein gestrichelter Kasten, mit je eigenen Inline-Farben.
   --------------------------------------------------------------------------- */
.pa-schnell {
    margin: 10px 0 4px;
    padding: 10px 12px;
    border: 1.5px dashed var(--color-primary);
    border-radius: 12px;
    background: var(--primary-soft-bg);
    flex-shrink: 0;
}

.pa-schnell-kopf {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: var(--fs-sm);
    font-weight: var(--weight-bold);
    color: var(--primary-strong);
    margin-bottom: 2px;
}

/* Der Weg zum grossen Formular. Er heisst „Mehrere anlegen“, weil GENAU DAS
   ihn von den zwei Feldern darunter unterscheidet — nicht, dass man dort Vor-
   und Nachnamen eintragen kann; das gilt hier wie dort. */
.pa-schnell-mehr {
    background: var(--surface-page);
    color: var(--text-body);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 3px 9px;
    font-size: var(--fs-sm);
    font-weight: var(--weight-bold);
    cursor: pointer;
}

.pa-schnell-mehr:hover {
    border-color: var(--color-primary);
    color: var(--primary-strong);
}

.pa-schnell-hinweis {
    font-size: var(--fs-2xs);
    color: var(--text-subtle);
    margin: 0 0 8px;
    line-height: 1.35;
}

.pa-schnell-zeile {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pa-schnell-feld {
    flex: 1 1 110px;
    min-width: 90px;
    padding: 8px 11px;
    border: 1.5px solid var(--border-color);
    border-radius: 9px;
    background: var(--surface-page);
    color: var(--text-main);
    font-size: var(--fs-md);
    outline: none;
}

.pa-schnell-feld:focus {
    border-color: var(--color-primary);
}

.pa-schnell-ok {
    background: var(--primary-fill-bg);
    color: var(--primary-fill-fg);
    /* Die Fuellung des Projekts ist bewusst weich (--primary-fill-bg ist ein sehr
       helles Mint). Ohne Kante liest sich der Knopf deshalb wie blosser Text. */
    border: 1.5px solid var(--color-primary);
    border-radius: 9px;
    padding: 8px 15px;
    font-size: var(--fs-md);
    font-weight: var(--weight-bold);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.pa-schnell-ok:hover { background: var(--primary-fill-hover); }

.pa-schnell-weg {
    background: none;
    color: var(--text-subtle);
    border: 1px solid var(--border-color);
    border-radius: 9px;
    padding: 8px 11px;
    font-size: var(--fs-md);
    cursor: pointer;
    flex-shrink: 0;
}

.pa-schnell-warnung {
    font-size: var(--fs-sm);
    margin-top: 5px;
    min-height: 15px;
}

/* ---------------------------------------------------------------------------
   PERSONEN-ZEILE: eine Person in einer Liste. Erzeugt von
   window.personenZeileHtml (personen-anlegen.js). Auswahl-Pool und Kader-Panel
   hatten dafuer zwei Bauweisen mit je eigenen Inline-Farben — nebeneinander
   gestellt sah es aus wie zwei Programme.
   --------------------------------------------------------------------------- */
.pa-person {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface-page);
    cursor: pointer;
    user-select: none;
}

.pa-person:hover { background: var(--surface-soft); }

/* Die Zeile der Team-Liste verhaelt sich wie .pa-person: die GANZE Zeile oeffnet
   die Karteikarte, und der Hover kuendigt das an.

   Bis zum 04.09.2026 lag der Klick nur auf dem Namen, und daneben stand ein Knopf
   „Bearbeiten" mit demselben Aufruf (window.openTeamKarte). Der Knopf war also ein
   Doppel — aber die EINZIGE sichtbare Ankuendigung, dass sich hier etwas oeffnen
   laesst. Ihn ersatzlos zu streichen haette die Zeile stumm gemacht; deshalb erbt
   sie hier erst das Verhalten der Personenzeile und gibt dann den Knopf ab.

   --primary-soft-bg statt --surface-soft: Die Zeile sitzt in .player-inner-grid,
   das im Dunkelmodus selbst #1e293b traegt — und genau das ist dort der Wert von
   --surface-soft. Der Hover waere unsichtbar gewesen. */
.tp-teamzeile {
    cursor: pointer;
}

.tp-teamzeile:hover {
    background: var(--primary-soft-bg);
}

.pa-person.ist-gewaehlt {
    background: var(--accent-green-bg);
    border-bottom-color: var(--color-success);
}

/* Ueber der Mengengrenze oder schon vergeben: sichtbar, aber nicht waehlbar. */
.pa-person.ist-blass {
    opacity: 0.45;
    pointer-events: none;
}

.pa-person-sym {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--surface-soft);
    color: var(--text-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-md);
    font-weight: var(--weight-bold);
    flex-shrink: 0;
}

.pa-person.ist-gewaehlt .pa-person-sym {
    background: var(--color-success);
    color: var(--surface-page);
}

.pa-person-text {
    flex: 1;
    min-width: 0;
}

.pa-person-name {
    font-size: var(--fs-base);
    font-weight: var(--weight-medium);
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Abwesend: durchgestrichen, aber lesbar — die Person ist ja noch im Kader. */
/* Platzhalter vor dem Namen, nur bei verborgenen Namen (personenZeileHtml, 17.09.2026). inline-block, damit der
   Durchstrich einer fehlenden Person das Schild nicht mit durchstreicht: Der Platz bleibt, auch wenn die Person fehlt. */
.pa-person-platz {
    display: inline-block;
    margin-right: 6px;
    padding: 0 6px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    background: var(--surface-soft);
    color: var(--text-strong);
    font-size: var(--fs-xs);
    font-weight: var(--weight-strong);
    font-variant-numeric: tabular-nums;
    line-height: 1.6;
    vertical-align: 1px;
}

.pa-person.ist-abwesend .pa-person-name {
    text-decoration: line-through;
    color: var(--text-subtle);
}

.pa-person-neben {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.pa-person-akt {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* Ein Knopf je Person in einer Auswahlliste — Kader-Panel wie Auswahl-Pool. */
.pa-zeilen-knopf {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--surface-soft);
    color: var(--text-body);
    border: none;
    border-radius: 6px;
    padding: 4px 9px;
    font-size: var(--fs-sm);
    font-weight: var(--weight-bold);
    cursor: pointer;
    flex-shrink: 0;
}

.pa-zeilen-knopf:hover { color: var(--primary-strong); }

/* Die beiden Symbolknoepfe der Anlege-Zeile („…" und „×"). Gleiche Masse wie
   .pc-vorschau-feld daneben, damit die Zeile beim Tippen nicht springt. */
.pa-mehr {
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    background: var(--surface-page);
    color: var(--text-body);
    border-radius: 7px;
    padding: 4px 9px;
    cursor: pointer;
    line-height: 1;
}

.pa-mehr:hover {
    color: var(--primary-strong);
}

.pa-mehr:disabled {
    opacity: 0.35;
    cursor: default;
}

/* Ein Menue-Eintrag, der ein FELD traegt statt einer Handlung — die Rueckennummer
   laesst sich nicht durchschalten wie Geschlecht oder Niveau. Der Eintrag darf
   deshalb auch nicht auf Zeigen die Farbe wechseln, als waere er anklickbar. */
.pt-dropdown-item.ist-feld {
    gap: 10px;
    cursor: default;
}

.pt-dropdown-item.ist-feld:hover {
    background: none;
    color: inherit;
}

.pt-dropdown-item.ist-feld .pc-vorschau-nummer {
    flex: 0 0 60px;
}

/* Rechts in derselben Zeile, nicht mehr in einer zweiten darunter (siehe
   .pa-zeile weiter oben). */
.pa-zeile .pc-badges {
    flex: 0 0 auto;
    justify-content: flex-end;
}

.pa-zeile .pc-badges button:disabled {
    opacity: 0.35;
    cursor: default;
}

.pa-zeile-dazu { margin-top: 8px; }

/* Einlese-Feld im Anlege-Baustein */
.pa-liste {
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px dashed var(--border-strong);
    border-radius: 10px;
    font-size: var(--fs-md);
    line-height: 1.5;
    color: var(--text-subtle);
}

.pa-liste.drueber {
    border-color: var(--primary-strong);
    background: var(--primary-soft-bg);
}

.pa-liste b { color: var(--text-body); }

/* Vorschau im Anlege-Baustein (personen-anlegen.js) */
.pa-vorschau {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 40vh;
    overflow-y: auto;
}

/* --- Team-Karteikarte: dieselbe Form wie bei einer Person -------------- */

.tp-teamkarte-liste {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tp-teamkarte-anlegen {
    margin-top: 12px;
    padding: 12px;
    border: 1px dashed var(--border-strong);
    border-radius: 12px;
}

.tp-karte-phasenliste {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tp-karte-phasenchip {
    padding: 4px 10px;
    border-radius: 8px;
    background: var(--primary-soft-bg);
    color: var(--primary-strong);
    font-size: var(--fs-sm);
    font-weight: var(--weight-bold);
}

.tp-karte-kaderchip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px 6px 12px;
    border-radius: 9px;
    background: var(--surface-soft);
    color: var(--text-body);
    font-size: var(--fs-base);
}

.tp-karte-kaderchip button {
    border: none;
    background: transparent;
    color: var(--text-subtle);
    cursor: pointer;
    font-size: var(--fs-lg);
    line-height: 1;
    padding: 0 2px;
}

/* ============================================================================
   DIE KADER-KARTE — Personenliste, Klassen-Ansicht, Handgriffe

   Gezogen aus dem Kader-Panel (labs-groups.js), das seine Optik als Inline-Stil
   trug und deshalb in jedem zweiten Zweig ein bisschen anders aussah. Hier steht
   sie einmal, in Token — damit greifen Dunkelmodus, Schriftgroesse und die
   Kontrast-Pruefung ohne Zutun.
   ============================================================================ */

/* Umschalter Team <-> Klasse. Am Turniertag der haeufigste Handgriff: jemand
   fehlt, also rueckt ein Kind aus einem anderen Team derselben Klasse nach. */
.tp-kader-umschalter {
    display: flex;
    gap: 0;
    margin: 10px 0 4px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.tp-kader-umschalter button {
    flex: 1;
    border: none;
    background: var(--surface-page);
    color: var(--text-body);
    padding: 9px 10px;
    font-size: var(--fs-md);
    font-weight: var(--weight-strong);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.tp-kader-umschalter button + button {
    border-left: 1px solid var(--border-color);
}

.tp-kader-umschalter button.ist-aktiv {
    background: var(--primary-soft-bg);
    color: var(--primary-strong);
}

/* Ein Team in der Klassen-Ansicht. Das gerade geoeffnete ist hervorgehoben,
   damit man beim Umschalten den Faden nicht verliert. */
.tp-kader-block + .tp-kader-block {
    margin-top: 10px;
}

.tp-kader-block.ist-offen {
    border-left: 2px solid var(--color-primary);
    padding-left: 8px;
    margin-left: -10px;
}

.tp-kader-blockkopf {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 0 4px;
    font-size: var(--fs-sm);
    font-weight: var(--weight-bold);
    color: var(--text-main);
}

.tp-kader-blockkopf span:last-child {
    font-weight: var(--weight-normal);
    color: var(--text-body);
}

.tp-kader-block.ist-offen .tp-kader-blockkopf {
    color: var(--primary-strong);
}

/* Kader-Abschnitt („1. Halbzeit") als Zwischenueberschrift. */
.tp-kader-teil {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin: 8px 0 2px;
    font-size: var(--fs-xs);
    font-weight: var(--weight-strong);
    color: var(--primary-strong);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tp-kader-teil span:last-child {
    color: var(--text-body);
    text-transform: none;
    letter-spacing: 0;
}

/* Wer heute fehlt. Standardmaessig aufgeklappt: das ist am Turniertag die
   Information, die man sofort sehen will. */
.tp-kader-fehlen {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-color);
}

.tp-kader-fehlen > button {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 0;
    font-size: var(--fs-xs);
    font-weight: var(--weight-strong);
    color: var(--text-body);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tp-kader-fehlen > button svg {
    transition: transform 0.2s;
}

/* Ein als Chip getarntes Auswahlfeld. Auf dem Tablet schlaegt ein echtes
   Bedienelement das Ziehen und Ablegen — deshalb liegt hier ein <select>
   unsichtbar ueber dem Chip, statt eines eigenen Menues. */
.tp-kader-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    max-width: 130px;
    padding: 3px 9px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--surface-page);
    color: var(--text-body);
    font-size: var(--fs-xs);
    font-weight: var(--weight-strong);
    white-space: nowrap;
}

.tp-kader-chip > span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.tp-kader-chip.ist-gesetzt {
    border-color: var(--primary-soft-border);
    background: var(--primary-soft-bg);
    color: var(--primary-strong);
}

.tp-kader-chip.ist-symbol {
    padding: 4px 6px;
    border-radius: 7px;
    color: var(--text-body);
}

.tp-kader-chip select {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Anwesenheit und Entfernen: kleine Symbole, die erst beim Zeigen Farbe bekommen
   — sonst schreit jede Zeile mit fuenf bunten Knoepfen um Aufmerksamkeit. */
.tp-kader-symbolknopf {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-subtle);
    padding: 2px 4px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s;
}

.tp-kader-symbolknopf:hover {
    color: var(--primary-strong);
}

.tp-kader-symbolknopf.ist-zurueck {
    color: var(--text-success);
}

/* Die Bezeichnung eines Kader-Abschnitts ist antippbar, sieht aber wie Text aus:
   Sie gehoert der Phase, nicht dem Team — ein Klick benennt sie fuer ALLE Teams
   um. Ein Knopf, der wie ein Knopf aussaehe, versprach hier zu viel. */
.tp-kader-abschnittname {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: none;
    background: none;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
}

.tp-kader-abschnittname:hover {
    color: var(--primary-strong);
}

/* Vorhandene Personen zum Antippen. Blass = steht schon in einem anderen Team;
   ein Klick nimmt sie mit herueber. */
.tp-kader-vorschlaege {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 12px;
}

.tp-kader-vorschlag {
    padding: 4px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--bg-card);
    color: var(--text-body);
    font-size: var(--fs-md);
    cursor: pointer;
    transition: all 0.15s;
}

.tp-kader-vorschlag.ist-blass {
    border-style: dashed;
    background: var(--surface-page);
    color: var(--text-body);
    font-style: italic;
}

.tp-kader-vorschlag:hover {
    border-color: var(--color-primary);
    background: var(--primary-soft-bg);
    color: var(--primary-strong);
    font-style: normal;
}

/* ==========================================================================
   DIE KADER-KARTE ALS ZWEI REITER                       (Aufbau: players-teams.js)

   Bis zum 04.09.2026 lag alles in einer Bahn: Kopf, Umschalter, Anwesenheits-
   Verweis, Block „Team", Personen, Anlegen, Kader-Abschnitte, Fuss. Sieben
   Bloecke vor der ersten Person — man musste scrollen, um zu sehen, wofuer man
   die Karte geoeffnet hat. Jetzt traegt der Reiter „Kader" nur Liste und
   Anlege-Zeile; was man einmal einstellt, liegt unter „Einstellungen".
   ========================================================================== */

/* Was vom Block „Team" beim Arbeiten gebraucht wird: Phase und Klasse, in einer
   Zeile. Dafuer musste bisher der ganze Block offen stehen. */
.tp-kader-kontext {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    align-items: baseline;
    margin: 10px 0 2px;
    font-size: var(--fs-xs);
    /* --text-subtle, NICHT --text-muted: Letzteres gibt es in dieser App gar
       nicht — es steht nur in landing.css, und die laedt app.html nicht. Die
       Zeile bekam dadurch ueberhaupt keine Farbe. pruefe-variablen.js konnte das
       nicht melden, weil es bis 04.09.2026 nur .js-Dateien las. */
    color: var(--text-subtle);
}

/* Die beiden Wege nach draussen — Klassen-Ansicht und Anwesenheit. Beide sind
   „weiter schauen", also dieselbe Form, als Paar, UNTER der Liste. Ueber ihr
   standen sie vor dem Inhalt, um den es geht. */
.tp-kader-bruecken {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin: 12px 0 2px;
}

/* .tp-kader-alleklassen traegt `margin: 0 0 4px auto` — allein steht der Verweis
   damit rechts. Zu zweit in einer Reihe schoebe das auto beide auseinander. */
.tp-kader-bruecken .tp-kader-alleklassen {
    margin: 0;
}

/* Der Anlege-Kasten als Zeile statt als gestrichelter Rahmen: Direkt unter der
   Liste erklaert die Stelle schon, wozu die zwei Felder da sind. */
.tp-teamkarte-anlegen.ist-schmal {
    border: none;
    border-top: 1px solid var(--border-color);
    border-radius: 0;
    padding: 12px 0 0;
    margin-top: 12px;
}

.tp-teamkarte-anlegen.ist-schmal .pa-schnell {
    border: 1px solid var(--border-color);
    background: var(--surface-soft);
}

/* Der Satz „Vorname und Nachname getrennt…" steht im gemeinsamen Baustein
   schnellAnlageHtml und wird an seinen anderen Stellen gebraucht. Hier, unter
   der Liste und mit beschrifteten Feldern, kostet er nur Hoehe. */
.tp-teamkarte-anlegen.ist-schmal .pa-schnell-hinweis {
    display: none;
}

/* Ein leerer Kader-Abschnitt ist eine Zeile, kein Block: Die 0 dahinter sagt
   dasselbe wie eine zweite Zeile „Noch niemand". */
.tp-kader-teil.ist-leer {
    opacity: 0.55;
}

/* --- Das „…"-Menue der Personenzeile ----------------------------------------
   Gebaut aus .pt-dropdown-popover (togglePlayerMenu), damit es im Dunkelmodus
   schon geregelt ist. Zwei Eintraege sind AUSWAHLEN: Ein unsichtbares <select>
   deckt den Eintrag ab — dieselbe Technik wie in .tp-kader-chip, und auf dem
   Tablet die einzige, die ohne Untermenue auskommt. */
.pt-dropdown-item.ist-auswahl {
    position: relative;
}

.pt-dropdown-item.ist-auswahl select {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* --accent-red-text, nicht --danger-strong: den zweiten Namen benutzt die App an
   ein paar Stellen, definiert ist er nirgends (pruefe-variablen.js schlaegt dort
   an). Denselben Token traegt schon .tp-karte-loeschen, und er ist im
   Dunkelmodus mit umgestellt — eine eigene .dark-mode-Zeile braucht es nicht. */
.pt-dropdown-item.ist-gefahr {
    color: var(--accent-red-text);
}

/* .pt-dropdown-popover traegt eine rohe 1000 — genug fuer ein Menue in der
   Seite, zu wenig fuer eines IN einem Dialog: Der sitzt auf --z-dialog (100.000)
   und deckt das Menue vollstaendig zu. Es ist dann da, im DOM messbar, mit
   richtiger Position und richtigem Inhalt — und trotzdem unsichtbar.

   Diese Regel hiess bis zum 04.09.2026 `#tp-zeilenmenue` und galt nur fuer das
   Menue der Kader-Zeile. Beim naechsten Menue aus einem Dialog (der Anlege-Zeile)
   trat derselbe Fehler prompt wieder auf. Deshalb jetzt ein NAME statt einer
   Kennung: Wer ein Aufklappmenue aus einem Dialog heraus oeffnet, haengt
   `ueber-dialog` an — und faellt nicht noch einmal darauf herein.

   --z-dialog-2 ist die passende Sprosse der Leiter: laut ihrer eigenen
   Beschreibung „Waehler, die AUS einem Dialog aufgehen". */
.pt-dropdown-popover.ueber-dialog {
    z-index: var(--z-dialog-2);
}

/* Manche Dialoge tragen noch eine ROHE Nummer oberhalb von --z-dialog-2 und
   bilden untereinander eine eigene kleine Leiter — der Terminkalender etwa mit
   200100 (Zentrale), 200200 (Rhythmus), 200260 und 200300. Ein Menue aus so
   einem Dialog verschwindet mit `.ueber-dialog` dahinter: Es steht im Dokument,
   ist richtig plaziert, gefuellt — und unsichtbar. Genau dieser Fall hat beim
   Kader-Umbau eine Sitzung gekostet und ist am 06.09.2026 im Rhythmus-Dialog
   wieder aufgetreten.

   --z-schwebend ist die Sprosse, die die Leiter dafuer vorsieht: „Toasts und
   Popover — liegen ueber JEDEM Dialog". Sie greift unabhaengig davon, welche
   rohe Zahl der Dialog darunter traegt.

   Das ist ein Pflaster, kein Ersatz: Die rohen Zahlen in labs-view-calendar.js
   gehoeren auf die Leiter. Sie stehen im Bestand von pruefe-ebenen.js. */
.pt-dropdown-popover.ueber-alles {
    z-index: var(--z-schwebend);
}

textarea.tp-karte-eingabe {
    resize: vertical;
    min-height: 70px;
    font-family: inherit;
    line-height: 1.4;
    /* Ohne das zeigte das Feld beide Bildlaufleisten, obwohl nichts darin stand. */
    overflow-x: hidden;
    white-space: pre-wrap;
}

/* Die drei Wappen-Einstellungen standen ueber der Teamliste und nahmen mehr
   Platz ein als der Inhalt. Zugeklappt sind sie erreichbar, ohne zu dominieren. */
.tp-wappen-einstellungen {
    margin-bottom: 12px;
}

.tp-wappen-einstellungen > summary {
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--text-body);
    font-size: var(--fs-sm);
    font-weight: var(--weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    list-style-position: inside;
}

.tp-wappen-einstellungen[open] > summary {
    margin-bottom: 10px;
}

/* Auf schmalen Geraeten steht die Beschriftung ueber dem Feld statt daneben. */
@media (max-width: 520px) {
    .tp-karte-zeile {
        flex-direction: column;
        gap: 4px;
    }
    .tp-karte-name {
        flex: none;
        padding-top: 0;
    }
    .pc-zusammenfassung {
        flex-basis: 100%;
        text-align: left;
        order: 2;
    }
}


/* ============================================
   SYNC-HINWEIS UNTEN: eigener Grund statt Schweben
   ============================================
   Der Hinweis steht `position:fixed` ueber dem rollenden Inhalt und hatte einen
   DURCHSICHTIGEN Grund. Gemessen am 31.08.2026 bei 375 px und scrollY=0 lag er
   damit auf der Zeile "10:52 - 11:15 UHR" - zwei Texte uebereinander. Eine
   Bodenpolsterung am Inhalt hilft nicht: die Leiste ist fest, sie wandert beim
   Rollen ueber JEDE Stelle des Dokuments, nicht nur ueber dessen Ende.

   Er traegt deshalb jetzt einen eigenen Grund. Sichtbar ist er ohnehin selten -
   `updateSyncStatusInfo` (cloud-sync.js) fuellt ihn nur im Gastmodus, im
   abgemeldeten Zustand und bei einem Sync-Fehler; angemeldet ist er LEER.
   Genau dafuer haengt die Gestaltung an `:not(:empty)`: kein leerer Kasten,
   wenn nichts zu sagen ist. */
#version-tag-bottom #sync-status-info:not(:empty) {
    display: inline-block;
    background: var(--surface-page);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 3px 8px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.10);
}

/* Hier standen die Regeln des Teilen-Hubs. Der Hub ist am 21.09.2026 entfallen:
   Seine fuenf Karten stehen seit Entwurf A direkt im Menue, eine Zwischenseite
   dazwischen waere ein Klick ohne Gegenwert. Sein "i" lebt weiter als
   .tp-erklaer-knopf im Kopf der Dialoge (eigener Abschnitt am Dateiende). */

/* ============================================================================
   DIE ANWESENHEITSLISTE (anwesenheit.js)

   Bewusst wenige Regeln: Die Liste benutzt die Bauteile, die es schon gibt —
   .tp-karte-schale als Rahmen, .tp-kader-block fuer ein Team, .pa-person fuer
   eine Person. Neu ist nur, was es vorher nirgends gab: der klebende Kopf mit
   dem Zaehler und die zuklappbare Klassen-Ueberschrift.
   ============================================================================ */

/* Breiter als eine Karteikarte: Hier stehen Name, Kader-Abschnitt und ein
   Verschiebe-Ziel NEBENeinander. Bei 520px braeche jede Zeile um, und die
   Liste waere doppelt so lang wie das Blatt Papier daneben. */
.tp-karte.sehr-breit {
    max-width: 840px;
}

/* Der Kopf bleibt stehen: Beim Blaettern durch 96 Namen ist der Zaehler
   „84 von 96 da" die Zahl, die man dauernd im Auge behalten will. */
.tp-anw-kopf {
    position: sticky;
    top: -18px;
    z-index: var(--z-haftend);
    background: var(--surface-page);
    padding: 2px 0 8px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--border-color);
}

.tp-anw-kopfzeile {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.tp-anw-zaehler {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    margin-right: auto;
}

.tp-anw-zaehler strong {
    font-size: var(--fs-lg);
    font-weight: var(--weight-bold);
    color: var(--text-main);
}

.tp-anw-zaehler span {
    font-size: var(--fs-xs);
    color: var(--text-subtle);
}

/* Fehlt jemand, faerbt sich NUR die Zeile darunter — die grosse Zahl bleibt
   ruhig. Ein rot leuchtender Kopf bei einem einzigen Ausfall waere ein
   Alarm fuer etwas voellig Normales. */
.tp-anw-zaehler.ist-luecke span {
    color: var(--accent-amber-text);
    font-weight: var(--weight-strong);
}

.tp-anw-phase {
    max-width: 190px;
}

.tp-anw-suche {
    flex: 1;
    min-width: 140px;
}

.tp-anw-satz {
    font-size: var(--fs-xs);
    color: var(--text-subtle);
    line-height: 1.4;
}

.tp-anw-koerper {
    padding-top: 6px;
}

.tp-anw-klasse + .tp-anw-klasse {
    margin-top: 16px;
}

.tp-anw-klasse-kopf {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0 6px;
    border-bottom: 2px solid var(--border-strong);
    margin-bottom: 6px;
}

.tp-anw-klappe {
    display: flex;
    align-items: center;
    gap: 7px;
    border: none;
    background: none;
    padding: 2px 0;
    margin-right: auto;
    cursor: pointer;
    color: var(--text-main);
    font-size: var(--fs-md);
    font-weight: var(--weight-bold);
}

.tp-anw-klappe svg {
    color: var(--text-subtle);
    flex-shrink: 0;
    transition: transform 0.15s;
}

.tp-anw-klassezahl {
    font-size: var(--fs-xs);
    color: var(--text-subtle);
    white-space: nowrap;
}

.tp-anw-klassezahl.ist-luecke {
    color: var(--accent-amber-text);
    font-weight: var(--weight-strong);
}

.tp-anw-neu {
    flex-shrink: 0;
}

.tp-anw-leer {
    font-size: var(--fs-sm);
    color: var(--text-subtle);
    padding: 8px 2px 10px;
    line-height: 1.45;
}

.tp-anw-zuweisen {
    max-width: 150px;
}

/* Die Bruecke aus der Kader-Karte in die ganze Liste. Kein weiterer Segment-
   knopf im Umschalter darueber: Der schaltet die ANSICHT um, dieser hier
   oeffnet ein anderes Fenster — zwei verschiedene Dinge sehen auch
   verschieden aus. */
.tp-kader-alleklassen {
    display: block;
    margin: 0 0 4px auto;
    border: none;
    background: none;
    padding: 2px 0;
    cursor: pointer;
    color: var(--primary-strong);
    font-size: var(--fs-xs);
    font-weight: var(--weight-strong);
}

.tp-kader-alleklassen:hover {
    text-decoration: underline;
}

/* Im Dunkelmodus erzwingt `body.dark-mode button` (0,1,1) Grau MIT !important.
   Seine Ausnahmeliste prueft ausschliesslich INLINE-Stile — eine Klasse mit
   `background: none` faellt nicht darunter und wird grau uebermalt. Beide Verweise
   sehen dann aus wie gewoehnlicher Text und verlieren ihren einzigen Hinweis
   darauf, dass man sie antippen kann.

   (0,2,0) schlaegt (0,1,1) unter gleichem !important. Dasselbe Vorgehen wie bei
   body.dark-mode .sidebar-nav-btn weiter oben. */
body.dark-mode .tp-kader-alleklassen,
body.dark-mode .tp-anw-alle {
    background: none !important;
    color: var(--primary-strong) !important;
}

/* Der eingerastete Filter-Zustand: Der Punkt allein traegt es zwar, aber der
   Knopf soll dieselbe Sprache sprechen wie im hellen Modus. */
body.dark-mode .tp-anw-ansicht.ist-gefiltert {
    color: var(--primary-strong) !important;
    border-color: var(--primary-soft-border) !important;
}


/* --- Umschalter, Sortierung und Filter ---------------------------------- */

/* Vier Bedienelemente in einer Zeile, bewusst klein: Sie stehen ueber der
   Liste, nicht in ihr. Wer nichts umstellen will, soll sie ueberlesen. */
.tp-anw-schalter {
    gap: 6px;
}

.tp-anw-gliederung {
    flex-shrink: 0;
}

.tp-anw-gliederung .tp-segmented-item {
    padding: 5px 10px;
    font-size: var(--fs-xs);
}

.tp-anw-sortierung {
    max-width: 168px;
    font-size: var(--fs-xs);
    padding: 5px 8px;
}

/* Ein Filter ist ein Zustand, kein Befehl — deshalb bleibt er sichtbar
   eingerastet, statt nur beim Druecken aufzuleuchten. */
.tp-anw-filter {
    background: var(--surface-soft);
    color: var(--text-body);
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 5px 11px;
    font-size: var(--fs-xs);
    font-weight: var(--weight-bold);
    cursor: pointer;
    flex-shrink: 0;
}

.tp-anw-filter:hover {
    color: var(--primary-strong);
}

.tp-anw-filter.ist-an {
    background: var(--primary-soft-bg);
    border-color: var(--primary-soft-border);
    color: var(--primary-strong);
}

/* Symbol und Wort NEBENeinander — fuer alle Knoepfe des Kopfes, die beides
   tragen. Ohne inline-flex setzt der Browser das Wort unter das Symbol; genau
   das passierte dem Drucker-Knopf, weil die Regel anfangs nur am Ansicht-Knopf
   hing. Deshalb EINE Klasse fuer alle drei statt einer Aufzaehlung, die man beim
   naechsten Knopf wieder vergisst. Das Wort selbst faellt ab 599px weg
   (.tp-btn-label-wide), das Symbol bleibt. */
.tp-anw-wortknopf {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Ein Filter, der zugeklappt weiterwirkt, muss sich ansehen lassen. Der Punkt
   sagt „hier ist etwas eingestellt" — den Klartext traegt der Satz darunter. */
.tp-anw-ansicht.ist-gefiltert {
    border-color: var(--primary-soft-border);
    color: var(--primary-strong);
}

.tp-anw-ansicht.ist-gefiltert::after {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary-strong);
    flex-shrink: 0;
}

/* „Alle zeigen" steht IM Satz und sieht deshalb aus wie ein Verweis, nicht wie
   ein Knopf — sonst konkurrierte es mit den Filtern selbst. */
.tp-anw-alle {
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    color: var(--primary-strong);
    font-size: var(--fs-xs);
    font-weight: var(--weight-bold);
    text-decoration: underline;
}

/* Das Team neben dem Namen — nur in der Namensansicht. Es ist eine Auskunft,
   keine Ueberschrift: Es darf den Namen nicht ueberstimmen, muss aber lesbar
   bleiben, sonst braeuchte man es nicht. */
.tp-anw-team {
    font-size: var(--fs-xs);
    color: var(--text-subtle);
    font-weight: var(--weight-medium);
}

/* --- Der Druck-Auswahldialog -------------------------------------------- */

.tp-anw-druck-titel {
    margin: 0 0 4px;
    font-size: var(--fs-md);
    font-weight: var(--weight-bold);
    color: var(--text-main);
}

.tp-anw-druck-satz {
    margin: 0;
    font-size: var(--fs-xs);
    color: var(--text-subtle);
    line-height: 1.4;
}

.tp-anw-druck-zeile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    background: var(--surface-page);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.tp-anw-druck-name {
    display: block;
    font-size: var(--fs-base);
    font-weight: var(--weight-bold);
    color: var(--text-main);
}

.tp-anw-druck-zahl {
    display: block;
    font-size: var(--fs-xs);
    color: var(--text-subtle);
}

/* Zugeklappt — der Klick des Bedienenden. */
.tp-anw-schalter[data-state="closed"] {
    display: none;
}

/* --- Schwelle 1: die Schalter passen nicht mehr in eine Zeile ----------

   Unterhalb 640px braucht die Schalterzeile DREI Zeilen: Umschalter und
   Sortier-Auswahl sind je fuer sich schon breiter als das halbe Fenster.
   Gemessen bei 375px kostete der Kopf dadurch 276 von 715 Pixeln — 39%, und
   der erste Name stand bei y=407.

   Deshalb ist die Zeile hier per Vorgabe zu. „auto" heisst: Die Breite
   entscheidet. Wer den Ansicht-Knopf drueckt, schreibt 'open' oder 'closed'
   fest und ueberstimmt sie. Dasselbe Muster traegt die Hinweiskarte der
   Planung (.tp-nextstep) — der Vorteil ist, dass KEINE Bildschirmbreite im
   JavaScript steht, die man hier und dort auseinanderlaufen lassen koennte. */
@media (max-width: 640px) {
    .tp-anw-schalter[data-state="auto"] {
        display: none;
    }

    .tp-anw-phase {
        max-width: none;
        flex: 1;
    }

    .tp-anw-klasse-kopf {
        flex-wrap: wrap;
    }
}

/* --- Schwelle 2: Handy ------------------------------------------------

   Hier wird die LISTE selbst enger, nicht nur der Kopf. Die Personenzeile war
   95px hoch, weil die Handgriffe erzwungen umbrachen (flex: 1 0 100%) — nach
   dem Kopf blieben drei Namen im Blick.

   Kein Zwang mehr: Die Handgriffe stehen neben dem Namen, WENN sie passen, und
   brechen sonst von selbst um. Das regelt flex-wrap. Der Auswahl-Pool mit einem
   einzigen Knopf wird damit einzeilig, die Kader-Zeile mit fuenf Handgriffen
   notfalls zweizeilig — aber schmaler.

   min-width am Textteil ist die Zusicherung, die bleiben muss: Der Name wird
   NIE plattgedrueckt. Genau das war er vorher („Ann…"). */
@media (max-width: 599px) {
    .pa-person {
        padding: 7px 10px;
        gap: 8px;
        row-gap: 4px;
        flex-wrap: wrap;
    }

    .pa-person-sym {
        width: 26px;
        height: 26px;
        font-size: var(--fs-sm);
    }

    .pa-person-text {
        min-width: 150px;
    }

    /* Ein langer Abschnittsname („2. Halbzeit") sprengt sonst die Zeile und
       schiebt alles Uebrige in den Umbruch. */
    .tp-kader-chip {
        max-width: 92px;
    }

    /* Eine Auswahl in der Zeile ist mit 37px das HOECHSTE Element und bestimmt
       damit die Zeilenhoehe, sobald umbrochen wird — sichtbar bei den Personen
       ohne Team, deren „Zuweisen…“ die Zeile auf 82px trieb. */
    .pa-person-akt .tp-karte-select {
        padding: 4px 6px;
        font-size: var(--fs-xs);
        max-width: 132px;
    }

    /* Die Karte selbst: 40px Rand weniger sind 40px mehr fuer die Zeile. */
    .tp-karte-schale {
        padding: 8px;
    }

    .tp-karte {
        padding: 12px 12px 10px;
    }
}

/* ============================================================================
   DER AUSWAHL-DIALOG — „was soll mit den vorhandenen Daten geschehen?"

   Zwei Dialoge stellen dieselbe Art Frage, und der Bedienende trifft sie oft
   direkt hintereinander:

     showPlayerMergeConflictDialog   ein Team kommt auf einen Platz, in dem
                                     schon Personen stehen
     showClassSyncConflictDialog     die Klasse eines Teams aendert sich,
                                     waehrend Personen daran haengen

   Bis zum 03.09.2026 brachte JEDER seinen eigenen <style>-Block mit. Der zweite
   ausserdem rund zwanzig feste Farbwerte, eine eigene Schriftart, einen eigenen
   Eckenradius und einen eigenen Schatten. Nebeneinander sahen die beiden aus wie
   zwei Programme — und weil die Regeln im JavaScript standen, sah sie auch kein
   Farb-Waechter.

   DER FEHLER, DEN DAS VERURSACHT HAT, steht weiter unten beim Hover: Beide
   Dialoge trugen dort einen fest eingetragenen dunklen Ton, waehrend die
   Schriftfarbe aus einem Token kam. Als die Palette von „gefuellt + weiss" auf
   „blass + dunkle Schrift" umgestellt wurde, zog nur das Token mit. Ergebnis:
   dunkles Petrol auf dunklem Petrol.
   ============================================================================ */

@keyframes tp-wahl-auf {
    from { transform: scale(0.96); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* Eigene Schale statt .tp-karte-schale: Diese Dialoge liegen ueber ALLEM, auch
   ueber einer offenen Kader-Karte, die selbst schon auf --z-dialog sitzt. */
.tp-wahl-schale {
    position: fixed;
    inset: 0;
    z-index: var(--z-meldung);
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    box-sizing: border-box;
}

/* Radius, Rahmen und Schatten wie bei der Karteikarte (.tp-karte) — die ist der
   Massstab fuer „so sieht ein Fenster in dieser App aus". */
.tp-wahl-karte {
    width: min(100%, 460px);
    max-height: 88vh;
    overflow-y: auto;
    background: var(--surface-page);
    color: var(--text-body);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    box-sizing: border-box;
    animation: tp-wahl-auf 0.18s ease-out;
}

.tp-wahl-kopf {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--primary-soft-bg);
    color: var(--primary-strong);
    border-bottom: 1px solid var(--primary-soft-border);
    font-size: var(--fs-xl);
    font-weight: var(--weight-bold);
}

.tp-wahl-kopf svg {
    flex-shrink: 0;
}

/* Bernstein statt Tuerkis, wo die Antwort etwas WEGnehmen kann. Es ist derselbe
   Kopf, nur in der Warnfarbe — keine zweite Bauweise. */
.tp-wahl-kopf.ist-warnung {
    background: var(--accent-amber-bg);
    color: var(--accent-amber-text);
    border-bottom-color: var(--accent-amber-border);
}

.tp-wahl-text {
    padding: 18px 20px;
    color: var(--text-body);
    font-size: var(--fs-base);
    line-height: 1.6;
}

.tp-wahl-text b {
    color: var(--primary-strong);
}

.tp-wahl-knoepfe {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 0 20px 18px;
}

.tp-wahl-knopf {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 100%;
    padding: 11px 14px;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: var(--fs-base);
    font-weight: var(--weight-bold);
    line-height: 1.25;
    transition: background 0.18s, border-color 0.18s, color 0.18s;
}

/* Die zweite Zeile im Knopf sagt, was die Wahl BEWIRKT. Sie ist leiser als die
   Beschriftung, aber kein Kleingedrucktes — daran haengt die Entscheidung. */
.tp-wahl-neben {
    font-size: var(--fs-xs);
    font-weight: var(--weight-normal);
    opacity: 0.85;
}

.tp-wahl-knopf.ist-haupt {
    background: var(--primary-fill-bg);
    color: var(--primary-fill-fg);
    border-color: var(--primary-fill-border);
}

/* HIER lag der gemeldete Fehler. Beide Dialoge trugen `background: #0f766e`
   fest ein, waehrend die Schrift aus --primary-fill-fg kam. Solange die Fuellung
   dunkel und die Schrift weiss war, ging das auf. Seit die Palette auf
   --primary-fill-bg: #f0fdfa / --primary-fill-fg: #0f766e steht, schrieb der
   Hover dunkles Petrol unter dunkles Petrol — der Knopf wurde beim Ueberfahren
   unlesbar. --primary-fill-hover gehoert zum selben Dreiklang und geht diesen
   Weg immer mit. */
.tp-wahl-knopf.ist-haupt:hover {
    background: var(--primary-fill-hover);
}

.tp-wahl-knopf.ist-neben {
    background: var(--surface-page);
    border-color: var(--border-strong);
    color: var(--text-body);
}

.tp-wahl-knopf.ist-neben:hover {
    background: var(--surface-soft);
    border-color: var(--text-subtle);
}

/* Abbrechen traegt keine Flaeche: Es ist der Rueckweg, keine dritte Wahl. */
.tp-wahl-knopf.ist-still {
    background: none;
    border-color: transparent;
    color: var(--text-subtle);
    padding: 8px 14px;
    font-weight: var(--weight-strong);
}

.tp-wahl-knopf.ist-still:hover {
    color: var(--accent-red-text);
}

/* Im Dunkelmodus uebermalt `body.dark-mode button` (0,1,1) jede Knopffarbe mit
   !important; seine Ausnahmeliste prueft nur INLINE-Stile und trifft Klassen
   nicht. (0,2,0) schlaegt das — dasselbe Vorgehen wie bei .sidebar-nav-btn. */
body.dark-mode .tp-wahl-knopf.ist-haupt {
    background: var(--primary-fill-bg) !important;
    color: var(--primary-fill-fg) !important;
    border-color: var(--primary-fill-border) !important;
}

body.dark-mode .tp-wahl-knopf.ist-haupt:hover {
    background: var(--primary-fill-hover) !important;
}

body.dark-mode .tp-wahl-knopf.ist-neben {
    background: var(--surface-soft) !important;
    border-color: var(--border-strong) !important;
    color: var(--text-body) !important;
}

body.dark-mode .tp-wahl-knopf.ist-still {
    background: none !important;
    color: var(--text-subtle) !important;
}

body.dark-mode .tp-wahl-knopf.ist-still:hover {
    color: var(--accent-red-text) !important;
}

@media (max-width: 599px) {
    .tp-wahl-schale { padding: 10px; }
    .tp-wahl-kopf   { padding: 13px 15px; font-size: var(--fs-lg); }
    .tp-wahl-text   { padding: 15px; }
    .tp-wahl-knoepfe { padding: 0 15px 15px; }
}

/* ============================================================================
   SEITENLEISTE EINGEKLAPPT  (body.seitenleiste-schmal)

   Die Leiste ist ab 900 px fest 220 px breit. Auf einem 1280er Bildschirm sind
   das 17 % der Flaeche, und mit vergroesserter Schrift (die App kann bis 125)
   bleibt entsprechend wenig fuer den Inhalt. Eingeklappt bleiben die Symbole
   stehen, die Beschriftungen gehen weg.

   Geaendert wird NUR das Token --seitenleiste-breite; Leiste, Inhaltsbereich und
   Gast-Banner haengen alle daran und wandern von selbst mit.
   ============================================================================ */
@media (min-width: 900px) {

    body.seitenleiste-schmal {
        --seitenleiste-breite: 64px;
    }

    /* Beschriftungen weg, Symbole mittig.

       `:not(.icon)` ist wichtig und war zuerst vergessen: Die Krone der
       Turnier-Zeile steckt in einem <span class="icon"> INNERHALB des Knopfes,
       nicht in einem .sidebar-row-icon daneben. Ohne die Ausnahme verschwand sie
       eingeklappt mit den Beschriftungen — die Zeile war dann eine leere Flaeche. */
    body.seitenleiste-schmal .sidebar-nav-btn span:not(.tp-nav-badge):not(.icon),
    body.seitenleiste-schmal .app-logo-text,
    body.seitenleiste-schmal .sidebar-user-btn span,
    body.seitenleiste-schmal .sidebar-tournament-nav-name,
    body.seitenleiste-schmal .sidebar-pencil-icon,
    body.seitenleiste-schmal .sidebar-chevron-toggle,
    body.seitenleiste-schmal .sidebar-chevron-spacer {
        display: none !important;
    }

    /* Die Schrift-Zeile ganz weg, nicht nur ihr Auswahlfeld: Sonst bliebe ein
       einsames „A" stehen, das nichts tut. Die Schriftgroesse stellt man mit
       ausgeklappter Leiste (oder auf dem Handy) ein. */
    body.seitenleiste-schmal .sidebar-item-row:has(.tp-font-size-control) {
        display: none !important;
    }

    /* Die Untermenues haben eingeklappt keinen Platz fuer ihre Beschriftungen.
       Sie bleiben ueber die Ansicht selbst erreichbar. */
    body.seitenleiste-schmal .sidebar-submenu {
        display: none !important;
    }

    body.seitenleiste-schmal .sidebar-item-row {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
        /* Eingeklappt ist die ganze Zeile die Schaltflaeche. Gemessen am 08.09.2026:
           Die Zeile war 42 px breit, davon nahm das Symbol 36 px und der Knopf 6 px —
           das Symbol ist ein GESCHWISTER des Knopfes, kein Inhalt. 86 % der Zeile
           taten also nichts, und ein Klick wechselte nur selten die Ansicht.
           Die Weiterleitung macht sidebar-logic.js; hier steht nur, dass es sich
           anfuehlt wie ein Knopf und gross genug zum Treffen ist. */
        cursor: pointer;
        min-height: 40px;
    }

    /* Die Zeile hat zwei Kinder: das Symbol (fest 36 px) und den Knopf (fuellt den
       Rest). Zusammen fuellen sie die Zeile exakt aus - `justify-content: center`
       an der Zeile hatte deshalb NICHTS zu zentrieren, und das Symbol sass bei 18
       statt bei 32. Eingeklappt bekommt darum das Symbol die ganze Breite und
       zentriert seinen Inhalt selbst; der Knopf faellt auf null zusammen.
       Er wird nicht gebraucht: Der Klick kommt von der Zeile (sidebar-logic.js). */
    body.seitenleiste-schmal .sidebar-item-row > .sidebar-row-icon {
        flex: 1 1 auto;
        width: auto;
        margin: 0;
        justify-content: center;
        pointer-events: none;   /* der Klick gehoert der Zeile */
    }

    body.seitenleiste-schmal .sidebar-item-row:has(> .sidebar-row-icon) > .sidebar-nav-btn {
        flex: 0 0 0;
        width: 0;
        min-width: 0;
        padding-left: 0;
        padding-right: 0;
        overflow: hidden;
    }

    /* Die Turnier-Zeile hat kein Symbol daneben - ihre Krone steckt IM Knopf.
       Sie wird darum im Knopf zentriert, und der Abstand zum (ausgeblendeten)
       Namen faellt weg. */
    body.seitenleiste-schmal .sidebar-tournament-nav-btn {
        justify-content: center;
    }

    body.seitenleiste-schmal .sidebar-nav-btn .icon {
        margin-right: 0;
    }

    body.seitenleiste-schmal .sidebar-nav-btn {
        padding-left: 0;
        padding-right: 0;
        justify-content: center;
    }

    body.seitenleiste-schmal .sidebar-header {
        padding: 20px 0 0 0;
        align-items: center;
    }

    /* Eingeklappt zeigt der Kopf NUR den Umschalter, mittig.

       Zuerst standen Logo und Umschalter untereinander. Das sass zwar mittig, kostete
       aber rund 30 px Hoehe an genau der Stelle, an der das Menue ohnehin zu lang war.
       Nebeneinander passen sie in 64 px nicht (Logo 32 + Umschalter 24 + Abstand).
       Also faellt weg, was dort keine Funktion hat: das Logo. */
    body.seitenleiste-schmal .sidebar-logo {
        justify-content: center;
        gap: 0;
    }

    body.seitenleiste-schmal .app-logo-img {
        display: none;
    }

    body.seitenleiste-schmal .sidebar-header {
        padding: 12px 0 0 0;
    }

    /* Die Turnier-Zeile behaelt eingeklappt nur ihre Krone - und die muss auf
       dieselbe Achse wie die Symbole darunter. */
    body.seitenleiste-schmal .sidebar-turnier-zeile {
        margin-left: 0;
    }

    /* Fusszeile eingeklappt: Konto oben, Abmelden darunter, beide mittig.
       Nebeneinander waeren zwei 32-px-Symbole plus Abstand breiter als die Leiste. */
    body.seitenleiste-schmal .sidebar-footer {
        flex-direction: column;
        gap: 2px;
    }

    /* Die Liste behielt eingeklappt ihr `padding-left: 21px` aus der breiten
       Fassung. Das hatte ZWEI sichtbare Folgen, die wie zwei Fehler aussahen:

       1. Die Symbole sassen bei x=39 statt bei 32 — also nicht mittig. Weil die
          Fusszeile ihr eigenes Padding hat, stand der Avatar bei x=17. Es sah
          aus, als sei der Avatar verrutscht; in Wahrheit sass NICHTS mittig.
       2. Sobald die Liste senkrecht scrollte, nahm der Balken 15 px weg. Von den
          63 px blieben 48, der Inhalt brauchte 53 — also erschien zusaetzlich ein
          WAAGERECHTER Balken in einer 64 px breiten Leiste.

       `overflow-x: hidden` ist die Sicherung: In dieser Breite darf nie ein
       waagerechter Balken entstehen, egal was der senkrechte uebrig laesst. */
    body.seitenleiste-schmal .sidebar-nav {
        padding-left: 0;
        padding-right: 0;
        overflow-x: hidden;
        /* Der senkrechte Balken nahm 15 px der 63 px weg. Die Zeilen waren dann nur
           48 px breit und ihre Mitte lag bei 24 statt 32 - die Symbole standen
           links, die Fusszeile daneben mittig. In einer 64 px schmalen Leiste ist
           ein 15 px breiter Balken ohnehin ein Viertel der Flaeche. Er wird darum
           ausgeblendet; GESCROLLT werden kann weiter (Rad, Wischen, Tastatur). */
        scrollbar-width: none;
    }

    body.seitenleiste-schmal .sidebar-nav::-webkit-scrollbar {
        display: none;
    }

    body.seitenleiste-schmal .sidebar-footer {
        padding-left: 0;
        padding-right: 0;
        display: flex;
        justify-content: center;
    }

    body.seitenleiste-schmal .sidebar-user-btn {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
        width: auto;
    }

    /* Der Abstand zum Namen daneben - eingeklappt gibt es keinen Namen mehr, und
       die 10 px schoben den Avatar aus der Mitte. */
    body.seitenleiste-schmal .user-avatar-placeholder {
        margin-right: 0;
    }

    /* Der Umschalter selbst — Groesse und Aussehen stehen oben bei den drei
       Symbolen der rechten Achse; hier nur, wo er sitzt. */
    #sidebar-schmal-schalter {
        margin-left: auto;
    }

    #sidebar-schmal-schalter:hover {
        background: var(--surface-soft);
    }

    body.seitenleiste-schmal #sidebar-schmal-schalter {
        margin: 0;
    }
}

/* Unter 900 px gibt es keine Seitenleiste — der Umschalter waere dort sinnlos. */
@media (max-width: 899px) {
    #sidebar-schmal-schalter {
        display: none;
    }
}


/* ============================================================================
   NAMENSCHUTZ — wer sieht die Namen? (namenschutz.js, Stufe 2, 16.09.2026)
   Auswahl im Dialog und im Assistenten, ruhiges Statusschild in „Teilen & Zugaenge".
   Das Schild ist KEIN Warnschild (Entscheidung E6): gleiche Ruhe fuer beide Wahlen,
   nur der Punkt unterscheidet sie.
   ============================================================================ */
.tp-rueckfrage.tp-namenschutz {
    max-width: 440px;
    text-align: left;
}

.tp-namenschutz-liste {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 1.1rem;
}

.tp-namenschutz-wahl {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 13px;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-card);
    cursor: pointer;
}

.tp-namenschutz-wahl.ist-gewaehlt {
    border-color: var(--color-primary);
    background: var(--primary-soft-bg);
}

/* Wahl 3 ohne Konto (Etappe 3c): sichtbar und lesbar, nur nicht waehlbar. Bewusst KEIN opacity —
   das nimmt dem Grund, der dort steht, den Kontrast. */
.tp-namenschutz-wahl.ist-gesperrt {
    cursor: not-allowed;
    background: var(--surface-soft);
    border-style: dashed;
}

.tp-namenschutz-wahl input {
    margin-top: 3px;
    flex-shrink: 0;
}

.tp-namenschutz-inhalt {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.tp-namenschutz-titel {
    font-weight: var(--weight-strong);
    color: var(--text-strong);
    font-size: var(--fs-md);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.tp-namenschutz-satz {
    font-size: var(--fs-sm);
    color: var(--text-body);
    line-height: 1.45;
}

/* Was die Wahl NICHT umfasst (19.09.2026): ein ruhiger Satz unter der Liste, kein Warnton. */
.tp-namenschutz-umfang {
    font-size: var(--fs-sm);
    color: var(--text-body);
    line-height: 1.45;
    margin: -0.5rem 0 1.1rem;
}

.tp-namenschutz-assistent .tp-namenschutz-umfang {
    margin: 8px 0 0;
}

/* Grund, warum eine Wahl gesperrt ist: eigene Zeile, sonst klebt er am Satz (20.09.2026). */
.tp-namenschutz-grund {
    display: block;
    margin-top: 3px;
    font-weight: var(--weight-strong);
}

.tp-namenschutz-knoepfe {
    flex-wrap: wrap;
}

.tp-namenschutz-assistent {
    margin-top: 18px;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.tp-namenschutz-assistent .tp-namenschutz-liste {
    margin-bottom: 0;
}

.tp-namenschutz-assistent-kopf {
    font-weight: var(--weight-strong);
    color: var(--text-strong);
    margin-bottom: 4px;
}

.tp-namenschutz-assistent-zeile {
    font-size: var(--fs-sm);
    color: var(--text-body);
    line-height: 1.45;
    margin-bottom: 10px;
}

.tp-namenschutz-schild {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 11px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: var(--fs-sm);
    font-weight: var(--weight-strong);
    cursor: pointer;
}

.tp-namenschutz-schild:hover,
.tp-namenschutz-schild:focus-visible {
    border-color: var(--color-primary);
}

.tp-namenschutz-punkt {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--text-subtle);
    flex-shrink: 0;
}

.tp-namenschutz-schild.ist-geschuetzt .tp-namenschutz-punkt,
.tp-namenschutz-schild.ist-ohne .tp-namenschutz-punkt,
.tp-namenschutz-schild.ist-verborgen .tp-namenschutz-punkt {
    background: var(--color-primary);
}


/* NAMENS-PASSWORT (namensschluessel.js, Stufe 2 Etappe 2, 16.09.2026): Felder im Rueckfrage-Stil. */
.tp-rueckfrage.tp-namensschluessel {
    max-width: 420px;
    text-align: left;
}

.tp-ns-feld {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: var(--fs-sm);
    font-weight: var(--weight-strong);
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.tp-ns-feld input {
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    padding: 0 11px;
    font-size: var(--fs-md);
    background: var(--bg-card);
    color: var(--text-main);
}

.tp-ns-haken {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-sm);
    color: var(--text-body);
    margin-bottom: 10px;
}

.tp-ns-staerke {
    font-size: var(--fs-xs);
    color: var(--text-body);
    margin: -4px 0 10px;
    min-height: 1em;
}

.tp-ns-meldung {
    font-size: var(--fs-sm);
    color: var(--color-danger);
    min-height: 1.2em;
    margin-bottom: 10px;
}

.tp-ns-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: var(--fs-lg);
    font-weight: var(--weight-strong);
    letter-spacing: 1px;
    text-align: center;
    padding: 14px 8px;
    margin-bottom: 12px;
    border: 2px solid var(--border-strong);
    border-radius: 10px;
    color: var(--text-strong);
    overflow-wrap: anywhere;
    user-select: all;
}

.tp-ns-zeile {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.tp-ns-zeile button {
    flex: 1;
    padding: 9px;
    border-radius: 10px;
    font-weight: var(--weight-strong);
    cursor: pointer;
}

.tp-ns-links {
    justify-content: space-between;
}

.tp-ns-zeile .tp-ns-link {
    flex: 0 0 auto;
    background: none;
    border: none;
    padding: 4px 0;
    color: var(--primary-strong);
    text-decoration: underline;
    font-size: var(--fs-sm);
}

/* NAMEN GESCHUETZT, Geraet ohne Schluessel (namen-anzeige.js, Etappe 3b): ruhige Leiste oben, kein Warnton. */
/* Die Regeln fuer .tp-namen-hinweis standen bis zum 21.09.2026 hier — und damit
   NUR fuer Seiten, die style_v2.css laden. Die Live-Zentrale tut das bewusst nicht;
   dort stand das Band unformatiert als Flex-Kind neben der Karte und nahm die halbe
   Seite ein. Es bringt sein Aussehen jetzt selbst mit (namen-anzeige.js), mit
   Rueckfallwerten fuer jedes Token. Eine Stelle erzeugt es, eine Stelle gestaltet es. */


/* ============================================================================
   MENUE-GRUPPEN UND DICHTE  (21.09.2026)

   Hierher verschoben aus @media (min-width: 900px): Diese Regeln gelten fuer BEIDE
   Menuefassungen. Was nur fuer die Seitenleiste gilt, steht unten in einem eigenen,
   ausdruecklichen Medienblock.
   ============================================================================ */
/* Das Namensschild im Menue (umgezogen aus dem Teilen-Hub, 21.09.2026). Leer, solange
   kein Turnier offen ist — namenschutz.js fuellt es und frischt es auf. Ohne Inhalt
   nimmt es dank :empty keinen Platz. */
.menue-namenschutz {
    /* Kein eigener Einzug: Die Huelle beginnt auf der Kante der Symbolspalte (Krone,
       Logo, Menuesymbole) — das Schild richtet sich darin selbst aus, siehe unten. */
    padding: 0 0 2px 0;
}

/* Im Menue KEINE Pille (23.09.2026). Mit Rahmen und eigenem Einzug wirkte das Schild
   wie ein eingesetzter Fremdkoerper: Punkt bei x=46, Krone und Logo bei x=31/32,
   Text auf keiner Kante des Menues. Jetzt ist es die Statuszeile des Turniers darueber:
   - der Punkt sitzt mittig in einer 20 px breiten Spalte — genau die Breite der Krone
     und der Menuesymbole, also auf deren Mittellinie;
   - der Text beginnt auf der Textkante des Turniernamens (20 px Spalte + 10 px Luecke);
   - leiser als ein Menuepunkt (kleiner, Sekundaerfarbe), weil man es liest, nicht trifft;
   - antippbar bleibt es, der Rahmen erscheint erst beim Darueberfahren als Zeilenflaeche.
   Das Schild im Assistenten und in Dialogen behaelt seine Pillenform — dort steht es fuer
   sich und braucht die Umrandung. */
.menue-namenschutz .tp-namenschutz-schild {
    display: flex;
    gap: 10px;
    padding: 3px 8px 3px 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font-size: var(--fs-sm);
    font-weight: var(--weight-normal);
    color: var(--text-secondary);
}

.menue-namenschutz .tp-namenschutz-schild:hover,
.menue-namenschutz .tp-namenschutz-schild:focus-visible {
    background: var(--surface-soft);
    color: var(--text-body);
}

/* 8 px Punkt + 6 px je Seite = 20 px Spalte. Der weiche Ring macht aus dem Punkt ein
   Statuslicht statt eines Aufzaehlungszeichens — und gibt ihm annaehernd das optische
   Gewicht eines 20-px-Symbols, ohne laut zu werden. */
.menue-namenschutz .tp-namenschutz-punkt {
    margin: 0 6px;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--text-subtle) 22%, transparent);
}

.menue-namenschutz .ist-geschuetzt .tp-namenschutz-punkt,
.menue-namenschutz .ist-ohne .tp-namenschutz-punkt,
.menue-namenschutz .ist-verborgen .tp-namenschutz-punkt {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 22%, transparent);
}

/* Burger-Menue: Dort gibt es keine Krone, die Symbolspalte ist 36 px breit und beginnt
   hinter dem Platz fuer die Aufklapp-Pfeile (gemessen: Symbolmitte x=67, Text x=85 bei
   11 px Menue-Einzug). 38 px Einzug + 36 px Spalte setzen Punkt und Text auf dieselben
   Linien wie „Planung", „Teilnehmer" usw. */
.main-nav .menue-namenschutz {
    padding-left: 38px;
}

.main-nav .menue-namenschutz .tp-namenschutz-schild {
    gap: 0;
}

.main-nav .menue-namenschutz .tp-namenschutz-punkt {
    margin: 0 14px;
}

.menue-namenschutz:empty {
    display: none;
}

@media (min-width: 900px) {
    /* Eingeklappt bleibt nur Platz fuer Symbole — das Schild traegt Text. */
    body.seitenleiste-schmal .menue-namenschutz {
        display: none;
    }
}

/* ============================================================================
   GRUPPEN-UEBERSCHRIFTEN IM HAUPTMENUE  (.menue-gruppe, 21.09.2026)

   Vorbereiten · Am Turniertag · Zeigen. Sie sind KEIN Knopf und kosten keinen Klick —
   sie sagen nur, wozu die Zeilen darunter gehoeren (Entwurf A, ROADMAP Thema 8).

   Bewusst leise: --fs-2xs, gesperrt, in --text-subtle. Eine Ueberschrift, die so laut
   ist wie die Eintraege, macht das Menue nicht klarer, sondern voller.
   ============================================================================ */
.menue-gruppe {
    /* Sie ist ein <button> (seit 21.09.2026 klappt sie ihre Gruppe zu), sieht aber
       bewusst nicht danach aus: kein Rahmen, kein Hintergrund, keine eigene Farbe.
       Die Klasse (0,1,0) schlaegt Tailwinds Preflight-Regel fuer `button` (0,0,1). */
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    font-size: var(--fs-2xs);
    font-weight: var(--weight-strong);
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    /* 12 -> 5 px oben. Die Ueberschrift trennt schon durch Farbe und Groesse; der
       breite Abstand kam aus der Zeit, als sie kein Schalter war. */
    padding: 5px 8px 1px 4px;
    user-select: none;
}

.menue-gruppe:hover {
    background: none;
    color: var(--text-main);
}

/* Zugeklappt UND der gerade offene Eintrag steckt darin. Ohne dieses Zeichen waere
   „wo bin ich?" verschwunden, sobald jemand seine Arbeitsgruppe zuklappt. */
.menue-gruppe.hat-aktiven {
    color: var(--primary-strong);
}

/* Der Pfeil zeigt nach unten, solange die Gruppe offen ist, und nach rechts, wenn sie
   zu ist — dieselbe Leserichtung wie bei den Untermenue-Chevrons. */
.menue-gruppe-pfeil {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.menue-gruppe[aria-expanded="false"] .menue-gruppe-pfeil {
    transform: rotate(-90deg);
}

/* Die Huelle der Gruppe. In der Seitenleiste ist die Liste eine Flex-Spalte mit 4 px
   Abstand; ohne dieselbe Angabe hier waeren die Zeilen INNERHALB einer Gruppe auf
   einmal dichter als zwischen den Gruppen. */
.menue-gruppe-inhalt {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menue-gruppe-inhalt.zu {
    display: none;
}

/* Die erste Ueberschrift steht schon unter der Turnier-Zeile — dort waere der volle
   Abstand oben eine Luecke. */
.menue-gruppe:first-child,
.menue-namenschutz + .menue-gruppe {
    padding-top: 2px;
}

@media (min-width: 900px) {
    /* Eingeklappt stehen nur Symbole. Eine Ueberschrift ohne Text waere ein leerer
       Balken, der nur Hoehe kostet — dieselbe Ueberlegung wie bei der Schrift-Zeile. */
    body.seitenleiste-schmal .menue-gruppe {
        display: none;
    }

    /* UND DESHALB: Ohne Ueberschrift gibt es keinen Schalter. Eine zugeklappte Gruppe
       waere in der schmalen Leiste nicht wieder zu oeffnen — ihre Symbole waeren weg
       und nichts erklaerte, warum. Schmal gilt jede Gruppe als offen. */
    body.seitenleiste-schmal .menue-gruppe-inhalt.zu {
        display: flex;
    }
}

/* ============================================================================
   BURGER-MENUE ENG  (.main-nav, 21.09.2026)

   Die Seitenleiste wurde am selben Tag auf 13 px und 36 px Zeilenhoehe gestellt; das
   Burger-Menue blieb stehen — und war danach GROESSER als vorher im Vergleich:

       Seitenleiste:  13 px Schrift, 36 px Zeile, 40 px Abstand von Zeile zu Zeile
       Burger (alt):  16 px Schrift, 44 px Zeile, 52 px Abstand

   Die 16 px kamen nicht aus einer Ueberlegung, sondern aus einer Regel in
   `@media (max-width: 640px)`, die `.nav-btn` auf --fs-xl HOCHsetzte. Damit war die
   Beschriftung im Burger-Menue die groesste Schrift der ganzen App.

   WAS HIER NICHT PASSIERT: die Zeilenhoehe auf 36 px zu ziehen. Die Seitenleiste
   erscheint erst ab 900 px — Maus, Trackpad oder Tablet quer. Das Burger-Menue ist
   das Menue fuer den FINGER, und dafuer empfehlen Apple und Google 44 px.
   40 px ist der Kompromiss: knapp darunter, weit ueber den 24 px, die WCAG 2.2 AA
   verlangt (Erfolgskriterium 2.5.8) — und die Zeile ist ueber die volle Breite des
   Menues antippbar, nicht nur der Text.

   NACHTRAG VOM SELBEN TAG: Hier stand zuerst 14 px Schrift und 40 px Zeilenhoehe —
   eine Stufe ueber der Seitenleiste, mit dem Argument, ein Handy werde weiter vom Auge
   weg gehalten. Davids Einwand nach dem Ansehen: „Es wirkt irgendwie zu klobig im
   Vergleich." Er hat recht, und das Argument trug nicht: Das Burger-Menue erscheint
   unter 900 px, und das ist auf den meisten Geraeten ein SCHMALES FENSTER am Rechner,
   nicht unbedingt ein Handy. Zwei Dichten fuer dasselbe Menue sind ausserdem genau der
   Zustand, gegen den menue-daten.js und pruefe-menue.js gebaut wurden — nur eben in
   der Gestaltung statt im Inhalt.

   Jetzt deckungsgleich mit der Seitenleiste: 13 px, Zeilenhoehe 1,25, 7 px Polster,
   2 px Abstand — 30 px Zeile, 34 px von Zeile zu Zeile, in beiden Fassungen gleich.
   Die Zeile ist dabei ueber die volle Breite des Menues antippbar (rund 300 px), nicht
   nur der Text; ueber der WCAG-2.2-AA-Grenze von 24 px liegt sie deutlich.
   ============================================================================ */
.main-nav .nav-btn {
    font-size: var(--fs-md);
    line-height: 1.25;
    /* `height: 40px` war eine feste Zahl an einer Stelle, an der sonst die Schrift die
       Hoehe bestimmt. Jetzt ergibt sich die Zeile aus Zeilenhoehe und Polster, genau wie
       in der Seitenleiste — eine Regel, zwei Fassungen.
       (Mit dem Vergroesserungsschalter hat das nichts zu tun: `.app-header` steht in der
       Liste mit `--tp-font-scale: 1`, das Burger-Menue waechst also ohnehin nicht mit.
       Nachgemessen am 22.09.2026 bei 100, 112 und 125 % — immer 13 px.) */
    height: auto;
    padding: 7px 12px 7px 0;
}

.main-nav .nav-item-row {
    /* 4 -> 2 px. Zusammen mit 30 px Zeile ergibt das 34 px von Zeile zu Zeile —
       derselbe Abstand wie in der Seitenleiste (30 + 4 px Luecke). */
    margin: 2px 0;
}

/* ============================================================================
   DAS „i" IM KOPF EINES DIALOGS  (.tp-erklaer-knopf, 21.09.2026)

   Die fuenf Zugaenge (Anmeldung, Schiedsrichter, Veroeffentlichung, Live-Anzeigen,
   Turnier teilen) hatten ihre Erklaerung bis zum 21.09.2026 im Teilen-Hub: Jede Karte
   dort trug ein „i", das die Folien aus erklaer-modi.js oeffnete. Mit Entwurf A
   stehen die fuenf direkt im Menue — der Hub ist weg, und mit ihm waeren die
   Erklaerungen unerreichbar geworden. Das „i" ist deshalb mit umgezogen: aus der
   Karte in den KOPF des jeweiligen Dialogs.

   Die Form ist bewusst dieselbe wie vorher (30 px, randlos, erst beim Zeigen ein
   Rahmen) — wer sie im Hub gelernt hat, erkennt sie wieder.
   Die 30 px sind ueber der WCAG-2.2-AA-Grenze von 24 px (Erfolgskriterium 2.5.8).
   ============================================================================ */
.tp-erklaer-knopf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    min-width: 30px;
    flex-shrink: 0;
    padding: 0;
    border: 1px solid transparent !important;
    border-radius: 8px;
    background: transparent !important;
    color: var(--text-subtle);
    cursor: pointer;
}

.tp-erklaer-knopf:hover,
.tp-erklaer-knopf:focus-visible {
    border-color: var(--border-color) !important;
    background: var(--surface-soft) !important;
    color: var(--primary-strong);
}

.tp-erklaer-knopf svg {
    display: block;
}

/* `.tp-modal-head` steht auf `justify-content: space-between` und hatte bis hierher
   genau zwei Kinder (Titel links, Schliessen rechts). Ein drittes Kind wuerde sich
   ohne diese Zeile in die MITTE setzen. Der Titel nimmt deshalb den freien Platz,
   „i" und Schliessen stehen zusammen rechts. */
.tp-modal-head .tp-modal-title {
    flex: 1 1 auto;
}

.tp-modal-head .tp-erklaer-knopf {
    margin-left: auto;
    align-self: center;
}

/* ============================================================================
   GESTALTUNG — „Kacheln auf ruhigem Grund“ · Grundgerüst (26.09.2026)
   Entscheidungen und Begründung: PLANUNG_Design.md. Kurz: getönter Grund, weiße Karten
   ohne Rahmen, straffe Ecken, EINE Überschriftenform (Phase = Kopf ihrer Karte), Türkis als
   einziger Akzent, Spielstand als großer Wert.
   NUR unter #app: public.html und einrichtung.html laden dasselbe Stylesheet und bekommen
   einen eigenen Schritt. Die Live-Anzeige (Beamer) bleibt bewusst unverändert.
   !important, weil die Bausteine ihre Flächen und Rahmen inline mitbringen (siehe memory
   farb-token-inline-styles) — Werte kommen trotzdem nur aus den Token hier oben.
   ============================================================================ */
:root {
    --gestalt-grund: #eef2f1;
    --gestalt-karte-radius: 6px;
    --gestalt-knopf-radius: 5px;
    --gestalt-marke-radius: 4px;
    --gestalt-karte-schatten: 0 1px 2px rgba(15, 23, 42, 0.04), 0 6px 20px rgba(15, 23, 42, 0.05);
    --gestalt-haarlinie: #eef1f4;
    --gestalt-menue-aktiv: rgba(13, 107, 99, 0.08);
}
body.dark-mode {
    --gestalt-grund: #0b1120;
    --gestalt-karte-schatten: 0 1px 2px rgba(0, 0, 0, 0.35);
    --gestalt-haarlinie: rgba(255, 255, 255, 0.06);
    --gestalt-menue-aktiv: rgba(94, 234, 212, 0.08);
}

/* Grund: App-Fläche und Seitenleiste */
#app,
#app main,
#app .tab-content,
#app #desktop-sidebar {
    background: var(--gestalt-grund) !important;
}
#app #desktop-sidebar {
    border-right: none !important;
}

/* Menü: der aktive Punkt ist EINE getönte Zeile über die ganze Breite, Schrift kräftig. */
#app #desktop-sidebar .sidebar-nav-btn.active {
    background: transparent !important;
    box-shadow: none !important;
    color: var(--primary-strong) !important;
    font-weight: var(--weight-strong) !important;
}
#app #desktop-sidebar .nav-item-row:has(.sidebar-nav-btn.active) {
    background: var(--gestalt-menue-aktiv) !important;
    border-radius: var(--gestalt-knopf-radius) !important;
}

/* Gast-Hinweis: ruhig im Akzent statt Lila */
#app #guest-mode-banner {
    background: var(--primary-soft-bg) !important;
    color: var(--primary-strong) !important;
    border: none !important;
    box-shadow: none !important;
}
#app #guest-mode-banner button,
#app #guest-mode-banner a {
    background: var(--primary-strong) !important;
    color: var(--bg-card) !important;
    border-radius: var(--gestalt-knopf-radius) !important;
}

/* EINE Kartenform: weiß, ohne Rahmen, straffe Ecken, weicher Schatten */
#app .phase-card,
#app .match-table-card,
#app .tp-nextstep,
#app .tp-filter-drawer,
#app .tp-axis-bar,
#app #standings div:has(> div > .tp-standings-row) {
    background: var(--bg-card) !important;
    border: none !important;
    border-radius: var(--gestalt-karte-radius) !important;
    box-shadow: var(--gestalt-karte-schatten) !important;
}
/* Der Filterkasten im Spielplan steht ausserhalb von #spielplan-content (Innenabstand 20px) und war darum links
   und rechts je 20px breiter als die Kaesten darunter — jetzt buendig (David, 28.09.2026) */
#app #tp-filter-drawer { margin-left: 20px; margin-right: 20px; }
#app .labs-group-card {
    background: var(--bg-card) !important;
    border: 1px solid var(--gestalt-haarlinie) !important;
    border-radius: var(--gestalt-karte-radius) !important;
    box-shadow: none !important;
}
#app .tp-phase-head {
    background: transparent !important;
    border-bottom: none !important;
}

/* Überschriften: eine Form, normal geschrieben */
#app .tp-phase-body,
#app .tp-phase-body * {
    text-transform: none !important;
    letter-spacing: 0 !important;
}
#app .tp-phase-body {
    font-size: var(--fs-lg) !important;
}

/* Phasen-Überschrift im Spielplan = Kopf ihrer Karte (Entscheidung David) */
#app .phase-header {
    background: var(--bg-card) !important;
    margin: 0 !important;
    padding: 16px 20px 12px !important;
    border-bottom: 1px solid var(--gestalt-haarlinie) !important;
    border-radius: var(--gestalt-karte-radius) var(--gestalt-karte-radius) 0 0 !important;
    box-shadow: var(--gestalt-karte-schatten) !important;
    display: flex !important;
    align-items: baseline !important;
    gap: 10px !important;
    text-decoration: none !important;
}
#app .phase-header > :first-child {
    color: var(--text-strong) !important;
    font-weight: var(--weight-strong) !important;
}
#app .phase-header > :not(:first-child):not(button) {
    color: var(--text-subtle) !important;
    font-weight: var(--weight-normal) !important;
}
#app .phase-section {
    margin-top: 22px !important;
}
#app .phase-header + .match-table-card {
    margin-top: 0 !important;
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
}

/* Linien leiser */
#app .match-tabular-row,
#app .tp-slot-row,
#app .tp-standings-row {
    border-color: var(--gestalt-haarlinie) !important;
    box-shadow: none !important;
}

/* Der Spielstand ist der große Wert der Zeile — auch auf der Schiri-Seite (kein #app dort, 28.09.2026) */
#app .match-score-box,
body.referee-mode .match-score-box {
    background: transparent !important;
    font-size: var(--fs-2xl) !important;
    font-weight: var(--weight-strong) !important;
    color: var(--text-strong) !important;
    font-variant-numeric: tabular-nums !important;
}
#app .match-score-box.ist-offen,
body.referee-mode .match-score-box.ist-offen {
    color: var(--text-subtle) !important;
}
/* Kein Kasten um den Spielstand — auch nicht im Dunkelmodus, wo ihn eine Knopf-Regel bisher zeichnete */
#app .match-score-box,
body.dark-mode #app .match-score-box,
body.referee-mode .match-score-box,
body.dark-mode.referee-mode .match-score-box {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}
/* Menü-Gruppenüberschriften sind Beschriftung, keine Knöpfe: im Dunkelmodus kein grauer Balken mehr
   (die pauschale Regel „body.dark-mode button“ färbte sie ein) */
body.dark-mode #app .menue-gruppe {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

/* Straffe Formen statt Pillen */
#app .tp-axis-chip,
#app .schedule-class-badge {
    border-radius: var(--gestalt-marke-radius) !important;
}
#app .tp-action-btn,
#app .tp-segmented-control,
#app .tp-segmented-control * {
    border-radius: var(--gestalt-knopf-radius) !important;
}
#app .tp-action-btn,
#app .tp-segmented-control {
    border: none !important;
    box-shadow: none !important;
    background: var(--bg-card) !important;
}

/* ---- Planung: Gruppenkarten (26.09.2026, Schritt 3) ---------------------------------------
   Kopf ohne graue Leiste; der Name steht kräftig, die gestrichelte Unterstreichung kommt erst
   beim Darüberfahren oder Bearbeiten (das Stift-Symbol zeigt schon, dass man umbenennen kann).
   Die Felder rechts in der Platz-Zeile tragen Information (Kader, Klasse) und bleiben sichtbar;
   nur ihre gestrichelten Trenner fallen weg. */
#app .labs-group-card > :first-child {
    background: transparent !important;
    border-bottom: 1px solid var(--gestalt-haarlinie) !important;
}
#app .labs-group-card > :first-child .labs-input {
    color: var(--text-strong) !important;
}
#app .labs-group-card > :first-child .labs-input:not(:focus):not(:hover) {
    border-bottom-color: transparent !important;
}
#app .tp-slot-players,
#app .tp-slot-class,
#app .tp-slot-remove {
    border-left-color: transparent !important;
}

/* ---- Tabellen (26.09.2026, Schritt 3) ------------------------------------------------------
   Karten- und Spaltenkopf ohne graue Fläche; der Phasen-Hinweis als kleines Rechteck in normaler
   Schreibweise; die Phasenwahl bündig über den Tabellen statt als eigene breite Karte. */
#app #standings div:has(> div > .tp-standings-row) > :first-child {
    background: transparent !important;
    border-bottom: 1px solid var(--gestalt-haarlinie) !important;
    padding-top: 12px !important;
    padding-bottom: 10px !important;
}
#app #standings div:has(> div > .tp-standings-row) > :first-child > div > span:first-child {
    font-size: var(--fs-lg) !important;
    color: var(--text-strong) !important;
}
#app #standings div:has(> div > .tp-standings-row) > :first-child > div > span:not(:first-child) {
    text-transform: none !important;
    border-radius: var(--gestalt-marke-radius) !important;
    font-size: var(--fs-2xs) !important;
}
#app #standings div:has(> .tp-standings-row) > div:not(.tp-standings-row) {
    background: transparent !important;
    border-bottom-color: var(--gestalt-haarlinie) !important;
}
#app #tp-standings-drawer {
    background: transparent !important;
    box-shadow: none !important;
    max-width: 800px !important;
    margin: 0 auto !important;
}

/* Umschalter oben rechts (LIVE, Ansicht, Filter) mit straffen Ecken statt Pillen */
#app .btn-live-pill,
#app .tp-filter-toggle {
    border-radius: var(--gestalt-knopf-radius) !important;
}
/* Beschriftung direkt auf dem getoenten Grund: das leise Grau kam dort nur auf 4,38:1 (pruefe-lesbarkeit.js) */
#app #tp-standings-drawer .drawer-section-label {
    color: var(--text-body) !important;
}

/* ---- Teilnehmer (26.09.2026, Schritt 5) ----------------------------------------------------
   Die Werkzeugleiste liegt auf dem Grund statt als weißer Streifen mit Schatten; Suche und Filter
   sind weiße Felder mit straffen Ecken. Die Teamkarten (players-teams.js, Klasse
   .tp-personen-karte) haben die eine Kartenform, der Teamname ist der Kopf der Karte. */
#app .player-view-sticky-header {
    background: var(--gestalt-grund) !important;
    box-shadow: none !important;
    /* Leiser Text steht hier direkt auf dem getoenten Grund: das Grau kam dort nur auf
       4,38:1 (pruefe-lesbarkeit.js) — in dieser Leiste deshalb eine Stufe kraeftiger. */
    --text-subtle: var(--text-body);
}
#app .pt-search-input,
#app .pt-action-island {
    background: var(--bg-card) !important;
    border-color: transparent !important;
    border-radius: var(--gestalt-knopf-radius) !important;
    box-shadow: var(--gestalt-karte-schatten) !important;
}
#app .pt-island-item {
    border-radius: var(--gestalt-marke-radius) !important;
}
#app .tp-wappen-einstellungen > summary {
    background: transparent !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    padding-left: 2px !important;
}
#app .tp-personen-karte {
    background: var(--bg-card);
    border-radius: var(--gestalt-karte-radius);
    box-shadow: var(--gestalt-karte-schatten);
    margin-bottom: 12px;
    overflow: hidden;
}
#app .player-inner-grid.tp-personen-karte {
    margin-bottom: 0;
}
#app .tp-personen-karte > div:first-child > span:first-child {
    font-size: var(--fs-lg) !important;
    font-weight: var(--weight-strong) !important;
}
#app .tp-personen-karte .btn-xs,
#app .pc-anwesenheit,
#app .pc-bearbeiten {
    border-radius: var(--gestalt-knopf-radius) !important;
}
#app .tp-personen-karte .team-class-tag {
    border-radius: var(--gestalt-marke-radius) !important;
}

/* ---- Turnierliste (26.09.2026, Schritt 6) --------------------------------------------------
   Die Karten in der einen Kartenform; das aktive Turnier erkennt man an der Marke „Aktiv“
   (vorher zusätzlich ein türkiser Rahmen). Fläche mit !important, weil .dash-card im
   Dunkelmodus eine eigene !important-Fläche mitbringt. */
#app .dash-card {
    background: var(--bg-card) !important;
    box-shadow: var(--gestalt-karte-schatten) !important;
}

/* ---- Dialoge: eine Hülle (26.09.2026, Schritt 7a) ------------------------------------------
   Neun Dialoge hatten acht Hüllen: Ecken 16/18/20/24 px, Rahmen mal ja, mal nein, und vier
   verschiedene Abdunklungen dahinter (zum Teil mit Unschärfe). Jetzt: EINE Hülle mit straffen
   Ecken, ohne Rahmen, mit einem Schatten; dahinter EINE ruhige Abdunklung ohne Unschärfe.
   Dialoge hängen am body, nicht in #app — deshalb die Eingrenzung über body:has(> #app).
   Der Schiri-Modus ist NICHT ausgenommen: Die Verwaltung öffnet die Ergebnis-Eingabe über
   denselben Weg und setzt dabei selbst body.referee-mode — eine Ausnahme hätte genau diesen
   Dialog verfehlt. .wiz-modal-card NUR als direktes Kind eines Overlays: dieselbe Klasse tragen
   auch Symbolkästchen und das Beamer-Menü. */
:root {
    --gestalt-dialog-radius: 8px;
    --gestalt-dialog-schatten: 0 2px 6px rgba(15, 23, 42, 0.08), 0 16px 48px rgba(15, 23, 42, 0.18);
    --gestalt-abdunkeln: rgba(15, 23, 42, 0.45);
}
body.dark-mode {
    --gestalt-dialog-schatten: 0 2px 6px rgba(0, 0, 0, 0.4), 0 16px 48px rgba(0, 0, 0, 0.5);
    --gestalt-abdunkeln: rgba(2, 6, 23, 0.65);
}
body:has(> #app) > div > .wiz-modal-card,
body:has(> #app) > div > .tp-rueckfrage,
body:has(> #app) .tp-karte-schale > .tp-karte,
body:has(> #app) #phase-wizard-modal > div,
body:has(> #app) #planning-wizard-modal > .tpw-card,
body:has(> #app) #crest-editor-overlay > .wc-card,
body:has(> #app) .tp-pick-overlay > .tp-pick-card,
body:has(> #app) #referee-modal-wrapper,
/* Schiri-Seite: ohne #app (initRefereeLite leert den Rumpf), 28.09.2026 */
body.referee-mode #referee-modal-wrapper,
body.referee-mode #ref-login-modal,
body.referee-mode #lite-register-form {
    border: none !important;
    border-radius: var(--gestalt-dialog-radius) !important;
    box-shadow: var(--gestalt-dialog-schatten) !important;
}
body:has(> #app) > div:has(> .wiz-modal-card),
body:has(> #app) > div:has(> .tp-rueckfrage),
body:has(> #app) .tp-karte-schale,
body:has(> #app) #phase-wizard-modal,
body:has(> #app) #planning-wizard-modal,
body:has(> #app) #crest-editor-overlay,
body:has(> #app) .tp-pick-overlay,
body:has(> #app) #referee-modal,
body.referee-mode #referee-modal {
    background: var(--gestalt-abdunkeln) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* ---- Dialoge innen (26.09.2026, Schritt 7b) ------------------------------------------------
   Im Dialog dieselben Regeln wie in den Ansichten: Knöpfe mit straffen Ecken statt 8–12 px,
   Abschnittsüberschriften normal geschrieben statt in gesperrten Versalien. Runde Knöpfe
   (Kreise, inline 50 %) bleiben rund. */
:is(body:has(> #app) > div > .wiz-modal-card,
    body:has(> #app) > div > .tp-rueckfrage,
    body:has(> #app) .tp-karte-schale > .tp-karte,
    body:has(> #app) #phase-wizard-modal > div,
    body:has(> #app) #planning-wizard-modal > .tpw-card,
    body:has(> #app) #crest-editor-overlay > .wc-card,
    body:has(> #app) .tp-pick-overlay > .tp-pick-card,
    body:has(> #app) #referee-modal-wrapper,
    body.referee-mode #referee-modal-wrapper,
    body.referee-mode #ref-login-modal,
    body.referee-mode #lite-register-form) :is(button, .btn, input, select, textarea):not([style*="50%"]):not([style*="999px"]):not([type="checkbox"]):not([type="radio"]) {
    border-radius: var(--gestalt-knopf-radius) !important;
}
:is(body:has(> #app) > div > .wiz-modal-card,
    body:has(> #app) > div > .tp-rueckfrage,
    body:has(> #app) .tp-karte-schale > .tp-karte,
    body:has(> #app) #phase-wizard-modal > div,
    body:has(> #app) #planning-wizard-modal > .tpw-card,
    body:has(> #app) #crest-editor-overlay > .wc-card,
    body:has(> #app) .tp-pick-overlay > .tp-pick-card,
    body:has(> #app) #referee-modal-wrapper,
    body.referee-mode #referee-modal-wrapper,
    body.referee-mode #ref-login-modal,
    body.referee-mode #lite-register-form) * {
    text-transform: none !important;
    letter-spacing: normal !important;
}

/* ---- Knopfarten (26.09.2026, Schritt 8, Entscheidung David: Variante A) --------------------
   Drei Arten, überall gleich:
     .tp-knopf-haupt     der EINE Hauptschritt eines Fensters — dunkles Türkis gefüllt, weiße Schrift
     .tp-knopf-neben     Nebenschritte (Abbrechen, Minimieren, Zurück) — ruhig grau
     .tp-knopf-loeschen  unwiderruflich (Löschen) — nur roter Text, ohne Fläche
   Höchstens EIN Hauptschritt je Fenster; Knöpfe, die sich wiederholen (Öffnen, Ändern), sind
   nie Hauptschritt. !important, weil ältere Regeln (.match-save-btn, .btn.secondary,
   body.dark-mode .dark-mode-styled *) mit !important färben. */
:root {
    --gestalt-haupt-bg: #0d6b63;
    --gestalt-haupt-fg: #ffffff;
    --gestalt-haupt-hover: #0a5751;
}
body.dark-mode {
    --gestalt-haupt-bg: #5eead4;
    --gestalt-haupt-fg: #042f2e;
    --gestalt-haupt-hover: #99f6e4;
}
body .tp-knopf-haupt,
body.dark-mode .tp-knopf-haupt,
body .tp-karte-fertig,
body.dark-mode .tp-karte-fertig {
    background: var(--gestalt-haupt-bg) !important;
    color: var(--gestalt-haupt-fg) !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: var(--gestalt-knopf-radius) !important;
    font-weight: var(--weight-strong) !important;
}
body .tp-knopf-haupt *,
body.dark-mode .dark-mode-styled .tp-knopf-haupt *,
body .tp-karte-fertig * {
    color: inherit !important;
}
body .tp-knopf-haupt:hover,
body.dark-mode .tp-knopf-haupt:hover,
body .tp-karte-fertig:hover {
    background: var(--gestalt-haupt-hover) !important;
    transform: none !important;
}
body .tp-knopf-neben,
body.dark-mode .tp-knopf-neben {
    background: var(--surface-soft) !important;
    color: var(--text-body) !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: var(--gestalt-knopf-radius) !important;
    font-weight: var(--weight-strong) !important;
}
body.dark-mode .tp-knopf-neben,
body.dark-mode .dark-mode-styled .tp-knopf-neben {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #e2e8f0 !important;
}
body .tp-knopf-neben:hover { background: var(--border-color) !important; }
body.dark-mode .tp-knopf-neben:hover { background: rgba(255, 255, 255, 0.14) !important; }
body .tp-knopf-loeschen,
body.dark-mode .tp-knopf-loeschen,
body.dark-mode .dark-mode-styled .tp-knopf-loeschen {
    background: transparent !important;
    color: var(--accent-red-text) !important;
    border: none !important;
    box-shadow: none !important;
    font-weight: var(--weight-strong) !important;
}
body .tp-knopf-loeschen:hover { text-decoration: underline !important; }
/* Gesperrt (z. B. „Noch keine Namen“, Planungshilfe mit Fehlern): Form bleibt, nur blasser */
body .tp-knopf-haupt:disabled,
body .tp-karte-fertig:disabled {
    opacity: 0.45 !important;
    cursor: default !important;
}
body .tp-knopf-haupt:disabled:hover,
body .tp-karte-fertig:disabled:hover {
    background: var(--gestalt-haupt-bg) !important;
}

/* Ergebnis-Eingabe: die Vergehen-Zähler in derselben Form wie die übrigen kleinen Zähler */
.ref-strich-knopf {
    background: var(--surface-soft) !important;
    color: var(--text-body) !important;
    border-radius: var(--gestalt-knopf-radius) !important;
}
.ref-strich-knopf:hover { background: var(--border-color) !important; color: var(--text-strong) !important; }
body.dark-mode .dark-mode-styled .ref-strich-knopf,
body.dark-mode .ref-strich-knopf {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #cbd5e1 !important;
}
/* Dunkelmodus der Ergebnis-Eingabe: body.dark-mode .labs-stepper-btn (transparent, !important) und
   .dark-mode-styled * (hellgrau, !important) nahmen den Zählerknöpfen die Fläche und „Einklappen“ die Farbe. */
body.dark-mode #referee-modal .ref-stepper-primary .labs-stepper-btn,
body.dark-mode #referee-modal .ref-stepper-secondary .labs-stepper-btn {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #cbd5e1 !important;
}
body.dark-mode #referee-modal .ref-stepper-primary .labs-stepper-btn:hover,
body.dark-mode #referee-modal .ref-stepper-secondary .labs-stepper-btn:hover {
    background: rgba(255, 255, 255, 0.14) !important;
    color: #f1f5f9 !important;
}
body.dark-mode #referee-modal #ref-violations-hint {
    color: var(--primary-strong) !important;
}

/* ---- Phasen-Editor und Planungshilfe (26.09.2026, Schritt 9 — G1 bis G6, PLANUNG_Design.md) ----
   Beide zeigen dieselben Einstellungen; gezählt waren 5 Auswahlfelder, 4 Datums-/Zeitfelder und
   8 Hinweiskästen. Jetzt: EIN Eingabefeld, DREI Hinweisarten (Erklärung / Ergebnis / Warnung),
   Zähler wie in der Ergebnis-Eingabe, keine Kästen in Kästen, EINE Abschnittsüberschrift. */

/* G1 ein Eingabefeld */
:is(#phase-wizard-modal, #planning-wizard-modal) :is(select, input[type="date"], input[type="time"], input[type="number"]) {
    height: 36px !important;
    min-height: 36px !important;
    font-size: var(--fs-md) !important;
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--gestalt-knopf-radius) !important;
    box-shadow: none !important;
}

body.dark-mode :is(#phase-wizard-modal, #planning-wizard-modal) :is(select, input[type="date"], input[type="time"], input[type="number"]) {
    /* Im Dunkelmodus ist --bg-card die Fensterfläche selbst: das Feld verschwamm (gesehen 26.09.2026) */
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.16) !important;
}

/* G2 drei Hinweisarten, alle ohne Rahmen */
.tp-hinweis-erklaerung,
.tp-hinweis-ergebnis,
.tp-hinweis-warnung {
    border: none !important;
    border-radius: var(--gestalt-karte-radius) !important;
}
.tp-hinweis-erklaerung {
    background: var(--surface-page) !important;
    color: var(--text-body) !important;
}
.tp-hinweis-ergebnis {
    background: var(--primary-soft-bg) !important;
    color: var(--primary-strong) !important;
}

/* G3 Zähler wie in der Ergebnis-Eingabe: graue Quadrate, Zahl ohne Rahmen */
:is(#phase-wizard-modal, #planning-wizard-modal) .labs-stepper-compact {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    gap: 4px;
}
:is(#phase-wizard-modal, #planning-wizard-modal) .labs-stepper-compact .labs-stepper-btn {
    width: 30px !important;
    height: 30px !important;
    background: var(--surface-soft) !important;
    color: var(--text-body) !important;
    border-radius: var(--gestalt-knopf-radius) !important;
    font-size: var(--fs-xl) !important;
}
:is(#phase-wizard-modal, #planning-wizard-modal) .labs-stepper-compact .labs-stepper-btn:hover {
    background: var(--border-color) !important;
    color: var(--text-strong) !important;
}
:is(#phase-wizard-modal, #planning-wizard-modal) .labs-stepper-compact .labs-stepper-value {
    color: var(--text-strong) !important;
    font-size: var(--fs-lg) !important;
}
body.dark-mode :is(#phase-wizard-modal, #planning-wizard-modal) .labs-stepper-compact {
    background: transparent !important;
    border-color: transparent !important;
}
body.dark-mode :is(#phase-wizard-modal, #planning-wizard-modal) .labs-stepper-compact .labs-stepper-btn {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #cbd5e1 !important;
}
body.dark-mode :is(#phase-wizard-modal, #planning-wizard-modal) .labs-stepper-compact .labs-stepper-value {
    color: #f1f5f9 !important;
}

/* G4 kein Kasten im Kasten: der Einstellungsblock ist Teil des Fensters */
:is(#phase-wizard-modal, #planning-wizard-modal) .wiz-card-frame {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    border-radius: 0 !important;
}

/* G5 eine Abschnittsüberschrift (Klasse in den Quellen, vorher 25 × dieselbe Versal-Stilzeile) */
.tp-abschnitt-kopf {
    font-size: var(--fs-base) !important;
    font-weight: var(--weight-strong) !important;
    color: var(--text-strong) !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    padding-bottom: 6px !important;
    border-bottom: 1px solid var(--gestalt-haarlinie);
}

/* G6 Schrittleiste des Editors mit Namen — NUR wenn Platz ist (Wunsch David: am schmalen Gerät
   verliert man sonst den Überblick). Ab 900 px wie die Seitenleiste; darunter bleibt es bei Nummern + Name am aktiven Schritt.
   Die Planungshilfe (acht Schritte) bleibt immer so: acht Namen passen nicht in eine Zeile. */
@media (min-width: 900px) {
    #phase-wizard-modal .wiz-step-tab .wiz-step-lbl {
        display: inline !important;
        color: var(--text-body) !important;
        font-weight: var(--weight-normal) !important;
    }
    #phase-wizard-modal .wiz-step-tab.active-tab .wiz-step-lbl {
        color: var(--text-strong) !important;
        font-weight: var(--weight-strong) !important;
    }
}

/* A4 Punkte je Spiel: drei kleine Zähler in EINER Zeile (Editor und Planungshilfe). Bricht am
   schmalen Gerät um, statt die Zähler zu quetschen. */
.tp-punkte-felder {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    margin-top: 8px;
}
.tp-punkte-feld {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}
.tp-punkte-feld > span {
    font-size: var(--fs-xs);
    color: var(--text-subtle);
}
.tp-punkte-feld .no-margin {
    width: auto !important;
    min-height: 0 !important;
    align-items: flex-start !important;
}

/* G3 auch für die eigenen Zähler der Planungshilfe (andere Bauart als .labs-stepper-compact) */
#planning-wizard-modal .tp-zaehler {
    border: none !important;
    padding: 0 !important;
    gap: 4px !important;
}
#planning-wizard-modal .tp-zaehler > button {
    width: 30px !important;
    height: 30px !important;
    background: var(--surface-soft) !important;
    color: var(--text-body) !important;
    border-radius: var(--gestalt-knopf-radius) !important;
    font-size: var(--fs-xl) !important;
}
#planning-wizard-modal .tp-zaehler > button:hover {
    background: var(--border-color) !important;
    color: var(--text-strong) !important;
}
#planning-wizard-modal .tp-zaehler > span {
    color: var(--text-strong) !important;
}
body.dark-mode #planning-wizard-modal .tp-zaehler > button {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #cbd5e1 !important;
}
body.dark-mode #planning-wizard-modal .tp-zaehler > span {
    color: #f1f5f9 !important;
}

/* A1 „Wer sieht die Personennamen?“ im Phasen-Editor: EINE Zeile mit dem Stand, „Ändern“ öffnet die
   Auswahl (namenschutzDialog). Die Wahl gehört dem Turnier, nicht der Phase. */
.tp-ns-editor-zeile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 20px;
    padding: 12px 20px;
    border-top: 1px solid var(--gestalt-haarlinie);
}
.tp-ns-editor-titel {
    font-size: var(--fs-md);
    font-weight: var(--weight-strong);
    color: var(--text-secondary);
}
.tp-ns-editor-satz {
    font-size: var(--fs-xs);
    color: var(--text-subtle);
    margin-top: 2px;
    line-height: 1.4;
}
.tp-ns-editor-zeile > button {
    flex-shrink: 0;
    padding: 7px 14px;
}

/* A5 „Mehr erfahren“ im Erklärkasten: immer an derselben Stelle (Ende des Kastens), klar als Verweis erkennbar */
.tp-mehr-erfahren {
    margin-top: 4px;
}
.tp-mehr-erfahren > summary {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    list-style: none;
    color: var(--primary-strong);
    font-weight: var(--weight-strong);
}
.tp-mehr-erfahren > summary::-webkit-details-marker {
    display: none;
}
.tp-mehr-erfahren > summary::after {
    content: "›";
    display: inline-block;
    transition: transform 0.15s;
}
.tp-mehr-erfahren[open] > summary::after {
    transform: rotate(90deg);
}
.tp-mehr-erfahren > div {
    margin-top: 4px;
}

/* A6 „Gilt für“: ein Baustein, in jedem Reiter mit turnierweiter Zuständigkeit ganz oben (tpGiltFuerZeile) */
.tp-gilt-fuer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin: 0 0 16px;
}
.tp-gilt-fuer-text {
    flex: 1 1 160px;
    min-width: 0;
    font-size: var(--fs-sm);
    font-weight: var(--weight-strong);
    color: var(--text-body);
}

/* A7 Start dieser Phase (renderWizTimeline): nur die eigene Phase, Wahl „Direkt nach … / Eigener Termin“ */
.tp-phasenstart {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.tp-phasenstart-wahl {
    align-self: flex-start;
    flex-wrap: wrap;
}
.tp-phasenstart-vorher,
.tp-phasenstart-satz {
    font-size: var(--fs-xs);
    color: var(--text-subtle);
    line-height: 1.5;
}
.tp-phasenstart-felder {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.tp-phasenstart-felder input {
    min-width: 130px;
}
.tp-phasenstart-felder input:disabled {
    opacity: 0.6;
    cursor: default;
}
.tp-phasenstart-ende {
    font-size: var(--fs-sm);
    color: var(--text-body);
    background: var(--surface-soft);
    padding: 6px 10px;
    border-radius: var(--gestalt-marke-radius);
    white-space: nowrap;
}

/* ---- Reste (26.09.2026, Schritt 10) ---------------------------------------------------------
   Gemessen statt gesucht (Rest-Zensus über alle Ansichten und Fenster): Bausteine, die ihre Form
   über eigene Klassen mitbringen und deshalb an den bisherigen Regeln vorbeiliefen — Pillen
   (Ecken 10–999 px), Versalien, blasse Knöpfe, die eigentlich Hauptschritte sind. Gemeldet von
   David mit Bildern aus Spielplan, Planung (Lostöpfe), Schiri-Fenster und Druck-Auswahl. */

/* Pillen → straffe Ecken */
#app .filter-chip,
#app .tp-axis-choice,
#app .tp-axis-legend-item,
#app .btn-live-pill,
#app select,
body .tp-kader-umschalter,
body .tp-kader-umschalter > button,
#ref-hub-root .rh-kopfzeile button {
    border-radius: var(--gestalt-knopf-radius) !important;
}
body .tp-pick-row,
body .pa-schnell,
body .pa-liste,
body .size-picker-btn,
#ref-hub-root .rh-box,
#ref-hub-root #ref-hub-info > div,
body .print-options-body #share-preview-wrap,
body .print-options-body > div:has(#share-preview-wrap) {
    border-radius: var(--gestalt-karte-radius) !important;
}

/* Versalien → normal geschrieben */
#app #standings div:has(> .tp-standings-row) > div:not(.tp-standings-row),
#app #standings div:has(> .tp-standings-row) > div:not(.tp-standings-row) *,
#app .btn-live-pill,
#app .drawer-section-label,
body .keypad-content .print-options-body,
body .keypad-content .print-options-body * {
    text-transform: none !important;
    letter-spacing: normal !important;
}

/* Knopfarten: Hauptschritt dieser Fenster (blasse Füllung → türkis gefüllt) */
body .print-options-body .btn.primary,
body.dark-mode .print-options-body .btn.primary,
body #btn-close-ref-modal,
body.dark-mode #btn-close-ref-modal {
    background: var(--gestalt-haupt-bg) !important;
    color: var(--gestalt-haupt-fg) !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: var(--gestalt-knopf-radius) !important;
    font-weight: var(--weight-strong) !important;
}
body .print-options-body .btn.primary *,
body #btn-close-ref-modal * {
    color: inherit !important;
}
body .print-options-body .btn.primary:hover,
body #btn-close-ref-modal:hover {
    background: var(--gestalt-haupt-hover) !important;
}
/* Nebenschritte daneben (Als Bild teilen, Excel, Als Text, Abbrechen, Link kopieren) */
body .print-options-body .btn:not(.primary):not(.size-picker-btn),
#ref-hub-root #rh-copy-btn {
    background: var(--surface-soft) !important;
    color: var(--text-body) !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: var(--gestalt-knopf-radius) !important;
}
body.dark-mode .print-options-body .btn:not(.primary):not(.size-picker-btn),
body.dark-mode #ref-hub-root #rh-copy-btn {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #e2e8f0 !important;
}
/* „Ausführliche Erklärung“: ein leiser Umschalter, keine türkise Pille */
#ref-hub-root .rh-kopfzeile button {
    background: transparent !important;
    border: 1px solid var(--border-color) !important;
    color: var(--primary-strong) !important;
}

/* Unschärfe hinter Fenstern: Schritt 7a hatte sie für neun Hüllen abgeschaltet, sie steckte aber in
   rund 30 Regeln und 15 Dateien (Druck-Auswahl, Filter, Keypad …). Grundsätzlich statt einzeln:
   Alles, was direkt am body hängt, ist ein Fenster oder eine Meldung der App. Den Beamer trifft es
   nicht — initDisplayMode nimmt #app aus der Seite, damit greift body:has(> #app) dort nicht. */
body:has(> #app) > :not(#app),
body:has(> #app) > :not(#app) > * {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Die Fenster-Familie .keypad-modal (Druck-Auswahl, Fairplay-Bericht, Zahlenfeld …) mit derselben
   Hülle, Abdunklung und demselben Inneren wie die übrigen Dialoge (Schritt 7a/7b). */
body:has(> #app) > .keypad-modal:not(#phase-wizard-modal) {
    background: var(--gestalt-abdunkeln) !important;
}
body:has(> #app) > .keypad-modal > .keypad-content {
    border: none !important;
    border-radius: var(--gestalt-dialog-radius) !important;
    box-shadow: var(--gestalt-dialog-schatten) !important;
}
body:has(> #app) > .keypad-modal > .keypad-content :is(button, .btn, input, select, textarea):not([style*="50%"]):not([style*="999px"]):not([type="checkbox"]):not([type="radio"]):not(.btn-close-keypad) {
    border-radius: var(--gestalt-knopf-radius) !important;
}
body:has(> #app) > .keypad-modal > .keypad-content .size-picker-btn {
    border-radius: var(--gestalt-karte-radius) !important;
}
body:has(> #app) > .keypad-modal > .keypad-content * {
    text-transform: none !important;
    letter-spacing: normal !important;
}

.tp-phasenstart-pause {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-sm);
    font-weight: var(--weight-strong);
    color: var(--text-body);
}
.tp-phasenstart-pause input {
    width: 72px;
}

/* ---- Terminkalender (27.09.2026) -------------------------------------------------------------
   Kalender, Tagesansicht und Rhythmus bringen fast alles inline mit (Ecken 9–16 px, Filter als
   Pillen, Kopfzeile in gesperrten Versalien). Deshalb hier gesammelt und nur für diese Fenster:
   Hülle wie alle Dialoge, Abschnitte und Tage straff, Filter und Marken straff. Punkte mit fester
   Breite (Phasenfarbe, Zähler, „heute") bleiben rund — sie tragen `width:`/`min-width:` im Stil.
   NICHT einfach [style*="width:"]: Der Dunkelmodus schreibt Stile um und hinterlässt dabei
   „border-top-width: ;“ — das schloss die Filter dort wieder aus (nachgemessen). */
:is(#tournament-calendar-center-modal, #calendar-rhythm-modal) > div {
    border: none !important;
    border-radius: var(--gestalt-dialog-radius) !important;
    box-shadow: var(--gestalt-dialog-schatten) !important;
}
:is(#tournament-calendar-center-modal, #calendar-rhythm-modal) > div :is([style*="border-radius:9px"], [style*="border-radius: 9px"], [style*="border-radius:10px"], [style*="border-radius: 10px"], [style*="border-radius:12px"], [style*="border-radius: 12px"], [style*="border-radius:14px"], [style*="border-radius: 14px"], [style*="border-radius:16px"], [style*="border-radius: 16px"]) {
    border-radius: var(--gestalt-karte-radius) !important;
}
:is(#tournament-calendar-center-modal, #calendar-rhythm-modal) > div :is(button, summary, input, select):is([style*="border-radius:8px"], [style*="border-radius: 8px"], [style*="border-radius:9px"], [style*="border-radius: 9px"], [style*="border-radius:10px"], [style*="border-radius: 10px"], [style*="border-radius:12px"], [style*="border-radius: 12px"]) {
    border-radius: var(--gestalt-knopf-radius) !important;
}
:is(#tournament-calendar-center-modal, #calendar-rhythm-modal) > div :is([style*="border-radius:999px"], [style*="border-radius: 999px"]):not(:is([style^="width:"], [style^="min-width:"], [style*=" width:"], [style*=" min-width:"], [style*=";width:"], [style*=";min-width:"])) {
    border-radius: var(--gestalt-marke-radius) !important;
}
:is(#tournament-calendar-center-modal, #calendar-rhythm-modal) > div button:is([style*="border-radius:999px"], [style*="border-radius: 999px"]):not(:is([style^="width:"], [style^="min-width:"], [style*=" width:"], [style*=" min-width:"], [style*=";width:"], [style*=";min-width:"])) {
    border-radius: var(--gestalt-knopf-radius) !important;
}
:is(#tournament-calendar-center-modal, #calendar-rhythm-modal) .tp-axis-chip {
    border-radius: var(--gestalt-marke-radius) !important;
}
:is(#tournament-calendar-center-modal, #calendar-rhythm-modal) [style*="text-transform:uppercase"] {
    text-transform: none !important;
    letter-spacing: normal !important;
}

/* ---- Phasen-Editor: Reste (27.09.2026, gefunden von pruefe-reste.js) -------------------------------
   Der Wächter öffnete die Editor-Reiter bis dahin nicht; dort standen noch runde Umschalter (der
   Umschalter „Gilt für“ liegt im Fenster, nicht in #app, und bekam die App-Regel nicht), Infokästen
   und Auswahlkarten mit 12 px, Pillen-Marken mit 999 px. */
body:has(> #app) #phase-wizard-modal .tp-segmented-control { border-radius: var(--gestalt-knopf-radius) !important; }
body:has(> #app) #phase-wizard-modal .tp-segmented-item { border-radius: var(--gestalt-marke-radius) !important; }
body:has(> #app) #phase-wizard-modal :is(.wiz-info-box, .wiz-radio-card) { border-radius: var(--gestalt-karte-radius) !important; }
body:has(> #app) #phase-wizard-modal :is([style*="border-radius:10px"], [style*="border-radius: 10px"], [style*="border-radius:11px"], [style*="border-radius: 11px"], [style*="border-radius:12px"], [style*="border-radius: 12px"]) { border-radius: var(--gestalt-karte-radius) !important; }
body:has(> #app) #phase-wizard-modal :is([style*="border-radius:999px"], [style*="border-radius: 999px"]):not(:is([style^="width:"], [style*=" width:"], [style*=";width:"])) { border-radius: var(--gestalt-marke-radius) !important; }
/* ---- Textmarker unter dem Spielstand der Ergebnis-Eingabe (Probe, 28.09.2026) ------------------------------
   Nur an den GROSSEN Zahlen (.ref-stepper-primary = was man gerade eintraegt; an Saetzen, Vergehen und
   Fairplay-Punkten wurde es zu unruhig, David 28.09.2026). Nur mit ?textmarker=1 (Klasse tp-textmarker am html, gesetzt im Kopf von app.html, je Geraet gemerkt).
   Dieselbe dreiteilige Form wie die Platzhalter-Schildchen, aber Tuerkis und nur hier: im Spielplan bleibt die
   Form das Zeichen fuer freie Plaetze. Waechter: mess-textmarker.js.
   Ohne z-index (Ebenen-Leiter): Der Strich liegt UEBER der Zahl und faerbt per Mischmodus nur den Grund —
   multiply laesst dunkle Ziffern dunkel, im Dunkelmodus screen laesst helle Ziffern hell. */
html.tp-textmarker #referee-modal-wrapper .ref-stepper-primary .labs-stepper-value { position: relative !important; }
html.tp-textmarker #referee-modal-wrapper .ref-stepper-primary .labs-stepper-value::before {
    content: ""; position: absolute; mix-blend-mode: multiply; pointer-events: none; left: 50%; top: 58%; width: 1.25em; height: .42em; transform: translateX(-50%) rotate(-1.5deg);
    background: rgba(20, 184, 166, 0.32);
    -webkit-mask:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 30' preserveAspectRatio='none'%3E%3Cpath d='M9 3.5L10 3.45L10 28.9L3 29L6.5 23.5L1 18.5L5.5 13L2 8.5Z'/%3E%3C/svg%3E") left / .14em 100% no-repeat,
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 30' preserveAspectRatio='none'%3E%3Cpath d='M0 3.45L100 1.15L100 27.05L0 28.9Z'/%3E%3C/svg%3E") center / calc(100% - .26em) 100% no-repeat,
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 30' preserveAspectRatio='none'%3E%3Cpath d='M0 1.15L8 1L5.5 7L9 11.5L4.5 17L7 21.5L2.5 27L0 27.05Z'/%3E%3C/svg%3E") right / .14em 100% no-repeat;
    mask:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 30' preserveAspectRatio='none'%3E%3Cpath d='M9 3.5L10 3.45L10 28.9L3 29L6.5 23.5L1 18.5L5.5 13L2 8.5Z'/%3E%3C/svg%3E") left / .14em 100% no-repeat,
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 30' preserveAspectRatio='none'%3E%3Cpath d='M0 3.45L100 1.15L100 27.05L0 28.9Z'/%3E%3C/svg%3E") center / calc(100% - .26em) 100% no-repeat,
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 30' preserveAspectRatio='none'%3E%3Cpath d='M0 1.15L8 1L5.5 7L9 11.5L4.5 17L7 21.5L2.5 27L0 27.05Z'/%3E%3C/svg%3E") right / .14em 100% no-repeat;
}
html.tp-textmarker body.dark-mode #referee-modal-wrapper .ref-stepper-primary .labs-stepper-value::before { background: rgba(45, 212, 191, 0.30); mix-blend-mode: screen; }

/* ---- Handy-Karten bei 350 px (David, 28.09.2026: Davids iPhone, die vereinbarte Mindestbreite) ----------------
   Spielplan der Turnierleitung UND Schiri-Seite. Die Teamspalten hatten flex:1, aber min-width:auto — sie wuchsen
   mit langen Namen und Platzhaltern, schoben Ergebnis/„vs“ aus der Mitte (bis 75 px) und liefen still über den
   Kartenrand (die Karte schneidet mit overflow:hidden ab). Jetzt zwei gleich breite Spalten; Namen und Platzhalter
   brechen an Leerzeichen um, ein einzelnes zu langes Wort als letzter Ausweg mit Trennstrich (lang="de").
   Wächter: mess-karten-350.js. */
.matchup > .team-left, .matchup > .team-right,
.referee-matchup > .team-left, .referee-matchup > .team-right { flex: 1 1 0 !important; min-width: 0 !important; }
/* Keine Silbentrennung („Halbfi-nale“ sah nicht gut aus, David) — ein zu langes Wort bricht nur als letzter Ausweg */
.matchup .tp-name, .referee-matchup .tp-name { overflow-wrap: break-word; hyphens: manual; -webkit-hyphens: manual; }
/* auch im Felderplan (.hall-match-team): „Sieger Halbfinale 2“ lief dort ueber den Kartenrand (David, 28.09.2026) */
:is(.matchup, .referee-matchup, .hall-match-team) .tp-name--frei { white-space: normal; max-width: 100%; box-sizing: border-box; }
.hall-match-team .tp-name { overflow-wrap: break-word; hyphens: manual; -webkit-hyphens: manual; }
/* Schiri-Seite: die Namenszeile (extractTeamHtmlStacked) stand auf nowrap — wie im Felderplan umbrechen lassen */
.referee-matchup .player-line, .referee-matchup .tp-name { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; }
.referee-matchup .team-left span, .referee-matchup .team-right span { min-width: 0; max-width: 100%; }
/* Schmal (bis 430 px, der vorhandene Haltepunkt = breitestes iPhone): Wappen UEBER dem Namen, damit der Name die ganze Spaltenbreite hat (Entwurf A, David).
   - Oben ausgerichtet, nicht mittig: sonst rutscht das Wappen neben einem zweizeiligen Namen hoeher als gegenueber.
   - Beide Seiten gleich gebaut und in ihrer Spalte mittig: Namen ohne Wappen stehen unter dem freien Wappenplatz,
     genauso weit von der Mitte wie die mit Wappen (die App haelt den Platz frei; die Schiri-Seite bekommt ihn hier).
   - Das Ergebnis steht auf Hoehe der Namen (mittig zur ersten Namenszeile), nicht der Wappen — „vs“ ueber den
     Namen sah nicht stimmig aus (David). Die Ergebnisspalte ist so hoch wie die erste Namenszeile und rueckt um
     Wappen + Abstand nach unten (App 26+3, Schiri 28+3); ihr Inhalt steht darin mittig, gleich ob Ergebnis
     oder das niedrigere Meldungs-Schild.
   - Schiri-Seite: weniger Rand aussen — der Innenabstand von #ref-main (20 px, aus der Anmeldung) entfaellt.
   - Im Meldungs-Schild nur Pfeife und Stand; „Prüfen“ steht im Hinweis darueber. */
@media (max-width: 430px) {
    .matchup, .referee-matchup { align-items: flex-start !important; }
    .matchup > .team-left, .matchup > .team-right,
    .referee-matchup > .team-left, .referee-matchup > .team-right { align-items: center !important; text-align: center !important; }
    .matchup > .team-left > *, .matchup > .team-right > *,
    .referee-matchup > .team-left > *, .referee-matchup > .team-right > * { max-width: 100%; text-align: center !important; }
    /* NUR in den drei Kartenarten — die Regel galt zuerst fuer jede .tp-team-zeile, im Felderplan stand dann der
       Name UEBER dem Wappen (links liegt dort der Name vor dem Wappen; David, 28.09.2026) */
    :is(.matchup, .referee-matchup, .hall-matchup) .tp-team-zeile { flex-direction: column !important; align-items: center !important; justify-content: flex-start !important; gap: 3px !important; }
    .matchup .tp-team-zeile > span, :is(.referee-matchup, .hall-matchup) .tp-team-zeile > .team-crest { order: -1; }
    /* Felderplan in derselben Form: Namen mittig, Wappen oben, freier Wappenplatz, Ergebnis auf Namenshoehe */
    .hall-matchup { align-items: flex-start !important; }
    .hall-matchup > .hall-match-team { flex: 1 1 0 !important; min-width: 0 !important; flex-direction: column; align-items: center !important; justify-content: flex-start !important; text-align: center !important; }
    .hall-matchup .stacked-team { align-items: center !important; }
    body:has(.hall-matchup .team-crest) .hall-matchup > .hall-match-team:not(:has(.team-crest))::before { content: ""; display: block; height: 34px; margin-bottom: 3px; flex-shrink: 0; }
    body:has(.hall-matchup .team-crest) .hall-matchup > :nth-child(2) { margin-top: 37px; height: calc(var(--fs-md) * 1.12); justify-content: center; overflow: visible; }
    body:not(:has(.hall-matchup .team-crest)) .hall-matchup > :nth-child(2) { height: calc(var(--fs-md) * 1.12); justify-content: center; overflow: visible; }
    .matchup .tp-team-zeile > div, .matchup .player-pill, .referee-matchup .stacked-team { align-items: center !important; text-align: center !important; }
    /* Schiri: der Namensblock als Spalte — so steht der freie Wappenplatz (::before) genau wie ein Wappen mit Abstand */
    .referee-matchup > div > span { display: flex !important; flex-direction: column; align-items: center; gap: 3px; }
    body:has(.referee-matchup .team-crest) .referee-matchup > div > span:not(:has(.team-crest))::before { content: ""; display: block; height: 28px; flex-shrink: 0; }
    /* Ergebnisspalte auf Hoehe der ersten Namenszeile, Inhalt darin mittig (Ergebnis 32 px oder Meldungs-Schild) */
    .matchup:has(.tp-team-zeile) > :nth-child(2) { margin-top: 29px; height: calc(var(--fs-md) * 1.2 + 2px); justify-content: center; overflow: visible; }
    /* ohne Wappen: so hoch wie die erste Namenszeile (App: 1px Polster + Zeilenhoehe 1.2 auf --fs-md) */
    .matchup:not(:has(.tp-team-zeile)) > :nth-child(2) { height: calc(var(--fs-md) * 1.2 + 2px); justify-content: center; overflow: visible; }
    body:has(.referee-matchup .team-crest) .referee-matchup > :nth-child(2) { margin-top: 31px; height: calc(var(--fs-base) * 1.2); justify-content: center; overflow: visible; }
    body.referee-mode #ref-main:has(.ref-standalone-container) { padding-left: 0 !important; padding-right: 0 !important; }
    body:not(:has(.referee-matchup .team-crest)) .referee-matchup > :nth-child(2) { height: calc(var(--fs-base) * 1.2); justify-content: center; overflow: visible; }
    .mobile-only-card .tp-gemeldet-tun { display: none; }
}
