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

body {
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Courier New', monospace;
    overflow: hidden;
}

#game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#game-wrapper {
    position: relative;
    border: 4px solid #888;
    background: #000;
}

#game-canvas {
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.mobile-only {
    display: none;
}

@media (max-width: 600px) {
    .mobile-only {
        display: flex;
    }
    
    #mobile-controls {
        position: absolute;
        bottom: 10px;
        left: 0;
        right: 0;
        justify-content: space-between;
        padding: 0 20px;
        pointer-events: none;
    }
    
    .dpad {
        position: relative;
        width: 120px;
        height: 120px;
        pointer-events: auto;
    }
    
    .dpad-btn {
        position: absolute;
        width: 40px;
        height: 40px;
        background: rgba(100, 100, 100, 0.7);
        border: 2px solid #aaa;
        color: #fff;
        font-size: 16px;
        display: flex;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        user-select: none;
        -webkit-user-select: none;
        touch-action: manipulation;
    }
    
    .dpad-btn:active {
        background: rgba(150, 150, 150, 0.9);
    }
    
    .dpad-up { top: 0; left: 40px; }
    .dpad-down { bottom: 0; left: 40px; }
    .dpad-left { top: 40px; left: 0; }
    .dpad-right { top: 40px; right: 0; }
    
    .fire-btn {
        width: 70px;
        height: 70px;
        border-radius: 50%;
        background: rgba(200, 50, 50, 0.8);
        border: 3px solid #f00;
        color: #fff;
        font-size: 14px;
        font-weight: bold;
        align-self: flex-end;
        pointer-events: auto;
        cursor: pointer;
        user-select: none;
        -webkit-user-select: none;
        touch-action: manipulation;
    }
    
    .fire-btn:active {
        background: rgba(255, 80, 80, 0.9);
    }
}
