/* ========================================
   TANKWARS - NEON REDESIGN
   Smooth Animations + Neon Accents
   ======================================== */

/* === CSS VARIABLES === */
:root {
    --neon-cyan: #00F0FF;
    --neon-magenta: #FF00FF;
    --neon-green: #00FF88;
    --neon-orange: #FFAA00;
    --neon-gold: #FFD700;
    --bg-dark: #0a0a0f;
    --bg-card: rgba(20, 20, 30, 0.9);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

/* === GLOBAL STYLES === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Orbitron', 'Ubuntu', sans-serif;
    user-select: none;
    background: var(--bg-dark);
    color: white;
    overflow: hidden;
}

.hidden {
    display: none !important;
}

/* === ANIMATIONS === */
@keyframes neonGlow {

    0%,
    100% {
        box-shadow: 0 0 5px var(--neon-cyan),
            0 0 10px var(--neon-cyan),
            0 0 20px var(--neon-cyan);
    }

    50% {
        box-shadow: 0 0 10px var(--neon-cyan),
            0 0 20px var(--neon-cyan),
            0 0 40px var(--neon-cyan),
            0 0 60px var(--neon-cyan);
    }
}

@keyframes neonPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

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

@keyframes float {

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

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

/* === MENU OVERLAY === */
#menuOverlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.1), rgba(255, 0, 255, 0.1));
    backdrop-filter: blur(20px);
    padding: 40px;
    border-radius: 20px;
    border: 2px solid var(--neon-cyan);
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.3),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
    z-index: 10;
    pointer-events: auto;
}

.logo {
    font-size: 72px;
    font-weight: 900;
    color: white;
    text-shadow: 0 0 20px var(--neon-cyan),
        0 0 40px var(--neon-cyan),
        0 0 60px var(--neon-magenta);
    margin-bottom: 30px;
    animation: neonPulse 2s ease-in-out infinite;
    letter-spacing: 4px;
    text-transform: uppercase;
}

/* === INPUTS === */
#nameInput,
input[type="text"],
input[type="password"] {
    padding: 15px 25px;
    font-size: 18px;
    border-radius: 10px;
    border: 2px solid rgba(0, 240, 255, 0.5);
    width: 300px;
    text-align: center;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-family: 'Orbitron', sans-serif;
    font-weight: 600;
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

#nameInput:focus,
input[type="text"]:focus,
input[type="password"]:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.6),
        inset 0 0 10px rgba(0, 240, 255, 0.2);
    transform: scale(1.02);
}

/* === BUTTONS === */
.menu-buttons {
    margin-top: 20px;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

button {
    padding: 15px 35px;
    font-size: 16px;
    border: 2px solid var(--neon-cyan);
    border-radius: 10px;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(255, 0, 255, 0.2));
    color: white;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    position: relative;
    overflow: hidden;
    z-index: 100;
    pointer-events: auto;
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 240, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:hover::before {
    width: 300px;
    height: 300px;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px var(--neon-cyan),
        0 0 60px var(--neon-cyan);
    border-color: var(--neon-magenta);
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.3), rgba(255, 0, 255, 0.3));
}

button:active {
    transform: translateY(-1px);
}

/* === SHOP OVERLAY === */
#shopOverlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(10, 10, 15, 0.95), rgba(20, 20, 30, 0.95));
    backdrop-filter: blur(30px);
    padding: 40px;
    border-radius: 25px;
    color: white;
    text-align: center;
    width: 85%;
    max-width: 950px;
    max-height: 90%;
    overflow-y: auto;
    border: 2px solid var(--neon-cyan);
    box-shadow: 0 0 60px rgba(0, 240, 255, 0.4),
        inset 0 0 30px rgba(0, 0, 0, 0.5);
    z-index: 100;
}

#shopOverlay h2 {
    font-size: 42px;
    margin-bottom: 15px;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-magenta));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 0 30px rgba(0, 240, 255, 0.5);
}

#killCountDisplay {
    font-size: 20px;
    color: var(--neon-gold);
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(0, 240, 255, 0.3);
    animation: neonPulse 2s ease-in-out infinite;
}

/* === SKIN GRID === */
.skin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 25px;
    padding: 15px;
    width: 100%;
}

.skin-card {
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.4s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.skin-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(0, 240, 255, 0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.6s;
}

.skin-card:hover::before {
    left: 100%;
}

.skin-card:hover {
    transform: translateY(-10px) scale(1.05);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 40px rgba(0, 240, 255, 0.4);
    border-color: var(--neon-cyan);
}

.skin-card.active-card {
    border: 2px solid var(--neon-magenta);
    box-shadow: 0 0 30px rgba(255, 0, 255, 0.6);
    animation: neonGlow 2s ease-in-out infinite;
}

.skin-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
    transition: all 0.4s ease;
}

.skin-card:hover .skin-preview {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 0 30px var(--neon-cyan);
}

.skin-name {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

/* === SELECT BUTTONS === */
.select-btn {
    width: 100%;
    padding: 10px 0;
    font-size: 13px;
    font-weight: 700;
    border: 2px solid var(--neon-cyan);
    border-radius: 8px;
    cursor: pointer;
    background: rgba(0, 240, 255, 0.1);
    color: var(--neon-cyan);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.select-btn:hover {
    background: rgba(0, 240, 255, 0.3);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.5);
    transform: scale(1.05);
}

.select-btn.buy {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.3), rgba(0, 240, 255, 0.3));
    border-color: var(--neon-green);
    color: var(--neon-green);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
}

.select-btn.buy:hover {
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.6);
}

.select-btn.equipped {
    background: transparent;
    border: 2px solid var(--neon-gold);
    color: var(--neon-gold);
    cursor: default;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
    animation: neonPulse 2s ease-in-out infinite;
}

.select-btn.locked {
    background: rgba(0, 0, 0, 0.5);
    color: #555;
    cursor: not-allowed;
    border: 2px solid #333;
}

/* === SCOREBOARD === */
#scoreboard {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    padding: 20px;
    border-radius: 15px;
    color: white;
    min-width: 240px;
    border: 2px solid rgba(0, 240, 255, 0.3);
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.2);
    animation: slideIn 0.5s ease;
}

.scoreboard-title {
    font-weight: 800;
    text-align: center;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--neon-cyan);
    padding-bottom: 10px;
    font-size: 20px;
    letter-spacing: 2px;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-magenta));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
}

#leaderboardList {
    list-style: none;
    padding: 0;
    margin: 0;
}

#leaderboardList li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    padding: 8px 10px;
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

#leaderboardList li:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(-5px);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

#leaderboardList li:first-child {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.2), transparent);
    border-left-color: var(--neon-gold);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

#leaderboardList li:nth-child(2) {
    border-left-color: #C0C0C0;
}

#leaderboardList li:nth-child(3) {
    border-left-color: #CD7F32;
}

.rank {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    width: 30px;
}

#leaderboardList li:first-child .rank {
    color: var(--neon-gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

.name {
    flex-grow: 1;
    color: #fff;
    font-weight: 600;
}

.score {
    font-weight: 700;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.6);
}

/* === VOTING OVERLAY === */
#votingOverlay {
    background: linear-gradient(135deg, #1a1a2e, #16213e) !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#votingOverlay h2 {
    font-size: 48px;
    text-transform: uppercase;
    color: white;
    margin-bottom: 50px;
    text-shadow: 0 0 20px var(--neon-cyan);
    background: rgba(0, 0, 0, 0.6);
    padding: 15px 50px;
    border-radius: 10px;
    border: 2px solid var(--neon-cyan);
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.4);
    animation: neonPulse 3s ease-in-out infinite;
}

.vote-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    max-width: 900px;
    width: 100%;
    padding: 20px;
}

@media (min-width: 900px) {
    .vote-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

.vote-card {
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 15px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 3px solid var(--neon-cyan);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
    background: #1a1a1a;
    transition: all 0.4s ease;
}

.vote-card:hover {
    transform: scale(1.08) translateY(-5px);
    box-shadow: 0 0 40px var(--neon-cyan);
    z-index: 10;
}

.vote-card.selected-choice {
    border: 4px solid var(--neon-green);
    box-shadow: 0 0 50px var(--neon-green);
    transform: scale(1.12);
    animation: neonGlow 2s ease-in-out infinite;
}

.vote-card-bg {
    width: 100%;
    height: 80%;
    background-size: cover;
    background-position: center;
}

.vote-card-footer {
    height: 20%;
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-top: 3px solid var(--neon-cyan);
}

.vote-title {
    font-size: 18px;
    font-weight: 900;
    text-transform: uppercase;
    color: white;
    text-shadow: 0 0 10px var(--neon-cyan);
    margin: 0;
}

.vote-count {
    font-size: 12px;
    color: var(--neon-gold);
    font-weight: 700;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.6);
}

/* === UPGRADE UI === */
#upgradeContainer {
    background: transparent;
    /* Minimal background */
    padding: 0;
    border-radius: 5px;
    position: absolute;
    bottom: 10px;
    left: 10px;
    /* Moved to bottom-left */
    right: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    /* Very compact */
    border: none;
    box-shadow: none;
    width: 200px;
    /* Fixed small width */
    transition: opacity 0.5s ease, transform 0.5s ease;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

#upgradeContainer.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 2px;
    /* Minimal padding */
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.3);
    /* Slight legible bg */
}

.stat-row.upgradable:hover {
    background: rgba(0, 240, 255, 0.3);
}

.stat-label {
    color: white;
    font-size: 10px;
    /* Smaller text */
    font-weight: 700;
    text-shadow: 0 0 2px black;
    text-transform: uppercase;
    width: 60px;
    text-align: right;
    white-space: nowrap;
}

.stat-bar {
    flex-grow: 1;
    /* Fill remaining space */
    height: 8px;
    /* Thinner bar */
    background: rgba(0, 0, 0, 0.5);
    border-radius: 2px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-fill {
    height: 100%;
    width: 0%;
    transition: width 0.4s ease;
}

.stat-plus {
    color: #F1C40F;
    font-size: 20px;
    font-weight: 900;
    margin-left: auto;
    /* Push to right */
    text-shadow: 0 0 10px #F1C40F;
    user-select: none;
}

#upgradePointsDisplay {
    font-size: 15px !important;
    padding-left: 15px;
    border-left: 2px solid rgba(0, 240, 255, 0.5);
    display: flex;
    align-items: center;
    color: var(--neon-gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
    font-weight: 700;
}

/* === SHAPE PREVIEWS === */
.shape-preview {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    background: var(--neon-gold);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    transition: all 0.4s ease;
}

.shape-preview:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 40px var(--neon-gold);
}

.shape-preview.circle {
    border-radius: 50%;
}

.shape-preview.square {
    border-radius: 8px;
}

.shape-preview.triangle {
    width: 0;
    height: 0;
    background: transparent;
    border-left: 35px solid transparent;
    border-right: 35px solid transparent;
    border-bottom: 60px solid #FF3333;
    /* Red to match game */
    box-shadow: none;
    filter: drop-shadow(0 0 15px rgba(255, 51, 51, 0.8));
}

.shape-preview.pentagon {
    width: 60px;
    background-color: #3333FF;
    /* Blue to match game */
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
    box-shadow: none;
    filter: drop-shadow(0 0 15px rgba(51, 51, 255, 0.8));
}

.shape-preview.hexagon {
    width: 70px;
    height: 40px;
    background: #CC00CC;
    /* Purple to match game */
    position: relative;
    box-shadow: none;
    filter: drop-shadow(0 0 15px rgba(204, 0, 204, 0.8));
}

.shape-preview.hexagon:before,
.shape-preview.hexagon:after {
    content: "";
    position: absolute;
    width: 0;
    border-left: 35px solid transparent;
    border-right: 35px solid transparent;
}

.shape-preview.hexagon:before {
    bottom: 100%;
    border-bottom: 20px solid #CC00CC;
}

.shape-preview.hexagon:after {
    top: 100%;
    border-top: 20px solid #CC00CC;
}

.shape-preview.star {
    margin: 15px auto;
    width: 0;
    height: 0;
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-bottom: 32px solid #F1C40F;
    position: relative;
    box-shadow: none;
    filter: drop-shadow(0 0 15px rgba(241, 196, 15, 0.8));
}

.shape-preview.star:after {
    width: 0;
    height: 0;
    display: block;
    content: "";
    position: absolute;
    top: 12px;
    left: -36px;
    border-left: 36px solid transparent;
    border-right: 36px solid transparent;
    border-top: 32px solid #F1C40F;
}

/* Octagon Shape */
.shape-preview.octagon {
    width: 50px;
    height: 50px;
    background: #9B59B6;
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
    box-shadow: 0 0 20px rgba(155, 89, 182, 0.8);
}

/* Heart Shape */
.shape-preview.heart {
    width: 50px;
    height: 50px;
    background: #E74C3C;
    position: relative;
    transform: rotate(-45deg);
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.8);
}

.shape-preview.heart:before,
.shape-preview.heart:after {
    content: "";
    width: 50px;
    height: 50px;
    background: #E74C3C;
    border-radius: 50%;
    position: absolute;
}

.shape-preview.heart:before {
    top: -25px;
    left: 0;
}

.shape-preview.heart:after {
    left: 25px;
    top: 0;
}

/* Diamond Shape */
.shape-preview.diamond {
    width: 50px;
    height: 50px;
    background: #3498DB;
    transform: rotate(45deg);
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.8);
}

/* Cross Shape */
.shape-preview.cross {
    width: 50px;
    height: 50px;
    background: linear-gradient(to right, transparent 35%, #1ABC9C 35%, #1ABC9C 65%, transparent 65%),
        linear-gradient(to bottom, transparent 35%, #1ABC9C 35%, #1ABC9C 65%, transparent 65%);
    box-shadow: 0 0 20px rgba(26, 188, 156, 0.8);
}

/* === MOBILE CONTROLS === */
.neon-btn {
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid var(--neon-cyan);
    color: var(--neon-cyan);
    padding: 12px 18px;
    border-radius: 10px;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
    text-shadow: 0 0 10px var(--neon-cyan);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
    transition: all 0.3s ease;
}

.neon-btn:active {
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.8);
    background: rgba(0, 240, 255, 0.2);
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--neon-cyan), var(--neon-magenta));
    border-radius: 10px;
    box-shadow: 0 0 10px var(--neon-cyan);
}

::-webkit-scrollbar-thumb:hover {
    box-shadow: 0 0 20px var(--neon-cyan);
}

/* === UPGRADE BAR (HUD) === */
#upgradeContainer {
    position: fixed;
    bottom: 20px;
    left: 40px;
    background: linear-gradient(135deg, rgba(10, 10, 15, 0.98), rgba(20, 20, 30, 0.98));
    backdrop-filter: blur(25px);
    border: 3px solid var(--neon-cyan);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.5),
        0 0 80px rgba(0, 240, 255, 0.2),
        inset 0 0 30px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 50;
    font-family: 'Orbitron', sans-serif;
    min-width: 280px;
    animation: slideInLeft 0.5s ease-out, pulseGlow 3s ease-in-out infinite;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

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

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 40px rgba(0, 240, 255, 0.5),
            0 0 80px rgba(0, 240, 255, 0.2),
            inset 0 0 30px rgba(0, 0, 0, 0.6);
    }

    50% {
        box-shadow: 0 0 50px rgba(0, 240, 255, 0.7),
            0 0 100px rgba(0, 240, 255, 0.3),
            inset 0 0 30px rgba(0, 0, 0, 0.6);
    }
}

.upgrade-item {
    display: grid;
    grid-template-columns: 90px 1fr 35px;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: linear-gradient(90deg, rgba(0, 240, 255, 0.08), rgba(0, 240, 255, 0.03));
    border-radius: 10px;
    border-left: 4px solid var(--neon-cyan);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.upgrade-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.upgrade-item:hover::before {
    left: 100%;
}

.upgrade-item:hover {
    background: linear-gradient(90deg, rgba(0, 240, 255, 0.15), rgba(0, 240, 255, 0.08));
    transform: translateX(5px) scale(1.02);
    border-left-width: 6px;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
}

.stat-label {
    color: white;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-align: left;
    line-height: 1.2;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.stat-bar-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-bar {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(0, 240, 255, 0.4);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

.stat-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-green), var(--neon-cyan));
    background-size: 200% 100%;
    box-shadow: 0 0 15px var(--neon-cyan),
        inset 0 0 10px rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    animation: shimmer 2s linear infinite;
    position: relative;
}

@keyframes shimmer {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}

.stat-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.4), transparent);
    border-radius: 6px 6px 0 0;
}

.upgrade-btn {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(0, 240, 255, 0.1));
    border: 3px solid var(--neon-cyan);
    border-radius: 8px;
    color: var(--neon-cyan);
    font-size: 20px;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
    position: relative;
}

.upgrade-btn::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 8px;
    padding: 3px;
    background: linear-gradient(45deg, var(--neon-cyan), transparent, var(--neon-cyan));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.upgrade-btn:hover::before {
    opacity: 1;
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.upgrade-btn:hover {
    background: var(--neon-cyan);
    color: #0a0a0f;
    box-shadow: 0 0 25px var(--neon-cyan),
        0 0 50px rgba(0, 240, 255, 0.5);
    transform: scale(1.15) rotate(90deg);
}

.upgrade-btn:active {
    transform: scale(0.95) rotate(90deg);
}

.level-display {
    color: white;
    font-size: 16px;
    font-weight: 900;
    text-shadow: 0 0 15px var(--neon-cyan),
        0 0 30px rgba(0, 240, 255, 0.5);
    padding: 15px;
    text-align: center;
    border-top: 3px solid rgba(0, 240, 255, 0.5);
    margin-top: 8px;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.1), rgba(0, 240, 255, 0.05));
    border-radius: 10px;
    animation: levelPulse 2s ease-in-out infinite;
}

@keyframes levelPulse {

    0%,
    100% {
        text-shadow: 0 0 15px var(--neon-cyan),
            0 0 30px rgba(0, 240, 255, 0.5);
    }

    50% {
        text-shadow: 0 0 20px var(--neon-cyan),
            0 0 40px rgba(0, 240, 255, 0.7),
            0 0 60px rgba(0, 240, 255, 0.3);
    }
}

/* === LEADERBOARD (HUD) === */
#scoreboard {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, rgba(10, 10, 15, 0.95), rgba(20, 20, 30, 0.95));
    backdrop-filter: blur(25px);
    border: 2px solid var(--neon-cyan);
    border-radius: 15px;
    padding: 20px;
    min-width: 320px;
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.4),
        inset 0 0 25px rgba(0, 0, 0, 0.5);
    z-index: 50;
    font-family: 'Orbitron', sans-serif;
    display: flex;
    flex-direction: column;
}

#scoreboard h3 {
    margin: 0 0 15px 0;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 3px;
    text-align: left;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-magenta));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(0, 240, 255, 0.3);
}

.leaderboard-entry {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin: 4px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border-left: 3px solid rgba(0, 240, 255, 0.3);
    transition: all 0.3s ease;
}

.leaderboard-entry:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(3px);
}

/* Gold - 1st Place */
.leaderboard-entry:nth-child(2) {
    border-left-color: var(--neon-gold);
    background: rgba(255, 215, 0, 0.08);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

/* Silver - 2nd Place */
.leaderboard-entry:nth-child(3) {
    border-left-color: #C0C0C0;
    background: rgba(192, 192, 192, 0.05);
}

/* Bronze - 3rd Place */
.leaderboard-entry:nth-child(4) {
    border-left-color: #CD7F32;
    background: rgba(205, 127, 50, 0.05);
}

.rank-badge {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.3), rgba(0, 255, 136, 0.3));
    color: white;
    border: 2px solid var(--neon-cyan);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 16px;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
    flex-shrink: 0;
}

.leaderboard-entry:nth-child(2) .rank-badge {
    background: linear-gradient(135deg, var(--neon-gold), #FFA500);
    border-color: var(--neon-gold);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    color: black;
}

.leaderboard-entry:nth-child(3) .rank-badge {
    background: linear-gradient(135deg, #C0C0C0, #A8A8A8);
    border-color: #C0C0C0;
    color: black;
}

.leaderboard-entry:nth-child(4) .rank-badge {
    background: linear-gradient(135deg, #CD7F32, #B8722D);
    border-color: #CD7F32;
    color: black;
}

.player-name {
    color: white;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.leaderboard-entry:nth-child(2) .player-name {
    color: var(--neon-gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.player-score {
    color: var(--neon-cyan);
    font-size: 18px;
    font-weight: 900;
    text-shadow: 0 0 10px var(--neon-cyan);
    text-align: right;
    min-width: 50px;
}

.leaderboard-entry:nth-child(2) .player-score {
    color: var(--neon-gold);
    text-shadow: 0 0 15px var(--neon-gold);
    font-size: 20px;
}

/* === EVOLUTION MENU === */
#evolutionContainer {
    position: absolute;
    top: 100px;
    /* Below Top Bar */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row;
    /* Horizontal */
    gap: 20px;
    z-index: 50;
    pointer-events: none;
    /* Let clicks pass through if not on card */
}

.class-card {
    pointer-events: auto;
    background: rgba(10, 10, 15, 0.9);
    border: 2px solid var(--neon-cyan);
    border-radius: 10px;
    padding: 10px;
    width: 100px;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

.class-card:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 0 30px var(--neon-cyan);
    background: rgba(0, 240, 255, 0.1);
}

.class-card canvas {
    margin-bottom: 5px;
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.5));
}

.class-card div {
    font-size: 12px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    text-align: center;
    text-shadow: 0 0 4px black;
}