html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #0d0d1a;
    color: rgba(255, 255, 255, 0.87);
    overscroll-behavior: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
    touch-action: none;
}

#app {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #0d0d1a;
}

#game-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container canvas {
    display: block;
    touch-action: none;
}

#touch-controls {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: none;
    z-index: 10;
}

.touch-cluster {
    position: absolute;
    bottom: max(16px, env(safe-area-inset-bottom));
    display: flex;
    gap: 14px;
    pointer-events: auto;
}

.touch-cluster-left {
    left: max(16px, env(safe-area-inset-left));
}

.touch-cluster-right {
    right: max(16px, env(safe-area-inset-right));
}

.touch-btn {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(180, 200, 220, 0.16);
    color: rgba(230, 240, 255, 0.78);
    border: 1px solid rgba(180, 200, 220, 0.35);
    font-size: 28px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    transition: background 80ms ease, transform 80ms ease;
}

.touch-btn:active,
.touch-btn.is-pressed {
    background: rgba(180, 220, 220, 0.34);
    transform: scale(0.96);
}

.touch-btn:focus {
    outline: none;
}

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

body.force-touch-controls #touch-controls {
    display: block;
}

@media (max-height: 380px) {
    .touch-btn {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
}
