/* LoL Live – Grund-CSS: Design-Variablen, Hülle, Grundklassen und Bausteine.
   Farben nur über Variablen. Ansichten haben eigene Dateien mit Präfix (home-, match-, …).
   Werte nach docs/DESIGN.md („Broadcast-Terminal“). */

/* ---------- Design-Variablen ---------- */

:root {
  color-scheme: dark;

  /* Farben (dunkel). Kontrast geprüft: text/text-2/muted/accent auf bg/surface/surface-2 ≥ 4,5:1 */
  --bg: #0b0e13;
  --bg-elev: #10141b;
  --surface: #151a22;
  --surface-2: #1c222c;
  --surface-3: #262e3a;          /* kein --muted darauf */
  --border: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .16);
  --text: #eef2f7;
  --text-2: #aab4c5;
  --muted: #8591a3;
  --accent: #d2b172;
  --accent-soft: rgba(210, 177, 114, .14);
  --on-accent: #17120a;
  --accent-2: #1fd1c0;
  --blue: #5e9dff;
  --blue-soft: rgba(94, 157, 255, .15);
  --red: #ff5c6b;
  --red-soft: rgba(255, 92, 107, .15);
  --win: #3dd27f;
  --win-soft: rgba(61, 210, 127, .14);
  --loss: var(--red);
  --live: #ff3d4c;
  --live-badge: #dc1f2e;         /* Grund des LIVE-Abzeichens: weiß darauf 4,9:1 */
  --live-soft: rgba(255, 61, 76, .14);
  --on-live: #ffffff;
  --logo-bg: transparent;        /* Teamlogos sind meist hell auf dunkel gedacht */
  --header-bg: rgba(11, 14, 19, .86);
  --shadow-1: 0 0 0 0 transparent; /* „kein Schatten“, aber in Schatten-Listen kombinierbar (none wäre dort ungültig) */
  --shadow-2: 0 12px 32px -8px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .06);

  /* Drachenfarben (Spiel-Ansicht und Multi-View) */
  --drake-ocean: #2ec4b6;
  --drake-cloud: #b4c3d8;
  --drake-infernal: #ff7a45;
  --drake-mountain: #c9a26b;
  --drake-hextech: #6fc8ff;
  --drake-chemtech: #a6d84a;
  --drake-elder: #c79bff;

  /* Abstände (4-px-Skala) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-14: 56px;
  --grid-gap: 12px;              /* Kartenraster */

  /* Radien */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-pill: 999px;

  /* Bewegung */
  --dur-1: 120ms;
  --dur-2: 200ms;
  --dur-3: 320ms;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-in-out: cubic-bezier(.4, 0, .2, 1);

  /* Schrift-Skala (Desktop; Handy unten) */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-display-xl: 44px;
  --fs-display: 32px;
  --fs-h1: 28px;
  --fs-h2: 20px;
  --fs-h3: 16px;
  --fs-body: 15px;
  --fs-small: 13px;
  --fs-caption: 12px;
  --fs-eyebrow: 11px;
  --fs-num-lg: 22px;
  --lh-body: 1.5;
  --lh-small: 1.45;
  --lh-caption: 1.35;

  /* Hülle */
  --header-h: 60px;
  --tabbar-h: 60px;
  --content: 1200px;

  /* Alte Namen (Aliase, damit bestehende Ansichten nicht brechen) */
  --radius: var(--r-md);
  --radius-sm: var(--r-sm);
  --gap: var(--s-4);
  --shadow: var(--shadow-2);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5f9;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1f3f7;
  --surface-3: #e6e9ef;
  --border: rgba(16, 24, 40, .08);
  --border-strong: rgba(16, 24, 40, .16);
  --text: #0f1420;
  --text-2: #4a5567;
  --muted: #5f6a80;
  --accent: #7a5c17;
  --accent-soft: rgba(122, 92, 23, .12);
  --on-accent: #ffffff;
  --accent-2: #047a70;
  --blue: #2458d6;
  --blue-soft: rgba(36, 88, 214, .12);
  --red: #cf1f33;
  --red-soft: rgba(207, 31, 51, .1);
  --win: #1b7f3b;
  --win-soft: rgba(27, 127, 59, .12);
  --live: #d81e2d;
  --live-badge: #c81a28;
  --live-soft: rgba(216, 30, 45, .1);
  --logo-bg: #1b2330;            /* dunkle Kachel unter Logos, damit weiße Logos sichtbar bleiben */
  --header-bg: rgba(255, 255, 255, .86);
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-2: 0 12px 32px -8px rgba(16, 24, 40, .18), 0 0 0 1px rgba(16, 24, 40, .06);
  --drake-ocean: #0f9488;
  --drake-cloud: #66788f;
  --drake-infernal: #d9531a;
  --drake-mountain: #8f6a33;
  --drake-hextech: #1f7fc4;
  --drake-chemtech: #5b8a10;
  --drake-elder: #8a4fd6;
}

@media (max-width: 759.98px) {
  :root {
    --fs-display-xl: 36px;
    --fs-display: 28px;
    --fs-h1: 24px;
    --fs-h2: 18px;
    --fs-num-lg: 20px;
    --grid-gap: 10px;
    --header-h: 52px;
  }
}

/* ---------- Grundlagen ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: var(--surface-3) transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-feature-settings: "cv11", "ss01"; /* tabellarische Ziffern nur über .num und Zahl-Bausteine */
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

h1, h2, h3, h4 { margin: 0; color: var(--text); }
h1 { font-size: var(--fs-h1); line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: var(--fs-h2); line-height: 1.25; font-weight: 700; letter-spacing: -.015em; }
h3 { font-size: var(--fs-h3); line-height: 1.3; font-weight: 650; letter-spacing: -.01em; }
h4 { font-size: var(--fs-body); line-height: 1.4; font-weight: 600; }
p { margin: 0; }

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

img, svg { vertical-align: middle; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:disabled { cursor: not-allowed; }

::selection { background: var(--accent-soft); }

/* Fokus (2.6) */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

[hidden] { display: none !important; }

.icon { flex: none; }

/* ---------- Typografie-Klassen (2.2) ---------- */

.display-xl, .display, .num-lg, .num { font-variant-numeric: tabular-nums; }
.display-xl { font-size: var(--fs-display-xl); line-height: 1; font-weight: 800; letter-spacing: -.03em; }
.display { font-size: var(--fs-display); line-height: 1.05; font-weight: 800; letter-spacing: -.025em; }
.h1 { font-size: var(--fs-h1); line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
.h2 { font-size: var(--fs-h2); line-height: 1.25; font-weight: 700; letter-spacing: -.015em; }
.h3 { font-size: var(--fs-h3); line-height: 1.3; font-weight: 650; letter-spacing: -.01em; }
.body-strong { font-size: var(--fs-body); font-weight: 600; }
.small { font-size: var(--fs-small); line-height: var(--lh-small); }
.caption { font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 500; }
.eyebrow {
  font-size: var(--fs-eyebrow);
  line-height: 1;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.num-lg { font-size: var(--fs-num-lg); line-height: 1; font-weight: 700; letter-spacing: -.01em; }
.prose { max-width: 64ch; }
.text-2 { color: var(--text-2); }

/* ---------- Hülle: Kopfzeile, Navigation, Inhalt, Fußzeile ---------- */

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}
.skip-link:focus { top: calc(8px + env(safe-area-inset-top)); text-decoration: none; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: env(safe-area-inset-top);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
}

.app-header-inner {
  display: flex;
  align-items: center;
  gap: var(--s-6);
  max-width: var(--content);
  height: var(--header-h);
  margin: 0 auto;
  padding: 0 max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left));
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-logo { flex: none; }
.brand-logo-hex { fill: var(--surface-2); stroke: var(--accent); stroke-width: 1.8; stroke-linejoin: round; }
.brand-logo-pulse { fill: none; stroke: var(--accent-2); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.brand-accent { color: var(--accent); }

.app-nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: color var(--dur-1), background-color var(--dur-1);
}
.nav-link:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
/* Aktiv: Fläche + Gold-Icon, kein Unterstrich */
.nav-link[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.nav-link[aria-current="page"] .nav-icon { color: var(--accent); }
.nav-icon { display: inline-flex; width: 22px; height: 22px; }
.nav-icon:empty { display: none; }

.nav-count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--live-badge);
  color: var(--on-live);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  animation: pop-in var(--dur-2) var(--ease);
}

/* Kopfzeilen-Aktion (Slot #header-action): nur auf dem Handy sichtbar, Ansichten füllen ihn über ctx.setHeaderAction */
.header-action { display: none; }

.app-main {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--content);
  margin: 0 auto;
  padding: var(--s-8) max(24px, env(safe-area-inset-right)) var(--s-10) max(24px, env(safe-area-inset-left));
  min-width: 0;
}
.app-main:focus { outline: none; }

.app-footer {
  padding: var(--s-6) var(--s-4);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: var(--fs-caption);
  line-height: var(--lh-caption);
  font-weight: 500;
  text-align: center;
}

.app-center { text-align: center; }

/* Handy: Navigation als Tab-Leiste unten */
@media (max-width: 759.98px) {
  body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }

  /* backdrop-filter würde die feste Tab-Leiste an die Kopfzeile binden → hier deckend ohne Blur */
  .app-header { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }

  .app-header-inner {
    gap: var(--s-3);
    padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  }

  .header-action {
    display: flex;
    align-items: center;
    gap: var(--s-1);
    margin-left: auto;
    margin-right: -6px;
  }
  .header-action:empty { display: none; }
  .header-action .btn-icon { width: 44px; height: 44px; }

  .app-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: flex;
    align-items: stretch;
    gap: 0;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    background: var(--header-bg);
    border-top: 1px solid var(--border);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    backdrop-filter: saturate(160%) blur(14px);
  }

  .nav-link {
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    height: auto;
    padding: 6px 2px;
    border-radius: 0;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: -.01em;
  }
  /* Aktiv: Gold-Icon + Gold-Label, kein Strich */
  .nav-link:hover, .nav-link[aria-current="page"] { background: none; }
  .nav-link[aria-current="page"] { color: var(--accent); }
  .nav-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .nav-count { position: absolute; top: 5px; left: calc(50% + 6px); min-width: 16px; height: 16px; font-size: 10px; }

  .app-main { padding: var(--s-5) max(16px, env(safe-area-inset-right)) var(--s-8) max(16px, env(safe-area-inset-left)); }
}

/* ---------- Grundklassen für Ansichten ---------- */

.view { min-width: 0; animation: view-in var(--dur-3) var(--ease); }

.page { display: flex; flex-direction: column; gap: var(--s-6); min-width: 0; }

/* Seitenkopf: optional Eyebrow, h1, Untertitel; rechts Aktionen */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-3) var(--s-4);
  min-width: 0;
}
.page-head h1 { min-width: 0; overflow-wrap: anywhere; }
.page-head > .row, .page-head-actions { margin-left: auto; }
.page-head-actions { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2); min-width: 0; }
.page-head-text { display: flex; flex-direction: column; gap: var(--s-1); min-width: 0; }
.page-sub { color: var(--text-2); font-size: var(--fs-small); line-height: var(--lh-small); max-width: 64ch; }
.page-eyebrow { color: var(--text-2); }
.page-eyebrow a { color: var(--text-2); }
.page-eyebrow a:hover { color: var(--text); }

/* Hero (Liga, Team, Match-Kopf): die einzige Stelle mit Verlauf */
.page-hero {
  position: relative;
  min-width: 0;
  padding: var(--s-5) var(--s-6);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--accent-soft), transparent 120px), var(--surface);
  box-shadow: var(--shadow-1);
}
.page-hero.is-live {
  border-color: color-mix(in srgb, var(--live) 45%, var(--border));
  background: linear-gradient(180deg, var(--live-soft), transparent 120px), var(--surface);
}

/* Abschnitt: Kopf → Inhalt 16 (Handy 12); Abschnitt + Abschnitt = 40 (Handy 32) zusammen mit dem .page-gap */
.section { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
.page > .section + .section { margin-top: var(--s-4); }

.section-head { display: flex; align-items: center; gap: var(--s-2) var(--s-3); min-width: 0; }
.section-head h2 { display: inline-flex; align-items: center; gap: var(--s-2); min-width: 0; }
.section-head-action { margin-left: auto; }

/* Zähler-Pille */
.count {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 20px;
  padding: 0 7px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* Tagestitel in Listen */
.day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  min-width: 0;
  padding-bottom: var(--s-2);
  border-bottom: 1px solid var(--border);
}
.day-head h3 { display: inline-flex; align-items: center; gap: var(--s-2); min-width: 0; }
.day-head-sub { color: var(--muted); font-weight: 500; }
.day-head-count { flex: none; color: var(--muted); font-size: var(--fs-caption); font-weight: 500; font-variant-numeric: tabular-nums; }

.card {
  min-width: 0;
  padding: var(--s-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
}
.card--lg { padding: var(--s-5); }
.card--flush { padding: 0; overflow: hidden; }
.card--flush > .card-head { padding: var(--s-4) var(--s-4) 0; }
.card--flush > .table-wrap, .card--flush .table-wrap { border: 0; border-radius: 0; box-shadow: none; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
  min-width: 0;
}
.card-head h2, .card-head h3 { font-size: var(--fs-h3); font-weight: 650; letter-spacing: -.01em; }

.grid { display: grid; gap: var(--grid-gap); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 760px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.row { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2); min-width: 0; }
.stack { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }

.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

.side-blue { color: var(--blue); }
.side-red { color: var(--red); }
.win { color: var(--win); }
.loss { color: var(--loss); }

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Logos (Teams, Ligen) im hellen Design auf dunklem Grund, damit weiße Logos sichtbar bleiben */
.logo-bg { background: var(--logo-bg); border-radius: var(--r-xs); }
.logo-tile { flex: none; object-fit: contain; background: var(--logo-bg); border-radius: var(--r-xs); }
:root[data-theme="light"] img.logo-tile { padding: 2px; }

/* Waagrechte Scroll-Reihen mit weichem Rand (Klassen per util.scrollShadows) */
.scroll-fade.can-right:not(.can-left) {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
}
.scroll-fade.can-left:not(.can-right) {
  -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 32px), transparent);
  mask-image: linear-gradient(to left, #000 calc(100% - 32px), transparent);
}
.scroll-fade.can-left.can-right {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent);
}
/* Chip-Reihe (3.6): gleiche Logik, schmalerer Rand (24 px) */
.chips-scroll.can-right:not(.can-left) {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
}
.chips-scroll.can-left:not(.can-right) {
  -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(to left, #000 calc(100% - 24px), transparent);
}
.chips-scroll.can-left.can-right {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent);
}

/* ---------- Buttons (3.9) ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color var(--dur-1), border-color var(--dur-1), color var(--dur-1), filter var(--dur-1);
}
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

.btn-primary { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.btn-primary:hover { background: var(--accent); border-color: transparent; filter: brightness(1.06); }
.btn-primary:active { filter: brightness(.96); }
.btn-primary:focus-visible { outline-color: var(--text); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; color: var(--text); }

.btn-danger { background: transparent; border-color: transparent; color: var(--red); }
.btn-danger:hover { background: var(--red-soft); border-color: transparent; color: var(--red); }

.btn-sm { height: 30px; padding: 0 10px; gap: 6px; font-size: 13px; }
.btn-lg { height: 44px; padding: 0 18px; font-size: 15px; }
.btn-icon { width: 36px; padding: 0; }
.btn-sm.btn-icon { width: 30px; }
.btn-lg.btn-icon { width: 44px; }

/* Lade-Zustand: erstes Icon wird zum Spinner, Breite bleibt */
.btn.is-busy { pointer-events: none; }
.btn.is-busy > .icon:first-child { display: none; }
.btn.is-busy::before {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  margin: 0 2px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* ---------- Abzeichen (3.5) ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 20px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.badge-live { background: var(--live-badge); color: var(--on-live); }
.badge-done { background: var(--surface-3); color: var(--text-2); }
.badge-accent, .badge-warn { background: var(--accent-soft); color: var(--accent); }
.badge-ok { background: var(--win-soft); color: var(--win); }
.badge-error { background: var(--red-soft); color: var(--red); }
/* hell: Rot auf Rot-soft nur 4,2:1 → Text dunkel, roter Punkt */
:root[data-theme="light"] .badge-error { color: var(--text); }
:root[data-theme="light"] .badge-error::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: live-pulse 1.8s ease-out infinite;
}

/* Einzelner Live-Punkt (Abschnittskopf, Zeilen, Tagestitel) */
.live-dot {
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live);
  color: var(--live);
  animation: live-pulse 1.8s ease-out infinite;
}

/* ---------- Chips (3.6) ---------- */

.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); min-width: 0; }
.chips-scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; scroll-snap-type: x proximity; }
.chips-scroll::-webkit-scrollbar { display: none; }
.chips-scroll > .chip { scroll-snap-align: start; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  transition: background-color var(--dur-2), border-color var(--dur-2), color var(--dur-2);
}
.chip:has(.chip-img) { padding-left: 8px; }
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.active { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 60%, transparent); color: var(--text); }
.chip-img { flex: none; width: 18px; height: 18px; object-fit: contain; border-radius: 4px; background: var(--logo-bg); }
:root[data-theme="light"] .chip-img { padding: 2px; }

/* ---------- Reiter (3.7) ---------- */

.tabs {
  display: flex;
  gap: var(--s-1);
  min-width: 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 10px 14px 12px;
  border: 0;
  background: none;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: color var(--dur-2);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); }
.tab.active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}
.tab:focus-visible { outline-offset: -2px; border-radius: var(--r-sm); }

/* Reiter mobil klebrig unter der Kopfzeile */
@media (max-width: 759.98px) {
  .tabs--sticky {
    position: sticky;
    top: calc(var(--header-h) + env(safe-area-inset-top));
    z-index: 30;
    background: var(--bg);
  }
}

/* Segment (Werkzeuge, Spiel-Reiter, segmented()) */
.tabs--segment, .segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  width: max-content;
  max-width: 100%;
  padding: 3px;
  border: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  overflow-x: auto;
  scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.tabs--segment .tab, .segmented-opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: none;
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: color var(--dur-2), background-color var(--dur-2), box-shadow var(--dur-2);
}
.tabs--segment .tab:hover, .segmented-opt:hover { color: var(--text); }
.tabs--segment .tab.active, .segmented-opt[aria-checked="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-1), 0 0 0 1px var(--border);
}
.tabs--segment .tab.active::after { content: none; }
.tabs--segment .tab:focus-visible, .segmented-opt:focus-visible { outline-offset: 0; }
.segmented--full { display: flex; width: 100%; }
.segmented--full .segmented-opt { flex: 1 1 0; }

/* ---------- Schalter (3.12) ---------- */

.switch { position: relative; display: inline-flex; align-items: center; gap: var(--s-3); min-width: 0; cursor: pointer; }
.switch-label { min-width: 0; color: var(--text); font-size: 14px; font-weight: 600; }
.switch-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: inherit;
}
.switch-track {
  position: relative;
  flex: none;
  width: 40px;
  height: 24px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  background: var(--surface-3);
  transition: background-color var(--dur-2), border-color var(--dur-2);
}
.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-2);
  transition: transform var(--dur-2) var(--ease), background-color var(--dur-2);
}
.switch-input:checked + .switch-track { background: var(--accent); border-color: transparent; }
.switch-input:checked + .switch-track .switch-thumb { transform: translateX(16px); background: var(--on-accent); }
.switch-input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch:has(.switch-input:disabled) { opacity: .5; cursor: not-allowed; }

/* ---------- Auswahlliste, Suche (3.12) ---------- */

.select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 36px;
  max-width: 100%;
  min-width: 0;
  color: var(--text-2);
  font-size: 14px;
  vertical-align: middle;
}
.select-wrap > .select { width: 100%; height: 100%; font-size: inherit; }
.select-chevron {
  position: absolute;
  right: 10px;
  top: 50%;
  display: inline-flex;
  transform: translateY(-50%);
  pointer-events: none;
}

.select {
  height: 36px;
  max-width: 100%;
  min-width: 0;
  padding: 0 34px 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background-color: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  -webkit-appearance: none;
  appearance: none;
  text-overflow: ellipsis;
  transition: border-color var(--dur-1), box-shadow var(--dur-1);
}
/* <select> ohne Hülle: Pfeil als Verlauf (Fallback) */
.select:not(.select-wrap > .select) {
  background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.select:hover { border-color: var(--border-strong); }
.select:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.select-wrap.is-active > .select, .select.is-active { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.select-wrap:has(.select:disabled) { opacity: .55; }

.input-search {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  height: 40px;
  color: var(--muted);
}
.input-search > .icon { position: absolute; left: 12px; pointer-events: none; }
.input-search input {
  width: 100%;
  height: 100%;
  padding: 0 36px 0 38px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color var(--dur-1), box-shadow var(--dur-1);
}
.input-search input::placeholder { color: var(--muted); opacity: 1; }
.input-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.input-search input:hover { border-color: var(--border-strong); }
.input-search input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-search-clear {
  position: absolute;
  right: 4px;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--text-2);
}
.input-search-clear:hover { background: var(--surface-3); color: var(--text); }
.input-search:has(input:placeholder-shown) .input-search-clear { display: none; }

.field-label { color: var(--text); font-size: 13px; font-weight: 600; }
.field-help { color: var(--text-2); font-size: var(--fs-small); line-height: var(--lh-small); }

/* ---------- Tabellen (3.8) ---------- */

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
/* Scroll-Hinweise links/rechts (Klassen per util.scrollShadows) – Verlauf im Hintergrund, bleibt beim Scrollen stehen */
.table-wrap { --table-hint: color-mix(in srgb, var(--text) 20%, transparent); }
:root[data-theme="light"] .table-wrap { --table-hint: color-mix(in srgb, var(--text) 10%, transparent); }
.table-wrap.can-left,
.table-wrap.can-right {
  background-repeat: no-repeat;
  background-attachment: scroll;
}
.table-wrap.can-right:not(.can-left) {
  background-image: linear-gradient(to left, var(--table-hint), transparent);
  background-position: right center;
  background-size: 32px 100%;
}
.table-wrap.can-left:not(.can-right) {
  background-image: linear-gradient(to right, var(--table-hint), transparent);
  background-position: left center;
  background-size: 32px 100%;
}
.table-wrap.can-left.can-right {
  background-image: linear-gradient(to right, var(--table-hint), transparent), linear-gradient(to left, var(--table-hint), transparent);
  background-position: left center, right center;
  background-size: 32px 100%, 32px 100%;
}
/* Feste Höhe mit klebrigem Kopf (z. B. Statistik, Desktop) */
@media (min-width: 760px) {
  .table-wrap--scroll { max-height: calc(100dvh - 180px); overflow: auto; }
  /* Kopf über klebriger Erstspalte, Ecke ganz oben */
  .table-wrap--scroll .table th { z-index: 2; }
  .table-wrap--scroll .table th:first-child { z-index: 3; }
}

.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th, .table td { padding: 10px 12px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--border); }
.table th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 40px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.table td { height: 44px; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color var(--dur-1); }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.num { font-weight: 500; }
.table .is-top { color: var(--accent); font-weight: 700; }
.table a:focus-visible { outline-offset: -2px; }

.table th.sortable { padding: 0; }
.th-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}
.th-btn:hover { color: var(--text); }
.th-btn:focus-visible { outline-offset: -2px; }
.table th.num .th-btn { justify-content: flex-end; }
.sort-ind { display: inline-block; width: 10px; font-size: 10px; line-height: 1; }
.th-btn:hover .sort-ind::before { content: "▾"; opacity: .5; }
th[aria-sort="ascending"] .th-btn, th[aria-sort="descending"] .th-btn { color: var(--text); }
th[aria-sort="ascending"] .sort-ind::before { content: "▲"; color: var(--accent); opacity: 1; }
th[aria-sort="descending"] .sort-ind::before { content: "▼"; color: var(--accent); opacity: 1; }

@media (max-width: 759.98px) {
  .table th, .table td { padding: 8px 10px; }
  .th-btn { padding: 0 10px; }
}

/* ---------- Lade-, Leer- und Fehlerzustände (3.10) ---------- */

.skel-group { display: flex; flex-direction: column; gap: var(--s-3); padding: 4px 0; }
.skel {
  border-radius: var(--r-xs);
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
.skel-line { height: 14px; }
.skel-block { height: 96px; border-radius: var(--r-md); }
.skel-card { height: 112px; border-radius: var(--r-md); }
.skel-hero { height: 120px; border-radius: var(--r-lg); }
.skel-rows {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}
.skel-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 52px minmax(0, 1fr);
  align-items: center;
  gap: var(--s-3);
  height: 52px;
  padding: 0 var(--s-4);
  border-bottom: 1px solid var(--border);
}
.skel-row:last-child { border-bottom: 0; }
.skel-row .skel { height: 12px; }

@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.spinner {
  width: 28px;
  height: 28px;
  margin: 24px auto;
  border: 3px solid var(--surface-3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.spinner-inline { display: inline-block; width: 14px; height: 14px; margin: 0; border-width: 2px; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: var(--s-10) var(--s-4);
  color: var(--text-2);
  font-size: 14px;
  text-align: center;
}
/* Leerzustand immer gestrichelt */
.state-empty { border: 1px dashed var(--border-strong); border-radius: var(--r-md); }
.state-error { border: 1px solid color-mix(in srgb, var(--red) 40%, var(--border)); border-radius: var(--r-md); }
.state-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 4px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
}
.state-title { color: var(--text); font-size: 16px; font-weight: 700; }
.state-text { max-width: 44ch; font-size: var(--fs-small); line-height: var(--lh-small); }
.state .btn { margin-top: 6px; }
.state-error .state-icon { background: var(--red-soft); color: var(--red); }
.state--compact { gap: 8px; padding: var(--s-5) var(--s-4); }
.state--compact .state-icon { width: 40px; height: 40px; margin-bottom: 0; }
.state--compact .state-text { max-width: 34ch; }

/* Inline-Hinweis */
.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  min-width: 0;
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.4;
}
.notice > .icon { color: var(--text-2); }
.notice-text { flex: 1 1 auto; min-width: 0; }
.notice > .icon { flex: none; }
.notice-text a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.notice-action { flex: none; margin-left: auto; }
.notice--warn { background: var(--accent-soft); }
.notice--warn > .icon { color: var(--accent); }
.notice--error { background: var(--red-soft); }
.notice--error > .icon { color: var(--red); }
.notice--ok { background: var(--win-soft); }
.notice--ok > .icon { color: var(--win); }
/* Schmal: Icon bleibt links neben dem Text (Basis 0 statt Textbreite), nur die Aktion rutscht bei Bedarf in eine eigene Zeile */
@media (max-width: 479.98px) {
  .notice { flex-wrap: wrap; }
  .notice-text { flex: 1 1 0; min-width: 55%; }
}

/* ---------- Toast (3.11) ---------- */

.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
  width: max-content;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--bg-elev);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-2);
  animation: toast-in var(--dur-2) var(--ease);
  transition: opacity .25s, transform .25s;
}
:root[data-theme="light"] .toast { background: var(--surface); }
.toast-icon-check { color: var(--win); }
.toast-icon-warning, .toast-icon-close { color: var(--red); }
.toast-action { pointer-events: auto; margin: -4px -8px -4px 4px; color: var(--accent); }
.toast-out { opacity: 0; transform: translateY(8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 759.98px) {
  .toasts { bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom)); }
}

/* ---------- Teamlogo (2.9) ---------- */

.tlogo { display: inline-block; flex: none; object-fit: contain; border-radius: var(--r-xs); background: var(--logo-bg); }
/* Noch nicht geladen: neutraler Platzhalter statt der dunklen Logo-Kachel (wirkte hell wie ein fehlendes Bild) */
img.tlogo:not(.is-loaded) { background: var(--surface-3); }
/* Kachel-Innenabstand nur im hellen Design (dunkel: kein Grund) */
:root[data-theme="light"] img.tlogo { padding: 2px; }
:root[data-theme="light"] img.tlogo-pad-m { padding: 4px; }
:root[data-theme="light"] img.tlogo-pad-l { padding: 8px; }
.tlogo-pad-l { border-radius: var(--r-sm); }
.tlogo-fallback {
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border-radius: var(--r-xs);
  background: var(--surface-3);
  color: var(--text-2);
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1;
  white-space: nowrap;
  text-overflow: clip;
}
.tlogo-tbd { background: transparent; border: 1px dashed var(--border-strong); color: var(--muted); font-weight: 700; }

/* ---------- Match-Karte (3.4) ---------- */

.mcard {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
  transition: border-color var(--dur-1), background-color var(--dur-1);
}
.mcard:has(.mcard-link):hover { border-color: var(--border-strong); background: var(--surface-2); }
:root[data-theme="light"] .mcard:has(.mcard-link):hover { background: var(--surface); }

.mcard-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.mcard-link:focus-visible { outline-offset: -2px; }
.mcard button { position: relative; z-index: 2; }

/* Zustände: Favorit (Gold-Kante), bald (Gold-Rahmen), live (rote Kante, gewinnt gegen Favorit) */
.mcard-is-fav { box-shadow: inset 3px 0 0 var(--accent), var(--shadow-1); }
.mcard-soon { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.mcard-live,
.mcard-live:has(.mcard-link):hover { border-color: color-mix(in srgb, var(--live) 45%, var(--border)); box-shadow: inset 3px 0 0 var(--live), var(--shadow-1); }
.mcard-live:has(.mcard-link):hover { border-color: color-mix(in srgb, var(--live) 65%, var(--border)); }

.mcard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  min-height: 20px;
  min-width: 0;
}
.mcard-league {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.mcard-league-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.mcard-league-logo { flex: none; width: 16px; height: 16px; object-fit: contain; border-radius: 3px; background: var(--logo-bg); }
:root[data-theme="light"] .mcard-league-logo { padding: 1px; }
.mcard-status { display: inline-flex; align-items: center; gap: var(--s-2); flex: none; color: var(--text-2); font-size: var(--fs-caption); font-weight: 500; }
.mcard-status.muted { color: var(--muted); }
.mcard-time { color: var(--text); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mcard-countdown {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.mcard-teams { display: flex; flex-direction: column; gap: var(--s-2); }
.mcard-team { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); }
.mcard-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mcard-name-short { display: none; }
.mcard-fav { display: inline-flex; flex: none; color: var(--accent); }
.mcard-score {
  flex: none;
  min-width: 2ch;
  color: var(--text-2);
  font-size: var(--fs-num-lg);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -.01em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.mcard-score.is-hidden { color: var(--muted); }
.mcard-score.is-lead { color: var(--text); }

.mcard-team.win { color: var(--text); }
.mcard-team.win .mcard-name { font-weight: 700; }
.mcard-team.win .mcard-score, .mcard-score.is-win { color: var(--accent); }
.mcard-team.loss .mcard-name { color: var(--muted); }
.mcard-team.loss .tlogo { opacity: .55; }
.mcard-team.is-tbd .mcard-name { color: var(--muted); font-weight: 500; }

.mcard-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); min-height: 20px; margin-top: -2px; }
.mcard-bo { color: var(--muted); font-size: var(--fs-caption); font-weight: 500; }
.mcard-show { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); font-size: 15px; font-weight: 600; }
.mcard-show > .icon { color: var(--text-2); }

/* Aufdecken: Werte blenden mit Unschärfe ein */
.mcard-revealing .mcard-score,
.mcard-revealing .mcard-row-score { animation: reveal-in var(--dur-3) var(--ease); }
@keyframes reveal-in { from { opacity: 0; filter: blur(6px); } }

@media (max-width: 339.98px) {
  .mcard-name-long { display: none; }
  .mcard-name-short { display: inline; }
}

/* Hero (Live auf der Übersicht): Teams groß, rechts optional ein Streifen (opts.aside) */
.mcard--hero { padding: 0; container-type: inline-size; }
.mcard-hero-in { display: flex; flex-direction: column; min-width: 0; }
.mcard-hero-main { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; padding: var(--s-5) var(--s-6); }
.mcard-hero-aside { position: relative; z-index: 2; min-width: 0; padding: var(--s-4) var(--s-6); border-top: 1px solid var(--border); }
.mcard--hero .mcard-teams { gap: var(--s-3); }
.mcard--hero .mcard-team { gap: var(--s-3); }
.mcard--hero .mcard-name { font-size: 18px; }
.mcard--hero .mcard-team:not(.loss) .mcard-name { font-weight: 700; }
.mcard--hero .mcard-score { font-size: 28px; font-weight: 800; letter-spacing: -.025em; }
@container (min-width: 640px) {
  .mcard-hero-in { flex-direction: row; align-items: stretch; }
  .mcard-hero-main { flex: 1 1 56%; justify-content: center; }
  .mcard-hero-aside { flex: 1 1 44%; border-top: 0; border-left: 1px solid var(--border); padding: var(--s-5) var(--s-6); }
}
@media (max-width: 759.98px) {
  .mcard-hero-main { padding: var(--s-4); }
  .mcard-hero-aside { padding: var(--s-3) var(--s-4) var(--s-4); }
}

/* Zeile (Listen): Höhe 52 (Handy 56), Hairline unten. Einzeln (ohne .mrows) mit eigenem Rahmen. */
.mrows {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
}
.mcard-row {
  display: block;
  padding: 0;
  container-type: inline-size;
}
.mrows > .mcard-row, .mrows > .mtbd, .mtbd-list > .mcard-row {
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.mrows > :last-child { border-bottom: 0; }
.mrows > .mcard-row:has(.mcard-link):hover, .mtbd-list > .mcard-row:has(.mcard-link):hover { background: var(--surface-2); }
.mrows > .mcard-row.mcard-is-fav, .mtbd-list > .mcard-row.mcard-is-fav { box-shadow: inset 3px 0 0 var(--accent); }
.mrows > .mcard-row.mcard-live, .mtbd-list > .mcard-row.mcard-live { box-shadow: inset 3px 0 0 var(--live); }

.mcard-row-in {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 52px minmax(0, 1fr);
  align-items: center;
  column-gap: var(--s-3);
  min-height: 52px;
  padding: 0 var(--s-4);
}
.mcard-row.is-date .mcard-row-in { grid-template-columns: 56px minmax(0, 1fr) 52px minmax(0, 1fr); }
.mcard-row.has-reveal .mcard-row-in { grid-template-columns: 48px minmax(0, 1fr) 52px minmax(0, 1fr) auto; }
.mcard-row.is-date.has-reveal .mcard-row-in { grid-template-columns: 56px minmax(0, 1fr) 52px minmax(0, 1fr) auto; }
.mcard-row-when { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--text); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mcard-row-when.muted { color: var(--muted); font-weight: 500; }
/* Live: Punkt statt Uhrzeit, darunter „Spiel 2“ (caption, --text-2) – kein farbiger Kleintext */
.mcard-row-when.is-live { flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; }
.mcard-row-game { color: var(--text-2); font-size: var(--fs-caption); font-weight: 500; line-height: 1; }
.mcard-row .mcard-team { gap: var(--s-2); }
.mcard-row .mcard-name { font-size: 14px; }
/* Team A gespiegelt (Name rechtsbündig, Logo am Spielstand) – liest sich als „A 2:1 B“ (Abweichung von 3.4 bewusst) */
.mcard-row .mcard-team-a { flex-direction: row-reverse; }
.mcard-row .mcard-team-a .mcard-name { text-align: right; }
.mcard-row-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.mcard-row-score .is-win { color: var(--accent); }
.mcard-row-score .is-lead { color: var(--text); }
.mcard-row-score.is-hidden, .mcard-row-score .mcard-sep { color: var(--muted); }
.mcard-row-vs { color: var(--muted); font-size: var(--fs-caption); font-weight: 500; }
.mcard-row-meta, .mcard-row-bo { display: none; }
.mcard-row-meta { min-width: 0; overflow: hidden; color: var(--muted); text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.mcard-row-bo { color: var(--muted); font-size: var(--fs-caption); font-weight: 500; text-align: right; }
.mcard-row .spoiler-reveal-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mcard-row .mcard-show { grid-column: 2 / -1; font-size: 14px; }
.mcard-row.mcard-compact .mcard-name-long { display: none; }
.mcard-row.mcard-compact .mcard-name-short { display: inline; }

/* Schmal (Handy): Zeit und Spielstand je 44 px, Auge in der Spielstand-Spalte, Stern klein direkt am Kürzel.
   Kürzel mit 4 Zeichen (TLAW, UCAM) passen so auch mit Auge und Stern ungekürzt. */
@container (max-width: 419.98px) {
  .mcard-row-in .mcard-name-long { display: none; }
  .mcard-row-in .mcard-name-short { display: inline; }
  .mcard-row-in,
  .mcard-row.has-reveal .mcard-row-in { grid-template-columns: 44px minmax(0, 1fr) 44px minmax(0, 1fr); }
  .mcard-row.is-date .mcard-row-in,
  .mcard-row.is-date.has-reveal .mcard-row-in { grid-template-columns: 52px minmax(0, 1fr) 44px minmax(0, 1fr); }
  /* Auge ersetzt „– : –“: feste Plätze, damit Team B nicht in die nächste Zeile rutscht */
  .mcard-row.has-reveal .mcard-row-score { display: none; }
  .mcard-row.has-reveal .mcard-team-b { grid-area: 1 / 4; }
  .mcard-row.has-reveal .spoiler-reveal { grid-area: 1 / 3; justify-self: center; width: 44px; height: 44px; padding: 0; }
  /* Name nur so breit wie nötig, Stern (12 px) direkt daneben statt eigener Spalte */
  .mcard-row .mcard-name { flex: 0 1 auto; }
  .mcard-row .mcard-fav { margin-inline-start: -4px; }
  .mcard-row .mcard-team-a .mcard-fav { margin-inline: 0 -4px; }
  .mcard-row .mcard-fav .icon { width: 12px; height: 12px; }
}
@container (min-width: 620px) {
  .mcard-row-in { grid-template-columns: 48px minmax(0, 1fr) 52px minmax(0, 1fr) minmax(0, 220px) 40px; }
  .mcard-row.is-date .mcard-row-in { grid-template-columns: 56px minmax(0, 1fr) 52px minmax(0, 1fr) minmax(0, 220px) 40px; }
  .mcard-row.has-reveal .mcard-row-in { grid-template-columns: 48px minmax(0, 1fr) 52px minmax(0, 1fr) minmax(0, 220px) 40px auto; }
  .mcard-row.is-date.has-reveal .mcard-row-in { grid-template-columns: 56px minmax(0, 1fr) 52px minmax(0, 1fr) minmax(0, 220px) 40px auto; }
  .mcard-row-meta, .mcard-row-bo { display: block; }
}
@media (max-width: 759.98px) {
  .mcard-row-in { min-height: 56px; padding: 0 var(--s-3); column-gap: 10px; }
}

/* Platzhalter-Gruppe: mehrere Matches mit zwei offenen Teams als eine Zeile */
.mtbd {
  grid-column: 1 / -1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.mrows > .mtbd { border-bottom: 1px dashed var(--border-strong); }
.mrows > .mtbd:last-child { border-bottom: 0; }
.mtbd-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto 18px;
  align-items: center;
  column-gap: var(--s-3);
  width: 100%;
  min-height: 52px;
  padding: 6px var(--s-4);
  border: 0;
  background: none;
  color: var(--text);
  text-align: left;
  transition: background-color var(--dur-1);
}
.mtbd-row:hover { background: var(--surface-2); }
.mtbd-row:focus-visible { outline-offset: -2px; }
.mtbd-times { color: var(--text-2); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mtbd-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mtbd-league { min-width: 0; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.mtbd-text { color: var(--muted); font-size: var(--fs-small); line-height: 1.3; }
.mtbd-times-short, .mtbd-text-short { display: none; }
.mtbd-bo { color: var(--muted); font-size: var(--fs-caption); font-weight: 500; }
.mtbd-chev { display: inline-flex; color: var(--text-2); transition: transform var(--dur-2) var(--ease); }
.mtbd-row[aria-expanded="true"] .mtbd-chev { transform: rotate(180deg); }
.mtbd-list { border-top: 1px dashed var(--border-strong); background: var(--bg-elev); }
:root[data-theme="light"] .mtbd-list { background: var(--surface-2); }
.mtbd-list > .mcard-row:last-child { border-bottom: 0; }
@media (max-width: 759.98px) {
  .mtbd-row { min-height: 56px; padding: 6px var(--s-3); column-gap: 10px; }
  .mtbd-times-long, .mtbd-text-long { display: none; }
  .mtbd-times-short, .mtbd-text-short { display: inline; }
  .mtbd-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* ---------- Kleiner Gold-Verlauf (chart.js sparkline, z. B. Multi-View) ---------- */

.match-spark { display: block; overflow: visible; }
.match-spark-zero { stroke: var(--border); stroke-width: 1; }
.match-spark-area.is-blue { fill: var(--blue-soft); }
.match-spark-area.is-red { fill: var(--red-soft); }
.match-spark-line { fill: none; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.match-spark-line.is-blue { stroke: var(--blue); }
.match-spark-line.is-red { stroke: var(--red); }
.match-spark-dot { stroke: var(--surface); stroke-width: 1.5; }
.match-spark-dot.is-blue { fill: var(--blue); }
.match-spark-dot.is-red { fill: var(--red); }

/* ---------- Bewegung (2.7) ---------- */

@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } }
@keyframes pop-in { from { transform: scale(.8); opacity: 0; } }
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 70%, transparent); }
  70% { box-shadow: 0 0 0 8px color-mix(in srgb, currentColor 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 0%, transparent); }
}
@keyframes num-flash {
  0%, 100% { background-color: transparent; }
  35% { background-color: var(--accent-soft); }
}

/* Neue Karten/Zeilen: style="--i: <Index>" → höchstens 12 gestaffelt (20 ms), danach ohne Verzögerung */
.fade-up {
  animation: fade-up var(--dur-3) var(--ease) both;
  animation-delay: calc(min(var(--i, 0), 12) * 20ms);
}

/* Wertänderung live (Klasse kurz setzen, util.flash) */
.num-flash { border-radius: 4px; animation: num-flash 600ms var(--ease-in-out); }

/* ---------- Bewegung reduzieren ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  /* Live-Punkt statisch mit Ring */
  .badge-dot, .live-dot {
    animation: none !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 30%, transparent);
  }
  .view, .fade-up { animation: none !important; }
}
