/* =========================================================
   STADIUM DAYLIGHT — Pot ledger (/pot)
   Chronological table of every match's entries, pot, winners,
   payouts, and rollovers. Totals row in <tfoot>.
   Tokens: tokens.css. Conventions: BEM, mobile-first.
   ========================================================= */

.pot-ledger {
  padding: var(--space-lg) var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.pot-ledger__header {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.pot-ledger__heading {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0;
  font-variation-settings: "SOFT" 100, "opsz" 96;
}

.pot-ledger__empty {
  text-align: center;
  padding: var(--space-2xl) var(--space-md);
  color: var(--slate);
  font-size: 14px;
}

/* Horizontal scroll wrapper — 9 columns won't fit on phone screens. */
.pot-ledger__scroll {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

.pot-ledger__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  color: var(--ink);
}

.pot-ledger__table thead { background: var(--border-soft); }

.pot-ledger__col,
.pot-ledger__cell {
  padding: 10px 12px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-soft);
}
.pot-ledger__col {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate);
}

/* Teams cell: [home-flag home-code] – [away-code away-flag], left-aligned
   in the column. `auto`-sized grid columns hug the content so the cluster
   stays compact and left-anchored, while the explicit gap keeps the "vs"
   separator visually centred between the two team chunks. */
.pot-ledger__cell--teams {
  white-space: nowrap;
  font-weight: 500;
}
/* The match identity links to the match details. The link carries the
   three-column grid so the home / vs / away layout is preserved; the team
   codes underline on hover as the click affordance. */
.pot-ledger__match-link {
  display: inline-grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  gap: var(--space-sm);
  color: inherit;
  text-decoration: none;
}
.pot-ledger__match-link:hover .pot-ledger__team-code {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.pot-ledger__team {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pot-ledger__team-code {
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.pot-ledger__vs {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate);
}

.pot-ledger__cell--num,
.pot-ledger__cell--date,
.pot-ledger__cell--score,
.pot-ledger__cell--money {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
/* Date and stage both read as muted, no-wrap metadata next to the match. */
.pot-ledger__cell--date,
.pot-ledger__cell--stage {
  white-space: nowrap;
  color: var(--slate);
}
.pot-ledger__cell--score {
  white-space: nowrap;
  font-weight: 600;
}
.pot-ledger__cell--money { color: var(--ink-soft); }

.pot-ledger__row:hover { background: var(--border-soft); }

/* Totals row in <tfoot> — thicker top border, bolder font. */
.pot-ledger__totals {
  border-top: 2px solid var(--ink);
  background: var(--pitch-soft);
}
.pot-ledger__totals .pot-ledger__cell {
  border-bottom: none;
  font-weight: 600;
  color: var(--ink);
  padding-top: 14px;
  padding-bottom: 14px;
}
.pot-ledger__cell--totals-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}
.pot-ledger__totals-tag {
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate);
  margin-left: 4px;
  font-weight: 500;
}
.pot-ledger__cell--float {
  color: var(--pitch-deep);
  font-weight: 700;
}
/* The outstanding float sits as a second line beneath the paid-out total
   in the same cell, since the rollover columns it used to align under are
   gone. Muted relative to the paid figure above it. */
.pot-ledger__totals-float {
  display: block;
  margin-top: 4px;
  color: var(--pitch-deep);
  font-weight: 700;
}

/* ----- Wider screens ---------------------------------------- */

@media (min-width: 481px) {
  .pot-ledger { padding: var(--space-lg) var(--space-md); }
}
