/* ============================================================================
   Brabham Motorsport Setup Database
   ----------------------------------------------------------------------------
   Handgeschrieben, kein Framework (Projektanweisung §34).

   Leitidee seit dem Redesign: "smooth is fast". Alles Runde kommt vom
   Randstein am Kurvenscheitel, alle Bewegung folgt derselben Kurve - schnell
   rein, weich auslaufen. Seitenwechsel laufen ueber native View Transitions:
   reines CSS, kein JavaScript. Browser ohne Unterstuetzung wechseln die Seite
   wie bisher, es geht also nichts kaputt.

   Aufbau: Tokens -> Reset -> Bewegung -> Layout -> Komponenten -> Responsive.
   ========================================================================= */

/* --- Tokens --------------------------------------------------------------
   Alle Farben leiten sich aus der Basisfarbe #252F5D ab: gleicher Blauton,
   nur unterschiedlich hell. Der Akzent ist aus dem Simply-Race-Logo
   ausgelesen, nicht erfunden.                                             */

:root {
  color-scheme: dark;   /* dunkle Scrollbalken und native Felder */

  --bg:            #10142B;
  --surface:       #1A2144;
  --surface-raised:#252F5D;
  --surface-hover: #2C3769;
  --surface-muted: #161B37;   /* Flaechen fuer Inaktives */

  /* Linien halbtransparent statt hart: Flaechen trennen sich ueber den
     Helligkeitsunterschied, die Linie ist nur noch ein Hauch. */
  --line:          rgba(151, 160, 192, .16);
  --line-strong:   rgba(151, 160, 192, .34);
  --line-muted:    rgba(151, 160, 192, .10);
  --hover-wash:    rgba(231, 234, 243, .07);

  --text:          #E7EAF3;
  --text-bright:   #C6CCE2;
  --muted:         #97A0C0;
  --dim:           #8690B3;
  --dimmest:       #7780A5;
  --disabled:      #5B648B;
  --disabled-soft: #6A7398;

  --accent:        #009CBE;
  --accent-light:  #59BFD5;   /* fuer kleine Schrift und Icons auf dunklem Grund */
  --accent-ink:    #0B1020;   /* Schrift auf einer Akzentflaeche */
  --accent-tint:   rgba(0, 156, 190, .14);

  /* Klassenfarben aus dem Endurance-Racing. */
  --class-hypercar: #E4322B;
  --class-lmp2:     #3A86E8;
  --class-lmp3:     #7C5CE6;
  --class-lmgt3:    #29B36A;
  --class-gte:      #E8A33A;

  /* Fahrerfarben der Strategieplanung, nach Position im Line-up. Hell und
     ungesaettigt, damit sie neben den kraeftigen Klassenfarben nicht wie
     eine weitere Klasse wirken und auf dem dunklen Grund lesbar bleiben. */
  --driver-1: #7CC8E8;
  --driver-2: #E8A0C4;
  --driver-3: #EBCB72;
  --driver-4: #8FD3A6;
  --driver-5: #B3A2F0;
  --driver-6: #F0A486;
  --driver-7: #7FD1C7;
  --driver-8: #C9CED9;

  /* Weiterhin nur Systemschriften: laden sofort, kein externer Abruf.
     Bahnschrift ist die DIN 1451 von Windows - die Schrift der deutschen
     Strassenschilder. Fast das ganze Team sitzt an einem Windows-Rechner (LMU
     gibt es nur dort); Mac und iPhone bekommen ihre DIN, alles andere die
     Systemschrift. */
  --font-sans: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-display: Bahnschrift, "DIN Alternate", "Roboto Condensed", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;

  /* Radien nach Rang, nicht ein Wert fuer alles: aussen gross, innen kleiner. */
  --radius-sm: 10px;
  --radius:    14px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  --pill:      999px;

  /* Bewegung: schnell rein, weich auslaufen. --ease-spring schwingt beim
     Druecken und Loslassen minimal ueber. */
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: linear(0, .38 12%, .74 26%, 1.02 42%, 1.06 52%, 1.02 68%, 1);
  --t-fast: .16s;
  --t: .26s;
  --t-morph: .38s;

  --shadow-soft: 0 18px 40px -22px rgba(4, 7, 22, .9);

  --page-x: 44px;
  --content-narrow: 660px;
  --content-wide: 1000px;

  /* <details> kann damit auf "auto" animieren. */
  interpolate-size: allow-keywords;
}

/* --- Reset ------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html { scrollbar-color: var(--line-strong) transparent; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;   /* Zeiten springen nicht beim Zaehlen */
  -webkit-font-smoothing: antialiased;
}

a { color: var(--muted); text-decoration: none; transition: color var(--t-fast) var(--ease); }
a:hover { color: var(--text); }

img { max-width: 100%; display: block; }

h1, h2, p { margin: 0; }

button { font-family: inherit; }

/* Sichtbarer Fokus fuer Tastaturbedienung - nie wegoptimieren. */
:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 3px; }

/* --- Seitenwechsel -----------------------------------------------------
   Bisher war jeder Klick ein harter Schnitt: alte Seite weg, neue da. Mit
   dieser einen Regel blendet der Browser selbst zwischen den beiden Seiten
   ueber und fuehrt gleich benannte Elemente von der alten an die neue Stelle.
   Eindeutige Namen sind Pflicht: Traegt ein Name zwei Elemente auf einer
   Seite, faellt der ganze Uebergang aus.                                  */

@view-transition { navigation: auto; }

::view-transition-old(root) { animation: seite-raus .14s ease-in both; }
::view-transition-new(root) { animation: seite-rein var(--t) var(--ease) both; }
@keyframes seite-raus { to { opacity: 0; } }
@keyframes seite-rein { from { opacity: 0; transform: translateY(8px); } }

::view-transition-group(*) {
  animation-duration: var(--t-morph);
  animation-timing-function: var(--ease);
}

/* Kopfleiste steht still, darueber liegt beim Wechsel nichts. */
.site-header { view-transition-name: site-header; }
::view-transition-group(site-header) { z-index: 10; }
::view-transition-group(nav-kerb) { z-index: 11; }

/* Kachel wird zur Seite: Die Kachel auf der Spiel-Startseite waechst in den
   Bereich, den sie oeffnet - und beim Zurueck wieder in sich zusammen. */
.action-card--search, .morph-search { view-transition-name: area-search; view-transition-class: morph; }
.action-card--upload, .morph-upload { view-transition-name: area-upload; view-transition-class: morph; }
.action-card--plan,   .morph-plan   { view-transition-name: area-plan;   view-transition-class: morph; }
::view-transition-old(*.morph),
::view-transition-new(*.morph) {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
}

/* Nur das erste Spiel traegt den Namen. So bleibt er eindeutig, auch wenn
   einmal mehrere Spiele aktiv sind - die uebrigen blenden dann einfach ueber. */
.game-grid > .game-tile:first-child:not(.game-tile--soon) .game-tile__logo img,
.game-head__logo { view-transition-name: game-logo; }

/* Im Bearbeiten-Raster laedt jeder Knopf die Seite neu ("Vorschau bei jedem
   Klick"). Dort waere ein Ueberblenden nur ein Flackern. */
html:has(.sheet--edit)::view-transition-old(root) { animation: none; opacity: 0; }
html:has(.sheet--edit)::view-transition-new(root) { animation: none; }

/* --- Layout ------------------------------------------------------------ */

.page {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}

/* Schwebende Leiste statt Balken ueber die ganze Breite. Fast deckend: Der
   Uebergang fotografiert die Leiste, ein starker Weichzeichner saehe waehrend
   des Wechsels anders aus als davor und danach. */
.site-header {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 12px 20px 0;
  padding: 8px 10px 8px 18px;
  background: rgba(26, 33, 68, .94);
  backdrop-filter: blur(14px);
  border-radius: var(--pill);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-soft);
}

.site-main {
  position: relative;
  z-index: 1;
  flex-grow: 1;
  width: 100%;
  max-width: var(--content-narrow);
  margin: 0 auto;
  padding: 40px var(--page-x) 60px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.site-main--wide { max-width: var(--content-wide); }
.site-main--centred { justify-content: center; gap: 40px; padding-top: 58px; }

.site-footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 46px;
  padding: 30px var(--page-x) 34px;
}

/* Die Hoehen sind nicht geschaetzt: fuer jedes Logo wurde die tatsaechlich
   deckende Flaeche gemessen und daraus eine Hoehe berechnet, bei der alle
   drei optisch gleich schwer wirken. */
.sponsor--simply-race { height: 34px; width: auto; }
.sponsor--artisans    { height: 49px; width: auto; }
.sponsor--sim3d       { height: 28px; width: auto; }

/* --- Kopfbereich ------------------------------------------------------- */

.brand { display: flex; align-items: center; gap: 12px; }
.brand__emblem { height: 30px; width: auto; transition: transform var(--t) var(--ease-spring); }
.brand:hover .brand__emblem { transform: scale(1.06); }
.brand__name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.brand__name span { font-weight: 400; color: var(--accent-light); }

.nav {
  display: flex;
  gap: 2px;
  font-family: var(--font-display);
  font-size: 14.5px;
}
.nav a {
  position: relative;
  padding: 7px 14px 9px;
  border-radius: var(--pill);
  transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.nav a:hover { background: var(--hover-wash); }
.nav a.is-current { color: var(--text); }

/* Der Randstein ist vom Balken ueber die ganze Breite zum Positionsanzeiger
   geworden: Er sitzt unter dem aktuellen Bereich und faehrt beim Wechsel
   zum naechsten. Ein echtes Element im Makro, damit der Uebergang es greifen
   kann. */
.nav__kerb {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 3px;
  height: 3px;
  border-radius: var(--pill);
  background: repeating-linear-gradient(90deg, var(--accent) 0 6px, var(--text) 6px 12px);
  view-transition-name: nav-kerb;
}

/* Rechte Seite des Kopfbereichs: Navigation und Konto nebeneinander. */
.site-header__end { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.account { display: flex; align-items: center; gap: 6px; }
.account__link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 12px 4px 4px;
  border-radius: var(--pill);
  transition: background-color var(--t-fast) var(--ease);
}
.account__link:hover { background: var(--hover-wash); }
.account__link:hover .account__name { color: var(--text); }
.account__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-raised);   /* Platzhalter, bis das Bild da ist */
}
.account__name {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
  color: var(--text-bright);
}
.account form { display: flex; }
/* Ein Knopf, der aussieht wie die Links der Navigation daneben. */
.account__logout {
  padding: 7px 12px;
  font-family: var(--font-display);
  font-size: 13.5px;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: var(--pill);
  cursor: pointer;
  transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.account__logout:hover { color: var(--text); background: var(--hover-wash); }

/* --- Textbausteine ----------------------------------------------------- */

.eyebrow {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--accent-light);
}

.title {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  line-height: 1.1;
}
.title--hero { font-size: 46px; line-height: 1.04; }

.lede { font-size: 15px; color: var(--muted); max-width: 62ch; }
.lede--hero { font-size: 16px; max-width: 46ch; }

.meta {
  font-size: 12.5px;
  color: var(--dim);
}

.back-link {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 7px;
  margin-left: -10px;
  padding: 5px 12px 5px 10px;
  font-family: var(--font-display);
  font-size: 14px;
  border-radius: var(--pill);
  transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.back-link svg { transition: transform var(--t) var(--ease-spring); }
.back-link:hover { background: var(--hover-wash); }
.back-link:hover svg { transform: translateX(-3px); }

.stack { display: flex; flex-direction: column; gap: 8px; }
.stack--centred { align-items: center; text-align: center; gap: 12px; }

/* --- Startseite: Kurvenscheitel ----------------------------------------
   Das eine grosse Motiv der Anwendung, und nur hier: der Randstein als echter
   Bogen, daneben die Strecke. Zwei konzentrische Kreise, deshalb liegt der
   Randstein exakt an der Streckenkante. Er zieht sich beim Laden einmal in
   die Kurve; danach bewegt sich auf dieser Seite nichts mehr von selbst.   */

.corner {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 0;
  width: clamp(320px, 42vw, 540px);
  height: auto;
  pointer-events: none;
  /* Beide Enden laufen weich aus, statt hart abgeschnitten zu enden. */
  mask-image: linear-gradient(to bottom, #000 68%, transparent 88%);
}
.corner__track { fill: none; stroke: var(--surface); stroke-width: 130; animation: strecke-rein .9s var(--ease) both; }
.corner__kerb-base { fill: none; stroke: var(--text); stroke-width: 15; }
.corner__kerb-dash { fill: none; stroke: var(--accent); stroke-width: 15; stroke-dasharray: 32 32; }
/* Ein wachsender Kreis um das untere Ende legt den Bogen der Reihe nach frei. */
.corner__kerb { animation: randstein-zieht 1.15s .1s var(--ease) both; }
@keyframes strecke-rein { from { opacity: 0; } }
@keyframes randstein-zieht {
  from { clip-path: circle(0 at 143px 580px); }
  to   { clip-path: circle(1000px at 143px 580px); }
}

/* Emblem gross, Name daneben wie ein Team-Lockup. Bewusst keine riesige
   Display-Ueberschrift: das Wappen ist das Echte, die Schrift bleibt ruhig. */
.hero { display: flex; align-items: center; gap: 26px; padding-block: 34px 22px; }
.hero__emblem { width: 104px; height: auto; flex: none; }
.hero__title {
  font-family: "Segoe UI Variable Display", var(--font-sans);
  font-size: clamp(30px, 4.2vw, 46px);
  font-weight: 600;
  line-height: 1.1;
}
.hero__sub { color: var(--muted); font-weight: 400; }

/* --- Spielauswahl ------------------------------------------------------
   Wer aktiv ist, bekommt die volle Breite; was noch kommt, steht klein und
   leise darunter. Vorher sahen alle vier Spiele gleich wichtig aus.        */

.game-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.game-tile {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 26px 30px 26px 34px;
  background: var(--surface-raised);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  color: var(--text);
  transition: background-color var(--t) var(--ease), transform var(--t) var(--ease-spring);
}
.game-tile:hover { color: var(--text); background: var(--surface-hover); transform: translateY(-2px); }
.game-tile:active { transform: scale(.992); }

.game-tile--soon {
  grid-column: auto;
  flex-direction: column;
  justify-content: flex-start;
  gap: 12px;
  padding: 20px 16px 18px;
  background: var(--surface-muted);
  border-radius: var(--radius-lg);
  box-shadow: none;
  cursor: default;
}
.game-tile--soon:hover { background: var(--surface-muted); transform: none; }
.game-tile--soon:active { transform: none; }

/* Festes Feld, in das sich jedes Logo hineinskaliert. Die Logos haben sehr
   verschiedene Seitenverhaeltnisse (Le Mans breit, RaceRoom quadratisch) -
   so wirken sie trotzdem gleich gewichtet. */
.game-tile__logo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 84px;
}
.game-tile__logo img {
  max-height: 84px;
  max-width: 210px;
  width: auto;
  height: auto;
  transition: transform var(--t) var(--ease-spring);
}
.game-tile:hover .game-tile__logo img { transform: scale(1.03); }
.game-tile--soon:hover .game-tile__logo img { transform: none; }
.game-tile--soon .game-tile__logo { height: 48px; justify-content: center; }
.game-tile--soon .game-tile__logo img { max-height: 48px; max-width: 120px; filter: grayscale(1); opacity: .45; }

.game-tile__info { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; justify-content: flex-end; }
.game-tile__meta { font-size: 14px; color: var(--text-bright); }
.game-tile--soon .game-tile__info { justify-content: center; }
.game-tile--soon .game-tile__meta { font-size: 13px; color: var(--dim); text-align: center; }

/* Sieht aus wie .btn, ist aber Teil des Links drumherum. */
.game-tile__go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent-light);
  border-radius: var(--pill);
}
.game-tile__go svg, .action-card__go svg { transition: transform var(--t) var(--ease-spring); }
.game-tile:hover .game-tile__go svg, .action-card:hover .action-card__go svg { transform: translateX(4px); }

/* --- Spiel-Startseite -------------------------------------------------- */

.game-head { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.game-head__logo { max-height: 56px; max-width: 150px; width: auto; height: auto; }

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.action-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 26px 28px 24px;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: inset 0 0 0 1px var(--line-muted);
  color: var(--text);
  transition: background-color var(--t) var(--ease), transform var(--t) var(--ease-spring);
}
.action-card:hover { color: var(--text); background: var(--surface-raised); transform: translateY(-2px); }
.action-card:active { transform: scale(.985); }

/* Suchen ist das, wofuer die meisten herkommen: grosse Kachel links, die
   beiden anderen rechts uebereinander. */
.action-grid--three { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.action-card--search { grid-row: span 2; justify-content: space-between; background: var(--surface-raised); }
.action-card--search:hover { background: var(--surface-hover); }
.action-card--search .action-card__title { font-size: 28px; }
.action-card--search .action-card__text { font-size: 15px; max-width: 34ch; }

.action-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  width: 48px;
  height: 48px;
  color: var(--accent-light);
  background: var(--accent-tint);
  border-radius: 50%;
}
.action-card__title { font-family: var(--font-display); font-size: 20px; font-weight: 600; }
.action-card__text { font-size: 14px; color: var(--muted); }
.action-card__go {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 14.5px;
  color: var(--accent-light);
}

/* --- Karte, Notiz ------------------------------------------------------ */

.panel {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: inset 0 0 0 1px var(--line-muted);
  padding: 28px;
}

/* Das hidden-Attribut setzt nur "display: none" mit der schwachen
   Browser-Standardregel. Jede eigene display-Angabe - etwa das flex weiter
   unten bei .note - schlaegt sie und das Element bliebe sichtbar. Deshalb
   einmal zentral nachhelfen. */
[hidden] { display: none !important; }

.note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--dim);
  line-height: 1.55;
}

/* --- Formular ----------------------------------------------------------- */

.form { display: flex; flex-direction: column; gap: 22px; }

.field { display: flex; flex-direction: column; gap: 9px; }

.field__label {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--text-bright);
}

/* Ein natives <select> - ohne JavaScript ist das die richtige Wahl. Der
   zugeklappte Zustand laesst sich frei gestalten, die aufgeklappte Liste
   zeichnet das Betriebssystem. Dafuer funktioniert es mit Tastatur,
   Screenreader und auf dem Handy ohne eine Zeile Extraaufwand. */
.select { position: relative; display: flex; }

.select select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 12px 40px 12px 16px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t) var(--ease), background-color var(--t-fast) var(--ease);
}
.select select:hover { border-color: var(--line-strong); }
.select select:focus, .select select:open { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px var(--accent-tint); }

/* Die aufgeklappte Liste erbt die Seitenfarben nicht - deshalb hier
   ausdruecklich setzen, sonst steht auf manchen Systemen heller Text auf
   hellem Grund. */
.select option,
.select optgroup { background: var(--surface-raised); color: var(--text); }

.select__arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  transition: transform var(--t) var(--ease-spring);
}
.select:has(select:open) .select__arrow { transform: translateY(-50%) rotate(180deg); }

/* Aufgeklappte Liste: Wo der Browser es kann (Chrome/Edge), zeichnen wir sie
   selbst - rund, im Seitenton, weich aufklappend. Alle anderen behalten die
   Liste des Betriebssystems; Tastatur, Screenreader und Handy funktionieren in
   beiden Faellen, es bleibt ein echtes <select>. Im Stint-Raster bleibt es bei
   der nativen Liste: dort stehen Hunderte Auswahlfelder auf einer Seite. */
@supports (appearance: base-select) {
  .select:not(.select--compact) select,
  .select:not(.select--compact) select::picker(select) { appearance: base-select; }
  .select:not(.select--compact) select::picker-icon { display: none; }
  .select:not(.select--compact) select::picker(select) {
    margin-block: 6px;
    padding: 6px;
    max-height: min(340px, 60vh);
    color: var(--text);
    background: var(--surface-raised);
    border: 0;
    border-radius: var(--radius);
    box-shadow: inset 0 0 0 1px var(--line), 0 24px 48px -16px rgba(4, 7, 22, .9);
    scrollbar-width: thin;
    opacity: 0;
    translate: 0 -6px;
    transition: opacity var(--t-fast) var(--ease), translate var(--t) var(--ease),
                overlay var(--t) allow-discrete, display var(--t) allow-discrete;
  }
  .select:not(.select--compact) select:open::picker(select) { opacity: 1; translate: 0 0; }
  @starting-style {
    .select:not(.select--compact) select:open::picker(select) { opacity: 0; translate: 0 -6px; }
  }
  .select:not(.select--compact) option {
    padding: 8px 12px;
    background: transparent;
    border-radius: var(--radius-sm);
    transition: background-color var(--t-fast) var(--ease);
  }
  .select:not(.select--compact) option:hover,
  .select:not(.select--compact) option:focus { background: var(--hover-wash); outline: none; }
  .select:not(.select--compact) option:checked { color: var(--accent-light); font-weight: 600; }
  .select:not(.select--compact) option::checkmark { display: none; }
  .select:not(.select--compact) optgroup {
    padding-block: 6px 2px;
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--muted);
    background: transparent;
  }
  .select:not(.select--compact) optgroup option { font-family: var(--font-sans); font-weight: 400; color: var(--text); }
}

.btn {
  align-self: flex-start;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  padding: 12px 26px;
  border: none;
  border-radius: var(--pill);
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), transform var(--t) var(--ease-spring);
}
.btn:hover { background: var(--accent-light); color: var(--accent-ink); }
.btn:active { transform: scale(.96); }
.btn--compact { padding: 9px 18px; font-size: 14px; white-space: nowrap; }

/* Meldungen. Der Warnton ist die Hypercar-Klassenfarbe - sie ist ohnehin im
   System, und ein sechster Rotton waere Willkuer. */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13.5px;
  color: #F2685F;
  background: rgba(228, 50, 43, .12);
  border-radius: var(--radius);
  padding: 12px 16px;
  animation: meldung-rein var(--t) var(--ease) both;
}

@keyframes meldung-rein { from { opacity: 0; transform: translateY(-4px); } }

/* --- Login ------------------------------------------------------------- */

.login {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 440px;
  align-self: center;
}
.login__button { align-self: stretch; text-align: center; }

/* --- Upload ------------------------------------------------------------ */

.field__labelrow { display: flex; align-items: baseline; gap: 9px; }
.field__optional { font-size: 12.5px; color: var(--dimmest); }

/* Der gestrichelte Rahmen aus dem Entwurf. Das eigentliche Bedienelement
   darin ist ein natives <input type="file"> - nur der Browser kann den
   gewaehlten Dateinamen anzeigen, und ohne JavaScript geht das nicht anders. */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px 20px;
  background: var(--bg);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: border-color var(--t) var(--ease), background-color var(--t) var(--ease);
}
.dropzone:hover { border-color: var(--accent-light); }
.dropzone:hover .dropzone__icon { transform: translateY(-3px); }
.dropzone:focus-within { border-color: var(--accent); background: var(--accent-tint); }
.dropzone__icon { color: var(--accent-light); transition: transform var(--t) var(--ease-spring); }
.dropzone__hint {
  font-family: var(--font-display);
  font-size: 12.5px;
  color: var(--dimmest);
}

.file-input {
  /* Volle Breite, sonst kuerzt der Browser den Dateinamen mit Auslassungs-
     punkten ab - und genau der soll ja lesbar sein. */
  width: 100%;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text-bright);
}
.file-input::file-selector-button {
  font-family: inherit;
  font-size: 13px;
  font-weight: 650;
  margin-right: 12px;
  padding: 9px 18px;
  border: 0;
  border-radius: var(--pill);
  background: var(--surface-raised);
  color: var(--text);
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease);
}
.file-input::file-selector-button:hover { background: var(--surface-hover); }

.text-input {
  width: 100%;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t) var(--ease);
}
.text-input::placeholder { color: var(--dim); }
.text-input:hover { border-color: var(--line-strong); }
.text-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px var(--accent-tint); }

.text-input--area { resize: vertical; min-height: 80px; line-height: 1.55; }

.form__actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.form__cancel {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--muted);
}

.alert--success {
  color: #5FCB95;
  background: rgba(41, 179, 106, .12);
}

/* --- Ergebnisse --------------------------------------------------------- */

.result-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.result-head__name { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.result-head__track {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--muted);
}

.result-head__count {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--accent-light);
  white-space: nowrap;
}

/* Klassenfarben aus dem Endurance-Racing. Man sieht auf einen Blick, zu
   welcher Klasse ein Setup gehoert, ohne den Fahrzeugnamen zu lesen. */
.class-badge {
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 3px 10px;
  border-radius: var(--pill);
}
.class-badge--hypercar { color: #F2685F; background: rgba(228,  50,  43, .18); }
.class-badge--lmp2     { color: #7FB0F0; background: rgba( 58, 134, 232, .18); }
.class-badge--lmp3     { color: #A794F0; background: rgba(124,  92, 230, .18); }
.class-badge--lmgt3    { color: #5FCB95; background: rgba( 41, 179, 106, .18); }
.class-badge--gte      { color: #F0C173; background: rgba(232, 163,  58, .18); }

.filter {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border-radius: var(--pill);
  box-shadow: inset 0 0 0 1px var(--line);
  padding: 11px 18px;
  transition: box-shadow var(--t) var(--ease);
}
.filter:focus-within { box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 4px var(--accent-tint); }
.filter__icon { color: var(--dim); flex-shrink: 0; }

.filter__input {
  flex-grow: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: none;
  border: none;
  padding: 0;
}
.filter__input::placeholder { color: var(--dim); }
.filter__input:focus { outline: none; }

.filter__clear {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--muted);
  flex-shrink: 0;
}

.setup-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: inset 0 0 0 1px var(--line-muted);
}

.setup-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-radius: var(--radius-lg);
  padding: 16px 16px 16px 20px;
  transition: background-color var(--t-fast) var(--ease);
}

.setup-card:hover { background: var(--hover-wash); }

/* Das gerade hochgeladene Setup. Der Akzent-Hauch reicht - es blinkt nichts,
   die Zeile ist nur eindeutig als die neue erkennbar. */
.setup-card--new {
  background: var(--accent-tint);
  animation: karte-erscheint var(--t-morph) var(--ease) both;
}

@keyframes karte-erscheint {
  from { opacity: 0; transform: translateY(-6px); }
}

.setup-card__body { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
/* Zeigt Fahrzeug oder Strecke, wenn danach nicht gefiltert wurde - sonst
   waere bei einer Suche nur nach Strecke nicht erkennbar, zu welchem Auto
   ein Setup gehoert. */
.setup-card__where {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--text-bright);
}
.setup-card__track {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--muted);
}

.setup-card__name { font-size: 16px; font-weight: 600; }
.setup-card__text { font-size: 13.5px; color: var(--muted); }

/* Wer es hochgeladen hat, vor Datum und Groesse in derselben Zeile. */
.setup-card__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.uploader { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.uploader__avatar { width: 16px; height: 16px; border-radius: 50%; }

.empty { display: flex; flex-direction: column; gap: 7px; }
.empty__title { font-size: 15px; font-weight: 600; }
.empty__text { font-size: 13.5px; color: var(--muted); }
.empty__text a { color: var(--accent-light); }

/* --- Allgemeine Ergaenzungen (seit der Strategieplanung) ---------------- */

/* Ueberschrift links, Aktion rechts - auf Event-Liste und Event-Seite. */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.section { display: flex; flex-direction: column; gap: 14px; }
.section__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section__title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-bright);
}

.muted { color: var(--dim); }

/* Fuer Elemente, die Screenreader und Formulare brauchen, das Auge nicht. */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}

/* Zweitrangiger Knopf: Umriss statt Flaeche. */
.btn--ghost {
  background: transparent;
  color: var(--accent-light);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.btn--ghost:hover { background: var(--hover-wash); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent); }

/* Loeschen. Der Rotton ist wie bei .alert die Hypercar-Klassenfarbe. */
.btn--danger { background: var(--class-hypercar); color: #fff; }
.btn--danger:hover { background: #F2483F; color: #fff; }

.danger { box-shadow: inset 0 0 0 1px rgba(228, 50, 43, .35); gap: 14px; }
.danger__title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: #F2685F;
}

.checkbox { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-bright); cursor: pointer; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--accent); }

/* Zwei Felder nebeneinander, etwa Datum und Uhrzeit. */
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

/* Gruppe zusammengehoeriger Felder mit gemeinsamer Ueberschrift. */
.fieldset { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; border: 0; min-width: 0; }
.fieldset legend { padding: 0; margin-bottom: 12px; }
.field__sublabel {
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--dim);
}

.text-input--short { max-width: 180px; }

/* Das Kalender-Symbol der nativen Datums-/Zeitfelder ist dunkel und auf
   unserem Grund sonst kaum zu sehen. */
.text-input::-webkit-calendar-picker-indicator { filter: invert(.75); cursor: pointer; }
.text-input[type="date"], .text-input[type="time"] { color-scheme: dark; }

/* --- Strategieplanung --------------------------------------------------- */

.event-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: inset 0 0 0 1px var(--line-muted);
}

.event-card {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  padding: 16px 18px 16px 20px;
  border-radius: var(--radius-lg);
  color: var(--text);
  transition: background-color var(--t-fast) var(--ease);
}
.event-card:hover { color: var(--text); background: var(--hover-wash); }
.event-card--past { opacity: .8; }
.event-card--past:hover { opacity: 1; }
.event-card--past .event-card__name { color: var(--text-bright); }

.event-card__when { display: flex; flex-direction: column; gap: 3px; font-family: var(--font-display); }
.event-card__date { font-size: 14px; color: var(--text-bright); }
.event-card__time { font-size: 13.5px; color: var(--accent-light); }

.event-card__body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.event-card__name { font-size: 16px; font-weight: 600; }
.event-card__meta { font-size: 13px; color: var(--muted); }
.event-card__cars { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.event-card__go { color: var(--accent-light); transition: transform var(--t) var(--ease-spring); }
.event-card:hover .event-card__go { transform: translateX(4px); }

.car-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--text-bright);
}

/* Eckdaten eines Events als Kacheln. */
.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}
.facts__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 20px;
  background: var(--surface);
  border-radius: var(--radius-lg);
}
.facts dt {
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--dim);
}
.facts dd { margin: 0; font-size: 13px; color: var(--text-bright); line-height: 1.45; }
.facts__big { font-family: var(--font-display); font-size: 24px; font-weight: 600; color: var(--text); }

.notes { white-space: pre-line; font-size: 13.5px; color: var(--text-bright); padding: 18px 22px; }

.entry-list { display: flex; flex-direction: column; gap: 12px; }
.entry-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 22px;
  background: var(--surface);
  border-radius: var(--radius-xl);
}
.entry-card__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.entry-card__car { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.entry-card__name { font-family: var(--font-display); font-size: 18px; font-weight: 600; }
.entry-card__edit {
  font-family: var(--font-display);
  font-size: 12.5px;
  color: var(--accent-light);
}
.entry-card__links { display: flex; gap: 16px; flex-shrink: 0; }
.entry-card__lineup { display: flex; flex-wrap: wrap; gap: 8px; }

/* Ein Fahrer mit seiner Farbe als linker Rand. Die Farbe kommt ueber die
   Klasse driver--N, damit sie an jeder Stelle dieselbe ist. */
.driver-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 12px 3px 3px;
  font-size: 13px;
  color: var(--text);
  background: color-mix(in srgb, var(--driver-colour, var(--line-strong)) 16%, var(--bg));
  border-radius: var(--pill);
}
.driver-chip__avatar { width: 20px; height: 20px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--driver-colour, transparent); }
.driver-chip__avatar--guest {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--driver-colour);
}
.driver-chip__lap { font-family: var(--font-display); font-size: 12.5px; color: var(--muted); }

.driver--1 { --driver-colour: var(--driver-1); }
.driver--2 { --driver-colour: var(--driver-2); }
.driver--3 { --driver-colour: var(--driver-3); }
.driver--4 { --driver-colour: var(--driver-4); }
.driver--5 { --driver-colour: var(--driver-5); }
.driver--6 { --driver-colour: var(--driver-6); }
.driver--7 { --driver-colour: var(--driver-7); }
.driver--8 { --driver-colour: var(--driver-8); }

/* Line-up im Formular: Auswahl, Gastname, Rundenzeit nebeneinander. */
.lineup { display: flex; flex-direction: column; gap: 10px; }
.lineup__head,
.lineup__row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 110px;
  gap: 10px;
}
.lineup__head {
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--dim);
}

/* --- Strategie: Ansicht und Bearbeiten (Phase S2) ---------------------- */

/* Strategie-Seiten nutzen die ganze Breite: Je breiter der Bildschirm,
   desto mehr Stints stehen nebeneinander - wie im Sheet. */
.site-main--full { max-width: none; }

.page-head__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-head__actions form { display: flex; }

/* Die style-Attribute an den Info-Icons greifen wegen der
   Content-Security-Policy nicht (style-src 'self') - deshalb hier. */
.note > svg, .alert > svg { flex-shrink: 0; }

.ok-text { color: #5FCB95; }
.warn-text { color: #F2685F; }

/* Kleine Kennzeichnung, etwa "ACTIVE" an einer Strategie. */
.tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 12px;
  padding: 2px 9px;
  border-radius: var(--pill);
  color: var(--muted);
  border: 1px solid var(--line-strong);
  vertical-align: middle;
}
.tag--active { color: var(--accent-ink); background: var(--accent-light); border-color: var(--accent-light); }
/* Im Rennen gefahren (Phase S8) - gruen wie "FINISH FITS". */
.tag--done { color: #5FCB95; border-color: rgba(95, 203, 149, .45); }

/* Ein Knopf, der aussieht wie ein Link - fuer Aktionen per POST. */
.link-button {
  padding: 0;
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--accent-light);
  background: none;
  border: 0;
  cursor: pointer;
  transition: color var(--t-fast) var(--ease);
}
.link-button:hover { color: var(--text); }

.alert--list ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }

/* Strategien eines Autos auf der Event-Seite. */
.strategy-list { display: flex; flex-direction: column; gap: 6px; }
.strategy-list form { display: flex; }
.strategy-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 10px 16px;
  background: var(--bg);
  border-radius: var(--radius);
  color: var(--text);
  transition: background-color var(--t-fast) var(--ease);
}
.strategy-row:hover { color: var(--text); background: var(--surface-raised); }
.strategy-row--active { box-shadow: inset 0 0 0 1px var(--line-strong); }
.strategy-row__name { font-weight: 600; font-size: 14px; }
.strategy-row__meta {
  margin-left: auto;
  font-family: var(--font-display);
  font-size: 12.5px;
  color: var(--muted);
}

/* Varianten als Reiter. */
.tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.tabs__tab {
  padding: 7px 16px;
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--muted);
  border-radius: var(--pill);
  transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.tabs__tab:hover { background: var(--hover-wash); }
.tabs__tab.is-current { color: var(--text); background: var(--surface-raised); view-transition-name: tab-current; }
.tabs__action { margin-left: auto; display: flex; }

/* Rennuhr (T+) unter einer Uhrzeit. */
.clock {
  display: block;
  font-family: var(--font-display);
  font-size: 12.5px;
  color: var(--dim);
}

/* --- Strategie wie das Sheet: Kopf oben, Stints als Spalten ------------ */

/* Kopf: Fahrer, Stoppzeiten, Renndaten nebeneinander - wie die ersten
   Zeilen im Sheet. Flex mit Umbruch statt festem Raster: Auf schmalen
   Bildschirmen rutschen die Kaesten von selbst untereinander. */
.sheet-head { display: flex; flex-wrap: wrap; gap: 12px; max-width: 1240px; }
.sheet-box {
  flex: 1 1 220px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 16px 20px;
  background: var(--surface);
  border-radius: var(--radius-lg);
}
.sheet-box--drivers { flex: 2.4 1 600px; overflow-x: auto; scrollbar-color: var(--line-strong) transparent; }
.sheet-box__title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 400;
  color: var(--dim);
}
.sheet-box__title--next { margin-top: 6px; }
.sheet-box__foot { font-size: 12px; color: var(--dim); }

/* Kleine Tabelle im Kopf: die Fahrer mit ihrer Fahrzeit. */
.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini-table th,
.mini-table td {
  padding: 6px 8px;
  text-align: left;
  font-weight: 400;
  white-space: nowrap;
  border-bottom: 1px solid var(--line-muted);
}
.mini-table th:first-child { padding-left: 0; }
.mini-table td:last-child { padding-right: 0; }
.mini-table thead th {
  padding-top: 0;
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--dim);
}
.mini-table tbody tr:last-child > * { border-bottom: 0; }
.mini-table .num { text-align: right; }
.mini-table td.num { font-family: var(--font-display); font-size: 12.5px; color: var(--text-bright); }
.mini-table__share { min-width: 150px; }

.share { display: flex; align-items: center; gap: 10px; }
.share-bar { flex: 1; min-width: 60px; height: 8px; display: block; border-radius: var(--pill); overflow: hidden; }
.share-bar__track { fill: var(--bg); }
.share-bar__fill { fill: var(--driver-colour, var(--accent)); }
.share-bar__fill--warn { fill: var(--class-hypercar); }
.share-bar__limit { stroke: var(--text); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.share__value { min-width: 48px; text-align: right; font-family: var(--font-display); font-size: 12.5px; color: var(--text-bright); }

/* Schluessel und Wert untereinander, etwa Stoppzeiten. */
.kv { display: flex; flex-direction: column; margin: 0; }
.kv > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--line-muted);
}
.kv > div:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-family: var(--font-display); font-size: 12.5px; color: var(--text); }

/* Das Stint-Raster. Es scrollt seitwaerts in seinem eigenen Kasten, die
   Seite selbst bleibt so breit wie der Bildschirm. tabindex="0" im HTML,
   damit man es auch mit den Pfeiltasten scrollen kann. */
.sheet {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
  background: var(--surface);
  border-radius: var(--radius-lg);
}
.sheet__table { border-collapse: separate; border-spacing: 0; font-size: 13px; }
.sheet__table th,
.sheet__table td {
  width: 136px;
  min-width: 136px;
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
  font-weight: 400;
  white-space: nowrap;
  border-right: 1px solid var(--line-muted);
  border-bottom: 1px solid var(--line-muted);
}
/* Rechter Rand: den zeichnet schon der Kasten drumherum. */
.sheet:not(.sheet--edit) .sheet__table tr > :last-child,
.sheet__table .sheet__stint--add,
.sheet__table .sheet__add { border-right: 0; }
.sheet__table tbody tr:last-child > * { border-bottom: 0; }
.sheet__table td { font-family: var(--font-display); font-size: 12.5px; color: var(--text-bright); }

/* Kopfzeile mit der Stintnummer, die Fahrerfarbe als Strich obendrauf. */
.sheet__table thead th {
  padding-top: 7px;
  padding-bottom: 7px;
  font-family: var(--font-display);
  font-size: 12.5px;
  color: var(--muted);
  background: var(--surface-muted);
  border-top: 3px solid var(--driver-colour, transparent);
}
/* Wer per Sprungmarke hierher kommt (#stint-12), soll die Spalte neben der
   festen Beschriftung sehen und nicht darunter - und oben noch die
   Vorschau mit Zielflagge und Fahrzeiten. */
.sheet__stint { scroll-margin-left: 140px; scroll-margin-top: 150px; }
/* Sprung zur Spalte aus der Warnliste gleitet. Nicht im Bearbeiten-Raster:
   Dort wuerde es nach jedem Knopfdruck von vorn losfahren. */
.sheet:not(.sheet--edit) { scroll-behavior: smooth; }

/* Beschriftung links, bleibt beim Seitwaerts-Scrollen stehen - wie
   Spalte A im Sheet. Braucht einen Hintergrund, sonst scheinen die
   Zellen durch, die darunter durchlaufen. */
.sheet .sheet__table .sheet__label {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 118px;
  min-width: 118px;
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--dim);
  background: var(--surface);
  border-right: 1px solid var(--line-strong);
}
.sheet .sheet__table thead .sheet__label { background: var(--surface-muted); }
.sheet__unit { font-family: var(--font-display); font-size: 11.5px; color: var(--dimmest); }

/* Fahrerzeile: Zelle in der Fahrerfarbe, wie die Farbregeln im Sheet -
   nur dass die Farbe hier am Fahrer haengt und nicht am Namen. */
.sheet__table .sheet__driver {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--driver-colour);
  background-clip: padding-box;
  border: 3px solid transparent;
  border-radius: var(--radius);
}
.sheet__table .sheet__big { font-size: 15px; color: var(--text); }
.sheet__table .sheet__note { white-space: normal; font-family: var(--font-sans); font-size: 12.5px; color: var(--muted); }
.sheet__note > span { display: flex; flex-direction: column; gap: 3px; overflow-wrap: anywhere; }
.sheet__table .clock { margin-top: 2px; }

/* Bearbeiten: breitere Spalten fuer die Eingabefelder, gerechnete Zeilen
   grau hinterlegt - wie Formelzellen, in die man nichts eintippt. */
.sheet--edit .sheet__table th,
.sheet--edit .sheet__table td { width: 176px; min-width: 176px; padding: 6px 8px; }
.sheet--edit .sheet__table .sheet__label { padding-left: 12px; }
.sheet--edit .text-input,
.sheet--edit .select select { width: 100%; }
/* Die Zellen erben die Monospace-Schrift - fuer Namen und Stopparten ist
   sie zu breit, "Fuel + front tyres" passte sonst nicht in die Spalte. */
.sheet--edit .select select { font-family: var(--font-sans); }
.sheet__calc td { background: var(--surface-muted); }
.sheet__driver-input select { box-shadow: inset 0 0 0 1.5px var(--driver-colour, transparent); }
.sheet__warn { display: block; margin-top: 3px; white-space: normal; font-family: var(--font-sans); font-size: 13px; }
.sheet__ignored .select { opacity: .45; }
.sheet__ignored .stop--finish { display: block; margin-bottom: 4px; font-size: 11.5px; }

.sheet__stint-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.sheet__stint-no { font-size: 12px; color: var(--text-bright); }
.sheet__tools { display: flex; gap: 3px; }
.sheet__tools .icon-button { width: 25px; height: 25px; font-size: 13px; }

/* Letzte Spalte: Stints anhaengen, wie im Sheet nach rechts weiter. */
.sheet__table .sheet__add { white-space: normal; font-family: var(--font-sans); }
.sheet__add-box { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.sheet__add-label { font-family: var(--font-display); font-size: 12px; color: var(--dim); }
.sheet__add-hint { font-size: 12px; color: var(--dim); }

/* Erste Spalte im Rennen: die gefahrenen Stints, zusammengefasst und
   gesperrt (Phase S8). Wie eine Formelzelle grau hinterlegt. */
.sheet__table .sheet__done { white-space: normal; font-family: var(--font-sans); background: var(--surface-muted); }
.sheet__done-box { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; position: sticky; top: 8px; }
.sheet__done-box strong { font-size: 13px; font-weight: 600; color: var(--text-bright); }
.sheet__done-box .clock { margin-top: -4px; }

.stop { font-size: 13px; color: var(--text-bright); }
.stop--tyres { color: var(--accent-light); }
.stop--finish { font-family: var(--font-display); font-size: 12.5px; color: var(--muted); }
.stop__time { display: block; font-family: var(--font-display); font-size: 12.5px; color: var(--dim); }
.sheet__table .stop { font-family: var(--font-sans); font-size: 12.5px; }
.sheet__table .stop--finish { font-family: var(--font-display); font-size: 12.5px; }

/* Nachfuellmenge im Stopp - die Zahl, die im Pit-Menue eingestellt wird. */
.stop__fuel { display: block; margin-top: 2px; font-family: var(--font-display); font-size: 12.5px; color: var(--text); }

/* Reifen je Ecke als 2x2-Raster: vorne links, vorne rechts, hinten links,
   hinten rechts - so wie sie am Auto sitzen. */
.tyres { display: inline-grid; grid-template-columns: repeat(2, auto); gap: 3px 12px; font-family: var(--font-display); font-size: 12px; }
.tyres__corner { display: inline-flex; align-items: center; gap: 5px; }
/* Mischung als Buchstabe in ihrer ueblichen Farbe: Soft rot, Medium gelb,
   Hard weiss, Wet blau. */
.compound {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent-ink);
  border-radius: 50%;
}
.compound--soft   { background: var(--class-hypercar); color: var(--text); }
.compound--medium { background: #EBCB72; }
.compound--hard   { background: var(--text); }
.compound--wet    { background: var(--class-lmp2); color: var(--text); }
.stop__tyres { display: block; margin-top: 2px; font-family: var(--font-sans); font-size: 12px; color: var(--accent-light); }

/* Startreifen im Bearbeiten-Formular: Mischung und Haken nebeneinander. */
.start-tyres { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; }
.start-tyres .select { width: 160px; }

/* Vorschlags-Generator im Bearbeiten-Formular, auf- und zuklappbar. */
.suggest {
  background: var(--bg);
  border-radius: var(--radius-lg);
}
.suggest__summary {
  padding: 12px 18px;
  font-family: var(--font-display);
  font-size: 14.5px;
  color: var(--accent-light);
  cursor: pointer;
  transition: color var(--t-fast) var(--ease);
}
.suggest__summary:hover { color: var(--text); }
.suggest__summary::marker { content: ""; }
.suggest__summary::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 11px 2px 2px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  border-radius: 1px;
  rotate: -45deg;
  transition: rotate var(--t) var(--ease-spring);
}
.suggest[open] .suggest__summary::before { rotate: 45deg; }
.suggest::details-content {
  block-size: 0;
  overflow: clip;
  transition: block-size var(--t) var(--ease), content-visibility var(--t) allow-discrete;
}
.suggest[open]::details-content { block-size: auto; }
.suggest__body { display: flex; flex-direction: column; gap: 16px; padding: 4px 18px 18px; }
.suggest__fields { display: grid; grid-template-columns: repeat(3, minmax(0, 160px)); gap: 16px; }
.suggest__fields .field { gap: 6px; }
.suggest__rotation { display: flex; flex-wrap: wrap; gap: 8px; }
.suggest__rotation .select { width: 180px; }
.suggest__rotation select { font-family: var(--font-sans); }
.suggest__actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; }
.suggest__hint { font-size: 12px; color: var(--dim); }

/* Kompaktere Felder fuer das Stint-Raster. */
.text-input--compact { padding: 8px 10px; font-size: 13.5px; }
.text-input--area.text-input--compact { min-height: 42px; }
.text-input--tiny { width: 72px; }
.select--compact select { padding: 8px 30px 8px 10px; font-size: 13.5px; }
.select--compact .select__arrow { right: 10px; }

.preview-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  padding: 12px 18px;
  background: var(--bg);
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 13.5px;
  color: var(--text-bright);
}
.preview-bar__label { font-size: 12px; color: var(--dim); margin-right: 4px; }
.preview-bar__driver { border-left: 3px solid var(--driver-colour); padding-left: 7px; }

.icon-button {
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  color: var(--muted);
  background: var(--bg);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease), transform var(--t) var(--ease-spring);
}
.icon-button:hover:not(:disabled) { color: var(--text); background: var(--surface-raised); }
.icon-button:active:not(:disabled) { transform: scale(.9); }
.icon-button:disabled { opacity: .35; cursor: default; }
.icon-button--danger:hover:not(:disabled) { color: #F2685F; background: rgba(228, 50, 43, .18); }


/* --- Verfuegbarkeit und Spotter (Phase S5) ------------------------------ */

/* Namen im Raster (Spotter, wer nicht kann) in normaler Schrift. */
.sheet__table .sheet__person { font-family: var(--font-sans); font-size: 12.5px; color: var(--text-bright); }
.sheet__away span { display: block; color: #F2685F; }

/* Stint-Nummer in der Warnliste springt zur Spalte. */
.alert__link { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.alert__link:hover { color: var(--text); }

/* Datum und Uhrzeit nebeneinander in einem Feld. */
.date-time { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 8px; }

/* Eingetragene Zeitfenster, nach Person. */
.away-list { display: flex; flex-direction: column; gap: 10px; }
.away-person {
  display: grid;
  grid-template-columns: minmax(120px, 200px) minmax(0, 1fr);
  gap: 8px 16px;
  padding: 16px 20px;
  background: var(--surface);
  border-radius: var(--radius-lg);
}
.away-person__name { font-weight: 600; font-size: 14px; }
.away-person__windows { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.away-window { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; }
.away-window form { display: flex; margin-left: auto; }
.away-window__time { font-family: var(--font-display); font-size: 12.5px; color: var(--text-bright); }
.away-window__note { font-size: 13px; color: var(--muted); }

/* Zeitleiste auf der Event-Seite: Namen links, Rennen als Balken rechts.
   Die Abschnitte der Kopfzeile sind gleich breit wie die Gitterlinien in
   den Balken (TIMELINE_SEGMENTS in routes.py). */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  background: var(--surface);
  border-radius: var(--radius-lg);
}
.timeline__ticks,
.timeline__row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}
.timeline__scale { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.timeline__scale span {
  overflow: hidden;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--dim);
}
.timeline__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.timeline__bar { width: 100%; height: 14px; display: block; border-radius: var(--pill); overflow: hidden; }
.timeline__track { fill: var(--bg); }
.timeline__grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.timeline__drives { fill: var(--accent); }
.timeline__spots { fill: none; stroke: var(--accent-light); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.timeline__away { fill: rgba(228, 50, 43, .45); }
.timeline__legend { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.timeline__key { display: inline-block; width: 16px; height: 9px; border-radius: var(--pill); }
.timeline__key--drives { background: var(--accent); }
.timeline__key--spots { border: 1.5px solid var(--accent-light); }
.timeline__key--away { background: rgba(228, 50, 43, .45); }


/* --- Wetter, Uhr im Spiel, Strafpunkte, Setup (Phase S6) ---------------- */

/* Wetter-Zeilen im Event-Formular, gebaut wie das Line-up. */
.weather-rows { display: flex; flex-direction: column; gap: 10px; }
.weather-rows__head,
.weather-rows__row { display: grid; grid-template-columns: 130px 150px minmax(0, 1fr); gap: 10px; }
.weather-rows__head { font-family: var(--font-display); font-size: 12px; color: var(--dim); }

/* Eine Zeile unter den Eckdaten eines Events: Spielzeit, Wetter, Links. */
.conditions { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 22px; font-size: 13px; color: var(--text-bright); }
.conditions__label { margin-right: 6px; font-family: var(--font-display); font-size: 12px; color: var(--dim); }
.conditions__link { font-family: var(--font-display); font-size: 12.5px; color: var(--accent-light); }

.sheet-box__setup { font-size: 13px; overflow-wrap: anywhere; }
.sheet-box__setup a { color: var(--accent-light); }
.sheet-box__links { display: flex; gap: 16px; padding-top: 4px; }

/* Nacht im Spiel: gedeckt statt grell, es ist ein Hinweis, keine Warnung. */
.tag--night { color: var(--text); background: #2A3270; border-color: #3B4590; }

/* Wetter als kleines Schild in seiner Farbe. */
.weather {
  display: inline-block;
  padding: 1px 9px;
  font-family: var(--font-display);
  font-size: 12.5px;
  border-radius: var(--pill);
  border: 1px solid var(--line-strong);
}
.weather--dry { color: #EBCB72; border-color: rgba(235, 203, 114, .45); }
.weather--cloudy { color: var(--muted); }
.weather--rain { color: #7CC8E8; border-color: rgba(124, 200, 232, .5); }
.weather__note { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.weather__change { display: block; margin-top: 3px; font-family: var(--font-display); font-size: 12.5px; color: var(--muted); }
.sheet__ingame { display: block; margin-bottom: 3px; font-family: var(--font-display); font-size: 12px; }

/* --- Live im Rennen (Phase S8) -----------------------------------------
   Die Rennseite: oben Rennuhr und Fortschritt, darunter Kaesten, die auf
   dem Handy untereinander rutschen. Gross, was man im Rennen auf einen
   Blick braucht: Countdown, Nachfuellmenge.                              */

.live { max-width: 1240px; }

.live__updated {
  padding: 12px 18px;
  font-size: 13.5px;
  color: var(--text);
  background: var(--accent-tint);
  border-radius: var(--radius);
  animation: meldung-rein var(--t) var(--ease) both;
}
.live__updated a { color: var(--accent-light); }

.live-progress {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
  padding: 16px 22px;
  background: var(--surface);
  border-radius: var(--radius-lg);
}
.live-progress__clock { display: flex; flex-direction: column; gap: 2px; }
.live-progress__label { font-family: var(--font-display); font-size: 12px; color: var(--dim); }
.live-progress__time { font-family: var(--font-display); font-size: 36px; font-weight: 600; line-height: 1.1; color: var(--text); }
.live-progress__bar { flex: 1 1 260px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.live-progress__text { font-size: 12.5px; color: var(--muted); }
.progress-bar { width: 100%; height: 10px; display: block; border-radius: var(--pill); overflow: hidden; }
.progress-bar__track { fill: var(--bg); }
.progress-bar__fill { fill: var(--accent); }

.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.live-card { gap: 12px; }
/* Der laufende Stint traegt oben die Farbe des Fahrers, wie die Spalte im Raster. */
.live-card[class*="driver--"] { box-shadow: inset 0 3px 0 var(--driver-colour); }
.live-card__who { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.live-card__spotter { font-size: 12.5px; color: var(--muted); }
.live-card__lead { font-size: 14px; color: var(--text-bright); }
.live-card__lead .stop__time { margin-left: 8px; }
.live-card .kv dd .driver-chip { justify-content: flex-end; font-family: var(--font-sans); }
.kv dd.live-card__big { font-size: 20px; color: var(--text); }
.live-card__tyres { display: flex; flex-direction: column; gap: 6px; }
.live-card__more { font-family: var(--font-display); font-size: 12.5px; color: var(--accent-light); }

.live-form .btn { align-self: flex-start; }
.live-form__clock { display: flex; gap: 8px; }
.live-form__clock .text-input { flex: 1; min-width: 0; font-family: var(--font-display); font-size: 18px; }
.live-form--inline { display: flex; flex-direction: column; gap: 10px; }
.live-form__fix { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
.live-form--reopen { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding-top: 10px; border-top: 1px solid var(--line-muted); }
.live-form--reopen .checkbox { font-size: 12.5px; color: var(--muted); }

.live-next { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.live-next__item {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: baseline;
  gap: 10px;
  padding: 7px 0 7px 10px;
  font-size: 13px;
  color: var(--text-bright);
  border-bottom: 1px solid var(--line-muted);
}
.live-next__item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: var(--pill);
  background: var(--driver-colour, var(--line));
}
.live-next__item:last-child { border-bottom: 0; }
.live-next__no { font-family: var(--font-display); font-size: 12px; color: var(--dim); }
.live-next__who { min-width: 0; overflow-wrap: anywhere; }
.live-next__when { text-align: right; font-family: var(--font-display); font-size: 12.5px; }

/* --- Responsive --------------------------------------------------------
   Ein einziger Umbruchpunkt reicht fuer diese Seitenzahl.                */

@media (max-width: 760px) {
  :root { --page-x: 20px; }

  /* Auf dem Handy bricht die Leiste um und wuerde festgeklebt zu viel vom
     Inhalt verdecken - dort also mitscrollen und weniger rund. */
  .site-header { position: static; gap: 8px 12px; margin: 10px 10px 0; padding: 8px 8px 8px 14px; border-radius: var(--radius-lg); }
  .brand__name { font-size: 15px; }
  .brand__name span { display: none; }
  /* Zwei Zeilen statt drei: Marke und Konto oben, Navigation darunter. */
  .site-header__end { display: contents; }
  .account { order: 1; margin-left: auto; }
  .account__link { padding-right: 4px; }
  .nav { order: 2; width: 100%; }
  .brand__emblem { height: 28px; }
  /* Mit Namen passt das Konto nicht mehr neben die Navigation und bekaeme
     eine eigene Zeile. Das Profilbild allein ist eindeutig genug. */
  .account__name { display: none; }

  .site-main { padding-top: 30px; padding-bottom: 44px; gap: 22px; }
  .site-main--centred { padding-top: 36px; gap: 30px; }

  /* Die Ueberschrift nimmt hier die volle Breite, ein Bogen dahinter stoerte
     nur beim Lesen. */
  .corner { display: none; }
  .hero { gap: 16px; padding-block: 8px; }
  .hero__emblem { width: 68px; }
  .hero__title { font-size: 26px; }

  .title { font-size: 28px; }
  .title--hero { font-size: 34px; }

  .action-grid,
  .action-grid--three { grid-template-columns: minmax(0, 1fr); }
  .action-card--search { grid-row: auto; }
  .action-card--search .action-card__title { font-size: 24px; }

  /* Strategieplanung */
  .event-card { grid-template-columns: minmax(0, 1fr) auto; gap: 12px 16px; padding: 16px 18px; }
  .event-card__when { grid-column: 1 / -1; flex-direction: row; gap: 10px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entry-card { padding: 16px 18px; }
  .field-row { grid-template-columns: minmax(0, 1fr); }
  /* Rundenzeit unter die Auswahl, sonst bleibt fuer Namen kaum Platz. */
  .lineup__head { display: none; }
  .lineup__row {
    grid-template-columns: minmax(0, 1fr) 96px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line-muted);
  }
  .lineup__row .select { grid-column: 1 / -1; }

  .tabs__action { margin-left: 0; padding-bottom: 8px; }

  /* Strategie: Das Raster bleibt ein Raster und scrollt seitwaerts, nur die
     feste Beschriftung links wird schmaler. Im Fahrerkasten fallen die
     Spalten weg, die man auch im Raster ablesen kann. */
  .sheet .sheet__table .sheet__label { width: 86px; min-width: 86px; padding-left: 10px; padding-right: 8px; font-size: 11px; }
  .sheet--edit .sheet__table .sheet__label { padding-left: 10px; }
  .sheet__stint { scroll-margin-left: 96px; }
  .sheet-box--drivers { flex-basis: 100%; }
  .mini-table__opt { display: none; }
  .share-bar { display: none; }
  .mini-table__share { min-width: 0; }
  .mini-table thead th { white-space: normal; }
  /* Lange Namen duerfen umbrechen, sonst faellt bei 277 px der Anteil raus. */
  .mini-table tbody th { white-space: normal; }
  .mini-table th, .mini-table td { padding-left: 5px; padding-right: 5px; }
  .share__value { min-width: 0; }
  .suggest__fields { grid-template-columns: minmax(0, 1fr); }
  .suggest__rotation .select { width: 100%; }
  .timeline { padding: 12px 14px; }
  .timeline__ticks { grid-template-columns: 84px minmax(0, 1fr); gap: 8px; }
  .timeline__row { grid-template-columns: 84px minmax(0, 1fr); gap: 8px; }
  .timeline__scale span { font-size: 11px; }
  .timeline__day { display: none; }
  .away-person { grid-template-columns: minmax(0, 1fr); padding: 12px 14px; }
  .date-time { grid-template-columns: minmax(0, 1fr); }
  .weather-rows__head { display: none; }
  .weather-rows__row { grid-template-columns: 96px minmax(0, 1fr); padding-bottom: 10px; border-bottom: 1px solid var(--line-muted); }
  .weather-rows__row input[name=weather_note] { grid-column: 1 / -1; }

  .game-tile { flex-direction: column; align-items: flex-start; gap: 16px; padding: 22px; }
  .game-tile__info { justify-content: space-between; width: 100%; }
  .game-tile__logo { height: 70px; }
  .game-tile__logo img { max-height: 70px; max-width: 180px; }
  .game-tile--soon { align-items: center; padding: 14px 8px 12px; gap: 8px; }
  .game-tile--soon .game-tile__logo { height: 36px; }
  .game-tile--soon .game-tile__logo img { max-height: 36px; max-width: 84px; }
  .game-tile--soon .game-tile__meta { font-size: 12px; }

  .panel { padding: 20px; border-radius: var(--radius-lg); }

  /* Auf schmalen Bildschirmen frisst der gestrichelte Rahmen sonst zu viel
     Platz weg - der Button-Text des Datei-Feldes ("Datei auswaehlen") plus
     der vom Browser angezeigte Dateiname passen dann nicht mehr nebeneinander
     und werden vom Browser selbst in der Mitte abgeschnitten. */
  .dropzone { padding: 22px 12px; }

  /* Ergebniskarte: Knopf unter den Text statt daneben, sonst wird beides zu schmal. */
  .setup-card { flex-direction: column; align-items: stretch; gap: 14px; padding: 14px; }
  .btn--compact { align-self: flex-start; }

  .result-head { flex-direction: column; align-items: flex-start; gap: 12px; }

  .site-footer { gap: 30px; padding: 24px var(--page-x) 28px; }
  .sponsor--simply-race { height: 28px; }
  .sponsor--artisans    { height: 40px; }
  .sponsor--sim3d       { height: 23px; }

  /* Rennseite: eine Spalte, die Rennuhr etwas kleiner. */
  .live-grid { grid-template-columns: minmax(0, 1fr); }
  .live-progress__time { font-size: 26px; }
}

/* Wer im Betriebssystem weniger Bewegung eingestellt hat, bekommt keine. */
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
  .game-tile:hover, .game-tile:active,
  .action-card:hover, .action-card:active,
  .btn:active { transform: none; }
}
