/* ==========================================================================
   Топ игроков
   ========================================================================== */

.leaderboard-page {
    padding-bottom: 26px;
}

.page-hero--board {
    align-items: center;
}

/* ---------- Панель выбора трассы ---------- */

.board-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
    padding: 20px 22px;
}

.board-toolbar__text {
    flex: 1 1 auto;
    min-width: 0;
}

.board-toolbar__label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted-2);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.board-select {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
}

.board-select__row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.board-select .input {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 520px;
}

.board-select .btn {
    flex: none;
}

.board-damage .board-toolbar__label {
    margin-bottom: 6px;
}

.board-damage .damage-options {
    justify-content: flex-start;
}

.board-toolbar__stats {
    display: flex;
    flex: none;
    gap: 8px;
}

.mini-stat {
    min-width: 96px;
    padding: 10px 14px;
    border: 1px solid var(--line-soft);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.024);
    text-align: left;
}

.mini-stat strong {
    display: block;
    color: var(--text);
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.mini-stat span {
    display: block;
    margin-top: 2px;
    color: var(--muted-2);
    font-size: 0.64rem;
    font-weight: 700;
    white-space: nowrap;
}

/* ---------- Информация о трассе ---------- */

.board-info {
    margin-bottom: 28px;
}

.board-info__title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
}

.board-info__title h2 {
    font-size: clamp(1.4rem, 2.4vw, 1.9rem);
    letter-spacing: -0.035em;
}

.board-info__preview {
    max-width: 820px;
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.6;
}

/* ---------- Пьедестал ---------- */

.podium {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: center;
    gap: 16px;
    margin-bottom: 26px;
}

.podium-card {
    position: relative;
    display: flex;
    flex: 1 1 300px;
    flex-direction: column;
    align-items: center;
    max-width: 380px;
    min-height: 238px;
    padding: 26px 20px 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 20px;
    background:
        radial-gradient(340px 200px at 50% -20%, rgba(148, 170, 220, 0.1), transparent 70%),
        linear-gradient(180deg, rgba(22, 32, 56, 0.9), rgba(9, 15, 27, 0.96));
    box-shadow: var(--shadow);
    text-align: center;
}

.podium-card--1 {
    order: 2;
    min-height: 286px;
    padding-top: 34px;
    border-color: rgba(255, 191, 52, 0.34);
    background:
        radial-gradient(420px 240px at 50% -18%, rgba(255, 176, 32, 0.2), transparent 70%),
        linear-gradient(180deg, rgba(42, 39, 33, 0.92), rgba(12, 15, 24, 0.97));
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.36), 0 0 0 1px rgba(255, 176, 32, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.podium-card--2 {
    order: 1;
    border-color: rgba(190, 205, 230, 0.22);
}

.podium-card--3 {
    order: 3;
    border-color: rgba(255, 140, 90, 0.2);
}

.podium-card.is-me {
    box-shadow: 0 0 0 2px rgba(255, 176, 32, 0.4), 0 22px 50px rgba(255, 128, 45, 0.12);
}

.podium-card__rank {
    position: absolute;
    top: 14px;
    left: 18px;
    color: rgba(255, 255, 255, 0.14);
    font-family: var(--font-display);
    font-size: 2.6rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.06em;
}

.podium-card--1 .podium-card__rank {
    color: rgba(255, 196, 70, 0.32);
}

.podium-card--2 .podium-card__rank {
    color: rgba(200, 216, 240, 0.24);
}

.podium-card--3 .podium-card__rank {
    color: rgba(255, 150, 100, 0.22);
}

.podium-card__avatar {
    position: relative;
    margin-top: 14px;
    padding: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
}

.podium-card__avatar .avatar--lg {
    width: 72px;
    height: 72px;
}

.podium-card--1 .podium-card__avatar {
    background: linear-gradient(135deg, rgba(255, 209, 92, 0.6), rgba(255, 106, 61, 0.35));
    box-shadow: 0 0 26px rgba(255, 176, 32, 0.24);
}

.podium-card--1 .avatar--lg {
    width: 86px;
    height: 86px;
}

.podium-card__nick {
    max-width: 100%;
    margin: 12px 0 4px;
    overflow: hidden;
    font-size: 0.98rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.podium-card__score {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
    color: var(--text);
    font-size: 1.55rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
}

.podium-card--1 .podium-card__score {
    color: #ffd15c;
    font-size: 1.8rem;
}

.podium-card__score small {
    color: var(--muted-2);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0;
}

.podium-card__meta {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
}

.podium-card__meta span + span::before {
    content: "·";
    margin-right: 8px;
    color: var(--muted-2);
}

.podium-card__baseline {
    width: calc(100% + 40px);
    height: 44px;
    margin: auto -20px 0;
    background:
        linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.03)),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.07) 0 20px, transparent 20px 40px);
    border-top: 1px solid var(--line-soft);
}

.podium-card--1 .podium-card__baseline {
    height: 58px;
    background:
        linear-gradient(180deg, transparent, rgba(255, 176, 32, 0.08)),
        repeating-linear-gradient(90deg, rgba(255, 176, 32, 0.13) 0 20px, transparent 20px 40px);
    border-top-color: rgba(255, 176, 32, 0.18);
}

/* ---------- Таблица ---------- */

.board-table-card {
    margin-bottom: 24px;
    overflow: hidden;
}

.board-table th:first-child,
.board-table td:first-child {
    padding-left: 22px;
}

.board-table th:last-child,
.board-table td:last-child {
    padding-right: 22px;
}

.board-table td {
    padding-top: 12px;
    padding-bottom: 12px;
}

.board-table .table-rank {
    font-size: 0.86rem;
}

.board-table__note {
    padding: 12px 22px;
    border-top: 1px solid var(--line-soft);
    color: var(--muted-2);
    font-size: 0.72rem;
}

/* ---------- Своё место вне таблицы ---------- */

.my-place {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
    padding: 16px 20px;
    border-color: rgba(255, 176, 32, 0.26);
    background:
        radial-gradient(420px 140px at 4% 50%, rgba(255, 176, 32, 0.1), transparent 70%),
        linear-gradient(180deg, rgba(26, 33, 53, 0.9), rgba(10, 16, 30, 0.96));
}

.my-place__label {
    color: var(--accent);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.my-place__rank {
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.my-place__nick {
    font-weight: 700;
}

.my-place__score {
    margin-left: auto;
    color: var(--accent);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.board-empty {
    margin-bottom: 24px;
}

/* ---------- Призыв ---------- */

.board-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 8px;
    padding: 24px 26px;
    border-color: rgba(255, 176, 32, 0.16);
    background:
        radial-gradient(500px 180px at 6% 0%, rgba(255, 176, 32, 0.09), transparent 68%),
        linear-gradient(160deg, rgba(24, 34, 58, 0.9), rgba(9, 15, 27, 0.95));
}

.board-cta h3 {
    margin-bottom: 5px;
    font-size: 1.15rem;
}

.board-cta p {
    max-width: 640px;
    color: var(--muted);
    font-size: 0.84rem;
}

.board-cta__actions {
    display: flex;
    flex: none;
    gap: 8px;
}

/* ---------- Адаптивность ---------- */

@media (max-width: 980px) {
    .board-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
    }

    .board-select .input {
        max-width: none;
    }

    .board-toolbar__stats {
        width: 100%;
    }

    .mini-stat {
        flex: 1;
    }
}

@media (max-width: 780px) {
    .page-hero--board {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .podium {
        gap: 12px;
    }

    .podium-card,
    .podium-card--1 {
        order: 0;
        flex-basis: 100%;
        max-width: none;
        min-height: 0;
        padding-bottom: 0;
    }

    .podium-card--1 {
        padding-top: 26px;
    }

    .podium-card__baseline,
    .podium-card--1 .podium-card__baseline {
        height: 22px;
        margin-top: 16px;
    }

    .podium-card--1 .podium-card__avatar .avatar--lg,
    .podium-card--1 .avatar--lg {
        width: 72px;
        height: 72px;
    }

    .board-cta {
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
    }

    .board-cta__actions {
        width: 100%;
    }

    .board-cta__actions .btn {
        flex: 1;
    }
}

@media (max-width: 560px) {
    .board-toolbar {
        padding: 16px;
    }

    .board-select {
        flex-direction: column;
        align-items: stretch;
    }

    .board-toolbar__stats {
        flex-wrap: wrap;
    }

    .mini-stat {
        flex: 1 1 30%;
        min-width: 0;
        padding: 9px 11px;
    }

    .board-table th:first-child,
    .board-table td:first-child {
        padding-left: 14px;
    }

    .board-table th:last-child,
    .board-table td:last-child {
        padding-right: 14px;
    }

    .my-place__score {
        margin-left: 0;
    }
}
