/* ─── Drafter Stats Page ─────────────────────────────────────────────────── */

/* ── Stats table ── */
#stats-head th {
  text-align: center !important;
  border: 1px solid #3a3e3f !important;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background 0.12s;
}

#stats-head th:hover { background: rgba(98,168,172,0.1); }

#stats-head th.sort-active { color: #fff; }

#stats-body td {
  text-align: center;
  border: 1px solid #2e3233 !important;
  padding: 7px 10px !important;
  font-size: 0.83rem;
}

#stats-body td.cell-left { text-align: left; }

/* ── Rate columns ── */
.rate-col { color: var(--color-accent); }

/* ── Sortable header arrow ── */
.sort-arrow { font-size: 0.7rem; margin-left: 3px; opacity: 0.8; }

/* ── Empty / loading states ── */
.ps-empty-state {
  text-align: center;
  padding: 5rem 1rem;
  color: #444;
}

.ps-empty-state i {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}

.ps-empty-state p {
  font-size: 0.9rem;
  margin: 0;
}

/* ─── Player scores sortable headers ────────────────────────────────────── */
.ps-sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color 0.12s;
}

.ps-sortable:hover { color: var(--color-accent); }

.ps-sort-active { color: #fff; }

.ps-sort-active::after {
  margin-left: 4px;
  font-size: 0.7rem;
  opacity: 0.8;
}

.ps-sort-asc::after  { content: '↑'; }
.ps-sort-desc::after { content: '↓'; }

/* ─── Row click / expand ─────────────────────────────────────────────────── */
#stats-body tr[data-row-index] { cursor: pointer; }

#stats-body tr.row-expanded > td {
  background: rgba(98, 168, 172, 0.07) !important;
}

/* ─── Detail / histogram panel ───────────────────────────────────────────── */
/* Loading placeholder (still uses colspan) */
tr.detail-row > td[colspan] {
  padding: 0 !important;
  border: none !important;
}

.spark-panel-loading {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  color: #666;
  font-size: 0.82rem;
  background: rgba(14, 18, 20, 0.95);
}

/* Per-column detail cells */
.detail-cell {
  background: rgba(14, 18, 20, 0.95) !important;
  border-top: none !important;
  border-bottom: 1px solid rgba(98, 168, 172, 0.2) !important;
  vertical-align: middle !important;
  padding: 8px 6px !important;
}

.detail-cell-legend {
  vertical-align: middle !important;
  white-space: nowrap;
}

.detail-cell-chart {
  min-width: 188px;
  vertical-align: top !important;
  padding-top: 6px !important;
}

.detail-cell-empty {
  border-left: none !important;
  border-right: none !important;
}

/* Legend */
.spark-legend {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.7rem;
  color: #888;
}

.spark-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.spark-empty {
  color: #444;
  font-size: 0.75rem;
}

/* ─── Legend + Season button row ─────────────────────────────────────────── */
.detail-legend-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.season-dist-btn {
  background: var(--color-primary);
  border: 1px solid var(--color-secondary);
  border-radius: 4px;
  color: var(--color-accent);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.season-dist-btn:hover:not(:disabled) {
  background: var(--color-secondary);
  color: #fff;
}

.season-dist-btn.active {
  background: var(--color-secondary);
  color: #fff;
}

.season-dist-btn:disabled { opacity: 0.5; cursor: default; }

/* ─── Season outcome distribution row ────────────────────────────────────── */
.season-dist-cell {
  padding: 0.75rem 1rem 0.5rem !important;
  background: rgba(14, 18, 20, 0.95) !important;
  border-top: none !important;
  border-bottom: 1px solid rgba(98,168,172,0.2) !important;
}

.season-dist-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
  width: 100%;
}

.season-dist-title {
  color: var(--color-accent);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.season-dist-note {
  color: #555;
  font-size: 0.72rem;
}

.season-bin-toggle {
  display: flex;
  gap: 2px;
  margin-left: auto;
}

.season-bin-btn {
  background: var(--color-primary);
  border: 1px solid var(--color-secondary);
  border-radius: 3px;
  color: #666;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.season-bin-btn:hover { color: #ccc; }

.season-bin-btn.active {
  background: var(--color-secondary);
  color: #fff;
  border-color: var(--color-secondary);
}

/* D3 bar for season chart */
.sbar { fill: var(--color-secondary); opacity: 0.7; }
