﻿/* =========================
   VARIAVEIS E CORES
   ========================= */
:root {
  --stage-width: 1080px;   /* Largura base do convite vertical. */
  --stage-height: 1920px;  /* Altura base do convite vertical. */
  --stage-scale: 1;        /* Atualizado pelo JavaScript para caber na tela. */
}

/* =========================
   RESET E CONFIGURACOES GERAIS
   ========================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: 'Cormorant Garamond', Georgia, serif;
}

img, video {
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
}

button {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
}

/* =========================
   ESTRUTURA PRINCIPAL DO CONVITE
   ========================= */
#inviteViewport {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #2a1a1a 0%, #000 70%);
  overflow: hidden;
}

#canvas1080v {
  position: relative;
  width: var(--stage-width);
  height: var(--stage-height);
  flex: 0 0 auto;
  background: #000;
  overflow: hidden;
  transform-origin: center center;
  transform: scale(var(--stage-scale, 1));
  box-shadow: 0 30px 90px rgba(0,0,0,.6);
  touch-action: manipulation;
}

.layerImg,
.layerVideo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

#layerArcoiris {
  z-index: 1;
}

/* =========================
   VIDEO PRINCIPAL
   ========================= */
#video {
  z-index: 2;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
}

#video.show {
  opacity: 1;
}

/* =========================
   MOLDURA FINAL
   ========================= */
#layerFinal {
  z-index: 3;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
}

#layerFinal.show {
  opacity: 1;
}

/* =========================
   LOGO LYNN DESIGN
   ========================= */
#brandLogo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  user-select: none;
  z-index: 200 !important; /* Mantem o logo acima de todo o conteudo do convite. */
  opacity: 1;
  transition: opacity 1.2s ease;
  animation: brandFloat 6s ease-in-out infinite;
}

#brandLogo.show {
  opacity: 1;
}

@keyframes brandFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.01); }
}

/* =========================
   BOTAO PULAR ABERTURA
   ========================= */
#skipButton {
  position: absolute;
  top: 56px;    /* Ajuste a distancia do topo. */
  right: 56px;  /* Ajuste a distancia da direita. */
  padding: 18px 36px;
  font-family: inherit;
  font-size: 30px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 60px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity .6s ease, transform .6s ease, background .3s ease;
  z-index: 20;
}

#skipButton.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

#skipButton:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,.55);
}

/* =========================
   BOTOES DE ACAO
   ========================= */
#botoesFinais {
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s ease;
}

#botoesFinais.show {
  opacity: 1;
  pointer-events: auto;
}

.btn-final {
  position: absolute;
  width: 165px;   /* Ajuste o tamanho padrao dos botoes finais. */
  height: 165px;  /* Ajuste o tamanho padrao dos botoes finais. */
  padding: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: transform .15s ease;
}

#botoesFinais.show .btn-final {
  pointer-events: auto;
}

.btn-final img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.btn-final:hover {
  transform: translate(-50%, -50%) scale(1.04);
}

.btn-final:active {
  transform: translate(-50%, -50%) scale(0.96);
}

/* Posicoes dos botoes sobre a arte final.png. */
#btnConfirmar {
  left: 430px;
  top: 890px;
  width: 165px;
  height: 165px;
}

#btnLocal {
  left: 650px;
  top: 890px;
  width: 165px;
  height: 165px;
}

#btnPresentes {
  left: 430px;
  top: 1100px;
  width: 165px;
  height: 165px;
}

#btnManual {
  left: 650px;
  top: 1100px;
  width: 165px;
  height: 165px;
}

/* =========================
   AVISO PARA INICIAR O VIDEO
   ========================= */
#hintVideo {
  display: none;
  position: absolute;
  left: 50%;
  bottom: 14%;
  transform: translateX(-50%);
  max-width: 88%;
  padding: 18px 28px;
  border-radius: 18px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font: 600 28px/1.2 system-ui, -apple-system, Segoe UI, Roboto, Arial;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 40;
}

/* =========================
   OVERLAYS DE MANUAL E PRESENTES
   ========================= */
.overlayConvite {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
}

.overlayConvite.active {
  display: flex;
}

.overlayConvite > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.fecharOverlay {
  position: absolute;
  top: 36px;
  right: 36px;
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,.18);
  color: #fff;
  border-radius: 20px;
  font-size: 56px;
  line-height: 1;
  z-index: 70;
  backdrop-filter: blur(6px);
}

#pixImage {
  cursor: pointer;
}

/* =========================
   TOAST PIX
   ========================= */
#toastPix {
  display: none;
  position: absolute;
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.82);
  color: #fff;
  padding: 22px 32px;
  border-radius: 18px;
  font-weight: 700;
  font-size: 28px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
  z-index: 80;
}

#toastPix.show {
  display: block;
}

/* =========================
   REVEAL INICIAL
   ========================= */
#reveal-cover {
  position: absolute;
  inset: 0;
  background: #000;
  z-index: 100;
  overflow: hidden;
  touch-action: none;
}

#reveal-cover.is-completing {
  transition: opacity .9s ease, transform .9s ease;
  opacity: 0;
  transform: scale(1.05);
}

#reveal-cover.is-hidden {
  display: none;
}

#reveal-cover canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#reveal-hint {
  position: absolute;
  bottom: 12%;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font: 500 32px/1.3 'Cormorant Garamond', Georgia, serif;
  letter-spacing: 4px;
  text-transform: uppercase;
  padding: 20px 44px;
  border-radius: 60px;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 101;
  pointer-events: none;
  white-space: nowrap;
  animation: hintPulse 2.4s ease-in-out infinite;
  transition: opacity .6s ease;
}

#reveal-hint.fade-out {
  opacity: 0;
}

@keyframes hintPulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* =========================
   RESPONSIVIDADE MOBILE
   =========================
   O ajuste principal de escala acontece no JavaScript para preservar 1080x1920.
*/

