/**
 * MoVix TV Watch внутри #player-container (основное приложение IPTV).
 * Тема встроенного плеера: чёрный / красный / белый (без наследования зелёного акцента сайта).
 */
#player-container.iptv-mvx-host {
    position: relative;
}

#player-container.iptv-mvx-host .iptv-mvx-wrap {
    --tvw-accent-rgb: 229, 57, 53;
    --tvw-text-main: rgba(255, 255, 255, 0.95);
    --tvw-text-muted: rgba(255, 255, 255, 0.72);
    --tvw-border: rgba(255, 255, 255, 0.14);
    --tvw-focus-ring: 0 0 0 3px rgba(152, 152, 152, 0.92);
    --tvw-radius-s: 10px;
    --tvw-radius-m: 16px;
    --tvw-dur-fast: 120ms;
    --tvw-dur-mid: 180ms;
    --tvw-ease-out: cubic-bezier(0.2, 0.8, 0.3, 1);
    --tvw-ctrl-pad-y: clamp(0.24rem, 0.42vw, 0.5rem);
    --tvw-ctrl-pad-x: clamp(0.34rem, 0.58vw, 0.7rem);
    --tvw-ctrl-row: clamp(1.9rem, 1vw + 1.5rem, 2.45rem);
    --tvw-bar-core: calc(var(--tvw-ctrl-row) + var(--tvw-ctrl-pad-y) * 2);
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    background: #000;
}

#player-container.iptv-mvx-host .iptv-mvx-wrap .tv-watch-stage {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
}

#player-container.iptv-mvx-host .iptv-mvx-wrap #playerMount {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    height: 100%;
    position: relative;
}

/* TV / встроенный WebView: отдельный композитный слой для <video> */
#player-container.iptv-mvx-host video.tv-player-video {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* «Каналы» / «Программа» — только в полноэкранном режиме (класс выставляет tv_watch_custom.js — надёжнее :fullscreen в Safari). */
#player-container.iptv-mvx-host #tvWatchStage.tv-watch-stage--iptv-fs button[data-act="channels"],
#player-container.iptv-mvx-host #tvWatchStage.tv-watch-stage--iptv-fs button[data-act="program"] {
    display: inline-flex !important;
    align-items: center;
}
/* Запасной вариант, если класс по какой-то причине не обновился */
#player-container.iptv-mvx-host #tvWatchStage:fullscreen button[data-act="channels"],
#player-container.iptv-mvx-host #tvWatchStage:-webkit-full-screen button[data-act="channels"],
#player-container.iptv-mvx-host #tvWatchStage:-moz-full-screen button[data-act="channels"],
#player-container.iptv-mvx-host #tvWatchStage:fullscreen button[data-act="program"],
#player-container.iptv-mvx-host #tvWatchStage:-webkit-full-screen button[data-act="program"],
#player-container.iptv-mvx-host #tvWatchStage:-moz-full-screen button[data-act="program"] {
    display: inline-flex !important;
    align-items: center;
}

/* «Каналы» и «Программа» — одинаковый размер панели (как базовый .tv-watch-modal в tv_watch.css). */
#player-container.iptv-mvx-host #modalChannels.tv-watch-modal,
#player-container.iptv-mvx-host #modalProgram.tv-watch-modal {
    justify-content: center;
    align-items: center;
    padding: 1.25rem;
}
#player-container.iptv-mvx-host #modalChannels .tv-watch-modal__panel,
#player-container.iptv-mvx-host #modalProgram .tv-watch-modal__panel {
    width: min(760px, 100%);
    max-width: min(760px, 100%);
    max-height: min(85vh, 860px);
}
#player-container.iptv-mvx-host #modalChannels .channel-item,
#player-container.iptv-mvx-host #modalChannels .channel-item .channel-info,
#player-container.iptv-mvx-host #modalChannels .channel-name,
#player-container.iptv-mvx-host #modalChannels .channel-program,
#player-container.iptv-mvx-host #modalChannels .tv-ch-epg,
#player-container.iptv-mvx-host #modalChannels .channel-epg-overlay,
#player-container.iptv-mvx-host #modalChannels .channel-next {
    text-align: left;
}

/* Текущая передача в модалке «Каналы»: белый текст, зелёная полоса-акцент */
#player-container.iptv-mvx-host #modalChannels .channel-program--current {
    color: #ffffff !important;
    font-weight: 600;
    border-left: 3px solid var(--epg-current-color, #81c784);
    padding-left: 0.45rem;
    margin-left: -0.1rem;
    box-sizing: border-box;
}
#player-container.iptv-mvx-host #modalChannels .channel-item {
    justify-content: flex-start;
    align-items: center;
}

/* Модалка «Каналы»: та же сетка, что у #channels-list (.channel-item + .channel-logo + EPG). */
#player-container.iptv-mvx-host .tv-ch-list a.channel-item.iptv-modal-ch-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
    width: 100%;
    margin-bottom: 6px;
}
#player-container.iptv-mvx-host .tv-ch-list a.channel-item.iptv-modal-ch-row .channel-info {
    min-width: 0;
}

/* Длинные списки: браузер откладывает внеэкранную отрисовку строк модалки «Каналы». */
#player-container.iptv-mvx-host #modalChannels .tv-ch-list > li {
    content-visibility: auto;
    contain-intrinsic-size: 52px;
}

/**
 * Панель каналов + EPG (#iptv-fs-panels) — второй ребёнок #tvWatchStage.
 * Без этого #playerMount с height:100% забирает всю высоту колонки, блок списка
 * уходит вниз и обрезается overflow:hidden у .iptv-mvx-wrap.
 */
#player-container.iptv-mvx-host .iptv-mvx-wrap #tvWatchStage.iptv-fs-with-panels {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    min-height: 0 !important;
}

#player-container.iptv-mvx-host .iptv-mvx-wrap #tvWatchStage.iptv-fs-with-panels #playerMount {
    flex: 1 1 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none;
}

/* Панель поверх чёрного фона, не перекрываемая соседним слоем */
#player-container.iptv-mvx-host .iptv-mvx-wrap .iptv-fs-panels.iptv-fs-panels--visible {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

/* Бренд как в навбаре: иконка + название */
.tv-player-brand__iptv {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 750;
    font-size: clamp(0.78rem, 0.35vw + 0.62rem, 0.95rem);
    letter-spacing: 0.02em;
    color: var(--tvw-text-main, rgba(255, 255, 255, 0.95));
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}
.tv-player-brand__nav-icon {
    font-size: 1.15em;
    color: rgba(var(--tvw-accent-rgb, 229, 57, 53), 1);
    line-height: 1;
}
.tv-player-brand__nav-icon.iptv-ico .iptv-ico-svg {
    width: 1.15em;
    height: 1.15em;
    color: rgba(var(--tvw-accent-rgb, 229, 57, 53), 1);
}
.tv-player-brand__nav-text {
    max-width: min(36vw, 14rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 900px) {
    #player-container.iptv-mvx-host .iptv-mvx-wrap .tv-player-controls__center {
        display: none;
    }
}
