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

body {
    background: #1a1a2e;
    color: #fff;
    font-family: 'Courier New', monospace;
    overflow: hidden;
    user-select: none;
}

#game-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    position: relative;
}

#canvas {
    border: 2px solid #4A90E2;
    background: #0f0f23;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    max-width: 100vw;
    max-height: 80vh;
    object-fit: contain;
}

#controls {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    position: relative;
    z-index: 100;
}

.control-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.control-btn {
    background: linear-gradient(145deg, #4A90E2, #357ABD);
    border: none;
    color: white;
    padding: 12px 16px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.1s ease;
    box-shadow: 
        inset 0 1px 0 rgba(255,255,255,0.2),
        0 2px 4px rgba(0,0,0,0.3);
    user-select: none;
    touch-action: manipulation;
    min-width: 50px;
}

.control-btn:hover {
    background: linear-gradient(145deg, #5BA0F2, #4A90E2);
    transform: translateY(-1px);
    box-shadow: 
        inset 0 1px 0 rgba(255,255,255,0.3),
        0 3px 6px rgba(0,0,0,0.4);
}

.control-btn:active,
.control-btn.pressed {
    background: linear-gradient(145deg, #357ABD, #2E6BA8);
    transform: translateY(1px);
    box-shadow: 
        inset 0 2px 4px rgba(0,0,0,0.3),
        0 1px 2px rgba(0,0,0,0.2);
}

#fireBtn {
    background: linear-gradient(145deg, #E24A4A, #BD3737);
    font-size: 16px;
    padding: 12px 20px;
}

#fireBtn:hover {
    background: linear-gradient(145deg, #F25A5A, #E24A4A);
}

#fireBtn:active,
#fireBtn.pressed {
    background: linear-gradient(145deg, #BD3737, #A82E2E);
}

#pauseBtn {
    background: linear-gradient(145deg, #9B4AE2, #7D37BD);
}

#pauseBtn:hover {
    background: linear-gradient(145deg, #AB5AF2, #9B4AE2);
}

#pauseBtn:active,
#pauseBtn.pressed {
    background: linear-gradient(145deg, #7D37BD, #6A2EA8);
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    z-index: 200;
}

.screen {
    background: rgba(26, 26, 46, 0.95);
    border: 3px solid #4A90E2;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 0 30px rgba(74, 144, 226, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.screen.active {
    opacity: 1;
    visibility: visible;
}

.screen h1 {
    font-size: 48px;
    color: #4A90E2;
    text-shadow: 
        2px 2px 0 #357ABD,
        -2px -2px 0 #357ABD,
        2px -2px 0 #357ABD,
        -2px 2px 0 #357ABD;
    margin-bottom: 20px;
    letter-spacing: 4px;
}

.screen h2 {
    font-size: 32px;
    color: #E24A4A;
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.screen p {
    font-size: 16px;
    margin-bottom: 10px;
    line-height: 1.5;
}

.controls-info {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #4A90E2;
}

.controls-info p {
    font-size: 14px;
    color: #ccc;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #canvas {
        max-height: 70vh;
    }
    
    .control-btn {
        padding: 10px 12px;
        font-size: 12px;
        min-width: 45px;
    }
    
    .screen {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .screen h1 {
        font-size: 36px;
    }
    
    .screen h2 {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    #controls {
        margin-top: 15px;
    }
    
    .control-row {
        gap: 6px;
    }
    
    .control-btn {
        padding: 8px 10px;
        font-size: 11px;
        min-width: 40px;
    }
    
    .screen {
        padding: 25px 15px;
    }
    
    .screen h1 {
        font-size: 28px;
        letter-spacing: 2px;
    }
    
    .screen p {
        font-size: 14px;
    }
}

/* Gaming-specific styles */
.screen {
    animation: scanlines 2s linear infinite;
}

@keyframes scanlines {
    0% {
        box-shadow: 
            0 0 30px rgba(74, 144, 226, 0.3),
            inset 0 0 0 rgba(74, 144, 226, 0.1);
    }
    50% {
        box-shadow: 
            0 0 30px rgba(74, 144, 226, 0.5),
            inset 0 0 10px rgba(74, 144, 226, 0.2);
    }
    100% {
        box-shadow: 
            0 0 30px rgba(74, 144, 226, 0.3),
            inset 0 0 0 rgba(74, 144, 226, 0.1);
    }
}

/* Retro glow effects */
#canvas {
    box-shadow: 
        0 0 20px rgba(74, 144, 226, 0.5),
        inset 0 0 50px rgba(15, 15, 35, 0.8);
}

/* CRT-style effects */
#canvas::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        transparent 50%, 
        rgba(0, 255, 0, 0.03) 50%
    );
    background-size: 100% 4px;
    pointer-events: none;
}