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

body {
    background: #0a0a1a;
    overflow: hidden;
    font-family: 'Share Tech Mono', monospace;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

#canvas {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

#footer-link {
    position: fixed;
    bottom: 6px;
    right: 12px;
    color: #4a5568;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    text-decoration: none;
    z-index: 100;
    letter-spacing: 1px;
    transition: color 0.3s;
}

#footer-link:hover {
    color: #718096;
}

#touch-controls {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    z-index: 50;
    pointer-events: none;
}

#dpad {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 130px;
    height: 130px;
    pointer-events: auto;
}

.dpad-btn {
    position: absolute;
    width: 44px;
    height: 44px;
    background: rgba(30, 40, 70, 0.8);
    border: 1px solid rgba(100, 140, 255, 0.4);
    color: #8ab4ff;
    font-size: 18px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.dpad-btn:active {
    background: rgba(60, 80, 140, 0.9);
    border-color: rgba(100, 140, 255, 0.8);
}

#btn-up { top: 0; left: 50%; transform: translateX(-50%); }
#btn-down { bottom: 0; left: 50%; transform: translateX(-50%); }
#btn-left { top: 50%; left: 0; transform: translateY(-50%); }
#btn-right { top: 50%; right: 0; transform: translateY(-50%); }

.action-btn {
    position: fixed;
    bottom: 55px;
    right: 30px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(30, 50, 80, 0.8);
    border: 2px solid rgba(100, 180, 255, 0.5);
    color: #8ab4ff;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    letter-spacing: 1px;
    cursor: pointer;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
}

.action-btn:active {
    background: rgba(60, 100, 160, 0.9);
    border-color: rgba(100, 180, 255, 0.9);
}

@media (pointer: coarse) {
    #touch-controls {
        display: block;
    }
}

@media (max-width: 600px) {
    #touch-controls {
        display: block;
    }
}