/* Leaderboard (views/leaderboard.ts): tabs, a podium for the top 3, then the list. */
.leaderboard { padding-bottom: 96px; max-width: 760px; }
.leaderboard .section-head { margin-bottom: 24px; }

.lb-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 48px; }
.lb-tab { display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px; border-radius: 999px; border: 1px solid var(--border-2); background: rgba(255, 255, 255, 0.03); color: var(--muted); font-size: 13.5px; font-weight: 600; transition: background 0.15s, color 0.15s, border-color 0.15s; }
.lb-tab .icon { width: 15px; height: 15px; }
.lb-tab:hover { color: var(--text); border-color: var(--border-3); }
.lb-tab[aria-current="page"] { background: #fff; border-color: #fff; color: #0b0b10; }

/* Podium: 2nd, 1st, 3rd from left to right (the list order in the markup). */
.lb-podium { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 12px; margin: 0 0 28px; padding: 0; }
.lb-place { display: grid; gap: 12px; justify-items: center; min-width: 0; }
.lb-who { display: grid; justify-items: center; gap: 6px; min-width: 0; max-width: 100%; color: var(--text); text-align: center; }
.lb-who b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.lb-who:hover b { text-decoration: underline; text-underline-offset: 3px; }
.lb-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 2px solid var(--place, var(--border-2)); box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.45); background: var(--surface-overlay); }
.lb-p1 .lb-avatar { width: 88px; height: 88px; }
.lb-initial { display: grid; place-items: center; font-weight: 700; font-size: 26px; color: var(--muted); }
.lb-step { width: 100%; display: grid; place-items: center; border-radius: 14px 14px 6px 6px; font-size: 34px; font-weight: 800; color: var(--place); border: 1px solid color-mix(in srgb, var(--place) 35%, transparent); border-bottom: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--place) 22%, transparent), color-mix(in srgb, var(--place) 4%, transparent)); }
.lb-p1 { --place: #f5c542; }
.lb-p2 { --place: #c9ced6; }
.lb-p3 { --place: #d08a4e; }
.lb-p1 .lb-step { height: 132px; font-size: 44px; }
.lb-p2 .lb-step { height: 96px; }
.lb-p3 .lb-step { height: 72px; }

.lb-count { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lb-count .icon { width: 14px; height: 14px; }

.lb-list { list-style: none; display: grid; gap: 8px; margin: 0; padding: 0; }
.lb-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 14px; border: 1px solid var(--border); background: rgba(255, 255, 255, 0.025); color: var(--text); transition: background 0.15s, border-color 0.15s; }
.lb-row:hover { background: rgba(255, 255, 255, 0.05); border-color: var(--border-2); }
.lb-rank { width: 26px; flex: none; color: var(--faint); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.lb-avatar-sm { width: 34px; height: 34px; flex: none; border-radius: 50%; object-fit: cover; background: var(--surface-overlay); }
.lb-avatar-sm.lb-initial { font-size: 14px; }
.lb-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 14.5px; }
.lb-empty { text-align: center; padding: 40px 0; }

@media (max-width: 560px) {
  .lb-tabs { margin-bottom: 36px; }
  .lb-podium { gap: 8px; }
  .lb-avatar { width: 56px; height: 56px; }
  .lb-p1 .lb-avatar { width: 68px; height: 68px; }
  .lb-who b { font-size: 13.5px; }
  .lb-p1 .lb-step { height: 104px; font-size: 36px; }
  .lb-p2 .lb-step { height: 76px; font-size: 28px; }
  .lb-p3 .lb-step { height: 58px; font-size: 28px; }
  .lb-row { padding: 9px 12px; gap: 10px; }
}

/* Pages of 10 (?page=): previous / numbers / next. */
.lb-pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 24px; }
.lb-pg { display: grid; place-items: center; min-width: 38px; height: 38px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--border); background: rgba(255, 255, 255, 0.025); color: var(--muted); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; transition: background 0.15s, color 0.15s, border-color 0.15s; }
a.lb-pg:hover { color: var(--text); border-color: var(--border-2); background: rgba(255, 255, 255, 0.05); }
.lb-pg[aria-current="page"] { background: #fff; border-color: #fff; color: #0b0b10; }
span.lb-pg-nav { opacity: 0.35; }
.lb-pg .icon { width: 16px; height: 16px; }

/* Supporters tab: supporters without an account are not links; the donate button under the list. */
div.lb-who:hover b { text-decoration: none; }
div.lb-row:hover { background: rgba(255, 255, 255, 0.025); border-color: var(--border); }
.lb-donate { display: flex; justify-content: center; margin: 28px 0 0; }

/* Supporters: the shop's badges, then Buy Me a Coffee (views/leaderboard.ts) */
.lb-support { display: grid; justify-items: center; gap: 10px; margin-top: 36px; }
.lb-shop { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.lb-support .lb-donate { margin: 14px 0 0; }
.lb-note { margin: 0; max-width: 460px; text-align: center; font-size: 13px; line-height: 1.5; }

/* Top 3 as their real profile cards (embed images); flat, the place number in its colour. */
.lb-podium { align-items: end; gap: 14px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.18fr) minmax(0, 1fr); }
.lb-place { display: block; }
.lb-card { display: grid; border-radius: 16px; overflow: hidden; border: 1px solid var(--border-2); background: var(--bg-2); color: var(--text); transition: border-color 0.2s, transform 0.2s; }
.lb-card:hover { border-color: rgba(255, 255, 255, 0.28); transform: translateY(-3px); }
.lb-p1 .lb-card { border-color: color-mix(in srgb, var(--place) 45%, transparent); }
.lb-cover { display: grid; place-items: center; aspect-ratio: 1200 / 630; background: #0f0f14; overflow: hidden; }
.lb-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-card { width: 100%; }
.lb-cover .lb-avatar { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; box-shadow: none; }
@media (max-width: 760px) { .lb-cover .lb-avatar { width: 64px; height: 64px; } }
.lb-card-foot { display: flex; align-items: center; gap: 10px; padding: 12px 14px; min-width: 0; border-top: 1px solid var(--border); }
.lb-card-foot b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.lb-card:hover .lb-card-foot b { text-decoration: underline; text-underline-offset: 3px; }
.lb-place-n { flex: none; font-size: 15px; font-weight: 800; color: var(--place); font-variant-numeric: tabular-nums; }
.lb-p1 .lb-card-foot { padding-block: 14px; }
.lb-p1 .lb-place-n, .lb-p1 .lb-card-foot b { font-size: 17px; }
.lb-row { background: var(--bg-2); }
.lb-row:hover { background: #111118; }
@media (max-width: 760px) {
  .lb-podium { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .lb-p1 { order: -1; grid-column: 1 / -1; }
  .lb-p2 .lb-card-foot, .lb-p3 .lb-card-foot { padding: 10px; gap: 6px; flex-wrap: wrap; }
  .lb-p2 .lb-card-foot b, .lb-p3 .lb-card-foot b { font-size: 13.5px; }
}
