/* ============================================================
   Bereich „Eventserver" — die Aktionen der Event-Server.
   Drei Ebenen: Kategorie-Kacheln, flache Streckenliste, volle Rangliste.
   Baut auf denselben Grundformen wie Server/Dach (--card-strong, --line).
   ============================================================ */

/* --- Ebene 1: breite Kategorie-Karten ------------------------
   Marc, 15.09.2026: „völlig unklar worauf man klicken kann … alles so kleine
   schrift." Daraus zwei Regeln fuer diesen Abschnitt:

   1. **Klickbar = sichtbar klickbar.** Drei Merkmale muss jedes Ziel tragen:
      eigenen Rahmen, einen Pfeil und einen Hover-Zustand. Die ganze Karte ist
      ein Ziel (Bindung in `EventBoardsView`), Streckenchips und Fahrername
      sind eigene Ziele und fangen den Klick ab.
   2. **Keine Schrift unter 13 px.** Vorher lagen Meta-Zeile und Chips bei
      11,5–12,5 px. */
.eb-kats { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }

.ebkat {
  position: relative; min-width: 0; padding: 20px 22px 18px;
  border-radius: var(--radius); background: var(--card-strong);
  border: 1px solid var(--line); border-left: 4px solid var(--gt4, var(--cyan));
  cursor: var(--cur-pointer);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.ebkat:hover, .ebkat:focus-visible {
  transform: translateY(-2px); border-color: rgba(122, 243, 255, 0.45);
  box-shadow: 0 16px 40px -20px var(--gt4, var(--cyan));
  outline: none;
}
.ebkat:focus-visible { border-color: var(--cyan); }
.ebkat__pf { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.4; }

.ebkat__kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ebkat__titel { margin: 0; font-size: 26px; font-weight: 800; color: var(--text); letter-spacing: 0.01em; }
.ebkat:hover .ebkat__titel { color: var(--cyan); }
.ebkat__kl {
  font-size: 13px; padding: 3px 11px; border-radius: 999px; color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line);
}
.ebkat__best {
  margin-left: auto; display: flex; align-items: baseline; gap: 7px;
  font-variant-numeric: tabular-nums; color: var(--cyan); font-size: 19px; font-weight: 600;
}
.ebkat__best i {
  font-style: normal; font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-faint);
}
/* Der sichtbare Hinweis, dass die KARTE selbst ein Ziel ist. */
.ebkat__oeffnen {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px;
  border-radius: 999px; border: 1px solid rgba(122, 243, 255, 0.35);
  color: var(--cyan); font-size: 13px; white-space: nowrap;
}
.ebkat:hover .ebkat__oeffnen { background: rgba(122, 243, 255, 0.14); }
.ebkat:hover .ebkat__oeffnen .ebkat__pf { transform: translateX(2px); }

.ebkat__meta {
  display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 10px 0 16px;
  font-size: 13.5px; color: var(--text-dim);
}
.ebkat__meta b { color: var(--text); font-weight: 700; }

.ebkat__reihe { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 12px; min-width: 0; }
.ebkat__label {
  flex: 0 0 74px; padding-top: 7px; font-size: 11.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-faint);
}
.ebkat__werte { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.ebkat__mehr { align-self: center; font-size: 13px; color: var(--text-dim); }

/* Autos sind NICHT klickbar — flach, ohne Rahmenfarbe, ohne Pfeil. Der
   Unterschied zu den Streckenknoepfen daneben muss auf einen Blick lesbar
   sein, sonst klickt man ins Leere. */
.ebkat__auto {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px;
  border-radius: 999px; background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07); font-size: 14px; color: var(--text);
}
.ebkat__auto:not(:has(.mfr-tile)) { padding-left: 12px; }
.ebkat__auto .mfr-tile { width: 26px; height: 26px; }
.ebkat__autoname { white-space: nowrap; }

/* Strecken sind Kacheln und sagen, was sie tun: Zielflagge, Name ueber der
   Rundenzahl, rechts „Rangliste ›" — darunter klein das Podest der Strecke
   (Marc, 15.09.2026). Die ganze Kachel ist der Knopf. */
.ebkat__werte--kacheln {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(282px, 1fr)); width: 100%;
}
.ebkat__strecke {
  display: flex; flex-direction: column; gap: 9px; padding: 11px 12px 10px 13px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(122, 243, 255, 0.16), rgba(122, 243, 255, 0.06));
  border: 1px solid rgba(122, 243, 255, 0.42); color: var(--text);
  text-decoration: none; cursor: var(--cur-pointer);
  transition: background 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.ebkat__strecke:hover {
  background: linear-gradient(180deg, rgba(122, 243, 255, 0.28), rgba(122, 243, 255, 0.12));
  border-color: var(--cyan); transform: translateY(-1px);
  box-shadow: 0 8px 20px -12px var(--cyan);
}
.ebkat__streckenkopf { display: flex; align-items: flex-start; gap: 11px; }
.ebkat__streckenkopf .ebkat__tat { align-self: center; }
.ebkat__flagge { font-size: 16px; line-height: 1; }
.ebkat__streckentext { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ebkat__streckenname {
  /* Umbrechen statt abschneiden: „Flugplatz Niederstetten 1973 (Schikane)"
     endete sonst als „Flugplatz Niederste…" — ein Streckenname, den man nicht
     zu Ende lesen kann, ist keine Information. */
  font-weight: 700; font-size: 15.5px; line-height: 1.2; overflow-wrap: anywhere;
}
.ebkat__strecke b {
  font-variant-numeric: tabular-nums; color: var(--text-dim); font-weight: 400;
  font-size: 12px; white-space: nowrap;
}
/* Das ausgeschriebene „Rangliste ›" — der Teil, der aus der Kachel einen Knopf
   macht. Abgesetzt hinter einer Trennlinie, damit er nicht wie ein weiteres
   Datum aussieht. */
.ebkat__tat {
  display: inline-flex; align-items: center; gap: 3px; margin-left: auto;
  padding-left: 11px; border-left: 1px solid rgba(122, 243, 255, 0.28);
  color: var(--cyan); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.ebkat__strecke:hover .ebkat__pf { transform: translateX(3px); }
.ebkat__strecke .ebkat__pf { color: var(--cyan); transition: transform 0.15s; }

/* Podest der Strecke — klein, aber nicht winzig (13 px, Marcs Punkt vom
   15.09.: „alles so kleine schrift"). Eigene Flaeche, damit es sich vom
   Knopf-Teil darueber absetzt. */
.ebkat__podest {
  display: flex; flex-direction: column; gap: 3px; padding: 8px 9px 7px;
  border-radius: 9px; background: rgba(6, 10, 20, 0.5);
}
.ebkat__pz { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.ebkat__pm { font-size: 12px; width: 15px; flex: 0 0 auto; }
.ebkat__pn {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text-dim);
}
.ebkat__pz:first-child .ebkat__pn { color: var(--text); font-weight: 600; }
.ebkat__pt {
  margin-left: auto; font-variant-numeric: tabular-nums; color: var(--cyan);
  font-size: 13px;
}

/* --- Ebene 2: flache Streckenliste ---------------------------- */
/* Bewusst KEINE Reiter/Abschnitte (Marc: „reiterlisten sind so hässlich") —
   eine Karte je Block, in Backend-Reihenfolge (Streckenname, dann Beginn). */
.eb-liste { display: grid; gap: 10px; }
.ebzeile {
  display: block; padding: 14px 18px; border-radius: var(--radius);
  background: var(--card-strong); border: 1px solid var(--line);
  color: inherit; text-decoration: none; cursor: var(--cur-pointer);
  transition: transform 0.18s, box-shadow 0.18s;
}
.ebzeile:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -14px var(--cyan); }
.ebzeile__kopf {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; margin-bottom: 2px;
}
.ebzeile__strecke { font-size: 17px; font-weight: 700; color: var(--text); }
.ebzeile__klasse {
  font-size: 12px; padding: 2px 9px; border-radius: 999px; color: var(--muted);
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line);
}
.ebzeile__meta {
  display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted);
  margin-bottom: 10px;
}
.ebzeile__best { color: var(--cyan); font-variant-numeric: tabular-nums; }
/* Top-3-Zeilen mit Avatar: Medaille, Bild, Name, Zeit rechtsbuendig. */
.racecard__pod--voll .racecard__p { display: flex; align-items: center; gap: 8px; }
/* Nur im vollen Mini-Podium — ohne Einschraenkung schrumpfte die Regel seit 13.09. auch
   die Avatare der RaM-/Academy-Rennkarten (ram.css: 28 px) auf 22 px. */
.racecard__pod--voll .racecard__av { width: 22px; height: 22px; font-size: 10px; flex: 0 0 auto; }
.racecard__pt {
  margin-left: auto; font-variant-numeric: tabular-nums; color: var(--cyan); font-size: 12.5px;
}

/* --- Ebene 3: volle Rangliste ---------------------------------- */
/* Kein eigenes Markup mehr: die Rangliste nutzt seit 13.09.2026 `PodiumNeon`
   und `LeaderboardTable` wie jede andere Rangliste im Board (Marc: "leaderboards
   sollen alle gleich aussehen"). Die frueheren `.ebrang__*`-Regeln sind
   ersatzlos weg -- sie waren der Grund, warum dieser eine Bereich anders
   aussah. Das Aussehen kommt jetzt aus `components.css`. */

/* --- Handy: schmalere Spalten statt Umbruch (kein waagerechtes Scrollen) --- */
/* Sortieren + Suchen brechen am Handy um, statt die Seite seitwaerts zu
   schieben (`mobile.css` macht Leisten dort sonst wischbar — bei zwei
   Eingabefeldern nebeneinander passt das nicht). Vorbild: `.nur-handy .toolbar`. */
@media (max-width: 767px) {
  .controls__row--eb, .controls__row--eb .toolbar { flex-wrap: wrap; width: 100%; }
  .controls__row--eb .toolbar__spacer { display: none; }
  .controls__row--eb .search { flex: 1 1 100%; }
}

@media (max-width: 620px) {
  .ebkat { padding: 16px 15px 14px; }
  /* Nicht kleiner als 21 px — „alles so kleine schrift" war Marcs Punkt. */
  .ebkat__titel { font-size: 21px; }
  .ebkat__best { font-size: 17px; }
  /* Der Oeffnen-Knopf rutscht am Handy unter den Titel und ueber die volle
     Breite: eingequetscht neben der Bestzeit war er nicht mehr als Knopf zu
     erkennen. */
  .ebkat__oeffnen { order: 9; width: 100%; justify-content: center; margin-top: 4px; }
  .ebkat__meta { margin: 8px 0 14px; }
  /* Label ueber die Werte statt daneben: 62 px Beschriftung sind am Handy
     ein Fuenftel der Breite. */
  .ebkat__reihe { flex-direction: column; gap: 4px; }
  .ebkat__label { flex: none; padding-top: 0; }
  /* Autos und Strecken werden seitlich gewischt statt untereinander gestapelt:
     sechs Autos ergaben am Handy sechs Zeilen und eine endlos hohe Karte
     (gemessen 15.09.2026 auf 412 px). Muster wie `.hero__stats` in mobile.css.
     ⚠️ `max-width` ist Pflicht — ohne sie waechst die Reihe ueber den Rand und
     schiebt die ganze Seite seitwaerts (derselbe Fehler wie bei der
     Sortierleiste am 13.09.). */
  .ebkat__reihe { min-width: 0; }
  .ebkat__werte {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    -webkit-overflow-scrolling: touch; padding-bottom: 2px;
    /* `min-width: 0` ist der eigentliche Schalter: ohne ihn waechst ein
       Flex-Kind auf seinen Inhalt, `max-width` allein genuegt NICHT (gemessen:
       scrollWidth 1419 statt 412). */
    min-width: 0; width: 100%;
  }
  .ebkat__werte::-webkit-scrollbar { display: none; }
  .ebkat__werte > * { flex: 0 0 auto; }
  .ebkat__siegerwo { display: none; }
  .ebkat__siegername { font-size: 14.5px; }
  /* Streckenkacheln stehen am Handy untereinander und werden NICHT gewischt:
     ein Podest seitlich wegzuschieben verbirgt genau die Zeilen, die Marc
     sehen will. Nur die Autoreihe bleibt wischbar. */
  .ebkat__werte--kacheln {
    display: grid; grid-template-columns: minmax(0, 1fr); overflow: visible;
    flex-wrap: wrap;
  }
}

/* Abzeichen „läuft gerade" (_eventboards_aktiv.js); die Eventserver-Karten: eventserver.css. */
.eb-live i {
  width: 8px; height: 8px; border-radius: 50%; background: var(--sector-ok);
  box-shadow: 0 0 8px var(--sector-ok); flex: 0 0 auto;
}
.eb-live {
  display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; padding: 2px 10px;
  border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--sector-ok);
  border: 1px solid var(--sector-ok); background: rgba(61, 220, 132, 0.1); vertical-align: middle;
}
