/* 
==================================================
СОВРЕМЕННЫЙ ВИДЕОПЛЕЕР - УЛУЧШЕННАЯ ВЕРСИЯ
На основе эталонного примера из папки "Пример плеера"
==================================================
*/

/* Основной контейнер плеера */
.custom-player {
    position: relative;
    width: 100%;
    height: 400px;
    background: #000;
    border-radius: 8px;
    overflow: visible; /* Позволяем мобильному меню громкости выходить за границы */
    cursor: pointer;
    outline: none;
}

.custom-player:focus {
    outline: 2px solid rgba(255, 255, 255, 0.3);
    outline-offset: 2px;
}

/* Исправляем контейнер в fullscreen */
.custom-player:-webkit-full-screen,
.custom-player:-moz-full-screen,
.custom-player:fullscreen {
    width: 100% !important;
    height: 100% !important;
    height: -webkit-fill-available !important;
    max-width: 100% !important;
    max-height: 100% !important;
    max-height: -webkit-fill-available !important;
    padding-bottom: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    inset: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0) !important;
}

/* Видеоэлемент */
.custom-player-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    cursor: pointer;
}

/* Специальное правило для постера видео */
.custom-player-video[poster] {
    object-fit: cover;
    object-position: center;
}

/* Исправление видео в полноэкранном режиме */
.custom-player:-webkit-full-screen .custom-player-video,
.custom-player:-moz-full-screen .custom-player-video,
.custom-player:fullscreen .custom-player-video {
    width: 100% !important;
    height: 100% !important;
    height: -webkit-fill-available !important;
    max-width: 100% !important;
    max-height: 100% !important;
    max-height: -webkit-fill-available !important;
    /* object-fit управляется динамически через JavaScript */
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
}

/* Специальные правила для мобильных Safari */
@supports (-webkit-touch-callout: none) {
    .custom-player:-webkit-full-screen,
    .custom-player:fullscreen {
        height: 100% !important;
        height: -webkit-fill-available !important;
        min-height: 100% !important;
        min-height: -webkit-fill-available !important;
    }
    
    .custom-player:-webkit-full-screen .custom-player-video,
    .custom-player:fullscreen .custom-player-video {
        height: 100% !important;
        height: -webkit-fill-available !important;
        min-height: 100% !important;
        min-height: -webkit-fill-available !important;
        /* object-fit управляется динамически через JavaScript */
    }
}

/* Метаинформация плеера */
.custom-player-meta {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 5;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Метаданные исчезают только когда панель управления скрыта И видео воспроизводится */
.custom-player.hide-controls.playing .custom-player-meta {
    opacity: 0;
}

/* Метаданные всегда видны когда панель управления видна (при hover, focus, или паузе) */
.custom-player:hover .custom-player-meta,
.custom-player:focus .custom-player-meta,
.custom-player:not(.playing) .custom-player-meta {
    opacity: 1;
}

.cp-meta-line {
    line-height: 1.4;
    font-size: 14px;
    margin-bottom: 2px;
}

.cp-meta-top {
    font-weight: 600;
    font-size: 16px;
    color: #b9ff09;
}

.cp-meta-bottom {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
}

/* Элементы управления плеером */
.custom-player-controls {
    position: absolute;
    bottom: 0 !important;
    left: 0;
    right: 0;
    width: 100%;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 15px;
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s ease;
    z-index: 10;
    box-sizing: border-box;
}

.custom-player.hide-controls.playing .custom-player-controls {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

.custom-player:hover .custom-player-controls,
.custom-player:focus .custom-player-controls {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
    bottom: 0 !important;
    left: 0;
    right: 0;
}

/* Прогресс бар */
.cp-progress {
    width: 100%;
    height: 6px;
    margin-bottom: 15px;
    cursor: pointer;
    position: relative;
}

.cp-track {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}

.cp-buffered {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
}

.cp-played {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #b9ff09;
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
}

.cp-handle {
    position: absolute;
    top: 50%;
    right: -6px;
    width: 12px;
    height: 12px;
    background: #b9ff09;
    border-radius: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.2s ease;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3);
}

.cp-progress:hover .cp-handle {
    opacity: 1;
}

/* Время - справа сверху от прогресс-бара */
.cp-time {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    justify-content: flex-end;
    position: relative;
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
}

/* Время видимо только после загрузки метаданных */
.custom-player.metadata-loaded .cp-time {
    opacity: 1;
}

.cp-current {
    color: #b9ff09;
}

.cp-duration {
    color: rgba(255, 255, 255, 0.7);
}

/* Строка с кнопками управления */
.cp-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    flex-wrap: nowrap;
    overflow: hidden;
}

/* Левые кнопки */
.cp-left-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Центральные кнопки */
.cp-main-buttons {
    display: flex;
    align-items: center;
    gap: 16px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* Дополнительные кнопки справа */
.cp-additional-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Базовые стили кнопок */
.cp-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(185, 255, 9, 0.41);
    color: white;
    padding: 3px 8px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    min-height: 36px;
    outline: none;
}

.cp-btn:hover {
    margin-top: 2px;
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(185, 255, 9, 0.89);
}

.cp-btn:active {
    transform: translateY(0);
}

.cp-btn:focus {
    outline: 2px solid rgba(185, 255, 9, 0.5);
    outline-offset: 2px;
}

/* Кнопка сезонов в правом верхнем углу */
.cp-seasons-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 5;
}

.cp-seasons-btn {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(185, 255, 9, 0.41);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
    outline: none;
}

.cp-seasons-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(185, 255, 9, 0.89);
    transform: translateY(-1px);
}

.cp-seasons-btn:focus {
    outline: 2px solid rgba(185, 255, 9, 0.5);
    outline-offset: 2px;
}

.cp-seasons-text {
    font-weight: 500;
}

/* Кнопка сезонов исчезает при воспроизведении (как метаданные) */
.custom-player.playing .cp-seasons-panel {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Кнопка сезонов видна только когда НЕ воспроизводится */
.custom-player.hide-controls:not(.playing) .cp-seasons-panel {
    opacity: 1;
    transform: none;
    pointer-events: all;
}

/* В fullscreen режиме скрываем кнопку сезонов при воспроизведении */
.custom-player:-webkit-full-screen.playing .cp-seasons-panel,
.custom-player:-moz-full-screen.playing .cp-seasons-panel,
.custom-player:fullscreen.playing .cp-seasons-panel {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Также скрываем при скрытых элементах управления в полноэкранном режиме */
.custom-player:-webkit-full-screen.hide-controls .cp-seasons-panel,
.custom-player:-moz-full-screen.hide-controls .cp-seasons-panel,
.custom-player:fullscreen.hide-controls .cp-seasons-panel {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Кнопка play/pause */
.cp-play {
    padding: 10px;
    background: rgba(185, 255, 9, 0.2);
    border-color: rgba(185, 255, 9, 0.6);
}

.cp-play:hover {
    background: rgba(185, 255, 9, 0.3);
    border-color: #b9ff09;
}

.cp-play .icon-pause {
    display: none;
}

.cp-play.playing .icon-play {
    display: none;
}

.cp-play.playing .icon-pause {
    display: block;
}

/* Кнопки навигации */
.cp-prev, .cp-next {
    padding: 8px 10px;
}

/* Кнопка режима отображения - по умолчанию скрыта */
.display-mode-btn {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    min-width: 60px;
    text-align: center;
}

.display-mode-text {
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

/* Кнопка режима отображения скрыта на всех мобильных экранах кроме fullscreen в landscape */
@media (max-width: 768px) {
    .display-mode-btn {
        display: none !important;
    }
}

/* Управление громкостью */
.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.volume-btn {
    padding: 8px;
}

.volume-btn .icon-volume-mute {
    display: none;
}

.volume-btn.muted .icon-volume-up {
    display: none;
}

.volume-btn.muted .icon-volume-mute {
    display: block;
}

.volume-slider {
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.volume-progress {
    height: 100%;
    background: #b9ff09;
    border-radius: 2px;
    width: 100%;
    transition: width 0.1s linear;
}

/* Настройки */
.settings-container {
    position: relative;
}

.settings-menu {
    position: absolute;
    bottom: 100%;
    margin-bottom: 2px;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 0;
    min-width: 180px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 1000; /* Высокий z-index чтобы меню было поверх всех элементов */
}

.settings-menu:not(.hidden) {
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: all !important;
    display: block !important;
    position: fixed;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    cursor: pointer;
    color: white;
    font-size: 14px;
    transition: background 0.2s ease;
}

.settings-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Скрыть кнопку озвучки - не используется */
.cp-audio {
    display: none !important;
}

/* Исправление кнопки fullscreen - скрыть старые FontAwesome иконки */
.cp-fullscreen .fas,
.fullscreen-btn .fas,
.cp-fullscreen i,
.fullscreen-btn i {
    display: none !important;
}

/* Показать только SVG иконки для fullscreen */
.cp-fullscreen svg,
.fullscreen-btn svg {
    display: block;
}

.cp-fullscreen .icon-exit-fs {
    display: none;
}

/* Скрытие панели в fullscreen ТОЛЬКО при воспроизведении */
.custom-player:-webkit-full-screen.hide-controls.playing .custom-player-controls,
.custom-player:-moz-full-screen.hide-controls.playing .custom-player-controls,
.custom-player:fullscreen.hide-controls.playing .custom-player-controls {
    opacity: 0 !important;
    transform: translateY(10px) !important;
    pointer-events: none !important;
    transition: all 0.3s ease !important;
}

/* Принудительное скрытие панели на мобильных в fullscreen при воспроизведении */
@media (max-width: 768px), (hover: none), (pointer: coarse) {
    .custom-player:-webkit-full-screen.hide-controls.playing .custom-player-controls,
    .custom-player:-moz-full-screen.hide-controls.playing .custom-player-controls,
    .custom-player:fullscreen.hide-controls.playing .custom-player-controls {
        opacity: 0 !important;
        transform: translateY(20px) !important;
        pointer-events: none !important;
        transition: all 0.2s ease !important;
        visibility: hidden !important;
    }
}

/* На паузе в fullscreen панель всегда видна */
.custom-player:-webkit-full-screen:not(.playing) .custom-player-controls,
.custom-player:-moz-full-screen:not(.playing) .custom-player-controls,
.custom-player:fullscreen:not(.playing) .custom-player-controls {
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: all !important;
}

/* Улучшенные стили для fullscreen */
.custom-player:-webkit-full-screen,
.custom-player:-moz-full-screen,
.custom-player:fullscreen {
    cursor: none;
}

.custom-player:-webkit-full-screen:not(.hide-controls),
.custom-player:-moz-full-screen:not(.hide-controls),
.custom-player:fullscreen:not(.hide-controls) {
    cursor: default;
}

/* Скрыть курсор при бездействии в fullscreen */
.custom-player:-webkit-full-screen.hide-controls,
.custom-player:-moz-full-screen.hide-controls,
.custom-player:fullscreen.hide-controls {
    cursor: none !important;
}

.custom-player:-webkit-full-screen.hide-controls *,
.custom-player:-moz-full-screen.hide-controls *,
.custom-player:fullscreen.hide-controls * {
    cursor: none !important;
}



/* Модальное окно сезонов */
.seasons-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Специальные правила для модального окна в fullscreen режиме */
.custom-player:-webkit-full-screen ~ .seasons-modal,
.custom-player:-moz-full-screen ~ .seasons-modal,
.custom-player:fullscreen ~ .seasons-modal {
    z-index: 999999 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.9) !important;
}

/* Альтернативный подход - модальное окно как дочерний элемент плеера в fullscreen */
.custom-player:-webkit-full-screen .seasons-modal,
.custom-player:-moz-full-screen .seasons-modal,
.custom-player:fullscreen .seasons-modal {
    z-index: 999999 !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

.seasons-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}

.seasons-modal-content {
    position: relative;
    background: #1a0303;
    border-radius: 12px;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(87, 30, 30, 0.6);
    border: 1px solid #852222;
    margin: 20px;
}

.seasons-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #7b1f1f;
    background: #250505;
}

.seasons-modal-header h3 {
    margin: 0;
    color: white;
    font-size: 18px;
    font-weight: 600;
}

.seasons-modal-close {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.seasons-modal-close:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.seasons-modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.seasons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.season-item {
    display: block;
    padding: 16px;
    background: #2a2a2a;
    border-radius: 8px;
    text-decoration: none;
    color: white;
    transition: all 0.2s;
    border: 2px solid transparent;
    text-align: center;
}

.season-item:hover {
    background: #333;
    transform: translateY(-2px);
    color: white;
    text-decoration: none;
}

.season-item.current-season {
    border-color: #007bff;
    background: #1a4480;
}

.season-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.season-episodes {
    font-size: 12px;
    color: #999;
}

.season-number {
    font-size: 20px;
    font-weight: 600;
    color: #b9ff09;
    margin-bottom: 8px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .cp-main-buttons {
        gap: 12px;
    }
    
    .cp-btn {
        padding: 6px 10px;
        font-size: 12px;
        min-height: 32px;
        margin-top: 1px;
    }
    
    .cp-seasons {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .cp-time {
        font-size: 12px;
        margin-bottom: 12px;
        justify-content: flex-end;
    }
    
    .volume-slider {
        width: 60px;
    }
    
    .seasons-modal-content {
        margin: 15px;
        max-width: none;
    }
    
    .seasons-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
    }
    
    .seasons-modal-header {
        padding: 15px 20px;
    }
    
    .seasons-modal-body {
        padding: 20px;
    }
    
    .cp-seasons-panel {
        top: 15px;
        right: 15px;
    }
    
    .cp-seasons-btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    .custom-player {
        height: 280px;
    }
}

/* Основной контейнер плеера - унифицированные стили для всех устройств */

@media (max-width: 640px) {
    .custom-player {
        height: 240px;
    }
}

/* Адаптация для горизонтальной ориентации на мобильных */
@media (orientation: landscape) and (max-height: 500px) {
    .cp-progress {
        height: 3px !important;
        margin-bottom: 6px !important;
    }
    
    .cp-time {
        font-size: 10px !important;
        margin-bottom: 4px !important;
    }
    
    .cp-btn {
        padding: 4px 6px !important;
        font-size: 10px !important;
        min-height: 24px !important;
    }
    
    .cp-play {
        padding: 6px !important;
    }
    
    .cp-main-buttons {
        gap: 8px !important;
    }
    
    .cp-left-buttons,
    .cp-additional-buttons {
        gap: 6px !important;
    }
    
    /* Показываем кнопку режима отображения ТОЛЬКО в fullscreen в горизонтальном режиме */
    .custom-player:-webkit-full-screen .display-mode-btn,
    .custom-player:-moz-full-screen .display-mode-btn,
    .custom-player:fullscreen .display-mode-btn {
        display: flex !important;
        min-width: 35px !important;
        padding: 2px 4px !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
    }
    
    .custom-player:-webkit-full-screen .display-mode-text,
    .custom-player:-moz-full-screen .display-mode-text,
    .custom-player:fullscreen .display-mode-text {
        font-size: 8px !important;
        font-weight: 700 !important;
        white-space: nowrap !important;
        letter-spacing: 0.2px !important;
    }
}

/* Дополнительное правило для показа кнопки в fullscreen при горизонтальной ориентации */
@media screen and (orientation: landscape) {
    .custom-player:-webkit-full-screen .display-mode-btn,
    .custom-player:-moz-full-screen .display-mode-btn,
    .custom-player:fullscreen .display-mode-btn {
        display: flex !important;
        min-width: 40px !important;
        padding: 3px 5px !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
    }
    
    .custom-player:-webkit-full-screen .display-mode-text,
    .custom-player:-moz-full-screen .display-mode-text,
    .custom-player:fullscreen .display-mode-text {
        font-size: 9px !important;
        font-weight: 700 !important;
        white-space: nowrap !important;
        letter-spacing: 0.3px !important;
    }
}
    
/* Панель управления в полноэкранном режиме */
.custom-player:-webkit-full-screen .custom-player-controls,
.custom-player:-moz-full-screen .custom-player-controls,
.custom-player:fullscreen .custom-player-controls {
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        padding: 15px !important;
        padding-bottom: calc(15px + env(safe-area-inset-bottom, 0px)) !important;
        box-sizing: border-box !important;
    }
    
    /* Прогресс бар - фиксируем позицию */
    .cp-progress {
        position: relative;
        width: 100%;
        height: 4px;
        margin-bottom: 10px;
        order: 1;
    }
    
    /* Время - компактное отображение справа */
    .cp-time {
        font-size: 11px;
        margin-bottom: 8px;
        justify-content: flex-end;
        order: 2;
    }
    
    /* Строка с кнопками - горизонтальная компоновка в одну линию */
    .cp-controls-row {
        flex-direction: row;
        gap: 8px;
        align-items: center;
        order: 3;
        justify-content: space-between;
        flex-wrap: nowrap;
    }
    
    /* Левая группа - кнопка звука */
    .cp-left-buttons {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 0 0 auto;
        order: 1;
    }
    
    /* Центральные кнопки - play и перемотки */
    .cp-main-buttons {
        position: static;
        transform: none;
        gap: 15px;
        display: flex;
        align-items: center;
        flex: 0 0 auto;
        order: 2;
    }
    
    /* Дополнительные кнопки - настройки и полный экран справа */  
    .cp-additional-buttons {
        justify-content: flex-end;
        gap: 10px;
        display: flex;
        align-items: center;
        flex: 0 0 auto;
        flex-wrap: nowrap;
        order: 3;
    }
    
    /* Временно скрываем кнопку настроек полностью */
    .settings-container {
        display: none !important;
    }
    
    /* Компактный спиннер и текст загрузки на мобильных */
    .cp-loading-spinner {
        width: 40px;
        height: 40px;
        border-width: 3px;
        margin-bottom: 15px;
    }
    
    .cp-loading-text {
        font-size: 14px;
        line-height: 1.3;
    }
    
    .cp-loading-text small {
        font-size: 12px;
        opacity: 0.8;
    }
    
    /* Скрываем десктопный слайдер - используем только мобильное меню */
    .volume-desktop {
        display: none;
    }
    
    .volume-control {
        position: relative;
    }
    
    .volume-mobile-menu {
        position: absolute;
        bottom: 80px; /* Отступ от низа плеера */
        left: 20px; /* Отступ слева (рядом с кнопкой громкости) */
        transform: none;
        margin-bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        border-radius: 15px;
        padding: 8px 6px;
        width: 28px;
        height: 90px;
        backdrop-filter: blur(8px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
        display: none; /* По умолчанию скрыто */
        z-index: 50; /* Нормальный z-index */
    }
    
    .volume-mobile-menu:not(.hidden) {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    
    /* Отображение мобильного меню для всех устройств */
    .volume-mobile-menu:not(.hidden) {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .volume-mobile-slider {
        width: 4px;
        height: 74px;
        position: relative;
    }
    
    .volume-mobile-track {
        width: 100%;
        height: 100%;
        background: rgba(255, 255, 255, 0.25);
        border-radius: 2px;
        position: relative;
        cursor: pointer;
    }
    
    .volume-mobile-progress {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        background: #b9ff09;
        border-radius: 2px;
        height: 100%;
        transition: height 0.1s ease;
    }
    
    .volume-mobile-handle {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        width: 12px;
        height: 12px;
        background: #b9ff09;
        border-radius: 50%;
        cursor: grab;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
        border: 1px solid rgba(0, 0, 0, 0.6);
        top: 0;
        transition: top 0.1s ease;
    }
    
    .volume-mobile-handle:active {
        cursor: grabbing;
        transform: translateX(-50%) scale(1.1);
    }
    
    /* На очень низких экранах позиционируем НАД кнопкой громкости */
    @media (max-height: 400px) {
        .volume-mobile-menu {
            bottom: auto !important; /* Отключаем bottom */
            top: 85px !important; /* Позиция НАД кнопкой (высота меню + отступ) */
            left: 18px !important; /* Смещаем влево на 20% (20px - 20% = ~8px) */
            transform: none !important; /* Убираем центрирование */
            margin-bottom: 0 !important; /* Убираем margin, используем calc */
            margin-left: 0 !important;
            z-index: 1000 !important; /* Высокий z-index */
            width: 24px !important; /* Компактная ширина */
            height: 80px !important; /* Компактная высота */
        }
    }
    
    /* Громкость - компактная версия */
    .volume-control {
        gap: 5px;
    }
    
    .volume-slider {
        width: 50px;
    }
    
    /* Кнопки - уменьшаем размер */
    .cp-btn {
        padding: 6px 8px;
        font-size: 12px;
        min-height: 28px;
    }
    
    .cp-play {
        padding: 8px;
    }
    
    /* Кнопка сезонов - адаптируем позицию */
    .cp-seasons-panel {
        top: 10px;
        right: 10px;
    }
    
    .cp-seasons-btn {
        padding: 4px 8px;
        font-size: 14px;
    }
    
    /* Кнопка сезонов в полноэкранном режиме на мобильных */
    .custom-player:-webkit-full-screen .cp-seasons-panel,
    .custom-player:-moz-full-screen .cp-seasons-panel,
    .custom-player:fullscreen .cp-seasons-panel {
        top: env(safe-area-inset-top, 8px) !important;
        right: env(safe-area-inset-right, 8px) !important;
    }
    
    /* Скрываем кнопку сезонов при воспроизведении на мобильных в полноэкранном режиме */
    .custom-player:-webkit-full-screen.playing .cp-seasons-panel,
    .custom-player:-moz-full-screen.playing .cp-seasons-panel,
    .custom-player:fullscreen.playing .cp-seasons-panel {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
    
    /* Метаинформация - уменьшаем */
    .custom-player-meta {
        top: 10px;
        left: 10px;
    }
    
    .cp-meta-line {
        font-size: 11px;
    }
    
    .cp-meta-top {
        font-size: 13px;
    }
    
    .cp-meta-bottom {
        font-size: 10px;
    }
    
    /* Метаинформация в полноэкранном режиме на мобильных */
    .custom-player:-webkit-full-screen .custom-player-meta,
    .custom-player:-moz-full-screen .custom-player-meta,
    .custom-player:fullscreen .custom-player-meta {
        top: env(safe-area-inset-top, 8px) !important;
        left: env(safe-area-inset-left, 8px) !important;
    }
    
    /* Настройки - упрощаем меню */
    .settings-menu {
        min-width: 150px;
        right: -10px;
    }
    
    /* Модальное окно сезонов */
    .seasons-modal-content {
        margin: 10px;
        max-height: 90vh;
        width: 230px;
    }
    
    .seasons-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }
    
    .seasons-modal-header {
        padding: 12px 15px;
    }
    
    .seasons-modal-body {
        padding: 15px;
    }


/* Дополнительные стили для очень маленьких экранов */
@media (max-width: 360px) {
    .cp-main-buttons {
        gap: 15px;
    }
    
    .cp-additional-buttons {
        gap: 8px;
    }
    
    .cp-btn {
        padding: 5px 6px;
        font-size: 11px;
        min-height: 26px;
    }
    
    .display-mode-btn {
        display: none !important;
    }
    
    .volume-slider {
        width: 40px;
    }
    
    .seasons-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }
}

/* Кнопка режима отображения скрыта на планшетах кроме fullscreen в landscape */
@media (min-width: 481px) and (max-width: 768px) {
    .display-mode-btn {
        display: none !important;
    }
}

/* На десктопных устройствах с мышью показываем обычный слайдер */
@media (min-width: 769px) and (hover: hover) and (pointer: fine) {
    .volume-desktop {
        display: block !important;
    }
    
    /* НЕ скрываем мобильное меню в fullscreen */
    .custom-player:not(:-webkit-full-screen):not(:-moz-full-screen):not(:fullscreen) .volume-mobile-menu {
        display: none !important;
    }
    
    /* Кнопка режима отображения скрыта и на десктопе кроме fullscreen в landscape */
    .display-mode-btn {
        display: none !important;
    }
}

/* Для мобильных устройств и планшетов - всегда показываем мобильное меню в fullscreen */
@media (max-width: 768px), (hover: none), (pointer: coarse) {
    .volume-mobile-menu:not(.hidden) {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }
}

/* ===== ИСПРАВЛЕНИЕ ДЛЯ ГОРИЗОНТАЛЬНОЙ ОРИЕНТАЦИИ МОБИЛЬНЫХ ===== */
/* Специальные правила для мобильных устройств в горизонтальной ориентации */
@media (orientation: landscape) and (max-height: 480px) {
    /* Показываем кнопку режима отображения ТОЛЬКО в fullscreen в горизонтальном режиме */
    .custom-player:-webkit-full-screen .display-mode-btn,
    .custom-player:-moz-full-screen .display-mode-btn,
    .custom-player:fullscreen .display-mode-btn {
        display: flex !important;
        min-width: 32px !important;
        padding: 2px 3px !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
    }
    
    .custom-player:-webkit-full-screen .display-mode-text,
    .custom-player:-moz-full-screen .display-mode-text,
    .custom-player:fullscreen .display-mode-text {
        font-size: 7px !important;
        font-weight: 700 !important;
        white-space: nowrap !important;
        letter-spacing: 0.1px !important;
    }
    /* Уменьшаем отступы для горизонтальной ориентации */
    .custom-player-controls {
        bottom: 0 !important;
        left: 0;
        right: 0;
        padding: 12px;
    }
    
    .custom-player:-webkit-full-screen .custom-player-controls,
    .custom-player:-moz-full-screen .custom-player-controls,
    .custom-player:fullscreen .custom-player-controls {
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        padding: 10px !important;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
        background: linear-gradient(transparent, rgba(0, 0, 0, 0.9)) !important;
        box-sizing: border-box !important;
    }
    
    /* Компактный прогресс бар */
    .custom-player:-webkit-full-screen .cp-progress,
    .custom-player:-moz-full-screen .cp-progress,
    .custom-player:fullscreen .cp-progress {
        height: 3px !important;
        margin-bottom: 8px !important;
    }
    
    /* Уменьшаем время */
    .custom-player:-webkit-full-screen .cp-time,
    .custom-player:-moz-full-screen .cp-time,
    .custom-player:fullscreen .cp-time {
        font-size: 10px !important;
        margin-bottom: 5px !important;
    }
    
    /* Компактные кнопки управления */
    .custom-player:-webkit-full-screen .cp-btn,
    .custom-player:-moz-full-screen .cp-btn,
    .custom-player:fullscreen .cp-btn {
        padding: 4px 6px !important;
        font-size: 10px !important;
        min-height: 24px !important;
    }
    
    .custom-player:-webkit-full-screen .cp-play,
    .custom-player:-moz-full-screen .cp-play,
    .custom-player:fullscreen .cp-play {
        padding: 6px !important;
    }
    
    /* Уменьшаем отступы между кнопками */
    .custom-player:-webkit-full-screen .cp-main-buttons,
    .custom-player:-moz-full-screen .cp-main-buttons,
    .custom-player:fullscreen .cp-main-buttons {
        gap: 8px !important;
    }
    
    .custom-player:-webkit-full-screen .cp-left-buttons,
    .custom-player:-moz-full-screen .cp-left-buttons,
    .custom-player:fullscreen .cp-left-buttons,
    .custom-player:-webkit-full-screen .cp-additional-buttons,
    .custom-player:-moz-full-screen .cp-additional-buttons,
    .custom-player:fullscreen .cp-additional-buttons {
        gap: 6px !important;
    }
    
    /* Компактный слайдер громкости */
    .custom-player:-webkit-full-screen .volume-slider,
    .custom-player:-moz-full-screen .volume-slider,
    .custom-player:fullscreen .volume-slider {
        width: 40px !important;
    }
    

    
    /* Позиционирование элементов управления с учетом safe area */
    .custom-player:-webkit-full-screen .custom-player-controls,
    .custom-player:-moz-full-screen .custom-player-controls,
    .custom-player:fullscreen .custom-player-controls {
        bottom: env(safe-area-inset-bottom, 0px) !important;
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
    }
    
    /* Компактное мобильное меню громкости в горизонтальном режиме */
    .custom-player:-webkit-full-screen .volume-mobile-menu,
    .custom-player:-moz-full-screen .volume-mobile-menu,
    .custom-player:fullscreen .volume-mobile-menu {
        height: 60px !important;
        width: 24px !important;
        margin-bottom: 0 !important; /* Убираем margin, используем calc */
        left: 8px !important; /* Смещаем влево на 20% */
        top: -65px !important; /* Позиция НАД кнопкой (высота меню + отступ) */
        bottom: auto !important; /* Отключаем bottom */
        transform: none !important; /* Убираем центрирование */
        z-index: 1000 !important;
    }
    
    .custom-player:-webkit-full-screen .volume-mobile-slider,
    .custom-player:-moz-full-screen .volume-mobile-slider,
    .custom-player:fullscreen .volume-mobile-slider {
        height: 48px !important;
    }
}

/* Дополнительные правила для очень низких экранов в горизонтальной ориентации */
@media (orientation: landscape) and (max-height: 380px) {
    /* Показываем кнопку режима отображения ТОЛЬКО в fullscreen в горизонтальном режиме */
    .custom-player:-webkit-full-screen .display-mode-btn,
    .custom-player:-moz-full-screen .display-mode-btn,
    .custom-player:fullscreen .display-mode-btn {
        display: flex !important;
        min-width: 30px !important;
        padding: 1px 2px !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
    }
    
    .custom-player:-webkit-full-screen .display-mode-text,
    .custom-player:-moz-full-screen .display-mode-text,
    .custom-player:fullscreen .display-mode-text {
        font-size: 6px !important;
        font-weight: 700 !important;
        white-space: nowrap !important;
        letter-spacing: 0px !important;
    }
    /* Еще более компактные элементы управления */
    .custom-player-controls {
        bottom: 0 !important;
        left: 0;
        right: 0;
        padding: 8px;
    }
    
    .custom-player:-webkit-full-screen .custom-player-controls,
    .custom-player:-moz-full-screen .custom-player-controls,
    .custom-player:fullscreen .custom-player-controls {
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        padding: 6px !important;
        padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px)) !important;
        box-sizing: border-box !important;
    }
    
    .custom-player:-webkit-full-screen .cp-progress,
    .custom-player:-moz-full-screen .cp-progress,
    .custom-player:fullscreen .cp-progress {
        height: 2px !important;
        margin-bottom: 5px !important;
    }
    
    .custom-player:-webkit-full-screen .cp-time,
    .custom-player:-moz-full-screen .cp-time,
    .custom-player:fullscreen .cp-time {
        font-size: 9px !important;
        margin-bottom: 3px !important;
    }
    
    .custom-player:-webkit-full-screen .cp-btn,
    .custom-player:-moz-full-screen .cp-btn,
    .custom-player:fullscreen .cp-btn {
        padding: 3px 5px !important;
        min-height: 20px !important;
    }
    
    .custom-player:-webkit-full-screen .cp-play,
    .custom-player:-moz-full-screen .cp-play,
    .custom-player:fullscreen .cp-play {
        padding: 4px !important;
    }
    
    /* Скрываем слайдер громкости на очень низких экранах */
    .custom-player:-webkit-full-screen .volume-slider,
    .custom-player:-moz-full-screen .volume-slider,
    .custom-player:fullscreen .volume-slider {
        display: none !important;
    }
}

/* Специальные правила для экранов с высотой 460px и ниже */
@media (max-height: 460px) {
    .custom-player-controls {
        bottom: 0 !important;
        left: 0;
        right: 0;
        padding: 8px;
    }
    
    /* Уменьшаем размеры элементов */
    .cp-progress {
        height: 3px !important;
        margin-bottom: 6px !important;
    }
    
    .cp-time {
        font-size: 10px !important;
        margin-bottom: 4px !important;
    }
    
    .cp-btn {
        padding: 4px 6px !important;
        font-size: 10px !important;
        min-height: 22px !important;
    }
    
    .cp-play {
        padding: 5px !important;
    }
    
    /* Кнопка режима отображения скрыта для низких экранов (не в fullscreen) */
    .display-mode-btn {
        display: none !important;
    }
    
    /* НО показываем в fullscreen даже на низких экранах */
    .custom-player:-webkit-full-screen .display-mode-btn,
    .custom-player:-moz-full-screen .display-mode-btn,
    .custom-player:fullscreen .display-mode-btn {
        display: flex !important;
        min-width: 32px !important;
        padding: 3px 4px !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
    }
    
    .custom-player:-webkit-full-screen .display-mode-text,
    .custom-player:-moz-full-screen .display-mode-text,
    .custom-player:fullscreen .display-mode-text {
        font-size: 8px !important;
        font-weight: 700 !important;
        white-space: nowrap !important;
        letter-spacing: 0.1px !important;
    }
    
    /* Полноэкранный режим для низких экранов */
    .custom-player:-webkit-full-screen .custom-player-controls,
    .custom-player:-moz-full-screen .custom-player-controls,
    .custom-player:fullscreen .custom-player-controls {
        bottom: env(safe-area-inset-bottom, 2px) !important;
        left: env(safe-area-inset-left, 2px) !important;
        right: env(safe-area-inset-right, 2px) !important;
        padding: 6px !important;
    }
    
    /* Скрываем настройки на низких экранах */
    .settings-container {
        display: none !important;
    }
    
    /* Уменьшаем слайдер громкости */
    .volume-slider {
        width: 30px !important;
    }
}

/* Критически низкие экраны 400px и ниже */
@media (max-height: 400px) {
    .custom-player-controls {
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        padding-left: 15px;
        padding-right: 15px;
        box-sizing: border-box !important;
    }
    
    /* Минимальные размеры элементов */
    .cp-progress {
        height: 2px !important;
        margin-bottom: 12px !important;
    }
    
    .cp-time {
        font-size: 9px !important;
        margin-bottom: 2px !important;
    }
    
    .cp-btn {
        padding: 3px 4px !important;
        font-size: 9px !important;
        min-height: 18px !important;
    }
    
    .cp-play {
        padding: 4px !important;
    }
    
    /* Кнопка режима отображения скрыта для критически низких экранов (не в fullscreen) */
    .display-mode-btn {
        display: none !important;
    }
    
    /* НО показываем в fullscreen даже на критически низких экранах */
    .custom-player:-webkit-full-screen .display-mode-btn,
    .custom-player:-moz-full-screen .display-mode-btn,
    .custom-player:fullscreen .display-mode-btn {
        display: flex !important;
        min-width: 30px !important;
        padding: 2px 3px !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
    }
    
    .custom-player:-webkit-full-screen .display-mode-text,
    .custom-player:-moz-full-screen .display-mode-text,
    .custom-player:fullscreen .display-mode-text {
        font-size: 7px !important;
        font-weight: 700 !important;
        white-space: nowrap !important;
        letter-spacing: 0px !important;
    }
    
    /* Полноэкранный режим для критически низких экранов */
    .custom-player:-webkit-full-screen .custom-player-controls,
    .custom-player:-moz-full-screen .custom-player-controls,
    .custom-player:fullscreen .custom-player-controls {
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        padding: 4px !important;
        padding-bottom: calc(4px + env(safe-area-inset-bottom, 0px)) !important;
        box-sizing: border-box !important;
    }
    
    /* Скрываем слайдер громкости полностью */
    .volume-slider {
        display: none !important;
    }
    
    /* Уменьшаем отступы между кнопками */
    .cp-main-buttons {
        gap: 6px !important;
        margin-left: 40px;
    }
    
    .cp-left-buttons,
    .cp-additional-buttons {
        gap: 3px !important;
    }
}

/* Показывать панель при hover/focus даже в fullscreen */
.custom-player:-webkit-full-screen:hover .custom-player-controls,
.custom-player:-webkit-full-screen:focus .custom-player-controls,
.custom-player:-moz-full-screen:hover .custom-player-controls,
.custom-player:-moz-full-screen:focus .custom-player-controls,
.custom-player:fullscreen:hover .custom-player-controls,
.custom-player:fullscreen:focus .custom-player-controls {
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: all !important;
}

/* Универсальное правило для горизонтальной ориентации в fullscreen - по соотношению сторон */
@media screen and (min-aspect-ratio: 1/1) {
    .custom-player:-webkit-full-screen .display-mode-btn,
    .custom-player:-moz-full-screen .display-mode-btn,
    .custom-player:fullscreen .display-mode-btn {
        display: flex !important;
        min-width: 45px !important;
        padding: 4px 6px !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        background: rgba(255, 255, 255, 0.08) !important;
        border: 1px solid rgba(185, 255, 9, 0.41) !important;
        color: white !important;
        border-radius: 999px !important;
        cursor: pointer !important;
        transition: all 0.15s ease !important;
    }
    
    .custom-player:-webkit-full-screen .display-mode-text,
    .custom-player:-moz-full-screen .display-mode-text,
    .custom-player:fullscreen .display-mode-text {
        font-size: 10px !important;
        font-weight: 700 !important;
        white-space: nowrap !important;
        letter-spacing: 0.3px !important;
    }
}

/* Панель всегда видна в fullscreen когда видео НЕ играет */
.custom-player:-webkit-full-screen:not(.playing) .custom-player-controls,
.custom-player:-moz-full-screen:not(.playing) .custom-player-controls,
.custom-player:fullscreen:not(.playing) .custom-player-controls {
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: all !important;
}

/* СУПЕР ПРИОРИТЕТНОЕ ПРАВИЛО: Показ кнопки в fullscreen ВСЕГДА */
.custom-player:-webkit-full-screen .display-mode-btn[class],
.custom-player:-moz-full-screen .display-mode-btn[class],
.custom-player:fullscreen .display-mode-btn[class] {
    display: flex !important;
    min-width: 45px !important;
    padding: 4px 6px !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(185, 255, 9, 0.41) !important;
    color: white !important;
    border-radius: 999px !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    font-size: 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 999 !important;
}

.custom-player:-webkit-full-screen .display-mode-text[class],
.custom-player:-moz-full-screen .display-mode-text[class],
.custom-player:fullscreen .display-mode-text[class] {
    display: inline !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    letter-spacing: 0.3px !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: white !important;
}

/* Дополнительная адаптация для низких экранов в fullscreen */
@media (max-height: 460px) {
    .custom-player:-webkit-full-screen .cp-additional-buttons .display-mode-btn,
    .custom-player:-moz-full-screen .cp-additional-buttons .display-mode-btn,
    .custom-player:fullscreen .cp-additional-buttons .display-mode-btn {
        min-width: 35px !important;
        padding: 3px 4px !important;
    }
    
    .custom-player:-webkit-full-screen .cp-additional-buttons .display-mode-text,
    .custom-player:-moz-full-screen .cp-additional-buttons .display-mode-text,
    .custom-player:fullscreen .cp-additional-buttons .display-mode-text {
        font-size: 8px !important;
    }
}

@media (max-height: 400px) {
    .custom-player:-webkit-full-screen .cp-additional-buttons .display-mode-btn,
    .custom-player:-moz-full-screen .cp-additional-buttons .display-mode-btn,
    .custom-player:fullscreen .cp-additional-buttons .display-mode-btn {
        min-width: 32px !important;
        padding: 2px 3px !important;
    }
    
    .custom-player:-webkit-full-screen .cp-additional-buttons .display-mode-text,
    .custom-player:-moz-full-screen .cp-additional-buttons .display-mode-text,
    .custom-player:fullscreen .cp-additional-buttons .display-mode-text {
        font-size: 7px !important;
    }
}

/* Скрыть элементы по умолчанию */
.hidden {
    display: none !important;
}

/* Плавный переход для изменения object-fit */
.custom-player-video {
    transition: object-fit 0.3s ease;
}

/* ===== СЛАЙДЕР СЕРИЙ ===== */
.episodes-slider-container {
    margin: 30px 0;
    padding: 0 15px;
}

.episodes-slider-container h2 {
    margin-bottom: 20px;
    font-size: 22px;
    font-weight: 600;
    color: #333;
    text-align: center;
}

.episodes-slider {
    position: relative;
    padding: 0 50px;
}

.episode-slide-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease;
}

.episode-slide-link:hover {
    transform: translateY(-5px);
    text-decoration: none;
    color: inherit;
}

.episode-slide {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
}

.episode-slide:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.episode-image {
    position: relative;
    width: 100%;
    height: 160px;
    overflow: hidden;
}

.episode-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.episode-slide:hover .episode-image img {
    transform: scale(1.05);
}

.episode-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.episode-slide:hover .episode-overlay {
    opacity: 1;
}

.play-icon {
    color: #b9ff09;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.episode-info {
    padding: 8px;
}

.episode-number {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.episode-title {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.3;
    min-height: 32px;
}

.episode-duration {
    font-size: 11px;
    color: #666;
    font-weight: 400;
}

/* Активная серия */
.current-episode .episode-slide {
    border: 2px solid #b9ff09;
    box-shadow: 0 0 0 3px rgba(185, 255, 9, 0.2);
    background-color: #f5f2ef;
}

.current-episode .episode-image img {
    filter: blur(2px);
    opacity: 0.7;
}

.current-episode .episode-number {
    color: #333;
}

/* Ползунок для перемотки слайдов */
.episodes-slider-scrollbar {
    position: static !important;
    margin-top: 20px;
    height: 12px !important;
    background: rgba(0, 0, 0, 0.2) !important;
    border-radius: 6px !important;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.episodes-slider-scrollbar .swiper-scrollbar-drag {
    background: #333333 !important;
    border-radius: 6px !important;
    cursor: grab;
    transition: background-color 0.3s ease;
    opacity: 1 !important;
    height: 100% !important;
    top: 0 !important;
}

.episodes-slider-scrollbar .swiper-scrollbar-drag:active {
    cursor: grabbing;
    background: #000000 !important;
}

.episodes-slider-scrollbar:hover {
    background: rgba(0, 0, 0, 0.3) !important;
}

.episodes-slider-scrollbar:hover .swiper-scrollbar-drag {
    background: #000000 !important;
}

/* Адаптивность */
@media (max-width: 768px) {
    .episodes-slider-container {
        margin: 20px 0;
        padding: 0 10px;
    }
    
    .episodes-slider-container h2 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .episodes-slider {
        padding: 0 35px;
    }
    
    .episode-image {
        height: 140px;
    }
    
    .episode-info {
        padding: 6px;
    }
    
    .episode-title {
        font-size: 12px;
        min-height: 32px;
    }
    
    .episodes-slider-prev,
    .episodes-slider-next {
        width: 35px !important;
        height: 35px !important;
        margin-top: -17.5px !important;
    }
    
    .episodes-slider-prev::after,
    .episodes-slider-next::after {
        font-size: 14px !important;
    }
    
    .episodes-slider-prev {
        left: 5px !important;
    }
    
    .episodes-slider-next {
        right: 5px !important;
    }
}

@media (max-width: 480px) {
    .episodes-slider-container h2 {
        font-size: 16px;
    }
    
    .episode-image {
        height: 120px;
    }
    
    .episode-info {
        padding: 5px;
    }
    
    .episode-number {
        font-size: 13px;
    }
    
    .episode-title {
        font-size: 11px;
        min-height: 28px;
    }
    
    .episode-duration {
        font-size: 10px;
    }
}

/* Визуальная обратная связь при переключении режима отображения */
.display-mode-btn:active {
    background: rgba(185, 255, 9, 0.3) !important;
    border-color: #b9ff09 !important;
    transform: scale(0.95) !important;
}

/* Подсветка активного режима */
.display-mode-btn[data-mode="cover"] {
    background: rgba(255, 193, 7, 0.2);
    border-color: rgba(255, 193, 7, 0.6);
}

.display-mode-btn[data-mode="fill"] {
    background: rgba(220, 53, 69, 0.2);
    border-color: rgba(220, 53, 69, 0.6);
}

.display-mode-btn[data-mode="contain"] {
    background: rgba(13, 202, 240, 0.2);
    border-color: rgba(13, 202, 240, 0.6);
}

/* ФИНАЛЬНОЕ УНИВЕРСАЛЬНОЕ ПРАВИЛО - ПЕРЕКРЫВАЕТ ВСЕ МЕДИА-ЗАПРОСЫ */
.custom-player[style*="fullscreen"] .display-mode-btn,
.custom-player:-webkit-full-screen .display-mode-btn,
.custom-player:-moz-full-screen .display-mode-btn,
.custom-player:fullscreen .display-mode-btn,
body .custom-player:-webkit-full-screen .display-mode-btn,
body .custom-player:-moz-full-screen .display-mode-btn,
body .custom-player:fullscreen .display-mode-btn {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-width: 40px !important;
    padding: 3px 5px !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(185, 255, 9, 0.5) !important;
    color: white !important;
    border-radius: 999px !important;
    cursor: pointer !important;
    font-size: 0 !important;
    position: relative !important;
    z-index: 1000 !important;
}

body .custom-player:-webkit-full-screen .display-mode-text,
body .custom-player:-moz-full-screen .display-mode-text,
body .custom-player:fullscreen .display-mode-text {
    display: inline !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    letter-spacing: 0.2px !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: white !important;
}

/* Спиннер загрузки видео */
.cp-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 8;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.custom-player.loading .cp-loading-overlay {
    opacity: 1;
    visibility: visible;
}

.cp-loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid #b9ff09;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.cp-loading-text {
    color: white;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    line-height: 1.4;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Анимации при загрузке */
.custom-player {
    animation: playerFadeIn 0.5s ease-out;
}

@keyframes playerFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Улучшенные состояния кнопок */
.cp-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.cp-btn:disabled:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(185, 255, 9, 0.41);
}

/* Состояние загрузки */
.custom-player.loading .cp-play {
    position: relative;
    overflow: hidden;
}

.custom-player.loading .cp-play::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Скрыть старую центральную кнопку play */
.play-button,
.video-container .play-button,
.custom-player .play-button {
    display: none !important;
}

/* Убираем конфликтующие стили */
.video-controls-wrapper {
    display: none !important;
}

/* ===== ДИАЛОГ ОТЧЁТА О ПРОБЛЕМЕ ПО ЦЕНТРУ ===== */
.report-dialog-small {
    position: absolute;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid #444;
    border-radius: 12px;
    padding: 20px;
    width: 320px;
    z-index: 1000;
    animation: reportDialogFadeIn 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
}

@keyframes reportDialogFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.report-content-small h4 {
    color: #b9ff09;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.report-close-btn {
    background: none;
    border: none;
    color: #ccc;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.report-close-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.report-textarea-small {
    width: 100%;
    height: 80px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    color: #fff;
    padding: 12px;
    font-family: inherit;
    font-size: 14px;
    resize: none;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
    margin-bottom: 5px;
}

.report-textarea-small:focus {
    outline: none;
    border-color: #b9ff09;
    box-shadow: 0 0 0 1px rgba(185, 255, 9, 0.3);
}

.report-textarea-small::placeholder {
    color: #888;
}

.report-textarea-small[style*="border-color: red"] {
    border-color: #ff4444 !important;
    box-shadow: 0 0 0 1px rgba(255, 68, 68, 0.3) !important;
}

.captcha-small {
    margin-bottom: 10px;
}

.captcha-question-small {
    color: #fff;
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 500;
    text-align: center;
    background: #2a2a2a;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #444;
}

.captcha-answer-small {
    width: 100%;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 6px;
    color: #fff;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 14px;
    text-align: center;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
    margin-bottom: 15px;
}

.captcha-answer-small:focus {
    outline: none;
    border-color: #b9ff09;
    box-shadow: 0 0 0 1px rgba(185, 255, 9, 0.3);
}

.captcha-answer-small::placeholder {
    color: #888;
}

.captcha-answer-small[style*="border-color: red"] {
    border-color: #ff4444 !important;
    box-shadow: 0 0 0 1px rgba(255, 68, 68, 0.3) !important;
}

.send-report-small {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #b9ff09;
    color: #000;
}

.send-report-small:hover:not(:disabled) {
    background: #a8e808;
    transform: translateY(-1px);
}

.send-report-small:disabled {
    background: #666;
    color: #999;
    cursor: not-allowed;
    transform: none;
}

.sending-indicator-small {
    text-align: center;
    margin-top: 8px;
    color: #b9ff09;
    font-size: 11px;
    font-weight: 500;
}

.sending-indicator-small.hidden {
    display: none;
}

.success-message {
    text-align: center;
    color: #b9ff09;
    font-size: 12px;
    font-weight: 500;
    padding: 10px;
}

/* Контент модального окна в fullscreen режиме */
.custom-player:-webkit-full-screen .seasons-modal-content,
.custom-player:-moz-full-screen .seasons-modal-content,
.custom-player:fullscreen .seasons-modal-content {
    max-width: 90vw !important;
    max-height: 90vh !important;
    margin: 20px !important;
    z-index: 1000000 !important;
    position: relative !important;
}

/* Кнопка сезонов всегда видна в fullscreen на паузе */
.custom-player:-webkit-full-screen:not(.playing) .cp-seasons-panel,
.custom-player:-moz-full-screen:not(.playing) .cp-seasons-panel,
.custom-player:fullscreen:not(.playing) .cp-seasons-panel {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: all !important;
    z-index: 100 !important;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .report-dialog-small {
        width: 280px;
        padding: 15px;
        /* Центрирование сохраняется через transform в JS */
    }
    
    .report-textarea-small {
        height: 40px;
        font-size: 13px;
    }
    
    .captcha-question-small {
        font-size: 12px;
        padding: 8px;
    }
    
    .captcha-answer-small {
        font-size: 13px;
        padding: 8px 10px;
    }
    
    .send-report-small {
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* ===== ДОПОЛНИТЕЛЬНЫЕ ПРАВИЛА ДЛЯ КНОПКИ РЕЖИМА ОТОБРАЖЕНИЯ ===== */

/* Дополнительные правила для JavaScript-управляемых классов */
body .video-player.fullscreen .display-mode-btn,
body .video-player.fullscreen-active .display-mode-btn,
body .video-player[data-fullscreen="true"] .display-mode-btn {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: absolute !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 1000 !important;
}

/* Очень агрессивное правило для всех состояний fullscreen */
.display-mode-btn[style*="flex"],
.display-mode-btn[style*="visible"] {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Принудительное правило для всех разрешений в fullscreen */
html body .video-player:fullscreen .display-mode-btn,
html body .video-player:-webkit-full-screen .display-mode-btn,
html body .video-player:-moz-full-screen .display-mode-btn,
html body .video-player:-ms-fullscreen .display-mode-btn {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: absolute !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 2000 !important;
    pointer-events: auto !important;
}

/* ===== ДОПОЛНИТЕЛЬНЫЕ ПРАВИЛА ДЛЯ МОБИЛЬНОГО МЕНЮ ГРОМКОСТИ ===== */

/* Принудительное правило для мобильного меню громкости в горизонтальном режиме */
html body .custom-player .volume-mobile-menu:not(.hidden) {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 1500 !important;
    pointer-events: auto !important;
}

/* Специальные правила для низких экранов (горизонтальный режим) */
@media (max-height: 450px) {
    .volume-mobile-menu:not(.hidden) {
        position: absolute !important;
        top: -38px !important; /* Позиция НАД кнопкой (высота меню + отступ) */
        left: 19px !important; /* Смещаем влево на 20% */
        bottom: auto !important; /* Отключаем bottom */
        transform: none !important; /* Убираем центрирование */
        margin-bottom: 0 !important; /* Убираем margin, используем calc */
        z-index: 1500 !important;
        width: 24px !important;
        height: 70px !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* ===== СТИЛИ ДЛЯ КНОПКИ "СООБЩИТЬ О ПРОБЛЕМЕ" ===== */

/* Контейнер кнопок */
.report-problem-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
    width: 100%;
}

/* Основная кнопка "Сообщить о проблеме" */
.report-problem-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b6b, #ff5252);
    border: none;
    box-shadow: 0 3px 8px rgba(255, 107, 107, 0.3), 
                0 1px 3px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

/* Кнопка "Поделиться" */
.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border: none;
    box-shadow: 0 3px 8px rgba(76, 175, 80, 0.3), 
                0 1px 3px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

/* SVG иконки */
.report-problem-btn .report-icon,
.share-btn .share-icon {
    width: 20px;
    height: 20px;
    color: white;
    transition: all 0.3s ease;
}

/* Исправленная иконка для проблем */
.report-problem-btn .report-icon {
    fill: white;
}

.share-btn .share-icon {
    fill: white;
}

/* Состояние при наведении */
.report-problem-btn:hover {
    transform: translateY(-1px) scale(1.08);
    box-shadow: 0 6px 15px rgba(255, 107, 107, 0.4), 
                0 3px 6px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #ff5252, #f44336);
}

.share-btn:hover {
    transform: translateY(-1px) scale(1.08);
    box-shadow: 0 6px 15px rgba(76, 175, 80, 0.4), 
                0 3px 6px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #45a049, #388e3c);
}

/* Состояние при нажатии */
.report-problem-btn:active {
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 4px 10px rgba(255, 107, 107, 0.3);
}

.share-btn:active {
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 4px 10px rgba(76, 175, 80, 0.3);
}

/* Hover эффекты для иконок */
.report-problem-btn:hover .report-icon {
    transform: scale(1.1);
}

.share-btn:hover .share-icon {
    transform: scale(1.1);
}

/* Адаптивные стили для мобильных устройств */
@media (max-width: 480px) {
    .report-problem-container {
        justify-content: center;
        gap: 12px;
        margin: 12px 0;
    }
    
    .report-problem-btn,
    .share-btn {
        width: 38px;
        height: 38px;
    }
    
    .report-problem-btn .report-icon,
    .share-btn .share-icon {
        width: 18px;
        height: 18px;
        margin-right: 6px;
    }
    
    .report-problem-btn .report-text,
    .share-btn .share-text {
        font-size: 12px;
    }
    
    .report-problem-btn .triangle,
    .share-btn .triangle {
        border-left-width: 5px;
        border-right-width: 5px;
        margin-left: 6px;
    }
    
    .report-problem-btn .triangle {
        border-top-width: 6px;
    }
    
    .share-btn .triangle {
        border-top-width: 6px;
    }
    .custom-player {
        height: 240px;
    }
}

