/* ============================================================
   CineGift — sessao.css
   ============================================================ */
:root {
  --noite: #0a0407;
  --creme: #f4efe6;
  --font-display: "Playfair Display", serif;
  --font-body: "DM Sans", sans-serif;
  --font-mono: "DM Mono", monospace;
}

.cinema-body {
  background: var(--noite);
  margin: 0;
  overflow: hidden;
  color: var(--creme);
  font-family: var(--font-body);
}

/* Temas Visuais */
.cinema-body[data-tema="romance"] {
  --theme-bg: #0d0610;
  --theme-accent: #c4405a;
  --tk-bg1: #3d0a1c;
  --tk-bg2: #1a0610;
  --tk-footer: #120408;
  --tk-text: #f4efe6;
  --tk-label: rgba(244, 239, 230, 0.45);
  --tk-tear-bg: #2a0818;
  --tk-accent2: #8b6070;
  --cor-cortina: #660011;
  --theme-glow: rgba(196, 64, 90, 0.3);
}
.cinema-body[data-tema="amizade"] {
  --theme-bg: #0e1a2a;
  --theme-accent: #4a8ec4;
  --tk-bg1: #1a3a5c;
  --tk-bg2: #0e1a2a;
  --tk-footer: #081018;
  --tk-text: #f4efe6;
  --tk-label: rgba(168, 208, 232, 0.5);
  --tk-tear-bg: #1a3a5c;
  --tk-accent2: #a8d0e8;
  --cor-cortina: #0c2038;
  --theme-glow: rgba(74, 142, 196, 0.3);
}
.cinema-body[data-tema="familia"] {
  --theme-bg: #160a04;
  --theme-accent: #d4782a;
  --tk-bg1: #5c2a10;
  --tk-bg2: #2a0e04;
  --tk-footer: #160a04;
  --tk-text: #f4ead8;
  --tk-label: rgba(232, 168, 96, 0.5);
  --tk-tear-bg: #3a1a08;
  --tk-accent2: #e8a860;
  --cor-cortina: #3a1705;
  --theme-glow: rgba(212, 120, 42, 0.3);
}
.cinema-body[data-tema="aniversario"] {
  --theme-bg: #12080e;
  --theme-accent: #d4407a;
  --tk-bg1: #4a1040;
  --tk-bg2: #12080e;
  --tk-footer: #0a0408;
  --tk-text: #f4efe6;
  --tk-label: rgba(212, 64, 122, 0.55);
  --tk-tear-bg: #2a0a1e;
  --tk-accent2: #4a8ec4;
  --cor-cortina: #2e0827;
  --theme-glow: rgba(212, 64, 122, 0.3);
}

/* Fases e Transições */
.fase {
  display: none;
  width: 100vw;
  height: 100vh;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  background: radial-gradient(
    ellipse 80% 70% at 50% 50%,
    #1a1218 0%,
    var(--theme-bg) 100%
  );
  clip-path: circle(150% at 50% 50%);
  transition: clip-path 0.8s cubic-bezier(0.645, 0.045, 0.355, 1);
}
.fase.active {
  display: flex;
}
.fase.spotlight-close {
  clip-path: circle(0% at 50% 50%);
  pointer-events: none;
}

.fase-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  z-index: 2;
  position: relative;
}
.fase-titulo {
  font-family: var(--font-display);
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}
.fase-subtitulo {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 1.5rem 0;
  opacity: 0.7;
}
.frase-dinamica {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--theme-accent);
  margin-bottom: 2rem;
  max-width: 600px;
  padding: 0 20px;
}

.interativo-box {
  background: rgba(20, 15, 18, 0.45);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  max-width: 90vw;
}
.dust-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0;
  transition: opacity 2s ease;
}
#fase-filme.active ~ .dust-overlay,
#fase-filme.active .dust-overlay {
  opacity: 1;
}

/* Ingresso VIP */
.ticket-preview {
  width: 320px;
  margin-bottom: 2.5rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
  transform: rotate(-2deg);
  transition: transform 0.5s;
  position: relative;
  z-index: 5;
}
.ticket-preview:hover {
  transform: rotate(0deg) scale(1.02);
}
.ticket-body-card {
  background: linear-gradient(145deg, var(--tk-bg1), var(--tk-bg2));
  padding: 24px;
  border-radius: 12px 12px 0 0;
  text-align: left;
}
.ticket-header {
  color: var(--tk-label);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 2px;
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}
.ticket-header-badge {
  border: 1px solid var(--tk-label);
  padding: 2px 6px;
  border-radius: 2px;
}
.ticket-label {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--tk-label);
}
.ticket-body h3 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--tk-text);
  margin: 10px 0;
}
.ticket-director {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.15em;
  color: var(--tk-label);
}
.ticket-director span {
  color: var(--tk-accent2);
}
.ticket-tear {
  height: 20px;
  background: var(--tk-tear-bg);
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.ticket-tear::before,
.ticket-tear::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  background: var(--theme-bg);
  border-radius: 50%;
}
.ticket-tear::before {
  left: -9px;
}
.ticket-tear::after {
  right: -9px;
}
.ticket-tear-line {
  width: 100%;
  border-top: 2px dashed rgba(244, 239, 230, 0.15);
  margin: 0 15px;
}
.ticket-footer {
  background: linear-gradient(145deg, var(--tk-footer), var(--tk-bg2));
  padding: 15px 24px;
  border-radius: 0 0 12px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ticket-barcode {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 4px;
  color: var(--tk-label);
}
.ticket-seat {
  text-align: right;
}
.ticket-seat span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.45rem;
  letter-spacing: 0.15em;
  color: var(--tk-label);
}
.ticket-seat strong {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--theme-accent);
}
.ticket-preview.tearing {
  animation: ticketTearDown 0.8s forwards ease-in;
}
@keyframes ticketTearDown {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  20% {
    transform: translateY(-15px) rotate(5deg);
  }
  100% {
    transform: translateY(100vh) rotate(-15deg);
    opacity: 0;
  }
}

/* Poltronas */
.seat-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 2rem;
}
.seat {
  width: 35px;
  height: 35px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  border-bottom: 4px solid rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: 0.3s;
}
.seat:active {
  transform: scale(0.85);
}
.seat.selected {
  background: var(--theme-accent);
  box-shadow: 0 0 15px var(--theme-accent);
  border-bottom-color: var(--tk-bg1);
  animation: seatPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes seatPop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
  }
}

/* Snacks */
.snacks-container {
  display: flex;
  gap: 15px;
  margin-bottom: 2.5rem;
  justify-content: center;
}
.snack-item {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--creme);
  padding: 10px 20px;
  border-radius: 30px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: 0.3s;
}
.snack-item.active {
  background: var(--theme-accent);
  border-color: var(--theme-accent);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  transform: scale(1.05);
}

/* Botões Globais */
.btn-acao {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.12) 0%,
    rgba(255, 255, 255, 0.02) 100%
  );
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    0 8px 32px 0 rgba(0, 0, 0, 0.3),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  color: var(--creme);
  padding: 16px 42px;
  border-radius: 50px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 20;
  position: relative;
  overflow: hidden;
}
.btn-acao::before {
  content: "";
  position: absolute;
  top: 0;
  left: -150%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to right,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transform: skewX(-25deg);
  transition: 0.6s ease;
}
.btn-acao:hover::before {
  left: 150%;
}
.btn-acao:hover {
  transform: translateY(-4px);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.18) 0%,
    rgba(255, 255, 255, 0.05) 100%
  );
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow:
    0 15px 30px rgba(0, 0, 0, 0.6),
    0 0 30px var(--theme-accent),
    inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

/* Galeria com Snap Effect */
.lobby-gallery {
  display: flex;
  gap: 30px;
  overflow-x: auto;
  width: 100vw;
  max-width: 100%;
  padding: 40px calc(50vw - 100px); /* O offset exato para o 1º/último quadro parar no meio */
  scrollbar-width: none;
  margin-bottom: 2rem;
  align-items: center;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  z-index: 10;
}
.lobby-gallery::-webkit-scrollbar {
  display: none;
}

.poster-wrapper {
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  flex: 0 0 200px;
}
.poster-frame {
  position: relative;
  width: 200px;
  height: 300px;
  background: #111;
  border: 4px solid #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transform: rotate(-2deg);
  transition:
    transform 0.4s ease,
    border-color 0.4s ease,
    box-shadow 0.4s ease;
  overflow: hidden;
  flex-shrink: 0;
}
.poster-wrapper:nth-child(even) .poster-frame {
  transform: rotate(2deg);
}

/* Efeito de Destaque (Hover no PC ou Centro no Celular) */
.poster-wrapper:hover .poster-frame,
.poster-wrapper.is-centered .poster-frame {
  transform: scale(1.08) rotate(0deg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
  border-color: var(--theme-accent);
}
.poster-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Legenda das Fotos */
.poster-title-below {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-style: italic;
  color: var(--creme);
  text-align: center;
  opacity: 0;
  transform: translateY(-10px);
  transition: 0.4s ease;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
  width: 100%;
}
.poster-wrapper:hover .poster-title-below,
.poster-wrapper.is-centered .poster-title-below {
  opacity: 1;
  transform: translateY(0);
  color: var(--theme-accent);
}

/* Botão de Música Flutuante */
.music-toggle-btn {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}
.music-toggle-btn.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.5);
}
.music-toggle-btn:hover {
  transform: scale(1.1);
  background: var(--theme-accent);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Cinema e Tela Principal */
.curtain-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #000;
}
.master-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  z-index: 50;
  transition: opacity 0.6s ease;
  backdrop-filter: blur(2px);
}
.curtain-valance {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 10px;
  background: var(--tk-bg1);
  z-index: 20;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.8);
}
.curtain {
  position: absolute;
  top: 0;
  width: 50.5%;
  height: 100%;
  z-index: 10;
  background-color: var(--cor-cortina);
  background-image: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.4) 0%,
    rgba(255, 255, 255, 0.1) 20%,
    rgba(0, 0, 0, 0.3) 40%,
    rgba(0, 0, 0, 0.5) 80%,
    rgba(0, 0, 0, 0.4) 100%
  );
  background-size: 60px 100%;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.9);
  transition: transform 3.5s cubic-bezier(0.65, 0, 0.15, 1);
}
.curtain.left {
  left: 0;
  transform-origin: left top;
  border-right: 4px solid rgba(0, 0, 0, 0.4);
}
.curtain.right {
  right: 0;
  transform-origin: right top;
  border-left: 4px solid rgba(0, 0, 0, 0.4);
}
.curtain.open-left,
.curtain.open-right {
  transform: scaleX(0.06);
}

.theater-screen {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at center 30%, #111 0%, #000 100%);
  padding: 15px; /* Evita que o ecrã raspe nos limites laterais */
}

.video-wrapper {
  width: 100%;
  max-width: 960px;
  aspect-ratio: 16 / 9; /* Mantém proporção do filme (não amassa a imagem) */
  border-radius: 6px;
  background: #000;
  box-shadow:
    0 0 0 10px #050505,
    0 0 120px var(--theme-glow),
    0 50px 100px rgba(0, 0, 0, 0.9);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-wrapper::after {
  content: "";
  position: absolute;
  bottom: -80px;
  left: 5%;
  width: 90%;
  height: 60px;
  background: var(--theme-glow);
  filter: blur(60px);
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
}
video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 4px;
}

/* Créditos Finais */
.credits-roll {
  display: none;
  position: absolute;
  inset: 0;
  background: var(--theme-bg);
  z-index: 5;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.credits-roll.active {
  display: flex;
  animation: fadeIn 2s ease forwards;
}
.credits-content {
  padding: 2rem;
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: creditsReveal 3s ease forwards;
}
.credits-content h1 {
  font-family: var(--font-display);
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
  color: var(--creme);
}
.msg-scroll-container {
  width: 100%;
  max-height: 45vh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  margin: 1.5rem 0;
  padding: 0 1rem;
}
.msg-scroll-container::-webkit-scrollbar {
  display: none;
}
.credits-mensagem {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.3rem;
  opacity: 0.9;
  max-width: 500px;
  margin: 0 auto;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  line-height: 1.6;
}
.credits-divider {
  width: 60px;
  height: 1px;
  background: var(--theme-accent);
  margin: 0 auto 1.5rem;
  flex-shrink: 0;
}
.credits-director-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  opacity: 0.5;
  display: block;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}
.credits-director-name {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  margin-bottom: 2rem;
  flex-shrink: 0;
  color: var(--creme);
}
.the-end {
  font-family: var(--font-display);
  font-size: 3rem;
  font-style: italic;
  color: var(--theme-accent);
  flex-shrink: 0;
}

@keyframes creditsReveal {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Loader PIPOCA */
.loader-overlay {
  position: fixed;
  inset: 0;
  background: var(--noite);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: 0.8s;
}
.loader-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}
.popcorn-loader {
  font-size: 3.5rem;
  animation: popLoader 1.2s infinite;
}
@keyframes popLoader {
  0%,
  100% {
    transform: scale(1) rotate(-4deg);
  }
  50% {
    transform: scale(1.2) rotate(4deg);
  }
}

/* =========================================
   MEDIA QUERIES (OTIMIZAÇÃO MOBILE - CORRIGIDO)
========================================= */
@media (max-width: 768px) {
  .fase-titulo {
    font-size: 1.8rem;
    margin-bottom: 0.2rem;
  }
  .fase-subtitulo {
    font-size: 0.8rem;
    margin: 1rem 0;
  }
  .frase-dinamica {
    font-size: 1rem;
    margin-bottom: 1rem;
  }

  .ticket-preview {
    width: 280px;
    margin-bottom: 1.5rem;
  }
  .interativo-box {
    padding: 1.5rem;
  }
  .seat-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    margin-bottom: 1.5rem;
  }
  .seat {
    width: 30px;
    height: 30px;
  }
  .snacks-container {
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
  }
  .btn-acao {
    padding: 14px 28px;
    font-size: 0.95rem;
  }

  .credits-content h1 {
    font-size: 2.5rem;
  }
  .credits-mensagem {
    font-size: 1.1rem;
  }

  .video-wrapper {
    width: 100%;
    box-shadow:
      0 0 0 4px #050505,
      0 0 50px var(--theme-glow);
  }

  /* --- O SEGREDO DO CORREDOR NO CELULAR --- */
  .lobby-gallery {
    padding: 20px calc(50vw - 80px); /* Recalculado para o novo centro */
    margin-bottom: 1rem;
    gap: 15px;
  }
  .poster-wrapper {
    flex: 0 0 160px; /* Reduz a largura do wrapper */
    gap: 10px;
  }
  .poster-frame {
    width: 160px; /* Reduz a largura da foto */
    height: 240px; /* Reduz a altura da foto para libertar espaço para o botão! */
  }
  .poster-title-below {
    font-size: 0.9rem;
  }
}
