/* ==========================================================================
   Livesoccer.ug "Scoreboard" restyle  (loaded after site.css, so it can be removed to go back)
   Dense one-line-per-team rows in the style of a live-score app:

       12:45 |  [crest] Home team                    2
             |  [crest] Away team                    1

   - status / kick-off time in a fixed left column
   - teams stacked, scores in a right-hand column
   - league headers are compact, collapsible, with a Table link
   - tabs above the list: All / Live / Finished / Scheduled
   live.js keeps working: every class and data-* attribute it targets is unchanged.
   ========================================================================== */

:root {
  --fs-row-h: 26px;          /* height of one team line */
  --fs-status-w: 58px;       /* width of the time / status column */
}

/* ------------------------------------------------------------------ league header */
.bp-league-head, .league {
  margin: 10px 8px 0;
  padding: 7px 8px 7px 12px;
  gap: 6px;
  background: var(--bg-surface);
  border-radius: 8px 8px 0 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .01em;
}
.bp-league-head .bp-badge-img { width: 18px; height: 18px; }
.bp-league-head .bp-lg-txt {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bp-tbl-chip { font-size: 11px; font-weight: 600; color: var(--text-muted); }
.bp-tbl-chip:hover { color: var(--primary); }
.fs-collapse {
  flex: 0 0 auto; width: 26px; height: 26px; padding: 0; margin: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 6px; background: transparent; color: var(--text-muted);
  cursor: pointer;
}
.fs-collapse:hover { background: var(--bg-subtle); color: var(--text-primary); }
.fs-collapse svg { width: 16px; height: 16px; transition: transform .15s ease; }
.bp-league-head.is-collapsed .fs-collapse svg { transform: rotate(-90deg); }
.bp-league-head.is-collapsed { border-radius: 8px; margin-bottom: 4px; }
.bp-match-card[hidden], .bp-league-head[hidden], .fs-hide { display: none !important; }

/* ------------------------------------------------------------------ match row */
.bp-match-card.sb-row {
  padding: 4px 12px 4px 0;
}
.bp-match-card.sb-row::after { left: calc(var(--fs-status-w) + 4px); right: 0; }

.sb-main {
  grid-template-columns: var(--fs-status-w) minmax(0, 1fr) 30px;
  grid-template-rows: var(--fs-row-h) var(--fs-row-h);
  column-gap: 8px; row-gap: 0;
  align-items: center;
}
/* status and score become direct grid items, so they can span both team lines */
.sb-center { display: contents; }

.sb-center .status {
  grid-column: 1; grid-row: 1 / 3;
  align-self: stretch; justify-content: center; align-items: center;
  padding: 0 0 0 10px;
  font-size: 12px; font-weight: 500; color: var(--text-muted);
  white-space: nowrap;
}
.sb-row[data-status="wait"] .sb-center .status,
.sb-row[data-status="ns"] .sb-center .status {
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
}
.sb-center .status.s-live { color: var(--live); font-weight: 700; }
.sb-center .status.s-ht   { color: var(--amber); font-weight: 700; }

/* teams: crest first, name after, one line each */
.sb-team { gap: 8px; text-align: left; }
.sb-home { grid-column: 2; grid-row: 1; flex-direction: row-reverse; justify-content: flex-end; }
.sb-away { grid-column: 2; grid-row: 2; justify-content: flex-start; }
.sb-team .bp-team-name {
  font-size: 14px; font-weight: 500; line-height: var(--fs-row-h);
  -webkit-line-clamp: 1; text-overflow: ellipsis;
}
.sb-team .bp-crest, .sb-team .bp-crest-fallback, .sb-team .team-mono { width: 18px; height: 18px; }
.sb-team.is-win .bp-team-name  { font-weight: 700; }
.sb-team.is-lose .bp-team-name { color: var(--text-muted); font-weight: 400; }

/* scores: one number per team line, right-aligned */
.sb-score {
  grid-column: 3; grid-row: 1 / 3;
  display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 0;
  font-size: 14px;
}
.sb-score .bp-score-num {
  display: block; min-width: 18px; height: var(--fs-row-h); line-height: var(--fs-row-h);
  font-size: 14px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums;
}
.sb-sep { display: none; }
.sb-row[data-status="live"] .sb-score .bp-score-num,
.sb-row[data-status="lv"] .sb-score .bp-score-num { color: var(--live); }
.sb-row[data-status="ht"] .sb-score .bp-score-num { color: var(--amber); }

/* live rows: keep the thin accent on the left edge */
.bp-match-card[data-status="live"], .bp-match-card[data-status="lv"] { box-shadow: inset 3px 0 0 var(--live); }

/* pick chip: small, under the teams, lined up with the team names */
.sb-pick { justify-content: flex-start; margin: 2px 0 2px calc(var(--fs-status-w) + 8px); }
.sb-pick .bp-odds-btn { width: auto; min-width: 0; height: 24px; padding: 0 10px; border-radius: 6px; font-size: 12px; }

/* ------------------------------------------------------------------ tabs: All / Live / Finished / Scheduled */
.fs-tabs {
  display: flex; gap: 6px; margin: 8px 8px 0; padding: 0;
  overflow-x: auto; scrollbar-width: none;
}
.fs-tabs::-webkit-scrollbar { display: none; }
.fs-tab {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 14px; border: 1px solid var(--border); border-radius: 16px;
  background: var(--bg-card); color: var(--text-secondary);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.fs-tab:hover { border-color: var(--primary); color: var(--primary); }
.fs-tab.is-active { background: var(--primary); border-color: var(--primary); color: var(--text-on-primary); }
.fs-tab .fs-count { font-size: 11px; font-weight: 600; opacity: .75; font-variant-numeric: tabular-nums; }
.fs-tab[data-filter="live"] .fs-count.has-live { color: var(--live); opacity: 1; }
.fs-tab[data-filter="live"].is-active .fs-count.has-live { color: inherit; }
.fs-tab-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--live); animation: pulse 1.4s infinite; }
.fs-tab.is-active .fs-tab-dot { background: currentColor; }
.fs-empty {
  margin: 16px 8px; padding: 22px 14px; text-align: center; color: var(--text-muted);
  font-size: 14px; border: 1px dashed var(--border); border-radius: 10px;
}

/* ------------------------------------------------------------------ small phones */
@media (max-width: 380px) {
  :root { --fs-status-w: 50px; }
  .sb-team .bp-team-name { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .fs-tab-dot, .fs-collapse svg { animation: none; transition: none; }
}
