/* ══════════════════════════════════════════════════════════════════════
   Turnierplan-Optik (.tp-*)

   Stammt aus der frueheren eigenstaendigen Turnierplan-Seite. Seit die
   Spielerseite Spieler UND Zuschauer bedient, gibt es diese Seite nicht
   mehr — die Klassen sind hierher gezogen, weil nur noch die Spielerseite
   sie benutzt. Was ausschliesslich zur alten Seite gehoerte (eigener
   Rahmen, Fusszeile, Code-Eingabe, eigene Tab-Leiste, Ranglisten, Legende,
   Ladeanzeige), ist dabei entfallen.

   Steht bewusst GANZ OBEN: frueher lud index.html turnierplan.css VOR
   player.css, und weiter unten in dieser Datei stehen Regeln, die .tp-*
   gezielt uebersteuern. Ans Ende gehaengt wuerden sie diese Uebersteuerung
   aushebeln.

   Das Praefix .tp- bleibt: es steckt an vielen Stellen in player.js, und
   Umbenennen waere Bewegung ohne Gewinn.
   ══════════════════════════════════════════════════════════════════════ */
.tp-micon {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  vertical-align: -0.18em;
  font-size: 1.2em;
  -webkit-font-smoothing: antialiased;
}

/* ── Kopf ───────────────────────────────────────────────────────────────── */
.tp-header {
  background: linear-gradient(135deg, var(--c-midnight), var(--c-crimson));
  color: var(--c-silk);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  box-shadow: var(--shadow-md);
  /* Kleiner Abstand nach unten, damit das direkt folgende Element (MVP-Banner
     oder Tab-Leiste) nicht an der Übersichts-Karte klebt. */
  margin-bottom: 14px;
}
.tp-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-almond);
  background: rgba(245, 208, 197, 0.10);
  border: 1px solid rgba(245, 208, 197, 0.22);
  padding: 5px 11px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.tp-title {
  font-size: 2rem;
  line-height: 1.1;
  margin: 0 0 4px;
  color: #fff;
  letter-spacing: -0.02em;
}
.tp-kind {
  color: var(--c-almond);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 16px;
}
.tp-date {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.95rem;
  color: var(--c-silk);
  margin-bottom: 18px;
}
.tp-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tp-info-chip {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: rgba(245, 208, 197, 0.10);
  border: 1px solid rgba(245, 208, 197, 0.18);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}
.tp-info-label {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-almond);
  font-weight: 700;
}
.tp-info-value {
  font-size: 0.86rem;
  color: #fff;
  font-weight: 600;
}

.tp-section-head { margin-bottom: 14px; }
.tp-section-title {
  font-size: 1.3rem;
  margin: 0;
  color: var(--c-midnight);
  letter-spacing: -0.01em;
}
.tp-section-sub {
  margin: 3px 0 0;
  color: var(--c-muted);
  font-size: 0.88rem;
}
.tp-card { padding: 6px 0; overflow: hidden; }

/* ── Spiel-Zeilen (Vorrunde + Finalrunde) ───────────────────────────────── */
.tp-matchlist { display: flex; flex-direction: column; }
.tp-match {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-areas:
    "meta meta meta"
    "a    score b";
  align-items: center;
  gap: 6px 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--c-border);
}
.tp-match:last-child { border-bottom: none; }
/* Laufende Spiele hervorheben: heller Grund (kein Balken an der Seite — der
   „Live"-Header oben kennzeichnet sie). Zusätzlich stehen sie ganz oben. */
.tp-match.is-live {
  background: var(--c-surface-2);
}
.tp-match.is-live .tp-match-meta { color: var(--c-reddish); }
/* Vorrunde als zwei getrennte Karten (Live / kommend) mit kleiner Lücke
   dazwischen — die Lücke ist echter Seiten-Hintergrund (keine eigene Farbe),
   beide Karten sind abgerundet. */
.tp-vorrunde {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* Farbiger „Live"-Header über den laufenden Spielen — füllt den oberen Rand
   der Karte und kennzeichnet die Live-Spiele klar. */
/* Header bündig oben, letzte Live-Zeile bündig unten (kein weißer Streifen am
   unteren Rand) — die Karten-Rundung klemmt die Ecken sauber ab. */
.tp-matchlist.has-live-header { padding: 0; }
.tp-live-header {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  background: var(--c-reddish);
  color: #fff;
  font-weight: 800;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tp-match-meta {
  grid-area: meta;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  color: var(--c-muted);
}
.tp-team {
  font-weight: 600;
  color: var(--c-text);
  min-width: 0;
  overflow-wrap: anywhere;
}
.tp-team.a { grid-area: a; text-align: right; }
.tp-team.b { grid-area: b; display: flex; align-items: center; }
.tp-team.b .tp-team-name { min-width: 0; overflow-wrap: anywhere; }
/* Zeilen-Status ganz rechts außen: Live-Punkt (laufend) bzw. Häkchen
   (abgeschlossen) sitzen an derselben Position. */
.tp-match-status {
  margin-left: auto;
  flex: 0 0 auto;
}
/* Roter, pulsierender Live-Punkt (auf hellem Zeilen-Grund). */
.tp-match-livedot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--c-reddish);
  animation: tp-pulse-red 1.6s infinite;
}
@keyframes tp-pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(142, 68, 61, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(142, 68, 61, 0); }
  100% { box-shadow: 0 0 0 0 rgba(142, 68, 61, 0); }
}
/* Häkchen für abgeschlossene Spiele — gleiche Stelle wie der Live-Punkt. */
.tp-match-checkmark {
  color: var(--c-reddish);
  font-weight: 800;
  font-size: 1rem;
  line-height: 1;
}
/* Smartphone: Zeilen-Status ganz nach links – aus dem Team-B-Feld herausgelöst
   und absolut am linken Rand der Spielzeile, mittig zur Team-/Score-Reihe. */
@media (max-width: 620px) {
  .tp-match-status {
    position: absolute;
    left: 16px;
    bottom: 25px;
    margin: 0;
  }
}
/* Gewinner: dunkler + fetter (das Häkchen sitzt jetzt rechts außen, nicht mehr
   am Namen). */
.tp-team.win { color: var(--c-midnight); font-weight: 800; }
/* Score: Punkte groß & mittig, Sätze etwas kleiner daneben. */
.tp-score {
  grid-area: score;
  justify-self: center;
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  background: var(--c-midnight);
  border-radius: var(--radius-sm);
  padding: 4px 11px;
}
.tp-score-pts {
  font-size: 1.18rem;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}

@media (max-width: 620px) {
  .tp-standings-grid { grid-template-columns: 1fr; }
}
.tp-standings { padding: 0; }
.tp-standings-head {
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--c-border);
}
.tp-group-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--c-reddish);
  border-radius: 999px;
  padding: 3px 12px;
}

/* ── Teams (Mannschaften + Spieler) ─────────────────────────────────────── */
.tp-teams-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 620px) {
  .tp-teams-grid { grid-template-columns: 1fr; }
}
.tp-team-card { padding: 14px 16px 16px; }
.tp-team-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.tp-team-card-count {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--c-muted);
  white-space: nowrap;
}
.tp-team-roster { display: flex; flex-wrap: wrap; gap: 6px; }
.tp-player-chip {
  background: var(--c-silk);
  color: var(--c-midnight);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 0.82rem;
  font-weight: 600;
}
.tp-team-empty { margin: 0; color: var(--c-muted); font-size: 0.85rem; }
.tp-standings table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.tp-standings th,
.tp-standings td {
  padding: 8px 4px;
  text-align: center;
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
}
.tp-standings th {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-muted);
  font-weight: 700;
}
.tp-standings tbody tr:last-child td { border-bottom: none; }
.tp-th-pl, .tp-td-pl { width: 26px; padding-left: 12px; }
.tp-th-team, .tp-td-team {
  text-align: left;
  font-weight: 600;
  color: var(--c-midnight);
  white-space: normal;
  overflow-wrap: anywhere;
  width: 99%;
}
.tp-td-baelle { color: var(--c-muted); font-variant-numeric: tabular-nums; }
.tp-th-pkt, .tp-td-pkt { font-weight: 800; color: var(--c-midnight); padding-right: 12px; }
.tp-advances td { background: rgba(203, 145, 115, 0.16); }
.tp-advances .tp-td-pl {
  position: relative;
  font-weight: 800;
  color: var(--c-reddish);
}
.tp-advances .tp-td-pl::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--c-reddish);
}

/* ── Finalrunde ─────────────────────────────────────────────────────────── */
.tp-round-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-reddish);
  padding: 14px 16px 6px;
}
.tp-round-label .tp-micon { font-size: 1.2rem; color: var(--c-almond); }
.tp-matchlist-inner .tp-match { padding-top: 8px; padding-bottom: 8px; }

/* Vorrunde: pro Uhrzeit ein eigener kleiner Block (eigene Karte) statt einer
   langen Liste. Die Luecke zwischen den Bloecken macht .tp-vorrunde (gap).
   Die Uhrzeit-Ueberschrift sitzt kompakt oben in der Karte. */
.tp-slot-card .tp-round-label { padding-top: 10px; }

/* ── Phasen-Badge im Kopf ───────────────────────────────────────────────── */
.tp-phase-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.82rem; font-weight: 700;
  color: var(--c-almond);
  background: rgba(245, 208, 197, 0.12);
  border: 1px solid rgba(245, 208, 197, 0.22);
  padding: 4px 12px;
  border-radius: 999px;
}
.tp-phase-badge.is-live { color: #fff; background: var(--c-reddish); border-color: var(--c-reddish); }
.tp-live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
  animation: tp-pulse 1.6s infinite;
}
@keyframes tp-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.6); }
  70% { box-shadow: 0 0 0 7px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

/* Offenes (noch nicht gespieltes) Ergebnis. */
.tp-score.open { background: var(--c-surface-2); border: 1px solid var(--c-border); }
.tp-score.open .tp-score-pts { font-size: 0.82rem; font-weight: 700; color: var(--c-muted); letter-spacing: 0; }
/* Laufendes Spiel: der laufende Satzstand in der dunklen Pille, die gewonnenen
   Sätze bei Mehrsatz in je einem eigenen kleinen, hellen Feld links & rechts
   daneben. Der Live-Punkt sitzt separat rechts außen (siehe .tp-match-livedot). */
.tp-live-score {
  grid-area: score;
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tp-set-badge {
  flex: 0 0 auto;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  color: var(--c-midnight);
  font-weight: 800;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  border-radius: 8px;
  padding: 4px 9px;
  min-width: 24px;
  text-align: center;
  line-height: 1.1;
}

/* Mobile-Gesten einschränken: kein Pinch-/Doppeltipp-Zoom, kein
   horizontales Scrollen oder Wegziehen. Vertikales Scrollen bleibt
   normal. Greift nur auf der Spielerseite — Admin/Score/Home haben
   andere Stylesheets. */
html, body {
  /* clip (statt hidden): schneidet horizontalen Überlauf ab, macht das
     Element aber NICHT zum Scroll-Container — so bleibt vertikales Scrollen
     normal. (overflow-x: hidden hatte das Seiten-Scrollen blockiert.) */
  overflow-x: clip;
  overscroll-behavior-x: none;
  touch-action: pan-y;
}

.player-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

.player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 12px;
  /* Auf schmalen Screens darf die User-Leiste in die naechste Zeile rutschen,
     damit "Abmelden"/"Turnier wechseln" nicht ueber den Rand abgeschnitten werden. */
  flex-wrap: wrap;
}
.player-header .logo {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--c-midnight);
  /* Ist ein Link zur Startseite („/") — wie Text aussehen lassen. */
  text-decoration: none;
  cursor: pointer;
}
.player-header .logo:hover { opacity: 0.85; }
.player-header .logo .accent { color: var(--c-reddish); }
.player-header .user {
  font-size: 0.9rem;
  color: var(--c-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
}
.player-header .logo { flex-shrink: 0; }
/* Linke Seite: Logo oben, Turniername als eigene Zeile darunter. */
.player-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 0;
  flex-shrink: 1;
}
.tournament-chip {
  font-weight: 700;
  color: var(--c-reddish);
  font-size: 0.9rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.tournament-chip:empty { display: none; }

.hero {
  text-align: center;
  padding: 36px 16px 28px;
}
.hero h1 {
  font-size: 2.1rem;
  margin-bottom: 8px;
}
.hero p {
  color: var(--c-muted);
  margin: 0;
}

.register-card {
  max-width: 420px;
  margin: 8px auto 0;
}
.register-card .field {
  margin-bottom: 14px;
}
.register-card button {
  width: 100%;
  padding: 14px 18px;
  font-size: 1rem;
}

/* Geschlechts-Umschalter (Mann/Frau) unter dem Namensfeld — die zwei Knöpfe
   stehen NEBENEINANDER, nicht in voller Breite wie die anderen Karten-Buttons.
   Optik wie der Umschalter im Admin-Cockpit (.gender-btn). */
.gender-toggle { display: flex; gap: 8px; }
.register-card .gender-toggle button {   /* die 100%-Breite/14px-Polster-Regel oben zurücknehmen */
  width: auto;
  flex: 1;
  padding: 11px 12px;
  font-size: 0.98rem;
}
.gender-btn {
  background: var(--c-surface);
  color: var(--c-midnight);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
}
/* Generischen button:hover (crimson-Fill aus theme.css) hier zurücknehmen. */
.gender-btn:hover { background: var(--c-surface-2); color: var(--c-midnight); border-color: var(--c-almond); }
.gender-btn.selected,
.gender-btn.selected:hover {
  background: var(--c-almond);
  color: var(--c-midnight);
  border-color: var(--c-almond);
}

/* Persönlicher Hinweis über dem Namensfeld, sobald man eingeloggt beitritt:
   fordert zum Wählen (bzw. Bestätigen) des dauerhaften Spielernamens auf.
   Helle Peach-Fläche wie das MVP-Banner, mit Akzent-Kante links. */
.account-name-hint {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-left: 3px solid var(--c-almond);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  margin-bottom: 14px;
}
.account-name-hint p {
  margin: 0;
  color: var(--c-midnight);
  font-size: 0.92rem;
  line-height: 1.45;
}
.account-name-hint .account-name-hint-sub {
  margin-top: 6px;
  color: var(--c-muted);
  font-size: 0.85rem;
}

/* Zweiter Weg unter der Anmeldekarte: derselbe Link führt Spieler und Gäste
   hierher. Bewusst ohne weiße Karte und mit Geist-Knopf — die Anmeldung soll
   der Hauptweg bleiben, Zuschauen die leise Alternative. */
.guest-block {
  max-width: 420px;
  margin: 18px auto 0;
  text-align: center;
}
.guest-block p {
  color: var(--c-muted);
  font-size: 0.88rem;
  margin: 0 0 10px;
}
.guest-block .guest-btn {
  width: 100%;
  padding: 12px 18px;
  font-size: 0.95rem;
  background: transparent;
  border: 1px solid var(--c-border);
}

/* „Turnier beitreten" + QR-Scan-Button — außerhalb des weißen Feldes. */
.player-action-row {
  max-width: 420px;
  margin: 12px auto 0;
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.player-action-row button.btn-primary {
  flex: 1;
  width: auto;
  padding: 14px 18px;
  font-size: 1rem;
}
.player-scan-btn {
  flex: 0 0 auto;
  width: 54px;
  aspect-ratio: 1;
  padding: 0;
  justify-content: center;
}
.player-scan-btn .micon { font-size: 1.6rem; margin: 0; }

/* Vollbild-Kamera-Overlay zum Scannen des Turnier-QR-Codes. */
.player-scan-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #160810;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 24px;
}
.player-scan-head {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--c-silk);
  font-weight: 700;
  font-size: 1.15rem;
}
.player-scan-stage {
  position: relative;
  width: min(82vw, 340px);
  aspect-ratio: 1;
  border-radius: 18px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.55);
}
.player-scan-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.player-scan-frame {
  position: absolute;
  inset: 14%;
  border: 3px solid rgba(245, 208, 197, 0.92);
  border-radius: 14px;
  pointer-events: none;
}
.player-scan-status {
  color: var(--c-silk);
  font-size: 0.95rem;
  text-align: center;
  max-width: 320px;
  line-height: 1.45;
  min-height: 1.4em;
}
.player-scan-status.is-error { color: #ffb4a8; }
.player-scan-cancel {
  color: var(--c-silk);
  background: rgba(245, 208, 197, 0.10);
  border: 1px solid rgba(245, 208, 197, 0.35);
  padding: 12px 30px;
}
.player-scan-cancel:hover { background: rgba(245, 208, 197, 0.20); }

/* Tabs im Stil der öffentlichen Zuschauerseite (Turnierplan): einzelne
   umrandete Pillen statt Segmented-Control. */
/* Tab-Leiste bleibt IMMER einzeilig und scrollt bei Bedarf horizontal —
   kein Umbruch in eine zweite Zeile. */
.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  /* Der globale Scrollbalken aus theme.css (11px hoch) saehe unter den Tabs
     wie ein Fehler aus — hier ausblenden, gewischt wird trotzdem. */
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  /* Aus der seitlichen 16px-Polsterung der .player-shell ausbrechen, damit die
     Leiste beim Wischen wirklich bis an den Displayrand laeuft. Das gleich
     grosse Innen-Padding haelt ersten und letzten Tab buendig zum uebrigen
     Inhalt, solange nicht gescrollt ist. Beide Werte gehoeren zusammen — wird
     die Polsterung der .player-shell geaendert, hier mitziehen. */
  margin: 0 -16px 18px;
  padding: 0 16px 2px;
}
.tabs::-webkit-scrollbar { display: none; }
/* Ohne das quetscht Flex die Buttons zusammen, statt sie ueberlaufen zu lassen. */
.tabs button { flex: 0 0 auto; }
.tabs button {
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--c-muted);
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: 999px;
  padding: 9px 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
/* Generischen button:hover (crimson-Fill aus theme.css) hier zurücknehmen. */
.tabs button:hover {
  background: var(--c-surface-2);
  color: var(--c-midnight);
  border-color: var(--c-almond);
}
.tabs button.active,
.tabs button.active:hover {
  background: var(--c-crimson);
  color: #fff;
  border-color: var(--c-crimson);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.match-card {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 16px;
  margin-bottom: 10px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.match-card.mine {
  border-color: var(--c-almond);
  background: linear-gradient(180deg, #ffe9dc, var(--c-surface));
}
.match-card.live {
  border-color: var(--c-reddish);
  box-shadow: 0 0 0 3px rgba(203, 145, 115, 0.18);
}
.match-side {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.match-side.right { justify-content: flex-end; }
.match-side .name {
  font-size: 0.98rem;
  color: var(--c-midnight);
}
.match-side .group {
  font-size: 0.7rem;
  color: var(--c-muted);
}
.match-score {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--c-midnight);
  font-variant-numeric: tabular-nums;
}
.match-score.placeholder {
  color: var(--c-muted);
  font-weight: 500;
  font-size: 0.85rem;
}
.match-meta {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--c-muted);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--c-border);
}

.team-card {
  margin-bottom: 10px;
}
.team-card .team-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.team-card .players {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.team-card .player-chip {
  background: var(--c-silk);
  color: var(--c-crimson);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.team-card.team-card-mine-dark {
  background: var(--c-midnight);
  color: var(--c-silk);
  border-color: var(--c-crimson);
  box-shadow: 0 8px 24px rgba(50, 10, 40, 0.25);
}
.team-card.team-card-mine-dark .team-head h2,
.team-card.team-card-mine-dark .team-head h3 {
  color: var(--c-silk);
}
.team-card.team-card-mine-dark .tag {
  background: var(--c-almond);
  color: var(--c-midnight);
  border-color: var(--c-almond);
}
.team-card.team-card-mine-dark .player-chip {
  background: var(--c-crimson);
  color: var(--c-silk);
}

.standings-table th, .standings-table td {
  padding: 8px 10px;
  font-size: 0.92rem;
}
.standings-table td.team { font-weight: 600; color: var(--c-midnight); }
.standings-table td.num { text-align: center; font-variant-numeric: tabular-nums; }
.standings-table tr.advances { background: rgba(203, 145, 115, 0.12); }
.standings-table tr.mine { background: rgba(77, 36, 61, 0.15); }
.standings-table tr.mine.advances { background: rgba(77, 36, 61, 0.22); }
.standings-table tr.mine td.team { color: var(--c-midnight); font-weight: 700; }

.bracket {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 12px;
}
.bracket-round {
  min-width: 200px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 12px;
}
.bracket-round .round-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-muted);
  font-weight: 700;
  text-align: center;
  margin-bottom: 4px;
}
.bracket-match {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 0.88rem;
  box-shadow: var(--shadow-sm);
}
.bracket-match .bracket-match-meta {
  font-size: 0.72rem;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
}
.bracket-match .team-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
}
.bracket-match .team-row.winner {
  font-weight: 700;
  color: var(--c-midnight);
}
.bracket-match .team-row.winner .crown {
  color: var(--c-almond);
}
.bracket-match .team-row.loser {
  color: var(--c-muted);
}
.bracket-match.placeholder-match {
  background: var(--c-surface-2);
  border-style: dashed;
}
.bracket-match.placeholder-match .team-row.placeholder-team {
  color: var(--c-muted);
  font-style: italic;
}

.waiting-state {
  text-align: center;
  padding: 60px 20px;
}
.waiting-state .spinner {
  margin: 0 auto 16px;
}


.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.section-title h2 { margin: 0; }

/* „Dein nächstes Spiel" ist bewusst eine helle INHALTS-Karte und kein zweiter
   Kopfbereich. Vorher war der Block dunkel (midnight) und damit vom dunklen
   tp-Header darüber kaum zu unterscheiden — gestapelt wirkte das wie zwei
   Header. Jetzt normale Kartenfläche mit Akzentkante links; die Hierarchie ist
   damit eindeutig: dunkler Kopf = Turnier-Identität, helle Karte = Inhalt.
   Die Textfarben sind echte Farben statt der früheren opacity-Abstufungen —
   die funktionierten nur auf dunklem Grund. */
.my-next {
  background: var(--c-surface);
  color: var(--c-text);
  border: 1px solid var(--c-border);
  padding: 16px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  /* Gleicher Abstand nach oben (Kopfbereich) wie nach unten (Tab-Auswahl). */
  margin: 18px 0;
  transition: transform 0.08s ease, box-shadow 0.15s ease;
}
.my-next.clickable {
  cursor: pointer;
}
.my-next.clickable:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: var(--c-almond);
}
.my-next.clickable:active { transform: translateY(0); }
.my-next .next-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.my-next .label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--c-reddish);
}
.my-next .tap-hint {
  font-size: 0.74rem;
  color: var(--c-muted);
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.my-next .opponent {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--c-midnight);
  margin-bottom: 4px;
}
.my-next .meta {
  font-size: 0.88rem;
  color: var(--c-muted);
}

.live-section {
  margin-bottom: 18px;
  padding: 14px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.live-section .live-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-weight: 700;
  color: var(--c-crimson);
  font-size: 0.92rem;
}
.live-card {
  background: linear-gradient(180deg, rgba(255, 233, 220, 0.5), var(--c-surface));
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 8px;
  position: relative;
}
.live-card:last-child { margin-bottom: 0; }
.live-card.mine {
  border-color: var(--c-almond);
  box-shadow: 0 0 0 2px rgba(203, 145, 115, 0.18);
}
.live-card .live-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.76rem;
}
.live-card .live-round {
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}
.live-card .live-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}
.live-card .live-team {
  font-weight: 600;
  font-size: 1rem;
  color: var(--c-text);
}
.live-card .live-team.lead { color: var(--c-midnight); font-weight: 800; }
.live-card .live-score {
  font-size: 1.6rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--c-muted);
  line-height: 1;
}
.live-card .live-score.lead {
  color: var(--c-reddish);
}
/* Multi-Set: rechts neben den Hauptzahlen (gewonnene Sätze) sitzt als
   kleinere Sub-Zahl der aktuelle Satzstand in Punkten. */
.live-card .live-score-box {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.live-card .live-score-sub {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--c-muted);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  min-width: 1.4ch;
  text-align: right;
}

.modal-team-head {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.modal-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.modal-chip-list .player-chip {
  background: var(--c-silk);
  color: var(--c-crimson);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
}
.team-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}
.stat-tile {
  background: var(--c-silk);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  text-align: center;
}
.stat-tile-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--c-midnight);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.stat-tile-label {
  font-size: 0.74rem;
  color: var(--c-crimson);
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

/* ── Turnierplan-Bausteine auf der Spielerseite ─────────────────────────────
   Die Spielplan-/Tabellen-Ansicht nutzt die .tp-*-Optik der öffentlichen
   Turnierplan-Seite (turnierplan.css). Ergänzt hier: die Hervorhebung des
   EIGENEN Teams/Spiels — die Zuschauerseite kennt kein „mein Team". */
.tp-match.is-mine { background: linear-gradient(90deg, rgba(203, 145, 115, 0.16), transparent 70%); }
.tp-match.is-mine::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--c-almond);
}
.tp-standings tr.is-mine td { background: rgba(77, 36, 61, 0.10); }
.tp-standings tr.is-mine.tp-advances td { background: rgba(77, 36, 61, 0.17); }
.tp-standings tr.is-mine .tp-td-team { font-weight: 800; color: var(--c-midnight); }
/* Eigener Spieler in der Mannschaftsliste hervorgehoben. */
.tp-player-chip.is-me { background: var(--c-crimson); color: #fff; }

/* In den Team-Karten trägt der TEAMNAME das farbige Badge (.tp-group-badge),
   die Gruppe steht schlicht daneben — auf der Zuschauerseite ist es umgekehrt. */
.tp-team-card-group {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--c-midnight);
}


/* „Mit Konto einloggen" unter dem Beitritts-Button (Sekundär-Look), damit es
   sich klar vom primären „Beitreten" abhebt. */
.register-card .account-login-btn {
  margin-top: 8px;
  background: transparent;
  border: 1px solid var(--c-border);
  color: var(--c-crimson);
}
.register-card .account-login-btn:hover { background: var(--c-surface-2); }
/* Gast-Hinweistext sitzt jetzt UNTER dem Gast-Knopf (statt darüber). */
.guest-block .guest-hint { margin: 10px 0 0; }

/* ── MVP-Wahl ─────────────────────────────────────────────────────────── */
/* Banner unter dem Header — helle Peach-Fläche wie die Turnier-Phase-Karte im
   Cockpit; links Text, rechts der orange „MVP wählen"-Knopf. */
.mvp-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  box-shadow: 0 7px 18px rgba(50, 10, 40, 0.08);
  padding: 12px 16px;
  margin-bottom: 24px;
}
.mvp-banner-text { min-width: 0; display: flex; flex-direction: column; }
.mvp-kicker {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--c-reddish);
}
.mvp-title {
  font-size: 1.02rem; font-weight: 700; color: var(--c-midnight); margin-top: 2px;
}
.mvp-action {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit; font-size: 0.92rem; font-weight: 700;
  padding: 9px 16px; border-radius: 999px;
  border: none; cursor: pointer;
  background: var(--c-mvp); color: #fff;
  box-shadow: 0 4px 12px rgba(211, 116, 40, 0.28);
  transition: background 0.12s ease, transform 0.05s ease;
  white-space: nowrap;
}
.mvp-action:hover { background: var(--c-mvp-dark); }
.mvp-action:active { transform: translateY(1px); }
.mvp-arrow { font-size: 0.85em; }
/* Nach der Wahl: heller Knopf mit orangem Rand + Trophäe — bleibt ANKLICKBAR,
   ein Tipp öffnet die Auswahl erneut, um die Wahl zu ändern. */
.mvp-action-chosen {
  background: var(--c-surface); color: var(--c-mvp-dark);
  border: 1.5px solid var(--c-mvp); box-shadow: none;
}
.mvp-action-chosen:hover { background: #fff4ec; }
.mvp-action-chosen .micon { font-size: 1.1rem; color: var(--c-mvp); }
.mvp-action-name { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mvp-edit { opacity: 0.6; font-size: 0.9em; }

@media (max-width: 620px) {
  .mvp-banner { padding: 11px 13px; gap: 10px; }
  .mvp-title { font-size: 0.95rem; }
  .mvp-action { padding: 8px 13px; font-size: 0.88rem; }
  .mvp-action-name { max-width: 32vw; }
}

/* Auswahl-Popup */
.mvp-search {
  width: 100%; box-sizing: border-box;
  padding: 11px 14px; font-size: 1rem; font-family: inherit;
  border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  background: var(--c-surface); color: var(--c-text);
}
.mvp-search:focus { outline: none; border-color: var(--c-mvp); }
.mvp-results { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.mvp-result {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  width: 100%; text-align: left; font-family: inherit;
  padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--c-border); background: var(--c-surface);
  cursor: pointer; transition: border-color 0.1s ease, background 0.1s ease;
}
.mvp-result:hover { border-color: var(--c-almond); background: var(--c-surface-2); }
.mvp-result.is-selected { border-color: var(--c-mvp); background: #fff4ec; }
.mvp-result-name { font-weight: 600; color: var(--c-midnight); }
.mvp-result-team { font-size: 0.82rem; color: var(--c-muted); flex-shrink: 0; }
.mvp-result-empty { padding: 10px 4px; color: var(--c-muted); font-size: 0.9rem; }
.mvp-selected { margin-top: 12px; font-size: 0.95rem; color: var(--c-text); min-height: 1.2em; }
.mvp-selected-label { color: var(--c-muted); }
