/* =========================================================
   KENO LEADERBOARD
========================================================= */

.leaderboard-page {
    width: min(1000px, calc(100% - 40px));

    margin: 0 auto;

    padding: 45px 0 80px;
}


/* =========================================================
   BACK BUTTON
========================================================= */

.back-button {
    display: inline-flex;
    align-items: center;

    margin-bottom: 45px;

    padding: 10px 15px;

    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 11px;

    background: rgba(255, 255, 255, 0.035);

    color: #a8a8b5;

    font-size: 13px;
    font-weight: 650;

    text-decoration: none;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.back-button:hover {
    background: rgba(139, 92, 246, 0.1);

    border-color: rgba(139, 92, 246, 0.25);

    color: #c4b5fd;

    transform: translateX(-2px);
}


/* =========================================================
   HEADER
========================================================= */

.leaderboard-header {
    text-align: center;

    margin-bottom: 38px;
}

.leaderboard-header .eyebrow {
    color: #9b7cff;

    font-size: 12px;
    font-weight: 700;

    letter-spacing: 2px;

    margin-bottom: 12px;

    text-transform: uppercase;
}

.leaderboard-header h1 {
    margin: 0;

    font-size: clamp(38px, 6vw, 64px);

    font-weight: 800;

    letter-spacing: -2px;
}

.leaderboard-header p {
    margin-top: 14px;

    color: #8e8e9d;

    font-size: 16px;
}


/* =========================================================
   YOUR RANK
========================================================= */

.your-rank {
    display: flex;
    align-items: center;

    width: 100%;
    box-sizing: border-box;

    margin-bottom: 28px;

    padding: 18px 22px;

    border: 1px solid rgba(139, 92, 246, 0.25);

    border-radius: 18px;

    background:
        linear-gradient(
            135deg,
            rgba(139, 92, 246, 0.12),
            rgba(139, 92, 246, 0.035)
        );

    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.18),
        0 0 40px rgba(139, 92, 246, 0.06);
}

.your-rank.hidden {
    display: none;
}

.your-rank-icon {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-right: 15px;

    border-radius: 12px;

    background: rgba(139, 92, 246, 0.15);

    color: #a78bfa;

    font-size: 18px;
}

.your-rank-info {
    display: flex;
    flex-direction: column;

    gap: 3px;
}

.your-rank-info span,
.your-rank-balance span {
    color: #777785;

    font-size: 11px;
    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: 1px;
}

.your-rank-info strong {
    color: #f5f5f7;

    font-size: 19px;
}

.your-rank-balance {
    margin-left: auto;

    display: flex;
    flex-direction: column;

    align-items: flex-end;

    gap: 3px;
}

.your-rank-balance strong {
    color: #a78bfa;

    font-size: 17px;
}


/* =========================================================
   PODIUM
========================================================= */

.podium {
    display: grid;

    grid-template-columns:
        1fr
        1.15fr
        1fr;

    align-items: end;

    gap: 14px;

    margin-bottom: 30px;
}

.podium-loading {
    grid-column: 1 / -1;

    padding: 50px;

    text-align: center;

    color: #777785;
}


/* =========================================================
   PODIUM PLAYER
========================================================= */

.podium-player {
    position: relative;

    display: flex;

    flex-direction: column;

    align-items: center;

    min-height: 205px;

    padding: 25px 15px 20px;

    box-sizing: border-box;

    border-radius: 22px;

    border: 1px solid rgba(255, 255, 255, 0.07);

    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.045),
            rgba(255, 255, 255, 0.018)
        );
}

.podium-player.first {
    min-height: 235px;

    border-color: rgba(245, 201, 74, 0.22);

    background:
        linear-gradient(
            180deg,
            rgba(245, 201, 74, 0.09),
            rgba(255, 255, 255, 0.018)
        );

    box-shadow:
        0 15px 50px rgba(0, 0, 0, 0.22);
}

.podium-player.second {
    border-color: rgba(191, 196, 206, 0.15);
}

.podium-player.third {
    border-color: rgba(205, 140, 88, 0.15);
}


/* =========================================================
   MEDAL
========================================================= */

.podium-medal {
    font-size: 31px;

    margin-bottom: 13px;
}


/* =========================================================
   AVATAR
========================================================= */

.podium-avatar {
    width: 52px;
    height: 52px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 12px;

    border-radius: 15px;

    background: rgba(139, 92, 246, 0.12);

    color: #a78bfa;

    font-size: 19px;
    font-weight: 800;
}

.podium-player.first .podium-avatar {
    width: 60px;
    height: 60px;

    border-radius: 17px;

    background: rgba(245, 201, 74, 0.12);

    color: #f5c94a;
}


/* =========================================================
   PODIUM NAME
========================================================= */

.podium-name {
    max-width: 100%;

    overflow: hidden;

    color: #f5f5f7;

    font-size: 15px;
    font-weight: 700;

    text-overflow: ellipsis;

    white-space: nowrap;
}


/* =========================================================
   PODIUM BALANCE
========================================================= */

.podium-balance {
    margin-top: 7px;

    color: #a78bfa;

    font-size: 14px;
    font-weight: 750;
}

.podium-player.first .podium-balance {
    color: #f5c94a;
}


/* =========================================================
   PODIUM PLACE
========================================================= */

.podium-place {
    position: absolute;

    top: 13px;
    right: 15px;

    color: #666674;

    font-size: 11px;
    font-weight: 700;
}


/* =========================================================
   LEADERBOARD CARD
========================================================= */

.leaderboard-card {
    background: rgba(18, 18, 25, 0.82);

    border: 1px solid rgba(255, 255, 255, 0.07);

    border-radius: 22px;

    overflow: hidden;

    box-shadow:
        0 20px 70px rgba(0, 0, 0, 0.35),
        0 0 80px rgba(120, 80, 255, 0.07);

    backdrop-filter: blur(15px);
}


/* =========================================================
   CARD HEADER
========================================================= */

.leaderboard-top {
    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 20px 28px;

    background: rgba(255, 255, 255, 0.025);

    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.top-title {
    display: flex;

    justify-content: space-between;

    width: 100%;

    color: #777785;

    font-size: 12px;
    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: 1px;
}


/* =========================================================
   REFRESH BUTTON
========================================================= */

.refresh-button {
    flex-shrink: 0;

    margin-left: 20px;

    padding: 9px 14px;

    border: 1px solid rgba(255, 255, 255, 0.08);

    border-radius: 10px;

    background: rgba(255, 255, 255, 0.04);

    color: #b6b6c2;

    font-size: 12px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.refresh-button:hover {
    background: rgba(139, 92, 246, 0.12);

    color: #c4b5fd;
}

.refresh-button:active {
    transform: scale(0.96);
}

.refresh-button:disabled {
    opacity: 0.6;

    cursor: wait;
}


/* =========================================================
   PLAYER LIST
========================================================= */

.leaderboard-list {
    display: flex;

    flex-direction: column;
}


/* =========================================================
   PLAYER ROW
========================================================= */

.leaderboard-row {
    display: grid;

    grid-template-columns:
        75px
        1fr
        auto;

    align-items: center;

    min-height: 78px;

    padding: 0 28px;

    border-bottom:
        1px solid rgba(255, 255, 255, 0.045);

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.leaderboard-row:last-child {
    border-bottom: none;
}

.leaderboard-row:hover {
    background: rgba(255, 255, 255, 0.025);
}


/* =========================================================
   CURRENT USER
========================================================= */

.leaderboard-row.current-user {
    background:
        linear-gradient(
            90deg,
            rgba(139, 92, 246, 0.10),
            rgba(139, 92, 246, 0.035)
        );

    box-shadow:
        inset 3px 0 0 #8b5cf6;
}


/* =========================================================
   RANK
========================================================= */

.player-rank {
    color: #777785;

    font-size: 16px;
    font-weight: 700;
}

.player-rank.first {
    color: #f5c94a;
}

.player-rank.second {
    color: #bfc4ce;
}

.player-rank.third {
    color: #cd8c58;
}


/* =========================================================
   PLAYER INFO
========================================================= */

.player-info {
    display: flex;

    align-items: center;

    gap: 13px;

    min-width: 0;
}


/* =========================================================
   PLAYER AVATAR
========================================================= */

.player-avatar {
    width: 38px;
    height: 38px;

    display: flex;

    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 12px;

    background: rgba(130, 90, 255, 0.12);

    color: #a78bff;

    font-size: 15px;
    font-weight: 800;
}


/* =========================================================
   PLAYER NAME
========================================================= */

.player-name {
    overflow: hidden;

    color: #f3f3f7;

    font-size: 15px;
    font-weight: 650;

    text-overflow: ellipsis;

    white-space: nowrap;
}


/* =========================================================
   CURRENT USER LABEL
========================================================= */

.current-label {
    display: inline-block;

    margin-left: 8px;

    padding: 3px 7px;

    border-radius: 6px;

    background: rgba(139, 92, 246, 0.13);

    color: #a78bfa;

    font-size: 9px;
    font-weight: 800;

    letter-spacing: 0.5px;

    text-transform: uppercase;
}


/* =========================================================
   BALANCE
========================================================= */

.player-balance {
    color: #ffffff;

    font-size: 16px;
    font-weight: 750;

    white-space: nowrap;
}


/* =========================================================
   STATES
========================================================= */

.leaderboard-loading,
.leaderboard-error,
.leaderboard-empty {
    padding: 60px 20px;

    text-align: center;

    color: #777785;

    font-size: 14px;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 650px) {

    .leaderboard-page {
        width: calc(100% - 24px);

        padding-top: 25px;
    }


    .back-button {
        margin-bottom: 35px;
    }


    .leaderboard-header {
        margin-bottom: 30px;
    }


    .leaderboard-header h1 {
        font-size: 40px;
    }


    .podium {
        grid-template-columns:
            1fr
            1.15fr
            1fr;

        gap: 7px;
    }


    .podium-player {
        min-height: 175px;

        padding: 18px 8px 15px;

        border-radius: 17px;
    }


    .podium-player.first {
        min-height: 200px;
    }


    .podium-avatar {
        width: 42px;
        height: 42px;

        font-size: 15px;
    }


    .podium-player.first .podium-avatar {
        width: 48px;
        height: 48px;
    }


    .podium-name {
        font-size: 12px;
    }


    .podium-balance {
        font-size: 11px;
    }


    .podium-medal {
        font-size: 24px;
    }


    .leaderboard-top {
        padding: 15px;
    }


    .refresh-button {
        margin-left: 10px;

        padding: 8px 10px;
    }


    .leaderboard-row {
        grid-template-columns:
            48px
            1fr
            auto;

        min-height: 70px;

        padding: 0 15px;
    }


    .player-avatar {
        width: 34px;
        height: 34px;

        border-radius: 10px;
    }


    .player-name {
        font-size: 14px;
    }


    .player-balance {
        font-size: 14px;
    }


    .current-label {
        display: none;
    }


    .your-rank {
        padding: 15px;
    }
}