.leaderboard-page {
    display: block;
    background: #e4e5e1;
    color: #000;
    font-family: Barlow, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.lb {
    container-type: inline-size;
    --row-inset: clamp(12px, 3.9cqw, 28px);
    --panel-inset: max(var(--row-inset), env(safe-area-inset-left), env(safe-area-inset-right));
}

.lb-head,
.lb-rows,
.lb-status {
    padding-inline: var(--panel-inset);
}

.lb-head {
    position: sticky;
    top: 0;
    z-index: 1;
    padding-block-start: max(var(--panel-inset), env(safe-area-inset-top));
    background: #e4e5e1;
}

.lb-bar {
    position: relative;
    display: grid;
    place-items: center;
    box-sizing: border-box;
    min-height: clamp(52px, 13.4cqw, 70px);
    padding: clamp(10px, 2.4cqw, 14px) clamp(52px, 12cqw, 76px);
    background: #000;
    color: #fff;
}

.lb-title {
    margin: 0;
    font-size: clamp(0.8125rem, 3.06cqw, 1rem);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: 0.0048em;
    text-transform: uppercase;
    text-align: center;
}

.lb-title span {
    display: block;
}

.lb-back {
    position: absolute;
    inset-inline-start: clamp(8px, 2.4cqw, 18px);
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    min-width: 48px;
    min-height: 48px;
    color: inherit;
}

.lb-chevron {
    width: clamp(12px, 3.06cqw, 16px);
    height: clamp(24px, 6.12cqw, 32px);
}

.lb-back:active .lb-chevron {
    opacity: 0.6;
}

.lb-back:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -4px;
}

@media (hover: hover) {
    .lb-back:hover .lb-chevron {
        opacity: 0.65;
    }
}

.lb-rows {
    margin: 0;
    padding-block-end: var(--panel-inset);
    list-style: none;
}

.lb-row {
    display: flex;
    align-items: center;
    padding: clamp(14px, 3.4cqw, 20px) var(--row-inset);
    border-bottom: 2px solid rgb(0 0 0 / 10%);
}

.lb-row:last-child {
    border-bottom: 0;
}

.lb-rank,
.lb-distance {
    flex: none;
    font-size: clamp(1.375rem, 5.9cqw, 1.875rem);
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.006em;
    font-variant-numeric: tabular-nums;
}

.lb-rank {
    /* Leave room for 100 while keeping names aligned with the first row. */
    width: 3ch;
    margin-inline-end: clamp(4px, calc(5.2cqw - 1ch), 24px);
    overflow-wrap: anywhere;
}

.lb-name {
    flex: 1;
    min-width: 0;
    font-size: clamp(1.0625rem, 4.7cqw, 1.5rem);
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: 0.003em;
    overflow-wrap: anywhere;
}

.lb-distance {
    margin-inline-start: clamp(12px, 3cqw, 24px);
    text-align: end;
}

.lb-status {
    margin: 0;
    padding-block: 1.5rem;
    text-align: center;
}
