/* Leaderboard page. Loads after styles.css. */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lb-brand { display: flex; align-items: center; gap: 8px; color: #fff; font: 600 1.5rem var(--font-display); text-shadow: 0 2px 0 rgba(23, 50, 77, .25); }
.lb-logo { width: 28px; height: 28px; border-radius: 8px; display: block; }
.lb-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.lb-back { color: #fff; font-weight: 800; font-size: 0.85rem; padding: 8px; text-decoration: underline; }
.lb .link, .lb-back { text-shadow: 0 1px 0 rgba(23, 50, 77, .35); }
.lb .top :focus-visible { outline-color: #fff; }

.lb-intro { padding: 4px 0 18px; }
.lb-intro h1 { font-size: clamp(2.2rem, 7vw, 3.4rem); margin-bottom: 8px; }
.lb-intro .lead { max-width: 40ch; margin-bottom: 0; }

/* Collection */
.lb-collection { background: var(--paper); border-radius: 22px; padding: 16px; margin: 0 0 22px; box-shadow: 0 8px 0 rgba(23, 50, 77, .14), 0 14px 28px rgba(23, 50, 77, .12); }
.coll-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.coll-head h2 { margin: 0; }
.coll-count { margin: 0; font: 600 1.05rem var(--font-display); color: var(--purple-deep); }
.coll-note { margin: 2px 0 12px; color: var(--ink-soft); font-weight: 600; font-size: 0.92rem; }
.coll-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(5, 1fr); }
.coll-slot { margin: 0; }
.coll-btn { appearance: none; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 8px; border: 2px solid var(--line); border-radius: 16px; background: #fff; cursor: pointer; text-align: center; }
.coll-btn:hover { border-color: var(--purple); background: var(--purple-tint); }
.coll-btn[aria-pressed="true"] { border-color: var(--purple-deep); background: var(--purple-tint); }
.coll-slot.earned .coll-btn { border-color: #e6c25a; background: #fff9e3; }
.coll-slot.earned .coll-btn[aria-pressed="true"] { border-color: var(--purple-deep); }
.coll-art { display: block; width: 44px; height: 44px; line-height: 0; }
.coll-art svg { width: 44px; height: 44px; }
.coll-name { font: 600 0.85rem/1.15 var(--font-display); color: var(--ink); }
.coll-slot.locked .coll-name { color: var(--ink-mute); }
.coll-state { font-size: 0.7rem; font-weight: 800; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.06em; }
.coll-slot.earned .coll-state { color: #2c6a2c; }
.coll-detail { margin: 12px 0 0; min-height: 1.5em; color: var(--ink-soft); font-weight: 700; font-size: 0.95rem; }
.coll-detail strong { color: var(--ink); }
.fb-badge { display: inline-grid; place-items: center; border-radius: 50%; background: var(--purple-tint); color: var(--purple-deep); font: 600 0.8rem var(--font-display); border: 2px solid var(--purple); }
.fb-badge.lock { background: #e9eef4; color: var(--ink-mute); border-color: var(--line); }

/* Switch and tabs */
.lb-switch { display: flex; gap: 10px; margin: 0 0 12px; }
.lb-pill { appearance: none; flex: 1 1 0; max-width: 220px; min-height: 52px; border: 2px solid var(--ink); background: var(--paper); border-radius: 999px; padding: 8px 22px; cursor: pointer; font: 600 1.2rem var(--font-display); box-shadow: 0 4px 0 rgba(23, 50, 77, .25); }
.lb-pill:hover { background: #fff; }
.lb-pill[aria-selected="true"] { background: var(--purple); border-color: var(--purple-deep); color: #fff; box-shadow: 0 4px 0 var(--purple-deep); }
.lb-pill[aria-selected="true"]:hover { background: var(--purple); }
.lb .tabs { margin-bottom: 14px; }
.lb .lb-tabs { margin: 6px 4px 12px; }
.lb .tab:hover { background: #fff; }
.lb .tab[aria-selected="true"]:hover { background: var(--purple); }
.lb-board:focus { outline: none; }

/* Table */
.lb-board .board-wrap { padding: 8px 14px 14px; min-height: 160px; }
.lb-explain { margin: 8px 4px 10px; font-weight: 700; color: var(--ink-soft); }
.lb-table { width: 100%; display: block; }
.lb-head, .lb-row { display: grid; align-items: center; column-gap: 10px; }
.lb-people .lb-head, .lb-people .lb-row { grid-template-columns: 40px minmax(0, 1fr) minmax(0, 210px) 104px 70px; }
.lb-companies .lb-head, .lb-companies .lb-row { grid-template-columns: 40px minmax(0, 1fr) minmax(0, 210px) 92px 80px; }
.lb-head { padding: 8px 8px; color: var(--ink-mute); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 800; border-bottom: 2px solid var(--line); }
.lb-row { padding: 8px; border-radius: 14px; font-weight: 700; }
.lb-row:nth-child(even) { background: #f6f3ec; }
.lb-row.top3 { background: #fff7dc; }
.lb-row.top3:nth-child(even) { background: #fff7dc; }
.c-rank { display: flex; }
.medal, .rank-num { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font: 600 1rem var(--font-display); }
.rank-num { color: var(--ink-mute); }
.medal { color: #3a2a00; border: 2px solid rgba(23, 50, 77, .35); box-shadow: 0 2px 0 rgba(23, 50, 77, .2); }
.medal.m1 { background: radial-gradient(circle at 35% 30%, #ffe892, #f2b705); }
.medal.m2 { background: radial-gradient(circle at 35% 30%, #f4f7fa, #b7c3cf); color: #1d2b3a; }
.medal.m3 { background: radial-gradient(circle at 35% 30%, #f0c096, #c27a3c); color: #35200b; }
.c-name { min-width: 0; line-height: 1.25; }
.c-name .nm { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.c-name .co { color: var(--ink-mute); font-weight: 600; }
.c-name .sub-note { display: block; color: var(--ink-mute); font-weight: 600; font-size: 0.82rem; }
.c-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; min-width: 0; line-height: 0; }
.c-badges .none { color: var(--ink-mute); font-weight: 600; font-size: 0.85rem; line-height: 1.2; }
.bdg { display: inline-block; width: 22px; height: 22px; line-height: 0; }
.bdg svg { width: 22px; height: 22px; }
.bdg-more { font: 800 0.78rem var(--font-body); color: var(--purple-deep); background: var(--purple-tint); border-radius: 999px; padding: 2px 7px; line-height: 1.3; margin-left: 2px; }
.c-time { white-space: nowrap; color: var(--ink-soft); font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.c-score { text-align: right; font: 600 1.1rem var(--font-display); font-variant-numeric: tabular-nums; color: var(--ink); }
.c-stat { color: var(--ink-soft); font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.c-avg { display: block; color: var(--ink-mute); font-weight: 600; font-size: 0.8rem; }
.lb-head .c-time, .lb-head .c-score, .lb-head .c-stat { text-align: right; }
.stars-sm { color: var(--orange); letter-spacing: 1px; font-size: 0.8rem; }

/* States */
.lb-state { text-align: center; padding: 34px 14px 30px; }
.lb-state p { margin: 0 auto 16px; max-width: 38ch; font-weight: 700; color: var(--ink-soft); font-size: 1.05rem; }
.lb-state.loading p { margin: 0; color: var(--ink-mute); }

@media (max-width: 640px) {
  .coll-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .coll-name { font-size: 0.78rem; }
  .lb-pill { max-width: none; }
  .lb-head { display: none; }
  .lb-people .lb-row, .lb-companies .lb-row {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    grid-template-areas: "rank name score" ". meta meta" ". badges badges";
    row-gap: 3px;
  }
  .c-rank { grid-area: rank; }
  .c-name { grid-area: name; }
  .c-score { grid-area: score; }
  .c-time, .c-stat { grid-area: meta; text-align: left; font-size: 0.85rem; }
  .c-badges { grid-area: badges; }
  .c-badges:empty { display: none; }
  .c-avg { display: inline; margin-left: 6px; }
  .c-avg::before { content: "\00b7\00a0"; }
  .c-name .nm { white-space: normal; overflow-wrap: anywhere; }
  .c-hide-m { display: none; }
}
@media (min-width: 641px) and (max-width: 860px) {
  .coll-grid { grid-template-columns: repeat(5, 1fr); }
  .lb-people .lb-head, .lb-people .lb-row { grid-template-columns: 40px minmax(0, 1fr) minmax(0, 150px) 98px 64px; }
  .lb-companies .lb-head, .lb-companies .lb-row { grid-template-columns: 40px minmax(0, 1fr) minmax(0, 150px) 84px 72px; }
}
@media (min-width: 641px) { .c-avg-m { display: none; } }
.lb-head .c-score { font: 800 0.74rem var(--font-body); color: var(--ink-mute); }
.lb-head .c-time, .lb-head .c-stat { font-weight: 800; }
.lb-board { margin-bottom: 22px; }
