/* ==========================================================================
   Stats & Leaderboard — /stats/
   ========================================================================== */

.stats-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1rem;
}

.stats-tab-btn {
  padding: 7px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font: 500 0.86rem/1 var(--font-text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.stats-tab-btn.is-active {
  background: var(--btn-bg);
  border-color: transparent;
  color: var(--btn-ink);
}

.stats-tab-btn:hover:not(.is-active) {
  border-color: var(--muted);
  color: var(--ink);
}

.stats-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

.stats-row:last-child {
  border-bottom: none;
}

.stats-rank {
  min-width: 2.4em;
  font: 600 0.78rem/1 var(--font-text);
  color: var(--muted);
  flex-shrink: 0;
}

.stats-row:first-child .stats-rank {
  color: var(--accent-text);
}

.stats-icon {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.stats-name {
  flex: 1;
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.stats-name:hover {
  text-decoration: underline;
}

.stat-count {
  min-width: 3.5em;
  text-align: right;
  font: 600 0.88rem/1 var(--font-text);
  color: var(--ink-soft);
  flex-shrink: 0;
}

/* Loading skeleton */
.stats-skeleton-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.skel {
  background: var(--surface-3);
  border-radius: 4px;
  animation: skel-pulse 1.4s ease-in-out infinite;
}

@keyframes skel-pulse {
  0%, 100% { opacity: 0.45; }
  50%       { opacity: 0.9; }
}

/* No-JS note */
.stats-noscript {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.5rem 0 1rem;
}
