.rotate-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 5vw, 3rem);
  background: radial-gradient(circle at 50% 30%, rgba(0, 170, 170, 0.9), rgba(0, 0, 0, 0.9));
  color: #e5f7ff;
  z-index: 30;
  touch-action: none;
  overscroll-behavior: contain;
}

.rotate-overlay.is-active {
  pointer-events: auto;
}

@media (orientation: portrait) and (max-width: 1024px), (max-aspect-ratio: 7 / 5) and (max-width: 1024px) {
  .rotate-overlay.is-active {
    display: flex;
  }
}

.rotate-overlay__panel {
  width: min(32.5rem, 92vw);
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 3vw, 1.5rem);
  align-items: center;
  padding: clamp(1.25rem, 4vw, 1.8rem);
  background: rgba(6, 18, 22, 0.88);
  border: 0.0625rem solid rgba(0, 200, 200, 0.5);
  border-radius: 1rem;
  box-shadow: 0 1.125rem 2.8125rem rgba(0, 0, 0, 0.65), 0 0.375rem 1.125rem rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(0.375rem);
}

.rotate-overlay__icon {
  position: relative;
  width: clamp(5.5rem, 22vw, 7.5rem);
  height: clamp(5.5rem, 22vw, 7.5rem);
  display: grid;
  place-items: center;
}

.rotate-overlay__device {
  border: 0.125rem solid rgba(0, 220, 220, 0.8);
  border-radius: 0.8rem;
  background: rgba(0, 130, 130, 0.2);
  box-shadow: 0 0 1.25rem rgba(0, 200, 200, 0.35);
}

.rotate-overlay__device--portrait {
  width: 3rem;
  height: 5.25rem;
  opacity: 0.9;
  animation: rotate-device 2.8s ease-in-out infinite;
}

.rotate-overlay__device--landscape {
  width: 5.25rem;
  height: 3rem;
  position: absolute;
  transform: rotate(-90deg);
  opacity: 0.3;
}

.rotate-overlay__hint-line {
  position: absolute;
  width: 70%;
  height: 0.125rem;
  background: linear-gradient(90deg, rgba(0, 200, 200, 0), rgba(0, 200, 200, 0.8), rgba(0, 200, 200, 0));
  transform: rotate(-20deg);
  opacity: 0.6;
}

.rotate-overlay__text {
  display: flex;
  flex-direction: column;
  text-align: center;
  gap: 0.35rem;
  font-family: "ComixLoud", sans-serif;
  padding-left: 1rem;
}

.rotate-overlay__title {
  font-size: clamp(1.2rem, 4vw, 1.6rem);
  padding-bottom: 1rem;
}

.rotate-overlay__subtitle {
  font-size: clamp(0.95rem, 3.3vw, 1.1rem);
  color: rgba(229, 247, 255, 0.82);
  line-height: 2;
}

body.viewport-locked {
  touch-action: none;
}

@keyframes rotate-device {
  0% {
    transform: rotate(0deg) translateY(0);
    opacity: 0.95;
  }
  40% {
    transform: rotate(90deg) translateY(-0.25rem);
    opacity: 1;
  }
  60% {
    transform: rotate(90deg) translateY(-0.25rem);
    opacity: 1;
  }
  100% {
    transform: rotate(0deg) translateY(0);
    opacity: 0.95;
  }
}
