/* Общий фон и позиционирование */
#previewWrap {
    position: fixed;
    top: 0; left: 0; 
    width: 100vw; height: 100vh;
    background: transparent; 
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    z-index: 9998;
}

/* Контейнер видео с жестким соотношением 9:16 */
.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* МАГИЯ АДАПТИВНОСТИ: 
  На мобильных (до 768px) видео резиновое на весь экран.
  На ПК ограничено по высоте окна (100vh) с пропорцией 9:16.
*/
@media (min-width: 768px) {
    .video-container {
        height: 100vh;
        width: auto;
        aspect-ratio: 9 / 16;
    }
}

/* Сами видео-плееры */
.ava-video {
    position: absolute;
    top: 0; left: 0;
    width: 100%; 
    height: 100%;
    object-fit: cover;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease-in-out;
}

/* Активное видео выводится на передний план */
.ava-video.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

/* Прелоадер */
#avaPreloader {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: #000;
    display: flex; justify-content: center; align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}
.ava-spinner {
    width: 50px; height: 50px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #00FF88;
    animation: spin 1s ease-in-out infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* СТЕКЛЯННАЯ ПУЛЬСИРУЮЩАЯ КНОПКА PLAY */
#avaPlayBtn {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 80px; height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: white;
    display: none; /* Покажется через JS после загрузки */
    justify-content: center; align-items: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    animation: ava-pulse 2s infinite cubic-bezier(0.66, 0, 0, 1);
}

#avaPlayBtn svg {
    width: 35px; height: 35px;
    margin-left: 6px; /* Оптическое выравнивание треугольника */
}

@keyframes ava-pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.5); }
    70% { box-shadow: 0 0 0 25px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}