* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: #0a0a0a;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 10px;
    font-family: 'Press Start 2P', monospace;
    overflow: hidden;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

#canvas {
    border: 2px solid #222;
    max-width: 100%;
    touch-action: none;
}

/* Desktop layout improvements */
@media (min-width: 900px) {
    body {
        padding: 20px;
    }
    
    #canvas {
        border: 3px solid #333;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    }
}

#controls {
    margin-top: 10px;
}

#mobile-controls {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.ctrl-row {
    display: flex;
    gap: 5px;
}

.ctrl-btn {
    width: 60px;
    height: 60px;
    font-size: 24px;
    background: #111;
    border: 2px solid #333;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
}

.ctrl-btn:active {
    background: #222;
    border-color: #fff;
}

@media (max-width: 768px) {
    #mobile-controls {
        display: flex;
    }
}

@media (hover: none) and (pointer: coarse) {
    #mobile-controls {
        display: flex;
    }
}

#footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #0a0a0a;
    padding: 12px;
    text-align: center;
    border-top: 1px solid #222;
}

#footer a {
    color: #666;
    text-decoration: none;
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

#footer a:hover {
    color: #fff;
}