/* Stats Hub tabs */
.stats-hub-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  background: var(--menu-panel-highlight);
}

.stats-hub-tab {
  flex: 1;
  min-width: 0;
  padding: 8px 6px;
  border: none;
  border-radius: var(--menu-btn-radius);
  background: transparent;
  color: var(--menu-btn-color);
  font-size: var(--menu-btn-font-size);
  font-weight: var(--menu-btn-font-weight);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-tap-highlight-color: transparent;
}

.stats-hub-tab--active {
  background: var(--menu-button-active);
  color: var(--color-brown-dark);
}

.stats-hub-tab:not(.stats-hub-tab--active):hover {
  background: var(--menu-button-hover);
}

/* Stats Hub panes */
.stats-hub-pane {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stats-hub-pane--hidden {
  display: none;
}

/* Scrollable stats/leaderboard list */
.stats-scroll-list {
  max-height: calc(var(--games-list-row-height) * 4);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 8px;
}

/* Player Stats */
.stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex: 0 0 auto;
  padding: 10px 12px;
  height: var(--games-list-row-height);
  font-size: var(--menu-btn-font-size);
  line-height: 1.2;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.38);
  box-sizing: border-box;
}

.stats-label {
  color: var(--color-brown-muted, #6C4B2B);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-value {
  font-weight: 700;
  color: var(--color-brown-strong, #654321);
  font-variant-numeric: tabular-nums;
  min-width: 36px;
  text-align: right;
}

/* Inline stats summary (inside accordion toggle) */
.games-stats-summary {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 8px;
  margin-right: auto;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-brown-strong, #654321);
}

.games-stats-summary:empty {
  display: none;
}

.games-stats-item {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.games-stats-separator {
  color: var(--color-brown-muted, #6C4B2B);
  opacity: 0.5;
}

.games-stats-item--wins {
  color: #2e7d32;
}

.games-stats-item--losses {
  color: #c62828;
}

/* Leaderboard */
.leaderboard-row {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 10px 12px;
  height: var(--games-list-row-height);
  font-size: var(--menu-btn-font-size);
  line-height: 1.2;
  gap: 10px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.38);
  box-sizing: border-box;
}

.leaderboard-rank {
  width: 26px;
  font-weight: 700;
  color: var(--color-brown-muted, #6C4B2B);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* Top 3 rank highlight */
.leaderboard-row:first-child .leaderboard-rank {
  color: var(--color-gold, #D4AF37);
}

.leaderboard-row:nth-child(2) .leaderboard-rank,
.leaderboard-row:nth-child(3) .leaderboard-rank {
  color: var(--color-brown-warm, #5B3D24);
}

.leaderboard-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-brown-strong, #654321);
  font-weight: 700;
}

.leaderboard-value {
  font-weight: 700;
  color: var(--color-brown-strong, #654321);
  min-width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Empty state */
#leaderboard-status {
  color: var(--color-brown-muted, #6C4B2B);
  font-size: 0.78rem;
  text-align: center;
  padding: 8px 4px;
}
