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

html, body {
    height: 100%;
    width: 100%;
}

body {
    background: #0a0a12;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Press Start 2P', monospace;
    overflow: hidden;
}

#game-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    width: 100%;
    height: 100%;
    padding: 20px;
}

#canvas {
    border: 4px solid #225566;
    border-radius: 4px;
    box-shadow: 
        0 0 20px rgba(34, 85, 102, 0.5),
        inset 0 0 60px rgba(0, 0, 0, 0.3);
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    max-width: 100%;
    max-height: 100%;
}

#mobile-controls {
    display: none;
    position: fixed;
    bottom: 60px;
    left: 0;
    right: 0;
    padding: 20px;
    justify-content: space-between;
    align-items: flex-end;
    pointer-events: none;
    z-index: 100;
}

#joystick-zone {
    pointer-events: auto;
}

#joystick-base {
    width: 120px;
    height: 120px;
    background: rgba(34, 85, 102, 0.3);
    border: 3px solid rgba(34, 85, 102, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}

#joystick-stick {
    width: 50px;
    height: 50px;
    background: rgba(0, 255, 102, 0.6);
    border: 2px solid rgba(0, 255, 102, 0.8);
    border-radius: 50%;
    transition: transform 0.05s ease-out;
}

#button-zone {
    display: flex;
    flex-direction: column;
    gap: 15px;
    pointer-events: auto;
}

#button-zone button {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

#fire-btn {
    background: rgba(255, 221, 0, 0.3);
    border-color: rgba(255, 221, 0, 0.7);
    color: #FFDD00;
}

#fire-btn:active {
    background: rgba(255, 221, 0, 0.6);
    transform: scale(0.95);
}

#bomb-btn {
    background: rgba(255, 102, 0, 0.3);
    border-color: rgba(255, 102, 0, 0.7);
    color: #FF6600;
}

#bomb-btn:active {
    background: rgba(255, 102, 0, 0.6);
    transform: scale(0.95);
}

footer {
    padding: 15px;
    flex-shrink: 0;
}

footer a {
    color: #4A7C8C;
    text-decoration: none;
    font-size: 12px;
    transition: color 0.3s;
}

footer a:hover {
    color: #00FF66;
}

/* Mobile styles */
@media (max-width: 850px) {
    body {
        justify-content: flex-start;
    }
    
    #game-container {
        padding: 10px;
        padding-bottom: 180px;
    }
    
    #canvas {
        border-width: 2px;
    }
    
    #mobile-controls {
        display: flex;
    }
    
    footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        text-align: center;
        background: rgba(10, 10, 18, 0.9);
        padding: 10px;
    }
}

@media (max-height: 600px) and (orientation: landscape) {
    #game-container {
        padding: 5px;
        padding-bottom: 100px;
    }
    
    #mobile-controls {
        bottom: 10px;
        padding: 10px;
    }
    
    #joystick-base {
        width: 90px;
        height: 90px;
    }
    
    #joystick-stick {
        width: 40px;
        height: 40px;
    }
    
    #button-zone button {
        width: 60px;
        height: 60px;
        font-size: 8px;
    }
    
    footer {
        display: none;
    }
}