/* SPDX-License-Identifier: AGPL-3.0-only */
/* ---------- Responsive ---------- */

@media (max-width: 900px) {
    .stage.has-spotlight {
        flex-direction: column;
    }

    .stage.has-spotlight .grid {
        flex: 0 0 110px;
        grid-template-rows: minmax(0, 1fr);
        grid-auto-flow: column;
        grid-auto-columns: 160px;
        grid-template-columns: none;
        overflow-x: auto;
        overflow-y: hidden;
    }

    /* The whiteboard on top, the tiles in a row below it. */
    .room-body:has(> .whiteboard:not([hidden])) {
        flex-direction: column;
        gap: 6px;
    }

    .whiteboard:not([hidden]) ~ .stage {
        flex: 0 0 110px;
    }

    .whiteboard:not([hidden]) ~ .stage .grid {
        grid-template-rows: minmax(0, 1fr);
        grid-auto-flow: column;
        grid-auto-columns: 160px;
        grid-template-columns: none;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .side-panel {
        position: fixed;
        inset: 0 0 var(--controls-h) 0;
        width: auto;
        border-radius: 0;
        z-index: 30;
    }
}

@media (max-width: 1000px) {
    .bar-clock,
    .bar-sep,
    .controls-left .bar-room {
        display: none;
    }

    .controls-left .invite-btn {
        width: 48px;
        height: 48px;
        padding: 0;
        border-radius: 50%;
        background: var(--surface-2);
    }

    .controls-left .invite-btn svg {
        width: 22px;
        height: 22px;
        color: inherit;
    }
}

/* Compact bar: data-overflow buttons live in the More menu (moved by controls.js). Keep in sync with COMPACT_QUERY. */
@media (max-width: 720px) {
    .room-controls {
        display: flex;
        justify-content: safe center;
        gap: 10px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .controls-group {
        display: contents;
    }

    .controls-left {
        display: none;
    }

    .controls-right > .ctrl-btn {
        order: 1;
    }

    .more-wrap {
        order: 2;
    }

    #btn-leave {
        order: 3;
    }

    .more-menu {
        position: fixed;
        inset-inline: auto 8px;
        bottom: calc(var(--controls-h) + env(safe-area-inset-bottom));
        min-width: 210px;
        transform: none;
    }
}

@media (max-width: 560px) {
    :root {
        --controls-h: 72px;
    }

    .room-controls {
        gap: 4px;
        padding: 0 6px env(safe-area-inset-bottom);
    }

    .ctrl-btn {
        flex-shrink: 0;
        width: 44px;
        height: 44px;
    }

    .ctrl-btn.danger {
        width: 56px;
    }

    .room-body {
        padding: 0 6px;
    }

    .room-info {
        gap: 8px;
    }

    .tag-text {
        display: none;
    }

    /* Tiles are narrow here, so role badges keep only their icon and the name gets the room (screen readers still get the text). */
    .tile-footer .host-tag {
        position: relative;
        width: 20px;
        padding: 0;
        font-size: 0;
    }

    /* Taken out of flow so the hidden text can't push the icon off-centre. */
    .tile-footer .host-tag::before {
        position: absolute;
        inset: 0;
        width: 12px;
        height: 12px;
        margin: auto;
    }

    .stage {
        gap: 6px;
    }

    .reaction-picker {
        gap: 2px;
    }

    .reaction-picker button {
        width: 38px;
        height: 38px;
        font-size: 22px;
    }
}
