/*
 * Turnier für Zuschauer (/Turnier). Handy zuerst, Tippflächen mindestens --tap-min.
 * Beamer und PC (ab 1200 px im Querformat oder mit dem Schalter „Beamer-Ansicht“): feste Fläche 1920 x 1080, stufenlos skaliert, in
 * beamer.css. Darunter gilt diese Datei allein, auch am Laptop mit Maus.
 */
/* Die Icon-Leiste von „Mein Turnier“ kommt wie auf allen Spielerseiten aus layout.css (.page--player), hier nicht überschreiben. */
.page--spectator .page__main {
  max-width: var(--content-max);
  margin-inline: auto;
}

.page--spectator .page__main {
  max-width: none;
  padding: var(--space-8);
}

.page--spectator .page__footer {
  max-width: var(--content-max);
  margin-inline: auto;
}

/* Kopf */
.tv-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0 var(--space-6);
}

.tv-meta__line {
  font-weight: var(--weight-semibold);
}

.tv-meta__refresh {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--tap-min);
  height: var(--tap-min);
  margin: calc(var(--space-3) * -1) calc(var(--space-5) * -1) calc(var(--space-3) * -1) 0;
  border: 0;
  background: transparent;
  color: var(--color-white);
  cursor: pointer;
}

.tv-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: var(--line-thin) solid var(--color-line);
}

.tv-tabs__item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--btn-height);
  color: var(--color-text-soft);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  text-decoration: none;
}

.tv-tabs__item[aria-current='page'] {
  box-shadow: inset 0 calc(var(--line-thick) * -1) 0 var(--color-gold);
  color: var(--color-gold);
}

/* Karten */
.tv {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  min-width: 0;
}

.tv-sides {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.tv-side {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.tv-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-7) var(--space-8);
  border: var(--line-thin) solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.tv-card--now {
  border-color: var(--color-gold);
  background: var(--color-gold-surface);
}

.tv-card--empty {
  color: var(--color-text-muted);
}

.tv-card--race {
  overflow: hidden;
  padding-left: var(--space-12);
}

.tv-card--race .tv-card__title {
  font-size: var(--text-plate);
  line-height: var(--leading-race);
}

.tv-card--race::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--space-5);
  background: repeating-conic-gradient(var(--color-gold) 0 25%, var(--color-gold-surface) 0 50%) 0 0 / var(--space-5) var(--space-5);
}

.tv-card__label {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  color: var(--color-gold);
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  line-height: var(--leading-md);
}

.tv-card__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  line-height: var(--leading-xl);
}

.tv-card__big {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-style: italic;
  line-height: var(--leading-hero);
}

.tv-card__text {
  color: var(--color-text-warm);
  font-size: var(--text-md);
  line-height: var(--leading-md);
}

.tv-pulse {
  width: var(--tv-pulse);
  height: var(--tv-pulse);
  border-radius: 50%;
  background: var(--color-gold);
  animation: tv-pulse 1.6s ease-in-out infinite;
}

@keyframes tv-pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tv-pulse {
    animation: none;
  }
}

.tv-drivers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 var(--space-8);
  padding: var(--space-3) var(--space-8) var(--space-5);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  list-style: none;
}

.tv-driver {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
  min-height: var(--tap-min);
  font-size: var(--text-lg);
}

.tv-driver__nr {
  flex: none;
  width: var(--space-13);
  color: var(--color-text-muted);
  font-family: var(--font-display);
  font-size: var(--text-sm);
}

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

/* Am Handy dürfen lange Namen in die zweite Zeile, statt mit Punkten abgeschnitten zu werden */
@media (max-width: 40rem) {
  .tv-driver__name {
    overflow-wrap: break-word;
    text-overflow: clip;
    white-space: normal;
  }
}

.tv-driver__points {
  color: var(--color-gold);
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
}

.tv-next {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-6) var(--space-8);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.tv-next__label {
  color: var(--color-text-muted);
  font-size: var(--text-md);
}

.tv-next__names {
  font-family: var(--font-display);
  font-size: var(--text-xl);
}

/* Dashboard, Turnierbaum und die Check-in-Bühne gelten nur am Beamer (beamer.css); am Handy gilt _Handy bzw. Kasten und Zähler. Seitenkarten ebenso. */
.tv-tree,
.tv-dash,
.tv-pre,
.tv-sides {
  display: none;
}

/* Vor dem Start und nach dem Ende */
.tv-before,
.tv-end {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-13) var(--space-8);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  text-align: center;
}

.tv-end {
  background: transparent;
  padding-block: var(--space-4);
}

/* Podest nach dem Ende: Markup und Aussehen des Ranglisten-Podests (player.css), auch am Beamer nur auf Inhaltsbreite, die Plätze darunter ebenso */
.tv-end .podium,
.tv-end .tv-rest {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
}

/* Der Name ist hier kein Knopf (in der Rangliste öffnet er die Spielerkarte) */
.tv-end__name {
  cursor: default;
}

.tv-before__title,
.tv-end__title {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-style: italic;
  line-height: var(--leading-3xl);
}

.tv-before__text,
.tv-hint {
  color: var(--color-text-muted);
  font-size: var(--text-md);
  line-height: var(--leading-md);
}

.tv-counters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.tv-counter {
  display: flex;
  flex-direction: column;
  padding: var(--space-7);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.tv-counter__n {
  color: var(--color-gold);
  font-family: var(--font-display);
  font-size: var(--tv-counter-size);
  line-height: var(--leading-3xl);
}

.tv-counter__n--ice {
  color: var(--color-ice);
}

.tv-rest {
  list-style: none;
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.tv-rest__row {
  display: flex;
  gap: var(--space-6);
  align-items: center;
  min-height: var(--tap-min);
  padding: 0 var(--space-7);
  border-top: var(--line-thin) solid var(--color-line-soft);
}

.tv-rest__place {
  width: var(--space-12);
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
}

.tv-rest__name {
  flex: 1;
}

.tv-rest__points {
  color: var(--color-text-muted);
  font-family: var(--font-display);
}

/* Ziffern in Turnier-Listen gleich breit (Startnummern, Punkte, Plätze, Zähler), damit Spalten nicht springen */
.tv-driver__nr,
.tv-driver__points,
.tv-counter__n,
.tv-rest__place,
.tv-rest__points {
  font-variant-numeric: tabular-nums;
}



/*
 * ===== Zuschauer am Handy (Design „Rennen“) =====
 * Kopf und Leiste wie auf den Spielerseiten (Banner fest oben, Leiste unten für Angemeldete), darunter die Reiter Jetzt, Baum und Gruppen,
 * die Stand-Zeile und der Inhalt aus den Bausteinen von „Mein Turnier“ (Tafeln, Zeilen, Schilder, Keil-Marken). Prototyp handy.css.
 * Alles hier gilt nur am Handy und am Laptop ohne Beamer-Ansicht; beamer.css wirft den Rahmen am Beamer wieder ab.
 */
.page--spectator {
  padding-top: calc(var(--race-head-height) + env(safe-area-inset-top, 0px));
}

.page--spectator:has(.icon-bar) {
  padding-bottom: calc(var(--race-dock-height) + env(safe-area-inset-bottom, 0px) + var(--install-hint-room));
}

/* Hülle der Bühne (_LayoutSpectator): am Handy ohne eigenen Kasten, Kopf der Seite, Inhalt und Fuß stehen wie direkt im body */
.tv-stage {
  display: contents;
}

/* Der alte Seitenkopf mit Reitern ist Beamer-Kopf (vor dem Start und nach dem Ende) */
.tv-stage > .tv-topbar,
.tv-stage > .checker,
.tv-stage > .tv-tabs {
  display: none;
}

/* Leiste unten wie auf den Spielerseiten (layout.css .page--player .icon-bar): fest, von Rand zu Rand, Punkte auf Inhaltsbreite */
.page--spectator .icon-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  padding-right: max(calc(var(--race-dock-inset) + env(safe-area-inset-right, 0px)), calc((100% - var(--content-max)) / 2));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: max(calc(var(--race-dock-inset) + env(safe-area-inset-left, 0px)), calc((100% - var(--content-max)) / 2));
}

.page--spectator .app-head--static {
  position: fixed;
  z-index: 30;
}

.page--spectator .page__main {
  max-width: var(--content-max);
  margin-inline: auto;
  padding: 0 var(--space-10) var(--space-6);
  gap: 0;
}

.page--spectator .page__footer {
  padding-inline: var(--space-10);
}

/* Reiter Jetzt, Baum, Gruppen: kleben unter dem Banner (Prototyp .bphs) */
.tv-views {
  position: sticky;
  top: calc(var(--race-head-height) + env(safe-area-inset-top, 0px));
  z-index: 6;
  display: flex;
  gap: var(--space-2);
  width: 100%;
  max-width: var(--content-max);
  height: var(--tv-views-height);
  margin-inline: auto;
  padding: var(--space-4) var(--space-10) var(--space-2);
  background: var(--color-bg);
}

.tv-views__item,
.tv-hphase {
  position: relative;
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: var(--tv-hchip-height);
  padding: 0 var(--space-5);
  background: var(--race-panel-hi);
  color: var(--race-ink-muted);
  font-family: var(--font-title);
  font-size: var(--tv-hchip-size);
  font-style: italic;
  font-weight: var(--weight-extrabold);
  line-height: var(--leading-none);
  letter-spacing: var(--race-tracking-tab);
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  clip-path: polygon(var(--tv-hchip-cut) 0, 100% 0, calc(100% - var(--tv-hchip-cut)) 100%, 0 100%);
}

.tv-views__item[aria-current="page"],
.tv-hphase--sel {
  background: var(--race-ink);
  color: var(--race-on-silver);
}

.tv-views__item:focus-visible,
.tv-hphase:focus-visible {
  outline: var(--line-thick) solid var(--race-gold-hi);
  outline-offset: calc(var(--line-thick) * -1);
}

/* Stand der Phase, Uhrzeit, Aktualisieren */
.tv-hmeta {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  height: var(--tv-hmeta-height);
  color: var(--race-ink-muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.tv-hmeta__line {
  display: -webkit-box;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  line-height: var(--leading-xs);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* Schmale Handys: Die Zeile bricht an Leerzeichen in die zweite Zeile (passt in die Höhe), statt mit „…“ abgeschnitten zu werden;
   die Uhrzeit bleibt ganz */
.tv-hmeta__stand {
  flex: none;
  white-space: nowrap;
}

.tv-hmeta__refresh {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--tap-min);
  height: var(--tap-min);
  margin-right: calc(var(--space-5) * -1);
  border: 0;
  background: transparent;
  color: var(--race-ink-soft);
  cursor: pointer;
}

.tv {
  gap: 0;
}

.tv-h {
  display: flex;
  flex-direction: column;
}

/* Einflug beim Seitenaufruf (motion.js, Entwurf R.fly): Nur die Tafeln der Handy-Ansicht warten unsichtbar, bis motion.js sie übernimmt
   (Regel und Notbremse wie in components.css). Die Bühne am Beamer hat eigene Bewegung und wartet nie, auch wenn _LayoutSpectator die
   Klasse ohne den Schalter „Beamer-Ansicht“ setzt (der Server kennt die Breite nicht). */
@media (prefers-reduced-motion: no-preference) {
  .page--spectator.fly-wait .tv-h [data-fly] {
    animation: race-fly-wait 1ms linear var(--race-fly-safety) both;
  }
}

/* Treffer der Suche: eine Fläche für den Einflug, innen wie .tv-h */
.tv-hhits {
  display: flex;
  flex-direction: column;
}

.tv-h > .section-head {
  margin-top: var(--space-12);
}

.tv-h > .section-head:first-child {
  margin-top: var(--space-4);
}

.tv-h .board + .board {
  margin-top: var(--space-6);
}

.tv-h__empty {
  margin: 0;
}

.tv-h__tracks {
  margin-bottom: var(--space-3);
}

.tv-h__sentence {
  margin: 0 0 var(--space-6) var(--space-1);
  color: var(--race-ink-soft);
}

.tv-end,
.tv-before {
  margin-top: var(--space-4);
}

.tv--baum .tv-end {
  display: none;
}

/* Als Nächstes: Keil-Marke, Gruppe, Konsole */
.tv-hnext {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  list-style: none;
}

.tv-hnext__row {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  min-height: var(--tap-min);
  padding: var(--space-2) var(--space-6) var(--space-2) var(--space-5);
  background: var(--race-panel);
  box-shadow: var(--race-drop-s);
}

.tv-hnext__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.tv-hnext__name {
  min-width: 0;
  font-family: var(--font-title);
  font-size: var(--race-tab-size);
  font-style: italic;
  font-weight: var(--weight-black);
  line-height: var(--leading-none);
  text-transform: uppercase;
}

.tv-hnext__row--halb .tv-hnext__name {
  color: var(--race-silver);
}

.tv-hnext__row--fin .tv-hnext__name {
  color: var(--race-gold);
}

.tv-hnext__console {
  color: var(--race-ink-muted);
  font-size: var(--race-section-small);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  white-space: nowrap;
}

/* Phasen: Fortschritt je Phase */
.tv-hphasen {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--tv-hphasen-gap);
  list-style: none;
}

.tv-hphasen__item {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
  color: var(--race-ink-dim);
}

.tv-hphasen__item--on {
  color: var(--race-red-text);
}

.tv-hphasen__item--done {
  color: var(--race-ink-soft);
}

.tv-hphasen__item--halb {
  color: var(--race-silver);
}

.tv-hphasen__item--fin {
  color: var(--race-gold);
}

.tv-hphasen__name {
  font-family: var(--font-title);
  font-size: var(--tv-hchip-size);
  font-style: italic;
  font-weight: var(--weight-extrabold);
  letter-spacing: var(--race-tracking-tab);
  text-transform: uppercase;
}

.tv-hphasen__bar {
  display: block;
  width: 100%;
  height: var(--tv-hphasen-bar);
  border: 0;
  background: var(--race-recess);
  appearance: none;
}

.tv-hphasen__bar::-webkit-progress-bar {
  background: var(--race-recess);
}

.tv-hphasen__bar::-webkit-progress-value {
  background: var(--race-gold);
}

.tv-hphasen__bar::-moz-progress-bar {
  background: var(--race-gold);
}

/* Gruppen: Suche und zugeklappte Tafeln */
.tv-search {
  display: flex;
  flex-direction: column;
}

.tv-search__form {
  margin-bottom: var(--space-4);
}

.tv-hhit {
  margin-top: var(--space-8);
}

/* Name des Gesuchten: einzeilig wie der Abschnittskopf, ein zu langer Name endet mit „…“ */
.tv-hhit__text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tv-hcard--fold > summary {
  min-height: var(--tap-min);
  margin-bottom: 0;
  cursor: pointer;
  list-style: none;
}

.tv-hcard--fold > summary::-webkit-details-marker {
  display: none;
}

.tv-hcard--fold[open] > summary {
  margin-bottom: var(--space-2);
}

.tv-hcard__more {
  width: var(--space-5);
  height: var(--space-5);
  margin-left: var(--space-2);
  border: solid var(--race-ink-muted);
  border-width: 0 var(--line-thick) var(--line-thick) 0;
  transform: translateY(calc(var(--space-1) * -1)) rotate(45deg);
}

.tv-hcard--fold[open] .tv-hcard__more {
  transform: translateY(var(--space-1)) rotate(225deg);
}

.tv-hcard--fold .wedge,
.tv-hcard--fold .mein-group__count {
  margin-left: auto;
}

.tv-hcard--mine {
  box-shadow: inset var(--race-row-bar) 0 0 var(--race-gold), var(--race-drop);
}

.tv-hcard--found .mein-row--self {
  background: var(--race-travel-bg);
}

/* Baum: feste Fläche. Die Seite scrollt nicht, nur .tv-hb; die Phasen-Reiter kleben darin oben (sticky im eigenen Scroller
   rechnet der Browser beim Scrollen selbst mit, ohne dass die Browserleiste die Seite verschiebt, Wunsch N1). */
.tv-h--baum {
  position: fixed;
  top: calc(var(--race-head-height) + env(safe-area-inset-top, 0px) + var(--tv-views-height) + var(--tv-hmeta-height));
  right: 0;
  bottom: calc(env(safe-area-inset-bottom, 0px) + var(--install-hint-room));
  left: 0;
  z-index: 5;
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
}

.page--spectator:has(.icon-bar) .tv-h--baum {
  bottom: calc(var(--race-dock-height) + env(safe-area-inset-bottom, 0px) + var(--install-hint-room));
}

/* Die Fußzeile liegt hinter der festen Fläche (die Seite scrollt nicht). Sie war nur durch Lücken zu sehen und schien beim Einflug, solange
   die Tafeln noch durchsichtig sind, unten durch. Nur am Handy: tv-auto (ohne Schalter „Beamer-Ansicht“, _LayoutSpectator) und nicht in der
   Medienbedingung der Bühne (BeamerView.AutoMedia, Unit-Test hält beide gleich); am Beamer bleibt der Nintendo-Hinweis als Fuß. */
@media not all and (orientation: landscape) and (min-width: 1200px) {
  .tv-auto:has(.tv-h--baum) .page__footer {
    visibility: hidden;
  }
}

.tv-hb {
  height: 100%;
  padding: 0 var(--space-10) var(--space-12);
  overflow: hidden auto;
  overscroll-behavior: contain;
}

.tv-hmini {
  margin-top: var(--space-4);
  padding-bottom: var(--space-5);
}

.tv-hmini__head {
  margin-bottom: var(--space-4);
}

.tv-hmini__legend {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-left: auto;
  color: var(--race-ink-muted);
  font-size: var(--race-section-small);
  font-weight: var(--weight-bold);
  letter-spacing: var(--race-tracking-small);
  text-transform: uppercase;
}

.tv-hmini__legend i {
  width: var(--space-7);
  height: var(--space-5);
  box-shadow: inset 0 0 0 var(--line-medium) var(--race-gold-hi);
}

.tv-hmini__svg {
  display: block;
  width: calc(100% - var(--space-5) * 2);
  height: auto;
  margin-inline: var(--space-5);
  overflow: visible;
}

.tv-hmini__label {
  fill: var(--race-ink-muted);
  font-family: var(--font-title);
  font-size: var(--tv-hmini-label-size);
  font-style: italic;
  font-weight: var(--weight-extrabold);
  letter-spacing: var(--race-tracking-tab);
  text-transform: uppercase;
}

.tv-hmini__label--on {
  fill: var(--race-red-text);
}

.tv-hmini__num {
  fill: var(--race-ink);
  font-family: var(--font-title);
  font-size: var(--tv-hmini-num-size);
  font-weight: var(--weight-bold);
  dominant-baseline: central;
  text-anchor: middle;
}

.tv-hmini__hatch {
  fill: var(--tv-mini-hatch);
}

.tv-hmini__hatched {
  fill: url("#tv-hmini-hatch");
}

.tv-hmini__jump {
  cursor: pointer;
  outline: none;
}

.tv-hmini__hit {
  fill: transparent;
  pointer-events: all;
}

.tv-hmini__jump:focus-visible .tv-hmini__shape {
  stroke: var(--race-gold-hi);
  stroke-width: var(--tv-hmini-mine-width);
}

.tv-hmini__shape {
  fill: var(--tv-mini-pend);
}

.tv-hmini__block--done .tv-hmini__shape {
  fill: var(--race-travel-bg);
}

.tv-hmini__block--done .tv-hmini__num {
  fill: var(--race-gold-hi);
}

.tv-hmini__block--run .tv-hmini__shape {
  fill: var(--race-fade-red);
}

/* Auswertung: dunkelrot, ohne Pulsieren (Prototyp handy.js, miniTree: rev) */
.tv-hmini__block--rev .tv-hmini__shape {
  fill: var(--race-review-1);
}

.tv-hmini__block--pend .tv-hmini__num {
  fill: var(--race-ink-muted);
}

.tv-hmini__bar {
  fill: var(--tv-mini-bar-fill);
}

.tv-hmini__mine {
  fill: none;
  stroke: var(--race-gold-hi);
  stroke-width: var(--tv-hmini-mine-width);
}

.tv-hmini__pulse {
  fill: var(--race-red-hot);
  opacity: var(--tv-mini-pulse-opacity);
  animation: race-glow 1.4s ease-in-out infinite;
}

.tv-hmini__block--halb.tv-hmini__block--pend .tv-hmini__shape {
  fill: var(--tv-mini-pend-semi);
}

.tv-hmini__block--halb.tv-hmini__block--done .tv-hmini__shape {
  fill: var(--race-silver-lo);
}

.tv-hmini__block--final.tv-hmini__block--pend .tv-hmini__shape {
  fill: var(--tv-mini-pend-final);
}

.tv-hmini__block--final.tv-hmini__block--pend .tv-hmini__num {
  fill: var(--race-gold);
}

.tv-hmini__block--final.tv-hmini__block--done .tv-hmini__shape {
  fill: var(--race-gold);
}

.tv-hmini__block--halb.tv-hmini__block--done .tv-hmini__num,
.tv-hmini__block--final.tv-hmini__block--done .tv-hmini__num {
  fill: var(--race-on-gold);
}

.tv-hmini__wire {
  fill: none;
  stroke: var(--tv-tree-empty);
  stroke-linejoin: round;
  stroke-width: var(--tv-hmini-wire-width);
}

.tv-hmini__wire--done {
  stroke: var(--race-gold);
  opacity: var(--tv-wire-done-opacity);
}

@media (prefers-reduced-motion: reduce) {
  .tv-hmini__pulse {
    animation: none;
  }
}

/* Reiter je Phase */
.tv-hphases {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  gap: var(--space-2);
  margin: var(--space-6) calc(var(--space-10) * -1) 0;
  padding: var(--space-4) var(--space-10);
  overflow-x: auto;
  background: var(--color-bg);
  scrollbar-width: none;
}

.tv-hphases::-webkit-scrollbar {
  display: none;
}

.tv-hphase {
  flex: 1 0 auto;
}

.tv-hphase--done {
  color: var(--race-ink-soft);
}

.tv-hphase--on {
  color: var(--race-on-red);
}

.tv-hphase--on::after {
  content: "";
  position: absolute;
  top: var(--space-4);
  right: var(--space-6);
  width: var(--space-3);
  height: var(--space-3);
  border-radius: var(--radius-round);
  background: var(--race-red-hot);
  animation: race-blink 1.1s ease-in-out infinite;
}

.tv-hphase--halb {
  color: var(--race-silver);
}

.tv-hphase--fin {
  color: var(--race-gold);
}

.tv-hphase--sel,
.tv-hphase--sel.tv-hphase--on {
  color: var(--race-on-silver);
}

@media (prefers-reduced-motion: reduce) {
  .tv-hphase--on::after {
    animation: none;
  }
}

.tv-hside {
  flex-wrap: wrap;
  margin-top: var(--space-12);
  row-gap: var(--space-2);
  white-space: normal;
}

.tv-hphases + .tv-hlist > .tv-hside:first-child {
  margin-top: var(--space-6);
}

.tv-hlist .board {
  scroll-margin-top: var(--tv-hphases-height);
}

.tv-hnext__console:empty {
  display: none;
}

/* Halbfinale und Finale behalten ihre Silber- und Gold-Tafel, auch wenn die Gruppe läuft (Prototyp: .gt.halb und .gt.fin vor .gt.run) */
.tv-h .board--semi .board__title {
  background: var(--race-silver-fill);
  color: var(--race-on-silver);
}

.tv-h .board--final .board__title {
  background: var(--race-gold-fill);
  color: var(--race-on-gold);
}

/* Schmale Handys (bis 389 px): Der Titel einer zugeklappten Gruppe teilt sich die Zeile mit Marke und Pfeil, deshalb weniger Innenabstand.
   „2. Viertelfinale“ neben „Als Nächstes“ soll ganz passen (fehlten bei 320 px 37 px, zugeklappt 39 px, zugeklappt bei 375 px 14 px):
   Kopf, Reiter und Keil rücken enger, der Reiter sperrt nicht, der Keil nur so weit wie sonst die Reiter. */
@media (max-width: 389px) {
  .tv-hcard__summary {
    gap: var(--space-3);
  }

  .tv-hcard--fold .board__title {
    padding-right: var(--space-8);
    padding-left: var(--space-5);
  }

  .tv-h .board__head {
    gap: var(--space-3);
    padding-right: var(--space-4);
  }

  .tv-h .board__title {
    padding-right: var(--space-8);
    padding-left: var(--space-5);
    letter-spacing: 0;
  }

  .tv-h .board__head .wedge {
    padding-inline: var(--space-4);
    letter-spacing: var(--race-tracking-tab);
  }
}

/* Schmale Handys (bis 374 px): „Gruppen“ in der Phasen-Übersicht von „Jetzt“ war breiter als seine Spalte und stieß an „Achtel“ */
@media (max-width: 374px) {
  .tv-hphasen__name {
    font-size: var(--text-sm);
    letter-spacing: 0;
  }
}
