/* App_Ricochet Design System "Die Hallentafel" (DESIGN.md)
   Alles leitet sich von der Ricochet-Anzeigetafel an der Hallenwand ab: weisse Tafel,
   Seite R auf Rot, Seite G auf Schiefergrau, rote 7-Segment-Ziffern in schwarzen Fenstern.
   Schriften liegen lokal in /static/fonts (SIL OFL, siehe OFL-*.txt) - die App laeuft offline. */

@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/lm-sachsen/static/fonts/bsc-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/lm-sachsen/static/fonts/bsc-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/lm-sachsen/static/fonts/bsc-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/lm-sachsen/static/fonts/bsc-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/lm-sachsen/static/fonts/bsc-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Semi Condensed"; font-style: italic; font-weight: 600; font-display: swap;
  src: url("/lm-sachsen/static/fonts/bsc-latin-600-italic.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/lm-sachsen/static/fonts/bsc-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow Semi Condensed"; font-style: italic; font-weight: 600; font-display: swap;
  src: url("/lm-sachsen/static/fonts/bsc-latin-ext-600-italic.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/lm-sachsen/static/fonts/bsc-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Semi Condensed"; font-style: italic; font-weight: 700; font-display: swap;
  src: url("/lm-sachsen/static/fonts/bsc-latin-700-italic.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/lm-sachsen/static/fonts/bsc-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow Semi Condensed"; font-style: italic; font-weight: 700; font-display: swap;
  src: url("/lm-sachsen/static/fonts/bsc-latin-ext-700-italic.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 800; font-display: swap;
  src: url("/lm-sachsen/static/fonts/bsc-latin-800-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Semi Condensed"; font-style: italic; font-weight: 800; font-display: swap;
  src: url("/lm-sachsen/static/fonts/bsc-latin-800-italic.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 800; font-display: swap;
  src: url("/lm-sachsen/static/fonts/bsc-latin-ext-800-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow Semi Condensed"; font-style: italic; font-weight: 800; font-display: swap;
  src: url("/lm-sachsen/static/fonts/bsc-latin-ext-800-italic.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "DSEG7 Classic"; font-style: normal; font-weight: 700; font-display: block;
  src: url("/lm-sachsen/static/fonts/DSEG7Classic-Bold.woff2") format("woff2"); }

:root, [data-theme="matchday-light"], [data-theme="light"] {
  /* Hell: die weisse Tafel */
  --bg-main: #e8eaec;
  --bg-card: #ffffff;
  --bg-card-hover: #f3f4f5;
  --bg-surface-2: #f1f2f3;
  --border-color: #c3c8cd;
  --border-subtle: #dfe2e5;
  --border-active: #cc1829;

  --text-main: #141719;
  --text-muted: #363d44;
  --text-dim: #575f67;

  /* Spec R2-21: Spielerfarben fuer Text (Spieler 1 rot, Spieler 2 grau), je Theme eigens definiert */
  --p1-text: #c4182a;
  --p2-text: #4d565e;

  --ricochet-red: #cc1829;
  --ricochet-grey: #4d565e;

  /* Kopfband: Schiefergrau wie die G-Haelfte der Tafel */
  --shell-bg: #4d565e;
  --shell-text: #ffffff;
  --shell-muted: #dfe3e6;
  --shell-line: rgba(255, 255, 255, 0.26);
  --shell-btn-bg: rgba(255, 255, 255, 0.08);
  --shell-btn-hover: rgba(255, 255, 255, 0.18);

  --color-primary: #cc1829;
  --color-primary-hover: #a51320;
  --color-success: #047857;
  --color-warning: #a14a07;
  --color-danger: #c4182a;
  --color-live: #047857;

  --btn-secondary-bg: #ffffff;
  --btn-secondary-color: #141719;
  --btn-secondary-hover: #f1f2f3;

  /* LED-Fenster der Tafel */
  --led-bg: #0b0c0d;
  --led-on: #ff2a3b;
  --led-ghost: rgba(255, 42, 59, 0.17);
  --scoreboard-bg: var(--led-bg);
  --scoreboard-color: var(--led-on);
  --scoreboard-border: #2c3238;

  /* Vorlauf-Badges V1/V2 und Court-Farben (die einzige Farbe in der Warteschlange); >= 4,5:1 */
  --vorlauf: #1d4ed8;
  --court-1: #1d4ed8;
  --court-2: #047857;
  --court-3: #a14a07;
  --win: #136c33;
  --danger-text: #c4182a;
  --accent-text: #be123c;
  --zone-main: #be123c;
  --zone-loser: #0369a1;
  --zone-place: #c2410c;
  --zone-trost: #7e22ce;
  --zone-women: #be185d;

  --card-shadow: none;
  --card-shadow-hover: none;
  --modal-shadow: 0 20px 25px -5px rgba(20, 23, 25, 0.22), 0 8px 10px -6px rgba(20, 23, 25, 0.14);

  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 10px;

  --font-sans: "Barlow Semi Condensed", "Arial Narrow", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "Barlow Semi Condensed", ui-monospace, Menlo, Consolas, monospace;
  --font-led: "DSEG7 Classic", ui-monospace, Menlo, Consolas, monospace;
}

[data-theme="dark"], [data-theme="leitstand-dark"], [data-theme="referee-oled"] {
  /* Dunkel: die Tafel bei Nacht - neutrales Schiefergrau statt Marineblau.
     Flaechen gestaffelt Seite < Karte < erhoehte Karte; Text >= 4,5:1 (WCAG AA). */
  --bg-main: #141719;
  --bg-card: #1f2327;
  --bg-card-hover: #2a2f34;
  --bg-surface-2: #262b30;
  --border-color: #3f464d;
  --border-subtle: #2c3237;
  --border-active: #ff8f99;

  --text-main: #f2f3f4;
  --text-muted: #c6ccd1;
  --text-dim: #a1a9b0;

  --p1-text: #ff8f99;
  --p2-text: #d3d8dc;

  --ricochet-red: #cc1829;
  --ricochet-grey: #7c8894;

  --shell-bg: #2b3136;
  --shell-text: #ffffff;
  --shell-muted: #c6ccd1;
  --shell-line: rgba(255, 255, 255, 0.14);
  --shell-btn-bg: rgba(255, 255, 255, 0.06);
  --shell-btn-hover: rgba(255, 255, 255, 0.14);

  --color-primary: #cc1829;
  --color-primary-hover: #a51320;
  --color-success: #047857;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-live: #047857;

  --btn-secondary-bg: #2f353a;
  --btn-secondary-color: #f7f8f8;
  --btn-secondary-hover: #3b4247;

  --led-bg: #050606;
  --led-on: #ff2a3b;
  --led-ghost: rgba(255, 42, 59, 0.15);
  --scoreboard-bg: var(--led-bg);
  --scoreboard-color: var(--led-on);
  --scoreboard-border: #2c3237;

  --vorlauf: #93c5fd;
  --court-1: #93c5fd;
  --court-2: #6ee7b7;
  --court-3: #fcd34d;
  --win: #4ade80;
  --danger-text: #f87171;
  --accent-text: #fb7185;
  --zone-main: #fda4af;
  --zone-loser: #7dd3fc;
  --zone-place: #fdba74;
  --zone-trost: #d8b4fe;
  --zone-women: #f9a8d4;

  --card-shadow: none;
  --card-shadow-hover: none;
  --modal-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85);

  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 10px;

  --font-sans: "Barlow Semi Condensed", "Arial Narrow", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "Barlow Semi Condensed", ui-monospace, Menlo, Consolas, monospace;
  --font-led: "DSEG7 Classic", ui-monospace, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 1.0625rem;              /* Barlow Semi Condensed ist schmal: etwas groesser fuer gleiche Lesbarkeit */
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.2s ease, color 0.2s ease;
}

::selection { background: rgba(204, 24, 41, 0.22); }

/* Accessibility & Numbers (Web Design Guidelines & Frontend Design) */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.btn:focus-visible, .tab-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.form-input:focus, .form-input:focus-visible,
select:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
  border-color: var(--color-primary);
}

.data-table, .time-badge, .badge, .display-clock, .score-led, .led-score-box, .btn-touch, .set-chip, .roster-table,
.bracket-node-stacked, .bracket-node-compact, .bracket-score, .bracket-set-detail,
.score-chip-p1, .score-chip-p2, .display-chip-p1, .display-chip-p2,
.touch-score-hero, .tablet-score-display, .side-match-section, .match-code-badge,
.game-chip, .court-card-score, .standings-table, .standings-rank, .ranking-badge,
.btn-quick-score, .timer-box, .court-timeline-match {
  font-variant-numeric: tabular-nums;
}

h1, h2, h3, h4, .brand-title, .card-title, .modal-title, .section-title {
  text-wrap: balance;
}

/* Layout Robustness & Truncation (Web Design Guidelines) */
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.player-name, .bracket-player-name, .touch-player-name, .match-label, .brand-title, .brand-subtitle {
  min-width: 0;
}

/* Structured Empty State Component (Web Design Guidelines) */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  text-align: center;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-surface-2);
  color: var(--text-muted);
  margin: 1rem 0;
}

.empty-state-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.empty-state-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  max-width: 440px;
  line-height: 1.45;
}

/* Accessibility: Reduced Motion (Web Design Guidelines) */
@media (prefers-reduced-motion: reduce) {
  /* Keine Bewegung, aber Zustandswechsel bleiben sichtbar: Farben wechseln kurz statt abrupt,
     Pulsieren und Verschieben entfallen. */
  *, *::before, *::after {
    animation: none !important;
    scroll-behavior: auto !important;
    transition-property: background-color, color, border-color, opacity !important;
    transition-duration: 0.12s !important;
  }
}

/* Nur fuer Screenreader sichtbar (Seitentitel, Orientierung) */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}


/* Header */
.app-header {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  padding: 0.85rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--card-shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-online {
  background-color: transparent;
  color: var(--color-success);
  border: 1.5px solid var(--color-success);
}

[data-theme="dark"] .status-online {
  background-color: transparent;
  color: #10b981;
  border-color: #10b981;
}

.status-offline {
  background-color: transparent;
  color: #dc2626;
  border: 1.5px solid #dc2626;
}

[data-theme="dark"] .status-offline {
  background-color: transparent;
  color: var(--danger-text);
  border-color: #ef4444;
}

/* Layout */
.container {
  /* Master-PC: 1560px entsprach 100 %, gewuenscht sind 135-140 %.
     Die Seiten werden dadurch nicht nur breiter, es passt auch spuerbar mehr
     Spielstapel in eine Zeile. */
  max-width: 2180px;
  margin: 0 auto;
  padding: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  box-shadow: var(--card-shadow-hover);
}

.card-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--text-main);
}

/* Court Leitstand Hero Cards */
.court-card-hero {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--border-color);
}

.court-card-hero.court-card-1, .side-court-card.court-1 { --court-accent: var(--court-1); }
.court-card-hero.court-card-2, .side-court-card.court-2 { --court-accent: var(--court-2); }
.court-card-hero.court-card-3, .side-court-card.court-3 { --court-accent: var(--court-3); }

/* Pulsating Live Status Indicator */
.status-live-pulse {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(16, 185, 129, 0.12);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

[data-theme="dark"] .status-live-pulse {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.45);
}

.status-live-pulse::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981;
}

/* Warm-up Status Indicator */
.status-warmup-pulse {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

[data-theme="dark"] .status-warmup-pulse {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.45);
}

.status-warmup-pulse::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #f59e0b;
}

/* Ready Status Indicator */
.status-ready-pulse {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(16, 185, 129, 0.12);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

[data-theme="dark"] .status-ready-pulse {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.45);
}

.status-ready-pulse::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981;
}

/* Waiting Status Indicator */
.status-waiting-pulse {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.status-waiting-pulse::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--text-dim);
}

/* Neutral Tablet Online Badge (im Stil von 'Court defekt melden') */
.status-tablet-online {
  background-color: transparent !important;
  color: var(--text-muted) !important;
  border: 1px solid var(--border-color) !important;
}

/* Digital LED Scoreboard Counter */
.scoreboard-led-display {
  background: var(--scoreboard-bg, #0b0c0d);
  border: 1px solid var(--scoreboard-border, #22272c);
  border-radius: 4px;
  padding: 0.12rem 0.55rem;
  font-size: 1.25rem;
  color: var(--scoreboard-color, #ff3b4e);
  min-width: 1.9rem;
  text-align: center;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.7);
  letter-spacing: -0.02em;
}

/* Theme Selector Segmented Control (UIZZE Design Contract) */
.theme-selector-group {
  display: inline-flex;
  align-items: center;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.btn-theme-opt {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
}

.btn-theme-opt:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.btn-theme-opt.active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  border-color: var(--border-color);
}

/* Modern Segmented Navigation Tabs */
.tab-bar {
  display: inline-flex;
  background: var(--bg-surface-2);
  padding: 0.35rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  gap: 0.3rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.tab-btn {
  /* +30 % gegenueber der alten Groesse (0.6/1.25 rem, 0.92 rem). */
  padding: 0.78rem 1.65rem;
  font-size: 1.2rem;
  font-weight: 800;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.6);
  color: var(--text-main);
}

[data-theme="dark"] .tab-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.tab-btn.active {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-color);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .tab-btn.active {
  background: #22272c;
  color: #ffffff;
  border-color: #363d44;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.tab-btn.active #results-count-badge {
  background: var(--bg-surface-2) !important;
  color: var(--text-main) !important;
  border-color: var(--border-color) !important;
}

/* High-Contrast Navigation Buttons for Stats & Trivia Modal */
.stats-tab-nav-btn {
  padding: 0.5rem 1.15rem;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.stats-tab-nav-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.stats-tab-nav-btn.active {
  background: var(--text-main);
  color: var(--bg-card);
  border-color: var(--text-main);
  font-weight: 800;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .stats-tab-nav-btn {
  background: #22272c;
  color: #f7f8f8;
  border-color: #363d44;
}

[data-theme="dark"] .stats-tab-nav-btn:hover {
  background: #363d44;
  color: #ffffff;
}

[data-theme="dark"] .stats-tab-nav-btn.active {
  background: var(--text-main);
  color: var(--bg-card);
  border-color: var(--text-main);
}

::selection {
  background: #2563eb;
  color: #ffffff;
}

.match-row-women {
  background-color: #fdf2f8 !important;   /* Damenfeld: nur Toenung, kein Seitenstreifen */
}

[data-theme="dark"] .match-row-women {
  background-color: rgba(236, 72, 153, 0.12) !important;
}

/* Damenspiele im Stapel auf einen Blick: rosa getoente Zeile und ein gefuelltes "Damen"-Schild */
.match-row-women > td { background-color: #fce7f3 !important; }
[data-theme="dark"] .match-row-women > td { background-color: rgba(236, 72, 153, 0.16) !important; }
.women-badge-solid {
  background: #be185d;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Spiele-Stapel: drei feste Spalten, wie in der frueheren Fassung.
   Links  die Court-Uebersicht (drei Courts uebereinander gestapelt)
   Mitte  der komplette Spielstapel
   Rechts wer als naechstes auf welchem Court spielt
   Es gibt bewusst keinen Aus-/Einklapp-Schalter mehr: die Uebersicht ist
   dauerhaft sichtbar, weil sie beim Disponieren staendig gebraucht wird. */
.stapel-3col {
  display: grid;
  grid-template-columns: minmax(280px, 320px) minmax(0, 1fr) minmax(260px, 300px);
  gap: 1rem;
  align-items: start;
}

/* Linke Spalte: Court-Uebersicht gestapelt */
.stapel-court-column {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
}

/* Immer eine Spalte, damit die Courts untereinander stehen und nicht
   nebeneinander umbrechen. */
.courts-grid-stacked {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 0.75rem;
}

.courts-grid-stacked .court-card-hero {
  padding: 0.75rem;
}

/* Mittlere Spalte: Spielstapel */
.stapel-main-card {
  min-width: 0;
  margin: 0;
}

.stapel-main-card > .table-scroll-container {
  height: auto;
  min-height: 620px;
  max-height: 78vh;
  overflow-y: auto;
}

/* Rechte Spalte: kommende Court-Besetzungen */
.stapel-side-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  min-width: 0;
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
}

/* Auf schmalen Fenstern stapeln sich die drei Spalten untereinander,
   Reihenfolge bleibt: Court-Uebersicht, Spielstapel, Court-Zuordnung. */
@media (max-width: 1400px) {
  .stapel-3col {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 300px);
  }
  .stapel-court-column {
    grid-column: 1 / -1;
    position: static;
    max-height: none;
    overflow: visible;
  }
  .courts-grid-stacked {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
  }
}

@media (max-width: 900px) {
  .stapel-3col {
    grid-template-columns: minmax(0, 1fr);
  }
  .stapel-side-panel {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

.side-court-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: border-color 0.15s ease;
}



.side-court-header {
  padding: 0.45rem 0.65rem;
  background: var(--bg-surface-2);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  font-size: 0.88rem;
}

.side-court-body {
  padding: 0.5rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.side-match-section {
  border-radius: 5px;
  padding: 0.4rem 0.55rem;
  font-size: 0.8rem;
}

.side-match-live {
  background: rgba(5, 150, 105, 0.08);
  border: 1px solid rgba(5, 150, 105, 0.35);
}

.side-match-next {
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.25);
}

.side-match-following {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-color);
}

.badge-lock-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: var(--font-mono, monospace);
  white-space: nowrap;
  background: transparent !important;
}
.badge-lock-horizon {
  background: transparent !important;
  color: #2563eb !important;
  border: 1.5px solid #2563eb !important;
}
[data-theme="dark"] .badge-lock-horizon {
  background: transparent !important;
  color: #3b82f6 !important;
  border-color: #3b82f6 !important;
}
.badge-lock-manual {
  background: transparent !important;
  color: #dc2626 !important;
  border: 1.5px solid #dc2626 !important;
}
[data-theme="dark"] .badge-lock-manual {
  background: transparent !important;
  color: var(--danger-text) !important;
  border-color: #ef4444 !important;
}

.action-btn-group {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Controls & Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.05s ease, border-color 0.15s ease;
  user-select: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background-color: var(--color-primary);
  color: white;
}
.btn-primary:hover {
  background-color: var(--color-primary-hover);
}

.btn-success {
  background-color: var(--color-success);
  color: white;
}

.btn-warning {
  background-color: var(--color-warning);
  color: #ffffff;
}
[data-theme="dark"] .btn-warning { color: #141719; }

.btn-danger {
  background-color: var(--color-danger);
  color: white;
}

.btn-secondary {
  background-color: var(--btn-secondary-bg);
  color: var(--btn-secondary-color);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background-color: var(--btn-secondary-hover);
}

/* Spec R2-11: einheitliche Kopfleisten-Buttons in allen sechs Oberflaechen (Navigation, Sprache, Theme,
   Vollbild): gleiche Hoehe (44 px Touchflaeche), Schrift, Polsterung, Ecken, Hover und Fokusrahmen.
   Farbe kommt von btn-primary / btn-secondary. Keine Inline-Styles an diesen Knoepfen. */
.btn.btn-nav {
  min-height: 2.75rem;
  padding: 0.45rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.1;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  gap: 0.35rem;
}
.btn.btn-nav:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.btn-large {
  padding: 0.9rem 1.5rem;
  font-size: 1.1rem;
  min-height: 48px;
}

.btn-touch {
  min-width: 56px;
  min-height: 50px;
  font-size: 1.4rem;
  font-family: var(--font-mono);
}

/* Tables & Lists */
.table-scroll-container {
  max-height: 580px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.data-table th,
.data-table thead th {
  background-color: var(--bg-surface-2);
  color: var(--text-muted);
  padding: 0.65rem 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 5;
}

.data-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  background-color: var(--bg-card);
}

.data-table tr:hover td {
  background-color: var(--bg-card-hover);
}

/* Compact Table Density (UIZZE operate.md) */
.data-table.table-compact th,
.data-table.table-compact thead th {
  padding: 0.45rem 0.6rem;
  font-size: 0.72rem;
}

.data-table.table-compact td {
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
}

/* Status Badges for Queue & Matches */
.badge-ready {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: transparent !important;
  color: var(--color-success);
  border: 1.5px solid var(--color-success);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

[data-theme="leitstand-dark"] .badge-ready,
[data-theme="dark"] .badge-ready {
  background: transparent !important;
  color: #10b981;
  border-color: #10b981;
}

[data-theme="referee-oled"] .badge-ready {
  background: transparent !important;
  color: #22c55e;
  border: 1.5px solid #22c55e;
}

.badge-pending {
  display: inline-flex;
  align-items: center;
  background: transparent !important;
  color: var(--text-muted);
  border: 1.5px solid var(--border-color);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-scheduled {
  display: inline-flex;
  align-items: center;
  background: transparent !important;
  color: #2563eb;
  border: 1.5px solid #2563eb;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Spielerportrait im Hochformat.
   Reihenfolge an jeder Stelle: R/G-Symbol, dann Portrait, dann Name.
   Ohne hinterlegtes Bild wird nichts gerendert, damit die Zeile nicht
   aufgerissen wird. */
.player-portrait {
  display: inline-block;
  width: var(--portrait-w, 2.1rem);
  height: var(--portrait-h, 2.9rem);
  object-fit: cover;
  object-position: center top;
  border-radius: 4px;
  border: none;
  background: var(--bg-surface-2);
  flex-shrink: 0;
  vertical-align: middle;
  margin: 0 0.4rem;
  /* Bilder werden regelmaessig neu geladen, Layout darf nicht springen. */
  box-sizing: border-box;
  user-select: none;
  -webkit-user-drag: none;
}

.player-portrait-g {
  --portrait-border: #4d565e;
}

/* Groessere Varianten fuer Tablet- und Hallenanzeige */
.player-portrait-lg {
  --portrait-w: 3.2rem;
  --portrait-h: 4.5rem;
  border: none;
}

/* 'Sei bereit' / 'Warm-up' auf der Hallenanzeige: gross, aber bewusst
   kleiner als das laufende Spiel (player-portrait-xl). */
.player-portrait-warmup {
  --portrait-w: 4.4rem;
  --portrait-h: 6.2rem;
  border: none;
}

.player-portrait-md {             /* Hallen-TV "Bitte bereithalten": kompakt, damit alle kommenden Spiele Platz haben */
  --portrait-w: 2.3rem;
  --portrait-h: 3.2rem;
  border: none;
}

.player-portrait-xl {
  --portrait-w: 5rem;
  --portrait-h: 7rem;
  border: none;
}

/* Vorlagenschau in der Spieler-Verwaltung */
.player-portrait-thumb {
  --portrait-w: 2.4rem;
  --portrait-h: 3.4rem;
  margin: 0;
}

/* Platzhalter zwischen R/G-Emblem und Spielername im Scoreboard.
   Bleibt leer, wenn kein Portrait hinterlegt ist. */
.player-portrait-slot {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.player-portrait-slot:empty {
  display: none;
}

/* ---------------------------------------------------------------------------
   Duell-Zeile: Bild AUSSERHALB, R/G-Box und Name zur Mitte hin.
   Feste Reihenfolge von links nach rechts:
     [Bild P1] [Rot-Box] [Name P1]   vs.   [Name P2] [Grau-Box] [Bild P2]
   Das "vs." ist immer die Trennung, die Bilder stehen immer aussen. Das gilt
   fuer den Court-Startbildschirm und fuer den Endbildschirm gleichermassen.
   --------------------------------------------------------------------------- */
.duel-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: calc(100% - 30px);
  margin: 0 auto;
}

.duel-row > .duel-side:first-child {
  justify-self: start;
}

.duel-row > .duel-side:last-child {
  justify-self: end;
}

.duel-row.duel-row-single {
  grid-template-columns: 1fr;
  justify-items: center;
}

.duel-side {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.duel-player-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.duel-player-info-p1 {
  align-items: flex-start;
  text-align: left;
}

.duel-player-info-p2 {
  align-items: flex-end;
  text-align: right;
}

.duel-meta-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.duel-player-info-p2 .duel-meta-row {
  justify-content: flex-end;
}

.duel-name-row {
  min-width: 0;
  width: 100%;
}

.duel-id {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.duel-name {
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
  min-width: 0;
}

.duel-name-p1 {
  color: var(--text-main) !important;
}

.duel-name-p2 {
  color: var(--text-main) !important;
}

.duel-vs {
  min-width: 8rem;
  max-width: 14rem;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

[data-theme="dark"] .duel-name-p1 {
  color: var(--text-main) !important;
}

[data-theme="dark"] .duel-name-p2 {
  color: var(--text-main) !important;
}

/* Sieger auf dem Endbildschirm. */
.duel-name-winner {
  text-decoration: underline;
  text-decoration-color: #10b981;
  text-decoration-thickness: 4px;
  text-underline-offset: 5px;
}

/* Das Portrait an der Aussenkante: gross (R3-04: 12rem x 16.8rem, 5:7) ohne Rahmen. */
.duel-portrait {
  --duel-portrait-w: 12rem;
  --duel-portrait-h: 16.8rem;
  width: var(--duel-portrait-w, 12rem);
  height: var(--duel-portrait-h, 16.8rem);
  flex: 0 0 auto;
  margin: 0;
  border-radius: 8px;
  border: none;
  object-fit: cover;
}

.duel-portrait.duel-portrait-empty {
  width: 0;
  height: var(--duel-portrait-h, 16.8rem);
  border: none;
  background: transparent;
  box-shadow: none;
}

.card.duel-card {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  max-width: calc(100% - 30px);
  margin: 0 auto;
}

#idle-match-title {
  max-width: 100%;
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 900px) {
  .duel-portrait {
    --duel-portrait-w: 9rem;
    --duel-portrait-h: 12.6rem;
  }
  .duel-name {
    font-size: 1.15rem;
  }
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(20, 23, 25, 0.65);
  backdrop-filter: blur(6px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
  box-sizing: border-box;
}

.modal-overlay.active {
  display: flex;
}

/* Der Bild-Zuschneide-Dialog liegt ueber dem Spieler-Modal, wird er doch aus
   dem Spieler-Modal heraus geoeffnet. Beide teilen sich .modal-overlay und
   damit auch den z-index - ohne diesen Aufschlag landete der Dialog hinten
   und war vollstaendig vom Spieler-Modal verdeckt. */
#modal-photo-editor {
  z-index: 10050;
}

/* Kopfzeile eines Dialogs mit Schliessen-Knopf oben rechts.
   .modal-close-x hatte ueberhaupt keine Regel - der Knopf stand dadurch
   einfach links neben dem Titel statt in der oberen rechten Ecke. */
.modal-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-card);
  border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0;
}

.modal-close-x {
  /* Anker ist der relative .modal-header darüber - nicht das Modal-overlay,
     das spannt sich ueber den ganzen Bildschirm. */
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 2;
  width: 2.4rem;
  height: 2.4rem;
  min-width: 2.4rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1;
  border-radius: 6px;
}

.modal-content {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  /* Ohne diese Klammerung malt der quadratische Kopf- und Fussbereich des
     Modals ueber die runden Ecken und links oben/rechts oben ein sichtbares
     Viereck stehen. 'hidden' schneidet jede Kinderflaeche auf den Radius zu. */
  overflow: hidden;
}

.modal-content > .card-header {
  flex-shrink: 0;
  margin-bottom: 0;
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-card);
  /* Ecken des Modals mitfuehren, damit der Kopf die Rundung nicht bricht. */
  border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0;
}

/* Fussleiste mit Aktionen (R2-02): hatte keine Regel, die Knoepfe klebten am Rand des Dialogs. */
.modal-footer {
  flex-shrink: 0;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
}

.modal-content > .modal-body {
  /* Unten genauso: die letzte Zeile darf die unteren Ecken nicht aussparen. */
  border-radius: 0 0 calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px);
}

.modal-body {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  padding: 1.25rem 1.5rem;
  box-sizing: border-box;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input {
  width: 100%;
  padding: 0.75rem;
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 1rem;
}

.form-input:focus {
  outline: none;
  border-color: var(--border-active);
}

/* Tablet Touch Ergonomics & Schieberegler */
.touch-counter-card {
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  transition: border-color 0.15s ease;
}

.touch-counter-card:hover, .touch-counter-card.active {
  border-color: #3b82f6;
}

.touch-player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.touch-player-name {
  font-size: 1.35rem;
  font-weight: 800;
}

.touch-score-hero {
  font-size: 3.5rem;
  font-weight: 900;
  font-family: var(--font-mono);
  color: #f7f8f8;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(34, 39, 44, 0.8);
  border: 1px solid var(--border-color);
  text-align: center;
  min-width: 90px;
  user-select: none;
  -webkit-user-select: none;
}

.touch-score-hero:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: #3b82f6;
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.75rem 0 0.25rem 0;
}

.score-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  background: #363d44;
  border-radius: 11px;
  outline: none;
  cursor: pointer;
}

.score-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #3b82f6;
  border: 3px solid #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: transform 0.1s ease, background-color 0.1s ease;
}

.score-slider::-webkit-slider-thumb:active {
  transform: scale(1.15);
  background: #60a5fa;
}

.score-slider::-moz-range-thumb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #3b82f6;
  border: 3px solid #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  padding: 0 8px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.slider-ticks span.mark-15 {
  color: #34d399;
  font-weight: 800;
  font-size: 0.85rem;
}

.quick-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.btn-pill {
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: var(--font-mono);
  border-radius: 9999px;
  background: #363d44;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.1s ease;
  user-select: none;
  -webkit-user-select: none;
}

.btn-pill:hover, .btn-pill:active {
  background: #4d565e;
}

.btn-pill.pill-15 {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.5);
}
.btn-pill.pill-15:hover {
  background: rgba(16, 185, 129, 0.35);
}

.btn-nudge {
  width: 48px;
  height: 48px;
  font-size: 1.5rem;
  font-weight: 800;
  font-family: var(--font-mono);
  border-radius: var(--radius-sm);
  background: #363d44;
  color: white;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
  -webkit-user-select: none;
}
.btn-nudge:active {
  background: #4d565e;
  transform: scale(0.95);
}


/* Public Display Columns */
.display-court-col {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--card-shadow);
}

.display-court-col.court-col-1,
.display-court-col.court-col-2,
.display-court-col.court-col-3 {
  border-top: none;
}

.court-col-header {
  background-color: var(--bg-card);
  color: var(--text-main);
  border-bottom: 2px solid var(--border-color);
  padding: 1.1rem;
  text-align: center;
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tier-section {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

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

.live-badge {
  background-color: var(--color-live);
  color: white;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ========================================================================= */
/* Player Color System: Spieler 1 = Rot, Spieler 2 = Grau                    */
/* ========================================================================= */

:root {
  --ricochet-red-glow: #ff2a3b;
  --ricochet-grey-light: #7c8894;
}


/* Authentic Ricochet Scoreboard Emblem & Badges */
.ricochet-badge-container {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  gap: 0.65rem;
  background: rgba(20, 23, 25, 0.8);
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  box-sizing: border-box;
}

.ricochet-badge-red {
  border-color: rgba(204, 24, 41, 0.6);
  background: rgba(204, 24, 41, 0.15);
}

.ricochet-badge-grey {
  border-color: rgba(77, 86, 94, 0.7);
  background: rgba(77, 86, 94, 0.2);
}

.ricochet-tag-label {
  font-family: var(--font-sans);
  font-style: italic;
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.ricochet-tag-label-red {
  color: var(--accent-text);
}

.ricochet-tag-label-grey {
  color: var(--p2-text);
}

.player-badge-red {
  background: rgba(204, 24, 41, 0.25);
  color: #ff6b7a;
  border: 1px solid var(--ricochet-red);
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

.player-badge-grey {
  background: rgba(77, 86, 94, 0.3);
  color: #e1e4e7;
  border: 1px solid var(--ricochet-grey);
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

/* Digital 7-Segment LED Score Display (from authentic Ricochet court board) */
.touch-score-hero {
  font-family: var(--font-mono);
  font-size: 3.6rem;
  font-weight: 900;
  line-height: 1;
  background: #000000;
  border: 2px solid #2c3238;
  border-radius: 8px;
  padding: 0.35rem 1.1rem;
  min-width: 100px;
  text-align: center;
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.95), 0 4px 12px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  user-select: none;
  color: #ff2a3b !important;
  text-shadow: none;
}

.score-hero-red {
  color: #ff2a3b !important;
  text-shadow: none;
}

.score-hero-grey {
  color: #ff2a3b !important;
  text-shadow: none;
}

.score-slider-red {
  accent-color: var(--ricochet-red);
}

.score-slider-grey {
  accent-color: var(--ricochet-grey);
}

.btn-pill-red {
  background: rgba(204, 24, 41, 0.18);
  color: #ff8591;
  border-color: rgba(204, 24, 41, 0.6);
}
.btn-pill-red:hover {
  background: rgba(204, 24, 41, 0.35);
}

.btn-pill-grey {
  background: rgba(77, 86, 94, 0.25);
  color: #e1e4e7;
  border-color: rgba(77, 86, 94, 0.7);
}
.btn-pill-grey:hover {
  background: rgba(77, 86, 94, 0.45);
}

/* Authentic Ricochet GAMES Dots Indicator */
.games-indicator-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.4rem;
}
.games-dots {
  display: flex;
  gap: 0.45rem;
}
.game-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1.5px solid #6c757d;
  background: #363d44;
  box-sizing: border-box;
  display: inline-block;
  transition: background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.game-dot.won {
  background: #ff2a3b !important;
  box-shadow: 0 0 6px #ff2a3b, 0 0 14px rgba(255, 42, 59, 0.65) !important;   /* leuchtende Satz-LED wie an der Tafel */
  border-color: #ff2a3b !important;
}

.games-caption {
  font-family: var(--font-sans);
  font-style: italic;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: #9aa2aa;
}

/* Tablet Fullwidth Overhaul */
.tablet-container-full {
  width: 100% !important;
  max-width: 100% !important;
  padding: 0.4rem 0.75rem !important;
  margin: 0 !important;
  box-sizing: border-box;
}

/* Validation Alert */
.validation-alert {
  background: rgba(239, 68, 68, 0.15);
  border: 2px solid #ef4444;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.25rem;
  color: #fca5a5;
  font-weight: 700;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1rem;
}

/* Satzpause / Break State Banner */
.break-banner {
  background: var(--bg-surface-2);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.break-timer-display {
  font-family: var(--font-mono);
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--text-main);
  margin: 0.75rem 0;
  letter-spacing: 0.05em;
}

.break-score-summary {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 1.5rem;
}

/* Roster Management & Wizard Styles (Master PC) */
.drop-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: center;
  background: var(--bg-surface-2);
  cursor: pointer;
  transition: all 0.2s ease;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--text-dim);
  background: var(--bg-card-hover);
}

.roster-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-top: 0;
}

.roster-table th {
  background: var(--bg-surface-2);
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 2px solid var(--border-color);
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
  z-index: 5;
}

.roster-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.roster-table tr:hover {
  background: var(--bg-card-hover);
}

.roster-input {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  width: 100%;
}

/* Format Evaluation & Suitability Cards */
.suggestions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.15rem;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

.suggestion-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.4rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  overflow: hidden;
}

.suggestion-card:hover {
  border-color: var(--text-dim);
  box-shadow: var(--card-shadow-hover);
}

.suggestion-card.active {                /* gewaehlt: kraeftiger dunkler Rahmen, kein Leuchten */
  border: 3px solid var(--text-main);
  background: var(--bg-card);
}

.suggestion-card.top-rec {
  border-color: var(--text-dim);
}

.suggestion-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.suggestion-card-header > div:first-child {
  flex: 1 1 170px;
  min-width: 0;
}

.suggestion-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
}

.suitability-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: normal;
  line-height: 1.25;
  max-width: 100%;
  word-break: break-word;
  text-align: center;
  flex-shrink: 0;
}

/* Eine neutrale Pillenform; nur der Punkt traegt die Farbe */
.suitability-pill.success, .suitability-pill.info, .suitability-pill.warning, .suitability-pill.danger {
  background: var(--bg-surface-2);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  gap: 0.35rem;
}
.suitability-pill.success::before, .suitability-pill.info::before,
.suitability-pill.warning::before, .suitability-pill.danger::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
}
.suitability-pill.success::before { background: var(--color-success); }
.suitability-pill.info::before { background: var(--text-dim); }
.suitability-pill.warning::before { background: var(--color-warning); }
.suitability-pill.danger::before { background: var(--color-danger); }

.suggestion-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.suggestion-meta strong {
  color: var(--text-main);
}

.suggestion-pros-cons {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin: 0;
  padding-left: 1.1rem;
}

.suggestion-pros-cons li {
  margin-bottom: 0.2rem;
}

/* Interactive Court Selection Tiles */
.court-pills-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.court-pill-btn {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
  user-select: none;
}

.court-pill-btn:hover {
  border-color: var(--text-dim);
  color: var(--text-main);
}

.court-pill-btn.active {                 /* ruhig: dunkle Flaeche statt blauem Leuchten */
  background: var(--text-main);
  border-color: var(--text-main);
  color: var(--bg-card);
  font-weight: 800;
}

/* Team Match Tournament Styles */
.team-standings-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.team-standings-header {
  background: var(--bg-surface-2);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.team-standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.team-standings-table th {
  background: var(--bg-surface-2);
  color: var(--text-muted);
  font-weight: 800;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 2px solid var(--border-color);
}

.team-standings-table td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  background: transparent;
}

.team-standings-table tr:hover td {
  background: var(--bg-surface-2);
}

.team-duel-section {
  margin-top: 1.25rem;
}

.team-duel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.team-duel-header {
  background: var(--bg-surface-2);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.team-match-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  transition: background 0.15s ease;
}

.team-match-row:last-child {
  border-bottom: none;
}

.team-match-row:hover {
  background: var(--bg-surface-2);
}

/* Team Builder (Setup Modal) */
.team-builder-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
}

.team-builder-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.reorder-btn {
  padding: 0.15rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
}

/* Team Builder Stacked Cards Layout (Setup Modal) */
.team-card-section {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  transition: border-color 0.15s ease;
}

.team-card-section:hover {
  border-color: #4d565e;
}

.team-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.team-tile-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  width: 100%;
}

.team-tile-btn:hover {
  border-color: var(--text-dim);
}

.team-tile-btn.active {
  border: 2px solid var(--text-main);
  background: var(--bg-surface-2);
}

.team-tile-btn.active .team-tile-title {
  color: var(--text-main);
}

.team-tile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.team-tile-badge {
  background: rgba(37, 99, 235, 0.15);
  color: #1d4ed8;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.8rem;
  font-weight: 800;
  font-family: var(--font-mono);
  display: inline-block;
}

[data-theme="dark"] .team-tile-badge,
[data-theme="leitstand-dark"] .team-tile-badge,
[data-theme="referee-oled"] .team-tile-badge {
  background: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
}

.team-tile-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-tile-count {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.team-detail-pane {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.player-seed-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 900;
  line-height: 1;
  flex-shrink: 0;
}

/* Encounters Dashboard */
.encounters-dashboard {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  margin-bottom: 1.25rem;
}

.encounters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 0.85rem;
}

.encounter-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.15s ease;
}

.encounter-card:hover {
  border-color: #60a5fa;
}

.encounter-card.in-progress {
  border-color: #f59e0b;
}

.encounter-card.completed {
  border-color: #10b981;
}

/* ========================================================================= */
/* Ricochet Tablet Scoreboard Matrix Table                                  */
/* ========================================================================= */
.matrix-board-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.6rem;
  margin-bottom: 0.4rem;
  overflow-x: auto;
}

.matrix-grid-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.35rem;
  min-width: auto;
}

.matrix-th {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.45rem;
  text-align: left;
}

.matrix-th-set {
  text-align: center;
  min-width: 55px;
  max-width: 70px;
  padding: 0.2rem 0.25rem;
}

.matrix-th-active {
  /* Die Beschriftung gehoert direkt ueber die Bedienelemente am rechten
     Rand, nicht in die Mitte der Leiste. */
  text-align: right;
  padding-left: 0.5rem;
  padding-right: 0.25rem;
  white-space: nowrap;
}

/* Rot- und Graubox des Spielers (DESIGN.md "Flat Board Rule"): flache Zeile,
   die Seite zeigen die Kante links und das R/G-Emblem - kein Verlauf hinter dem Namen. */
.matrix-row-red,
.matrix-row-grey {
  background: var(--bg-card);
}

.matrix-row-red .ricochet-badge-container,
.matrix-row-grey .ricochet-badge-container {
  background: var(--bg-card);
}

/* Die Zeilen sind rund 50 % hoeher als vorher. Das Bild des Spielers fuellt
   den Kasten dabei fast vollstaendig aus - der Platz war vorhanden, er wurde
   nur nicht genutzt. */
.matrix-row-red td, .matrix-row-grey td {
  padding: 0.5rem 0.6rem;
  vertical-align: middle;
}
.matrix-row-red > *, .matrix-row-grey > * {
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.matrix-row-red > :first-child {
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
  border-left: 0;
}
.matrix-row-red td:last-child {
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  border-right: 1px solid var(--border-color);
}

.matrix-row-grey > :first-child {
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
  border-left: 0;
}
.matrix-row-grey td:last-child {
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  border-right: 1px solid var(--border-color);
}

.matrix-td-player {
  min-width: 230px;
  width: 34%;
}

/* Fuellt die Hoehe der Zeile aus: R/G-Emblem, Bild und Text sitzen
   gleich hoch, das Bild nimmt den ganzen Kasten ein. */
.player-identity-matrix {
  display: flex;
  align-items: stretch;
  gap: 0.7rem;
  min-height: 5.4rem;
}

.player-identity-matrix .ricochet-badge-container {
  align-self: center;
}

.player-matrix-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

/* Das Spielerbild fuellt den Kasten fast vollstaendig aus: es nimmt die
   volle Zeilenhoehe und eine breite eigene Spalte. Der Rand ist schmal, damit
   links das R/G-Emblem und rechts der Name Platz bleiben. */
/* Reihenfolge in der Scoreboard-Zeile: Bild am linken Rand, dann R/G-Box,
   dann der Name. Das Bild steht damit am weitesten vom Gegenueber weg. */
.player-identity-matrix .player-portrait-slot {
  order: -1;
  align-self: stretch;
  display: flex;
  align-items: stretch;
  flex: 0 0 auto;
}

.player-identity-matrix .player-portrait {
  width: 4.8rem;
  height: 100%;
  min-height: 5.4rem;
  margin: 0 0.15rem;
  border-radius: 6px;
  border: none;
}

.player-name-matrix {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

/* Spec R2-05: Setznummer als feste Plakette - ein Bauteil fuer Court, Turnierbaum und Master.
   Gleiche Grundlinie wie der Name (Flex mit align-items: baseline), feste Mindestbreite, kein Umbruch,
   schrumpft nie und ueberlappt nichts; der Name bricht stattdessen um. */
.player-name-line {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  min-width: 0;
}
.player-name-line > .player-name-matrix {
  min-width: 0;
  overflow-wrap: anywhere;
}
.seed-plaque {
  flex-shrink: 0;
  display: inline-block;
  box-sizing: border-box;
  min-width: 2.7em;
  padding: 0.05em 0.45em;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--bg-surface-2);
  color: var(--text-muted);
  font: 700 0.75rem/1.35 var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: center;
  white-space: nowrap;
  text-shadow: none;
  vertical-align: middle;
  margin-left: 0.35rem;
}
.seed-plaque:empty, .player-flag:empty {
  display: none;
}
.player-flag { flex-shrink: 0; font-size: 1.25rem; }   /* gleiche Groesse wie .player-name-matrix */

.games-indicator-box-matrix {
  display: flex;
  align-items: center;
  margin-top: 0.25rem;
}
.games-indicator-box-matrix .seed-plaque {
  margin-left: 0.6rem;
}
.games-indicator-box-matrix .scoreboard-led-display {
  margin-left: 0.6rem;
  font-size: 1.15rem;
  padding: 0.1rem 0.45rem;
}

/* Confirmed Set Score Display */
.matrix-td-set-score {
  text-align: center;
  min-width: 55px;
  max-width: 70px;
  cursor: pointer;
  padding: 0.25rem 0.25rem !important;
}

.set-score-display {
  font-size: 1.7rem;
  line-height: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 6px;
  padding: 0 0.35rem;
  display: inline-block;
  text-align: center;
  user-select: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.set-score-display:hover {
  transform: scale(1.05);
  border-color: #3b82f6;
}
.set-score-display.set-chip {
  font-size: 1.7rem;
  line-height: 48px;
  height: 48px;
  min-width: 48px;
  padding: 0 0.35rem;
}

/* Active Score Input Cluster (Optimized for 11" 1920x1200 Tablet) */
/* Die Schnellwahl sitzt bewusst ganz rechts: so bleiben Bild und Spielername
   links ungestoert breit, und die vier Knopfchen sind trotzdem mit einem
   Daumen erreichbar. */
.matrix-td-active {
  text-align: right;
}

.score-input-cluster {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  flex-wrap: nowrap;
  width: 100%;
}

/* Spec R2-19: alle Kaestchen der Punkteingabe (-, +, Schnellwahl) gleich gross, unabhaengig von Inhalt
   und Rahmen (border-box). Eine Groesse fuer alle: --score-key. */
:root { --score-key: 64px; }
.btn-nudge-large, .btn-pill-compact {
  box-sizing: border-box;
  width: var(--score-key);
  min-width: var(--score-key);
  height: var(--score-key);
  padding: 0;
  line-height: 1;
}

.btn-nudge-large {
  font-size: 2.2rem;
  font-weight: 900;
  font-family: var(--font-mono);
  border-radius: 8px;
  background: #22272c;
  color: white;
  border: 1.5px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.1s ease, transform 0.08s ease;
}

.btn-nudge-large:active {
  background: #363d44;
  transform: scale(0.92);
}

.btn-nudge-plus,
.btn-nudge-minus {
  /* neutral: Rot gehoert der Seite R, Blau waere eine dritte Farbe (DESIGN.md "Two Sides Rule") */
  background: var(--btn-secondary-bg);
  border: 2px solid var(--border-color);
  color: var(--text-main);
}

.btn-nudge-plus:active,
.btn-nudge-minus:active {
  background: var(--text-main);
  color: var(--bg-card);
  transform: scale(0.92);
}

.score-box-compact {
  font-size: 2.9rem;
  line-height: 64px;
  background: #000000;
  border: 2px solid #2c3238;
  border-radius: 8px;
  min-width: 104px;
  height: 64px;
  text-align: center;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.95);
  cursor: pointer;
  user-select: none;
  color: #ff2a3b !important;
  text-shadow: none;              /* Tablet bei Tageslicht: Glow macht die Ziffern unscharf (nur Hallen-TV glueht) */
  flex-shrink: 0;
}

/* Die Schnellwahl klebt direkt an den +-Knoepfen und sitzt mit dem ganzen
   Block am rechten Rand. Ein "margin-left: auto" wuerde die Pillen allein
   nach rechts schieben und die Punkte dazwischen in der Mitte stehen lassen. */
.quick-pills-wrap {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  margin-left: 0;
}

.btn-pill-compact {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  /* Groesse: siehe --score-key oben (gleich wie Plus/Minus) */
  font-size: 1.25rem;
  font-weight: 800;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.btn-pill-compact:hover {
  background: rgba(255, 255, 255, 0.16);
}
.btn-pill-compact:active {
  transform: scale(0.95);
}

/* Disabled / Greyed out score input cluster (e.g. during set breaks before set 2 is started) */
.scoring-disabled {
  opacity: 0.28 !important;
  pointer-events: none !important;
  filter: grayscale(1) !important;
  user-select: none !important;
  cursor: not-allowed !important;
}

.scoring-disabled button,
.scoring-disabled input,
.scoring-disabled .score-box-compact {
  pointer-events: none !important;
  cursor: not-allowed !important;
}

/* Bracket Converging Tree Styles */
.bracket-tree-container {
  overflow-x: auto;
  overflow-y: auto;
  padding: 1rem 0.75rem;
  background: var(--bg-surface, #f7f8f8);
  border-radius: 8px;
  border: 1px solid var(--border-color, #c9ced3);
  max-width: 100%;
}

[data-theme="dark"] .bracket-tree-container {
  background: #141719;
  border-color: #22272c;
}

.bracket-node-compact {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #c9ced3);
  border-radius: 4px;
  padding: 0 6px;
  font-size: 0.76rem;
  overflow: hidden;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: border-color 0.15s, background-color 0.15s;
}

[data-theme="dark"] .bracket-node-compact {
  background: #22272c;
  border-color: #363d44;
}

.bracket-node-compact:hover {
  border-color: #2563eb;
}

/* Stacked 2-Row Match Node (bo5 / German Open Style) */
.bracket-node-stacked {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #c9ced3);
  border-radius: 5px;
  padding: 3px 6px;
  font-size: 0.78rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: border-color 0.15s, box-shadow 0.15s;
  cursor: pointer;
  user-select: none;
  overflow: hidden;
}

[data-theme="dark"] .bracket-node-stacked {
  background: #22272c;
  border-color: #363d44;
}

.bracket-node-stacked:hover {
  border-color: var(--text-dim);
}

.bracket-node-stacked.status-in_progress {
  border: 2px solid var(--color-live) !important;   /* laufendes Spiel: klare Kante in Live-Gruen, kein Gluehen */
}



.bns-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
  font-size: 0.70rem;
  color: var(--text-muted, #6c757d);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding-bottom: 1px;
}

[data-theme="dark"] .bns-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.bns-code {
  font-family: var(--font-mono);
  font-weight: 900;
  color: var(--text-dim);
  background: var(--bg-surface-2, #f2f3f4);
  border: 1px solid var(--border-color, #e1e4e7);
  border-radius: 3px;
  padding: 0px 4px;
}

[data-theme="dark"] .bns-code {
  background: #363d44;
  color: #c9ced3;
  border-color: #4d565e;
}

.bns-format {
  font-weight: 700;
  font-size: 0.65rem;
  color: var(--text-muted, #6c757d);
}

.bns-live {
  background: var(--color-live);
  color: #ffffff;
  font-weight: 900;
  font-size: 0.62rem;
  padding: 1px 5px;
  border-radius: 2px;
}

.bns-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0;
  min-height: 20px;
}

.bns-player-info {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.bns-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: 0.01em;
}

/* Namen im Turnierbaum schwarz; die Seite zeigt das kleine R/G-Emblem davor */
.bns-name.p1,
.bns-name.p2 {
  color: var(--text-main);
}

.bns-player-row.winner .bns-name {
  font-weight: 900;
}

/* Beendetes Spiel: Sieger fett, Verlierer duenn (beide schwarz) - dazu die gefuellte Siegerzahl */
*:has(> .bns-player-row.winner) > .bns-player-row:not(.winner) .bns-name {
  font-weight: 400;
}

.bns-win-tag {
  color: var(--win);
  font-weight: 900;
  font-size: 0.74rem;
  margin-left: 3px;
  flex-shrink: 0;
}

.bns-sets-badge {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.88rem;
  background: var(--bg-surface-2, #f2f3f4);
  color: #000000;
  border: 1px solid var(--border-color, #c9ced3);
  border-radius: 4px;
  min-width: 24px;
  text-align: center;
  padding: 1px 5px;
  flex-shrink: 0;
}

[data-theme="dark"] .bns-sets-badge {
  background: #363d44;
  color: #f7f8f8;
  border-color: #4d565e;
}

/* Siegerzahl: gefuellt in Schriftfarbe (dunkel im hellen, hell im dunklen Design) */
.bns-sets-badge.winner,
[data-theme="dark"] .bns-sets-badge.winner {
  font-weight: 900;
  background: var(--text-main);
  color: var(--bg-card);
  border-color: var(--text-main);
}

.bns-games-detail {
  min-width: 0;                     /* weicht dem L-/W-Verweis: lieber "..." als Ueberlappen */
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted, #6c757d);
  letter-spacing: 0.02em;
  margin-top: 1px;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 2-Column Placement Grid Layout.
   Beide Spalten teilen sich die Breite nach dem, was tatsaechlich drinsteht:
   links die Plaetze 5-8 und 17-24, rechts 9-16 und 25-32. Die Kacheln darin
   duerfen ihre Spalte voll ausfuellen (siehe createDuelPlacementCard), damit
   die Namen lesbar bleiben - es gibt keine kuenstliche Obergrenze mehr.
   Die Spalten sind so vermessen, dass der komplette Block ohne Innen-
   Scrollbalken auf einen Bildschirm passt. */
/* Spec R2-09: Platzierungsbloecke (5-8, 9-16, 17-24, 25-32) fliessen als Raster nebeneinander und brechen
   automatisch in weitere Zeilen um, statt untereinander zu stehen. Jeder Block ist so breit wie sein Inhalt;
   die beiden Teilbaeume eines Blocks (z. B. 17-20 und 21-24) stehen ebenfalls nebeneinander, wenn Platz ist.
   Die Kacheln behalten ihre 310 px (Namen werden nicht abgeschnitten). */
.placement-2col-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: flex-start;
}
/* Die frueheren Spalten-Container (links/rechts) loesen sich auf: ihre Bloecke werden direkte Rasterelemente. */
.placement-2col-grid > .placement-column {
  display: contents !important;
}
.placement-2col-grid .placement-block-card {
  flex: 0 1 auto;
  max-width: 100%;
  overflow-x: auto;
}
.placement-subtrees {
  flex-wrap: wrap;
  align-items: flex-start;
}

/* Nichts darf mehr abgeschnitten werden. */
.bracket-section.section-placement {
  overflow-x: auto;
}

.placement-block-card {
  box-sizing: border-box;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.4rem 0.55rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}



/* Bracket Section Cards with Themed Pastels */
.bracket-section {
  background: var(--bg-card, #ffffff);
  border-radius: 8px;
  border: 1px solid var(--border-color, #c9ced3);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.9rem;
  overflow-x: auto;
}

/* Feld-Kennung nur als Farbquadrat vor dem Titel und als Kante der Spielknoten (DESIGN.md) */
.bracket-section.section-winner { --zone: #e11d48; }
.bracket-section.section-loser { --zone: #0284c7; }
.bracket-section.section-placement { --zone: #ea580c; }
.bracket-section.section-trost { --zone: #9333ea; }
.bracket-section.section-women { --zone: #db2777; }

.bracket-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* Dicht unter der Box-Oberkante: die Sektion soll den Baum nach oben
     schieben, nicht selbst Platz verbrauchen. */
  margin-bottom: 0.4rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .bracket-section-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.quali-side-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid #fecdd3;
  border-radius: 6px;
  width: 250px;
  flex-shrink: 0;
}

[data-theme="dark"] .quali-side-panel {
  background: #22272c;
  border-color: #4d565e;
}

/* Interactive Loser Feeder Link Badges & Smooth Navigation Pulse */
.loser-link-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  text-decoration: none;
  background: transparent !important;
}

.loser-link-badge:hover {
  background: rgba(37, 99, 235, 0.12) !important;
  border-color: #2563eb !important;
  color: #1d4ed8 !important;
  transform: translateY(-1px);
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.2);
}

[data-theme="dark"] .loser-link-badge {
  background: transparent !important;
  color: #60a5fa !important;
  border-color: #3b82f6 !important;
}

[data-theme="dark"] .loser-link-badge:hover {
  background: rgba(59, 130, 246, 0.2) !important;
  color: #93c5fd !important;
}

.winner-link-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  text-decoration: none;
  background: transparent !important;
}

.winner-link-badge:hover {
  background: rgba(22, 163, 74, 0.12) !important;
  border-color: #16a34a !important;
  color: #15803d !important;
  transform: translateY(-1px);
  box-shadow: 0 1px 3px rgba(22, 163, 74, 0.2);
}

[data-theme="dark"] .winner-link-badge {
  background: transparent !important;
  color: #4ade80 !important;
  border-color: #16a34a !important;
}

[data-theme="dark"] .winner-link-badge:hover {
  background: rgba(34, 197, 94, 0.2) !important;
  color: #86efac !important;
}

@keyframes bracketNodeGlow {
  0% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.7); transform: scale(1.02); }
  50% { box-shadow: 0 0 0 12px rgba(225, 29, 72, 0); transform: scale(1.03); }
  100% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0); transform: scale(1); }
}

.bracket-node-pulse {
  animation: bracketNodeGlow 1.5s ease-in-out !important;
  z-index: 20 !important;
  position: relative !important;
  border-color: #e11d48 !important;
}

/* High-Contrast Match Finished Panel (Tablet Light & Dark Theme)
   Spec R2-06: zentrierter Block mit Maximalbreite statt ueber die ganze Breite gezogen. */
#match-finished-panel {
  border-radius: 12px;
  padding: 1.25rem 1.25rem 1.5rem;
  margin: 0 auto 0.75rem;
  max-width: 560px;
  text-align: center;
  background: transparent !important;
  border: none !important;
}
.winner-card { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; margin: 0.6rem 0 0.4rem; }
.winner-label {
  font-size: 0.95rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted);
}
.winner-portrait-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
}
.winner-identity {
  display: flex; align-items: center; justify-content: center; gap: 0.65rem; max-width: 100%; flex-wrap: wrap;
}
.winner-portrait {
  --portrait-w: 10rem;
  --portrait-h: 14rem;          /* festes Seitenverhaeltnis 5:7 wie im Zuschnitt; object-fit: cover, nie gestreckt */
  width: var(--portrait-w, 10rem);
  height: var(--portrait-h, 14rem);
  object-fit: cover;
  flex-shrink: 0;
  border: none !important;
  border-radius: 8px;
}
.winner-name { font-size: 1.8rem; font-weight: 900; line-height: 1.15; overflow-wrap: anywhere; min-width: 0; color: var(--text-main) !important; }
.winner-sets-label { font-size: 0.8rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.85; color: var(--text-muted); }
.winner-sets { font-size: 2.6rem; font-weight: 900; line-height: 1.1; color: var(--text-main); }
.winner-games { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.35rem; font-size: 1.15rem; font-weight: 800; }
.winner-games > span { padding: 0.1rem 0.55rem; border-radius: var(--radius-sm); background: var(--bg-surface-2); color: var(--text-main); font-weight: 400; }

:root #match-finished-panel,
[data-theme="matchday-light"] #match-finished-panel,
[data-theme="light"] #match-finished-panel {
  background: transparent !important;
  border: none !important;
}

:root #match-finished-panel #lbl-match-finished-title,
[data-theme="matchday-light"] #match-finished-panel #lbl-match-finished-title,
[data-theme="light"] #match-finished-panel #lbl-match-finished-title {
  color: var(--text-main) !important;
}

:root #match-finished-panel #match-finished-winner,
[data-theme="matchday-light"] #match-finished-panel #match-finished-winner,
[data-theme="light"] #match-finished-panel #match-finished-winner {
  color: var(--text-main) !important;
}

:root #match-finished-panel #match-finished-score,
[data-theme="matchday-light"] #match-finished-panel #match-finished-score,
[data-theme="light"] #match-finished-panel #match-finished-score {
  color: var(--text-main) !important;
}

[data-theme="dark"] #match-finished-panel,
[data-theme="referee-oled"] #match-finished-panel,
[data-theme="leitstand-dark"] #match-finished-panel {
  background: transparent !important;
  border: none !important;
}

[data-theme="dark"] #match-finished-panel #lbl-match-finished-title,
[data-theme="referee-oled"] #match-finished-panel #lbl-match-finished-title {
  color: var(--text-main) !important;
}

[data-theme="dark"] #match-finished-panel #match-finished-winner,
[data-theme="referee-oled"] #match-finished-panel #match-finished-winner {
  color: var(--text-main) !important;
}

[data-theme="dark"] #match-finished-panel #match-finished-score,
[data-theme="referee-oled"] #match-finished-panel #match-finished-score {
  color: var(--text-main) !important;
}

.resting-notice-box {
  color: var(--text-main);
  font-size: 1.05rem;
  margin-top: 0.5rem;
  background: var(--bg-surface-2);
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  border: 0;
  background: color-mix(in srgb, var(--color-warning) 12%, var(--bg-card));
  text-align: left;
}

#idle-past-match-box, .resting-notice-box, .idle-notice-box {
  max-width: 640px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Vorlauf-Schalter im Spielstapel: ein Klick schaltet um, wie bei BO3/BO5.
   "FEST" (manuell fixiert) ist kein Schalter, sondern nur ein Hinweis. */
.horizon-toggle-btn {
  cursor: pointer;
  font-family: inherit;
  transition: filter 0.15s ease, transform 0.08s ease;
}
.horizon-toggle-btn:hover {
  filter: brightness(1.08);
}
.horizon-toggle-btn:active {
  transform: scale(0.97);
}
.badge-lock-released {
  background: transparent !important;
  color: #d97706 !important;
  border: 1.5px dashed #d97706 !important;
}

.badge-vorlauf-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  color: var(--vorlauf);
  border: 1.5px solid var(--vorlauf);
  font-weight: 800;
  border-radius: 4px;
  white-space: nowrap;
}

/* Spec R2-16: gemeinsame Mobil-Kopfleiste fuer Mobil-Halle (/lm-sachsen/m/display) und Mobil-Turnierbaum (/lm-sachsen/m/bracket).
   Gleiche Reihenfolge: Titel + Live-Status / Navigation | Sprache, Theme / Suche + Reset. */
.m-head {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.6rem 0.85rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.m-head-top, .m-head-controls, .m-head-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.m-head-top, .m-head-controls { justify-content: space-between; }
.m-head-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 900;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.m-head-group { display: flex; gap: 0.4rem; }
.m-search-input {
  flex: 1;
  min-width: 0;
  min-height: 2.75rem;
  box-sizing: border-box;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  background: var(--bg-card);
  color: var(--text-main);
}

/* ========================================================================= */
/* Spec R2-20: einheitliche Scoring-Darstellung in Halle, Master und Court   */
/* (Vorbild Halle). Mobil und Turnierbaum sind bewusst ausgenommen.          */
/* ========================================================================= */
:root {
  --font-score: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
/* Alle Zahlen des Scorings: Punktestand, Satzergebnisse, gewonnene Saetze, Satzzaehler */
.score-num {
  font-family: var(--font-score);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.seed-plaque { font-family: var(--font-score); }

/* Sieger / gewonnener Satz: fett in voller Schriftfarbe; Verlierer / verlorener Satz: duenn und gedimmt.
   Der Unterschied liegt in Staerke UND Helligkeit - ohne Gruen. */
.res-win  { font-weight: 900 !important; color: var(--text-main) !important; }
.res-lose { font-weight: 400 !important; color: var(--text-dim) !important; }
.bracket-lose { font-weight: 400 !important; color: var(--text-main) !important; }   /* Turnierbaum: Verlierer duenn, aber schwarz */

/* Satzergebnis-Chip (gemeinsames Bauteil, erzeugt von renderSetChips() in core.js) */
.set-chip {
  display: inline-block;
  min-width: 2.1rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-size: 1.05rem;
  text-align: center;
}
.set-chip-p1 { background: var(--bg-card); color: var(--p1-text); border: 2px solid #cc1829; }   /* verloren: rote Schrift und roter Rahmen, nur ohne Hellrot-Flaeche */
.set-chip-p1.won { background: #cc1829; color: #ffffff; border-color: #cc1829; box-shadow: 0 1px 4px rgba(204, 24, 41, 0.4); }
.set-chip-p2 { background: var(--bg-card); color: var(--text-main); border: 1.5px solid #6c757d; }
.set-chip-p2.won { background: #363d44; color: #ffffff; border-color: #141719; box-shadow: 0 1px 4px rgba(20, 23, 25, 0.45); }
[data-theme="dark"] .set-chip-p2 {
  background: rgba(34, 39, 44, 0.6);
  border-color: rgba(154, 162, 170, 0.25);
  color: rgba(201, 206, 211, 0.7);
}
[data-theme="dark"] .set-chip-p2.won {
  background: #4d565e;
  border-color: #c9ced3;
  color: #ffffff;
}
.set-chip-pending { font-size: 0.8rem; font-style: italic; color: var(--text-muted); }
.set-chip-compact { font-size: 0.85rem; min-width: 1.6rem; padding: 0.12rem 0.45rem; }

/* Spec R2-12: Landesfaehnchen neben dem Namen (Court, Halle, Mobil, Master). Festes Seitenverhaeltnis 4:3,
   sitzt auf der Schriftlinie, schrumpft nie und ueberlappt nichts. */
.flag {
  display: inline-block;
  flex-shrink: 0;
  width: 1.25em;
  height: 0.94em;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(20, 23, 25, 0.25);
  vertical-align: -0.08em;
  margin: 0 0.3em 0 0;
}

/* =====================================================================
   DIE HALLENTAFEL - gemeinsame Ebene fuer alle sechs Oberflaechen.
   Steht am Ende und nutzt "body ..." als Praefix, damit sie die
   Seiten-Styles der Templates (die nach style.css geladen werden) schlaegt.
   ===================================================================== */

/* --- Kopfband: Schiefergrau wie die G-Haelfte der Tafel, rote Kante darunter --- */
body .app-header, body .display-header, body .tablet-header, body .bracket-header, body .m-head {
  --text-main: var(--shell-text);
  --text-muted: var(--shell-muted);
  --text-dim: var(--shell-muted);
  --border-color: var(--shell-line);
  --bg-card: var(--shell-bg);
  --btn-secondary-bg: var(--shell-btn-bg);
  --btn-secondary-color: var(--shell-text);
  --btn-secondary-hover: var(--shell-btn-hover);
  --color-success: #7ee0b5;
  --danger-text: #ffc9ce;
  background: var(--shell-bg);
  color: var(--shell-text);
  border-bottom: 4px solid var(--ricochet-red);
  box-shadow: none;
  backdrop-filter: none;
}
body .app-header .status-offline, body .display-header .status-offline,
body .tablet-header .status-offline, body .bracket-header .status-offline, body .m-head .status-offline {
  color: #ffc9ce; border-color: #ffc9ce;
}
body .app-header .status-online, body .display-header .status-online,
body .tablet-header .status-online, body .bracket-header .status-online, body .m-head .status-online {
  color: #7ee0b5; border-color: #7ee0b5;
}
body .app-header .btn-secondary, body .display-header .btn-secondary, body .tablet-header .btn-secondary,
body .bracket-header .btn-secondary, body .m-head .btn-secondary {
  border-color: var(--shell-line);
}

/* --- Schrift der Tafel: fett, kursiv, Versalien fuer Beschriftungen ("GAMES", "LET") --- */
body .brand-title, body .display-title, body .court-col-header, body .court-badge-large, body .card-title,
body .tier-title, body .matrix-th, body .modal-title, body .section-title {
  font-family: var(--font-sans);
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0.02em;
}
body .tier-title, body .matrix-th {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
body .brand-title, body .display-title { text-transform: uppercase; }

/* --- Knoepfe: kantig wie die Tafel --- */
body .btn { font-family: var(--font-sans); font-weight: 700; letter-spacing: 0.01em; border-radius: var(--radius-sm); }
body .btn.btn-nav { font-size: 0.95rem; }

/* --- Karten: flach, Rahmen statt Schatten --- */
body .card { box-shadow: none; border-radius: var(--radius-md); }
body .card:hover { box-shadow: none; }

/* --- LED-Fenster: echte 7-Segment-Ziffern; Geister-Segmente "8" stehen dahinter wie bei der Tafel --- */
body .live-sets, body .score-box-compact, body .scoreboard-led-display, body .touch-score-hero {
  font-family: var(--font-led) !important;   /* einige Uhren setzen die Schrift inline */
  font-weight: 700;
  font-style: normal;
  font-variant-numeric: normal;
  color: var(--led-on);
  background: var(--led-bg);
  border: 1px solid var(--scoreboard-border);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.8);
  text-shadow: none;
  letter-spacing: 0.04em;
  position: relative;
  isolation: isolate;
}
/* Uhren (Tageszeit, Spieldauer): ruhige Tafelschrift, kein LED - LED gehoert nur dem Spielstand */
body .display-clock, body #clock-display, body .live-elapsed-clock, body #match-timer {
  font-family: var(--font-sans) !important; font-weight: 700 !important; font-style: normal;
  font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
  background: none; border: 0; box-shadow: none; padding: 0;
}
body .live-sets::before, body .scoreboard-led-display::before {
  content: "8";
  position: absolute; z-index: -1; color: var(--led-ghost);
  left: 0; right: 0; text-align: center;
}
body .score-box-compact { text-align: right; padding-right: 0.9rem; }
body .score-box-compact::before {
  content: "88";
  position: absolute; z-index: -1; color: var(--led-ghost);
  right: 0.9rem; top: 0; text-align: right;
}

/* --- Emblem-Schrift im SVG: Tafelschrift statt Arial Black --- */
body .ricochet-court-symbol text, body svg text[font-style="italic"] { font-family: var(--font-sans); font-weight: 800; }

/* --- Formulare und Tabellen in Tafelschrift --- */
body input, body select, body textarea, body button, body table { font-family: var(--font-sans); }

/* --- Turnierbaum: Saetze als LED-Fenster; Sieger leuchtet rot, Verlierer grau --- */
body .bns-sets-badge {
  font-family: var(--font-led); font-weight: 700; font-size: 0.8rem;
  background: var(--led-bg); color: #8f989f; border-color: var(--scoreboard-border);
  border-radius: 2px; padding: 2px 5px;
}
body .bns-sets-badge.winner, body [data-theme="dark"] .bns-sets-badge.winner,
[data-theme="dark"] body .bns-sets-badge.winner {
  background: var(--led-bg); color: var(--led-on); border-color: var(--scoreboard-border);
}
body .bracket-node-stacked, body .bracket-node-compact { box-shadow: none; }
body .bracket-node-stacked { border-left: 1px solid var(--border-color); border-radius: 3px; }

/* --- Tablet: Spielerzeile mit Seitenflaeche wie auf der Tafel (R auf Rot, G auf Schiefergrau, weisser Ring) --- */
body .matrix-row-red > th.matrix-td-player, body .matrix-row-grey > th.matrix-td-player {
  --side-w: 4.6rem;
  position: relative;
  border-left: 0;
  padding-left: calc(var(--side-w) + 0.7rem);
  overflow: hidden;
}
body .matrix-row-red > th.matrix-td-player::before, body .matrix-row-grey > th.matrix-td-player::before {
  content: "R";
  position: absolute; left: 0; top: 0; bottom: 0; width: var(--side-w);
  display: flex; align-items: center; justify-content: center;
  background: var(--ricochet-red); color: #ffffff;
  font: italic 800 2.3rem/1 var(--font-sans);
}
body .matrix-row-grey > th.matrix-td-player::before { content: "G"; background: var(--ricochet-grey); }
body .matrix-row-red > th.matrix-td-player::after, body .matrix-row-grey > th.matrix-td-player::after {
  content: ""; position: absolute; top: 50%; left: calc(var(--side-w) / 2);
  width: 3.3rem; height: 3.3rem; transform: translate(-50%, -50%);
  border: 3px solid #ffffff; border-radius: 50%;
}
body .matrix-row-red .ricochet-badge-container svg, body .matrix-row-grey .ricochet-badge-container svg { display: none; }
body .matrix-row-red .ricochet-badge-container, body .matrix-row-grey .ricochet-badge-container {
  min-width: 0 !important; box-shadow: none; border-radius: var(--radius-sm);
}
body .ricochet-tag-label { font-family: var(--font-sans); font-weight: 800; font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.06em; }
body .player-name-matrix { font-size: 1.4rem; font-weight: 800; }
body .matrix-td-player { text-align: left; }
body .player-name-line { white-space: nowrap; }
body .btn-nudge-large { font-family: var(--font-sans); font-weight: 600; }
body .btn-pill-compact { font-family: var(--font-sans); font-weight: 700; font-size: 1.15rem; }
body .score-box-compact { font-size: 2.7rem; }

/* --- Turnierleitung: Court-Karten-Zeilen mit kleiner Seitenflaeche wie auf der Tafel --- */
body .cc-row {
  --side-w: 2.5rem;
  position: relative;
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  padding: 0.45rem 0.6rem 0.45rem calc(var(--side-w) + 0.6rem);
  margin-bottom: 0.4rem; overflow: hidden; min-height: 3rem;
}
body .cc-row::before {
  content: "R"; position: absolute; left: 0; top: 0; bottom: 0; width: var(--side-w);
  display: flex; align-items: center; justify-content: center;
  background: var(--ricochet-red); color: #fff; font: italic 800 1.3rem/1 var(--font-sans);
}
body .cc-row-g::before { content: "G"; background: var(--ricochet-grey); }
body .scoreboard-led-display { font-size: 1.5rem; padding: 0.2rem 0.5rem; min-width: 2.4rem; text-align: center; }

/* Tabs der Turnierleitung: aktiver Tab mit roter Unterkante wie die Kopfband-Kante */
body .tab-btn { font-family: var(--font-sans); font-style: italic; font-weight: 800; letter-spacing: 0.01em; }
body .tab-btn.active, [data-theme="dark"] body .tab-btn.active, body[data-theme="dark"] .tab-btn.active { box-shadow: inset 0 -4px 0 var(--ricochet-red); }
body .m-head-title { font-style: italic; font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; }
body .m-head input::placeholder { color: var(--shell-muted); }


/* Gesperrter "Satz bestaetigen": lesbar ausgegraut statt verblasstem Rot (Text >= 4,5:1) */
body #btn-confirm-set.scoring-disabled, body #btn-confirm-set:disabled {
  opacity: 1 !important; filter: none !important;
  background: var(--bg-surface-2) !important; color: var(--text-dim) !important;
  border: 1px dashed var(--border-color) !important;
}

/* --- R/G ueberall gleich: Feld mit weissem Ring (wie Halle und Tablet) --- */
body .matrix-row-red .ricochet-badge-container, body .matrix-row-grey .ricochet-badge-container { display: none; }
body .cc-row::after {
  content: ""; position: absolute; top: 50%; left: calc(var(--side-w) / 2);
  width: 1.85rem; height: 1.85rem; transform: translate(-50%, -50%);
  border: 2.5px solid #ffffff; border-radius: 50%;
}
body .cc-row::before { font-size: 1.05rem; }

/* --- Turnierbaum-Verweise "L -> ..." / "S -> ...": ohne Rahmen, leicht gefuellt in der Farbe des Zielfelds --- */
body .loser-link-badge[class], body .winner-link-badge[class], body .loser-link-badge[class]:hover, body .winner-link-badge[class]:hover {
  color: var(--zt, var(--zone-main)) !important; background: color-mix(in srgb, var(--zt, var(--zone-main)) 13%, transparent) !important;
  border: 0 !important; box-shadow: none !important; font-family: var(--font-sans) !important;
}
body [class][data-zone="loser"] { --zt: var(--zone-loser); }
body [class][data-zone="place"] { --zt: var(--zone-place); }
body [class][data-zone="trost"] { --zt: var(--zone-trost); }
body [class][data-zone="women"] { --zt: var(--zone-women); }

/* --- Turnierfortschritt: je Feld Name, Zahl und kurzer Datenbalken statt umrandeter Chips --- */
body #progress-breakdown-badges { gap: 1.4rem !important; font-size: 1rem !important; }
body .pf-field { min-width: 6.2rem; }
body .pf-label { font: italic 800 0.72rem/1.2 var(--font-sans); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
body .pf-val { font-size: 1.05rem; font-weight: 600; color: var(--text-muted); }
body .pf-val strong { font-size: 1.25rem; font-weight: 800; color: var(--text-main); }
body .pf-bar { height: 4px; margin-top: 3px; background: var(--border-subtle); border-radius: 2px; overflow: hidden; }
body .pf-bar i { display: block; height: 100%; }
body #progress-summary-badge { background: none !important; border: 0 !important; padding: 0 !important; font-family: var(--font-sans) !important; font-size: 1.05rem !important; font-weight: 700 !important; }

/* --- Marken ohne Umrandung (keine "Outline-Pillen"): Status als Punkt + Text, Marken als ruhige Fuellung --- */
body .status-badge:is(.status-online, .status-offline, .status-tablet-online) {
  border: 0 !important; background: none !important; padding: 0 !important;
  border-radius: 0; gap: 0.4rem; letter-spacing: 0.05em;
}
body .status-badge:is(.status-online, .status-offline, .status-tablet-online)::before {
  content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: currentColor; flex-shrink: 0;
}
body .status-live-pulse[class] {
  background: var(--color-live) !important; color: #ffffff !important; border: 0 !important; border-radius: 3px;
}
body .status-live-pulse[class]::before { background-color: #ffffff; }
body .badge-ready[class] {
  background: color-mix(in srgb, var(--color-success) 14%, transparent) !important; border: 0 !important; border-radius: 3px;
}
body .badge-pending[class], body .badge-scheduled[class] {
  background: var(--bg-surface-2) !important; color: var(--text-muted) !important; border: 0 !important; border-radius: 3px;
}
body .seed-plaque[class], body #results-count-badge { border: 0 !important; }

/* Hallenanzeige "Zuletzt beendet": Spielergebnis deutlich von den Satzstaenden getrennt */
body .past-match-item .past-sets { margin-left: 1.4rem; padding-left: 1.4rem; border-left: 1px solid var(--border-color); gap: 0 !important; }
body .status-badge:not(.status-online):not(.status-offline):not(.status-tablet-online) { border: 0 !important; border-radius: 3px; }

/* Court-Kachel: kurzer Hinweis, wenn sich das naechste Spiel geaendert hat */
@keyframes cc-changed { from { background-color: color-mix(in srgb, var(--color-warning) 22%, var(--bg-card)); } to { background-color: var(--bg-card); } }
body .court-card-hero.cc-changed { animation: cc-changed 2.4s ease-out; }


/* Dezente Court-Farbe (Blau / Gruen / Bernstein): leicht getoente Court-Karte und Court-Plan-Kopf,
   damit V1/V2-Marken (gleiche Farbe) sofort dem Court zugeordnet werden. Kein Rahmen, kein Streifen. */
body .court-card-hero[class*="court-card-"] { background: color-mix(in srgb, var(--court-accent, transparent) 6%, var(--bg-card)); }
body .side-court-card[class*="court-"] .side-court-header { background: color-mix(in srgb, var(--court-accent, transparent) 12%, var(--bg-card)); }

/* =====================================================================
   Dialoge der Turnierleitung (Logins, Backup, Spieler & Status, Statistiken, Setup ...)
   im Tafel-Design: Kopf als Schiefergrau-Band mit roter Kante, "Schliessen" als Textknopf.
   ===================================================================== */
body .modal-content { border-radius: var(--radius-md); }
body .modal-content > .card-header, body .modal-header {
  --text-main: var(--shell-text); --text-muted: var(--shell-muted); --text-dim: var(--shell-muted);
  --border-color: var(--shell-line); --bg-card: var(--shell-bg);
  --btn-secondary-bg: var(--shell-btn-bg); --btn-secondary-color: var(--shell-text); --btn-secondary-hover: var(--shell-btn-hover);
  background: var(--shell-bg) !important; color: var(--shell-text);
  border-bottom: 0 !important; box-shadow: inset 0 -4px 0 var(--ricochet-red) !important; padding-bottom: calc(1.25rem + 4px) !important; border-radius: 0 !important;
}
body .modal-content > .card-header .card-title, body .modal-header .card-title,
body .modal-content > .card-header h2, body .modal-content > .card-header h3 {
  color: var(--shell-text) !important; text-transform: uppercase; font-style: italic; font-weight: 800;
}
body .modal-content > .card-header .btn, body .modal-header .btn { border-color: var(--shell-line) !important; color: var(--shell-text) !important; }
body .modal-close-x { width: auto; min-width: 0; padding: 0 0.9rem; font-size: 0.95rem; font-weight: 700; }

/* Statistik-Tabs wie die Tabs der Turnierleitung: kursiv, aktiver Tab mit roter Unterkante */
body .stats-tab-nav-btn[class] {
  background: transparent !important; color: var(--text-muted) !important; border: 0 !important; box-shadow: none !important;
  font: italic 800 1.05rem var(--font-sans); padding: 0.55rem 1rem; border-radius: 0;
}
body .stats-tab-nav-btn[class]:hover { color: var(--text-main) !important; }
body .stats-tab-nav-btn[class].active { color: var(--text-main) !important; box-shadow: inset 0 -4px 0 var(--ricochet-red) !important; }

/* Trivia & Rekorde: ruhige Karten, Name gross, keine Regenbogen-Rahmen */
body .trivia-spot { background: var(--bg-surface-2); border-radius: var(--radius-md); padding: 1.5rem 1.75rem; margin-bottom: 1.5rem; }
body .trivia-tag { font: italic 800 0.82rem var(--font-sans); text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
body .trivia-player { font: italic 800 2.4rem/1.1 var(--font-sans); color: var(--text-main); margin: 0.2rem 0 0.6rem; }
body .trivia-mini { padding: 1rem; cursor: pointer; border: 1px solid var(--border-color); background: var(--bg-card); box-shadow: none; }
body .trivia-mini:hover { background: var(--bg-card-hover); }
body .trivia-mini.is-selected { background: var(--bg-surface-2); box-shadow: inset 0 -4px 0 var(--ricochet-red); }
body .trivia-mini-title { font: italic 800 0.78rem var(--font-sans); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 0.35rem; }
body .status-badge.status-offline { color: var(--danger-text); }
/* Court-Status in der Turnierleitung als ruhige Fuellung statt umrandeter Pille */
body .status-warmup-pulse[class] { background: color-mix(in srgb, var(--color-warning) 16%, transparent) !important; color: var(--color-warning) !important; border: 0 !important; border-radius: 3px; }
body .status-ready-pulse[class] { background: color-mix(in srgb, var(--color-success) 14%, transparent) !important; border: 0 !important; border-radius: 3px; }
body .status-waiting-pulse[class] { background: var(--bg-surface-2) !important; border: 0 !important; border-radius: 3px; }

/* Tablet-Anmeldestatus in der Court-Uebersicht: nur Text, kein Leuchtpunkt */
body [data-court-login]::before { display: none !important; }

/* Gaeste-QR-Code in der Kopfzeile (core.js mountGuestQr) */
.guest-qr { display: inline-flex; align-items: center; --guest-qr-size: 46px; }
.guest-qr-btn { display: inline-flex; align-items: center; gap: 0.45rem; background: transparent; border: 0;
  padding: 0; cursor: pointer; color: inherit; font: inherit; }
.guest-qr-img { width: var(--guest-qr-size); height: var(--guest-qr-size); background: #fff; padding: 3px;
  border-radius: 6px; display: block; box-sizing: border-box; }
.guest-qr-label { font-size: 0.72rem; font-weight: 700; line-height: 1.1; max-width: 5.5em; text-align: left;
  color: var(--text-muted, #888); text-transform: uppercase; letter-spacing: 0.03em; }
.guest-qr-overlay { position: fixed; inset: 0; z-index: 10000; background: rgba(0,0,0,0.72);
  display: flex; align-items: center; justify-content: center; cursor: pointer; }
.guest-qr-card { background: #fff; color: #141719; border-radius: 16px; padding: 1.5rem 1.5rem 1.1rem;
  text-align: center; max-width: 90vw; }
.guest-qr-card img { width: min(70vmin, 520px); height: min(70vmin, 520px); display: block; margin: 0 auto; }
.guest-qr-card-title { font-size: 1.4rem; font-weight: 800; margin-top: 0.6rem; text-transform: uppercase; }
.guest-qr-card-url { font-family: monospace; font-size: 1rem; margin-top: 0.3rem; word-break: break-all; }
@media print { .guest-qr { display: none !important; } }
