/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #c9d9f2;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
}

/* ===== Palco 9:16, sempre inteiro na tela (qualquer celular) ===== */
.stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(100vw, calc(100vh * 9 / 16));
  height: min(100vh, calc(100vw * 16 / 9));
  transform: translate(-50%, -50%);
  overflow: hidden;
  background: #c9d9f2;
}
@supports (height: 100dvh) {
  .stage {
    width: min(100vw, calc(100dvh * 9 / 16));
    height: min(100dvh, calc(100vw * 16 / 9));
  }
}

.layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}
.cover { z-index: 1; }
.video { z-index: 2; opacity: 0; background: transparent; }
.video.on { opacity: 1; }

/* ===== Alvo (invisível) – mão esquerda da Elsa =====
   Área generosa, em % do palco */
.target {
  position: absolute;
  z-index: 3;
  left: 20%;
  top: 30%;
  width: 28%;
  height: 18%;
  pointer-events: none;
  /* para ver a área durante testes, descomente: */
  /* outline: 2px dashed red; */
}

/* ===== Objeto arrastável =====
   O wrapper é a área de toque (maior que a bola); (left, top) = CENTRO da bola, em % */
.ball {
  position: absolute;
  z-index: 5;
  left: 78.06%;
  top: 70.63%;
  width: 22%;
  height: 12.4%;
  transform: translate(-50%, -50%);
  display: none;
  align-items: center;
  justify-content: center;
  touch-action: none;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.ball.ready { display: flex; }
.ball.dragging { cursor: grabbing; z-index: 6; }

.ball img {
  width: 43%;              /* tamanho original da bola em relação ao wrapper */
  height: auto;
  pointer-events: none;    /* regra: a imagem nunca recebe o toque */
  -webkit-user-drag: none;
  user-select: none;
  filter: drop-shadow(0 0 6px rgba(120, 190, 255, .9));
  transition: transform .12s ease;
}
.ball.hint img { animation: pulso 1.6s ease-in-out infinite; }
.ball.dragging img { transform: scale(1.25); animation: none; }

.ball.pop { pointer-events: none; }
.ball.pop img { animation: pop .35s ease-out forwards; }

@keyframes pulso {
  0%, 100% { transform: scale(1);    filter: drop-shadow(0 0 5px rgba(120,190,255,.8)); }
  50%      { transform: scale(1.18); filter: drop-shadow(0 0 14px rgba(150,210,255,1)); }
}
@keyframes pop {
  to { transform: scale(2.2); opacity: 0; }
}

/* ===== Botões desenhados no vídeo: áreas invisíveis (mesma posição e tamanho) ===== */
.hotspots { position: absolute; inset: 0; z-index: 7; pointer-events: none; }
.hot {
  position: absolute;
  display: block;
  pointer-events: none;           /* só liga a partir do segundo em que o botão aparece */
  -webkit-tap-highlight-color: transparent;
  /* para ver as áreas durante testes: background: rgba(255,0,0,.3); */
}
.hotspots.active .hot { pointer-events: auto; }

.hot-local     { left: 23.33%; top: 89.27%; width: 27.50%; height: 2.97%; }
.hot-confirmar { left: 55.09%; top: 89.27%; width: 27.41%; height: 2.97%; }
.hot-sobre     { left: 36.20%; top: 92.92%; width: 27.50%; height: 2.92%; }

/* ===== Carregando ===== */
.loading {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 600 1rem/1.2 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #4f4a96;
  background: #c9d9f2;
  transition: opacity .4s ease;
}
.loading.done { opacity: 0; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .ball.hint img { animation: none; }
}
