/* ═══════════════════════════════════════════════════════════════
   STANDINGS SCREEN — "טבלה / מובילים" and the league-leaders tab
   Colours come from the league theme tokens (home.css), so the tab follows
   light, dark and the favourite-team accent like the table beside it. The
   one exception is the leader's card, which wears the club's colour with
   white type on it: the colour is darkened first so small white text stays
   readable on every club, including the pale ones.
   ═══════════════════════════════════════════════════════════════ */

.st-view-bar {
  display: flex;
  justify-content: center;
  padding: 14px 16px 0;
}
.st-view-bar:empty { display: none; }

/* National teams' games screen: "my countries / all games". */
.nt-filter-bar { display: flex; justify-content: center; padding: 4px 16px 12px; }
.nt-none-mine { padding: 24px 16px; text-align: center; color: var(--muted); font-size: 15px; }

.ld-seg {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.ld-seg button {
  min-height: 36px;
  padding: 6px 22px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: "Heebo", sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.ld-seg button[aria-selected="true"] {
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 800;
}
.ld-seg--small button { min-height: 32px; padding: 4px 16px; font-size: 13.5px; }
.ld-seg button:focus-visible,
.ld-chip:focus-visible,
.ld-hero:focus-visible,
.ld-row:focus-visible,
.ld-retry:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── The tab ─────────────────────────────────────────────────── */
.st-leaders {
  container-type: inline-size;
  padding: 12px 16px 24px;
  font-family: "Heebo", sans-serif;
  color: var(--text);
}
.ld-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.ld-note {
  align-self: stretch;
  margin: 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--muted) 14%, var(--bg-card));
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  text-wrap: pretty;
}

.ld-chips {
  display: flex;
  gap: 8px;
  margin: 14px -16px 0;
  padding: 0 16px 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.ld-chips::-webkit-scrollbar { display: none; }
.ld-chip {
  flex: none;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-family: "Heebo", sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.ld-chip[aria-selected="true"] {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg-card);
  font-weight: 800;
}

.ld-grid {
  display: grid;
  gap: 16px;
  margin-top: 12px;
}
.ld-card { display: none; flex-direction: column; gap: 10px; min-width: 0; }
.ld-card.is-on { display: flex; }

/* ── Leader card ─────────────────────────────────────────────── */
.ld-hero {
  --ld-c: var(--accent);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 196px;
  padding: 14px 18px 16px;
  border: 0;
  border-radius: 14px;
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--ld-c) 82%, #000) 0%,
      color-mix(in srgb, var(--ld-c) 55%, #060b18) 100%);
  color: #ffffff;
  font-family: inherit;
  text-align: start;
  cursor: pointer;
}
.ld-hero[disabled] { cursor: default; }
/* The shirt number, as a watermark: identity without a photo. */
.ld-hero-mark {
  position: absolute;
  inset-inline-end: -6px;
  bottom: -38px;
  font-family: "Anton", "Arial Narrow", Impact, sans-serif;
  font-size: 200px;
  line-height: 1;
  color: rgba(255, 255, 255, .10);
  pointer-events: none;
}
.ld-hero-mark--crest {
  bottom: auto;
  top: -34px;
  inset-inline-end: -44px;
  opacity: .18;
}
.ld-hero-title {
  position: relative;
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .28);
  font-size: 13px;
  font-weight: 800;
}
.ld-hero-body {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.ld-hero-who { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ld-hero-name {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.15;
  text-wrap: balance;
}
.ld-hero-team {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, .88);
}
.ld-hero-team .team-crest { --crest-ring: rgba(255, 255, 255, .45); }
.ld-hero-gp { margin-top: -2px; font-size: 12px; color: rgba(255, 255, 255, .80); }
.ld-hero-stat { display: flex; flex-direction: column; align-items: flex-start; flex: none; }
.ld-hero-val {
  font-family: "Anton", "Arial Narrow", Impact, sans-serif;
  font-size: 64px;
  line-height: .95;
  font-variant-numeric: tabular-nums;
}
.ld-hero-unit { font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, .85); }

/* ── Places 2–5 ──────────────────────────────────────────────── */
.ld-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.ld-list li + li { border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
.ld-row {
  --ld-c: var(--muted);
  display: grid;
  grid-template-columns: 18px 26px minmax(0, 1fr) auto;
  grid-template-areas:
    "rank crest who val"
    ".    bar   bar bar";
  align-items: center;
  column-gap: 10px;
  row-gap: 6px;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  text-align: start;
  cursor: pointer;
}
.ld-row--nobar { grid-template-areas: "rank crest who val"; padding-block: 12px; }
.ld-row[disabled] { cursor: default; }
.ld-row:hover:not([disabled]) { background: color-mix(in srgb, var(--text) 4%, transparent); }
.ld-rank {
  grid-area: rank;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}
.ld-row .team-crest { grid-area: crest; }
.ld-who { grid-area: who; display: flex; flex-direction: column; min-width: 0; }
.ld-name {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ld-team { font-size: 12px; color: var(--muted); }
.ld-val {
  grid-area: val;
  font-family: "Anton", "Arial Narrow", Impact, sans-serif;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}
.ld-bar {
  grid-area: bar;
  height: 4px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--text) 9%, transparent);
  overflow: hidden;
}
.ld-bar > span {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--ld-c);
  box-shadow: inset 0 0 0 1px var(--crest-ring);
}

.ld-foot {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  text-wrap: balance;
}

/* ── Loading / failure ───────────────────────────────────────── */
.ld-skel {
  height: 196px;
  margin-top: 12px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--muted) 14%, var(--bg-card));
  animation: ldPulse 1.4s ease-in-out infinite;
}
.ld-skel + .ld-skel { height: 250px; }
@keyframes ldPulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .ld-skel { animation: none; } }

.ld-empty {
  margin-top: 16px;
  padding: 24px 16px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.ld-retry {
  margin-top: 10px;
  min-height: 36px;
  padding: 6px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* ── Wide: every category at once ────────────────────────────── */
@container (min-width: 700px) {
  .ld-top { flex-direction: row; flex-wrap: wrap; justify-content: space-between; }
  .ld-note { order: 3; flex-basis: 100%; }
  .ld-chips { display: none; }
  .ld-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 16px; }
  .ld-card { display: flex; }
  .ld-hero { min-height: 136px; padding: 10px 14px 12px; gap: 10px; }
  .ld-hero-mark { font-size: 130px; bottom: -24px; }
  .ld-hero-mark--crest { top: -26px; inset-inline-end: -34px; }
  .ld-hero-title { font-size: 12px; }
  .ld-hero-name { font-size: 17px; }
  .ld-hero-team { font-size: 12px; }
  .ld-hero-val { font-size: 42px; }
  .ld-hero-unit { font-size: 11px; }
  .ld-row { padding: 8px 12px; grid-template-columns: 16px 22px minmax(0, 1fr) auto; }
  .ld-name { font-size: 14px; }
  .ld-val { font-size: 19px; }
}

/* ── The games screen's card ─────────────────────────────────── */
/* Under the games list, so on a game night it never pushes a game down. */
.hl { margin: 18px 0 22px; }
.hl-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius, 10px);
  padding: 10px 12px 8px;
  font-family: "Heebo", sans-serif;
  color: var(--text);
}
.hl-head { display: flex; align-items: baseline; gap: 8px; }
.hl-title { margin: 0; font-size: 15px; font-weight: 900; color: var(--text); }
.hl-note { font-size: 12px; color: var(--muted); }
.hl-more {
  margin-inline-start: auto;
  padding: 6px 0 6px 2px;
  border: 0;
  background: transparent;
  color: var(--accent-ink, var(--accent));
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.hl-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 2px;
}
.hl-col {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "c v" "c u" "n n";
  column-gap: 6px;
  align-items: center;
  min-height: 44px;
  padding: 6px 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  text-align: start;
  cursor: pointer;
}
.hl-col:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
.hl-col .team-crest { grid-area: c; }
.hl-val {
  grid-area: v;
  font-family: "Anton", "Arial Narrow", Impact, sans-serif;
  font-size: 22px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.hl-unit { grid-area: u; font-size: 11px; color: var(--muted); }
.hl-name {
  grid-area: n;
  margin-top: 3px;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hl-more:focus-visible,
.hl-col:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
