/* =========================================================================
   Файл: /_assets/_css/modules/live.css (Часть 1 из 3)
   Описание: Стили каталога прямых трансляций и комнаты эфира LAFRUM
   ========================================================================= */

.live-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.live-ended-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-color: var(--accent);
    background: var(--accent-soft);
}

.live-ended-banner-ico {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.live-ended-banner-txt {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
    color: var(--text-secondary);
}

.live-ended-banner-txt strong {
    color: var(--text-primary);
    font-size: 14px;
}

/* Двухколоночная раскладка каталога по стандарту LAFRUM */
.live-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 16px;
    align-items: start;
}

.live-main-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.live-head-card {
    padding: 18px 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.live-head-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.live-head-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.live-page-title {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

@media (min-width: 900px) {
    .live-head-start-btn {
        display: none;
    }
}

@media (max-width: 899px) {
    .live-promo-card {
        display: none;
    }
}

/* Вкладки разделов каталога */
.live-tabs-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    overflow-x: auto;
    scrollbar-width: none;
}

.live-tabs-bar::-webkit-scrollbar {
    display: none;
}

.live-tab {
    position: relative;
    padding: 7px 14px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.18s ease, color 0.18s ease;
}

.live-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.live-tab.is-active {
    color: var(--accent);
    background: var(--accent-soft);
}

/* Фильтры пола */
.live-gender-pills {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.live-pill {
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
}

.live-pill:hover {
    border-color: var(--border-focus);
    color: var(--text-primary);
}

.live-pill.is-active {
    background: var(--accent-grad);
    border-color: transparent;
    color: var(--text-primary);
}

/* Сетка карточек эфиров */
.live-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.live-grid-skeleton {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.live-skel-card {
    aspect-ratio: 3 / 4;
    border-radius: 18px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    animation: livePulseSkel 1.4s ease-in-out infinite;
}

@keyframes livePulseSkel {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 0.95; }
}

.live-card {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    border-radius: 18px;
    overflow: hidden;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    text-decoration: none;
    transition: transform 0.22s ease, border-color 0.22s ease;
}

.live-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
}

.live-card-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.live-card-top {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    z-index: 2;
}

.live-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--bg-glass);
    backdrop-filter: blur(8px);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 700;
}

.live-card-badge.is-paid {
    background: var(--vip-grad);
}

.live-card-badge.is-followers {
    background: var(--prem-grad);
}

.live-dot-red {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--danger);
    display: inline-block;
    animation: liveDotBlink 1.3s infinite;
}

@keyframes liveDotBlink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

.live-card-bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 36px 12px 12px;
    background: linear-gradient(to top, var(--bg-main) 0%, transparent 100%);
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 2;
}

.live-card-user {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
}

.live-card-title {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-empty-state {
    grid-column: 1 / -1;
}

/* Правая колонка каталога */
.live-side-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 80px;
}

.live-promo-card {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg-surface);
}

.live-promo-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.live-promo-ico {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.live-promo-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.25;
}

.live-promo-desc {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.live-top-card {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.live-top-header {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.live-top-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.live-top-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 12px;
    text-decoration: none;
    transition: background 0.16s ease;
}

.live-top-row:hover {
    background: var(--bg-hover);
}

.live-top-rank {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.live-top-rank.is-medal {
    color: var(--text-primary);
    background: var(--accent-grad);
}

.live-top-rank.is-rank-1 {
    background: var(--vip-grad);
}

.live-top-rank.is-rank-2 {
    background: var(--prem-grad);
}

.live-top-avatar {
    position: relative;
    flex-shrink: 0;
}

.live-top-dot {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--danger);
    border: 2px solid var(--bg-surface);
}

.live-top-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.live-top-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-top-score {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.live-top-empty {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}
/* =========================================================================
   Файл: /_assets/_css/modules/live.css (Часть 2 из 3)
   Описание: Стили сцены комнаты эфира, верхней панели, анимации подарков и сердечек
   ========================================================================= */

.live-room-page {
    display: flex;
    justify-content: center;
}

.live-stage {
    position: relative;
    width: 100%;
    max-width: 540px;
    height: calc(100dvh - 104px);
    min-height: 540px;
    max-height: 860px;
    border-radius: 22px;
    overflow: hidden;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.live-video-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.live-video-el {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.live-video-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.live-video-fallback.is-hidden {
    display: none;
}

.live-fallback-bg {
    position: absolute;
    inset: -16px;
    width: calc(100% + 32px);
    height: calc(100% + 32px);
    object-fit: cover;
    filter: blur(22px) brightness(0.45);
}

.live-fallback-card {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 22px;
    border-radius: 20px;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    max-width: 300px;
}

.live-fallback-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
}

.live-fallback-sub {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.live-pause-overlay {
    position: absolute;
    inset: 0;
    z-index: 8;
    background: var(--bg-glass);
    backdrop-filter: blur(18px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.live-pause-overlay[hidden] {
    display: none;
}

.live-pause-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    color: var(--text-primary);
}

.live-pause-box span {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Верхняя панель комнаты (жёстко фиксирована вверху без обрезки на узких экранах) */
.live-room-top {
    position: relative;
    z-index: 14;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 10px 10px;
    background: linear-gradient(to bottom, var(--bg-main) 0%, transparent 100%);
}

.live-top-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
}

.live-top-right {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
}

.live-circle-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    text-decoration: none;
    transition: transform 0.16s ease, background 0.16s ease;
}

.live-circle-btn:hover {
    background: var(--bg-hover);
    transform: scale(1.05);
}

.live-author-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    border-radius: 999px;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    min-width: 0;
}

.live-author-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    min-width: 0;
}

.live-author-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.live-author-name {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-author-sub {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.live-follow-btn {
    padding: 5px 10px;
    border-radius: 999px;
    border: none;
    background: var(--accent-grad);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
}

.live-follow-btn.is-following {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.live-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 12px;
    flex-shrink: 0;
}

.live-stop-btn {
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: none;
    background: var(--danger);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    flex-shrink: 0;
}

/* Анимация подарков и летающих сердечек */
.live-gift-stage {
    position: absolute;
    left: 14px;
    right: 14px;
    top: 72px;
    z-index: 10;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.live-gift-toast {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    align-self: flex-start;
    padding: 8px 14px;
    border-radius: 16px;
    background: var(--accent-grad);
    box-shadow: var(--accent-glow);
    color: var(--text-primary);
    animation: liveGiftSlide 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.live-gift-toast img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

@keyframes liveGiftSlide {
    from { opacity: 0; transform: translate3d(-24px, 0, 0) scale(0.92); }
    to   { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

/* Вертикальная панель паузы/возобновления для автора слева под шапкой */
.live-owner-left-tools {
    position: absolute;
    top: calc(58px + env(safe-area-inset-top, 0px));
    left: 12px;
    z-index: 15;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.live-owner-tool-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-glass);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--card-shadow);
    transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.live-owner-tool-btn:hover {
    transform: scale(1.06);
    border-color: var(--accent);
}

.live-owner-tool-btn:active {
    transform: scale(0.94);
}

.live-owner-tool-btn.is-paused {
    background: var(--warning);
    border-color: transparent;
    color: var(--bg-main);
}

/* Вертикальные индикаторы выключенного микрофона/камеры справа под шапкой */
.live-media-badges {
    position: absolute;
    top: calc(58px + env(safe-area-inset-top, 0px));
    right: 12px;
    z-index: 15;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.live-media-badge {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--danger);
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--card-shadow);
    animation: liveBadgePop 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.live-media-badge[hidden] {
    display: none;
}

.live-media-badge::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: var(--danger);
    transform: rotate(-45deg);
}

@keyframes liveBadgePop {
    from { opacity: 0; transform: scale(0.75); }
    to   { opacity: 1; transform: scale(1); }
}

.live-hearts-layer {
    position: absolute;
    right: 10px;
    bottom: 72px;
    width: 84px;
    height: 320px;
    z-index: 10;
    pointer-events: none;
    overflow: hidden;
}

.live-float-heart {
    position: absolute;
    bottom: 0;
    right: 14px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    background: var(--accent-grad);
    box-shadow: var(--accent-glow);
    will-change: transform, opacity;
}

.live-float-heart.is-c1 { background: var(--danger); right: 8px; }
.live-float-heart.is-c2 { background: var(--accent-grad); right: 22px; }
.live-float-heart.is-c3 { background: var(--vip-grad); right: 12px; }
.live-float-heart.is-c4 { background: var(--prem-grad); right: 28px; }

.live-float-heart.is-p1 { animation: liveHeartWave1 2.45s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.live-float-heart.is-p2 { animation: liveHeartWave2 2.55s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.live-float-heart.is-p3 { animation: liveHeartWave3 2.35s cubic-bezier(0.22, 1, 0.36, 1) forwards; }

@keyframes liveHeartWave1 {
    0%   { opacity: 0; transform: translate3d(0, 0, 0) scale(0.45) rotate(-8deg); }
    12%  { opacity: 1; transform: translate3d(-6px, -36px, 0) scale(1.15) rotate(6deg); }
    40%  { opacity: 0.96; transform: translate3d(10px, -120px, 0) scale(1.0) rotate(-6deg); }
    72%  { opacity: 0.72; transform: translate3d(-12px, -215px, 0) scale(0.92) rotate(5deg); }
    100% { opacity: 0; transform: translate3d(4px, -295px, 0) scale(0.75) rotate(0deg); }
}

@keyframes liveHeartWave2 {
    0%   { opacity: 0; transform: translate3d(0, 0, 0) scale(0.5) rotate(10deg); }
    14%  { opacity: 1; transform: translate3d(8px, -42px, 0) scale(1.12) rotate(-8deg); }
    45%  { opacity: 0.95; transform: translate3d(-14px, -135px, 0) scale(1.02) rotate(7deg); }
    75%  { opacity: 0.68; transform: translate3d(8px, -225px, 0) scale(0.9) rotate(-4deg); }
    100% { opacity: 0; transform: translate3d(-6px, -300px, 0) scale(0.7) rotate(0deg); }
}

@keyframes liveHeartWave3 {
    0%   { opacity: 0; transform: translate3d(0, 0, 0) scale(0.4) rotate(0deg); }
    10%  { opacity: 1; transform: translate3d(-2px, -32px, 0) scale(1.18) rotate(-5deg); }
    50%  { opacity: 0.94; transform: translate3d(12px, -145px, 0) scale(0.98) rotate(8deg); }
    80%  { opacity: 0.65; transform: translate3d(-10px, -235px, 0) scale(0.88) rotate(-6deg); }
    100% { opacity: 0; transform: translate3d(2px, -290px, 0) scale(0.72) rotate(0deg); }
}

/* =========================================================================
   Файл: /_assets/_css/modules/live.css (Часть 3 из 3)
   Описание: Стили живого чата эфира, нижней панели действий, подарков и адаптива
   ========================================================================= */

.live-room-bottom {
    position: relative;
    z-index: 14;
    flex-shrink: 0;
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 24px 12px calc(12px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(to top, var(--bg-main) 0%, transparent 100%);
}

/* Закреплённое сообщение строго под верхней шапкой с тонким контуром и высокой контрастностью */
.live-pinned-bar {
    position: absolute;
    top: calc(56px + env(safe-area-inset-top, 0px));
    left: 12px;
    right: 54px;
    z-index: 13;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 11px;
    border-radius: 11px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    box-shadow: var(--card-shadow);
}

.live-pinned-bar[hidden] {
    display: none;
}

/* TikTok-style лента живого чата с верхним затуханием */
.live-chat-feed {
    max-height: 215px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding-top: 22px;
    padding-right: 48px;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to bottom, transparent, var(--text-primary) 22%);
    mask-image: linear-gradient(to bottom, transparent, var(--text-primary) 22%);
}

.live-chat-feed::-webkit-scrollbar {
    display: none;
}

.live-msg-row {
    display: inline-flex;
    align-items: flex-start;
    gap: 6px;
    align-self: flex-start;
    max-width: 100%;
    padding: 5px 10px;
    border-radius: 13px;
    border: 1px solid var(--border-color);
    background: var(--bg-glass);
    font-size: 13px;
    line-height: 1.35;
    color: var(--text-primary);
}

.live-msg-row.is-join {
    color: var(--text-secondary);
    font-size: 12px;
}

.live-msg-row.is-gift {
    border-color: transparent;
    background: var(--vip-grad);
    font-weight: 700;
}

.live-msg-row.is-system {
    color: var(--text-secondary);
    font-size: 12px;
}

.live-msg-author {
    font-weight: 700;
    color: var(--accent);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
}

.live-controls-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.live-chat-form {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 4px 6px 4px 14px;
}

.live-chat-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
}

.live-send-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--accent-grad);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.live-action-fab {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.16s ease;
}

.live-action-fab:active {
    transform: scale(0.9);
}

.live-action-fab.is-gift {
    background: var(--vip-grad);
    border-color: transparent;
}

.live-action-fab.is-like {
    background: var(--danger);
    border-color: transparent;
}

.live-action-fab.is-off {
    position: relative;
    background: var(--danger);
    border-color: transparent;
}

.live-action-fab.is-off::after {
    content: "";
    position: absolute;
    width: 24px;
    height: 2px;
    border-radius: 2px;
    background: var(--text-primary);
    transform: rotate(-45deg);
    pointer-events: none;
}

.live-guest-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 16px;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    font-size: 12px;
    color: var(--text-primary);
}

/* Витрина подарков в Bottom Sheet */
.live-gifts-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.live-gifts-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    max-height: 320px;
    overflow-y: auto;
}

.live-gift-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 8px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: var(--bg-elevated);
    color: var(--text-primary);
    cursor: pointer;
    text-align: center;
    transition: border-color 0.16s ease, transform 0.16s ease;
}

.live-gift-item:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.live-gift-item img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.live-gift-name {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.live-gift-price {
    font-size: 11px;
    font-weight: 800;
    color: var(--accent);
}

/* Панель зрителей в настройках автора */
.live-viewer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.live-viewer-user {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 700;
}

/* Убираем размытие («мыло») и выносим красную кнопку закрытия в правый верхний угол */
.app-overlay .app-card-box {
    position: relative;
    background: var(--bg-surface);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--border-color);
}

.app-overlay .app-card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 48px 14px 18px;
    align-items: center;
}

.app-overlay .app-card-header .icon-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    width: 30px;
    height: 30px;
    margin: 0;
    border: none;
    border-radius: 50%;
    background: var(--danger);
    color: var(--text-primary);
    box-shadow: var(--card-shadow);
    transition: transform 0.16s ease, filter 0.16s ease;
}

.app-overlay .app-card-header .icon-btn:hover {
    filter: brightness(1.08);
    transform: scale(1.06);
}

.app-overlay .app-card-header .icon-btn:active {
    transform: scale(0.94);
}

/* Сетка из 3 средних карточек-иконок для выбора действия при выходе автора */
.live-guard-sub {
    margin: 0 0 14px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.live-guard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.live-guard-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 8px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-elevated);
    color: var(--text-primary);
    cursor: pointer;
    text-align: center;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.live-guard-tile:hover,
.live-guard-tile:focus-visible {
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: translateY(-2px);
}

.live-guard-tile:active {
    transform: scale(0.96);
}

.live-guard-tile-ico {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.live-guard-tile.is-primary .live-guard-tile-ico {
    background: var(--accent-grad);
    border-color: transparent;
}

.live-guard-tile.is-pause .live-guard-tile-ico {
    color: var(--warning);
}

.live-guard-tile.is-danger:hover,
.live-guard-tile.is-danger:focus-visible {
    border-color: var(--danger);
    background: var(--accent-soft);
}

.live-guard-tile.is-danger .live-guard-tile-ico {
    color: var(--danger);
}

.live-guard-tile-lbl {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
}

.live-guard-hint {
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 959px) {
    .live-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .live-side-col {
        position: static;
    }

    .live-grid,
    .live-grid-skeleton {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .live-stage {
        position: fixed;
        inset: 0;
        z-index: 900;
        width: 100%;
        max-width: 100%;
        height: 100dvh;
        min-height: 100dvh;
        max-height: none;
        border-radius: 0;
        border: none;
    }

    .live-author-sub {
        max-width: 92px;
    }

    .live-stat-pill {
        height: 28px;
        padding: 0 8px;
        font-size: 11.5px;
    }

    .live-circle-btn {
        width: 32px;
        height: 32px;
    }

    .live-stop-btn {
        height: 30px;
        padding: 0 10px;
        font-size: 11.5px;
    }
}

/* =========================================================================
 * 2-шаговый мастер подготовки к эфиру (Камера/Звук -> Настройки)
 * ========================================================================= */
.live-wizard [hidden] {
    display: none !important;
}

.live-wizard .mt10 { margin-top: 10px; }
.live-wizard .mt12 { margin-top: 12px; }
.live-wizard .mt14 { margin-top: 14px; }
.live-wizard .mb12 { margin-bottom: 12px; }

.live-wizard-steps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
    padding: 4px;
    border-radius: 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
}

.live-wizard-pill {
    text-align: center;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-secondary);
    background: transparent;
    transition: all 0.2s ease;
}

.live-wizard-pill.is-active {
    color: var(--accent);
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px var(--border-focus);
}

.live-wizard-pane {
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: liveWizardFade 0.22s ease;
}

@keyframes liveWizardFade {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.live-preflight-box {
    position: relative;
    width: 100%;
    min-height: 172px;
    border-radius: 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.live-preflight-video {
    width: 100%;
    max-height: 240px;
    object-fit: cover;
    display: block;
    transform: scaleX(-1);
}

.live-preflight-video.is-rear {
    transform: none;
}

.live-preflight-flip {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.live-preflight-placeholder {
    padding: 22px 16px 50px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.live-preflight-placeholder strong {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.live-preflight-placeholder span {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.live-preflight-meter {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 11.5px;
}

.live-preflight-meter-track {
    flex: 1;
    height: 6px;
    border-radius: 999px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.live-preflight-meter-fill {
    height: 100%;
    width: 4%;
    border-radius: 999px;
    background: var(--accent-grad);
    transition: width 80ms linear;
}

.live-preflight-meter-lbl {
    font-weight: 700;
    opacity: 0.92;
}

.live-wizard .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.live-wizard .form-label {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-secondary);
}

.live-wizard .input {
    width: 100%;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.live-wizard .input::placeholder {
    color: var(--text-muted);
}

.live-wizard .input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.live-wizard .check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.18s ease;
}

.live-wizard .check-row:hover {
    border-color: var(--border-focus);
}

.live-wizard .check-row input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: var(--accent);
    cursor: pointer;
}

.live-priv-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.live-priv-grid.is-two-cols {
    grid-template-columns: repeat(2, 1fr);
}

.live-priv-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    padding: 11px 8px;
    border-radius: 14px;
    background: var(--bg-elevated);
    border: 1.5px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.14s ease;
}

.live-priv-card:hover {
    border-color: var(--border-focus);
}

.live-priv-card strong {
    font-size: 12.5px;
    font-weight: 700;
}

.live-priv-card span {
    font-size: 11px;
    color: var(--text-secondary);
}

.live-priv-card.is-active {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.live-priv-card.is-active .ico {
    color: var(--accent);
}

.live-wizard-actions {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 10px;
    margin-top: 4px;
}

/* =========================================================================
 * Сцена аудиокомнат (8/9/12 мест, сетка/круг, темы), мульти-видео и PK-баттл
 * ========================================================================= */
.live-stage.is-theme-cosmos  { background: radial-gradient(circle at 25% 15%, var(--accent-soft), var(--bg-main) 75%); }
.live-stage.is-theme-sunset  { background: linear-gradient(155deg, rgba(244, 63, 94, 0.24), rgba(245, 158, 11, 0.16) 50%, var(--bg-main)); }
.live-stage.is-theme-neon    { background: radial-gradient(circle at 75% 20%, rgba(6, 182, 212, 0.28), rgba(139, 92, 246, 0.22) 55%, var(--bg-main)); }
.live-stage.is-theme-emerald { background: radial-gradient(circle at 30% 25%, rgba(16, 185, 129, 0.26), var(--bg-main) 75%); }
.live-stage.is-theme-velvet  { background: linear-gradient(160deg, rgba(217, 70, 239, 0.24), rgba(88, 28, 135, 0.32) 55%, var(--bg-main)); }

.live-seats-stage {
    position: absolute;
    inset: 0;
    z-index: 4;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-content: center;
    gap: 14px 8px;
    padding: 96px 14px 140px;
}

.live-seats-stage[hidden] {
    display: none;
}

.live-seats-stage.is-count-9 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.live-seats-stage.is-circle {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.live-seats-stage.is-circle .live-seat-card.is-host {
    grid-column: 1 / -1;
    margin-bottom: 6px;
}

.live-seat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 4px;
    text-align: center;
}

.live-seat-avatar-wrap {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    padding: 2px;
    background: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.live-seat-card.is-host .live-seat-avatar-wrap {
    width: 72px;
    height: 72px;
    background: var(--vip-grad);
}

.live-seat-avatar-wrap img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    position: relative;
    z-index: 2;
}

.live-voice-ring {
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    opacity: 0;
    pointer-events: none;
}

.live-seat-card.is-speaking .live-voice-ring {
    animation: liveVoicePulse 1.1s ease-out infinite;
}

@keyframes liveVoicePulse {
    0%   { opacity: 0.95; transform: scale(0.95); }
    100% { opacity: 0; transform: scale(1.28); }
}

.live-seat-crown,
.live-seat-muted {
    position: absolute;
    right: -2px;
    bottom: -2px;
    z-index: 3;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--vip-grad);
    color: var(--text-primary);
}

.live-seat-muted {
    background: var(--danger);
}

.live-seat-plus {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 1.5px dashed var(--border-focus);
    background: var(--bg-glass);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.16s ease, border-color 0.16s ease;
}

.live-seat-card.is-empty:hover .live-seat-plus {
    border-color: var(--accent);
    color: var(--accent);
    transform: scale(1.05);
}

.live-seat-name {
    font-size: 12px;
    font-weight: 700;
    max-width: 84px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-seat-role {
    font-size: 10.5px;
    color: var(--text-secondary);
}

/* Мульти-видео плитки со-ведущих */
.live-multivideo-grid {
    position: absolute;
    top: 64px;
    right: 12px;
    z-index: 7;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 112px;
}

.live-multivideo-grid[hidden] {
    display: none;
}

.live-multi-tile {
    position: relative;
    aspect-ratio: 3 / 4;
    border-radius: 14px;
    overflow: hidden;
    border: 1.5px solid var(--accent);
    background: var(--bg-elevated);
    box-shadow: var(--card-shadow);
}

.live-multi-tile video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.live-multi-lbl {
    position: absolute;
    left: 6px;
    right: 6px;
    bottom: 5px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Шкала PK-баттла 1v1 */
.live-battle-bar {
    position: absolute;
    top: 58px;
    left: 12px;
    right: 54px;
    z-index: 11;
    padding: 7px 10px;
    border-radius: 14px;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.live-battle-bar[hidden] {
    display: none;
}

.live-battle-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-size: 11.5px;
    color: var(--text-primary);
}

.live-battle-timer {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--danger);
    font-weight: 800;
    font-size: 11px;
}

.live-battle-track {
    height: 7px;
    border-radius: 999px;
    background: var(--prem-grad);
    overflow: hidden;
}

.live-battle-fill-host {
    width: 50%;
    height: 100%;
    background: var(--vip-grad);
    transition: width 0.3s ease;
}

.live-action-fab.is-requested {
    border-color: var(--warning);
    color: var(--warning);
}

.live-action-fab.is-on-seat {
    background: var(--success);
    border-color: transparent;
}

/* Перетаскиваемое мини-окно активной трансляции автора (Draggable PiP) */
.live-pip-widget {
    position: fixed;
    right: 16px;
    bottom: 84px;
    z-index: 1150;
    width: 148px;
    aspect-ratio: 3 / 4;
    border-radius: 18px;
    overflow: hidden;
    background: var(--bg-surface);
    border: 1.5px solid var(--accent);
    box-shadow: var(--card-shadow);
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.live-pip-widget.is-dragging {
    cursor: grabbing;
}

.live-pip-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.live-pip-audio-cover {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    background: var(--bg-elevated);
    color: var(--text-primary);
    text-align: center;
    font-size: 11px;
    font-weight: 700;
}

.live-pip-top {
    position: absolute;
    top: 6px;
    left: 6px;
    right: 6px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}

.live-pip-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 10.5px;
    font-weight: 700;
}

.live-pip-actions {
    position: absolute;
    left: 6px;
    right: 6px;
    bottom: 6px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.live-pip-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-glass);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.live-pip-btn.is-stop {
    background: var(--danger);
    border-color: transparent;
}
