:root {
    --bg-color: #050505;
    --card-bg: rgba(20, 20, 20, 0.92);
    --accent-color: #ff2d55;
    --accent-glow: rgba(255, 45, 85, 0.4);
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --glass-border: rgba(255, 255, 255, 0.1);
    --safe-area-top: env(safe-area-inset-top);
    --safe-area-bottom: env(safe-area-inset-bottom);
    /* Partner preview / WebRTC: hide this much from the top of the frame */
    --partner-video-top-crop: 70px;
}

html {
    height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

[hidden] {
    display: none !important;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow: hidden;
    min-height: 100vh;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    height: 100vh;
    height: 100dvh;
    height: -webkit-fill-available;
    max-width: 100vw;
    display: flex;
    flex-direction: column;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 18+ age gate (first visit) */
.age-gate {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: #030303;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    transition: opacity 0.4s ease, visibility 0.4s;
    overflow: hidden;
}

.age-gate-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.age-gate-bg__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, minmax(0, 1fr));
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    transform: scale(1.08);
    transform-origin: center center;
}

.age-gate-bg__cell {
    min-height: 0;
    min-width: 0;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    opacity: 0.22;
    filter: saturate(1.08) brightness(0.88);
    animation: ageGateKen 22s ease-in-out infinite alternate;
}

.age-gate-bg__cell--w1 {
    background-image: url('https://images.unsplash.com/photo-1534528741775-53994a69daeb?auto=format&fit=crop&w=480&h=720&q=65&fm=webp');
    animation-duration: 24s;
    animation-delay: -3s;
}

.age-gate-bg__cell--m1 {
    background-image: url('https://images.unsplash.com/photo-1500648767791-00dcc994a43e?auto=format&fit=crop&w=480&h=720&q=65&fm=webp');
    animation-duration: 20s;
    animation-delay: -7s;
}

.age-gate-bg__cell--c1 {
    background-image: url('https://images.unsplash.com/photo-1516589178581-6cd783ba2244?auto=format&fit=crop&w=480&h=720&q=65&fm=webp');
    animation-duration: 26s;
    animation-delay: -1s;
}

.age-gate-bg__cell--w2 {
    background-image: url('https://images.unsplash.com/photo-1524504388940-b1c1722653e1?auto=format&fit=crop&w=480&h=720&q=65&fm=webp');
    animation-duration: 21s;
    animation-delay: -9s;
}

.age-gate-bg__cell--m2 {
    background-image: url('https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?auto=format&fit=crop&w=480&h=720&q=65&fm=webp');
    animation-duration: 23s;
    animation-delay: -5s;
}

.age-gate-bg__cell--c2 {
    background-image: url('https://images.unsplash.com/photo-1529636790768-af88bbb49d7e?auto=format&fit=crop&w=480&h=720&q=65&fm=webp');
    animation-duration: 25s;
    animation-delay: -11s;
}

@keyframes ageGateKen {
    0% {
        transform: scale(1) translate(0%, 0%);
    }
    100% {
        transform: scale(1.14) translate(-2.5%, -1.5%);
    }
}

@media (max-width: 520px) {
    .age-gate-bg__grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, minmax(0, 1fr));
    }
}

.age-gate-scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 100% 85% at 50% 35%, rgba(18, 10, 14, 0.42) 0%, transparent 55%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.88) 45%, rgba(0, 0, 0, 0.94) 100%);
    backdrop-filter: blur(10px);
}

html.ifigo-age-ok .age-gate {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.age-gate-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 380px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.75rem 1.5rem;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.age-gate-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    margin-bottom: 0.75rem;
}

.age-gate-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.65rem;
}

.age-gate-text {
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.age-gate-check-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.age-gate-check {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    text-align: left;
    font-size: 0.8rem;
    line-height: 1.38;
    margin-bottom: 0;
    cursor: pointer;
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.03);
}

.age-gate-check a {
    color: var(--accent-color);
    font-weight: 600;
    text-decoration: none;
}

.age-gate-check a:hover {
    text-decoration: underline;
}

.age-gate-check input {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    flex-shrink: 0;
    accent-color: var(--accent-color);
    cursor: pointer;
}

.age-gate-unlock {
    display: block;
    width: min(100%, 300px);
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.age-gate-unlock:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
    html.ifigo-age-ok .age-gate {
        transition: none;
    }

    .age-gate-bg__cell {
        animation: none;
    }

    .age-gate-scrim {
        backdrop-filter: blur(6px);
    }
}

/* Onboarding */
.onboarding {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: radial-gradient(circle at center, #1a1a1a 0%, #050505 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    padding: 1.5rem;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    transition: opacity 0.45s ease, visibility 0.45s;
}

.onboarding.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.onboarding-inner {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    max-width: 400px;
    min-height: 0;
    text-align: center;
}

.logo-main {
    font-size: clamp(1.75rem, 7vw, 3rem);
    font-weight: 700;
    margin-bottom: 0.75rem;
    background: linear-gradient(to bottom, #fff, #888);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.onb-lead {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.45;
    margin-bottom: 1.5rem;
}

.gender-fieldset {
    border: none;
    margin: 0 0 1.25rem;
}

.gender-fieldset legend {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
}

.gender-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.gender-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.65rem 0.5rem;
    border-radius: 40px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.88rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.gender-pill-icon {
    font-size: 0.98rem;
    line-height: 1;
}

.gender-pill-label {
    line-height: 1;
}

/* Colorful onboarding icons */
.gender-pill input[value='male'] + .gender-pill-icon {
    color: #60a5fa;
}
.gender-pill input[value='female'] + .gender-pill-icon {
    color: #fb7185;
}
.gender-pill input[value='couple'] + .gender-pill-icon {
    color: #f87171;
}
.gender-pill input[value='other'] + .gender-pill-icon {
    color: #a78bfa;
}

.header-gender-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.04);
    font-size: 1rem;
    line-height: 1;
    margin-left: 0.5rem;
}

#self-view-container .pip-gender-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 4;
    margin: 0;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.gender-pill.is-checked {
    border-color: var(--accent-color);
    background: rgba(255, 45, 85, 0.15);
}

.gender-pill input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.onb-country-block {
    margin-bottom: 1.25rem;
    text-align: left;
}

.onb-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.45rem;
}

.country-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    padding: 0.45rem 0.85rem;
    font-size: 0.88rem;
    color: var(--text-primary);
    cursor: pointer;
    max-width: 100%;
}

.country-chip.wide {
    width: 100%;
    justify-content: flex-start;
}

.country-chip-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 0;
}

.country-chip-flag .flag-img {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    display: block;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.flag-img {
    vertical-align: middle;
}

.flag-emoji {
    font-family:
        'Twemoji Mozilla',
        'Apple Color Emoji',
        'Segoe UI Emoji',
        'Segoe UI Symbol',
        'Noto Color Emoji',
        emoji,
        sans-serif;
    font-size: 1.1rem;
    line-height: 1;
    font-style: normal;
    font-variant-emoji: emoji;
}

.country-chip-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

header .country-chip.country-chip--icon-only {
    gap: 0;
    padding: 0.45rem 0.55rem;
}

header .country-chip.country-chip--icon-only .country-chip-name[hidden] {
    display: none;
}

.start-btn {
    width: 100%;
    max-width: 300px;
    padding: 1rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: white;
    background: var(--accent-color);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    box-shadow: 0 10px 30px var(--accent-glow);
    transition: transform 0.2s, opacity 0.2s;
}

.start-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.start-btn:not(:disabled):active {
    transform: scale(0.98);
}

button#onb-continue,
button#age-unlock {
    border-radius: 40px;
}

#onb-continue {
    align-self: center;
}

.onb-terms {
    flex-shrink: 0;
    width: 100%;
    max-width: min(22rem, 92vw);
    margin: 0.75rem auto 0;
    padding-top: 0.5rem;
    padding-bottom: max(0.25rem, env(safe-area-inset-bottom, 0px));
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
    text-align: center;
}

.onb-terms a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
}

.onb-terms a:hover {
    text-decoration: underline;
}

/* Header */
header {
    min-height: 64px;
    padding: calc(var(--safe-area-top) + 4px) 1rem 8px;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0.5rem 0.75rem;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.88), transparent);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.header-live-counter {
    justify-self: start;
    align-self: center;
}

.header-trailing {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    justify-self: end;
}

.header-region-row {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    flex-wrap: nowrap;
    max-width: 100%;
}

.header-settings-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    min-width: 34px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.06);
    color: #dadce0;
    cursor: pointer;
    flex-shrink: 0;
    transition:
        background 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.12s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.header-settings-btn svg {
    width: 18px;
    height: 18px;
}

.header-settings-btn:hover {
    background: rgba(255, 255, 255, 0.11);
    color: #fff;
}

.header-settings-btn:active {
    transform: scale(0.94);
}

#toggle-opt[aria-expanded='true'] {
    background: #2d3f59;
    box-shadow: 0 0 0 2px rgba(138, 180, 248, 0.75);
}

#toggle-opt[aria-expanded='true']:hover {
    background: #354a6b;
}

.header-exit-btn:hover {
    background: rgba(239, 68, 68, 0.22);
    color: #fecaca;
}

.header-exit-btn:active {
    transform: scale(0.94);
}

.live-line {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.82rem;
    white-space: nowrap;
}

.live-line-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff2d55;
    flex-shrink: 0;
    box-shadow: 0 0 0 0 rgba(255, 45, 85, 0.55);
    animation: livePulseDot 1.6s ease-in-out infinite;
}

.live-line-count {
    font-variant-numeric: tabular-nums;
    animation: liveCountAmbient 2.2s ease-in-out infinite;
}

.live-line-count.live-line-count--bump {
    animation: liveCountBump 0.38s ease-out 1;
}

.live-line-label {
    font-weight: 800;
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.88);
    text-shadow: 0 0 12px rgba(255, 45, 85, 0.35);
    animation: liveLabelPulse 2.5s ease-in-out infinite;
}

@keyframes livePulseDot {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 45, 85, 0.5);
    }
    45% {
        opacity: 0.95;
        transform: scale(1.12);
        box-shadow: 0 0 0 7px rgba(255, 45, 85, 0);
    }
}

@keyframes liveCountAmbient {
    0%,
    100% {
        text-shadow: 0 0 6px rgba(255, 45, 85, 0.2);
    }
    50% {
        text-shadow: 0 0 14px rgba(255, 45, 85, 0.45);
    }
}

@keyframes liveCountBump {
    0% {
        transform: scale(1);
    }
    35% {
        transform: scale(1.12);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes liveLabelPulse {
    0%,
    100% {
        opacity: 0.88;
        letter-spacing: 0.14em;
    }
    50% {
        opacity: 1;
        letter-spacing: 0.16em;
    }
}

@media (prefers-reduced-motion: reduce) {
    .live-line-pulse,
    .live-line-count,
    .live-line-label {
        animation: none;
    }

    .live-line-pulse {
        box-shadow: none;
    }

    .live-line-count.live-line-count--bump {
        animation: none;
    }
}

.header-ptv-timer {
    font-size: 0.76rem;
    font-weight: 600;
    color: #6ee7b7;
    white-space: nowrap;
    max-width: 100%;
    text-align: right;
    width: 100%;
}

/* Main: stage + optional chat 50/50 */
#app-main {
    flex: 1;
    min-height: 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.stage {
    flex: 1;
    min-height: 0;
    position: relative;
    display: flex;
    flex-direction: column;
}

#app-main.chat-open .stage {
    flex: 1 1 50%;
}

#app-main.chat-open .chat-panel {
    flex: 1 1 50%;
    max-height: none;
    opacity: 1;
    pointer-events: auto;
    border-top: 1px solid var(--glass-border);
}

/* Hide bottom mic/camera/next toolbar while chat is open; show again when closed */
#app-main.chat-open .app-controls {
    display: none;
}

aside#chat-panel {
    z-index: 999;
}

.chat-panel {
    flex: 0 0 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    transition: flex 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}

.chat-panel-header {
    flex-shrink: 0;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border-bottom: 1px solid var(--glass-border);
}

.chat-panel-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

/* Video stack — fills remaining layout; videos scale inside (any viewport / orientation) */
.video-stack {
    flex: 1;
    min-height: 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    position: relative;
    background: #000;
}

.partner-feed {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    min-width: 0;
    min-height: 0;
    position: absolute;
    inset: 0;
}

.partner-feed--awaiting {
    pointer-events: auto;
}

.partner-feed-loader {
    position: absolute;
    inset: 0;
    z-index: 28;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    pointer-events: auto;
}

.partner-feed-loader__ring {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.22);
    border-top-color: #fff;
    border-radius: 50%;
    animation: partnerNextLoaderSpin 0.7s linear infinite;
}

.partner-feed-loader__hint {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.88);
    letter-spacing: 0.02em;
    min-height: 1.2em;
}

/* Top-center LIVE pill on main partner video / placeholder */
.partner-feed-live-badge {
    position: absolute;
    left: 50%;
    top: max(0.55rem, env(safe-area-inset-top, 0px));
    transform: translateX(-50%);
    z-index: 6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.38rem 0.95rem;
    border-radius: 999px;
    font-weight: 800;
    font-size: clamp(0.72rem, 2.8vw, 0.92rem);
    letter-spacing: 0.16em;
    line-height: 1;
    color: #fff;
    background: rgba(220, 38, 38, 0.92);
    box-shadow:
        0 2px 16px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.12) inset;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.partner-feed-live-badge__pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #fff;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.45);
    animation: videoLivePulse 1.25s ease-out infinite;
}

.partner-feed-live-badge__txt {
    padding-top: 0.06em;
}

@keyframes partnerNextLoaderSpin {
    to {
        transform: rotate(360deg);
    }
}

.video-live-badge {
    position: absolute;
    top: max(0.45rem, env(safe-area-inset-top, 0px));
    left: max(0.45rem, env(safe-area-inset-left, 0px));
    z-index: 14;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.22rem 0.5rem;
    border-radius: 6px;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1;
    color: #fff;
    background: rgba(220, 38, 38, 0.88);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    pointer-events: none;
}

.video-live-badge--pip {
    top: 4px;
    left: 4px;
    z-index: 6;
    font-size: 0.5rem;
    padding: 0.15rem 0.35rem;
}

.video-live-badge__pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.55);
    animation: videoLivePulse 1.25s ease-out infinite;
}

.video-live-badge--pip .video-live-badge__pulse {
    width: 5px;
    height: 5px;
}

@keyframes videoLivePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.45);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(255, 255, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .partner-feed-loader__ring {
        animation: none;
        border-color: rgba(255, 255, 255, 0.45);
    }

    .video-live-badge__pulse,
    .partner-feed-live-badge__pulse {
        animation: none;
    }
}

.partner-feed > .partner-video {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.partner-video {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    object-position: center center;
    display: none;
    /* Hide top chrome / crop (match placeholder clip) */
    clip-path: inset(var(--partner-video-top-crop) 0 0 0);
    -webkit-clip-path: inset(var(--partner-video-top-crop) 0 0 0);
}

.partner-video.visible {
    display: block;
}

.partner-placeholder {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem;
    background: radial-gradient(ellipse at center, #1a1a1a 0%, #050505 100%);
    overflow: hidden;
}

.partner-search-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    /* Library clips: show full frame on tall/narrow/wide devices (letterbox if needed) */
    object-fit: contain;
    object-position: center center;
    opacity: 0.75;
    z-index: 1;
    /* Crop top bar / metadata strip */
    clip-path: inset(var(--partner-video-top-crop) 0 0 0);
    -webkit-clip-path: inset(var(--partner-video-top-crop) 0 0 0);
    transform: translateZ(0);
    backface-visibility: hidden;
}

.partner-placeholder > p {
    position: relative;
    z-index: 8;
}

/* Live-style chat + hearts over placeholder clip or real partner video */
.partner-feed > .live-sim {
    z-index: 5;
}

.live-sim {
    position: absolute;
    inset: 0;
    /* Receive horizontal swipes; controls use higher z-index + pointer-events */
    pointer-events: auto;
    touch-action: none;
}

.live-sim--hidden .live-sim-chat,
.live-sim--hidden .live-sim-form,
.live-sim--hidden .live-sim-hearts-field,
.live-sim--hidden .live-sim-heart-btn {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.live-sim-hearts-field {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    overflow: hidden;
    touch-action: none;
}

.live-sim-heart {
    position: absolute;
    bottom: 5rem;
    line-height: 0;
    pointer-events: none;
    color: #ff2338;
    animation: liveSimHeartUp linear forwards;
    will-change: transform, opacity, filter;
    filter: drop-shadow(0 0 5px rgba(255, 35, 55, 0.85));
}

.live-sim-heart-svg {
    display: block;
    width: 1em;
    height: 1em;
    fill: currentColor;
}

.live-sim-heart--user {
    color: #ff1a2e;
    filter: drop-shadow(0 0 8px rgba(255, 30, 45, 0.95));
}

.live-sim-heart--peer {
    color: #ff3b4d;
    filter: drop-shadow(0 0 9px rgba(255, 45, 60, 0.9));
}

@keyframes liveSimHeartUp {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 0.98;
        filter: drop-shadow(0 0 8px rgba(255, 40, 50, 0.95));
    }
    55% {
        filter: drop-shadow(0 0 12px rgba(255, 25, 40, 0.85));
    }
    100% {
        transform: translate3d(0, -120vh, 0) scale(0.35);
        opacity: 0;
        filter: drop-shadow(0 0 4px rgba(200, 0, 20, 0.4));
    }
}

.live-sim-heart-btn {
    position: absolute;
    right: max(0.65rem, env(safe-area-inset-right, 0px));
    bottom: max(4.75rem, calc(0.65rem + var(--safe-area-bottom)));
    z-index: 25;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(255, 60, 80, 0.55);
    background: rgba(255, 30, 50, 0.42);
    color: #ff2338;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
}

.live-sim-heart-btn:active {
    transform: scale(0.94);
}

.live-sim-chat {
    position: absolute;
    left: max(0.35rem, env(safe-area-inset-left, 0px));
    right: 30%;
    bottom: max(4.6rem, calc(0.35rem + var(--safe-area-bottom)));
    max-height: min(34vh, 220px);
    z-index: 8;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 0.28rem;
    overflow: hidden;
    pointer-events: none;
    mask-image: linear-gradient(to top, black 70%, transparent 100%);
    -webkit-mask-image: linear-gradient(to top, black 70%, transparent 100%);
}

.live-sim-chat__row {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.4rem;
    padding: 0.22rem 0.4rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.42);
    color: #f1f5f9;
    font-size: 0.62rem;
    line-height: 1.22;
    text-align: left;
    max-width: 100%;
    width: auto;
    box-sizing: border-box;
    pointer-events: none;
}

.live-sim-chat__row--mine {
    background: rgba(255, 45, 85, 0.28);
    border: 1px solid rgba(255, 45, 85, 0.35);
}

.live-sim-chat__user {
    font-weight: 700;
    color: #fda4af;
    flex-shrink: 0;
}

.live-sim-chat__row--mine .live-sim-chat__user {
    color: #fde68a;
}

.live-sim-chat__msg {
    color: rgba(255, 255, 255, 0.92);
    word-break: break-word;
    min-width: 0;
    flex: 0 1 auto;
}

.live-sim-form {
    position: absolute;
    left: max(0.35rem, env(safe-area-inset-left, 0px));
    right: max(0.35rem, env(safe-area-inset-right, 0px));
    bottom: max(0.35rem, var(--safe-area-bottom));
    z-index: 25;
    display: flex;
    gap: 0.45rem;
    align-items: center;
    pointer-events: auto;
}

.live-sim-input {
    flex: 1;
    min-width: 0;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 0.82rem;
    padding: 0.55rem 0.9rem;
    outline: none;
}

.live-sim-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.live-sim-send {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--accent-color);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px var(--accent-glow);
}

@media (prefers-reduced-motion: reduce) {
    .live-sim-heart {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

.partner-placeholder.is-searching-sequence > p {
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.65);
}

.partner-placeholder.hidden {
    display: none;
}

.partner-hint {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.partner-place {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 0.65rem;
    max-width: 92vw;
    padding: 0 0.5rem;
    text-align: center;
    word-wrap: break-word;
}

.partner-idle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    max-width: 280px;
    line-height: 1.45;
}

.partner-idle.is-animated {
    display: inline-flex;
    align-items: baseline;
    gap: 0.2rem;
    color: #d6d9e6;
    animation: partnerStatusPulse 1.8s ease-in-out infinite;
}

.partner-idle.is-animated::after {
    content: '...';
    display: inline-block;
    width: 1.1em;
    text-align: left;
    overflow: hidden;
    animation: partnerStatusDots 1.1s steps(4, end) infinite;
}

@keyframes partnerStatusPulse {
    0%,
    100% {
        opacity: 0.72;
        transform: translateY(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-1px);
    }
}

@keyframes partnerStatusDots {
    0% {
        width: 0;
    }
    100% {
        width: 1.1em;
    }
}

.partner-feed.searching .partner-placeholder {
    filter: blur(8px);
    opacity: 0.85;
}

.partner-feed.searching .partner-placeholder.is-searching-sequence {
    filter: none;
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .partner-feed.searching .partner-placeholder {
        filter: none;
        opacity: 1;
    }

    .partner-idle.is-animated,
    .partner-idle.is-animated::after {
        animation: none;
    }
}

/* Self view + flip (fixed so it can be dragged; position also set via JS after drag) */
#self-view-container {
    position: fixed;
    right: max(1rem, env(safe-area-inset-right));
    bottom: calc(108px + env(safe-area-bottom, 0px));
    left: auto;
    top: auto;
    width: clamp(88px, min(28vw, 22vh), 132px);
    height: clamp(132px, min(42vw, 33vh), 198px);
    max-width: min(132px, 32vw);
    max-height: min(198px, 38vh);
    background: #111;
    border-radius: 12px;
    overflow: visible;
    border: 2px solid var(--accent-color);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    z-index: 55;
    touch-action: none;
    cursor: grab;
    transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#self-view-container.self-view--dragging {
    cursor: grabbing;
    transition: opacity 0.25s ease, transform 0.2s ease;
}


/* Chat badge + typing indicator */
#toggle-chat {
    position: relative;
}

#toggle-chat.meet-action[aria-expanded='true'] {
    background: #2d3f59;
    box-shadow: 0 0 0 2px rgba(138, 180, 248, 0.75);
}

#toggle-chat.meet-action[aria-expanded='true']:hover {
    background: #354a6b;
}

#toggle-chat.meet-action .chat-badge {
    box-shadow: 0 0 0 2px #3c4043;
}

#toggle-chat.meet-action[aria-expanded='true'] .chat-badge {
    box-shadow: 0 0 0 2px #2d3f59;
}

.chat-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff2d55;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.65);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    font-size: 9px;
    line-height: 1;
    color: #fff;
}

.chat-badge--typing {
    height: 14px;
    min-width: 18px;
    border-radius: 999px;
    top: 4px;
    right: 4px;
}

.chat-title-wrap {
    display: inline-flex;
    align-items: baseline;
    gap: 0.45rem;
}

.typing-indicator {
    font-size: 0.82rem;
    color: var(--text-secondary);
    opacity: 0.95;
}

#self-view-container.pip-hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.92);
    cursor: default;
}

#self-video {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    object-position: center center;
    transform: scaleX(-1);
    border-radius: 10px;
    display: block;
}

#self-video.mirror-off {
    transform: none;
}

.pip-flip-btn {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.pip-flip-btn:active {
    background: var(--accent-color);
}

.pip-flip-btn svg {
    display: block;
}

/* Controls */
.app-controls {
    flex-shrink: 0;
    padding: 0.75rem 1.25rem calc(0.85rem + var(--safe-area-bottom));
    background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, transparent 100%);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 60;
}

.action-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.action-btn:active {
    transform: scale(0.9);
    background: var(--accent-color);
}

.action-btn.primary {
    width: 68px;
    height: 68px;
    background: var(--accent-color);
    border: none;
    box-shadow: 0 0 25px var(--accent-glow);
    font-weight: 700;
    font-size: 0.85rem;
}

/* Google Meet–style mic / camera */
.app-controls--meet {
    justify-content: center;
    gap: 0.65rem 1rem;
    flex-wrap: wrap;
}

.meet-action {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: #3c4043;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition:
        background 0.18s ease,
        transform 0.12s ease,
        opacity 0.18s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.meet-action:hover {
    background: #4a4d51;
}

.meet-action:active {
    transform: scale(0.94);
}

.meet-action:disabled,
.meet-action.meet-action--disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.app-controls--meet .meet-toolbar-btn {
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
}

.meet-action.meet-action--chat {
    color: #dadce0;
}

.meet-action.meet-action--primary {
    background: var(--accent-color);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    line-height: 1;
    box-shadow: 0 0 18px var(--accent-glow);
}

.meet-action.meet-action--primary:hover {
    background: #ff4568;
}

.meet-action.meet-action--primary:active {
    transform: scale(0.94);
}

.meet-next-spinner {
    display: block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    margin: 0 auto;
    animation: meetNextSpin 0.65s linear infinite;
}

@keyframes meetNextSpin {
    to {
        transform: rotate(360deg);
    }
}

.meet-action.is-muted,
.meet-action.is-cam-off {
    background: #ea4335;
    color: #fff;
}

.meet-action.is-muted:hover,
.meet-action.is-cam-off:hover {
    background: #f25142;
}

.meet-action.is-muted::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 2.5px;
    background: #fff;
    border-radius: 2px;
    transform: rotate(-38deg);
    pointer-events: none;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.meet-action__ic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.meet-action__ic[hidden] {
    display: none !important;
}

#self-view-container.self-cam-off #self-video {
    opacity: 0.35;
    filter: grayscale(0.4);
}

.self-cam-off-banner {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 12, 0.72);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.92);
    pointer-events: none;
}

#self-view-container.self-cam-off .pip-flip-btn {
    z-index: 5;
}

@media (prefers-reduced-motion: reduce) {
    .meet-action.is-muted::after {
        display: none;
    }

    .meet-next-spinner {
        animation: none;
        border-color: rgba(255, 255, 255, 0.5);
    }
}

.icon-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.35rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
}

.msg-container {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.msg {
    max-width: 88%;
    padding: 0.65rem 0.9rem;
    border-radius: 16px;
    font-size: 0.92rem;
    word-break: break-word;
}

.msg.received {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.08);
    border-bottom-left-radius: 4px;
}

.msg.sent {
    align-self: flex-end;
    background: var(--accent-color);
    border-bottom-right-radius: 4px;
}

.msg.system {
    align-self: center;
    max-width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.msg.msg-media {
    padding: 0.4rem;
    max-width: min(88%, 280px);
}

.msg.msg-media .msg-media__inner {
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
}

.msg.msg-media .msg-media__preview {
    line-height: 0;
    overflow: hidden;
}

.msg.msg-media img,
.msg.msg-media video {
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: min(40vh, 220px, 100dvh);
    object-fit: contain;
    object-position: center center;
    display: block;
}

.msg.msg-media .msg-media__file {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    font-size: 0.88rem;
    line-height: 1.35;
    word-break: break-word;
}

.msg.msg-media .msg-media__file-name {
    color: inherit;
    font-weight: 600;
}

.msg.msg-media .msg-media__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.45rem 0.5rem;
    border-top: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.15);
}

.msg.msg-media .msg-media__action {
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
    padding: 0.4rem 0.5rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    color: var(--text-primary, #f1f5f9);
    background: rgba(255, 255, 255, 0.06);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.msg.msg-media .msg-media__action:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

.msg.received.msg-media .msg-media__action {
    color: #e2e8f0;
}

.msg.sent.msg-media .msg-media__action {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.msg.sent.msg-media .msg-media__action:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-input-row {
    flex-shrink: 0;
    padding: 0.65rem 1rem calc(0.75rem + var(--safe-area-bottom));
    display: flex;
    gap: 0.6rem;
    align-items: center;
    border-top: 1px solid var(--glass-border);
}

.chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.65rem 1rem;
    color: white;
    outline: none;
    font-size: 1rem;
}

.chat-attach-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.chat-attach-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.chat-attach-btn svg {
    display: block;
}

.send-btn {
    background: none;
    border: none;
    font-size: 1.35rem;
    cursor: pointer;
    color: var(--accent-color);
    line-height: 1;
}

/* Country modal */
.country-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.country-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.country-modal-sheet {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: min(88vh, 640px);
    background: #121212;
    border-radius: 16px 16px 0 0;
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    z-index: 1;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
}

.country-modal-head {
    flex-shrink: 0;
    padding: 1rem 1rem 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.country-modal-head h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.country-search-wrap {
    padding: 0 1rem 0.5rem;
    flex-shrink: 0;
}

.country-search {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 1rem;
    outline: none;
}

.country-list {
    list-style: none;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding: 0 0.5rem 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.country-list::-webkit-scrollbar {
    width: 6px;
}

.country-list::-webkit-scrollbar-track {
    background: transparent;
}

.country-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 100px;
}

.country-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

.country-list::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

.country-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.92rem;
}

.country-item:hover,
.country-item:focus {
    background: rgba(255, 255, 255, 0.06);
}

.country-item-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 26px;
    line-height: 0;
}

.country-item-flag .flag-img {
    width: 22px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
    display: block;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.country-item-flag .flag-emoji {
    font-size: 1.15rem;
}

.country-item-name {
    flex: 1;
    text-align: left;
}

.country-item--worldwide {
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 0.35rem;
    padding-bottom: 0.75rem;
    font-weight: 600;
}

/* Membership upsell (every 30 × NEXT) */
.membership-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}

.membership-modal.is-open {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
}

.membership-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
}

.membership-modal__sheet {
    position: relative;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    background: #121212;
    border: 1px solid var(--glass-border);
    border-radius: 20px 20px 0 0;
    padding: 1.35rem 1.25rem calc(1.25rem + var(--safe-area-bottom));
    box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.55);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.membership-modal.is-open .membership-modal__sheet {
    transform: translateY(0);
}

.membership-modal__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.membership-modal__lead {
    font-size: 0.92rem;
    line-height: 1.45;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.membership-modal__perks {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-secondary);
    padding-left: 1.1rem;
    margin-bottom: 1rem;
}

.membership-modal__perks li {
    margin-bottom: 0.35rem;
}

.membership-modal__paypal {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}

.membership-modal__price-label {
    font-size: 0.88rem;
    color: var(--text-primary);
    margin: 0.25rem 0 0;
}

.paypal-btn-slot {
    min-height: 45px;
}

.membership-modal__fallback {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.membership-modal__warn {
    font-size: 0.8rem;
    color: #fbbf24;
    line-height: 1.4;
}

.membership-fallback-btn {
    padding: 0.65rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
}

.membership-modal__skip {
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.75rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.settings-badge {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-color);
    border: 1px solid rgba(255, 45, 85, 0.45);
    border-radius: 999px;
    padding: 0.1rem 0.45rem;
    margin-left: 0.35rem;
    vertical-align: middle;
}

.settings-help {
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--text-secondary);
    margin: -0.35rem 0 0.5rem;
}

.settings-row--disabled {
    opacity: 0.65;
}

.settings-row--disabled input:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Settings overlay */
.settings-overlay {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    max-height: 55vh;
    background: #141414;
    border-radius: 16px 16px 0 0;
    border: 1px solid var(--glass-border);
    z-index: 1500;
    display: flex;
    flex-direction: column;
    transform: translateY(110%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-overlay.visible {
    transform: translateY(0);
}

.settings-header {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--glass-border);
}

.settings-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.settings-section-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin: 0.25rem 0 0.35rem;
}

.settings-section-label:not(:first-child) {
    margin-top: 1rem;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.settings-row input[type='checkbox'] {
    width: 22px;
    height: 22px;
    accent-color: var(--accent-color);
    cursor: pointer;
}

.settings-row select {
    min-width: 9.5rem;
    max-width: 55%;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
}

.settings-row--partner-pref .settings-row__label {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.settings-row.settings-row--partner-pref select#partner-pref {
    appearance: none;
    cursor: pointer;
    outline: none;
    padding: 8px 2.25rem 8px 12px;
    background-color: rgba(255, 255, 255, 0.06);
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23cccccc%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    background-size: 0.55rem auto;
}

.settings-row.settings-row--partner-pref.settings-row--disabled select#partner-pref {
    cursor: not-allowed;
    opacity: 0.75;
}

.settings-row--disabled select:disabled {
    opacity: 1;
}

.settings-ptv-matching-block {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.settings-ptv-matching-block .settings-unlock-btn {
    margin-top: 0.15rem;
}

.settings-unlock-btn {
    width: 100%;
    font-size: 0.95rem;
}

.ptv-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.ptv-modal-head .membership-modal__title {
    margin: 0;
}

.ptv-gateway-block {
    margin-top: 0.75rem;
}

.ptv-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 0.65rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.ptv-field input {
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
}

.ptv-pay-primary {
    width: 100%;
    margin-top: 0.35rem;
}

.loading-dots::after {
    content: '...';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%,
    20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%,
    100% {
        content: '...';
    }
}

@media (prefers-reduced-motion: reduce) {
    .onboarding,
    .chat-panel,
    .settings-overlay,
    .membership-modal,
    .membership-modal__sheet,
    #app-main .stage {
        transition: none;
    }

    .loading-dots::after {
        animation: none;
        content: '…';
    }
}

@media (min-width: 768px) {
    /* Roomier header on desktop: live row vs region/settings */
    header {
        padding: calc(var(--safe-area-top) + 8px) 1.5rem 12px;
        gap: 1rem;
        align-items: center;
    }

    .header-trailing {
        gap: 0.65rem;
    }

    .header-region-row {
        gap: 0.9rem;
    }

    header .country-chip {
        padding: 0.5rem 1.05rem;
        gap: 0.5rem;
        min-height: 42px;
    }

    header .country-chip.country-chip--icon-only {
        padding: 0.5rem 0.65rem;
        gap: 0;
    }

    .header-settings-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }

    .header-exit-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }

    .live-line {
        gap: 0.45rem;
        font-size: 0.88rem;
    }

    .live-line-pulse {
        width: 9px;
        height: 9px;
    }

    .live-line-label {
        font-size: 0.72rem;
        letter-spacing: 0.15em;
    }

    .header-ptv-timer {
        margin-top: 0.05rem;
    }

    #app-main.chat-open {
        flex-direction: row;
    }

    #app-main.chat-open .stage {
        flex: 1 1 50%;
        border-right: 1px solid var(--glass-border);
    }

    #app-main.chat-open .chat-panel {
        flex: 1 1 50%;
        max-width: 50%;
        border-top: none;
    }
}

/* —— Legal & policy pages (standalone HTML) —— */
body.legal-doc-page {
    overflow-y: auto;
    overflow-x: hidden;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
}

.legal-doc-wrap {
    max-width: 42rem;
    margin: 0 auto;
    padding: calc(var(--safe-area-top) + 1.25rem) 1.25rem calc(2rem + var(--safe-area-bottom));
}

.legal-doc-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.legal-doc-nav a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
}

.legal-doc-nav a:hover {
    text-decoration: underline;
}

.legal-doc-banner {
    border: 1px solid rgba(255, 45, 85, 0.45);
    background: rgba(255, 45, 85, 0.08);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.legal-doc-banner strong {
    color: var(--text-primary);
}

.legal-doc-wrap h1 {
    font-size: 1.65rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    letter-spacing: -0.02em;
}

.legal-doc-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.legal-doc-wrap h2 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 1.75rem 0 0.65rem;
    color: var(--text-primary);
}

.legal-doc-wrap h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 1.15rem 0 0.45rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.legal-doc-wrap p,
.legal-doc-wrap li {
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.legal-doc-wrap ul {
    padding-left: 1.25rem;
    margin-bottom: 1rem;
}

.legal-doc-wrap a {
    color: var(--accent-color);
}

/* —— Investor relations (/investors/) —— */
body.investor-page .legal-doc-wrap.investor-wrap {
    max-width: 48rem;
}

.investor-nav-sep {
    color: var(--text-secondary);
}

.investor-hero {
    margin-bottom: 1.25rem;
}

.investor-hero-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent-color);
    margin: 0 0 0.35rem;
}

.investor-hero-meta {
    margin-bottom: 0;
}

.investor-disclaimer {
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    margin-bottom: 1.75rem;
}

.investor-disclaimer strong {
    color: var(--text-primary);
}

.investor-pill-grid {
    list-style: none;
    padding: 0;
    margin: 0 0 1.75rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .investor-pill-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
}

.investor-pill {
    margin: 0;
    padding: 1rem 1.1rem;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.investor-pill-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-primary);
}

.investor-pill-text {
    font-size: 0.86rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.investor-cta-box {
    margin: 2rem 0 1.5rem;
    padding: 1.25rem 1.35rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 45, 85, 0.35);
    background: linear-gradient(145deg, rgba(255, 45, 85, 0.12), rgba(15, 23, 42, 0.5));
}

.investor-cta-heading {
    margin: 0 0 0.5rem !important;
    font-size: 1.1rem !important;
}

.investor-cta-lead {
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--text-secondary);
    margin: 0 0 1rem;
}

.investor-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff !important;
    text-decoration: none !important;
    background: var(--accent-color);
    border-radius: 12px;
    box-shadow: 0 6px 20px var(--accent-glow);
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.investor-cta-btn:hover {
    transform: scale(1.02);
    opacity: 0.95;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.25rem;
    max-width: 28rem;
}

.contact-field label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.contact-field input,
.contact-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
}

.contact-field textarea {
    min-height: 8rem;
    resize: vertical;
}

button#contact-submit {
    margin-bottom: 15px;
}

.contact-submit {
    align-self: flex-start;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: var(--accent-color);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    box-shadow: 0 8px 24px var(--accent-glow);
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.contact-submit:hover:not(:disabled) {
    transform: scale(1.02);
}

.contact-submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.contact-form-msg {
    min-height: 1.35rem;
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin: 0;
}

.contact-form-msg:not(:empty) {
    color: #86efac;
}

.contact-hp {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 45;
    padding: 6px 10px calc(6px + var(--safe-area-bottom));
    text-align: center;
    font-size: 0.68rem;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.45);
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.65));
    pointer-events: none;
}

.site-footer nav {
    pointer-events: auto;
}

.site-ad-smartlink {
    pointer-events: auto;
    margin: 0.35rem 0 0;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
}

.site-footer a {
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    margin: 0 0.35rem;
}

.site-footer a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.site-footer .site-ad-smartlink a {
    color: rgba(255, 255, 255, 0.65);
    margin: 0;
}

.site-footer .site-ad-smartlink a:hover {
    color: var(--accent-color);
}

/* Rotating NEXT ads (native vs 300×250 display) */
.next-ad-overlay {
    position: fixed;
    inset: 0;
    z-index: 1800;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right))
        max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
    pointer-events: auto;
}

.next-ad-overlay[hidden] {
    display: none !important;
}

.next-ad-overlay__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.next-ad-overlay__dialog {
    position: relative;
    z-index: 1;
    max-width: calc(100vw - 2rem);
    padding: 2.25rem 1rem 1rem;
    background: #141414;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
}

.next-ad-overlay__close {
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.next-ad-overlay__close:hover {
    background: rgba(255, 255, 255, 0.18);
}

.next-ad-overlay__mount {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

#next-ad-display-wrap {
    min-height: 250px;
    min-width: 300px;
    max-width: 100%;
}

.age-gate-legal {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.age-gate-legal a {
    color: var(--accent-color);
    text-decoration: none;
}

.age-gate-legal a:hover {
    text-decoration: underline;
}

/* —— Mobile-first polish (small screens default; overrides below) —— */
html {
    -webkit-text-size-adjust: 100%;
}

body {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
}

@media (max-width: 767px) {
    header {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto;
        row-gap: 0.35rem;
        column-gap: 0.5rem;
        align-items: start;
        padding-left: max(0.75rem, env(safe-area-inset-left));
        padding-right: max(0.75rem, env(safe-area-inset-right));
    }

    .header-live-counter {
        grid-column: 1;
        grid-row: 1;
        justify-self: start;
        align-self: start;
    }

    .header-trailing {
        grid-column: 2;
        grid-row: 1;
        flex-direction: column;
        align-items: flex-end;
        justify-self: end;
        width: auto;
    }

    .header-settings-btn {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }

    .header-exit-btn {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }

    .header-settings-btn svg {
        width: 16px;
        height: 16px;
    }

    .country-chip {
        min-height: 44px;
        align-items: center;
    }

    .live-line,
    .header-ptv-timer {
        font-size: max(0.82rem, 12px);
    }

    /* Keep enough video visible when chat is open */
    #app-main.chat-open .stage {
        flex: 1 1 52%;
        min-height: 36vh;
    }

    #app-main.chat-open .chat-panel {
        flex: 1 1 48%;
        max-height: min(48vh, 420px);
        min-height: 0;
    }

    #self-view-container {
        bottom: calc(102px + var(--safe-area-bottom));
        right: max(0.65rem, env(safe-area-inset-right));
        width: clamp(88px, 27vw, 118px);
        height: clamp(132px, 40.5vw, 176px);
    }

    .pip-flip-btn {
        width: 40px;
        height: 40px;
    }

    .app-controls {
        padding-left: max(0.65rem, env(safe-area-inset-left));
        padding-right: max(0.65rem, env(safe-area-inset-right));
        gap: 0.35rem;
        justify-content: space-between;
    }

    .action-btn {
        min-width: 48px;
        min-height: 48px;
    }

    .meet-action,
    .app-controls--meet .meet-toolbar-btn {
        min-width: 52px;
        min-height: 52px;
    }

    .action-btn.primary {
        min-width: 64px;
        min-height: 64px;
    }

    .age-gate,
    .onboarding {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    .send-btn {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .icon-close {
        min-width: 44px;
        min-height: 44px;
    }
}

@media (max-width: 380px) {
    .header-region-row {
        justify-content: flex-end;
    }

    /* Keep 2×2 gender grid on small phones (same as tablet/desktop). */
    .gender-pill {
        min-height: 48px;
        padding: 0.55rem 0.42rem;
        font-size: 0.82rem;
        gap: 0.3rem;
    }

    .gender-pill-icon {
        font-size: 0.92rem;
    }
}

@media (max-width: 896px) and (orientation: landscape) and (max-height: 460px) {
    #app-main.chat-open .stage {
        flex: 1 1 58%;
        min-height: 45vh;
    }

    #app-main.chat-open .chat-panel {
        flex: 1 1 42%;
        max-height: 50vh;
    }

    #self-view-container {
        width: 68px;
        height: 102px;
        bottom: calc(86px + var(--safe-area-bottom));
        right: max(0.5rem, env(safe-area-inset-right));
    }

    .onboarding {
        padding-top: max(0.5rem, env(safe-area-inset-top));
        padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
    }

    .settings-overlay {
        max-height: min(85vh, 520px);
    }
}
