html,
body {
  height: 100%;
  margin: 0;
  background: #000;
  overflow: hidden;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
.scene {
  position: relative;
}

.scene > video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  z-index: 1;
  display: block;
}

.frame {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  z-index: 6;
  display: block;

  pointer-events: none;
}

.filter {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 5;
  display: block;
  mix-blend-mode: screen;
  opacity: 0.75;
  pointer-events: none;
}

.gate {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
  cursor: pointer;
}
.gate.is-on {
  opacity: 1;
  pointer-events: none;
}
.gate img {
  width: 25vw;
  height: auto;
  display: block;
  position: absolute;
  top: 1%;
  pointer-events: auto;
  cursor: pointer;
  transition: opacity 1s ease;
  animation: levitate 3.2s ease-in-out infinite;
}
.gate img:hover {
  animation-play-state: paused;
  transform: translateY(-6px) scale(1.02);
  filter: brightness(1.4);
}

@keyframes levitate {
  0% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-10px) scale(1.01);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .gate img {
    animation: none;
  }
}
.finals {
  position: fixed;
  inset: 0;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
.finals.is-on {
  opacity: 1;
  pointer-events: auto;
}

.finals::before {
  content: "";
  position: absolute;
  left: var(--box-left, 0);
  top: var(--box-top, 0);
  width: var(--box-w, 100%);
  height: var(--box-h, 100%);
  pointer-events: none;
}

.finals__pin {
  position: absolute;
  left: calc(var(--box-left, 0) + var(--pin-left, 0));
  top: calc(var(--box-top, 0) + var(--pin-top, 0));
  transform: translate(-50%, -50%);
}
.finals img {
  height: auto;
  display: block;
  transition: filter 0.2s ease;
}
.finals img:hover {
  filter: brightness(1.4);
}
.trigger-layer {
  position: fixed;
  inset: 0;
  z-index: 6;
  background: transparent;
  pointer-events: auto;
  touch-action: none;
}
.tap-start {
  position: fixed;
  inset: 0;
  z-index: 7;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.tap-start.is-on {
  opacity: 1;
  pointer-events: auto;
}
.tap-start__inner {
  color: #fff;
  font: 600 20px/1.2 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  padding: 14px 18px;
  border: 2px solid #fff;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(4px);
}
.rotate-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  background: #000;
  color: #fff;
  text-align: center;
  padding: 24px;
  pointer-events: none; /* включим в .is-on */
  font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
.rotate-overlay .rotate-box {
  max-width: 90vw;
}
.rotate-overlay .rotate-emoji {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.9;
}
.rotate-overlay .rotate-title {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.3px;
}

.rotate-overlay.is-on {
  display: flex;
  pointer-events: auto;
}

@media screen and (orientation: portrait) and (max-width: 900px) {
  .rotate-overlay {
    display: flex;
    pointer-events: auto;
  }
}

@media screen and (max-aspect-ratio: 10/11) and (max-width: 900px) {
  .rotate-overlay {
    display: flex;
    pointer-events: auto;
  }
}
