/* Chat page refresh (2026-10-07).
   1. Light, playful polish that works on every screen size.
   2. Emoji picker: popover on desktop, bottom sheet on phones.
   3. Phones (max-width: 767px): FaceTime-style call layout with a chat drawer,
      picture-in-picture self-view and tap-to-swap.
   4. Tablets and desktops (min-width: 768px): the same call layout on a big stage. Chat is a
      side panel in landscape and a bottom drawer in portrait.
   5. Pre-call screen (before Start): one big self-view card, big Start video chat, pill filters.
   6. Camera / mic help: permission card, self-view chip, partner audio chip, tap to unmute.
   chat-ui.js only toggles classes; the <video> elements are never moved or re-created. */

:root {
    --ctl-row: 0px;
    --pop: #ff7a59;
    --pop-soft: #fff1ea;
    --sun-soft: #fff6db;
    --call-bg: #0e1116;
    --bar-h: 76px;
}

/* ---------- 1. Polish (all sizes) ---------- */

body.omeger .lobby .btn,
body.omeger .lobby .action-video,
body.omeger .chat-toggle,
body.omeger .emoji-toggle {
    transition: background-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, filter 0.15s ease;
}

body.omeger .lobby .btn:not([disabled]):hover {
    filter: brightness(1.05);
    box-shadow: 0 6px 16px rgba(28, 36, 48, 0.12);
}

body.omeger .lobby .btn:not([disabled]):active,
body.omeger .lobby .action-video:active,
body.omeger .chat-toggle:active,
body.omeger .emoji-toggle:not([disabled]):active {
    filter: brightness(0.95);
}

body.omeger .lobby .action-video {
    border-radius: 999px;
}

body.omeger .chat-body .remote-chat div,
body.omeger .chat-body .local-chat div {
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(28, 36, 48, 0.06);
}

body.omeger .chat-body .remote-chat div {
    border-bottom-left-radius: 6px;
}

body.omeger .chat-body .local-chat div {
    background: var(--pop-soft);
    border-bottom-right-radius: 6px;
}

/* Legacy style.css floats each own bubble right inside a non-floating row, so consecutive own
   messages lined up side by side in reverse order. One bubble per row, right-aligned. */
body.omeger .chat-body .local-chat {
    display: flow-root;
}

body.omeger .chat-body .local-chat div {
    float: none;
    margin-left: auto;
}

body.omeger .chat-body .remote-chat:has(.font-weight-bold) div {
    border-radius: 14px;
    background: #eef8f3;
}

body.omeger .chat-body .server-msg {
    word-break: break-word;
}

/* New message pops in. */
body.omeger .chat-body > div {
    animation: oc-pop 0.22s ease-out both;
}

/* A new match fades in. */
body.omeger .stage .has-video #remoteVideo {
    animation: oc-fade 0.45s ease-out both;
}

@keyframes oc-pop {
    from { opacity: 0; transform: translateY(6px) scale(0.97); }
    to { opacity: 1; transform: none; }
}

@keyframes oc-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes oc-wiggle {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-12deg); }
    75% { transform: rotate(12deg); }
}

/* Emoji button sits next to the message box. */
body.omeger .composer {
    position: relative;
}

body.omeger .emoji-toggle {
    flex: 0 0 auto;
    align-self: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    font-size: 1.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

body.omeger .emoji-toggle:not([disabled]):hover,
body.omeger .emoji-toggle[aria-expanded="true"] {
    background: var(--sun-soft);
    color: #b7791f;
    border-color: #ffe3a3;
}

body.omeger .emoji-toggle[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* The drawer button only exists in the phone call layout. */
body.omeger .chat-toggle {
    display: none;
}

/* ---------- 2. Emoji picker ---------- */

body.omeger .emoji-picker {
    position: absolute;
    left: 0;
    bottom: calc(100% + 10px);
    z-index: 20;
    width: 340px;
    max-width: calc(100vw - 32px);
    height: 310px;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 18px 48px rgba(28, 36, 48, 0.18);
    overflow: hidden;
    animation: oc-pop 0.16s ease-out both;
}

body.omeger .emoji-picker[hidden] {
    display: none;
}

body.omeger .emoji-picker .ep-search {
    flex: 0 0 auto;
    height: 38px;
    min-height: 0;
    line-height: 1.2;
    -webkit-appearance: none;
    appearance: none;
    margin: 10px 10px 6px;
    width: auto;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.95rem;
}

body.omeger .emoji-picker .ep-tabs {
    display: flex;
    gap: 2px;
    padding: 0 6px 6px;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    scrollbar-width: none;
}

body.omeger .emoji-picker .ep-tabs::-webkit-scrollbar {
    display: none;
}

body.omeger .emoji-picker .ep-tab {
    flex: 1 0 auto;
    min-width: 32px;
    height: 32px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    filter: grayscale(0.6);
    opacity: 0.75;
}

body.omeger .emoji-picker .ep-tab[aria-selected="true"] {
    background: var(--sun-soft);
    filter: none;
    opacity: 1;
}

body.omeger .emoji-picker .ep-grid {
    flex: 1;
    overflow-y: auto;
    padding: 6px 8px 10px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
    align-content: start;
    gap: 2px;
    overscroll-behavior: contain;
}

body.omeger .emoji-picker .ep-emoji {
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

body.omeger .emoji-picker .ep-emoji:hover,
body.omeger .emoji-picker .ep-emoji:focus-visible {
    background: var(--sun-soft);
    outline: none;
}

body.omeger .emoji-picker .ep-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--muted);
    padding: 24px 0;
    font-weight: 700;
}

body.omeger[data-theme="dark"] .emoji-picker,
body.omeger[data-theme="dark"] .emoji-toggle {
    background: #243140;
    border-color: #34465a;
    color: #f4f7fb;
}

/* ---------- 3. Phones ---------- */

@media (max-width: 767px) {
    /* iOS Safari zooms the page into any focused field smaller than 16px. In the fixed full-screen
       call layout that zoom never undoes itself and pushes the chat drawer and buttons off-screen. */
    body.omeger .lobby input,
    body.omeger .lobby select,
    body.omeger .lobby textarea,
    body.omeger .emoji-picker .ep-search {
        font-size: 16px;
    }

    /* Before a call, and in text chat, show the chat panel instead of empty video boxes. */
    body.omeger:not(.oc-call) .lobby .video-section {
        display: none !important;
    }

    /* Big, thumb-friendly Start buttons and tidy filters. */
    body.omeger:not(.oc-call) .lobby .toolbar > div:first-child {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
    }

    body.omeger:not(.oc-call) .lobby .toolbar > div:first-child .btn {
        flex: 1 1 0;
        min-height: 50px;
        font-size: 1rem;
    }

    body.omeger:not(.oc-call) .lobby .filters {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    body.omeger:not(.oc-call) .lobby .filters select {
        min-width: 0;
    }

    body.omeger .lobby .about.omeger-welcome {
        border: 0;
        background: transparent;
        padding: 18px 0 6px;
    }

    body.omeger:not(.oc-call) .lobby .chat-body {
        min-height: 45vh;
        min-height: 45dvh;
        max-height: 60vh;
        max-height: 60dvh;
    }

    /* Emoji picker as a bottom sheet. */
    body.omeger .emoji-picker {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        width: auto;
        max-width: none;
        height: min(46vh, 340px);
        height: min(46dvh, 340px);
        border-radius: 22px 22px 0 0;
        border-bottom: 0;
        padding-bottom: env(safe-area-inset-bottom);
        z-index: 60;
        animation: oc-sheet 0.22s ease-out both;
    }

    @keyframes oc-sheet {
        from { transform: translateY(100%); }
        to { transform: none; }
    }

    /* ----- Video call: full-screen stage ----- */
    body.omeger.oc-call {
        overflow: hidden;
    }

    body.omeger.oc-call .lobby {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 50;
        display: block;
        margin: 0;
        padding: 0;
        height: 100vh;
        height: 100dvh;
        /* chat-ui.js keeps --oc-vv-top/--oc-vv-h in sync with window.visualViewport, so the call
           screen shrinks to the area above the on-screen keyboard instead of hiding behind it. */
        top: var(--oc-vv-top, 0px);
        bottom: auto;
        height: var(--oc-vv-h, 100dvh);
        /* Makes the lobby the containing block for its position:fixed children (bars, drawer, PiP
           labels), so they all move with it. */
        transform: translateZ(0);
        background: var(--call-bg);
    }

    body.omeger.oc-call .lobby .stage.video-section {
        position: absolute !important;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: auto !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 0;
        box-shadow: none;
        background: var(--call-bg);
        display: block;
    }

    body.omeger.oc-call .lobby .remote-video-container,
    body.omeger.oc-call .lobby .local-video-container {
        position: absolute !important;
        margin: 0;
        padding: 0;
        min-height: 0;
        border: 0;
        transition: top 0.25s ease, right 0.25s ease, width 0.25s ease, height 0.25s ease, border-radius 0.25s ease;
    }

    /* The big one: partner by default, you when swapped. */
    body.omeger.oc-call .lobby .remote-video-container,
    body.omeger.oc-call .lobby.oc-swapped .local-video-container {
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: var(--call-bg);
        z-index: 1;
        cursor: default;
    }

    /* The small corner box: you by default, partner when swapped. */
    body.omeger.oc-call .lobby .local-video-container,
    body.omeger.oc-call .lobby.oc-swapped .remote-video-container {
        top: calc(env(safe-area-inset-top) + 12px) !important;
        right: calc(env(safe-area-inset-right) + 12px) !important;
        left: auto !important;
        bottom: auto !important;
        width: min(28vw, 128px) !important;
        height: min(37.3vw, 170px) !important;
        border: 2px solid rgba(255, 255, 255, 0.9);
        border-radius: 18px;
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
        background: #222a33;
        z-index: 3;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    body.omeger.oc-call .lobby .stage video {
        object-fit: cover;
        background: transparent;
    }

    body.omeger.oc-call .lobby .well-copy {
        display: none;
    }

    body.omeger.oc-call .lobby .stage .video-load-icon {
        position: absolute;
        top: 50%;
        left: 50%;
        margin: -14px 0 0 -14px;
        font-size: 28px;
        color: #fff;
        opacity: 0.6;
    }

    /* Partner name and flag, top-left. */
    body.omeger.oc-call .lobby .remote-user-info {
        position: fixed;
        top: calc(env(safe-area-inset-top) + 14px);
        left: calc(env(safe-area-inset-left) + 14px);
        margin: 0;
        padding: 6px 12px;
        border-radius: 999px;
        background: rgba(0, 0, 0, 0.45);
        color: #fff;
        font-size: 0.9rem;
        z-index: 4;
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

    body.omeger.oc-call .lobby .remote-user-info.hide {
        display: none;
    }

    body.omeger.oc-call .lobby .remote-user-info #partnerName {
        color: #fff;
    }

    /* Mic, camera and switch-camera: a row of round buttons right above the bottom bar, always
       visible (also with the chat drawer, the keyboard or the emoji sheet open: those sit above it).
       The row ignores taps; only the buttons take them, so taps never reach the corner box. */
    body.omeger.oc-call .lobby {
        --ctl-row: 56px;
    }

    body.omeger.oc-call .lobby .video-actions {
        position: fixed;
        left: calc(env(safe-area-inset-left) + 14px);
        right: auto;
        width: auto;
        bottom: calc(var(--bar-h) + env(safe-area-inset-bottom) + 6px);
        height: 44px;
        display: flex !important;
        align-items: center;
        gap: 10px;
        text-align: left;
        z-index: 8;
        pointer-events: none;
    }

    body.omeger.oc-call .lobby .action-video {
        pointer-events: auto;
        width: 44px;
        height: 44px;
        flex: 0 0 auto;
        margin: 0;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 0;
        border-radius: 999px;
        font-size: 17px;
        color: #fff;
        background: rgba(0, 0, 0, 0.45);
        -webkit-backdrop-filter: blur(6px);
        backdrop-filter: blur(6px);
    }

    body.omeger.oc-call .lobby .action-video:hover {
        background: rgba(0, 0, 0, 0.6);
        color: #fff;
    }

    body.omeger.oc-call .lobby .action-video.hide {
        display: none;
    }

    /* Report sits at the bottom right, in the same row. */
    body.omeger.oc-call .lobby .report {
        position: fixed;
        top: auto;
        left: auto;
        right: calc(env(safe-area-inset-right) + 14px);
        bottom: calc(var(--bar-h) + env(safe-area-inset-bottom) + 6px);
        margin: 0;
        z-index: 8;
    }

    body.omeger.oc-call .lobby .report.hide {
        display: none;
    }

    /* ----- Bottom bar: chat button, Stop, Next ----- */
    body.omeger.oc-call .lobby .chat-main {
        position: static !important;
        padding: 0;
        background: transparent;
        box-shadow: none;
    }

    body.omeger.oc-call .lobby .toolbar {
        position: fixed !important;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 7;
        min-height: calc(var(--bar-h) + env(safe-area-inset-bottom));
        padding: 14px calc(env(safe-area-inset-right) + 14px) calc(env(safe-area-inset-bottom) + 14px) calc(env(safe-area-inset-left) + 14px);
        background: linear-gradient(180deg, rgba(14, 17, 22, 0), rgba(14, 17, 22, 0.7));
        justify-content: center;
        flex-wrap: nowrap;
    }

    body.omeger.oc-call .lobby .toolbar > div:first-child {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
    }

    body.omeger.oc-call .lobby .toolbar .filters {
        display: none;
    }

    body.omeger.oc-call .lobby #stop,
    body.omeger.oc-call .lobby #next {
        min-width: 96px;
        min-height: 48px;
        font-size: 1rem;
    }

    body.omeger.oc-call .lobby #stop {
        background: #ff5a5f;
    }

    body.omeger.oc-call .lobby #next {
        background: #fff;
        color: var(--green);
        border-color: #fff;
    }

    body.omeger.oc-call .chat-toggle {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        flex: 0 0 auto;
        border: 0;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.92);
        color: var(--ink);
        font-size: 1.2rem;
        cursor: pointer;
        padding: 0;
    }

    body.omeger.oc-drawer-open .chat-toggle {
        background: var(--sun);
    }

    body.omeger .chat-toggle .unread-dot {
        position: absolute;
        top: 6px;
        right: 6px;
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background: var(--pop);
        border: 2px solid #fff;
    }

    body.omeger .chat-toggle .unread-dot[hidden] {
        display: none;
    }

    body.omeger .chat-toggle.has-unread i {
        animation: oc-wiggle 0.4s ease-in-out 2;
    }

    /* ----- Chat drawer ----- */
    body.omeger.oc-call .lobby .chat-area {
        position: fixed !important;
        left: calc(env(safe-area-inset-left) + 8px) !important;
        right: calc(env(safe-area-inset-right) + 8px) !important;
        top: auto !important;
        bottom: calc(var(--bar-h) + var(--ctl-row) + env(safe-area-inset-bottom)) !important;
        width: auto !important;
        z-index: 6;
        padding: 10px;
        border-radius: 22px;
        background: rgba(255, 255, 255, 0.97);
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.3);
        transform: translateY(calc(100% + var(--bar-h) + var(--ctl-row) + 40px));
        opacity: 0;
        visibility: hidden;
        transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s ease, visibility 0s linear 0.28s;
    }

    body.omeger.oc-call.oc-drawer-open .lobby .chat-area {
        transform: none;
        opacity: 1;
        visibility: visible;
        transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s ease, visibility 0s;
    }

    body.omeger.oc-call .lobby .chat-panel {
        min-height: 0;
        padding: 0;
        background: transparent;
    }

    body.omeger.oc-call .lobby .chat-body {
        min-height: 96px;
        max-height: calc(42vh - 70px);
        max-height: calc(var(--oc-vv-h, 100dvh) * 0.42 - 70px);
    }

    /* Short screens (landscape phones): keep the messages usable above the two control rows. */
    @media (max-height: 480px) {
        body.omeger.oc-call .lobby .chat-body {
            min-height: 48px;
            max-height: calc(var(--oc-vv-h, 100dvh) - var(--bar-h) - var(--ctl-row) - 130px);
        }
    }

    /* Keyboard up: the visible area is short, so give the messages what's left above the bar. */
    body.omeger.oc-call.oc-kb .lobby .chat-body {
        min-height: 72px;
        min-height: 48px;
        max-height: calc(var(--oc-vv-h, 100dvh) - var(--bar-h) - var(--ctl-row) - 130px);
    }

    /* Keyboard up: the controls stay; only Report steps aside. */
    body.omeger.oc-call.oc-kb .lobby .report {
        visibility: hidden;
    }

    body.omeger[data-theme="dark"].oc-call .lobby .chat-area {
        background: rgba(36, 49, 64, 0.97);
    }

    /* In a call the emoji sheet opens just above the message box, so the box and Send stay visible
       and tappable (it used to cover the whole drawer, input included). */
    body.omeger.oc-call .emoji-picker {
        position: absolute;
        left: 0;
        right: 0;
        top: auto;
        bottom: calc(100% + 8px);
        width: auto;
        height: 260px;
        height: min(260px, calc(var(--oc-vv-h, 100dvh) - var(--bar-h) - var(--ctl-row) - 150px));
        padding-bottom: 0;
        border-radius: 20px;
        border-bottom: 1px solid var(--line);
        z-index: 8;
        animation: oc-pop 0.16s ease-out both;
    }
}

/* ---------- 4. Tablets and desktops ---------- */

@media (min-width: 768px) {
    body.omeger.oc-call {
        overflow: hidden;
    }

    body.omeger.oc-call .lobby {
        --oc-gap: 16px;
        --oc-panel: clamp(320px, 28vw, 400px);
        --oc-right: var(--oc-gap);
        --oc-ctl: 52px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 50;
        display: block;
        width: auto;
        max-width: none;
        margin: 0;
        padding: 0;
        height: 100vh;
        height: 100dvh;
        background: radial-gradient(120% 90% at 15% 0%, #1d2633 0%, var(--call-bg) 60%);
        /* Containing block for the position:fixed bars and panel below. */
        transform: translateZ(0);
        animation: oc-fade 0.25s ease-out both;
    }

    /* ----- Stage: the partner fills it ----- */
    body.omeger.oc-call .lobby .stage.video-section {
        position: absolute !important;
        top: calc(var(--oc-gap) + env(safe-area-inset-top));
        left: calc(var(--oc-gap) + env(safe-area-inset-left));
        bottom: calc(var(--oc-gap) + env(safe-area-inset-bottom));
        right: calc(var(--oc-right) + env(safe-area-inset-right));
        width: auto !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        display: block;
        border-radius: 28px;
        overflow: hidden;
        background: #05070a;
        box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
        transition: right 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    }

    body.omeger.oc-call .lobby .remote-video-container,
    body.omeger.oc-call .lobby .local-video-container {
        position: absolute !important;
        margin: 0;
        padding: 0;
        min-height: 0;
        border: 0;
        transition: top 0.3s ease, right 0.3s ease, width 0.3s ease, height 0.3s ease, border-radius 0.3s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    }

    /* The big one: partner by default, you when swapped. */
    body.omeger.oc-call .lobby .remote-video-container,
    body.omeger.oc-call .lobby.oc-swapped .local-video-container {
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: #05070a;
        z-index: 1;
        cursor: default;
    }

    /* The small corner box: you by default, partner when swapped. Click it to swap. */
    body.omeger.oc-call .lobby .local-video-container,
    body.omeger.oc-call .lobby.oc-swapped .remote-video-container {
        top: 16px !important;
        right: 16px !important;
        left: auto !important;
        bottom: auto !important;
        width: clamp(150px, 17vw, 260px) !important;
        height: calc(clamp(150px, 17vw, 260px) * 0.75) !important;
        border: 3px solid rgba(255, 255, 255, 0.92);
        border-radius: 20px;
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
        background: #222a33;
        z-index: 3;
        cursor: pointer;
    }

    /* Hover feedback without transform: a transform here would make the corner box the containing
       block for the fixed controls inside the wells and pull them into it. */
    body.omeger.oc-call .lobby:not(.oc-swapped) .local-video-container:hover,
    body.omeger.oc-call .lobby.oc-swapped .remote-video-container:hover {
        border-color: var(--sun);
        box-shadow: 0 0 0 4px rgba(255, 209, 102, 0.35), 0 16px 40px rgba(0, 0, 0, 0.55);
    }

    body.omeger.oc-call .lobby .stage video {
        object-fit: cover;
        background: transparent;
    }

    body.omeger.oc-call .lobby .well-copy {
        display: none;
    }

    body.omeger.oc-call .lobby .stage .video-load-icon {
        position: absolute;
        top: 50%;
        left: 50%;
        margin: -16px 0 0 -16px;
        font-size: 32px;
        color: #fff;
        opacity: 0.5;
    }

    /* Partner name and flag, top-left of the stage. */
    body.omeger.oc-call .lobby .remote-user-info {
        position: fixed;
        top: calc(var(--oc-gap) + env(safe-area-inset-top) + 16px);
        left: calc(var(--oc-gap) + env(safe-area-inset-left) + 16px);
        margin: 0;
        padding: 7px 14px;
        border-radius: 999px;
        background: rgba(0, 0, 0, 0.45);
        -webkit-backdrop-filter: blur(8px);
        backdrop-filter: blur(8px);
        color: #fff;
        font-size: 0.95rem;
        font-weight: 700;
        z-index: 4;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        animation: oc-pop 0.25s ease-out both;
    }

    body.omeger.oc-call .lobby .remote-user-info.hide {
        display: none;
    }

    body.omeger.oc-call .lobby .remote-user-info #partnerName {
        color: #fff;
    }

    /* ----- Floating controls along the bottom of the stage ----- */
    /* Mic, camera, switch camera: bottom-left, in the same row as chat / Stop / Next. */
    body.omeger.oc-call .lobby .video-actions {
        position: fixed;
        left: calc(var(--oc-gap) + env(safe-area-inset-left) + 18px);
        right: auto;
        top: auto;
        bottom: calc(var(--oc-gap) + env(safe-area-inset-bottom) + 18px);
        width: auto;
        height: var(--oc-ctl);
        display: flex !important;
        align-items: center;
        gap: 10px;
        /* Above the chat panel/drawer (6) and the toolbar (7): never dimmed or covered. */
        z-index: 8;
        pointer-events: none;
    }

    body.omeger.oc-call .lobby .action-video {
        pointer-events: auto;
        width: var(--oc-ctl);
        height: var(--oc-ctl);
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 999px;
        font-size: 18px;
        color: #fff;
        background: rgba(255, 255, 255, 0.16);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition: background-color 0.15s ease, transform 0.15s ease;
    }

    body.omeger.oc-call .lobby .action-video.hide {
        display: none;
    }

    body.omeger.oc-call .lobby .action-video:hover {
        background: rgba(255, 255, 255, 0.28);
        color: #fff;
        transform: translateY(-2px);
    }

    body.omeger.oc-call .lobby .action-video.video-on,
    body.omeger.oc-call .lobby .action-video.audio-unmute {
        background: #ff5a5f;
    }

    /* Report: bottom-right of the stage. */
    body.omeger.oc-call .lobby .report {
        position: fixed;
        top: auto;
        left: auto;
        right: calc(var(--oc-right) + env(safe-area-inset-right) + 18px);
        bottom: calc(var(--oc-gap) + env(safe-area-inset-bottom) + 18px);
        margin: 0;
        z-index: 8;
        transition: right 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.15s ease, transform 0.15s ease;
    }

    body.omeger.oc-call .lobby .report:hover {
        background: rgba(255, 90, 95, 0.85);
    }

    body.omeger.oc-call .lobby .report.hide {
        display: none;
    }

    /* Chat button, Stop, Next: centred under the partner. */
    body.omeger.oc-call .lobby .chat-main {
        position: static !important;
        padding: 0;
        margin: 0;
        background: transparent;
        box-shadow: none;
        border: 0;
    }

    body.omeger.oc-call .lobby .toolbar {
        position: fixed !important;
        top: auto !important;
        left: calc(var(--oc-gap) + env(safe-area-inset-left));
        right: calc(var(--oc-right) + env(safe-area-inset-right));
        bottom: calc(var(--oc-gap) + env(safe-area-inset-bottom) + 18px);
        z-index: 7;
        margin: 0;
        padding: 0;
        min-height: var(--oc-ctl);
        background: transparent;
        justify-content: center;
        flex-wrap: nowrap;
        pointer-events: none;
        /* Centred under the partner, but never over the camera/mic buttons on the left: on a narrow
           stage (1024px with the chat open, 768px portrait) this nudges the group right just enough.
           432px = room for the left buttons on both sides, 316px = chat button + Stop + Next. */
        padding-left: max(0px, calc(748px - 100vw + var(--oc-gap) + var(--oc-right) + env(safe-area-inset-left) + env(safe-area-inset-right)));
        transition: right 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), padding-left 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    }

    body.omeger.oc-call .lobby .toolbar > div:first-child {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        pointer-events: none;
    }

    body.omeger.oc-call .lobby .toolbar button {
        pointer-events: auto;
    }

    body.omeger.oc-call .lobby .toolbar .filters,
    body.omeger.oc-call .lobby #partnerCountryText {
        display: none !important;
    }

    body.omeger.oc-call .lobby #stop,
    body.omeger.oc-call .lobby #next {
        min-width: 120px;
        min-height: var(--oc-ctl);
        border-radius: 999px;
        font-size: 1.02rem;
        box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
        transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
    }

    body.omeger.oc-call .lobby #stop:not([disabled]):hover,
    body.omeger.oc-call .lobby #next:not([disabled]):hover {
        transform: translateY(-2px);
    }

    body.omeger.oc-call .lobby #stop {
        background: #ff5a5f;
        border-color: #ff5a5f;
        color: #fff;
    }

    body.omeger.oc-call .lobby #next {
        background: #fff;
        color: var(--green);
        border-color: #fff;
    }

    body.omeger.oc-call .lobby #next[disabled] {
        opacity: 0.7;
    }

    body.omeger.oc-call .chat-toggle {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: var(--oc-ctl);
        height: var(--oc-ctl);
        flex: 0 0 auto;
        border: 0;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.92);
        color: var(--ink);
        font-size: 1.25rem;
        cursor: pointer;
        padding: 0;
        box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
        transition: transform 0.15s ease, background-color 0.15s ease;
    }

    body.omeger.oc-call .chat-toggle:hover {
        transform: translateY(-2px);
    }

    body.omeger.oc-drawer-open .chat-toggle {
        background: var(--sun);
    }

    body.omeger .chat-toggle .unread-dot {
        position: absolute;
        top: 7px;
        right: 7px;
        width: 13px;
        height: 13px;
        border-radius: 50%;
        background: var(--pop);
        border: 2px solid #fff;
    }

    body.omeger .chat-toggle .unread-dot[hidden] {
        display: none;
    }

    body.omeger .chat-toggle.has-unread i {
        animation: oc-wiggle 0.4s ease-in-out 2;
    }

    /* ----- Chat panel ----- */
    body.omeger.oc-call .lobby .chat-area {
        position: fixed !important;
        z-index: 6;
        display: flex;
        flex-direction: column;
        padding: 14px;
        border-radius: 24px;
        background: rgba(255, 255, 255, 0.97);
        box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s ease, visibility 0s linear 0.3s;
    }

    body.omeger.oc-call.oc-drawer-open .lobby .chat-area {
        transform: none;
        opacity: 1;
        visibility: visible;
        transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s ease, visibility 0s;
    }

    body.omeger.oc-call .lobby .chat-area .welcome {
        display: none !important;
    }

    body.omeger.oc-call .lobby .chat-panel {
        flex: 1 1 auto;
        min-height: 0;
        padding: 0;
        background: transparent;
        display: flex !important;
        flex-direction: column;
    }

    body.omeger.oc-call .lobby .chat-box {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    body.omeger.oc-call .lobby .chat-body {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        height: auto;
        overflow-y: auto;
    }

    body.omeger[data-theme="dark"].oc-call .lobby .chat-area {
        background: rgba(36, 49, 64, 0.97);
    }

    /* Emoji popover opens above the message box, inside the panel. */
    body.omeger.oc-call .emoji-picker {
        left: 0;
        right: 0;
        width: auto;
        max-width: none;
        height: min(300px, 50vh);
        z-index: 8;
    }
}

/* Landscape tablets and desktops: chat is a panel on the right; the stage makes room for it. */
@media (min-width: 768px) and (orientation: landscape) and (min-height: 501px) {
    body.omeger.oc-call.oc-drawer-open .lobby {
        --oc-right: calc(var(--oc-gap) * 2 + var(--oc-panel));
    }

    body.omeger.oc-call .lobby .chat-area {
        top: calc(var(--oc-gap) + env(safe-area-inset-top)) !important;
        right: calc(var(--oc-gap) + env(safe-area-inset-right)) !important;
        bottom: calc(var(--oc-gap) + env(safe-area-inset-bottom)) !important;
        left: auto !important;
        width: var(--oc-panel) !important;
        height: auto !important;
        transform: translateX(calc(100% + var(--oc-gap) * 2));
    }
}

/* Landscape phones (wide but short): the stage keeps its full width so every control fits in one
   row; chat opens as an overlay on the right, above the control row. */
@media (min-width: 768px) and (orientation: landscape) and (max-height: 500px) {
    body.omeger.oc-call .lobby {
        --oc-gap: 10px;
        --oc-ctl: 46px;
    }

    body.omeger.oc-call .lobby .chat-area {
        top: calc(var(--oc-gap) + env(safe-area-inset-top) + 8px) !important;
        right: calc(var(--oc-gap) + env(safe-area-inset-right) + 8px) !important;
        bottom: calc(var(--oc-gap) + env(safe-area-inset-bottom) + 18px + var(--oc-ctl) + 10px) !important;
        left: auto !important;
        width: min(340px, 44vw) !important;
        height: auto !important;
        padding: 10px;
        transform: translateX(calc(100% + 40px));
    }
}

/* Portrait tablets: chat is a drawer at the bottom of the stage, above the controls. */
@media (min-width: 768px) and (orientation: portrait) {
    body.omeger.oc-call .lobby .chat-area {
        top: auto !important;
        left: calc(var(--oc-gap) + 14px) !important;
        right: calc(var(--oc-gap) + 14px) !important;
        bottom: calc(var(--oc-gap) + env(safe-area-inset-bottom) + 18px + var(--oc-ctl) + 14px) !important;
        width: auto !important;
        height: min(42vh, 440px) !important;
        transform: translateY(calc(100% + var(--oc-ctl) + 60px));
    }
}

@media (prefers-reduced-motion: reduce) {
    body.omeger .chat-body > div,
    body.omeger .stage .has-video #remoteVideo,
    body.omeger .emoji-picker,
    body.omeger .chat-toggle.has-unread i {
        animation: none !important;
    }

    body.omeger.oc-call .lobby,
    body.omeger.oc-call .lobby .remote-user-info {
        animation: none !important;
    }

    body.omeger.oc-call .lobby .chat-area,
    body.omeger.oc-call .lobby .stage.video-section,
    body.omeger.oc-call .lobby .toolbar,
    body.omeger.oc-call .lobby .report,
    body.omeger.oc-call .lobby .remote-video-container,
    body.omeger.oc-call .lobby .local-video-container {
        transition: none !important;
    }
}

/* ---------- 5. Pre-call screen (2026-10-07, before Start) ----------
   body.oc-precall is set by chat-ui.js while nothing has started (see syncPrecall).
   One big self-view card (a playful placeholder until the camera turns on), a big
   "Start video chat" button, "Start text chat" as the secondary, pill filters and the footer at
   the bottom of the screen. Everything is scoped to .oc-precall, so text chat and the call
   layouts above are untouched. The camera does not open until Start is pressed. */

/* Pre-call-only pieces stay hidden in every other state. */
body.omeger .precall-hero,
body.omeger .pc-badge,
body.omeger .precall-intro,
body.omeger .precall-steps {
    display: none;
}

body.omeger .lobby .pc-ico {
    margin-right: 8px;
}

/* Live count as a small pill, chat page only. */
body.omeger .topbar .live {
    white-space: nowrap;
    background: rgba(31, 157, 98, 0.12);
    color: #178a54;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 0.86rem;
}

body.omeger .topbar .live .dot {
    width: 7px;
    height: 7px;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}

body.omeger .topbar .nav .btn {
    white-space: nowrap;
}

/* Footer: centred, and the phone language picker lives here. */
body.omeger footer.footer {
    justify-content: center;
    text-align: center;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 0;
    padding-top: 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

body.omeger footer.footer a {
    margin: 0 7px;
}

body.omeger footer.footer p {
    margin: 4px 0 0;
    font-size: 0.82rem;
}

@media (max-width: 520px) {
    body.omeger .topbar {
        padding: 9px 12px;
        gap: 8px;
        flex-wrap: nowrap;
    }

    body.omeger .topbar .brand {
        font-size: 1.2rem;
        gap: 7px;
    }

    body.omeger .topbar .brand svg {
        width: 28px;
        height: 28px;
    }

    body.omeger .topbar .nav {
        flex-wrap: nowrap;
        gap: 10px;
    }

    body.omeger .topbar .live {
        font-size: 0.78rem;
        padding: 3px 9px;
    }

    body.omeger .topbar .live .approx,
    body.omeger .topbar .nav > .dropdown:has(#languageDropdown) {
        display: none;
    }

    body.omeger .topbar .dark-theme-setting {
        width: 28px;
    }

    body.omeger .topbar .nav a.quiet {
        font-size: 0.92rem;
    }

    body.omeger .topbar .nav a.btn {
        padding: 8px 13px;
        font-size: 0.92rem;
    }

    /* Links on one line; "18+ only." and the language picker on the next. */
    body.omeger footer.footer {
        gap: 4px 0;
        padding: 9px 10px calc(9px + env(safe-area-inset-bottom));
        font-size: 0.82rem;
    }

    body.omeger footer.footer > div:first-child {
        display: contents;
    }

    body.omeger footer.footer::after {
        content: "";
        flex-basis: 100%;
        order: 1;
    }

    body.omeger footer.footer a {
        margin: 0 6px;
    }

    body.omeger footer.footer p,
    body.omeger footer.footer .footer-lang {
        order: 2;
        margin: 0 8px;
    }

    body.omeger footer.footer .footer-lang {
        display: inline-block !important;
    }

    body.omeger footer.footer .footer-lang > a {
        margin: 0;
        font-size: 0.85rem;
    }

    body.omeger footer.footer .footer-lang .dropdown-menu {
        left: 50% !important;
        transform: translateX(-50%) !important;
        top: auto !important;
        bottom: 100% !important;
    }
}

@media (max-width: 400px) {
    body.omeger .topbar {
        padding: 8px 10px;
        gap: 6px;
    }

    body.omeger .topbar .brand {
        font-size: 1.08rem;
    }

    body.omeger .topbar .nav {
        gap: 7px;
    }

    body.omeger .topbar .nav a.btn {
        padding: 7px 11px;
    }
}

/* ----- Page frame: header, the lobby filling the space, footer at the bottom ----- */
body.omeger.oc-precall #app {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

body.omeger.oc-precall #app > main {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

body.omeger.oc-precall .dashboard {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

body.omeger.oc-precall .lobby {
    flex: 1 0 auto;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 16px 16px 8px;
}

/* ----- The self-view card ----- */
body.omeger.oc-precall .lobby .stage.video-section {
    display: flex !important;
    order: 0;
    width: 100%;
    max-width: 420px;
    padding: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

body.omeger.oc-precall .lobby .remote-video-container {
    display: none !important;
}

body.omeger.oc-precall .lobby .local-video-container {
    width: 100% !important;
    aspect-ratio: 3 / 4;
    height: auto !important;
    min-height: 260px;
    max-height: min(calc(100vh - 460px), 560px);
    max-height: min(calc(100dvh - 460px), 560px);
    margin: 0 auto;
    border: 1px solid var(--line);
    border-radius: 24px;
    background:
        radial-gradient(420px 300px at 85% 10%, rgba(255, 209, 102, 0.55), transparent 60%),
        radial-gradient(420px 320px at 10% 95%, rgba(255, 122, 89, 0.25), transparent 60%),
        linear-gradient(160deg, #e3f5ea 0%, #f3fbf6 55%, #fff4dc 100%);
    box-shadow: 0 18px 40px rgba(28, 36, 48, 0.12);
    display: grid;
    place-items: center;
    cursor: default;
}

body.omeger.oc-precall .lobby .local-video-container .well-copy,
body.omeger.oc-precall .lobby .local-video-container .video-load-icon,
body.omeger.oc-precall .lobby .video-actions {
    display: none !important;
}

body.omeger.oc-precall .lobby .local-video-container video {
    opacity: 0;
    pointer-events: none;
}

body.omeger.oc-precall .precall-hero {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 3;
    text-align: center;
}

body.omeger.oc-precall .precall-hero .pc-face,
body.omeger.oc-precall .precall-hero .pc-title,
body.omeger.oc-precall .precall-hero .pc-sub {
    position: relative;
    z-index: 1;
}

body.omeger.oc-precall .precall-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

body.omeger .pc-face {
    width: 96px;
    height: 96px;
    border-radius: 28px;
    background: linear-gradient(145deg, var(--coral), #ff9a7a);
    display: grid;
    place-items: center;
    font-size: 48px;
    line-height: 1;
    margin: 0 auto 14px;
    box-shadow: 0 12px 28px rgba(255, 122, 89, 0.35);
    animation: oc-wave 2.4s ease-in-out 0.6s infinite;
    transform-origin: 70% 80%;
}

@keyframes oc-wave {
    0%, 60%, 100% { transform: rotate(0); }
    10%, 30% { transform: rotate(-8deg); }
    20%, 40% { transform: rotate(8deg); }
}

body.omeger .pc-title {
    display: block;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--ink);
    margin: 0 0 6px;
}

body.omeger .pc-sub {
    display: block;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--muted);
}

body.omeger .pc-sub-starting,
body.omeger.oc-starting .pc-sub-idle {
    display: none;
}

body.omeger.oc-starting .pc-sub-starting {
    display: block;
}

/* Start tapped while the socket is still connecting (home.js waitForSocket). */
body.omeger .pc-sub-connecting,
body.omeger.oc-connecting .pc-sub-idle {
    display: none;
}

body.omeger.oc-connecting:not(.oc-starting) .pc-sub-connecting {
    display: block;
}

body.omeger.oc-connecting #video,
body.omeger.oc-connecting #text {
    cursor: progress;
}

body.omeger .pc-float {
    position: absolute;
    font-size: 26px;
    opacity: 0.6;
    z-index: 0;
}

body.omeger .pc-f1 { top: 9%; left: 10%; transform: rotate(-12deg); }
body.omeger .pc-f2 { top: 14%; right: 16%; font-size: 22px; transform: rotate(10deg); }
body.omeger .pc-f3 { bottom: 17%; left: 13%; font-size: 22px; transform: rotate(8deg); }
body.omeger .pc-f4 { bottom: 11%; right: 11%; transform: rotate(-8deg); }

body.omeger.oc-precall .pc-badge {
    display: inline-block;
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 4;
    background: rgba(28, 36, 48, 0.5);
    color: #fff;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 5px 10px;
    border-radius: 999px;
}

/* ----- Controls ----- */
body.omeger.oc-precall .lobby .chat-main {
    order: 1;
    width: 100%;
    max-width: 420px;
    padding: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

body.omeger.oc-precall .precall-intro {
    display: block;
    text-align: center;
}

body.omeger.oc-precall .pc-heading {
    margin: 2px 0 0;
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--ink);
}

body.omeger.oc-precall .pc-tagline {
    display: none;
    margin: 6px 0 0;
    color: var(--muted);
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.45;
}

body.omeger.oc-precall .lobby .toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin: 0;
    padding: 0;
    border: 0;
}

body.omeger.oc-precall .lobby .toolbar > div:first-child {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    width: 100%;
}

body.omeger.oc-precall .lobby .toolbar #video,
body.omeger.oc-precall .lobby .toolbar #text {
    width: 100%;
    flex: 0 0 auto !important;
    margin: 0;
    white-space: nowrap;
}

/* Video is the main action: first, big and green. Text is the outlined secondary. */
body.omeger.oc-precall .lobby .toolbar #video {
    order: -1;
    min-height: 58px;
    border: 0;
    border-radius: 18px;
    background: linear-gradient(180deg, #24b06f 0%, var(--green) 100%);
    color: #fff;
    font-size: 1.15rem;
    box-shadow: 0 10px 24px rgba(31, 157, 98, 0.35);
}

body.omeger.oc-precall .lobby .toolbar #text {
    min-height: 50px;
    border: 2px solid var(--green);
    border-radius: 16px;
    background: transparent;
    color: #178a54;
    font-size: 1rem;
}

/* No video chat on this site: text is the only (and so the main) button. */
body.omeger.oc-precall .lobby .text-chat-panel .toolbar #text {
    min-height: 58px;
    background: linear-gradient(180deg, #24b06f 0%, var(--green) 100%);
    color: #fff;
    border: 0;
}

body.omeger.oc-precall .lobby .filters {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

body.omeger.oc-precall .lobby .filters label {
    flex: 0 0 auto;
    width: auto;
}

body.omeger.oc-precall .lobby .filters select {
    -webkit-appearance: none;
    appearance: none;
    width: auto !important;
    min-width: 0;
    max-width: 170px;
    text-overflow: ellipsis;
    height: auto;
    border: 1px solid var(--line);
    border-radius: 999px;
    background-color: var(--card);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%235c6b7a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding: 8px 30px 8px 14px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--ink);
    box-shadow: none;
    cursor: pointer;
}

body.omeger.oc-precall .lobby .chat-area {
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
    min-height: 0;
}

body.omeger.oc-precall .lobby .about.omeger-welcome {
    border: 0;
    background: transparent;
    padding: 2px 0 0;
    margin: 0;
}

body.omeger.oc-precall .welcome .chat-hint {
    font-size: 0.95rem;
    font-weight: 700;
}

/* Nothing to chat about yet. */
body.omeger.oc-precall .lobby #chat {
    display: none !important;
}

body.omeger.oc-precall .precall-steps {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

body.omeger.oc-precall .precall-steps li {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px 8px;
    text-align: center;
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--ink);
}

body.omeger.oc-precall .precall-steps li span {
    display: block;
    font-size: 24px;
    margin-bottom: 4px;
}

/* While the camera permission prompt is up, the buttons are hidden by home.js; keep the filters too. */
body.omeger.oc-starting .lobby .filters {
    opacity: 0.6;
}

/* ----- Two columns: tablets and desktops ----- */
@media (min-width: 820px) {
    body.omeger.oc-precall .lobby {
        flex-direction: row;
        align-items: stretch;
        gap: 28px;
        padding: 24px 32px 12px;
    }

    body.omeger.oc-precall .lobby .stage.video-section {
        flex: 1.1 1 0;
        max-width: none;
        align-items: stretch;
    }

    body.omeger.oc-precall .lobby .local-video-container {
        aspect-ratio: auto;
        min-height: 440px;
        max-height: none;
        height: auto !important;
    }

    body.omeger.oc-precall .lobby .chat-main {
        flex: 0.9 1 0;
        max-width: 440px;
        justify-content: center;
    }

    body.omeger.oc-precall .precall-intro {
        text-align: left;
    }

    body.omeger.oc-precall .pc-heading {
        font-size: 2.1rem;
        line-height: 1.15;
    }

    body.omeger.oc-precall .pc-tagline {
        display: block;
    }

    body.omeger.oc-precall .lobby .filters {
        justify-content: flex-start;
    }

    body.omeger.oc-precall .welcome .chat-hint {
        text-align: left;
    }

    body.omeger.oc-precall .precall-steps {
        display: grid;
    }
}

/* Tall portrait tablets (e.g. iPad 820x1180): side by side would make the card a narrow ribbon,
   so stack it: the card takes the height that's left above the controls. */
@media (min-width: 820px) and (max-aspect-ratio: 3/4) {
    body.omeger.oc-precall .lobby {
        flex-direction: column;
        align-items: center;
        gap: 18px;
        padding: 24px 32px 16px;
    }

    body.omeger.oc-precall .lobby .stage.video-section {
        flex: 1 1 auto;
        width: 100%;
        max-width: 600px;
        min-height: 380px;
    }

    body.omeger.oc-precall .lobby .local-video-container {
        min-height: 380px;
    }

    body.omeger.oc-precall .lobby .chat-main {
        flex: 0 0 auto;
        width: 100%;
        max-width: 600px;
    }

    body.omeger.oc-precall .precall-intro,
    body.omeger.oc-precall .welcome .chat-hint {
        text-align: center;
    }

    body.omeger.oc-precall .lobby .filters {
        justify-content: center;
    }

    body.omeger.oc-precall .lobby .toolbar > div:first-child {
        flex-direction: row;
    }

    body.omeger.oc-precall .lobby .toolbar #video,
    body.omeger.oc-precall .lobby .toolbar #text {
        flex: 1 1 0 !important;
        width: auto;
        min-height: 58px;
    }

    body.omeger.oc-precall .lobby .toolbar #video {
        flex-grow: 1.4 !important;
    }
}

/* ----- Dark theme, pre-call only. The toggle sets data-theme on <html>; the older
   body[data-theme] rules never matched, so the rest of the chat page stays light as before. ----- */
html[data-theme="dark"] body.omeger.oc-precall {
    --ink: #f4f7fb;
    --muted: #a7b4c2;
    --line: #334155;
    --card: #243140;
    background:
        radial-gradient(900px 420px at 100% -10%, rgba(255, 209, 102, 0.1), transparent 55%),
        radial-gradient(700px 380px at -10% 0%, rgba(31, 157, 98, 0.16), transparent 50%),
        #1b2430;
    color: var(--ink);
}

html[data-theme="dark"] body.omeger.oc-precall header.topbar,
html[data-theme="dark"] body.omeger.oc-precall footer.footer {
    background: rgba(36, 49, 64, 0.92);
    color: var(--muted);
}

html[data-theme="dark"] body.omeger.oc-precall .nav a.quiet,
html[data-theme="dark"] body.omeger.oc-precall .nav .dropdown-toggle,
html[data-theme="dark"] body.omeger.oc-precall .dark-theme-setting {
    color: var(--ink);
}

html[data-theme="dark"] body.omeger.oc-precall .topbar .live {
    background: rgba(31, 157, 98, 0.22);
    color: #7ddea8;
}

html[data-theme="dark"] body.omeger.oc-precall footer.footer a {
    color: #7ddea8;
}

html[data-theme="dark"] body.omeger.oc-precall .lobby .local-video-container {
    background:
        radial-gradient(420px 300px at 85% 10%, rgba(255, 209, 102, 0.16), transparent 60%),
        radial-gradient(420px 320px at 10% 95%, rgba(255, 122, 89, 0.16), transparent 60%),
        linear-gradient(160deg, #243140 0%, #1b2430 60%, #0f1720 100%);
}

html[data-theme="dark"] body.omeger.oc-precall .lobby .toolbar #text {
    color: #7ddea8;
}

html[data-theme="dark"] body.omeger.oc-precall .lobby .filters select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23a7b4c2' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

html[data-theme="dark"] body.omeger.oc-precall .pc-badge {
    background: rgba(0, 0, 0, 0.45);
}

@media (prefers-reduced-motion: reduce) {
    body.omeger .pc-face {
        animation: none;
    }
}


/* ---------- 6. Camera / mic help ---------- */

/* Chips: on the self-view (yours) and on the partner video (theirs). */
body.omeger .oc-chip {
    position: absolute;
    z-index: 6;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 16px);
    padding: 7px 14px;
    border: 0;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
    color: #fff;
    background: rgba(20, 24, 31, 0.78);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
    pointer-events: auto;
}

body.omeger .oc-chip.hide,
body.omeger .oc-unmute-btn.hide,
body.omeger .oc-perm.hide {
    display: none !important;
}

body.omeger .oc-self-chip {
    bottom: 12px;
    cursor: pointer;
    background: linear-gradient(135deg, #ff7a59, #ff5a5f);
    animation: oc-chip-in 0.25s ease-out;
}

body.omeger .oc-self-chip[data-kind="muted"] {
    background: rgba(20, 24, 31, 0.8);
}

body.omeger .oc-self-chip:focus-visible,
body.omeger .oc-unmute-btn:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

/* Before Start the self-view is the big hero card. */
body.omeger.oc-precall .oc-self-chip {
    bottom: 48px;
    padding: 9px 16px;
    font-size: 0.9rem;
}

/* In a call the self-view is the small corner box: keep the chip tiny. */
body.omeger.oc-call .lobby:not(.oc-swapped) .oc-self-chip {
    bottom: 6px;
    padding: 4px 8px;
    font-size: 0.68rem;
    max-width: calc(100% - 8px);
}

body.omeger .oc-partner-chip {
    top: 64px;
    animation: oc-chip-in 0.25s ease-out;
}

body.omeger.oc-call .lobby.oc-swapped .oc-partner-chip {
    top: auto;
    bottom: 6px;
    padding: 4px 8px;
    font-size: 0.68rem;
}

body.omeger .oc-unmute-btn {
    position: absolute;
    z-index: 7;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    padding: 14px 26px;
    border: 0;
    border-radius: 999px;
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #1f9d62, #27b874);
    box-shadow: 0 10px 28px rgba(31, 157, 98, 0.45);
    cursor: pointer;
    animation: oc-pulse 1.6s ease-in-out infinite;
}

body.omeger.oc-call .lobby.oc-swapped .oc-unmute-btn {
    padding: 6px 10px;
    font-size: 0.72rem;
    animation: none;
}

/* Your own mic muted: make the mic button unmistakable. */
body.omeger .action-video.audio-unmute {
    background: #ff5a5f !important;
    color: #fff !important;
    box-shadow: 0 0 0 3px rgba(255, 90, 95, 0.35);
}

/* Permission card. */
body.omeger .oc-perm {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(14, 17, 22, 0.55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

body.omeger .oc-perm-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    padding: 26px 22px 20px;
    border-radius: 26px;
    text-align: center;
    color: #1d2433;
    background: #fff;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
    animation: oc-card-in 0.25s ease-out;
}

body.omeger .oc-perm-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    font-size: 1.5rem;
    line-height: 1;
    color: #6b7280;
    background: transparent;
}

body.omeger .oc-perm-icon {
    width: 76px;
    height: 76px;
    margin: 0 auto 12px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: linear-gradient(145deg, #fff1ea, #ffe0d4);
}

body.omeger .oc-perm-title {
    margin: 0 0 6px;
    font-size: 1.3rem;
    font-weight: 800;
}

body.omeger .oc-perm-text {
    margin: 0 0 12px;
    font-size: 0.95rem;
    color: #4b5563;
}

body.omeger .oc-perm-steps {
    margin: 0 0 16px;
    padding: 12px 14px 12px 34px;
    border-radius: 16px;
    text-align: left;
    font-size: 0.92rem;
    font-weight: 600;
    background: #f0faf5;
    counter-reset: none;
}

body.omeger .oc-perm-steps li {
    margin: 4px 0;
}

body.omeger .oc-perm-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

body.omeger .oc-perm-retry {
    min-height: 50px;
    border: 0;
    border-radius: 999px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #1f9d62, #27b874);
    box-shadow: 0 8px 20px rgba(31, 157, 98, 0.3);
}

body.omeger .oc-perm-text-btn span {
    margin-right: 6px;
}

body.omeger .oc-perm-text-btn {
    min-height: 46px;
    border: 2px solid #1f9d62;
    border-radius: 999px;
    font-weight: 800;
    color: #1f9d62;
    background: transparent;
}

html[data-theme="dark"] body.omeger .oc-perm-card {
    color: #f3f4f6;
    background: #1b2029;
}

html[data-theme="dark"] body.omeger .oc-perm-text {
    color: #c3c9d4;
}

html[data-theme="dark"] body.omeger .oc-perm-steps {
    background: #13261d;
}

html[data-theme="dark"] body.omeger .oc-perm-icon {
    background: linear-gradient(145deg, #3a2721, #4a2d24);
}

html[data-theme="dark"] body.omeger .oc-perm-text-btn {
    color: #4fd197;
    border-color: #4fd197;
}

@keyframes oc-chip-in {
    from { opacity: 0; transform: translate(-50%, 6px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes oc-card-in {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes oc-pulse {
    0%, 100% { box-shadow: 0 10px 28px rgba(31, 157, 98, 0.45); }
    50% { box-shadow: 0 10px 34px rgba(31, 157, 98, 0.75); }
}

@media (prefers-reduced-motion: reduce) {
    body.omeger .oc-chip,
    body.omeger .oc-unmute-btn,
    body.omeger .oc-perm-card {
        animation: none;
    }
}

/* Phones in a call: the corner box is tiny and sits top-right, so the self chip shrinks to its
   emoji and the partner chip moves down out of its way. */
@media (max-width: 767px) {
    body.omeger.oc-call .lobby:not(.oc-swapped) .oc-self-chip {
        font-size: 0;
        padding: 4px 9px;
        bottom: 6px;
    }

    body.omeger.oc-call .lobby:not(.oc-swapped) .oc-self-chip::before {
        content: attr(data-short);
        font-size: 13px;
    }

    body.omeger.oc-call .lobby:not(.oc-swapped) .oc-partner-chip {
        top: auto;
        bottom: calc(var(--bar-h) + 70px);
        max-width: calc(100% - 32px);
    }
}

/* ---------- 7. Call controls: same slots everywhere (2026-10-08) ----------
   Mic, camera, switch camera live outside both video boxes (home.blade.php), so swapping the
   self-view, the chat drawer/panel, the keyboard or the emoji sheet never moves or covers them.
   Switch camera shows only on devices with 2+ cameras (home.js sets body.oc-multicam); it is the
   last slot, so hiding it never shifts mic or camera. */
body.omeger .lobby .action-video.rotate {
    display: none !important;
}

body.omeger.oc-call.oc-multicam .lobby .action-video.rotate {
    display: inline-flex !important;
}

/* The call is a full-screen layer: the page header/footer behind it are hidden, so a header wider
   than a 360px phone can no longer widen the page and push the corner box / Report off-screen. */
body.omeger.oc-call #app > header.topbar,
body.omeger.oc-call #app > footer {
    display: none !important;
}

/* ---------- Consent banner on the chat page ----------
   On /chat (body.oc-app) the analytics consent banner is a compact strip at the top instead of a card
   at the bottom, and the page makes room for it: consent.js sets html.consent-open and --consent-h
   while it is open. Before a call the page is pushed down; during a call the whole call screen
   (stage, self-view, controls, chat drawer and input) starts below the strip, so nothing is covered.
   Accept/Reject and the Google Analytics behaviour are unchanged (consent.js). */
body.omeger.oc-app .omeger-consent {
    top: var(--oc-vv-top, 0px);
    bottom: auto;
    left: 0;
    right: 0;
    max-width: none;
    margin: 0;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: calc(6px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) 6px calc(12px + env(safe-area-inset-left));
    border-radius: 0;
    border-width: 0 0 1px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.16);
    font-size: 12.5px;
}

body.omeger.oc-app .omeger-consent p {
    min-width: 0;
    line-height: 1.3;
}

body.omeger.oc-app .omeger-consent-long {
    display: none;
}

body.omeger.oc-app .omeger-consent-short {
    display: inline;
}

body.omeger.oc-app .omeger-consent-actions {
    flex-shrink: 0;
    gap: 6px;
}

body.omeger.oc-app .omeger-consent-actions .btn {
    flex: 0 0 auto;
    min-width: 0;
    padding: 4px 12px;
    font-size: 12.5px;
    line-height: 1.4;
    border-radius: 999px;
}

@media (max-width: 374px) {
    body.omeger.oc-app .omeger-consent-actions {
        flex-direction: column;
        gap: 4px;
    }
}

html.consent-open body.omeger.oc-app:not(.oc-call) {
    padding-top: var(--consent-h, 0px);
}

html.consent-open body.omeger.oc-app.oc-call .lobby {
    top: calc(var(--oc-vv-top, 0px) + var(--consent-h, 0px)) !important;
    bottom: auto !important;
    height: calc(var(--oc-vv-h, 100dvh) - var(--consent-h, 0px)) !important;
}

/* ---------- Narrow phones: the header always fits ----------
   With the Live pill (chat page) the header needed ~430px, so on 320-414px phones it pushed the layout
   viewport wider than the screen ("Join Now" cut off and the whole page zoomed out). */
@media (max-width: 480px) {
    body.omeger .topbar {
        padding-left: calc(10px + env(safe-area-inset-left));
        padding-right: calc(10px + env(safe-area-inset-right));
        gap: 6px;
        min-width: 0;
        max-width: 100%;
    }

    body.omeger .topbar .nav {
        gap: 8px;
        min-width: 0;
    }

    body.omeger .topbar .nav > * {
        flex-shrink: 0;
    }

    body.omeger .topbar .live {
        padding: 3px 7px;
        gap: 4px;
    }

    body.omeger .topbar .nav a.btn {
        padding: 7px 11px;
        white-space: nowrap;
    }

    body.omeger .topbar .nav .dropdown-toggle {
        display: inline-block;
        max-width: 96px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        vertical-align: middle;
    }
}

/* Logo mark only (the link keeps aria-label="Omeger"). */
@media (max-width: 430px) {
    body.omeger .topbar .brand {
        font-size: 0;
        gap: 0;
    }
}

/* Pricing stays one tap away on the Join Now / register pages; the smallest phones drop it from the header. */
@media (max-width: 359px) {
    body.omeger .topbar .nav a.quiet[href$="/pricing"] {
        display: none;
    }
}

/* Drop recovery: "Reconnecting..." over the partner video (home.js overlay()) */
.remote-video-container .oc-reconnect {
    position: absolute; inset: 0; z-index: 6; display: flex; align-items: center; justify-content: center; gap: 10px;
    background: rgba(10, 14, 22, .62); color: #fff; font-weight: 600; font-size: 1rem; pointer-events: none;
}
.remote-video-container .oc-reconnect[hidden] { display: none; }
.oc-reconnect-spin {
    width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .35); border-top-color: #fff;
    animation: oc-reconnect-spin .9s linear infinite;
}
@keyframes oc-reconnect-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .oc-reconnect-spin { animation: none; } }
