:root {
    --neon-pink: #ff00ff;
    --neon-blue: #00ffff;
    --neon-green: #39ff14;
    --neon-red: #ff3131;
    --arcade-bg: #0d0d21;
    --glow-shadow: 0 0 10px rgba(255, 0, 255, 0.7), 0 0 20px rgba(255, 0, 255, 0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: #05050a;
    color: #fff;
    font-family: 'Press Start 2P', cursive;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

.arcade-container {
    position: relative;
    width: 600px;
    background: var(--arcade-bg);
    border: 15px solid #222;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9), inset 0 0 20px rgba(0, 0, 0, 1);
    background-image: 
        radial-gradient(circle at 50% 50%, rgba(30,30,60,0.3) 0%, rgba(10,10,20,0.8) 100%);
    overflow: hidden;
}

/* CRT EFFECTS */
.crt-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 4px, 3px 100%;
    pointer-events: none;
    z-index: 10;
}

.scanlines {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(rgba(0,0,0,0.1) 0%, rgba(255,255,255,0.05) 50%, rgba(0,0,0,0.1) 100%);
    background-size: 100% 10px;
    animation: scanline 10s linear infinite;
    pointer-events: none;
    z-index: 9;
    opacity: 0.2;
}

@keyframes scanline {
    0% { transform: translateY(0); }
    100% { transform: translateY(100%); }
}

header {
    text-align: center;
    margin-bottom: 20px;
}

.neon-text {
    font-size: 24px;
    color: var(--neon-pink);
    text-shadow: var(--glow-shadow);
    margin-bottom: 15px;
}

.game-stats {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    padding: 10px 0;
    border-bottom: 2px solid #333;
}

.stat {
    color: var(--neon-blue);
    text-shadow: 0 0 5px var(--neon-blue);
}

.game-screen {
    position: relative;
    width: 100%;
    aspect-ratio: 4/5;
    background: #000;
    border: 4px solid #333;
    box-shadow: inset 0 0 30px rgba(0, 255, 255, 0.1);
}

#gameCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* OVERLAYS */
.overlay-screen {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    text-align: center;
    padding: 20px;
    display: none;
}

.overlay-screen.visible {
    display: flex;
}

h2 {
    font-size: 30px;
    margin-bottom: 30px;
}

.neon-red { color: var(--neon-red); text-shadow: 0 0 10px var(--neon-red); }
.neon-green { color: var(--neon-green); text-shadow: 0 0 10px var(--neon-green); }

.flicker {
    animation: flicker 1.5s infinite, rhythmic-pulse 1s infinite step-end;
}

@keyframes flicker {
    0%, 18%, 22%, 25%, 53%, 57%, 100% { opacity: 1; }
    20%, 24%, 55% { opacity: 0.5; }
}

@keyframes rhythmic-pulse {
    0%, 50% { color: var(--neon-pink); text-shadow: var(--neon-pink) 0 0 15px; }
    51%, 100% { color: var(--neon-blue); text-shadow: var(--neon-blue) 0 0 15px; }
}

.flicker-vibrant {
    animation: flicker-fast 0.1s infinite;
    text-shadow: 0 0 20px var(--neon-pink);
}

@keyframes flicker-fast {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.02); }
}

.instructions {
    font-size: 8px;
    line-height: 1.8;
    color: #888;
    margin: 20px 0;
}

.high-scores-preview {
    margin-top: 30px;
    width: 100%;
}

.high-scores-preview h3 {
    font-size: 10px;
    color: var(--neon-blue);
    margin-bottom: 10px;
}

#rank-list {
    list-style: none;
    font-size: 8px;
    color: #ccc;
    line-height: 1.8;
    text-align: left;
    max-width: 250px;
    margin: 0 auto;
}

.rank-item {
    padding: 2px 5px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.rank-1 { color: #ffd700; text-shadow: 0 0 10px #ffd700; font-weight: bold; font-size: 9px; }
.rank-2 { color: #c0c0c0; text-shadow: 0 0 10px #c0c0c0; }
.rank-3 { color: #cd7f32; text-shadow: 0 0 10px #cd7f32; }

.retro-btn {
    background: transparent;
    border: 3px solid var(--neon-blue);
    color: var(--neon-blue);
    font-family: 'Press Start 2P', cursive;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    text-shadow: 0 0 5px var(--neon-blue);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
    margin: 10px;
}

.retro-btn:hover {
    background: var(--neon-blue);
    color: #000;
    box-shadow: 0 0 20px var(--neon-blue);
}

.name-input-container {
    margin: 20px 0;
}

#player-name {
    background: #111;
    border: 2px solid #555;
    color: #fff;
    font-family: 'Press Start 2P', cursive;
    padding: 10px;
    font-size: 14px;
    width: 200px;
    text-align: center;
    outline: none;
}

#player-name:focus {
    border-color: var(--neon-pink);
}

footer {
    text-align: center;
    margin-top: 20px;
    font-size: 8px;
    color: #444;
}

.joystick-badge {
    text-align: center;
    font-size: 8px;
    color: #444;
    margin-top: 10px;
    padding: 5px;
    border-top: 1px solid #222;
    transition: all 0.3s;
}

.joystick-badge.active {
    color: var(--neon-green);
    text-shadow: 0 0 10px var(--neon-green);
    font-weight: bold;
}

