/* =====================================
   🎮 GameVerse Leaderboard
===================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


html {
    scroll-behavior: smooth;
}


body {

    min-height: 100vh;

    font-family:
        "Vazirmatn",
        "Tahoma",
        sans-serif;

    color: #ffffff;

    background:
        radial-gradient(
            circle at 50% -10%,
            rgba(37, 99, 235, 0.30),
            transparent 45%
        ),
        linear-gradient(
            180deg,
            #020617 0%,
            #071329 50%,
            #020617 100%
        );

    overflow-x: hidden;

}


button {
    font-family: inherit;
}


/* =====================================
   Background
===================================== */

.space-background {

    position: fixed;

    inset: 0;

    overflow: hidden;

    pointer-events: none;

    z-index: -1;

}


.stars {

    position: absolute;

    inset: 0;

    opacity: 0.55;

    background-image:
        radial-gradient(
            1px 1px at 20% 30%,
            white,
            transparent
        ),
        radial-gradient(
            1px 1px at 70% 20%,
            white,
            transparent
        ),
        radial-gradient(
            1px 1px at 40% 80%,
            white,
            transparent
        ),
        radial-gradient(
            1px 1px at 85% 70%,
            white,
            transparent
        );

}


.stars-1 {
    transform: scale(1);
}


.stars-2 {

    transform: scale(1.5);

    opacity: 0.25;

}


.stars-3 {

    transform: scale(2);

    opacity: 0.12;

}


.glow {

    position: absolute;

    width: 500px;

    height: 500px;

    border-radius: 50%;

    filter: blur(100px);

    opacity: 0.15;

}


.glow-1 {

    background: #2563eb;

    top: 10%;

    right: -180px;

}


.glow-2 {

    background: #7c3aed;

    bottom: 5%;

    left: -180px;

}


/* =====================================
   Header
===================================== */

.leaderboard-header {

    width: min(
        1200px,
        calc(100% - 40px)
    );

    margin: 0 auto;

    padding: 30px 0;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 25px;

}


.back-button {

    border: 1px solid
        rgba(255,255,255,0.12);

    background:
        rgba(255,255,255,0.06);

    color: white;

    padding: 12px 20px;

    border-radius: 14px;

    cursor: pointer;

    transition: 0.25s;

}


.back-button:hover {

    background:
        rgba(37,99,235,0.25);

    transform:
        translateY(-2px);

}


.title-area {

    text-align: right;

}


.title-badge {

    display: inline-block;

    color: #60a5fa;

    font-size: 12px;

    letter-spacing: 2px;

    margin-bottom: 8px;

}


.title-area h1 {

    font-size: clamp(
        28px,
        5vw,
        46px
    );

}


.title-area p {

    color: #94a3b8;

    margin-top: 8px;

}


/* =====================================
   Main
===================================== */

.leaderboard-container {

    width: min(
        1100px,
        calc(100% - 40px)
    );

    margin: 0 auto;

    padding-bottom: 70px;

}


/* =====================================
   Helpers
===================================== */

.hidden {
    display: none !important;
}


/* =====================================
   Loading
===================================== */

.loading {

    text-align: center;

    padding: 50px;

    color: #94a3b8;

}


.loading-spinner {

    width: 40px;

    height: 40px;

    margin: 0 auto 15px;

    border: 3px solid
        rgba(255,255,255,0.10);

    border-top-color:
        #60a5fa;

    border-radius: 50%;

    animation:
        spin 0.8s linear infinite;

}


@keyframes spin {

    to {
        transform: rotate(360deg);
    }

}


/* =====================================
   Current User
===================================== */

.current-user-section {

    margin-bottom: 55px;

}


.current-user-header {

    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 12px;

    color: #cbd5e1;

}


.live-badge {

    color: #4ade80;

    font-size: 12px;

}


.current-user-card {

    display: grid;

    grid-template-columns:
        auto auto 1fr auto;

    align-items: center;

    gap: 22px;

    padding: 24px;

    border-radius: 24px;

    background:
        linear-gradient(
            135deg,
            rgba(37,99,235,0.20),
            rgba(255,255,255,0.06)
        );

    border:
        1px solid
        rgba(96,165,250,0.22);

    box-shadow:
        0 20px 60px
        rgba(0,0,0,0.25);

}


.current-rank {

    text-align: center;

}


.current-rank small {

    display: block;

    color: #94a3b8;

}


.current-rank strong {

    display: block;

    font-size: 34px;

    color: #facc15;

}


.current-avatar {

    width: 60px;

    height: 60px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 50%;

    background:
        rgba(255,255,255,0.08);

    font-size: 28px;

}


.current-info h2 {

    font-size: 22px;

}


.current-info span {

    display: block;

    color: #94a3b8;

    margin-top: 5px;

}


.current-stats {

    display: flex;

    gap: 25px;

}


.current-stats div {

    text-align: center;

}


.current-stats strong {

    display: block;

    font-size: 22px;

}


.current-stats small {

    color: #94a3b8;

}


/* =====================================
   Guest
===================================== */

.guest-section {

    display: flex;

    align-items: center;

    gap: 18px;

    margin-bottom: 50px;

    padding: 22px;

    border-radius: 22px;

    background:
        rgba(255,255,255,0.05);

    border:
        1px solid
        rgba(255,255,255,0.10);

}


.guest-section > span {

    font-size: 32px;

}


.guest-section div {

    flex: 1;

}


.guest-section h3 {

    margin-bottom: 5px;

}


.guest-section p {

    color: #94a3b8;

}


.guest-section button {

    border: none;

    background: #2563eb;

    color: white;

    padding: 11px 22px;

    border-radius: 12px;

    cursor: pointer;

}


/* =====================================
   Section Title
===================================== */

.section-title {

    margin-bottom: 25px;

}


.section-title span {

    color: #60a5fa;

    font-size: 12px;

    letter-spacing: 2px;

}


.section-title h2 {

    margin-top: 7px;

    font-size: 28px;

}


.section-title p {

    color: #94a3b8;

    margin-top: 6px;

}


/* =====================================
   Podium
===================================== */

.podium-section {

    margin-bottom: 60px;

}


.podium {

    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    align-items: end;

    gap: 18px;

}


.podium-card {

    text-align: center;

    padding: 28px 18px;

    border-radius: 25px;

    background:
        rgba(255,255,255,0.06);

    border:
        1px solid
        rgba(255,255,255,0.10);

    transition: 0.3s;

}


.podium-card:hover {

    transform:
        translateY(-7px);

}


.podium-1 {

    min-height: 280px;

    background:
        linear-gradient(
            180deg,
            rgba(250,204,21,0.18),
            rgba(255,255,255,0.05)
        );

    border-color:
        rgba(250,204,21,0.30);

}


.podium-2 {

    min-height: 240px;

}


.podium-3 {

    min-height: 220px;

}


.podium-medal {

    font-size: 42px;

    margin-bottom: 8px;

}


.podium-rank {

    color: #94a3b8;

    font-size: 13px;

}


.podium-card h3 {

    margin: 12px 0;

    font-size: 20px;

}


.podium-cups strong {

    font-size: 28px;

    margin-right: 5px;

    color: #facc15;

}


.podium-cups span {

    color: #94a3b8;

}


.podium-score {

    margin-top: 12px;

    color: #94a3b8;

}


.empty-podium {

    grid-column:
        1 / -1;

    text-align: center;

    padding: 40px;

    color: #94a3b8;

}


/* =====================================
   Players
===================================== */

.players-section {

    margin-bottom: 50px;

}


.players-title {

    display: flex;

    align-items: end;

    justify-content: space-between;

}


.player-count {

    color: #94a3b8;

}


/* =====================================
   Table
===================================== */

.table-wrapper {

    overflow: hidden;

    border-radius: 22px;

    border:
        1px solid
        rgba(255,255,255,0.08);

}


.table-head,
.playerCard {

    display: grid;

    grid-template-columns:
        90px 1fr
        120px 120px 120px;

    align-items: center;

    gap: 15px;

}


.table-head {

    padding: 16px 22px;

    color: #64748b;

    background:
        rgba(255,255,255,0.04);

    font-size: 13px;

}


.leader-list {

    background:
        rgba(255,255,255,0.02);

}


.playerCard {

    padding: 18px 22px;

    border-top:
        1px solid
        rgba(255,255,255,0.06);

    transition: 0.25s;

}


.playerCard:hover {

    background:
        rgba(37,99,235,0.08);

}


.playerCard.first {

    background:
        rgba(250,204,21,0.06);

}


.playerCard.second {

    background:
        rgba(203,213,225,0.04);

}


.playerCard.third {

    background:
        rgba(217,119,6,0.05);

}


.rank {

    width: 46px;

    height: 46px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 14px;

    background:
        rgba(255,255,255,0.06);

    font-size: 22px;

}


.first .rank {

    background: #facc15;

    color: #000;

}


.second .rank {

    background: #cbd5e1;

    color: #000;

}


.third .rank {

    background: #d97706;

}


.playerInfo h3 {

    font-size: 17px;

}


.playerInfo p {

    color: #64748b;

    font-size: 12px;

    margin-top: 4px;

}


.playerStats {

    text-align: center;

}


.playerStats strong {

    display: block;

    font-size: 20px;

}


.playerStats span {

    display: block;

    color: #64748b;

    font-size: 12px;

    margin-top: 4px;

}


/* =====================================
   Error
===================================== */

.error-box {

    text-align: center;

    padding: 40px;

    margin-bottom: 50px;

    border-radius: 22px;

    background:
        rgba(239,68,68,0.08);

    border:
        1px solid
        rgba(239,68,68,0.20);

}


.error-box > div {

    font-size: 40px;

}


.error-box h3 {

    margin: 12px 0 6px;

}


.error-box p {

    color: #94a3b8;

    margin-bottom: 18px;

}


.error-box button {

    border: none;

    background: #dc2626;

    color: white;

    padding: 11px 22px;

    border-radius: 12px;

    cursor: pointer;

}


/* =====================================
   Footer
===================================== */

footer {

    text-align: center;

    padding: 30px 20px;

    border-top:
        1px solid
        rgba(255,255,255,0.06);

    color: #64748b;

}


footer strong {

    display: block;

    color: white;

    margin-bottom: 8px;

}


/* =====================================
   Responsive
===================================== */

@media (max-width: 800px) {

    .leaderboard-header {

        flex-direction: column;

        align-items: stretch;

    }


    .title-area {

        text-align: center;

        order: -1;

    }


    .back-button {

        align-self: flex-start;

    }


    .current-user-card {

        grid-template-columns:
            auto 1fr;

    }


    .current-stats {

        grid-column:
            1 / -1;

        justify-content: center;

    }


    .podium {

        grid-template-columns:
            1fr;

    }


    .podium-1,
    .podium-2,
    .podium-3 {

        min-height: auto;

    }


    .table-wrapper {

        overflow-x: auto;

    }


    .table-head,
    .playerCard {

        min-width: 650px;

    }

}


@media (max-width: 500px) {

    .leaderboard-container {

        width:
            calc(100% - 24px);

    }


    .current-user-card {

        padding: 18px;

    }


    .current-stats {

        gap: 15px;

    }


    .current-stats strong {

        font-size: 18px;

    }


    .section-title h2 {

        font-size: 24px;

    }

}