/* ==========================================================================
   Live streaming — list, go-live and live room
   The video stage is always dark; sheets and cards follow the site theme.
   ========================================================================== */

:root {
    --live-red: #ff1744;
    --live-blue: #2979ff;
    --live-overlay: rgba(0, 0, 0, 0.45);
    --live-stage-bg: #000;
}

/* ─── Badges ─────────────────────────────────────────────────── */
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--live-red);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.live-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    animation: live-pulse 1.4s ease-in-out infinite;
}
@keyframes live-pulse { 50% { opacity: 0.3; } }

.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: var(--live-overlay);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    backdrop-filter: blur(6px);
}

/* ─── Live list ──────────────────────────────────────────────── */
.live-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}
@media (max-width: 575px) {
    .live-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}
.live-card {
    position: relative;
    display: block;
    aspect-ratio: 9 / 14;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #111;
    color: #fff;
    text-decoration: none;
    transition: transform 0.2s ease;
}
.live-card:hover { transform: translateY(-3px); color: #fff; }
.live-card-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(18px) brightness(0.55);
    transform: scale(1.2);
}
.live-card-avatar {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 84px;
    height: 84px;
    margin: -60px 0 0 -42px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--live-red);
    box-shadow: 0 0 0 4px rgba(255, 23, 68, 0.25);
}
.live-card-top {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}
.live-card-bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 30px 12px 12px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
}
.live-card-title {
    font-weight: 700;
    font-size: 14px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.live-card-host { font-size: 12px; opacity: 0.8; margin-top: 2px; }
.live-battle-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--live-red), var(--live-blue));
    font-size: 10px;
    font-weight: 800;
}
.live-empty {
    text-align: center;
    padding: 70px 20px;
    color: var(--text-muted);
}
.live-empty i { font-size: 54px; color: var(--live-red); opacity: 0.6; }

/* ─── Room shell ─────────────────────────────────────────────── */
.app-main.live-room-main { padding: 0 !important; }
.live-room-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - var(--header-height));
    background: radial-gradient(circle at center, #1b1b1b 0%, #050505 70%);
}
@media (max-width: 991px) {
    .live-room-wrap { min-height: calc(100dvh - var(--header-height) - var(--bottom-nav-height)); }
}

.live-stage {
    position: relative;
    width: min(100%, calc((100vh - var(--header-height) - 24px) * 9 / 16));
    aspect-ratio: 9 / 16;
    max-height: calc(100vh - var(--header-height) - 24px);
    border-radius: var(--radius-lg);
    overflow: hidden;
    overflow: clip; /* unlike hidden, can't be scrolled by focus moving into an off-screen sheet */
    background: var(--live-stage-bg);
    color: #fff;
    user-select: none;
    -webkit-user-select: none;
}
@media (max-width: 991px) {
    .live-stage {
        width: 100%;
        max-height: none;
        height: calc(100dvh - var(--header-height) - var(--bottom-nav-height));
        aspect-ratio: auto;
        border-radius: 0;
    }
}

/* ─── Video layers ───────────────────────────────────────────── */
.live-videos { position: absolute; inset: 0; display: flex; }
.live-video-slot {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    background: #000;
}
.live-video-slot video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.live-video-slot video.is-landscape { object-fit: contain; }
.live-video-slot video.is-mirrored { transform: scaleX(-1); }
.live-video-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-size: cover;
    background-position: center;
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
}
.live-video-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background: inherit;
    filter: blur(24px) brightness(0.4);
    transform: scale(1.2);
}
.live-video-placeholder > * { position: relative; }
.live-video-placeholder img {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.4);
}

/* Grid: host + guests (up to 9 tiles) or competition contestants (up to 6), like TikTok */
.live-stage { --grid-h: 42%; }
.live-stage[data-n="3"], .live-stage[data-n="4"] { --grid-h: 56%; }
.live-stage[data-n="5"], .live-stage[data-n="6"] { --grid-h: 48%; }
.live-stage[data-n="7"], .live-stage[data-n="8"], .live-stage[data-n="9"] { --grid-h: 58%; }
.live-stage.is-grid .live-videos {
    top: 96px;
    bottom: auto;
    height: var(--grid-h);
    display: grid;
    gap: 2px;
    background: #000;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 1fr;
}
.live-stage[data-n="2"] .live-videos { grid-template-rows: 1fr; }
.live-stage[data-n="3"] .live-videos, .live-stage[data-n="4"] .live-videos { grid-template-rows: repeat(2, 1fr); }
.live-stage[data-n="5"] .live-videos, .live-stage[data-n="6"] .live-videos { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); }
.live-stage[data-n="7"] .live-videos, .live-stage[data-n="8"] .live-videos, .live-stage[data-n="9"] .live-videos { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); }
/* Odd counts: the host's tile takes two rows so the grid has no hole */
.live-stage[data-n="3"] #slot-main, .live-stage[data-n="5"] #slot-main, .live-stage[data-n="8"] #slot-main { grid-row: span 2; }
.live-stage[data-n="7"] #slot-main { grid-row: span 3; }
.live-stage.is-grid .live-video-placeholder img { width: 48px; height: 48px; }
.live-stage[data-n="7"] .live-video-placeholder img, .live-stage[data-n="8"] .live-video-placeholder img, .live-stage[data-n="9"] .live-video-placeholder img { width: 36px; height: 36px; }
.live-stage.is-grid .live-video-placeholder { font-size: 11px; }
.live-slot-label {
    position: absolute;
    left: 6px;
    bottom: 6px;
    z-index: 2;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--live-overlay);
    font-size: 11px;
    font-weight: 700;
    max-width: calc(100% - 12px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.live-stage.is-grid .live-slot-label { font-size: 10px; padding: 1px 6px; }
.live-tile-score {
    position: absolute;
    left: 6px;
    top: 6px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 1px 7px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    background: var(--tile-color, var(--live-red));
}
.live-tile-score .rank { opacity: 0.85; font-weight: 700; }
.live-video-slot.is-battle-tile { box-shadow: inset 0 0 0 2px var(--tile-color, transparent); }
.live-video-slot.is-leader .live-tile-score::before { content: '👑'; }
.live-guest-remove {
    z-index: 3;
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* ─── Top bar ────────────────────────────────────────────────── */
.live-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 12px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    z-index: 6;
    background: linear-gradient(rgba(0, 0, 0, 0.5), transparent);
}
.live-host-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 4px 4px 4px;
    border-radius: var(--radius-full);
    background: var(--live-overlay);
    backdrop-filter: blur(6px);
    max-width: 62%;
}
.live-host-chip img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.live-host-chip .name {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
    text-decoration: none;
}
.live-host-chip .sub { font-size: 11px; opacity: 0.75; }
.live-follow-btn {
    flex-shrink: 0;
    border: none;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    cursor: pointer;
}
.live-top-right { display: flex; align-items: center; gap: 6px; }
.live-gifters { display: flex; }
.live-gifters img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ffd54f;
    margin-left: -8px;
}
.live-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: var(--live-overlay);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    cursor: pointer;
    backdrop-filter: blur(6px);
    flex-shrink: 0;
}
.live-icon-btn:hover { background: rgba(0, 0, 0, 0.65); }
.live-sub-row {
    position: absolute;
    top: 58px;
    left: 12px;
    display: flex;
    gap: 6px;
    z-index: 6;
}

/* ─── Battle bar ─────────────────────────────────────────────── */
.live-battle-bar {
    position: absolute;
    top: 58px;
    left: 0;
    right: 0;
    z-index: 5;
    padding: 0 10px;
    display: none;
}
.live-stage.is-battle .live-battle-bar { display: block; }
.live-stage.is-battle .live-sub-row { display: none; }
.live-battle-meter {
    position: relative;
    display: flex;
    height: 22px;
    border-radius: var(--radius-full);
    overflow: hidden;
    font-size: 12px;
    font-weight: 800;
}
.live-battle-meter .side {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    transition: flex-grow 0.5s ease;
    min-width: 34px;
    flex-grow: 1;
    background: var(--tile-color, var(--live-red));
    overflow: hidden;
    white-space: nowrap;
}
.live-battle-meter .side:first-child { justify-content: flex-start; padding-left: 10px; }
.live-battle-meter .side:last-child:not(:first-child) { justify-content: flex-end; padding-right: 10px; }
.live-battle-timer {
    position: absolute;
    left: 50%;
    top: 26px;
    transform: translateX(-50%);
    padding: 2px 10px;
    border-radius: var(--radius-full);
    background: rgba(0, 0, 0, 0.6);
    font-size: 12px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.live-battle-vs {
    position: absolute;
    left: 50%;
    top: calc(96px + var(--grid-h) / 2);
    transform: translate(-50%, -50%);
    font-size: 26px;
    font-weight: 900;
    font-style: italic;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
    z-index: 3;
    pointer-events: none;
}
.live-battle-result {
    position: absolute;
    top: 30%;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 1px;
    z-index: 4;
    animation: live-pop 0.5s ease;
}
.live-battle-result.win { background: linear-gradient(135deg, #ffd54f, #ff9800); color: #3e2723; }
.live-battle-result.lose { background: rgba(0, 0, 0, 0.7); color: #fff; }
.live-battle-result.draw { background: rgba(255, 255, 255, 0.9); color: #111; }
@keyframes live-pop { from { transform: scale(0.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ─── Chat ───────────────────────────────────────────────────── */
.live-chat {
    position: absolute;
    left: 10px;
    right: 80px;
    bottom: 64px;
    max-height: 38%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 5;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(transparent, #000 20%);
    mask-image: linear-gradient(transparent, #000 20%);
    padding-top: 24px;
}
.live-chat::-webkit-scrollbar { display: none; }
.live-stage.is-grid .live-chat { max-height: 26%; }
.live-stage[data-n="5"] .live-chat, .live-stage[data-n="6"] .live-chat,
.live-stage[data-n="7"] .live-chat, .live-stage[data-n="8"] .live-chat, .live-stage[data-n="9"] .live-chat { max-height: 22%; }
.live-msg {
    align-self: flex-start;
    max-width: 100%;
    padding: 5px 10px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.35);
    font-size: 13px;
    line-height: 1.35;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    animation: live-msg-in 0.25s ease;
}
.live-msg .who {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    margin-right: 5px;
    cursor: default;
}
.live-msg .who.can-act { cursor: pointer; }
.live-msg.is-system { color: #ffe082; font-weight: 600; }
.live-msg.is-gift { background: linear-gradient(90deg, rgba(255, 64, 129, 0.55), rgba(0, 0, 0, 0.3)); }
.live-msg.is-host .who { color: #ff8a80; }
@keyframes live-msg-in { from { opacity: 0; transform: translateY(6px); } }

/* ─── Bottom bar ─────────────────────────────────────────────── */
.live-bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 6;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
}
.live-input {
    flex: 1;
    min-width: 0;
    height: 40px;
    border-radius: var(--radius-full);
    border: none;
    padding: 0 16px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 14px;
    outline: none;
}
.live-input::placeholder { color: rgba(255, 255, 255, 0.6); }
.live-round-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: transform 0.12s ease;
}
.live-round-btn:active { transform: scale(0.9); }
.live-round-btn.is-gift { background: linear-gradient(135deg, #ff4081, #f50057); }
.live-round-btn.is-off { background: rgba(255, 23, 68, 0.75); }
.live-round-btn.is-end { background: var(--live-red); }
.live-round-btn .count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #ffd54f;
    color: #000;
    font-size: 11px;
    font-weight: 800;
    display: none;
    align-items: center;
    justify-content: center;
}
.live-round-btn .count.show { display: inline-flex; }

/* Right-side host tools column */
.live-side-tools {
    position: absolute;
    right: 10px;
    bottom: 70px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 6;
}
.live-side-tools .live-round-btn { background: rgba(0, 0, 0, 0.45); }

/* ─── Hearts & gift animations ───────────────────────────────── */
.live-hearts {
    position: absolute;
    right: 18px;
    bottom: 70px;
    width: 60px;
    height: 300px;
    pointer-events: none;
    z-index: 4;
}
.live-heart {
    position: absolute;
    bottom: 0;
    left: 20px;
    font-size: 26px;
    animation: live-heart-up 2.2s ease-out forwards;
}
@keyframes live-heart-up {
    0% { transform: translate(0, 0) scale(0.5); opacity: 1; }
    100% { transform: translate(var(--dx, 0), -280px) scale(1.2); opacity: 0; }
}

.live-gift-banners {
    position: absolute;
    left: 10px;
    top: 42%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 7;
    pointer-events: none;
}
.live-stage.is-grid .live-gift-banners { top: calc(104px + var(--grid-h)); }
.live-gift-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 14px 4px 4px;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, rgba(255, 64, 129, 0.9), rgba(124, 77, 255, 0.7));
    animation: live-banner 4s ease forwards;
    max-width: 260px;
}
.live-gift-banner img.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.live-gift-banner .txt { font-size: 12px; line-height: 1.2; min-width: 0; }
.live-gift-banner .txt b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-gift-banner .icon { font-size: 30px; line-height: 1; }
.live-gift-banner .icon img { width: 34px; height: 34px; object-fit: contain; }
.live-gift-banner .qty { font-size: 20px; font-weight: 900; font-style: italic; color: #ffd54f; }
@keyframes live-banner {
    0% { transform: translateX(-120%); opacity: 0; }
    10%, 85% { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(-20%); opacity: 0; }
}
.live-gift-big {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 8;
    pointer-events: none;
    animation: live-big 3s ease forwards;
}
.live-gift-big .icon { font-size: 120px; filter: drop-shadow(0 6px 24px rgba(255, 64, 129, 0.8)); }
.live-gift-big .icon img { width: 160px; height: 160px; object-fit: contain; }
.live-gift-big .txt { font-weight: 800; font-size: 16px; text-shadow: 0 2px 6px #000; margin-top: 8px; }
@keyframes live-big {
    0% { transform: scale(0.2); opacity: 0; }
    15% { transform: scale(1.15); opacity: 1; }
    25%, 80% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.4) translateY(-60px); opacity: 0; }
}

/* ─── Overlays ───────────────────────────────────────────────── */
.live-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    text-align: center;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
}
.live-overlay.show { display: flex; }
.live-overlay h3 { font-size: 22px; font-weight: 800; margin: 0; }
.live-overlay p { color: rgba(255, 255, 255, 0.75); margin: 0; font-size: 14px; }
.live-overlay img.avatar { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; }
.live-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 320px;
    margin: 8px 0;
}
.live-summary div {
    padding: 10px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.08);
}
.live-summary b { display: block; font-size: 18px; }
.live-summary span { font-size: 11px; opacity: 0.7; }
.live-tap-audio {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 9;
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-full);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}
.live-tap-audio.show { display: inline-flex; }
.live-connecting {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

/* ─── Bottom sheets (gifts, requests, battle) ────────────────── */
.live-sheet-backdrop {
    position: absolute;
    inset: 0;
    z-index: 15;
    background: rgba(0, 0, 0, 0.35);
    display: none;
}
.live-sheet-backdrop.show { display: block; }
.live-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 16;
    max-height: 70%;
    overflow-y: auto;
    padding: 16px;
    border-radius: 18px 18px 0 0;
    background: var(--bg-surface);
    color: var(--text-main);
    transform: translateY(105%);
    visibility: hidden;
    transition: transform 0.25s ease, visibility 0.25s;
}
.live-sheet.show { transform: translateY(0); visibility: visible; }
.live-sheet-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-weight: 800;
    font-size: 15px;
}
.live-sheet-head button {
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
}
.live-gift-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.live-gift-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 4px;
    border-radius: 12px;
    border: 2px solid transparent;
    background: var(--bg-surface-elevated);
    color: var(--text-main);
    cursor: pointer;
}
.live-gift-item.selected { border-color: var(--primary); background: var(--primary-light); }
.live-gift-item .icon { font-size: 30px; line-height: 1.1; }
.live-gift-item .icon img { width: 36px; height: 36px; object-fit: contain; }
.live-gift-item .name { font-size: 11px; font-weight: 600; }
.live-gift-item .price { font-size: 11px; color: #e98307; font-weight: 700; }
.live-gift-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.live-balance { font-size: 13px; color: var(--text-secondary); }
.live-balance b { color: #e98307; }
.live-qty { display: flex; gap: 4px; }
.live-qty button {
    min-width: 36px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface-elevated);
    color: var(--text-main);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.live-qty button.selected { border-color: var(--primary); color: var(--primary); }
.live-receivers { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.live-receivers button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 3px;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--border-color);
    background: var(--bg-surface-elevated);
    color: var(--text-main);
    font-size: 12px;
    cursor: pointer;
}
.live-receivers button.selected { border-color: var(--primary); }
.live-receivers img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.live-person-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}
.live-person-row:last-child { border-bottom: none; }
.live-person-row img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.live-person-row .info { flex: 1; min-width: 0; }
.live-person-row .info b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-person-row .info span { font-size: 12px; color: var(--text-muted); }
.live-sheet-empty { text-align: center; padding: 26px 10px; color: var(--text-muted); font-size: 14px; }

/* Battle invitation card */
.live-invite {
    position: absolute;
    left: 14px;
    right: 14px;
    top: 30%;
    z-index: 18;
    padding: 18px;
    border-radius: 18px;
    background: var(--bg-surface);
    color: var(--text-main);
    text-align: center;
    box-shadow: var(--shadow-soft);
    display: none;
}
.live-invite.show { display: block; animation: live-pop 0.3s ease; }
.live-invite img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.live-invite .actions { display: flex; gap: 8px; justify-content: center; margin-top: 14px; }

/* ─── Go live (setup) ────────────────────────────────────────── */
.golive-wrap {
    display: flex;
    justify-content: center;
    padding: 16px;
}
.golive-card {
    width: 100%;
    max-width: 440px;
}
.golive-preview {
    position: relative;
    aspect-ratio: 9 / 14;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #000;
    margin-bottom: 14px;
}
.golive-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}
.golive-preview .msg {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}
.golive-preview .tools {
    position: absolute;
    right: 10px;
    top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.golive-field {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 15px;
    outline: none;
}
.golive-field:focus { border-color: var(--primary); }
.golive-select { margin-top: 10px; display: flex; gap: 8px; }
.golive-select select { flex: 1; min-width: 0; font-size: 13px; padding: 9px 10px; }
.golive-start {
    width: 100%;
    margin-top: 14px;
    padding: 14px;
    border: none;
    border-radius: var(--radius-full);
    background: var(--live-red);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
}
.golive-start:disabled { opacity: 0.55; cursor: not-allowed; }
.golive-note { font-size: 12px; color: var(--text-muted); margin-top: 10px; text-align: center; }

/* ─── Miss Kivu Competition page ─────────────────────────────── */
.comp-hero {
    text-align: center;
    padding: 28px 20px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #ff1744 0%, #7c4dff 100%);
    color: #fff;
}
.comp-hero h1 { font-size: 26px; font-weight: 800; margin: 8px 0 6px; }
.comp-hero p { margin: 0 auto; max-width: 520px; font-size: 14px; opacity: 0.92; }
.comp-card {
    padding: 18px;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}
.comp-card h2 { font-size: 17px; font-weight: 800; margin: 0 0 12px; }
.comp-card p { font-size: 14px; color: var(--text-secondary); }
.comp-reqs { margin: 0; padding-left: 18px; font-size: 14px; color: var(--text-secondary); }
.comp-reqs li { margin-bottom: 6px; }
.comp-reqs b { color: var(--text-main); }
.comp-terms {
    white-space: pre-wrap;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-secondary);
    max-height: 340px;
    overflow-y: auto;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface-elevated);
}
.comp-status { font-weight: 700; font-size: 15px; }
.comp-form { display: flex; flex-direction: column; gap: 12px; }
.comp-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--text-main); }
.comp-form input[type=text], .comp-form input[type=tel], .comp-form input[type=date], .comp-form select, .comp-form input[type=file] {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 14px;
    font-weight: 400;
}
.comp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 575px) { .comp-row { grid-template-columns: 1fr; } }
.comp-checks, .comp-pay { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--radius-sm); background: var(--bg-surface-elevated); }
.comp-checks label, .comp-pay label { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 500; }
.comp-checks input, .comp-pay input { margin-top: 3px; accent-color: var(--primary); }
.comp-note { font-size: 12px; color: var(--text-muted); }
.comp-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(255, 23, 68, 0.15), rgba(124, 77, 255, 0.15));
    border: 1px solid rgba(255, 23, 68, 0.35);
    color: var(--text-main);
    text-decoration: none;
    font-size: 14px;
}
.comp-banner:hover { color: var(--text-main); border-color: #ff1744; }
.comp-banner span span { font-size: 12px; color: var(--text-secondary); }

.comp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.comp-table th, .comp-table td { padding: 9px 10px; border-bottom: 1px solid var(--border-color); text-align: left; }
.comp-table th { color: var(--text-muted); font-weight: 700; font-size: 12px; }
.comp-table td { color: var(--text-secondary); }
.comp-table .ok { color: #10b981; font-weight: 800; }

/* Competition sheet: lobby + multi-select */
.live-lobby { border: 1px solid var(--border-color, rgba(0,0,0,.1)); border-radius: 12px; padding: 8px 10px; margin-bottom: 12px; }
.live-lobby-head { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 4px; }
.live-lobby-actions { display: flex; gap: 8px; margin-top: 8px; }
.live-lobby-actions .rx-btn { flex: 1; }
.live-chip { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(0,0,0,.06); white-space: nowrap; }
.live-chip.ok { background: rgba(46, 160, 67, .15); color: #2ea043; }
.live-chip.wait { background: rgba(233, 131, 7, .15); color: #e98307; }
.live-chip.no { background: rgba(0,0,0,.06); color: var(--text-muted); }
.live-person-row.is-selected { background: rgba(255, 64, 129, .08); border-radius: 10px; }
.live-battle-sheet-foot { position: sticky; bottom: 0; padding-top: 10px; background: inherit; }
.live-lobby-actions .rx-btn:disabled { opacity: 0.45; pointer-events: none; }
/* Tiles are small: fill them even when the camera is landscape (laptop webcams) */
.live-stage.is-grid .live-video-slot video.is-landscape { object-fit: cover; }

/* Share sheet */
.live-share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 6px; margin: 4px 0 12px; }
.live-share-item { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-main); text-decoration: none; background: none; border: 0; cursor: pointer; padding: 0; }
.live-share-item span { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 22px; }
.live-share-item:hover span { filter: brightness(1.1); }

/* Quick top-up inside the live */
.live-topup-amounts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.live-topup-amounts button { flex: 1 0 auto; min-width: 64px; padding: 9px 10px; border-radius: 12px; border: 1.5px solid var(--border-color); background: transparent; color: var(--text-main); font-weight: 800; cursor: pointer; }
.live-topup-amounts button.selected { border-color: var(--primary); background: rgba(254, 44, 85, .1); color: var(--primary); }
.live-topup-methods { display: flex; flex-direction: column; gap: 8px; }
.live-topup-method { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: 12px; border: 0; font-weight: 800; font-size: 15px; cursor: pointer; color: #fff; background: #333; }
.live-topup-method i { font-size: 20px; }
.live-topup-method.is-cashapp { background: #00d632; }
.live-topup-method.is-paypal { background: #ffc439; color: #003087; }
.live-topup-method.is-stripe { background: #635bff; }
.live-topup-method:disabled { opacity: .6; }
.live-topup-note { font-size: 12px; color: var(--text-muted); margin: 10px 0 0; }

/* ─── Paid lives ─────────────────────────────────────────────── */
.live-paywall-price { font-size: 38px; font-weight: 800; color: #fbbf24; line-height: 1; }
.live-paid-tag {
    padding: 3px 9px;
    border-radius: 999px;
    background: #fbbf24;
    color: #1a1200;
    font-size: 11px;
    font-weight: 800;
}
.golive-price { margin-top: 10px; }
.golive-price-tabs { display: flex; gap: 8px; }
.golive-price-tabs button {
    flex: 1;
    padding: 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-main);
    font-weight: 700;
    font-size: 14px;
}
.golive-price-tabs button.active { border-color: var(--primary); background: var(--primary); color: #fff; }
#paywall-overlay { z-index: 14; } /* below the top-up sheet (16) so topping up works from the paywall */
