:root {
    --bg-color: #0d0914;
    --border-glow: #7b2cbf;
    --neon-blue: #e0aaff;
    --neon-pink: #9d4edd;
    --neon-green: #c77dff;
    --neon-yellow: #f8f9fa;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
}

body {
    background-color: var(--bg-color);
    color: #fff;
    font-family: 'Share Tech Mono', monospace;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background-image: radial-gradient(circle, #1a1325 0%, #0d0914 100%);
}

#game-container {
    position: relative;
    width: 800px;
    height: 500px;
    border: 1px solid var(--border-glow);
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(157, 78, 221, 0.3), inset 0 0 20px rgba(157, 78, 221, 0.1);
    overflow: hidden;
    background: #1a1325;
}

/* scanline overlay */
#game-container::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.3) 50%);
    z-index: 10;
    background-size: 100% 4px;
    pointer-events: none;
    opacity: 0.7;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    touch-action: none;
}

#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    font-size: 1.25rem;
    color: var(--neon-blue);
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
    z-index: 5;
    pointer-events: none;
}

.hud-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

#lives-val {
    color: var(--neon-pink);
    text-shadow: 0 0 8px rgba(255, 0, 85, 0.6);
}

#overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 3, 10, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
    cursor: pointer;
    transition: opacity 0.5s ease;
}

#title-neon {
    font-size: 4rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 
        0 0 10px var(--neon-pink),
        0 0 20px var(--neon-pink),
        0 0 40px var(--neon-pink);
    margin-bottom: 20px;
    letter-spacing: 0.1em;
    animation: flicker 1.5s infinite alternate;
}

#subtitle-msg {
    font-size: 1.5rem;
    color: var(--neon-blue);
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.8);
    margin-bottom: 40px;
    letter-spacing: 0.05em;
    animation: pulse 1s infinite alternate;
}

#instructions {
    text-align: center;
    color: #8a8897;
    line-height: 1.8;
    font-size: 0.95rem;
}

#pause-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: var(--neon-yellow);
    text-shadow: 0 0 15px var(--neon-yellow);
    z-index: 15;
    display: none;
    pointer-events: none;
}

.controls-info {
    margin-top: 20px;
    width: 800px;
    display: flex;
    justify-content: space-between;
    color: #575569;
    font-size: 0.9rem;
}

.controls-info a {
    color: var(--neon-blue);
    text-decoration: none;
    transition: color 0.2s;
}

.controls-info a:hover {
    color: #fff;
    text-shadow: 0 0 8px var(--neon-blue);
}

@keyframes flicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        text-shadow: 
            0 0 10px var(--neon-pink),
            0 0 20px var(--neon-pink),
            0 0 40px var(--neon-pink);
    }
    20%, 24%, 55% {
        text-shadow: none;
        color: rgba(255, 255, 255, 0.4);
    }
}

@keyframes pulse {
    0% { opacity: 0.6; }
    100% { opacity: 1; }
}

@media (max-width: 768px) {
    #game-container {
        width: 100%;
        height: auto;
        aspect-ratio: 8/5;
    }
    .controls-info {
        width: 100%;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    #title-neon {
        font-size: 2.5rem;
    }
    #subtitle-msg {
        font-size: 1.2rem;
    }
}
