#rotate-device {
    display: none;
}

@media (hover: none) and (orientation: portrait) {
    #rotate-device {
        display: flex;
        position: fixed;
        inset: 0;
        z-index: 9999;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 10%;
        background: rgba(0, 0, 0, 0.92);
        color: white;
        font-size: clamp(1.1rem, 5vw, 1.8rem);
        line-height: 1.6;
    }

    body > *:not(#rotate-device) {
        display: none !important;
    }
}

#touch-controls {
    display: none;
}

@media (hover: none) and (orientation: landscape) {
    #touch-controls {
        display: flex;
        position: fixed;
        inset: 0;
        justify-content: space-between;
        align-items: flex-end;
        padding: clamp(10px, 3vw, 26px);
        pointer-events: none;
        z-index: 6;
    }

    #joystick-base, .touch-btn {
        pointer-events: auto;
    }
}

#joystick-base {
    width: clamp(90px, 22vw, 130px);
    height: clamp(90px, 22vw, 130px);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.4);
    position: relative;
    touch-action: none;
}

#joystick-knob {
    width: 45%;
    height: 45%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.75);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#touch-actions {
    position: relative;
    width: clamp(150px, 32vw, 210px);
    height: clamp(150px, 32vw, 210px);
}

.touch-btn {
    position: absolute;
    transform: translate(-50%, -50%);
    width: clamp(50px, 13vw, 70px);
    height: clamp(50px, 13vw, 70px);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    background: rgba(13, 157, 216, 0.55);
    color: white;
    font-size: clamp(1.2rem, 5vw, 1.6rem);
    touch-action: none;
}

.touch-btn img {
    width: 80%;
}

#touch-bubble {
    top: 53%;
    left: 70%;
}

#touch-fin-slap {
    top: 90%;
    left: 85%;
}

#touch-poison {
    top: 89%;
    left: 42%;
}