/* ========== PRELOADER BASE ========== */

.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;              /* включаем через media-queries */
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, #020617 0%, #020617 55%, #020617 100%);
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

/* Когда прелоадер скрыт */
.preloader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Контейнер для видео + fallback-фото */
.preloader-media {
  position: relative;
  width: 320px;
  height: 320px;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Фото и видео друг над другом */
.preloader-fallback,
.preloader-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Если нужно спрятать видео (ошибка / таймаут) */
.preloader-video.is-hidden {
  opacity: 0;
  visibility: hidden;
}

/* Лого поверх */
.preloader-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.preloader-logo {
  width: 120px;
  height: auto;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.9));
}

/* ========== DESKTOP vs MOBILE ========== */

/* По умолчанию оба скрыты, включаем нужный */
@media (min-width: 769px) {
  #preloader {
    display: flex;
  }
}

@media (max-width: 768px) {
  #preloader_mobile {
    display: flex;
  }

  .preloader-media {
    width: 100vw;
    height: 100vh;
  }
}
