/* Übersicht (#/) – eigene Klassen mit Präfix home-. Farben nur über Variablen aus app.css.
   Abschnitte, Tagestitel, Karten, Zeilen, Platzhalter-Gruppen und Hinweise kommen aus dem Kern (DESIGN.md 3, 6). */

/* Scrollposition hält die Ansicht selbst (keepScroll in home.js) */
.home { overflow-anchor: none; }

/* ---------- Kopf und Hinweise ---------- */

.home-top { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
.home-head { flex-wrap: nowrap; }
.home-meta { font-variant-numeric: tabular-nums; }
.home-top .notice strong { font-weight: 600; }
/* Abweichung: Hinweistext darf schrumpfen, sonst bricht er unter 480 px (flex-wrap im Kern) samt Icon in eine eigene Zeile */
.home .notice-text { flex-basis: 0; }
/* Umbruch nur an den Fugen: „09:00 GAM – VIT“ und jeder Teil dahinter bleiben am Stück */
.home-next-link, .home-nowrap { white-space: nowrap; }
.home-next-time { font-weight: 600; }
.home-next-meta { color: var(--text-2); }
/* Sendung läuft (kein Spiel): Play-Icon in Türkis statt rotem Live-Punkt */
.home-show-note > .icon { color: var(--accent-2); }
/* Knopf ragt 4 px in den Innenabstand, damit beide Hinweise gleich hoch (40 px) sind; Trefferfläche bleibt */
.home-show-note .notice-action { margin-block: calc(-1 * var(--s-1)); }
.home-show-note .notice-action .btn { white-space: nowrap; }
/* Zwei Hinweise im Live-Abschnitt gehören zusammen: 8 statt 16 px Abstand */
.home-sec-live > .notice + .notice { margin-top: calc(-1 * var(--s-2)); }

/* Handy: Aktualisieren sitzt in der Kopfzeile (ctx.setHeaderAction) */
@media (max-width: 759.98px) {
  .home-refresh { display: none; }
}

/* ---------- Liga-Filter ---------- */

.home-filter-wrap { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.home-filter { position: relative; min-width: 0; }
.home-chip-star, .home-chip-off { display: inline-flex; flex: none; }
.home-chip-star { color: var(--accent); }
.home-chip-off { color: var(--muted); }
.home-chip-hidden:not(.active) { border-style: dashed; opacity: .7; }

.home-hidden-note { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) 6px; }
.home-hidden-note .icon { flex: none; }

@media (min-width: 760px) {
  .home-filter .chips-scroll { flex-wrap: wrap; overflow: visible; padding-bottom: 0; }
}

/* Handy: Chips über die volle Breite wischen, Ränder weich ausblenden */
@media (max-width: 759.98px) {
  .home-filter { margin-inline: -16px; }
  .home-filter .chips-scroll { padding-inline: 16px; scroll-padding-inline: 16px; }
  .home-filter::before, .home-filter::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 2px;
    z-index: 1;
    width: 16px;
    pointer-events: none;
  }
  .home-filter::before { left: 0; background: linear-gradient(90deg, var(--bg), transparent); }
  .home-filter::after { right: 0; background: linear-gradient(270deg, var(--bg), transparent); }
}

/* ---------- Abschnitte und Tage ---------- */

.home-body { display: flex; flex-direction: column; gap: var(--s-10); min-width: 0; }

.home-day { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
.home-day + .home-day { margin-top: var(--s-2); }

/* Mehrere Platzhalter-Gruppen im Kartenraster: eine Zeilenliste über alle Spalten */
.home-tbd-run { grid-column: 1 / -1; }

/* Handy: Liga als Gruppentitel in der Zeilenliste */
.home-league-head {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-width: 0;
  min-height: 32px;
  padding: 0 var(--s-3);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
}
.home-league-head .eyebrow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-league-logo { flex: none; width: 16px; height: 16px; object-fit: contain; border-radius: 3px; }
:root[data-theme="light"] .home-league-logo { padding: 1px; background: var(--logo-bg); }

.home-more { display: flex; justify-content: center; }
.home-more-btn { min-width: 200px; }

/* ---------- Deine Teams ---------- */

.home-fav-teams { display: inline-flex; align-items: center; padding-left: 6px; }
.home-fav-teams:hover { text-decoration: none; }
/* Kachel = Logo (Stufe row, 24 px, Innenabstand 2 px); der Ring in --bg trennt die überlappenden Logos */
.home-fav-logo {
  display: inline-flex;
  margin-left: -6px;
  border-radius: calc(var(--r-xs) + 1px);
  box-shadow: 0 0 0 1px var(--bg);
}
.home-fav-logo img.tlogo { width: 24px; height: 24px; padding: 2px; }
.home-fav-more { margin-left: var(--s-2); color: var(--muted); font-size: var(--fs-caption); font-weight: 700; }

/* ---------- Live: Hero-Karte mit Streifen (Spielzeit, Kills, Gold, Türme) ---------- */

/* Der Streifen ist selbst ein Link (öffnet das laufende Spiel) und füllt die Seitenfläche ganz aus */
.home-live-card .mcard-hero-aside { display: flex; flex-direction: column; padding: 0; }
/* Hinweis ohne Link: Klick geht an die Karte darunter */
.home-live-card .mcard-hero-aside:not(:has(a)) { pointer-events: none; }

.home-ls {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: center;
  gap: var(--s-3);
  min-width: 0;
  padding: var(--s-4) var(--s-5);
  color: var(--text);
}
a.home-ls:hover { text-decoration: none; }
.home-ls + .home-ls { border-top: 1px solid var(--border); }
@container (min-width: 640px) {
  .home-ls { gap: var(--s-4); padding: var(--s-5) var(--s-6); }
  .home-ls .home-ls-val { font-size: 26px; }
}

.home-ls-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-3); min-width: 0; }
.home-ls-game { display: inline-flex; align-items: center; gap: var(--s-2); color: var(--text-2); font-size: var(--fs-small); font-weight: 600; white-space: nowrap; }
.home-ls-clock { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.home-ls-clock:empty { display: none; }
.home-ls-dot.is-over { background: var(--muted); color: var(--muted); animation: none; }

.home-ls-sides { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.home-ls-side { max-width: 10ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-ls-side-sep { color: var(--muted); }

.home-ls-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); }
.home-ls-stat { display: flex; flex-direction: column; gap: var(--s-1); min-width: 0; }
.home-ls-stat:nth-child(2) { align-items: center; text-align: center; }
.home-ls-stat:nth-child(3) { align-items: flex-end; text-align: right; }
.home-ls-label { max-width: 100%; overflow: hidden; color: var(--muted); font-size: var(--fs-caption); font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.home-ls-val { font-size: var(--fs-num-lg); line-height: 1; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.home-ls-pair { display: inline-flex; align-items: baseline; gap: var(--s-1); }
.home-ls-colon { color: var(--muted); font-weight: 500; }
.home-ls-gold:not(.side-blue, .side-red) { color: var(--text-2); }

.home-ls-bar { position: relative; height: 6px; overflow: hidden; border-radius: var(--r-pill); background: var(--surface-3); }
.home-ls-bar::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  background: var(--text-2);
  opacity: .5;
}
.home-ls-fill { position: absolute; top: 0; bottom: 0; transition: left var(--dur-3) var(--ease), width var(--dur-3) var(--ease); }
.home-ls-fill.is-blue { background: var(--blue); }
.home-ls-fill.is-red { background: var(--red); }

.home-ls-msg { color: var(--text-2); font-size: var(--fs-small); }
.home-ls-msg.is-off { color: var(--muted); }
.home-ls-covered { display: flex; align-items: center; gap: var(--s-2); color: var(--muted); }
.home-ls-covered .icon { flex: none; }
.home-ls-note { margin-top: calc(-1 * var(--s-1)); }
.home-ls-msg-only { flex-direction: row; align-items: center; justify-content: flex-start; gap: var(--s-2); color: var(--muted); font-size: var(--fs-small); }
.home-ls-msg-only .icon { flex: none; }


/* ---------- Laden ---------- */

.home-loading { display: flex; flex-direction: column; gap: var(--s-4); }
.home-skel-title { width: 160px; height: 20px; }

/* ---------- Handy ---------- */

@media (max-width: 759.98px) {
  .home-body { gap: var(--s-8); }
  .home-ls { padding: var(--s-3) var(--s-4) var(--s-4); }
  /* Tagestitel bleibt beim Scrollen durch lange Tage unter der Kopfzeile stehen */
  .home .day-head {
    position: sticky;
    top: calc(var(--header-h) + env(safe-area-inset-top));
    z-index: 5;
    margin-top: calc(-1 * var(--s-2));
    padding-top: var(--s-2);
    background: var(--bg);
  }
}
