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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #050505;
    font-family: 'Creepster', cursive;
    user-select: none;
    -webkit-user-select: none;
}

#canvas {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#mobile-controls {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 150px;
    z-index: 100;
    pointer-events: none;
}

.dpad-btn {
    position: absolute;
    width: 50px;
    height: 50px;
    background: rgba(160, 100, 200, 0.25);
    border: 1px solid rgba(160, 100, 200, 0.4);
    border-radius: 10px;
    color: rgba(224, 224, 255, 0.6);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: all;
    outline: none;
    -webkit-appearance: none;
    touch-action: manipulation;
}

.dpad-btn:active {
    background: rgba(160, 100, 200, 0.5);
    border-color: rgba(160, 100, 200, 0.7);
    color: rgba(224, 224, 255, 0.9);
}

#btn-up { top: 0; left: 50px; }
#btn-left { top: 50px; left: 0; }
#btn-right { top: 50px; left: 100px; }
#btn-down { top: 100px; left: 50px; }

#game-footer {
    position: fixed;
    bottom: 4px;
    right: 10px;
    z-index: 50;
}

#game-footer a {
    font-family: 'Creepster', cursive;
    color: rgba(224, 224, 255, 0.2);
    text-decoration: none;
    font-size: 12px;
    letter-spacing: 1px;
}

#game-footer a:hover {
    color: rgba(224, 224, 255, 0.5);
}

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

@media (max-width: 500px) {
    #mobile-controls {
        bottom: 10px;
        width: 130px;
        height: 130px;
    }
    .dpad-btn {
        width: 42px;
        height: 42px;
        font-size: 17px;
    }
    #btn-up { top: 0; left: 44px; }
    #btn-left { top: 44px; left: 0; }
    #btn-right { top: 44px; left: 88px; }
    #btn-down { top: 88px; left: 44px; }
}