/* ============ Stats / Leaderboards view ============ */

.stats-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.9rem;
  margin-bottom: 2rem;
}

.stat-tile {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.stat-tile__label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.stat-tile__value {
  font-family: "EB Garamond", serif;
  font-size: 1.8rem;
  line-height: 1.1;
  color: var(--gold-bright);
}

/* Equal-width grid. Boards are kept to a uniform row count (top ~10) in
   stats.js so rows line up cleanly; the one inherently-short board (Top Parsers
   — only members with logged parses appear) is rendered LAST so its short
   height is harmless trailing space rather than a gap mid-grid. */
.stats-boards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
  align-items: start;
}

.board {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.1rem 1.2rem 1.25rem;
}
.board > h3,
.board__head h3 {
  margin: 0 0 0.85rem;
  font-family: "EB Garamond", serif;
  font-size: 1.25rem;
  letter-spacing: 0.03em;
  color: var(--gold-bright);
}
.board__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}
.board__head h3 {
  margin: 0;
}
.board__select {
  background: var(--bg-1);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.35rem 0.5rem;
  font: inherit;
  font-size: 0.82rem;
  max-width: 55%;
}
.board__select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 170, 110, 0.15);
}

.board__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.board__row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-radius: 3px;
}
.board__row--plain {
  padding: 0.45rem 0.5rem;
}
.board__more {
  padding: 0.5rem 0.5rem 0.1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.board__rank {
  flex: 0 0 1.6rem;
  text-align: right;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.board__link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  min-width: 0;
  padding: 0.45rem 0.5rem;
  border-radius: 3px;
  color: inherit;
  text-decoration: none;
  transition: background 0.15s;
}
.board__link:hover {
  background: rgba(200, 170, 110, 0.08);
}

.board__avatar {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--border);
}
.board__avatar--empty {
  display: inline-block;
  background: var(--bg-1);
}

.board__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.board__job {
  flex: 0 0 auto;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.board__value {
  flex: 0 0 auto;
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--gold);
}
/* When the value carries a parse-colour class, let that win over the gold. */
.board__value [class^="parse-"],
.board__value [class*=" parse-"] {
  font-weight: 600;
}

/* Touch: keep rows comfortably tappable. */
@media (pointer: coarse) {
  .board__link {
    min-height: 44px;
  }
  .board__select {
    min-height: 44px;
    font-size: 1rem;
  }
}
