/* ==========================
   infinito.css - FIX MOBILE/SCROLL
   música intacta
========================== */

:root{
  --cardH: 92vh;
  --cardW: calc(var(--cardH) * 1080 / 1850);
  --cardMaxW: 520px;
}

*, *::before, *::after{ box-sizing:border-box; }

html{
  background:#000;
  scrollbar-gutter: stable both-edges;
}

html, body{
  margin:0;
  padding:0;
  height:100%;
  background:#000;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial;
  overflow-x:hidden;
}

#backgroundFix{
  position:fixed;
  inset:0;
  background:#000 !important;
  z-index:-1;
}

/* PALCO: centro estável */
#palco{
  position:fixed;
  inset:0;
  display:grid;
  place-items:center;
  overflow:hidden;
}

/* estado inicial */
#container2-video{ display:none; }
#infinito{ display:none; }

/* ===== MOBILE ===== */

/* CAPA e VIDEO continuam travados */
#capa,
#container2-video{
  position:fixed;
  inset:0;
  width:100vw;
  height:100vh;
  overflow:hidden;
}

/* INFINITO precisa rolar */
#infinito{
  position:fixed;
  inset:0;
  width:100vw;
  height:100vh;
  z-index:10;
  background:#000 !important;
  overflow-y:auto;
  overflow-x:hidden;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}

/* CAPA */
#capa{
  z-index:30;
  background:#000;
  opacity:1;
  transition:opacity .25s ease;
  will-change:opacity;
}

#capa.is-opening{
  opacity:0;
  pointer-events:none;
}

#canvas1080{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  overflow:hidden;
}

#capa img{
  position:absolute;
  inset:0;
  width:100% !important;
  height:100% !important;
  object-fit:cover !important;
  object-position:center center !important;
  display:block !important;
  user-select:none;
  -webkit-user-drag:none;
}

#abrirConvite{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  background:transparent;
  border:0;
  outline:0;
  cursor:pointer;
  z-index:40;
  -webkit-tap-highlight-color:transparent;
  touch-action:manipulation;
}

/* VIDEO */
#container2-video{
  z-index:20;
  background:#000 !important;
}

#video{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center;
  pointer-events:none;
  background:#000 !important;
}

video::-webkit-media-controls-enclosure{
  display:none !important;
}

/* INFINITO */
#stageInfinito{
  position:relative;
  width:100%;
  min-height:100%;
}

#infImg{
  width:100% !important;
  height:auto !important;
  display:block;
  pointer-events:none;
  user-select:none;
  -webkit-user-drag:none;
}

/* BOTÕES */
#botoesConvite{
  position:absolute;
  inset:0;
  z-index:50;
}

.btnArea{
  position:absolute;
  display:block;
  background:transparent !important;
  border:0 !important;
  outline:0 !important;
  cursor:pointer;
  border-radius:20px;
  -webkit-tap-highlight-color:transparent;
  touch-action:manipulation;
  user-select:none;
  width:16%;
  height:6%;
}

/* POSIÇÕES DOS BOTÕES */

#presenca   { left:45%; top:33.5%; }
#cerimonia  { left:45%; top:50.5%; }
#recepcao   { left:45%; top:67.0%; }
#sugestoes  { left:45%; top:87.5%; }


/* OVERLAYS */
.overlayConvite{
  position:fixed;
  left:0;
  top:0;
  width:100%;
  height:100%;
  display:none;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  background:rgba(0,0,0,.85);
  backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px);
  z-index:100;
}

.overlayConvite img{
  max-width:85%;
  max-height:80%;
  object-fit:contain;
  border-radius:12px;
  cursor:pointer;
}

.fecharOverlay{
  position:absolute;
  top:12px;
  right:12px;
  background:rgba(255,255,255,.2);
  color:#fff;
  border:0;
  border-radius:50%;
  width:36px;
  height:36px;
  font-size:22px;
  line-height:1;
  cursor:pointer;
  display:flex;
  justify-content:center;
  align-items:center;
  transition:background .2s;
}

.fecharOverlay:hover{
  background:rgba(255,255,255,.35);
}

#toastPix{
  display:none;
  position:fixed;
  bottom:7%;
  left:50%;
  transform:translateX(-50%);
  background:rgba(0,0,0,.8);
  color:#fff;
  padding:10px 16px;
  border-radius:10px;
  z-index:200000;
  font-weight:700;
}

/* ===== DESKTOP: card fixo ===== */
@media (min-width:768px){
  body{
    background:radial-gradient(circle at center,#111 0%,#000 70%);
  }

  #capa,
  #container2-video,
  #infinito{
    position:absolute !important;
    left:50% !important;
    top:50% !important;
    transform:translate(-50%,-50%) !important;
    height:var(--cardH) !important;
    width:var(--cardW) !important;
    max-width:var(--cardMaxW) !important;
    border-radius:22px;
    overflow:hidden;
    box-shadow:0 18px 60px rgba(0,0,0,.55);
  }

  #infinito{
    overflow-y:auto !important;
    overflow-x:hidden !important;
  }

  .overlayConvite{
    position:absolute;
    border-radius:22px;
  }
}