body {
  /* margin: 0; */
  background: #000;
  color: white;
  font-family: sans-serif;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  min-height: 100vh;
  min-height: 100dvh;
  transition:
    opacity 0.6s ease,
    filter 0.6s ease;
}

body.is-exiting {
  opacity: 0.35;
  filter: blur(4px);
}
#container {
  position: relative;
  width: 100%;
  /* max-width: 1600px; */
  height: 80vh;
  display: flex;
  justify-content: center;
  align-items: center;
}
/* object-fit: contain гарантирует, что видео и канвас совпадут по пропорциям */
video,
canvas {
  position: absolute;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
canvas {
  z-index: 10;
  pointer-events: none;
}
#overlay-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
  background: #000;
  opacity: 0; /* Прозрачный */
  transition: opacity 1.5s ease-in-out; /* Плавное проявление за 1.5 секунды */
}
/* Класс, который мы будем добавлять через JS */
#overlay-video.visible {
  opacity: 1;
}
#status-bar {
  padding: 10px;
  text-align: center;
  z-index: 20;
}
.btn {
  padding: 15px 30px;
  font-size: 1rem;
  margin-top: 10px;
}
.is-hidden {
  display: none;
}
#exit-btn {
  position: absolute;
  bottom: 20px;
  left: 20px;
  z-index: 100;
  padding: 15px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: 1px solid white;
  border-radius: 30px;
  cursor: pointer;
}

@media (max-width: 640px) {
  body {
    padding: 12px;
  }

  #container {
    height: 70vh;
  }

  .btn {
    width: 100%;
    padding: 12px 16px;
  }

  #exit-btn {
    bottom: 12px;
    left: 12px;
    padding: 12px;
  }
}
.overlay-3d {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  z-index: 20;
  color: white;
  text-align: center;
}
model-viewer {
  width: 100%;
  height: 100%;
}

.exit-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.exit-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.exit-overlay__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: #fff;
  font-size: 1.2rem;
  letter-spacing: 0.4px;
}

.exit-overlay__spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  animation: exit-spin 0.9s linear infinite;
}

@keyframes exit-spin {
  to {
    transform: rotate(360deg);
  }
}
