.ranking-page {
    --club-border: rgba(226, 208, 165, 0.16);
    --club-gold-light: #e6d2a6;
    --club-surface: #1c1e1a;
    --club-surface-light: #242620;
}

.ranking-hero {
    background:
        radial-gradient(ellipse at 78% 20%, rgba(197, 165, 104, 0.16), transparent 55%),
        linear-gradient(115deg, #12130f, #232b22 90%);
}

.ranking-hero h1 {
    margin: 18px 0 12px;
    color: var(--club-text);
    font-size: clamp(42px, 7vw, 78px);
    letter-spacing: -0.04em;
}

.ranking-hero p {
    margin: 0;
    color: #c6c2b9;
    font-size: 17px;
    line-height: 1.7;
}

.ranking-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 25px;
    margin-bottom: 30px;
}

.ranking-heading h2 {
    margin: 13px 0 0;
    font-size: clamp(30px, 4vw, 48px);
    letter-spacing: -0.03em;
}

.ranking-date {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 15px;
    border: 1px solid var(--club-border);
    border-radius: 999px;
    background: rgba(197, 165, 104, 0.05);
    color: var(--club-muted);
    font-size: 12px;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.ranking-date::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--club-gold);
}

/* Таблица */

.ranking-page .rating-table-wrapper {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    overflow-x: auto;
    border: 1px solid rgba(226, 208, 165, 0.18);
    border-radius: 16px;
    background: linear-gradient(180deg, #1b1d19, #161814);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.26);
    -webkit-overflow-scrolling: touch;
}

.ranking-page .rating-table {
    width: 100%;
    min-width: 720px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.ranking-page .rating-table .rank-col-place {
    width: 92px;
}

.ranking-page .rating-table .rank-col-player {
    width: 31%;
}

.ranking-page .rating-table .rank-col-games,
.ranking-page .rating-table .rank-col-wins {
    width: 92px;
}

.ranking-page .rating-table .rank-col-score {
    width: 140px;
}

.ranking-page .rating-table th {
    padding: 17px 20px;
    border-bottom: 1px solid rgba(226, 208, 165, 0.16);
    background: rgba(197, 165, 104, 0.07);
    color: rgba(243, 238, 229, 0.48);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.ranking-page .rating-table thead th:first-child {
    border-top-left-radius: 15px;
}

.ranking-page .rating-table thead th:last-child {
    border-top-right-radius: 15px;
}

.ranking-page .rating-table td {
    padding: 13px 20px;
    border-bottom: 1px solid rgba(226, 208, 165, 0.07);
    color: #bdbab1;
    font-size: 14px;
    vertical-align: middle;
}

.ranking-page .rating-table th:first-child,
.ranking-page .rating-table td:first-child {
    padding-left: 14px;
    text-align: center;
}

.ranking-page .rating-table th:nth-child(4),
.ranking-page .rating-table th:nth-child(5),
.ranking-page .rating-table td:nth-child(4),
.ranking-page .rating-table td:nth-child(5) {
    text-align: center;
}

.ranking-page .rating-table th:last-child,
.ranking-page .rating-table td:last-child {
    padding-right: 24px;
    text-align: right;
}

.ranking-page .rating-table td:nth-child(3) {
    overflow: hidden;
    color: #a9a59c;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-page .rating-table td:nth-child(4),
.ranking-page .rating-table td:nth-child(5) {
    color: #ddd8ce;
    font-variant-numeric: tabular-nums;
}

.ranking-page .rating-table tbody tr {
    transition: background 0.2s ease;
}

.ranking-page .rating-table tbody tr:nth-child(even) {
    background: rgba(243, 238, 229, 0.015);
}

.ranking-page .rating-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(197, 165, 104, 0.12), rgba(197, 165, 104, 0.02) 70%);
}

.ranking-page .rating-table tbody tr:last-child td {
    border-bottom: 0;
}

.ranking-page .rating-table tbody tr.rank-row--podium {
    background: linear-gradient(90deg, rgba(197, 165, 104, 0.10), transparent 62%);
}

.ranking-page .rating-table tbody tr.rank-row--1 {
    background: linear-gradient(90deg, rgba(197, 165, 104, 0.18), transparent 65%);
}

/* Медали */

.ranking-page .rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(226, 208, 165, 0.24);
    border-radius: 50%;
    background: rgba(243, 238, 229, 0.05);
    color: rgba(243, 238, 229, 0.72);
    font-family: Georgia, serif;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.ranking-page .rank-badge--gold,
.ranking-page .rank-badge--silver,
.ranking-page .rank-badge--bronze {
    border-color: rgba(255, 255, 255, 0.45);
    color: #241d10;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.28),
        inset 0 -6px 12px rgba(0, 0, 0, 0.18),
        0 6px 16px rgba(0, 0, 0, 0.28);
}

.ranking-page .rank-badge--gold {
    background: linear-gradient(150deg, #fbeec2 5%, #ddb56c 48%, #ab7a29 100%);
}

.ranking-page .rank-badge--silver {
    background: linear-gradient(150deg, #f6f7f3 5%, #c3c8c8 48%, #8f9698 100%);
}

.ranking-page .rank-badge--bronze {
    background: linear-gradient(150deg, #f3cba4 5%, #cf8f56 48%, #93522a 100%);
}

/* Игрок */

.ranking-page .player-cell {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
    color: var(--club-text);
    font-size: 15px;
    font-weight: 600;
}

.ranking-page .player-cell > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-page .player-mini-avatar {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border: 2px solid rgba(197, 165, 104, 0.45);
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 3px rgba(197, 165, 104, 0.07);
}

.ranking-page .player-mini-avatar--fallback {
    display: grid;
    place-items: center;
    background: #242620;
    color: var(--club-gold-light);
    font-family: Georgia, serif;
    font-size: 16px;
    font-weight: 700;
}

/* Рейтинг */

.ranking-page .rating-score {
    white-space: nowrap;
}

.ranking-page .rating-score span {
    color: var(--club-gold-light);
    font-family: Georgia, serif;
    font-size: 23px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.ranking-page .rating-score small {
    margin-left: 6px;
    color: var(--club-muted);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.ranking-page .empty-state {
    max-width: 620px;
    margin: 0 auto;
    padding: 36px 28px;
    border: 1px dashed rgba(226, 208, 165, 0.22);
    border-radius: 14px;
    background: rgba(243, 238, 229, 0.025);
    color: var(--club-muted);
    font-size: 14px;
    line-height: 1.7;
    text-align: center;
}

/* Пагинация */

.ranking-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 32px;
    color: var(--club-muted);
    font-size: 13px;
}

.ranking-pagination span {
    padding: 0 4px;
    font-variant-numeric: tabular-nums;
}

.ranking-pagination a {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid var(--club-border);
    border-radius: 50%;
    color: var(--club-gold);
    font-size: 19px;
    text-decoration: none;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.ranking-pagination a:hover {
    border-color: var(--club-gold);
    background: var(--club-gold);
    color: #171711;
}

/* Планшеты */

@media (max-width: 991.98px) {
    .ranking-page .rating-table {
        min-width: 0;
    }

    .ranking-page .rating-table .rank-col-place {
        width: 68px;
    }

    .ranking-page .rating-table .rank-col-player {
        width: 30%;
    }

    .ranking-page .rating-table .rank-col-games,
    .ranking-page .rating-table .rank-col-wins {
        width: 64px;
    }

    .ranking-page .rating-table .rank-col-score {
        width: 104px;
    }

    .ranking-page .rating-table th,
    .ranking-page .rating-table td {
        padding-right: 14px;
        padding-left: 14px;
    }

    .ranking-page .rating-table th:first-child,
    .ranking-page .rating-table td:first-child {
        padding-left: 8px;
    }

    .ranking-page .rating-table th:last-child,
    .ranking-page .rating-table td:last-child {
        padding-right: 16px;
    }
}

/* Телефоны: карточки */

@media (max-width: 767.98px) {
    .ranking-heading {
        display: block;
    }

    .ranking-date {
        margin-top: 15px;
    }

    .ranking-page .rating-table-wrapper {
        overflow: visible;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .ranking-page .rating-table,
    .ranking-page .rating-table tbody {
        display: block;
        min-width: 0;
    }

    .ranking-page .rating-table colgroup,
    .ranking-page .rating-table thead {
        display: none;
    }

    .ranking-page .rating-table tr {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 12px 16px;
        padding: 16px 18px;
        border: 1px solid var(--club-border);
        border-radius: 14px;
        background: #171915;
        box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
    }

    .ranking-page .rating-table tbody tr + tr {
        margin-top: 12px;
    }

    .ranking-page .rating-table tbody tr:nth-child(even) {
        background: #171915;
    }

    .ranking-page .rating-table tbody tr:hover,
    .ranking-page .rating-table tbody tr.rank-row--podium,
    .ranking-page .rating-table tbody tr.rank-row--1 {
        background: #171915;
    }

    .ranking-page .rating-table tr:has(.rank-badge--gold) {
        border-color: rgba(197, 165, 104, 0.45);
        background: linear-gradient(140deg, rgba(197, 165, 104, 0.14), #171915 62%);
    }

    .ranking-page .rating-table tr:has(.rank-badge--silver),
    .ranking-page .rating-table tr:has(.rank-badge--bronze) {
        border-color: rgba(197, 165, 104, 0.28);
    }

    .ranking-page .rating-table td {
        padding: 0;
        border: 0;
        text-align: left;
    }

    .ranking-page .rating-table td:first-child {
        order: 1;
        flex: 0 0 auto;
        padding: 0;
        text-align: center;
    }

    .ranking-page .rating-table td:nth-child(2) {
        order: 2;
        flex: 1 1 120px;
        min-width: 0;
    }

    .ranking-page .rating-table td:nth-child(3) {
        order: 4;
        flex: 1 0 100%;
        font-size: 12px;
        letter-spacing: 0.04em;
    }

    .ranking-page .rating-table td:nth-child(4),
    .ranking-page .rating-table td:nth-child(5) {
        order: 5;
        display: inline-flex;
        gap: 5px;
        font-size: 12px;
        text-align: left;
    }

    .ranking-page .rating-table td:nth-child(3)::before,
    .ranking-page .rating-table td:nth-child(4)::before,
    .ranking-page .rating-table td:nth-child(5)::before {
        content: attr(data-label) ":";
        color: rgba(243, 238, 229, 0.4);
        font-size: 11px;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    .ranking-page .rating-table td:nth-child(5) {
        padding-left: 16px;
        border-left: 1px solid rgba(226, 208, 165, 0.14);
    }

    .ranking-page .rating-table td:last-child {
        order: 3;
        flex: 0 0 auto;
        margin-left: auto;
        padding: 0;
        align-self: flex-start;
        text-align: right;
    }

    .ranking-page .rank-badge {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }

    .ranking-page .player-mini-avatar {
        flex-basis: 38px;
        width: 38px;
        height: 38px;
    }

    .ranking-page .player-cell {
        gap: 11px;
        font-size: 14px;
    }

    .ranking-page .rating-score span {
        font-size: 22px;
    }

    .ranking-page .rating-score small {
        display: block;
        margin: 3px 0 0;
        font-size: 9px;
    }

    .ranking-pagination {
        gap: 12px;
        margin-top: 26px;
        font-size: 12px;
    }

    .ranking-pagination a {
        width: 38px;
        height: 38px;
    }
}
