/* =========================================================================
   game.css — single-game page.
   Extracted from views/game.js (~1420 lines of inline CSS). The game page
   pins the main header AND a secondary match header to the top of the
   viewport; everything else (lineups, stats, lead tracker, quarter score,
   video embed) lives below.
   ========================================================================= */

/* ---------------------------------------------------------------------------
   Pinned main header — the regular site header becomes fully fixed on the
   game page so the match header can sit immediately under it.
   --------------------------------------------------------------------------- */
body.page-game .main-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 10000 !important;
  background: var(--header-bg) !important;
  margin: 0 !important;
}

body.page-game .page-container {
  padding-top: calc(var(--main-header-height, 60px) + 90px);
}

/* ---------------------------------------------------------------------------
   Game match header — a slim, fixed scoreboard right under the main header.
   --------------------------------------------------------------------------- */
.game-match-header {
  position: fixed;
  top: var(--main-header-height, 60px);
  left: 0;
  right: 0;
  z-index: 999;
  background: var(--surface);
  border-bottom: 1px solid var(--color-soft);
  padding: 0;
}

.game-match-header .match-card {
  border-radius: 0;
  padding: 16px 0;
  background: var(--surface);
  border-bottom: none;
  max-width: 1200px;
  margin: 0 auto;
}

.game-match-header .match-card:hover {
  box-shadow: none;
  transform: none;
}

.game-match-header .match-card-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
}

.game-match-header .match-meta {
  width: 100px;
  flex-shrink: 0;
  font-size: 12px;
  color: #4b5563;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.game-match-header .match-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.game-match-header .game-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.game-match-header .gw-team {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 0;
  min-width: 0;
  max-width: 280px;
}

.game-match-header .gw-team-local {
  justify-content: flex-end;
}

.game-match-header .gw-team-logo {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 4px;
  object-fit: contain;
}

.game-match-header .gw-team-local .gw-team-logo {
  order: 2;
  margin-left: 4px;
}

.game-match-header .gw-team:not(.gw-team-local) .gw-team-logo {
  margin-right: 4px;
}

.game-match-header .gw-team-text {
  flex: 1 1 auto;
  min-width: 0;
}

.game-match-header .gw-team-name {
  line-height: 40px;
  display: inline-block;
  text-align: left;
  font-weight: 700;
  font-size: 18px;
  white-space: nowrap;
  overflow: hidden;
  color: #000;
  text-decoration: none;
}

.game-match-header .gw-team-local .gw-team-name {
  text-align: right;
}

.game-match-header .gw-team-name:hover {
  color: var(--color-primary);
}

.game-match-header .gw-team-coach {
  font-size: 11px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-match-header .gw-team-coach a {
  color: var(--ink-muted);
  text-decoration: none;
}

.game-match-header .gw-team-coach a:hover {
  color: var(--ink-strong);
  text-decoration: underline;
}

.game-match-header .gw-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.game-match-header .gw-competition {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -20px);
  z-index: 9999;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-strong);
  line-height: 1.4;
}

.game-match-header .gw-score-widget {
  display: flex;
}

.game-match-header .gw-score {
  padding: 8px 0;
  border: 1px solid var(--ink-strong);
  width: 56px;
  min-width: 56px;
  max-width: 56px;
  text-align: center;
  font-weight: 700;
  background-color: var(--surface);
  font-size: 26px;
  line-height: 1;
  color: var(--ink-strong);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-shadow: none;
}

.game-match-header .gw-score-winner {
  background: linear-gradient(120deg, #ff8ec7 0%, #ffb36a 100%);
  color: var(--ink-strong);
  border-color: var(--ink-strong);
  text-shadow: none;
}

.game-match-header .gw-status {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.game-match-header .gw-day,
.game-match-header .gw-hour {
  font-size: 12px;
}

.game-match-header .gw-day {
  font-weight: 600;
  color: var(--ink-strong);
}

.game-match-header .gw-hour {
  color: var(--ink-muted);
}

.game-match-header .match-broadcast {
  width: 100px;
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 768px) {
  .game-match-header .match-card-line {
    flex-wrap: wrap;
    gap: 10px;
  }
  .game-match-header .match-meta {
    width: auto;
    flex-direction: row;
    gap: 10px;
    order: 1;
  }
  .game-match-header .match-card-body {
    order: 2;
    width: 100%;
  }
  .game-match-header .match-broadcast {
    display: none;
  }
}

/* ---------------------------------------------------------------------------
   Admin file badge / overlay (hidden unless admin mode is on)
   --------------------------------------------------------------------------- */
.game-admin-files {
  display: none;
  background: #fef3c7;
  border-top: 1px solid var(--color-warning);
  border-bottom: 1px solid var(--color-warning);
  padding: 8px 16px;
  font-size: 11px;
  color: #92400e;
}

.game-admin-files.visible {
  display: block;
}

.game-admin-files-list {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
}

.game-admin-file-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}

.game-admin-file-item:hover           { background: rgba(0, 0, 0, 0.05); }
.game-admin-file-item.available       { color: #15803d; font-weight: 600; }
.game-admin-file-item.missing         { color: #991b1b; opacity: 0.6; cursor: not-allowed; }

.game-admin-file-path {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #1f2937;
  color: #f9fafb;
  padding: 20px 24px;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  z-index: 10001;
  max-width: 90%;
  font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
  font-size: 12px;
}

.game-admin-file-path.visible {
  display: block;
}

.admin-path-header {
  color: #9ca3af;
  margin-bottom: 8px;
  font-size: 11px;
}

.admin-path-command {
  background: #374151;
  padding: 12px;
  border-radius: 4px;
  margin-bottom: 12px;
  user-select: all;
  word-break: break-all;
}

.admin-path-buttons {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.admin-path-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
}

.admin-path-btn-copy        { background: #10b981; color: #fff; }
.admin-path-btn-copy:hover  { background: #059669; }
.admin-path-btn-close       { background: var(--ink-muted); color: #fff; }
.admin-path-btn-close:hover { background: #4b5563; }

.admin-path-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
}

.admin-path-overlay.visible {
  display: block;
}

/* ---------------------------------------------------------------------------
   Lineups
   --------------------------------------------------------------------------- */
.lineups-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.lineups-card {
  border: none;
  box-shadow: none;
  margin-top: 20px;
}

.lineups-card-title {
  margin: 0 0 14px 0;
  color: var(--ink-strong);
  font-size: 18px;
  font-weight: 900;
}

/* ---------------------------------------------------------------------------
   Quarter score summary (legacy compact card)
   --------------------------------------------------------------------------- */
.quarter-score-summary-card {
  margin: 24px 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.quarter-score-summary-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #1e293b;
  margin-bottom: 20px;
}

.quarter-score-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

.quarter-score-table thead th {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: #64748b;
  font-weight: 600;
  padding: 0 12px 16px 0;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
}

.quarter-score-table thead th:last-child { padding-right: 0; }

.quarter-score-table tbody td {
  padding: 14px 12px 14px 0;
  text-align: center;
  font-weight: 700;
  color: var(--ink-strong);
  font-size: 16px;
}

.quarter-score-table tbody td:first-child {
  text-align: left;
  padding-right: 20px;
}

.quarter-score-table tbody td:last-child { padding-right: 0; }

.quarter-score-table tbody tr + tr td {
  border-top: 1px solid #f8fafc;
}

.quarter-team {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.quarter-team-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f8fafc;
  object-fit: cover;
  border: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.quarter-team-logo.placeholder { background: #f1f5f9; }

.quarter-team span {
  font-weight: 600;
  font-size: 15px;
  color: #1e293b;
}

.quarter-score-team {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.quarter-score-team-logo {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--line);
  object-fit: contain;
  background: var(--surface);
}

.quarter-score-total {
  font-weight: 900;
  font-size: 15px;
  color: var(--ink-strong);
}

@media (max-width: 768px) {
  .quarter-score-summary-card {
    margin: 16px 0;
    padding: 18px;
    border-radius: 12px;
  }
  .quarter-score-summary-title {
    font-size: 13px;
    margin-bottom: 16px;
  }
  .quarter-score-table thead th {
    font-size: 11px;
    padding-bottom: 12px;
  }
  .quarter-score-table tbody td {
    padding: 10px 8px 10px 0;
    font-size: 15px;
  }
  .quarter-score-table tbody td:first-child { padding-right: 12px; }
  .quarter-team { gap: 8px; }
  .quarter-team-logo { width: 28px; height: 28px; }
  .quarter-team span { font-size: 14px; }
}

/* ---------------------------------------------------------------------------
   Quarter score card (modern widget; overrides .quarter-score-table inside it)
   --------------------------------------------------------------------------- */
.quarter-score-card {
  margin: 24px 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.quarter-score-card-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-strong);
  padding: 16px 20px;
  border-bottom: 2px solid var(--color-primary);
  background: linear-gradient(135deg, var(--surface-sunken) 0%, var(--surface) 100%);
}

.quarter-score-table-wrapper {
  overflow-x: auto;
}

.quarter-score-card .quarter-score-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.quarter-score-card .quarter-score-table thead th {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #64748b;
  font-weight: 700;
  padding: 12px 16px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.quarter-score-card .quarter-score-table thead th:first-child {
  text-align: left;
  padding-left: 20px;
  min-width: 180px;
}

.quarter-score-card .quarter-score-table tbody td {
  padding: 14px 16px;
  text-align: center;
  font-weight: 700;
  color: var(--ink-strong);
  font-size: 16px;
  border-bottom: 1px solid #f1f5f9;
}

.quarter-score-card .quarter-score-table tbody td:first-child {
  text-align: left;
  padding-left: 20px;
}

.quarter-score-card .quarter-score-table tbody tr:last-child td { border-bottom: none; }
.quarter-score-card .quarter-score-table tbody tr:hover {
  background: rgba(255, 112, 67, 0.04);
}

.quarter-score-card .quarter-score-team {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.quarter-score-card .quarter-score-team-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--line);
  object-fit: contain;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.quarter-score-card .quarter-score-team span {
  font-weight: 700;
  font-size: 14px;
  color: #1e293b;
  text-shadow: 1px 0 0 currentColor;
}

.quarter-score-card .quarter-score-total {
  font-weight: 900;
  font-size: 17px;
  color: var(--ink-strong);
  background: linear-gradient(to right, var(--color-primary), var(--color-soft));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@media (max-width: 768px) {
  .quarter-score-card {
    margin: 16px 0;
    border-radius: var(--radius-md);
  }
  .quarter-score-card-title {
    font-size: 12px;
    padding: 12px 14px;
  }
  .quarter-score-card .quarter-score-table thead th {
    font-size: 10px;
    padding: 10px;
  }
  .quarter-score-card .quarter-score-table thead th:first-child {
    padding-left: 14px;
    min-width: 120px;
  }
  .quarter-score-card .quarter-score-table tbody td {
    padding: 10px;
    font-size: 14px;
  }
  .quarter-score-card .quarter-score-table tbody td:first-child {
    padding-left: 14px;
  }
  .quarter-score-card .quarter-score-team-logo {
    width: 24px;
    height: 24px;
  }
  .quarter-score-card .quarter-score-team span {
    font-size: 13px;
  }
}

/* ---------------------------------------------------------------------------
   Video embed card (YouTube / streaming)
   --------------------------------------------------------------------------- */
.video-embed-card {
  margin-top: 20px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ink-strong);
  padding: 0;
  overflow: hidden;
}

.video-embed-card-title {
  font-weight: 700;
  font-size: 14px;
  color: #f9fafb;
  padding: 12px 16px;
  border-bottom: 1px solid var(--header-border);
}

.video-embed-player {
  width: 100%;
}

.video-embed-player iframe {
  width: 100%;
  height: 360px;
  border: 0;
  display: block;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

/* ---------------------------------------------------------------------------
   Stats groups (boxscore-like card)
   --------------------------------------------------------------------------- */
.stats-layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.stats-groups {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1 1 auto;
}

.stats-ad {
  flex: 0 0 300px;
  width: 300px;
  height: 600px;
  position: sticky;
  top: 20px;
  align-self: start;
}

.stats-ad .ad-placeholder {
  width: 100%;
  height: 100%;
}

@media (max-width: 1200px) {
  .stats-layout { flex-direction: column; }
  .stats-ad {
    position: relative;
    width: 100%;
    height: 140px;
    top: 0;
  }
}

.stats-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface);
}

.stats-group-title {
  margin: 0 0 10px 0;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #475569;
}

.stats-chart-legend {
  width: 260px;
  max-width: 100%;
  margin: 0 auto 6px;
}

.stats-legend-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.stats-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-strong);
  letter-spacing: 0.01em;
}

.stats-legend-color {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-pill);
  display: inline-block;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.stats-chart-wrap {
  width: 100%;
  height: 220px;
}

.stats-chart {
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------------------------------------------------------------------------
   Key / Value pairs and file-pill grids (boxscore footer, files list)
   --------------------------------------------------------------------------- */
.kv {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid #eef2f7;
  font-size: 14px;
}

.kv:first-child {
  border-top: 0;
  padding-top: 0;
}

.kv-key {
  color: #475569;
  font-weight: 700;
}

.kv-value {
  color: var(--ink-strong);
  font-weight: 600;
  word-break: break-word;
}

.files-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin-top: 8px;
  font-size: 13px;
}

.file-pill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink-strong);
  font-weight: 700;
}

.file-pill small {
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

@media (max-width: 768px) {
  .files-grid { grid-template-columns: 1fr; }
  .kv          { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------------
   Page-game widget overrides
   --------------------------------------------------------------------------- */
body.page-game .game-meta { font-size: 13px; }

body.page-game .game-team-logo {
  width: 36px;
  height: 36px;
}

body.page-game .game-team-name {
  font-size: 18px;
  mask-image: none;
  -webkit-mask-image: none;
}

body.page-game .game-competition,
body.page-game .game-status {
  font-size: 12px;
}

body.page-game .game-score-team {
  width: 56px;
  min-width: 56px;
  max-width: 56px;
  font-size: 24px;
  padding: 6px 0;
}

body.page-game .game-team-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

body.page-game .game-team-link:hover .game-team-name {
  text-decoration: underline;
}

body.page-game .game-team-link:focus-visible {
  outline: 2px solid var(--ink-faint);
  outline-offset: 2px;
  border-radius: 8px;
}

body.page-game .stats-group-title { font-size: 14px; }
body.page-game .stats-legend-item { font-size: 12px; }
body.page-game .files-grid         { font-size: 14px; }

@media (max-width: 768px) {
  body.page-game .game-team-name { font-size: 15px; }
  body.page-game .game-team-logo { width: 34px; height: 34px; }
  body.page-game .game-score-team {
    width: 46px;
    min-width: 46px;
    max-width: 46px;
    font-size: 19px;
  }
}

/* ---------------------------------------------------------------------------
   Lead tracker chart + stats grid
   --------------------------------------------------------------------------- */
.lead-tracker-container {
  background: var(--surface);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid #f1f5f9;
}

.lead-tracker-title {
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 28px 0;
  letter-spacing: -0.02em;
}

.lead-tracker-chart {
  position: relative;
  margin-bottom: 24px;
  background: var(--surface);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  height: 240px;
  min-height: 200px;
}

.lead-tracker-chart canvas,
.lead-tracker-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.lead-tracker-fallback-chart {
  width: 100%;
  position: relative;
}

.lead-tracker-teams-container {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.lead-tracker-teams-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 50px;
  margin-right: 8px;
}

.lead-tracker-team-side {
  display: flex;
  justify-content: center;
  align-items: center;
}

.lead-tracker-chart-area {
  flex: 1;
  position: relative;
}

.lead-tracker-team-side .team-logo {
  width: 0;
  height: 0;
  border-radius: 0;
  box-shadow: none;
  object-fit: contain;
  display: none;
}

.lead-tracker-team-side .team-name {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1;
  max-width: 45px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-tracker-team-side.home .team-name { color: #10b981; }
.lead-tracker-team-side.away .team-name { color: var(--color-danger); }

.lead-tracker-axis-labels {
  position: absolute;
  left: -40px;
  top: 0;
  bottom: 15px;
  width: 35px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 10px;
  font-weight: 600;
}

.lead-tracker-axis-labels .axis-label,
.lead-tracker-axis-labels .axis-label.home,
.lead-tracker-axis-labels .axis-label.away {
  line-height: 1;
  color: #000;
}

.lead-tracker-axis-labels .axis-label.center {
  color: #000;
  font-weight: 700;
}

.lead-tracker-fallback-bars {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 3px;
  height: 110px;
  margin: 12px 0;
  padding-left: 40px;
}

.lead-tracker-fallback-bars::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(15, 23, 42, 0.2);
  transform: translateY(-50%);
}

.lead-tracker-fallback-bar {
  flex: 1;
  position: relative;
  max-width: 14px;
  min-width: 2px;
}

.lead-tracker-fallback-bar span {
  position: absolute;
  left: 0;
  right: 0;
  border-radius: 2px;
}

.lead-tracker-fallback-bar.home span {
  bottom: 50%;
  transform-origin: bottom;
}

.lead-tracker-fallback-bar.away span {
  top: 50%;
  transform-origin: top;
}

.lead-tracker-fallback-bar.tie span {
  height: 3px;
  top: 50%;
  background: rgba(148, 163, 184, 0.5);
}

.lead-tracker-fallback-axis {
  position: absolute;
  left: -40px;
  top: 0;
  height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
  text-align: right;
  width: 30px;
}

.lead-tracker-fallback-axis span {
  line-height: 1;
}

.lead-tracker-tooltip {
  position: absolute;
  pointer-events: none;
  padding: 6px 12px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: #fff;
  background: rgba(15, 23, 42, 0.9);
  border-radius: var(--radius-pill);
  transform: translate(-50%, -110%);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 150ms ease, visibility 150ms ease;
}

.lead-tracker-tooltip.visible {
  opacity: 1;
  visibility: visible;
}

.lead-tracker-quarter-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: 0.08em;
  margin-top: 8px;
  color: #475569;
  padding-left: 40px;
  padding-right: 10px;
}

.lead-tracker-card {
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  margin-top: 18px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.lead-tracker-stats-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
}

.lead-tracker-stat-side {
  padding: 16px 18px;
  font-size: 20px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.lead-tracker-stat-side.home { justify-content: flex-start; }
.lead-tracker-stat-side.away { justify-content: flex-end;   }

.lead-tracker-stat-logo {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: contain;
  flex-shrink: 0;
}

.lead-tracker-stat-label {
  padding: 18px 16px;
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
  text-align: center;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 160px;
}

.lead-tracker-stats-grid div:nth-child(3n + 1),
.lead-tracker-stats-grid div:nth-child(3n + 2),
.lead-tracker-stats-grid div:nth-child(3n + 3) {
  border-bottom: 1px solid #f1f5f9;
}

.lead-tracker-lead-changes-row {
  display: flex;
  justify-content: space-between;
  border-top: 2px solid var(--line);
  background: #f8fafc;
}

.lead-tracker-lead-changes {
  flex: 1;
  text-align: center;
  padding: 18px 12px;
}

.lead-tracker-lead-changes + .lead-tracker-lead-changes {
  border-left: 1px solid var(--line);
}

.lead-tracker-lead-changes-count {
  display: block;
  font-size: 30px;
  font-weight: 900;
  color: var(--ink-strong);
  margin-bottom: 4px;
  letter-spacing: -0.03em;
}

.lead-tracker-lead-changes-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 600;
}

@media (max-width: 768px) {
  .lead-tracker-chart {
    padding: 12px;
    height: 200px;
    min-height: 180px;
  }
  .lead-tracker-container {
    padding: 16px;
    border-radius: 12px;
  }
  .lead-tracker-title {
    font-size: 18px;
    margin-bottom: 16px;
  }
  .lead-tracker-teams-container { gap: 8px; }
  .lead-tracker-teams-sidebar {
    min-width: 40px;
    gap: 16px;
    margin-right: 6px;
  }
  .lead-tracker-team-side .team-logo { width: 28px; height: 28px; }
  .lead-tracker-fallback-bars {
    height: 90px;
    padding-left: 35px;
  }
  .lead-tracker-axis-labels {
    left: -35px;
    width: 30px;
    font-size: 9px;
  }
  .lead-tracker-quarter-labels { padding-left: 35px; }
  .lead-tracker-stat-side {
    padding: 12px;
    font-size: 16px;
    gap: 6px;
  }
  .lead-tracker-stat-logo { width: 20px; height: 20px; }
  .lead-tracker-stat-label {
    padding: 12px 8px;
    font-size: 9px;
    letter-spacing: 0.15em;
    min-width: 100px;
  }
  .lead-tracker-lead-changes-count { font-size: 24px; }
}

/* ---------------------------------------------------------------------------
   Two-column game body (main column + side ad)
   --------------------------------------------------------------------------- */
.game-content-columns {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  margin: 20px auto 0;
  max-width: 1180px;
  width: 100%;
}

.game-main-column { min-width: 0; }

.game-sidebar-column {
  align-self: stretch;
}

.sidebar-ad {
  width: 300px;
  height: 600px;
  position: sticky;
  top: calc(var(--main-header-height, 60px) + var(--game-match-header-height, 90px) + 20px);
  background: #f0f0f0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 14px;
  font-weight: 600;
}

@media (max-width: 1100px) {
  .game-content-columns {
    grid-template-columns: 1fr;
  }
  .game-sidebar-column { display: none; }
  .sidebar-ad {
    position: static;
    top: auto;
  }
}
