/* スタッツ表 — 共通スタイル */

.stats-tables {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  min-width: 0;
}

.stats-team-panel {
  background: #fff;
  border-radius: 12px;
  padding: 16px 14px 14px;
  border: 1px solid rgba(60, 134, 171, 0.14);
  box-shadow:
    0 1px 2px rgba(44, 62, 80, 0.04),
    0 8px 24px rgba(44, 62, 80, 0.07);
}

.stats-team-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  padding-left: 11px;
  border-left: 4px solid #3c86ab;
  letter-spacing: 0.02em;
}

.stats-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
}

.stats-tables--total .stats-table-wrap {
  overscroll-behavior-x: contain;
}

.stats-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  table-layout: auto;
  font-variant-numeric: tabular-nums;
}

.stats-table--total {
  min-width: max-content;
}

.stats-table th,
.stats-table td {
  border: none;
  border-bottom: 1px solid #e8edf2;
  padding: 8px 7px;
  text-align: center;
  white-space: nowrap;
}

.stats-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #3c86ab;
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.03em;
  border-bottom: 2px solid #2f6d8a;
}

.stats-table thead th.col-no {
  position: sticky;
  left: 0;
  top: 0;
  z-index: 5;
  min-width: 2.8em;
  width: 2.8em;
  max-width: 2.8em;
  background: #3c86ab;
  color: #fff;
  box-shadow: 2px 0 6px rgba(44, 62, 80, 0.08);
}

.stats-table td.col-no,
.stats-table tfoot td.col-no {
  min-width: 2.8em;
  width: 2.8em;
  max-width: 2.8em;
  position: sticky;
  left: 0;
  z-index: 2;
  font-weight: 700;
  background: #fff;
  box-shadow: 2px 0 6px rgba(44, 62, 80, 0.05);
}

.stats-table .col-pts {
  min-width: 4.8em;
  font-weight: 700;
  color: #c0392b;
}

.stats-table .col-ast { min-width: 3em; }
.stats-table .col-2fg { min-width: 4.2em; }
.stats-table .col-3fg { min-width: 4.2em; }
.stats-table .col-pct {
  min-width: 3.8em;
  color: #1a5276;
  font-weight: 600;
}
.stats-table .col-narrow { min-width: 2.2em; }
.stats-table .col-game { min-width: 3.2em; }
.stats-table .col-wld { min-width: 5.5em; font-weight: 600; }

.stats-table tbody tr {
  background: #fff;
}

.stats-table tbody tr.row-even {
  background: #f8fafc;
}

.stats-table tbody tr.row-even td.col-no {
  background: #f8fafc;
}

.stats-table tbody tr:last-child td {
  border-bottom: none;
}

.stats-table--total .stat-max {
  color: #d35400;
  font-weight: 800;
  background: rgba(230, 126, 34, 0.1);
  border-radius: 4px;
}

.stats-table .total-footer-row td {
  background: #e8f4fa;
  font-weight: 700;
  border-top: 2px solid #3c86ab;
  border-bottom: none;
  color: #1a5276;
}

.stats-table tfoot tr td.col-no {
  background: #e8f4fa;
}

.stats-table tfoot tr td.col-pts {
  color: #c0392b;
}

.jersey-no-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: inherit;
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}

.jersey-no-btn:hover,
.jersey-no-btn:focus-visible {
  color: #3c86ab;
  outline: none;
}

.player-name-tooltip {
  position: fixed;
  z-index: 1000;
  padding: 8px 12px;
  background: rgba(44, 62, 80, 0.92);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  pointer-events: none;
  transform: translateY(calc(-100% - 8px));
  white-space: nowrap;
}

.player-name-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: var(--arrow-left, 14px);
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(44, 62, 80, 0.92);
}

@media (max-width: 800px) {
  .stats-team-panel {
    padding: 12px 10px 10px;
    border-radius: 10px;
  }

  .stats-table {
    font-size: 10px;
  }

  .stats-table th,
  .stats-table td {
    padding: 6px 4px;
  }

  .stats-table thead th {
    font-size: 10px;
  }
}
