﻿/* =========================================================
   CLUB RANKINGS — Wood & Brass Theme
   ========================================================= */

/* Page & Hero */
.rankings-page {
    min-height: 65vh;
    width: 100%;
    min-width: 0;
    overflow-x: clip;
    background: #fbf7ef;
    color: #65452e;
}

.rankings-hero {
    background: linear-gradient(135deg, #efe0c8, #fbf7ef);
    border-bottom: 1px solid #d8c3a2;
}

.rankings-kicker,
.rankings-label,
.rankings-modal-kicker {
    color: #946b42;
    font-size: .76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .13em;
}

.rankings-hero h1 span {
    color: #a88755;
}

.rankings-intro {
    max-width: 670px;
    color: #78634e;
    line-height: 1.7;
}

/* Buttons */
.rankings-info-btn {
    padding: .7rem 1.1rem;
    background: #65452e;
    border: 1px solid #a88755;
    border-radius: 9px;
    color: #f4dfb5;
    font-weight: 600;
}

    .rankings-info-btn:hover,
    .rankings-info-btn:focus {
        background: #79563a;
        border-color: #a88755;
        color: #fff0cf;
        box-shadow: none;
    }

/* Leaderboard Panel */
.rankings-panel {
    overflow: hidden;
    background: #fffaf2;
    border: 1px solid #dfcdb1;
    border-radius: 15px;
    box-shadow: 0 6px 22px rgba(101, 69, 46, .07);
}

.rankings-panel-heading {
    padding: 24px 26px;
    border-bottom: 1px solid #e6d7bf;
}

.rankings-status {
    display: inline-flex;
    align-items: center;
    padding: .45rem .8rem;
    background: #f3e6d1;
    border: 1px solid #d6ba90;
    border-radius: 30px;
    color: #65452e;
    font-size: .79rem;
    font-weight: 600;
}

.rankings-footnote {
    color: #78634e;
    font-size: .83rem;
}

/* Search & Sorting */
.rankings-search {
    position: relative;
    width: min(100%, 280px);
}

    .rankings-search > i {
        position: absolute;
        top: 50%;
        left: .85rem;
        transform: translateY(-50%);
        color: #98774f;
        pointer-events: none;
    }

    .rankings-search .form-control {
        padding-left: 2.4rem;
        background: #fff;
        border: 1px solid #d0b895;
        border-radius: 8px;
        color: #65452e;
    }

        .rankings-search .form-control:focus {
            border-color: #a88755;
            box-shadow: 0 0 0 .18rem rgba(168, 135, 85, .16);
        }

.rankings-sort {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: .35rem;
    padding: 0;
    background: transparent;
    border: 0;
    color: inherit;
    font: inherit;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

    .rankings-sort-active,
    .rankings-sort:hover {
        color: #9b6e3c;
    }

/* Leaderboard Table — native table layout for aligned columns */
.rankings-table {
    --bs-table-bg: transparent;
    --bs-table-color: #65452e;
    width: 100%;
    min-width: 360px;
    table-layout: auto;
    border-collapse: collapse;
}

    .rankings-table thead th {
        padding: 14px 20px;
        background: #f3e8d7;
        border-bottom: 1px solid #dfcdb1;
        color: #65452e;
        font-size: .78rem;
        font-weight: 700;
        letter-spacing: .03em;
        white-space: nowrap;
    }

    .rankings-table td {
        padding: 12px 20px;
        border-color: #eadbc4;
    }

        .rankings-table th:nth-child(2),
        .rankings-table th:nth-child(3),
        .rankings-table td:nth-child(3),
        .rankings-table td:nth-child(4) {
            text-align: right;
            white-space: nowrap;
        }

.rankings-empty {
    padding: 65px 20px !important;
}

.rankings-empty-icon {
    margin-bottom: 15px;
    color: #b49363;
    font-size: 2.7rem;
}

.rankings-empty p {
    max-width: 480px;
    margin: 0 auto;
    color: #78634e;
}

/* Player identity: avatar/rank column, then name/country column */
.rankings-avatar-cell {
    width: 64px;
}

.rankings-identity-cell {
    width: auto;
}

.rankings-avatar-stack {
    position: relative;
    width: 60px;
    height: 60px;
}

.rankings-player {
    display: flex;
    align-items: center;
    gap: .7rem;
    min-width: 0;
}

.rankings-player-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    object-fit: cover;
    border: 2px solid #c5a472;
    border-radius: 50%;
}

.rankings-player-avatar-empty {
    background: #efdfc5;
    color: #826043;
}

.rankings-player-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: .2rem;
    min-width: 0;
}

.rankings-player-name {
    color: #65452e;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.rankings-player-country {
    color: #92734d;
    font-size: .76rem;
    font-weight: 500;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

/* Rank & Rating */
.rankings-player-level {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .3rem;
}

.rankings-rank {
    display: inline-block;
    min-width: 25px;
    padding: 1px 5px;
    background: #e8d5b5;
    border: 1px solid #cbaa7b;
    border-radius: 5px;
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
}

.rankings-rank-legend {
    background: #65452e;
    color: #f4dfb5;
}


.rankings-avatar-stack > .rankings-rank {
    position: absolute;
    right: -5px;
    bottom: -4px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 23px;
    height: 23px;
    padding: 2px 5px;
    border: 2px solid #fffaf2;
    border-radius: 50%;
    font-size: .75rem;
    font-weight: 800;
    line-height: 1;
}

.rankings-level-name {
    display: block;
    color: #65452e;
    font-size: .85rem;
    font-weight: 650;
    text-align: center;
    white-space: nowrap;
}

.rankings-rating {
    color: #65452e;
    font-weight: 800;
    white-space: nowrap;
}

/* Pagination */
.rankings-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 15px;
    border-top: 1px solid #dfcdb1;
}

    .rankings-pagination.d-none {
        display: none !important;
    }

.rankings-page-btn {
    min-width: 36px;
    height: 36px;
    background: #65452e;
    border: 1px solid #a88755;
    border-radius: 7px;
    color: #f4dfb5;
    cursor: pointer;
}

    .rankings-page-btn:hover:not(:disabled) {
        background: #79563a;
    }

    .rankings-page-btn:disabled {
        opacity: .4;
        cursor: default;
    }

.rankings-page-info {
    color: #65452e;
    font-size: .84rem;
    font-weight: 600;
}

/* Club Levels Table */
.rankings-level-table {
    --bs-table-bg: transparent;
    --bs-table-color: #65452e;
    width: 100%;
    font-size: .85rem;
    margin: 0;
}

    .rankings-level-table thead th {
        background: #f3e8d7;
        color: #65452e;
        font-weight: 700;
        border-bottom: 1px solid #d5b88a;
    }

    .rankings-level-table th,
    .rankings-level-table td {
        padding: .55rem .75rem;
        border-color: #e5d4bc;
        vertical-align: middle;
    }

        .rankings-level-table th:first-child,
        .rankings-level-table td:first-child {
            width: 65px;
            text-align: center;
        }

        .rankings-level-table th:last-child,
        .rankings-level-table td:last-child {
            text-align: right;
            white-space: nowrap;
        }

    .rankings-level-table tbody tr:last-child td {
        border-bottom: none;
    }

.rankings-info-modal .modal-dialog {
    max-width: 560px;
}

.rankings-info-modal .modal-content {
    max-height: min(26rem, calc(100dvh - 24px));
}

/* Mobile */
@media (max-width: 768px) {
    .rankings-page .container {
        max-width: 100%;
    }

    .rankings-page .row > * {
        min-width: 0;
    }

    .rankings-panel-heading {
        padding: 19px 16px;
    }

    .rankings-search {
        width: 100%;
    }

    .rankings-table thead th,
    .rankings-table td {
        padding: 10px 7px;
    }

    .rankings-avatar-cell {
        width: 65px;
    }

    .rankings-player-avatar {
        display: grid;
        place-items: center;
        width: 48px;
        height: 48px;
        object-fit: cover;
        border: 2px solid #c5a472;
        border-radius: 50%;
    }

    .rankings-player-name {
        font-size: .82rem;
    }

    .rankings-player-country {
        font-size: .7rem;
    }

    .rankings-player {
        gap: .4rem;
    }

    .rankings-player-level {
        gap: .3rem;
    }

    .rankings-level-name {
        font-size: .75rem;
    }

    .rankings-rank {
        min-width: 23px;
        font-size: .75rem;
    }

    .rankings-sort {
        gap: .2rem;
        font-size: .75rem;
    }

    .rankings-rating {
        font-size: .85rem;
    }

    .rankings-avatar-stack {
        width: 48px;
        height: 48px;
    }


    .rankings-avatar-stack > .rankings-rank {
        min-width: 20px;
        height: 20px;
        font-size: .65rem;
    }
}
