/* Home screen.
 *
 * Loaded on top of app.css, which it extends rather than overrides. Reuses
 * .topbar, .masthead, .board-card, .rank-row, .crest, .status-pill and .dock
 * as-is; only the pieces unique to this screen live here.
 *
 * Organising idea: a bet locks five minutes before its own kickoff, so a
 * round has as many deadlines as it has matches — in a real seeded round the
 * locks span about 29 hours. Nothing here presents the round as a single
 * countdown. The hero is one match, the next one closing. */

/* The page reuses .match-list for its scroll container, which is a flex
   column built for the betting screen's cards. Flex items with non-visible
   overflow get an automatic minimum size of 0 (CSS Flexbox §4.5), so the
   board-cards below were being squeezed and clipped mid-row instead of the
   page scrolling. The dashboard is not a flex list — make it a block. */
#home { display: block; }

/* ---------- section headings ---------- */
.sec {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 20px 2px 8px;
}
.sec__title {
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sc-ink-soft);
}
.sec__link {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--sc-accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.sec__link svg { width: 11px; height: 11px; }

/* ---------- hero: the next match to lock ---------- */
.lock {
  border-radius: 18px;
  padding: 12px 14px 13px;
  background: var(--sc-card);
  border: 1px solid var(--sc-card-edge);
  box-shadow: var(--sc-card-shadow);
}
/* Tinted only while a bet is still missing — colour marks work outstanding,
   not merely "this is the top of the page". */
.lock--todo {
  background: var(--sc-accent-soft);
  box-shadow: none;
}

.lock__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.lock__label {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sc-ink-soft);
}
.lock--todo .lock__label { color: var(--sc-accent); }
.lock__clock {
  font-size: 1.05rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--sc-ink);
  white-space: nowrap;
}
.lock__clock.is-urgent { color: var(--sc-live-bg); }

/* Compact: one fixture line, one action line. The big centred treatment was
   over-weighted for something that is now the second block on the page. */
.lock__fixture {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
}
.lock__team {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.lock__team:last-of-type { flex-direction: row-reverse; }
.lock__team .crest { width: 30px; height: 30px; font-size: 0.54rem; flex: none; }
.lock__name {
  font-size: 0.86rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lock__vs { font-size: 0.72rem; font-weight: 700; color: var(--sc-ink-soft); }

/* Prediction and action share one line, still behind a divider and still
   under an explicit label — never a bare number beside a club name. */
.lock__bet {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px dashed var(--sc-line);
}
.lock__bet-label {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--sc-ink-soft);
}
.lock__bet-score {
  margin-right: auto;
  font-size: 1.02rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--sc-accent);
}
.lock__bet-none {
  margin-right: auto;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--sc-ink-soft);
}
.lock__cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.44rem 0.75rem;
  border-radius: 999px;
  background: var(--sc-accent);
  color: var(--sc-on-accent);
  font-size: 0.74rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  touch-action: manipulation;
}
.lock__cta svg { width: 11px; height: 11px; }

.lock__meta {
  margin: 8px 0 0;
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--sc-ink-soft);
}

/* ---------- KPI tiles ---------- */
.kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.kpi {
  background: var(--sc-card);
  border: 1px solid var(--sc-card-edge);
  box-shadow: var(--sc-card-shadow);
  border-radius: 14px;
  padding: 13px 8px 11px;
  min-width: 0;
  text-align: center;
}
.kpi__value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 1px;
  font-size: 1.45rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}
.kpi__unit { font-size: 0.7rem; font-weight: 700; color: var(--sc-ink-soft); }
.kpi__label {
  margin-top: 5px;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sc-ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kpi__delta { margin-left: 5px; font-size: 0.68rem; font-weight: 800; }
.kpi__delta.is-up { color: var(--sc-mint-ink); }
.kpi__delta.is-down { color: var(--sc-warn-ink); }
.kpi__delta.is-same { color: var(--sc-ink-soft); }

/* ---------- round progress ---------- */
.prog { margin-top: 18px; }
.prog__line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}
.prog__title { font-size: 0.78rem; font-weight: 800; }
.prog__count { font-size: 0.7rem; font-weight: 700; color: var(--sc-ink-soft); }

/* ---------- per-match rows ---------- */
.fx-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  padding: 7px 11px;
  border-bottom: 1px solid var(--sc-line);
}
.fx-row:last-child { border-bottom: none; }
.fx-row__match { min-width: 0; }
.fx-row__teams {
  font-size: 0.76rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fx-row__teams i { font-style: normal; font-weight: 600; color: var(--sc-ink-soft); }
.fx-row__score { font-variant-numeric: tabular-nums; }
.fx-row__kick {
  display: block;
  margin-top: 1px;
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--sc-ink-soft);
}

/* Each match carries its own lock state, because each match has its own
   deadline. This column is the whole reason the list exists. */
.fx-row__state {
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.fx-row__state--open { background: var(--sc-open-bg); color: var(--sc-open-ink); }
.fx-row__state--urgent { background: var(--sc-live-bg); color: var(--sc-live-ink); }
.fx-row__state--locked { background: var(--sc-locked-bg); color: var(--sc-locked-ink); }
.fx-row__state--live { background: var(--sc-live-bg); color: var(--sc-live-ink); }
.fx-row__state--done { background: var(--sc-done-bg); color: var(--sc-done-ink); }

.fx-row__bet {
  justify-self: end;
  min-width: 36px;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  padding: 0.2rem 0.4rem;
  border-radius: 999px;
  background: var(--sc-chip-bg);
  color: var(--sc-accent);
}
.fx-row__bet--none {
  background: transparent;
  border: 1px dashed var(--sc-line);
  color: var(--sc-ink-soft);
  font-weight: 700;
}

/* ---------- compact standings ---------- */
/* A gap in the ranking is information: it says "and then, further down, you".
   Without it a jump from 3rd to 7th reads as a rendering bug. */
.rank-row--gap { position: relative; }
.rank-row--gap::before {
  content: "⋯";
  position: absolute;
  top: -9px;
  left: 15px;
  font-size: 0.7rem;
  line-height: 1;
  color: var(--sc-ink-soft);
}

