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

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #b9d6ee;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  font-family: "Trebuchet MS", "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* ============ Palco 9:16 ============
   Altura = altura da tela; largura = altura × 9/16.
   Em celulares mais "compridos" que 9:16 as bordas laterais são cortadas um pouco;
   em telas mais largas (PC/tablet) sobram faixas azuis dos lados.
   Tudo dentro do palco usa % — por isso funciona em qualquer tamanho. */
.palco {
  --h: 100vh;
  --h: 100dvh;
  position: absolute;
  top: 0;
  left: 50%;
  height: var(--h);
  width: calc(var(--h) * 9 / 16);
  transform: translateX(-50%);
  overflow: hidden;
  touch-action: none;
  background: #cfe3f4;
}

.camada {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  display: block;
}

/* Vídeo principal: começa invisível e aparece com fade ao acertar o alvo */
.convite { opacity: 0; transition: opacity .7s ease; }
.convite.on { opacity: 1; }

/* ============ Alvo (invisível) ============ */
.alvo {
  position: absolute;
  pointer-events: none;
  /* left/top/width/height definidos em % pelo script.js */
}
body.debug .alvo { outline: 3px dashed rgba(255, 0, 80, .9); background: rgba(255, 0, 80, .12); }

/* ============ Pássaro (objeto arrastável) ============ */
.passaro {
  position: absolute;
  left: 64.8%;           /* posição inicial: sobre a cerca, perto do centro-direita (centro do objeto) */
  top: 83.5%;
  width: 17.4%;
  aspect-ratio: 150 / 146;
  transform: translate(-50%, -50%);
  cursor: grab;
  touch-action: none;    /* o navegador não rola/zoom ao arrastar */
  z-index: 3;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
/* área de toque mais generosa que a imagem */
.passaro::before {
  content: "";
  position: absolute;
  inset: -35%;
}
.passaro img {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;           /* regra: nunca o toque direto na <img> */
  -webkit-user-drag: none;
  user-select: none;
  transition: transform .18s ease, filter .18s ease, opacity .5s ease;
}
.passaro.arrastando { cursor: grabbing; z-index: 4; }
.passaro.arrastando img {
  transform: scale(1.15) rotate(-5deg);
  filter: drop-shadow(0 8px 8px rgba(80, 60, 50, .35));
}

/* animação de "entrar na casinha" ao acertar */
.passaro.entrando {
  pointer-events: none;
  transition: left .55s cubic-bezier(.3, .7, .3, 1), top .55s cubic-bezier(.3, .7, .3, 1);
}
.passaro.entrando img { transform: scale(.3); opacity: 0; filter: none; transition: transform .55s ease-in, opacity .55s ease-in; }
.passaro.sumiu { display: none; }

/* ============ Áreas clicáveis sobre os botões do vídeo ============ */
.hotspot {
  position: absolute;
  z-index: 6;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: none;          /* só ficam ativas a partir do segundo em que o botão aparece */
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
  /* left/top/width/height definidos em % pelo script.js */
}
.hotspot.ativo { pointer-events: auto; }
body.debug .hotspot { outline: 3px dashed rgba(0, 120, 255, .9); background: rgba(0, 120, 255, .15); }

/* ============ Tela de exemplo: Confirmar presença ============ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(70, 50, 50, .5);
  overflow-y: auto;
  -webkit-user-select: auto;
  user-select: auto;
}
.modal[hidden] { display: none; }

.cartao {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 26px 22px 22px;
  border-radius: 24px;
  background: #fffaf4;
  border: 3px solid #e8a3a0;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .25);
  color: #6d704a;
  text-align: center;
}
.cartao h2 { margin: 0 0 6px; font-size: 1.6rem; color: #d98f93; letter-spacing: .5px; }
.sub { margin: 0 0 16px; font-size: .95rem; line-height: 1.4; color: #8a8f5a; }

.fechar {
  position: absolute; top: 8px; right: 12px;
  width: 36px; height: 36px;
  border: 0; background: transparent;
  font-size: 2rem; line-height: 1; color: #b9a3a0; cursor: pointer;
}

.aviso-mockup {
  margin: -4px -4px 14px;
  padding: 7px 10px;
  border-radius: 10px;
  background: #fff1c9;
  border: 1px dashed #d9a93a;
  color: #8a6a12;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.3;
}
.aviso-mockup[hidden] { display: none; }

.campo { display: block; margin-bottom: 12px; text-align: left; }
.campo span { display: block; margin-bottom: 4px; font-size: .85rem; font-weight: 700; color: #8a8f5a; }
.campo input, .campo select {
  width: 100%;
  padding: 11px 12px;
  border: 2px solid #f0cfcc;
  border-radius: 12px;
  background: #fff;
  font: inherit;
  font-size: 1rem;           /* 16px+ evita zoom automático no iPhone */
  color: #5d5f3f;
}
.campo input:focus, .campo select:focus { outline: none; border-color: #e8a3a0; }

.opcoes { margin: 0 0 16px; padding: 0; border: 0; text-align: left; }
.opcoes label { display: flex; align-items: center; gap: 10px; padding: 8px 4px; font-size: .95rem; cursor: pointer; }
.opcoes input { width: 20px; height: 20px; accent-color: #e8a3a0; }

.enviar {
  width: 100%;
  padding: 13px 16px;
  border: 0;
  border-radius: 14px;
  background: #e8a3a0;
  box-shadow: 0 5px 0 #c98f8c;
  color: #fff;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
  cursor: pointer;
}
.enviar:active { transform: translateY(3px); box-shadow: 0 2px 0 #c98f8c; }

.obrigado[hidden] { display: none; }
.obrigado .flor { font-size: 3rem; margin-bottom: 4px; }
.obrigado p { margin: 0 0 18px; line-height: 1.4; }
