/* The public leaderboards (leaderboards.html): on top of style.css, the shared look. */

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.b-head { margin: 12px 0 22px; }
.b-head h1 { margin-bottom: 10px; }
.b-head .sub { max-width: 680px; }
.b-back { margin: 4px 0 6px; font-weight: 600; }
.b-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

/* the map / sport / kind switches */
.b-controls { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.seg { display: inline-flex; background: var(--fill-2); border: 1px solid var(--hairline); border-radius: 14px; padding: 3px; }
.seg a { color: var(--label-2); font-weight: 650; font-size: 15px; padding: 8px 16px; border-radius: 11px; white-space: nowrap; }
.seg a:hover { color: var(--label); }
.seg a.on { background: var(--accent); color: #fff; }

/* find a rider */
.b-find { padding: 16px; margin-bottom: 22px; }
.b-find-row, .b-search { display: flex; gap: 10px; flex-wrap: wrap; }
.b-find-row input, .b-search input { flex: 1; min-width: 200px; }
#find-out:not(:empty) { margin-top: 14px; }
.b-find-none { margin: 4px 4px 0; }
.small-pad { padding: 16px 0; }

/* the world rankings: the top ten climbers and sprinters, who ride the title paint */
.b-titles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 26px; }
.b-title { padding: 20px; position: relative; overflow: hidden; }
.b-title.climb { border-color: rgba(214, 48, 32, 0.35); }
.b-title.sprint { border-color: rgba(31, 150, 80, 0.4); }
.b-title h2 { font-size: 22px; margin: 0; }
.b-title .eyebrow { margin-bottom: 2px; }
.b-title.climb .eyebrow { color: var(--red); }
.b-title.sprint .eyebrow { color: var(--green); }
.b-title-head { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.b-title-swatch { width: 46px; height: 46px; border-radius: 14px; flex: none; }
.b-title-swatch.climb {
  background: radial-gradient(circle, #ff2a2a 0 28%, transparent 31%) 0 0 / 15px 15px, radial-gradient(circle, #ff2a2a 0 28%, transparent 31%) 7.5px 7.5px / 15px 15px, #f6f6f4;
  box-shadow: 0 0 18px rgba(255, 42, 42, 0.55);
}
.b-title-swatch.sprint {
  background: repeating-linear-gradient(-32deg, #0a160b 0 7px, #4dff22 7px 13px);
  box-shadow: 0 0 22px rgba(77, 255, 34, 0.6);
  animation: b-pulse 1.6s ease-in-out infinite;
}
@keyframes b-pulse { 50% { box-shadow: 0 0 8px rgba(77, 255, 34, 0.3); } }
@media (prefers-reduced-motion: reduce) { .b-title-swatch.sprint { animation: none; } }
.b-title-list { list-style: none; margin: 12px 0 8px; padding: 0; }
.b-title-list li { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--separator); }
.b-title-list li:last-child { border-bottom: 0; }
.b-title-list li.you { background: rgba(15, 107, 67, 0.14); border-radius: 10px; }
.b-title-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-title-pts { color: var(--label-2); font-size: 14px; font-variant-numeric: tabular-nums; }

/* the list of segments */
.b-count { margin: 0 0 12px 2px; }
.b-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.b-card {
  display: flex; flex-direction: column; gap: 8px; color: var(--label);
  background: var(--glass); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 18px;
  transition: border-color 0.15s, background-color 0.15s, transform 0.12s;
}
.b-card:hover { color: var(--label); border-color: rgba(15, 107, 67, 0.5); background: var(--group-hover); transform: translateY(-1px); }
.b-card h3 { margin: 2px 0 0; font-size: 18px; }
.b-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.b-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--label-2); font-size: 14px; font-variant-numeric: tabular-nums; }
.b-best { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--separator); display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: end; }
.b-best .caps { grid-column: 1 / -1; font-size: 10px; color: var(--label-3); }
.b-best .t { font-weight: 750; font-variant-numeric: tabular-nums; font-size: 17px; }
.b-best.empty { display: block; }

/* category badges, as the game colours them */
.badge.cat { color: #fff; }
.badge.hc { background: #d12d2d; }
.badge.c1 { background: rgba(214, 48, 32, 0.24); color: var(--red); }
.badge.c2 { background: rgba(232, 130, 0, 0.22); color: var(--orange); }
.badge.c3 { background: rgba(255, 214, 10, 0.2); color: var(--yellow); }
.badge.c4 { background: rgba(31, 150, 80, 0.18); color: var(--green); }

/* one board */
.b-stats { margin-bottom: 18px; }
.b-me { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 22px; margin-bottom: 18px; }
.b-me .big { font-size: 26px; font-weight: 750; letter-spacing: -0.4px; margin: 4px 0 0; }
.b-me .big .muted { font-size: 17px; font-weight: 600; }
.b-board { padding: 20px; margin-bottom: 14px; }
.b-search { margin-bottom: 14px; }
.b-empty { margin: 18px 4px 6px; }
.b-table td { font-size: 15px; }
.b-table .mono { font-variant-numeric: tabular-nums; }
.b-table tr.you td { background: rgba(15, 107, 67, 0.14); }
.b-table tr.you td:first-child { border-radius: 10px 0 0 10px; }
.b-table tr.you td:last-child { border-radius: 0 10px 10px 0; }
.who { font-weight: 650; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.6px; color: var(--label-2); background: var(--fill-2); border-radius: 6px; padding: 1px 6px; vertical-align: 1px; }
.rank { display: inline-grid; place-items: center; min-width: 30px; height: 26px; padding: 0 6px; border-radius: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rank.medal { color: #1a1a1a; }
.rank.m1 { background: #ffc83d; }
.rank.m2 { background: #c7c7cc; }
.rank.m3 { background: #d08a4e; }
.b-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.b-pager .off { opacity: 0.35; pointer-events: none; }

@media (max-width: 860px) {
  .b-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .b-titles { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .b-grid { grid-template-columns: 1fr; }
  .b-controls { gap: 8px; }
  .seg { width: 100%; }
  .seg a { flex: 1; text-align: center; padding: 8px 6px; font-size: 14px; }
  .hide-sm { display: none; }
  .b-board { padding: 14px 12px; }
  .b-table td { white-space: nowrap; }
  .b-table td.wrapcell { white-space: normal; }
}
