/* === LEADERBOARD VIEW - Elite Premium Design === */

.leaderboard-header {
    margin-bottom: 28px;
    padding: 48px 4px 0;
    position: relative;
    text-align: center;
}

.leaderboard-title-wrap h2 {
    font-family: var(--font-display);
    font-size: 42px;
    font-weight: 900;
    margin-bottom: 6px;
    background: linear-gradient(180deg,
            #fff 0%,
            #ffd700 20%,
            #ff8c00 40%,
            #ff4500 60%,
            #dc143c 80%,
            #8b0000 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
    position: relative;
    filter: brightness(1.3);
    animation: flameFlicker 3s ease-in-out infinite;
    text-shadow:
        0 0 10px rgba(255, 140, 0, 0.8),
        0 0 20px rgba(255, 69, 0, 0.6),
        0 0 30px rgba(220, 20, 60, 0.4),
        0 0 40px rgba(139, 0, 0, 0.3),
        0 2px 5px rgba(0, 0, 0, 0.5);
}

.leaderboard-title-wrap h2::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 0;
    right: 0;
    height: 100px;
    background: radial-gradient(ellipse at center,
            rgba(255, 140, 0, 0.3) 0%,
            rgba(255, 69, 0, 0.2) 30%,
            transparent 70%);
    filter: blur(20px);
    animation: glowPulseFlame 2s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

/* Floating embers */
.leaderboard-title-wrap::before,
.leaderboard-title-wrap::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, #ff8c00, #ff4500);
    border-radius: 50%;
    box-shadow:
        0 0 10px rgba(255, 140, 0, 0.8),
        0 0 20px rgba(255, 69, 0, 0.5);
    animation: emberFloat 4s ease-in-out infinite;
    opacity: 0;
}

.leaderboard-title-wrap::before {
    left: 10%;
    animation-delay: 0s;
}

.leaderboard-title-wrap::after {
    right: 15%;
    animation-delay: 2s;
}

@keyframes flameFlicker {

    0%,
    100% {
        text-shadow:
            0 0 10px rgba(255, 140, 0, 0.8),
            0 0 20px rgba(255, 69, 0, 0.6),
            0 0 30px rgba(220, 20, 60, 0.4),
            0 0 40px rgba(139, 0, 0, 0.3),
            0 2px 5px rgba(0, 0, 0, 0.5);
        filter: brightness(1.3);
    }

    25% {
        text-shadow:
            0 0 15px rgba(255, 140, 0, 1),
            0 0 25px rgba(255, 69, 0, 0.8),
            0 0 35px rgba(220, 20, 60, 0.6),
            0 0 45px rgba(139, 0, 0, 0.4),
            0 2px 5px rgba(0, 0, 0, 0.5);
        filter: brightness(1.5);
    }

    50% {
        text-shadow:
            0 0 12px rgba(255, 140, 0, 0.9),
            0 0 22px rgba(255, 69, 0, 0.7),
            0 0 32px rgba(220, 20, 60, 0.5),
            0 0 42px rgba(139, 0, 0, 0.35),
            0 2px 5px rgba(0, 0, 0, 0.5);
        filter: brightness(1.4);
    }

    75% {
        text-shadow:
            0 0 14px rgba(255, 140, 0, 0.95),
            0 0 24px rgba(255, 69, 0, 0.75),
            0 0 34px rgba(220, 20, 60, 0.55),
            0 0 44px rgba(139, 0, 0, 0.38),
            0 2px 5px rgba(0, 0, 0, 0.5);
        filter: brightness(1.45);
    }
}

@keyframes glowPulseFlame {

    0%,
    100% {
        opacity: 0.6;
        transform: scale(1);
    }

    50% {
        opacity: 0.9;
        transform: scale(1.05);
    }
}

@keyframes emberFloat {
    0% {
        opacity: 0;
        transform: translateY(20px) translateX(0);
    }

    20% {
        opacity: 1;
    }

    80% {
        opacity: 0.7;
    }

    100% {
        opacity: 0;
        transform: translateY(-60px) translateX(15px);
    }
}

.leaderboard-subtitle {
    color: var(--secondary);
    font-size: 15px;
    opacity: 0.9;
    font-weight: 500;
}

/* Master Container with Fire-Themed Glassmorphism */
.leaderboard-container {
    position: relative;
    background: linear-gradient(145deg,
            rgba(20, 10, 5, 0.9) 0%,
            rgba(30, 15, 10, 0.85) 100%);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(255, 140, 0, 0.2);
    border-radius: 32px;
    overflow: hidden;
    min-height: 500px;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 140, 0, 0.1) inset,
        0 0 100px rgba(255, 69, 0, 0.2);
}

.leaderboard-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 300px;
    background: radial-gradient(ellipse at top,
            rgba(255, 140, 0, 0.15) 0%,
            rgba(255, 69, 0, 0.08) 40%,
            transparent 70%);
    pointer-events: none;
    z-index: 1;
    animation: fireGlowTop 4s ease-in-out infinite;
}

@keyframes fireGlowTop {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

.leaderboard-glow-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    background: radial-gradient(circle,
            rgba(255, 69, 0, 0.05) 0%,
            rgba(220, 20, 60, 0.03) 50%,
            transparent 70%);
    pointer-events: none;
    z-index: 1;
    animation: fireGlowPulse 5s ease-in-out infinite;
}

@keyframes fireGlowPulse {

    0%,
    100% {
        opacity: 0.4;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

#leaderboard-bg-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.6;
}

.leaderboard-content-wrapper {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
}

/* ===== PODIUM SECTION ===== */
.podium-section {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 12px;
    padding: 70px 40px 0;
    background: linear-gradient(to bottom,
            rgba(6, 182, 212, 0.08) 0%,
            transparent 100%);
    position: relative;
}

.podium-entry {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 180px;
    animation: podiumRise 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    opacity: 0;
    position: relative;
}

@keyframes podiumRise {
    from {
        transform: translateY(60px) scale(0.9);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Crown effect for champion */
.crown-effect {
    position: absolute;
    top: -45px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 36px;
    z-index: 10;
    animation: crownFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 12px rgba(251, 191, 36, 0.5));
}

@keyframes crownFloat {

    0%,
    100% {
        transform: translateX(-50%) translateY(0) rotate(-5deg);
    }

    50% {
        transform: translateX(-50%) translateY(-8px) rotate(5deg);
    }
}

.podium-avatar-box {
    position: relative;
    margin-bottom: 16px;
    z-index: 2;
}

.podium-medal {
    position: absolute;
    top: -14px;
    right: -10px;
    font-size: 32px;
    z-index: 3;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6));
    animation: medalSpin 4s ease-in-out infinite;
}

@keyframes medalSpin {

    0%,
    100% {
        transform: rotate(0deg) scale(1);
    }

    25% {
        transform: rotate(-10deg) scale(1.1);
    }

    75% {
        transform: rotate(10deg) scale(1.1);
    }
}

.podium-avatar-wrapper {
    position: relative;
    padding: 5px;
    border-radius: 50%;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.15),
            rgba(255, 255, 255, 0.05));
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.podium-avatar-ring {
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: linear-gradient(45deg, #06b6d4, #4ade80, #818cf8) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0.6;
    animation: ringRotate 3s linear infinite;
}

@keyframes ringRotate {
    to {
        transform: rotate(360deg);
    }
}

.podium-avatar {
    width: 72px;
    height: 72px;
    background: linear-gradient(145deg, #1e293b, #0f172a);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 28px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.podium-entry:hover .podium-avatar {
    transform: scale(1.08);
}

.podium-first .podium-avatar {
    width: 96px;
    height: 96px;
    font-size: 38px;
    background: linear-gradient(145deg, #f59e0b, #fbbf24, #fcd34d);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow:
        0 0 40px rgba(245, 158, 11, 0.4),
        0 0 80px rgba(245, 158, 11, 0.2);
    animation: championPulse 2s ease-in-out infinite;
}

@keyframes championPulse {

    0%,
    100% {
        box-shadow:
            0 0 40px rgba(245, 158, 11, 0.4),
            0 0 80px rgba(245, 158, 11, 0.2);
    }

    50% {
        box-shadow:
            0 0 60px rgba(245, 158, 11, 0.6),
            0 0 100px rgba(245, 158, 11, 0.3);
    }
}

.champion-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(circle,
            rgba(251, 191, 36, 0.3) 0%,
            transparent 70%);
    border-radius: 50%;
    z-index: 0;
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.8;
    }
}

.podium-label {
    text-align: center;
    margin-bottom: 16px;
    width: 100%;
}

.podium-name {
    display: block;
    font-weight: 800;
    font-size: 17px;
    color: #fff;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.podium-badge {
    display: flex;
    justify-content: center;
}

.cred-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 800;
    padding: 5px 12px;
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
    border-radius: 20px;
    border: 1px solid rgba(74, 222, 128, 0.3);
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.2);
    transition: all 0.3s ease;
}

.podium-entry:hover .cred-pill {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(74, 222, 128, 0.3);
}

.cred-pill .cred-icon {
    font-size: 14px;
}

.podium-first .cred-pill {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* MODERN PEDESTAL */
.podium-pedestal-modern {
    width: 100%;
    height: var(--h, 60px);
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.05) 0%,
            rgba(255, 255, 255, 0.02) 100%);
    border-radius: 20px 20px 0 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: auto;
    position: relative;
    overflow: hidden;
}

.podium-second {
    --h: 120px;
}

.podium-first {
    --h: 180px;
}

.podium-third {
    --h: 90px;
}

.podium-first .podium-pedestal-modern {
    background: linear-gradient(180deg,
            rgba(245, 158, 11, 0.15) 0%,
            rgba(245, 158, 11, 0.05) 100%);
    border-color: rgba(245, 158, 11, 0.2);
    box-shadow: 0 -20px 40px rgba(245, 158, 11, 0.1) inset;
}

.pedestal-shine {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 0%,
            rgba(255, 255, 255, 0.08) 0%,
            transparent 60%);
    opacity: 0;
    animation: subtleShimmer 12s ease-in-out infinite;
}

@keyframes subtleShimmer {

    0%,
    85%,
    100% {
        opacity: 0;
    }

    90%,
    95% {
        opacity: 1;
    }
}

.pedestal-rank-txt {
    font-family: var(--font-display);
    font-size: 56px;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.04);
    position: relative;
    z-index: 1;
}

.podium-first .pedestal-rank-txt {
    color: rgba(245, 158, 11, 0.08);
}

/* ===== LIST SECTION ===== */
.leaderboard-list-modern {
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 0;
}

.leaderboard-entry.modern {
    display: grid;
    grid-template-columns: 70px 1fr auto;
    align-items: center;
    padding: 16px 28px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    animation: entrySlide 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
    position: relative;
    overflow: hidden;
}

@keyframes entrySlide {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.leaderboard-entry.modern:last-child {
    border-bottom: none;
}

.entry-hover-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            rgba(6, 182, 212, 0.08) 0%,
            rgba(74, 222, 128, 0.08) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.leaderboard-entry.modern:hover .entry-hover-glow {
    opacity: 1;
}

.leaderboard-entry.modern:hover {
    background: rgba(255, 255, 255, 0.02);
    padding-left: 36px;
    transform: translateX(4px);
}

.entry-rank-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.rank-id {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 800;
    color: var(--secondary);
    opacity: 0.6;
    transition: all 0.3s ease;
}

.leaderboard-entry.modern:hover .rank-id {
    opacity: 1;
    transform: scale(1.1);
}

.top-ten .rank-id {
    background: linear-gradient(135deg, #4ade80, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 1;
}

.rank-badge {
    font-size: 8px;
    font-weight: 900;
    padding: 2px 6px;
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
    border-radius: 8px;
    letter-spacing: 0.5px;
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.entry-user-box {
    display: flex;
    align-items: center;
    gap: 14px;
}

.entry-avatar-small {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(145deg, #334155, #1e293b);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.leaderboard-entry.modern:hover .entry-avatar-small {
    transform: scale(1.1) rotate(-5deg);
    border-color: rgba(6, 182, 212, 0.4);
}

.avatar-shine {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 30%,
            rgba(255, 255, 255, 0.15) 0%,
            transparent 50%);
    opacity: 0;
    animation: occasionalGlint 15s ease-in-out infinite;
}

@keyframes occasionalGlint {

    0%,
    88%,
    100% {
        opacity: 0;
    }

    90%,
    92% {
        opacity: 0.6;
    }
}

.entry-username-txt {
    font-weight: 700;
    font-size: 17px;
    color: rgba(255, 255, 255, 0.95);
    transition: all 0.3s ease;
}

.leaderboard-entry.modern:hover .entry-username-txt {
    color: #06b6d4;
    transform: translateX(4px);
}

.entry-stats-box {
    text-align: right;
}

.entry-cred-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.leaderboard-entry.modern:hover .entry-cred-pill {
    background: rgba(74, 222, 128, 0.1);
    border-color: rgba(74, 222, 128, 0.3);
    transform: scale(1.05);
}

.entry-cred-pill .cred-icon {
    font-size: 14px;
}

.cred-val {
    font-weight: 900;
    font-size: 16px;
    color: #fff;
}

/* Hover particle effect */
.hover-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, #06b6d4, transparent);
    border-radius: 50%;
    pointer-events: none;
    animation: particleBurst 0.8s ease-out forwards;
    z-index: 100;
}

@keyframes particleBurst {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

/* Empty state */
.leaderboard-empty {
    padding: 100px 40px;
    text-align: center;
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.leaderboard-empty .empty-icon {
    font-size: 80px;
    margin-bottom: 24px;
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-15px) rotate(10deg);
    }
}

.leaderboard-empty h3 {
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
}

.leaderboard-empty p {
    color: var(--secondary);
    font-size: 16px;
    max-width: 360px;
    margin: 0 auto;
    line-height: 1.6;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .leaderboard-title-wrap h2 {
        font-size: 32px;
    }

    .leaderboard-container {
        border-radius: 20px;
    }

    .podium-section {
        padding: 50px 16px 0;
        gap: 6px;
    }

    .podium-avatar {
        width: 56px;
        height: 56px;
        font-size: 22px;
    }

    .podium-first .podium-avatar {
        width: 76px;
        height: 76px;
        font-size: 32px;
    }

    .crown-effect {
        font-size: 28px;
        top: -35px;
    }

    .podium-name {
        font-size: 14px;
    }

    .pedestal-rank-txt {
        font-size: 40px;
    }

    .leaderboard-entry.modern {
        padding: 14px 18px;
        grid-template-columns: 50px 1fr auto;
    }

    .rank-id {
        font-size: 18px;
    }

    .entry-avatar-small {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .entry-username-txt {
        font-size: 15px;
    }
}