/* Match preview page — extends cards.css palette. */

.match-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px 48px;
}
.match-main .controls {
  grid-template-columns: 1fr;
  max-width: 520px;
  margin: 16px auto 24px;
}

/* ── Match header summary ─────────────────────────────────────────────── */

.match-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 24px;
  margin-bottom: 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}
.match-header .meta-line:first-of-type { margin-top: 2px; }
.match-header .team-block {
  display: flex;
  align-items: center;
  gap: 12px;
}
.match-header .team-block.home { justify-content: flex-start; }
.match-header .team-block.away { justify-content: flex-end; }
.match-header .team-block .name {
  font-weight: 700;
  font-size: 1.15em;
}
.match-header .vs {
  color: var(--text-soft);
  font-weight: 600;
  font-size: 0.85em;
  text-align: center;
}
.match-header .meta-line {
  color: var(--text-soft);
  font-size: 0.85em;
}
.match-header img.team-logo {
  width: 56px;
  height: 56px;
}

@media (max-width: 600px) {
  .match-header {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .match-header .team-block.home,
  .match-header .team-block.away { justify-content: center; }
}

/* ── Section card (wraps each big block on the page) ─────────────────── */

.section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}
.section h2 {
  margin: 0 0 12px;
  font-size: 1.15em;
  font-weight: 700;
}
.section .subtle {
  color: var(--text-soft);
  font-size: 0.85em;
  margin: 0 0 12px;
}
.section .empty {
  color: var(--text-soft);
  font-style: italic;
  padding: 16px 0;
  text-align: center;
}

/* ── DVP / matchup grid ──────────────────────────────────────────────── */

.dvp-grids {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 760px) {
  .dvp-grids { grid-template-columns: 1fr; }
}

.dvp-grid h3 {
  margin: 0 0 8px;
  font-size: 0.95em;
  font-weight: 700;
  color: var(--text);
}
.dvp-grid h3 .vs {
  color: var(--text-soft);
  font-weight: 500;
  margin-left: 4px;
}

.dvp-grid table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 2px;
}
.dvp-grid th, .dvp-grid td {
  padding: 6px 8px;
  font-size: 0.85em;
  text-align: center;
}
.dvp-grid th {
  font-weight: 600;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.7em;
  padding-bottom: 4px;
}
.dvp-grid td.pos {
  text-align: left;
  font-weight: 600;
  color: var(--text);
  padding-left: 4px;
}
.dvp-grid td.cell {
  border-radius: 6px;
  color: #fff;
  font-weight: 700;
  min-width: 36px;
}
.dvp-grid td.cell.empty {
  background: #F3F4F6;
  color: var(--text-soft);
}
.dvp-grid td.cell.r-green  { background: var(--rank-green); }
.dvp-grid td.cell.r-yellow { background: var(--rank-yellow); color: #1A1A2E; }
.dvp-grid td.cell.r-orange { background: var(--rank-orange); }
.dvp-grid td.cell.r-red    { background: var(--rank-red); }

/* ── Stat tables (Disposals / Goals / Fantasy) ───────────────────────── */

.table-wrap {
  overflow-x: auto;     /* tables scroll horizontally on narrow screens */
  -webkit-overflow-scrolling: touch;
  margin: 0 -4px;
  /* On narrow screens, hint that the table is horizontally scrollable
   * using a subtle right-edge fade. The mask sits above the table but
   * doesn't block interaction. */
  background:
    linear-gradient(to right, var(--card-bg) 30%, rgba(255,255,255,0)) left center / 24px 100% no-repeat,
    linear-gradient(to left,  var(--card-bg) 30%, rgba(255,255,255,0)) right center / 24px 100% no-repeat,
    radial-gradient(farthest-side at 0% 50%, rgba(0,0,0,0.12), rgba(0,0,0,0)) left center / 14px 100% no-repeat,
    radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,0.12), rgba(0,0,0,0)) right center / 14px 100% no-repeat;
  background-attachment: local, local, scroll, scroll;
}
.stat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
}
.stat-table th, .stat-table td {
  padding: 8px 10px;
  text-align: right;
  border-bottom: 1px solid var(--divider);
  white-space: nowrap;
}
.stat-table th {
  background: var(--row-bg);
  color: var(--text);
  font-weight: 700;
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
}
.stat-table th:first-child,
.stat-table td:first-child {
  text-align: left;
}
.stat-table td.team,
.stat-table td.pos {
  color: var(--text-soft);
  font-weight: 500;
}
.stat-table td.team {
  font-weight: 700;
  font-size: 0.85em;
}
.stat-table td.name {
  font-weight: 600;
  text-align: left;
}
.stat-table td.line {
  font-weight: 700;
}
.stat-table td.line.over  { color: var(--over); }
.stat-table td.line.under { color: var(--under); }
.stat-table td.hit {
  font-weight: 600;
}
.stat-table tr:hover td {
  background: rgba(235, 245, 251, 0.4);
}
