/* ==========================================================================
   LEADERBOARD PAGE STYLES
   ========================================================================== */

body {
    background-color: #030712;
    color: #e2e8f0;
    font-family: var(--font-main);
    overflow-x: hidden;
}

/* HERO SECTION */
.leaderboard-hero {
    position: relative;
    padding: 100px 20px 60px;
    text-align: center;
    background: radial-gradient(circle at top, #1e293b 0%, #030712 80%);
    border-bottom: 1px solid rgba(56, 189, 248, 0.2);
}

.leaderboard-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: #ffffff;
    animation: fadeInDown 1s ease-out;
}

.leaderboard-title span.gold-text {
    color: #fbbf24;
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
}

.leaderboard-subtitle {
    font-size: 1.2rem;
    color: #94a3b8;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
    animation: fadeInUp 1s ease-out;
}

/* PODIUM SECTION (TOP 3) */
.podium-section {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 20px;
    padding: 60px 10%;
    margin-top: -30px;
}

.podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: fadeInUp 1s ease-out;
}

.podium-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #94a3b8;
    border: 3px solid #334155;
    margin-bottom: 15px;
    position: relative;
    z-index: 2;
}

.podium-rank-2 .podium-avatar { border-color: #cbd5e1; color: #cbd5e1; width: 90px; height: 90px; font-size: 2.5rem; }
.podium-rank-1 .podium-avatar { border-color: #fbbf24; color: #fbbf24; width: 110px; height: 110px; font-size: 3rem; box-shadow: 0 0 20px rgba(251, 191, 36, 0.4); }
.podium-rank-3 .podium-avatar { border-color: #b45309; color: #b45309; width: 80px; height: 80px; font-size: 2rem; }

.podium-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: #f8fafc;
    margin-bottom: 5px;
}

.podium-score {
    font-size: 0.9rem;
    color: #38bdf8;
    font-weight: bold;
    margin-bottom: 15px;
}

.podium-base {
    width: 100px;
    background: linear-gradient(to bottom, #1e293b, #0f172a);
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
    border-bottom: none;
    display: flex;
    justify-content: center;
    padding-top: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    color: #475569;
}

.podium-rank-2 .podium-base { height: 120px; border-top-color: #cbd5e1; color: #cbd5e1; }
.podium-rank-1 .podium-base { height: 160px; border-top-color: #fbbf24; color: #fbbf24; width: 120px; }
.podium-rank-3 .podium-base { height: 90px; border-top-color: #b45309; color: #b45309; }

/* LEADERBOARD LIST */
.leaderboard-list-section {
    padding: 40px 10% 80px;
}

.leaderboard-table {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.05);
    overflow: hidden;
}

.table-header {
    display: grid;
    grid-template-columns: 80px 2fr 1.5fr 1.2fr;
    padding: 20px 30px;
    background: rgba(30, 41, 59, 0.8);
    font-weight: bold;
    color: #94a3b8;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.table-row {
    display: grid;
    grid-template-columns: 80px 2fr 1.5fr 1.2fr;
    padding: 20px 30px;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.2s ease;
}

.table-row:last-child {
    border-bottom: none;
}

.table-row:hover {
    background: rgba(56, 189, 248, 0.05);
}

.rank-cell {
    font-size: 1.2rem;
    font-weight: bold;
    color: #64748b;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
}

.user-name {
    color: #f8fafc;
    font-weight: bold;
}

.score-cell {
    font-weight: bold;
    color: #38bdf8;
}

/* ANIMATIONS */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   DYNAMIC LEADERBOARD ADDITIONS
   ========================================================================== */

.podium-initials {
    font-size: inherit;
    font-weight: 800;
    letter-spacing: 1px;
}

.podium-tier {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 6px;
}

.tier-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 8px;
    vertical-align: middle;
}

.user-avatar span {
    font-size: 0.85rem;
    font-weight: 800;
    color: #cbd5e1;
}

.you-tag {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.4);
    padding: 2px 8px;
    border-radius: 999px;
}

.table-row.me {
    background: rgba(56, 189, 248, 0.12);
    border-left: 3px solid #38bdf8;
}

.table-row.me .rank-cell,
.table-row.me .user-name {
    color: #67e8f9;
}

/* Loading / error / empty states */
.lb-state {
    text-align: center;
    padding: 80px 20px;
    color: #94a3b8;
}

.lb-state i {
    font-size: 2.4rem;
    color: #fbbf24;
    margin-bottom: 14px;
}

.lb-empty {
    text-align: center;
    padding: 90px 20px;
    color: #94a3b8;
}

.lb-empty i {
    font-size: 3rem;
    color: #22d3ee;
    margin-bottom: 18px;
}

.lb-empty h2 {
    color: #f8fafc;
    margin: 0 0 8px;
}

.lb-empty p {
    margin: 0 0 24px;
}

.lb-empty-btn {
    display: inline-block;
    background: linear-gradient(135deg, #0e9489, #5941c3);
    color: #fff;
    padding: 12px 26px;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lb-empty-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(56, 189, 248, 0.3);
}

.loader-spinner {
    width: 44px;
    height: 44px;
    margin: 0 auto 16px;
    border: 4px solid rgba(56, 189, 248, 0.2);
    border-top-color: #38bdf8;
    border-radius: 50%;
    animation: lb-spin 0.8s linear infinite;
}

@keyframes lb-spin {
    to { transform: rotate(360deg); }
}

/* Your rank card */
.lb-your-rank {
    max-width: 960px;
    margin: -30px auto 60px;
    padding: 0 24px;
}

.your-rank-inner {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(15, 23, 42, 0.8));
    border: 1px solid rgba(251, 191, 36, 0.4);
    border-radius: 16px;
    padding: 26px 32px;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.your-rank-title {
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-size: 0.85rem;
    color: #fbbf24;
    display: flex;
    align-items: center;
    gap: 8px;
}

.your-rank-big {
    font-size: 2.4rem;
    font-weight: 800;
    color: #f8fafc;
}

.your-rank-meta {
    display: flex;
    align-items: center;
    gap: 18px;
    color: #cbd5e1;
    font-size: 0.95rem;
    flex-wrap: wrap;
}

.your-rank-meta i {
    color: #38bdf8;
    margin-right: 4px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .podium-section {
        flex-wrap: wrap;
        gap: 10px;
        align-items: center;
    }
    .podium-rank-1 { order: -1; width: 100%; margin-bottom: 20px; }
    .podium-base { width: 100%; }
    .table-header, .table-row {
        grid-template-columns: 60px 1fr 80px;
        padding: 15px;
    }
    .tier-tag {
        display: none;
    }
    .your-rank-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}