html, body {
  height: 100%;
  background: var(--c-bg);
  color: var(--c-text);
  overscroll-behavior: none;
}

body {
  background:
    radial-gradient(1200px 600px at 100% 0%, rgba(203,145,115,0.18), transparent 70%),
    radial-gradient(900px 500px at 0% 100%, rgba(81,23,48,0.08), transparent 70%),
    var(--c-bg);
}

/* Im Zählmodus die Seite auf die dynamische Viewport-Höhe fixieren und
   Scrollen sperren. Sonst ist am Handy (iOS-Toolbar) der Body höher als der
   sichtbare Bereich → man kann darunter scrollen und der rosa
   Body-Hintergrund wird als Streifen sichtbar. */
html.score-scoring,
html.score-scoring body {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
/* Im Zählmodus keinen rosa Verlauf zeigen — der schimmerte oben im
   Statusleisten-Bereich (und rund um die Panels) als andersfarbiger Streifen
   durch. Weiß liegt HINTER dem Inhalt, verdeckt also nichts. */
html.score-scoring body {
  background: var(--c-surface);
}

.score-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.score-shell.scoring {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.score-area.fullscreen {
  flex: 1;
  min-height: 0;
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  position: relative;
  /* Kurz vor dem Vollbild schaltet .drawer-full-collapsed das Padding von 14px
     auf 0 (noetig, damit der Drawer den oberen Rand erreicht). Ohne Uebergang
     ruckt der Spielbereich dabei sichtbar nach oben — der kurze Uebergang
     glaettet diesen Sprung. */
  transition: padding 0.18s ease;
  /* Im zusammengeschobenen Zustand ist die Hoehe 0. Ohne overflow:hidden ragen
     die Team-Felder darueber hinaus, und weil .score-area positioniert ist
     (position:relative) liegt sie ueber dem statisch positionierten Drawer —
     dadurch blieb im Vollbild der untere Rand der Felder sichtbar. */
  overflow: hidden;
}

/* Multi-Set: kleines Quadrat mit gewonnenen Sätzen, eingebettet in die
   obere INNEN-Kante des jeweiligen Team-Panels. Team A bekommt es oben
   rechts, Team B oben links — so schließen die beiden Quadrate sauber
   am Gap zwischen den Panels an. Klicks bubblen aufs Panel und triggern
   wie gewohnt einen normalen Punkt. */
.team-panel { position: relative; }
.set-wins-square {
  position: absolute;
  top: 0;
  width: clamp(54px, 8vw, 80px);
  height: clamp(54px, 8vw, 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 800;
  background: var(--c-midnight);
  color: var(--c-silk);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  pointer-events: none; /* Klicks bubblen aufs Panel */
  z-index: 2;
}
.set-wins-square-a {
  right: 0;
  border-bottom-left-radius: 12px;
  border-top-right-radius: inherit;
}
.set-wins-square-b {
  left: 0;
  border-bottom-right-radius: 12px;
  border-top-left-radius: inherit;
}

.score-drawer {
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  box-shadow: 0 -4px 20px rgba(50, 10, 40, 0.10);
  display: flex;
  flex-direction: column;
  max-height: 64vh;
  max-height: 64dvh;
  transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  overflow: hidden;
  /* Dezent abgerundete obere Ecken (Bottom-Sheet-Optik). overflow:hidden
     oben sorgt dafuer, dass der Inhalt sauber mitbeschnitten wird. */
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
}
.score-drawer:not(.open) {
  max-height: 84px;
}
/* Ganz aufgezogen — bis zum oberen Bildschirmrand. height erzwingt das
   Füllen (auch bei wenig Inhalt), die animierte max-height macht den
   Übergang weich. Erreichbar ausschliesslich per Hochziehen der Griff-Leiste;
   Scrollen im Menue verschiebt den Drawer bewusst nicht. */
.score-drawer.full {
  max-height: 100dvh;
  height: 100dvh;
  /* Am oberen Bildschirmrand buendig abschliessen — sonst blitzt in den
     abgerundeten Ecken der Seitenhintergrund durch. */
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
/* Im Vollbild sitzt der Griff oben am Rand → Platz für die Statusleiste. */
.score-drawer.full .drawer-peek {
  padding-top: calc(18px + env(safe-area-inset-top));
}
.score-drawer.full .drawer-peek::before {
  top: calc(8px + env(safe-area-inset-top));
}
/* Bei ganz aufgezogenem Drawer den Spielbereich inkl. Padding auf 0
   zusammenschieben → der Drawer reicht wirklich bis zum oberen Rand. */
.score-area.fullscreen.drawer-full-collapsed {
  padding: 0;
  min-height: 0;
}
.drawer-peek {
  min-height: 84px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px 18px 10px;
  gap: 6px;
  cursor: pointer;
  background: transparent;
  border: none;
  flex-shrink: 0;
  position: relative;
  font-family: inherit;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
  text-align: center;
  touch-action: none;
}
/* NICHT ENTFERNEN und NICHT in eine Media-Query packen. Der generische
   button:hover-Fill aus theme.css ist mit (0,1,1) spezifischer als
   .drawer-peek (0,1,0) und wuerde die Leiste dunkelrot uebermalen. Auf iOS
   bleibt :hover nach einem Tipp haengen → die Leiste blieb dauerhaft dunkel.
   Eine (hover:hover)-Query matcht auf iOS NICHT, deshalb hat die frueher hier
   stehende Media-Query-Variante nichts genutzt. Gleiches Muster wie
   .pw-toggle in theme.css. */
.drawer-peek:hover,
.drawer-peek:focus,
.drawer-peek:active {
  background: transparent;
}
.drawer-peek .peek-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  width: 100%;
  /* Anker für den absolut rechts sitzenden Nachspielzeit-Knopf, während der
     Timer/Status mittig bleibt. */
  position: relative;
}
.drawer-peek::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 4px;
  background: var(--c-border);
  border-radius: 99px;
}
.drawer-peek .peek-status {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--c-midnight);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  line-height: 1.1;
}
.drawer-peek .peek-status.urgent {
  color: var(--c-reddish);
}
.drawer-peek .peek-status.expired {
  color: #b00020;
}
.drawer-peek .peek-status.round-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-reddish);
}
/* Läuft die Nachspielzeit („+M:SS"), hebt sie sich farblich ab. */
.drawer-peek .peek-status.nachspiel,
.timer.nachspiel {
  color: var(--c-reddish);
}

/* ── Nachspielzeit-Knopf (rechts in der Peek-Leiste, nur Zeitspiel) ─────────
   Gedrückt halten sammelt Zeit; der Status/Timer bleibt mittig, der Knopf
   sitzt absolut rechts. */
.nachspiel-btn {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 40px;
  padding: 7px 13px;
  border: 1px solid var(--c-almond);
  border-radius: 999px;
  background: var(--c-surface-2);
  color: var(--c-reddish);
  font-family: inherit;
  font-weight: 800;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  transition: transform 0.12s ease, background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.nachspiel-btn .micon {
  font-size: 1.15rem;
  line-height: 1;
}
/* Am Anfang ist das Label leer → ausblenden, damit der Knopf sauber nur das
   Symbol zeigt (kein Rest-Abstand aus dem flex-gap). */
.nachspiel-label:empty {
  display: none;
}
/* Eigene :hover/:focus, damit der generische button:hover-Fill aus theme.css
   (spezifischer als .nachspiel-btn allein) die Fläche nicht übermalt. */
.nachspiel-btn:hover,
.nachspiel-btn:focus {
  background: var(--c-surface-2);
  color: var(--c-reddish);
  outline: none;
}
/* Gehalten: kräftig eingefärbt + leicht kleiner (haptisches „gedrückt"). */
.nachspiel-btn.holding,
.nachspiel-btn:active {
  transform: translateY(-50%) scale(0.93);
  background: var(--c-reddish);
  color: #fff;
  border-color: var(--c-reddish);
}

/* Die „aufploppende" Zeit: kommt aus dem Knopf heraus, schwebt hoch und wird
   größer. Body-level + position:fixed, damit sie nicht am overflow:hidden der
   Leiste abgeschnitten wird. Startpunkt (left/top) setzt das Script auf die
   Knopf-Mitte. */
.nachspiel-pop {
  position: fixed;
  z-index: 200;
  transform: translate(-50%, -50%) scale(0.6);
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--c-reddish);
  color: #fff;
  font-weight: 900;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 10px 24px rgba(142, 68, 61, 0.45);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.18s ease;
}
.nachspiel-pop.show {
  opacity: 1;
  transform: translate(-50%, -150%) scale(1.7);
}
@media (prefers-reduced-motion: reduce) {
  .nachspiel-pop { transition: opacity 0.15s ease; }
  .nachspiel-pop.show { transform: translate(-50%, -150%) scale(1.4); }
}

.drawer-content {
  overflow-y: auto;
  flex: 1;
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--c-border);
}
.score-drawer:not(.open) .drawer-content {
  visibility: hidden;
}
/* Beim Ziehen ist der Inhalt schon sichtbar (nicht erst ab „open"), damit man
   ihn direkt mit hochkommen sieht statt einer leeren weißen Fläche. */
.score-drawer.dragging .drawer-content {
  visibility: visible;
}

.drawer-header-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--c-surface-2);
  border-bottom: 1px solid var(--c-border);
  font-size: 0.95rem;
}
.drawer-header-info .court-info { color: var(--c-midnight); }
.drawer-header-info .court-info strong { font-weight: 800; }
.drawer-header-info .court-info span { color: var(--c-muted); }
.drawer-header-info .unpair {
  background: transparent;
  color: var(--c-crimson);
  border: 1px solid var(--c-border);
  padding: 6px 12px;
  font-size: 0.82rem;
}
.drawer-header-info .unpair:hover {
  background: var(--c-silk);
  border-color: var(--c-almond);
  color: var(--c-midnight);
}

.score-pair {
  max-width: 480px;
  margin: 0 auto;
  padding: 48px 20px;
  width: 100%;
}
.score-pair h1 {
  color: var(--c-midnight);
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 8px;
}
.score-pair p.subtitle {
  color: var(--c-muted);
  text-align: center;
  margin: 0 0 28px;
  font-size: 0.95rem;
}
.score-pair .card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  color: var(--c-text);
}
.score-pair input {
  font-size: 1.8rem;
  text-align: center;
  letter-spacing: 0.5em;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  padding: 14px 0 14px 0.5em;
}
.score-pair input::placeholder {
  letter-spacing: 0.2em;
  color: var(--c-lilac, #c9b5b0);
  opacity: 0.5;
}
.score-pair button.btn-primary {
  width: 100%;
  padding: 16px;
  font-size: 1.05rem;
  margin-top: 16px;
}
.score-pair .hint {
  text-align: center;
  color: var(--c-muted);
  font-size: 0.82rem;
  margin-top: 18px;
}

/* „Verbinden" + QR-Scan-Button nebeneinander (Scan = kleines Quadrat rechts). */
.score-action-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-top: 16px;
}
.score-action-row button.btn-primary {
  flex: 1;
  width: auto;
  margin-top: 0;
}
.score-scan-btn {
  flex: 0 0 auto;
  width: 54px;
  aspect-ratio: 1;
  padding: 0;
  justify-content: center;
}
.score-scan-btn .micon { font-size: 1.7rem; margin: 0; }

/* Vollbild-Kamera-Overlay zum Scannen des Zähltafel-QR-Codes. */
.score-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;
}
.score-scan-head {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--c-silk);
  font-weight: 700;
  font-size: 1.15rem;
}
.score-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);
}
.score-scan-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.score-scan-frame {
  position: absolute;
  inset: 14%;
  border: 3px solid rgba(245, 208, 197, 0.92);
  border-radius: 14px;
  pointer-events: none;
}
.score-scan-status {
  color: var(--c-silk);
  font-size: 0.95rem;
  text-align: center;
  max-width: 320px;
  line-height: 1.45;
  min-height: 1.4em;
}
.score-scan-status.is-error { color: #ffb4a8; }
.score-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;
}
.score-scan-cancel:hover { background: rgba(245, 208, 197, 0.20); }

.score-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
}
.score-header .court-tag {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--c-midnight);
}
.score-header .court-tag .court-num {
  background: var(--c-midnight);
  color: var(--c-silk);
  padding: 4px 14px;
  border-radius: 8px;
  font-size: 0.95rem;
}
.score-header .unpair {
  background: transparent;
  color: var(--c-crimson);
  border: 1px solid var(--c-border);
  padding: 6px 12px;
  font-size: 0.82rem;
}
.score-header .unpair:hover {
  background: var(--c-silk);
  border-color: var(--c-almond);
  color: var(--c-midnight);
}
/* Aus dem Dashboard geöffnet: „← Zurück" und „Trennen" liegen nebeneinander.
   Die .unpair-Regeln oben greifen weiter (Nachfahren-Selektor). */
.exit-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}
/* Weg zurück zum Dashboard auf der Code-Eingabe (nur aus dem Dashboard). */
.pair-back-dash {
  display: block;
  margin: 22px auto 0;
}

.match-info {
  text-align: center;
  padding: 22px 16px 14px;
  background: var(--c-surface-2);
  border-bottom: 1px solid var(--c-border);
}
.match-info .round {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-reddish);
  font-weight: 700;
  margin-bottom: 6px;
}
.match-info .time {
  color: var(--c-muted);
  font-size: 0.9rem;
}

/* Multi-Set-Indikator: gewonnene Sätze als großes Verhältnis, darunter
   die Meta-Info (Set X von Y, Best of Z, Zielpunkte). */
.set-indicator {
  margin: 10px 0 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.set-wins {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  font-variant-numeric: tabular-nums;
}
.set-wins-num {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--c-midnight);
  min-width: 1.4ch;
  text-align: center;
}
.set-wins-divider {
  font-size: 1.2rem;
  color: var(--c-muted);
  font-weight: 700;
}
.set-wins-meta {
  font-size: 0.78rem;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.match-info .timer {
  font-size: clamp(3rem, 12vw, 5rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--c-midnight);
  margin: 6px 0;
  line-height: 1;
}
.match-info .timer.urgent {
  color: var(--c-reddish);
  animation: pulse-soft 1s ease-in-out infinite;
}
.match-info .timer.expired {
  color: #b00020;
}
@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

.pregame-teams {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 18px;
}
.pregame-team {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 18px;
  padding: 26px 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 140px;
}
.pregame-team .label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--c-reddish);
  font-weight: 700;
}
.pregame-team .name {
  font-size: clamp(1.4rem, 4.5vw, 1.9rem);
  font-weight: 800;
  color: var(--c-midnight);
  line-height: 1.15;
  word-break: break-word;
}
.pregame-team .group {
  margin-top: 2px;
  font-size: 0.82rem;
  color: var(--c-muted);
}
.pregame-team .pregame-players {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
  margin-top: 12px;
}
.pregame-team .pregame-players.empty {
  color: var(--c-muted);
  font-size: 0.78rem;
  font-style: italic;
}
.pregame-team .pregame-player {
  background: var(--c-silk);
  color: var(--c-crimson);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.start-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px 40px;
  gap: 24px;
}
.btn-start-big {
  background: var(--c-almond);
  color: var(--c-midnight);
  border: none;
  padding: 24px 44px;
  border-radius: 18px;
  font-size: 1.5rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(50, 10, 40, 0.18);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.05s ease, background 0.15s ease;
}
.btn-start-big:active { transform: scale(0.97); }
/* Der dunkelrote Farbwechsel NUR auf echten Zeigergeräten (Maus). Auf Touch
   klebt :active auf iOS Safari nach dem Antippen fest → der Button bliebe
   dauerhaft dunkelrot hängen. Die dezente Press-Skalierung bleibt überall. */
@media (hover: hover) and (pointer: fine) {
  .btn-start-big:active { background: var(--c-reddish); color: var(--c-silk); }
}
.start-gate .start-hint {
  color: var(--c-muted);
  font-size: 0.92rem;
  margin: 0;
  text-align: center;
}

.pregame-block {
  text-align: center;
  margin: 4px 0 16px;
}
.pregame-label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-reddish);
  font-weight: 700;
  margin-bottom: 6px;
}
.pregame-countdown {
  font-size: clamp(4rem, 18vw, 7rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--c-midnight);
  line-height: 1;
}
.pregame-countdown.urgent {
  color: var(--c-reddish);
  animation: pulse-soft 1s ease-in-out infinite;
}
.pregame-countdown.elapsed {
  color: var(--c-almond);
}

.no-match {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  color: var(--c-muted);
}
.no-match h2 {
  color: var(--c-midnight);
  margin-bottom: 8px;
}

.score-area {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 18px;
  align-items: stretch;
}

.team-panel {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.06s ease, background 0.12s ease, box-shadow 0.12s ease;
  outline: none;
}
.team-panel:focus-visible {
  box-shadow: 0 0 0 3px var(--c-almond), var(--shadow-sm);
}
.team-panel:active {
  transform: scale(0.985);
  background: var(--c-surface-2);
}
/* Das fuehrende Team bekommt bewusst KEINEN eigenen Rahmen mehr (frueher
   almond-farbener Rand + 2px-Ring). Es bleibt allein ueber die Punktefarbe
   hervorgehoben — siehe .team-panel.leading .score-display weiter unten. */
.team-panel .team-name {
  text-align: center;
  padding: 10px 12px;
  border-top: 1px dashed var(--c-border);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--c-midnight);
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Offener Drawer: die Panels sind dann so flach, dass der Teamname unten
   abgeschnitten wird — sichtbar blieb nur noch seine gestrichelte Trennlinie,
   denn die sitzt an der OBERkante des Namens. Deshalb Name samt Linie in
   diesem Zustand ausblenden; es bleibt der Spielstand.
   Bewusst visibility statt display:none: so bleibt das Layout stehen. Mit
   display:none wuerde der Name aus dem Fluss fallen und die Punktzahl im
   Moment des Einrastens sichtbar aufspringen. */
.score-area.drawer-open-compact .team-panel .team-name {
  visibility: hidden;
}
.team-panel .team-name.has-serve {
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
  text-decoration-color: var(--c-almond);
}
.team-panel .score-display {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(7rem, 32vw, 14rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  color: var(--c-midnight);
  padding: 16px 0 6px;
  line-height: 1;
}
.team-panel.leading .score-display { color: var(--c-reddish); }
.team-panel .score-display.undecided {
  /* "ANGABE" ist deutlich breiter als eine Punktzahl. Der fruehere Minimalwert
     von 2.4rem (38.4px) lag ueber 10vw und griff auf schmalen Displays immer —
     der Text skalierte also nicht mit und lief im Hochformat aus dem Feld
     (gemessen: 170px Text bei 165px Platz). Kleinere Basis + kleinerer
     vw-Anteil, damit er auch auf schmalen Geraeten hineinpasst. */
  font-size: clamp(1.3rem, 8.5vw, 3.2rem);
  color: var(--c-reddish);
  letter-spacing: 0.02em;
  font-weight: 800;
  text-transform: uppercase;
}

.minus-bar {
  padding: 8px 10px;
}
.minus-bar .minus {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--c-crimson);
  border: 1px solid var(--c-border);
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  padding: 10px 0;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: transform 0.05s ease, background 0.15s ease, color 0.15s ease;
}
.minus-bar .minus:active {
  transform: scale(0.97);
  background: var(--c-silk);
  color: var(--c-midnight);
}
.minus-bar .minus:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.action-bar {
  display: flex;
  gap: 10px;
  padding: 0 18px 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  background: var(--c-surface);
}
.action-bar button {
  flex: 1;
  padding: 16px 18px;
  font-size: 0.98rem;
  font-weight: 700;
  border-radius: 12px;
}
.action-bar .btn-finish {
  background: var(--c-almond);
  color: var(--c-midnight);
  border: none;
}
.action-bar .btn-secondary {
  background: var(--c-silk);
  color: var(--c-crimson);
  border: 1px solid var(--c-border);
}
/* Hover-Farbwechsel der Aktions-Buttons NUR auf echten Zeigergeräten (Maus).
   Auf Touch (iOS Safari) klebt :hover nach dem Antippen fest — sonst bliebe
   „Satz/Spiel beenden" dauerhaft DUNKELROT hängen. */
@media (hover: hover) and (pointer: fine) {
  .action-bar .btn-finish:hover { background: var(--c-reddish); color: var(--c-silk); }
  .action-bar .btn-secondary:hover { background: var(--c-almond); color: var(--c-midnight); }
}
.action-bar button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.action-bar button.btn-finish:not(:disabled) {
  box-shadow: 0 8px 20px rgba(203, 145, 115, 0.30);
}

.score-footer {
  text-align: center;
  padding: 10px 16px 16px;
  color: var(--c-muted);
  font-size: 0.78rem;
}

.message-row {
  padding: 12px 18px 14px;
}
.btn-message-admin {
  width: 100%;
  padding: 12px 16px;
  font-size: 0.92rem;
  font-weight: 700;
  background: var(--c-silk);
  color: var(--c-crimson);
  border: 1px solid var(--c-border);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.05s ease;
}
@media (hover: hover) and (pointer: fine) {
  .btn-message-admin:hover { background: var(--c-almond); color: var(--c-midnight); }
}
.btn-message-admin:active { transform: translateY(1px); }

/* Manueller Seitenwechsel-Button — sitzt jetzt über der Aktionsleiste und
   trägt die Trennlinie zum oberen Bereich (Reset/Beenden folgen ohne Linie). */
.sides-row {
  padding: 14px 18px 10px;
  border-top: 1px solid var(--c-border);
  background: var(--c-surface);
}
/* Vor dem Spiel sitzt der Seitenwechsel-Knopf direkt unter den Teams —
   ohne das Band/Trennlinie wie im Drawer. */
.sides-row.pregame-sides {
  border-top: none;
  background: transparent;
  padding: 0 18px 6px;
}
.btn-swap-sides {
  width: 100%;
  padding: 12px 16px;
  font-size: 0.92rem;
  font-weight: 700;
  background: var(--c-surface-2);
  color: var(--c-crimson);
  border: 1px solid var(--c-border);
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s ease, color 0.15s ease, transform 0.05s ease;
}
@media (hover: hover) and (pointer: fine) {
  .btn-swap-sides:hover { background: var(--c-almond); color: var(--c-midnight); }
}
.btn-swap-sides:active { transform: translateY(1px); }
/* Bewusst KEIN eingefärbter Aktiv-Zustand: der Knopf kannte nur den manuellen
   Kipp, nicht den automatischen Seitenwechsel nach jedem Satz — „nicht
   eingefärbt" hieß also nicht „nicht getauscht". Wie die Seiten stehen, sieht
   man an den Teams selbst; den Griff bestätigt ein Toast. */

.next-match {
  text-align: center;
  padding: 12px 16px;
  background: var(--c-surface-2);
  border-top: 1px solid var(--c-border);
  color: var(--c-muted);
  font-size: 0.88rem;
}
.next-match strong { color: var(--c-midnight); font-weight: 700; }

.queue-section {
  padding: 16px 18px;
  background: var(--c-surface-2);
  border-top: 1px solid var(--c-border);
}
.queue-section.empty {
  text-align: center;
  color: var(--c-muted);
  font-size: 0.88rem;
}
.queue-section.empty .queue-title { justify-content: center; }
.queue-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-reddish);
  font-weight: 700;
  margin-bottom: 12px;
}
.queue-count {
  background: var(--c-reddish);
  color: var(--c-silk);
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
}
.queue-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.queue-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  font-size: 0.92rem;
  color: var(--c-midnight);
}
.queue-item.next {
  background: linear-gradient(180deg, #ffe9dc, var(--c-surface));
  border-color: var(--c-almond);
}
.queue-item .queue-pos {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--c-reddish);
  letter-spacing: 0.05em;
  min-width: 60px;
}
.queue-item.next .queue-pos { color: var(--c-reddish); }
.queue-item .queue-teams { font-weight: 600; color: var(--c-midnight); }
.queue-item .queue-time {
  font-variant-numeric: tabular-nums;
  color: var(--c-muted);
  font-size: 0.86rem;
}
/* Auf-/Zuklappen der restlichen Spiele. Ist ein <button>; die beiden Klassen
   (0,2,0) sind spezifischer als die globalen button-Regeln (0,0,1) bzw.
   button:hover (0,1,1) aus theme.css, deren Fuellung damit nicht durchschlaegt.
   Akzentfarbe + volle Breite, damit er als Tap-Ziel erkennbar ist. */
.queue-item.more {
  display: block;
  width: 100%;
  text-align: center;
  color: var(--c-reddish);
  font-size: 0.82rem;
  font-weight: 700;
  background: transparent;
  border: none;
  padding: 9px 6px;
  cursor: pointer;
}
@media (hover: hover) and (pointer: fine) {
  .queue-item.more:hover {
    color: var(--c-crimson);
    text-decoration: underline;
  }
}
