/* Mobile registration only: one scroll owner, visual-viewport sizing, and a community shortcut. */
#register-modal .register-mobile-discord {
    display: none;
}

@media (max-width: 740px), (pointer: coarse) and (max-height: 600px) {
    html.meow-registration-open #meow-main-content {
        z-index: 10001 !important;
    }
    html.meow-registration-open .floating-buttons {
        visibility: hidden !important;
        pointer-events: none !important;
    }
    #register-modal.modal-overlay {
        top: var(--register-viewport-top, 0px);
        bottom: auto;
        height: 100vh;
        height: var(--register-viewport-height, 100dvh);
        padding: 0;
        align-items: stretch;
        overflow: hidden;
        touch-action: pan-y pinch-zoom;
    }

    html body #register-modal > .modal-container {
        flex: 1 1 auto;
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        min-height: 0;
        border-radius: 0;
        padding-top: env(safe-area-inset-top, 0px);
        padding-bottom: calc(140px + env(safe-area-inset-bottom, 0px));
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y pinch-zoom;
        scroll-padding-bottom: 140px;
        animation: none;
        transform: none;
    }

    #register-modal .register-mobile-discord {
        position: fixed;
        right: calc(14px + env(safe-area-inset-right, 0px));
        bottom: calc(20px + env(safe-area-inset-bottom, 0px));
        z-index: 20;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        border-radius: 50%;
        color: #fff;
        background: #5865f2;
        border: 1px solid rgba(255, 255, 255, .25);
        box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
        font-size: 24px;
        text-decoration: none;
        touch-action: manipulation;
    }
    #register-modal .register-mobile-discord:focus-visible {
        outline: 3px solid #e5b842;
        outline-offset: 3px;
    }
}
/* The existing chat redesign moves its button at the 640px breakpoint. */
@media (min-width: 641px) {
    #register-modal .register-mobile-discord {
        bottom: calc(100px + env(safe-area-inset-bottom, 0px));
    }
}
