/* ══════════════════════════
   LEADERBOARD PAGE
══════════════════════════ */
.lb-page {
  padding: 28px 24px 80px;
  max-width: 720px;
  margin: 0 auto;
}

/* ─── HEADER ─── */
.lb-header { margin-bottom: 24px; }

.lb-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 3.5vw, 30px);
  font-weight: 800;
  font-style: italic;
  margin-bottom: 6px;
}

.lb-subtitle {
  font-size: clamp(12px, 1vw, 13px);
  color: var(--muted);
}

/* ─── TABS ─── */
.lb-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.lb-tab {
  padding: 7px 16px;
  background: var(--panel);
  border: 1px solid var(--border-md);
  border-radius: 50px;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: clamp(12px, 1vw, 13px);
  font-weight: 600;
  cursor: pointer;
  transition: all .18s;
  -webkit-tap-highlight-color: transparent;
}

.lb-tab:hover { color: var(--text); border-color: var(--gold-glow); }

.lb-tab--active {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--gold);
}

/* ─── BOARD ─── */
.lb-board {
  display: flex;
  flex-direction: column;
  gap: 24px;   /* gap between sections */
}

/* ─── SECTION (one post group) ─── */
.lb-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lb-section-header {
  font-family: var(--font-display);
  font-size: clamp(13px, 1.1vw, 15px);
  font-weight: 700;
  font-style: italic;
  color: var(--text-2);
  padding: 8px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  border-left: 3px solid var(--gold);
  letter-spacing: .2px;
}

/* ─── ROW ─── */
.lb-row {
  display: grid;
  grid-template-columns: 44px 52px 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 4px;
  align-items: center;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  transition: border-color .18s, transform .18s;
}

.lb-row:hover {
  border-color: var(--border-md);
  transform: translateX(3px);
}

.lb-row--medal {
  border-color: var(--gold-glow);
  background: linear-gradient(135deg, var(--card), rgba(232,184,75,.04));
}

/* Rank */
.lb-rank {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  color: var(--muted);
  text-align: center;
  grid-row: 1 / 3;
}

.lb-rank--medal { font-size: 22px; color: var(--text); }

/* Avatar */
.lb-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--panel), var(--card));
  border: 2px solid var(--border);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  grid-row: 1 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-avatar::after {
  content: attr(data-initials);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  font-style: italic;
  color: var(--gold);
  z-index: 0;
}

.lb-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  z-index: 1;
  border-radius: 50%;
}

/* Info */
.lb-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.lb-name {
  font-family: var(--font-display);
  font-size: clamp(13px, 1.1vw, 15px);
  font-weight: 700;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-cat {
  font-size: clamp(10px, 0.85vw, 11px);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Stats */
.lb-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.lb-votes {
  font-size: clamp(12px, 1vw, 13px);
  color: var(--text-2);
  white-space: nowrap;
}

.lb-votes strong { color: var(--gold); font-weight: 700; }

.lb-boosts {
  font-size: 11px;
  color: var(--purple);
}

/* Progress bar — spans full width below name/stats */
.lb-bar-wrap {
  grid-column: 3 / 5;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.lb-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--teal));
  border-radius: 2px;
  transition: width .6s cubic-bezier(.4, 0, .2, 1);
}

.lb-row--medal .lb-bar { background: linear-gradient(90deg, var(--gold), #e03030); }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .lb-page { padding: 16px 14px calc(var(--bottom-h) + 16px); }
  .lb-row  { padding: 10px 12px; column-gap: 10px; }
}

@media (max-width: 480px) {
  .lb-row {
    grid-template-columns: 36px 40px 1fr auto;
  }
  .lb-avatar { width: 40px; height: 40px; }
  .lb-rank--medal { font-size: 18px; }
}
