body {
    margin: 0;
    background: radial-gradient(circle at top, #222 0, #050505 40%, #000 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    color: white;
    font-family: Arial, sans-serif;
    overflow: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(0, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(180deg, rgba(0, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.4;
    mix-blend-mode: screen;
    animation: gridMove 20s linear infinite;
    pointer-events: none;
}

@keyframes gridMove {
    from { transform: translateY(0); }
    to   { transform: translateY(40px); }
}

canvas {
    background: #000;
    border: 2px solid #0ff;
    box-shadow: 0 0 25px #0ff;
    cursor: none;
}

#game-footer {
    position: fixed;
    bottom: 10px;
    width: 100%;
    text-align: center;
    font-family: Verdana, Geneva, sans-serif;
    font-size: 16px;
    color: #ffffff;
    text-shadow: 0 0 8px rgba(255,255,255,0.9);
    z-index: 9999;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

/* Neon glowing bars on left + right */
#game-footer::before,
#game-footer::after {
    content: "";
    width: 80px;
    height: 3px;
    background: #ffffff;
    box-shadow: 0 0 12px #ffffff, 0 0 20px #00e5ff;
    border-radius: 2px;
    animation: footerBarPulse 2s infinite ease-in-out;
}

@keyframes footerBarPulse {
    0%   { opacity: 0.4; transform: scaleX(1); }
    50%  { opacity: 1;   transform: scaleX(1.3); }
    100% { opacity: 0.4; transform: scaleX(1); }
}

/* Pulsing separators */
#game-footer span.separator {
    color: #ffffff;
    animation: separatorPulse 1.5s infinite ease-in-out;
    text-shadow: 0 0 10px #ffffff;
}

@keyframes separatorPulse {
    0%   { opacity: 0.5; }
    50%  { opacity: 1; }
    100% { opacity: 0.5; }
}

/* Link styling */
#game-footer a {
    color: #ffffff;
    text-decoration: none;
    pointer-events: auto;
    text-shadow: 0 0 10px #ffffff;
}

#game-footer a:hover {
    text-decoration: underline;
}

/* ============================= */
/* LEADERBOARD OVERLAY (NEON)    */
/* ============================= */

.overlay {
    display: none;
}

.overlay.visible {
    display: block !important;
}

/* Neon leaderboard container */
.leaderboard-overlay {
    width: 420px;
    max-height: 520px;
    overflow-y: auto;
    padding: 20px 26px;
    background: rgba(5, 7, 18, 0.92);
    border-radius: 14px;

    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);

    border: 2px solid rgba(74, 242, 197, 0.55);
    box-shadow:
        0 0 25px rgba(74, 242, 197, 0.45),
        0 0 45px rgba(255, 79, 216, 0.35),
        inset 0 0 18px rgba(74, 242, 197, 0.25);

    animation: leaderboardFade 0.35s ease-out forwards,
               leaderboardGlow 3s ease-in-out infinite alternate;
}

.leaderboard-overlay h2 {
    margin: 0 0 12px;
    font-size: 30px;
    color: #4af2c5;
    text-shadow: 0 0 14px rgba(255, 79, 216, 0.8);
}

#leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 22px;
}

#leaderboard-table tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#leaderboard-table td {
    padding: 6px 10px;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.35);
}

@keyframes leaderboardFade {
    0% { opacity: 0; transform: scale(0.85); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes leaderboardGlow {
    0% {
        box-shadow:
            0 0 20px rgba(74, 242, 197, 0.35),
            0 0 35px rgba(255, 79, 216, 0.25),
            inset 0 0 12px rgba(74, 242, 197, 0.2);
    }
    100% {
        box-shadow:
            0 0 30px rgba(74, 242, 197, 0.55),
            0 0 55px rgba(255, 79, 216, 0.45),
            inset 0 0 18px rgba(74, 242, 197, 0.35);
    }
}
