.neo-player-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.neo-player-wrapper * { box-sizing: border-box; }

/* Видео (превью и основное) */
.neo-player-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.neo-preview { z-index: 10; } 
.neo-video { z-index: 2; }

/* Loader */
.neo-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

/* Спиннер-обёртка */
.neo-loader-circle {
    width: 50px;
    height: 50px;
    position: relative;
}

/* SVG внутри круга */
.neo-loader-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    will-change: transform;
}

/* Задний круг */
.neo-loader-circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.15);
    stroke-width: 3;
}

/* Круг прогресса */
.neo-loader-circle-progress {
    fill: none;
    stroke: #fff;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 94.2;
    stroke-dashoffset: 94.2;
    will-change: stroke-dashoffset;
}

/* Анимация вращения спиннера */
@keyframes spin-loader {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Класс, который включает вращение */
.neo-loader-spinner {
    animation: spin-loader 2s linear infinite;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
}

.neo-loader-text {
    display: none !important;
}

/* Big Play */
.neo-big-play {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 100px; height: 100px;
    border-radius: 50%; background: rgba(24,121,174,0.3);
    border: 2px solid #1879AE;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.25s;
    z-index: 15;
}
.neo-big-play:hover {
    transform: translate(-50%, -50%) scale(1.08);
    background: rgba(24,121,174,0.45);
}
.neo-big-play span { display: flex; align-items: center; justify-content: center; }
.neo-big-play svg { filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)); }

/* ✅ Кнопка повтора в центре после окончания видео */
.neo-replay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    display: none; /* По умолчанию скрыта */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 25;
    transition: all 0.2s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.neo-replay:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translate(-50%, -50%) scale(1.08);
    border-color: rgba(255, 255, 255, 0.4);
}

.neo-replay span {
    display: flex;
    align-items: center;
    justify-content: center;
}

.neo-replay svg {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* ✅ Иконка повтора для первого плеера (::before маска) */
.neo-replay-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.neo-replay-icon::before {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='white' d='M12 5V2L8 6l4 4V7c2.76 0 5 2.24 5 5 0 1.2-.42 2.29-1.12 3.16l1.46 1.46C18.34 15.32 19 13.74 19 12c0-3.87-3.13-7-7-7zm-5.34 2.34L5.2 8.8C4.26 9.93 3.7 11.4 3.7 13c0 3.87 3.13 7 7 7v3l4-4-4-4v3c-2.76 0-5-2.24-5-5 0-1.22.44-2.34 1.16-3.22z'/%3E%3C/svg%3E") center/contain no-repeat;
    background: #ffffff;
}

/* Controls */
.neo-controls {
    position: absolute;
    bottom: 0; left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 40px 16px 16px;
    z-index: 30;
    opacity: 1; transition: opacity 0.3s;
}

/* Progress bar */
.neo-progress-bar-wrapper {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    padding: 0 12px 8px 12px;
    background: transparent;
    box-sizing: border-box;
    z-index: 35;
    transition: opacity 0.3s;
    opacity: 1;
}

.neo-progress {
    position: relative;
    width: 100%;
    height: 12px;
    padding: 4px 0 4px 0;
    background: transparent;
    cursor: pointer;
}

.neo-progress-filled {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    transform: none;
    height: 4px;
    border-radius: 999px;
    background: #1879AE;
    width: 0%;
    transition: width 0.1s linear;
}

/* Bottom controls */
.neo-bottom {
    display: flex; align-items: center; gap: 8px;
    justify-content: flex-start; flex-wrap: wrap; width: 100%;
}
.neo-bottom .neo-play, .neo-bottom .neo-volume, .neo-bottom .neo-quality, .neo-bottom .neo-speed {
    flex-shrink: 0; white-space: nowrap;
}
.neo-bottom .neo-pip { flex-shrink: 0; margin-left: auto; }
.neo-bottom .neo-fullscreen { flex-shrink: 0; margin-left: 0; }

@media (max-width: 768px) {
    /* Обёртка мобильного плеера */
    .neo-player-wrapper.neo-player-mobile {
        position: relative;
        margin-bottom: 0;
    }

    /* Кнопки управления не поднимать, оставить на месте под видео */
    .neo-controls .neo-bottom {
        padding-bottom: 0;
    }
}

/* Кнопки */
.neo-btn {
    background: none; border: none;
    padding: 6px 8px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: white; border-radius: 4px; flex-shrink: 0;
    transition: all 0.2s;
}
.neo-btn:hover { background: rgba(255,255,255,0.1); }
.neo-btn:focus { outline: none; box-shadow: 0 0 0 2px rgba(24,121,174,0.5); }
.neo-btn:focus-visible { outline: 2px solid #1879AE; outline-offset: 2px; }
.neo-btn svg { width: 20px; height: 20px; display: block; }

/* Иконки */
.neo-play-icon, .neo-fullscreen-icon, .neo-pip-icon {
    display: flex; align-items: center; justify-content: center;
    width: 20px; height: 20px;
}
.neo-play-icon svg, .neo-fullscreen-icon svg, .neo-pip-icon svg {
    width: 100%; height: 100%; display: block;
}

/* Громкость */
.neo-volume {
    width: 80px; height: 4px;
    -webkit-appearance: none; appearance: none;
    background: rgba(255,255,255,0.2); border-radius: 2px;
    outline: none; cursor: pointer; flex-shrink: 0;
    border: none; padding: 0;
}
.neo-volume::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 12px; height: 12px;
    background: #1879AE; border-radius: 50%; cursor: pointer;
    border: none; transition: all 0.2s;
}
.neo-volume::-webkit-slider-thumb:hover {
    width: 14px; height: 14px; background: #2090D0;
}
.neo-volume::-moz-range-thumb {
    width: 12px; height: 12px; background: #1879AE;
    border: none; border-radius: 50%; cursor: pointer; transition: 0.2s;
}
.neo-volume::-moz-range-thumb:hover {
    width: 14px; height: 14px; background: #2090D0;
}
.neo-volume::-moz-range-track { background: transparent; border: none; }
.neo-volume:focus { outline: none; }

/* Селекты */
.neo-select {
    background: rgba(255,255,255,0.15); color: white;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 6px 8px; border-radius: 4px;
    font-size: 12px; cursor: pointer; font-family: inherit;
    transition: all 0.2s; flex-shrink: 0;
}
.neo-select:hover { background: rgba(255,255,255,0.25); }
.neo-select:focus { outline: none; background: rgba(24,121,174,0.3); border-color: #1879AE; }
.neo-select:focus-visible { outline: 2px solid #1879AE; outline-offset: 2px; }
.neo-select option { background: #1a1a1a; color: white; padding: 4px; }

/* Fullscreen */
.neo-player-wrapper:fullscreen,
.neo-player-wrapper:-webkit-full-screen,
.neo-player-wrapper:-moz-full-screen,
.neo-player-wrapper:-ms-fullscreen {
    width: 100vw; height: 100vh; aspect-ratio: auto; border-radius: 0;
}

/* Адаптив */
@media (max-width: 768px) {
    .neo-big-play { width: 64px; height: 64px; }
    .neo-big-play svg { width: 36px; height: 36px; }
    .neo-replay { width: 64px; height: 64px; }
    .neo-replay svg { width: 36px; height: 36px; }
    .neo-bottom { gap: 6px; }
    .neo-volume { width: 60px; }
    .neo-select { font-size: 11px; padding: 4px 6px; }
    .neo-btn svg { width: 18px; height: 18px; }

}
@media (max-width: 480px) {
    .neo-big-play { width: 48px; height: 48px; }
    .neo-big-play svg { width: 28px; height: 28px; }
    .neo-replay { width: 48px; height: 48px; }
    .neo-replay svg { width: 28px; height: 28px; }
    .neo-controls { padding: 30px 12px 12px; }
    .neo-btn { padding: 4px 6px; }
    .neo-btn svg { width: 16px; height: 16px; }
    .neo-volume { width: 50px; height: 3px; }
    .neo-select { font-size: 10px; padding: 3px 4px; }
    .neo-bottom { gap: 4px; }
    .neo-play-icon, .neo-fullscreen-icon, .neo-pip-icon { width: 16px; height: 16px; }
}

/* === МОБИЛЬНАЯ ВЕРСИЯ: квадратный второй плеер === */
@media (max-width: 768px) {

    #neo-player-2 {
        aspect-ratio: 1 / 1; /* квадрат */
        overflow: hidden;    /* чтобы видео не вылазило */
    }

    #neo-player-2 video,
    #neo-player-2 .neo-preview,
    #neo-player-2 .neo-video {
        object-fit: cover;
        width: 100%;
        height: 100%;
    }
}
