/* === RESET === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

/* === BACKGROUND – TELA INICIAL === */
body.start-screen {
  background-image: url('https://passatempo.canalblast.com/jogo-blast/assets/imgs/background-passatempo-11-anos.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  font-family: 'Bebas Neue', sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

@media (max-width: 768px) {
  body.start-screen {
    background-image: url('https://passatempo.canalblast.com/jogo-blast/assets/imgs/mobileBackground-passatempo-11-anos.jpg');
  }
}

/* === OVERLAY GRADIENT === */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1;
}

/* === CONTAINER – TELA INICIAL === */
.container {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* === HEADLINE – TELA INICIAL === */
.headline {
  width: 90%;
  max-width: 700px;
  height: auto;
  margin-bottom: 40px;
  animation: fadeIn 1s ease-in-out;
}

/* === LOGO – TELA INICIAL === */
.logo-blast {
  width: 200px;
  animation: fadeIn 1.5s ease-in-out;
}

/* === BUTTON – TELA INICIAL === */
.btn-start {
  display: inline-block;
  padding: 20px 60px;
  font-size: 22px;
  font-family: 'Roboto Condensed', sans-serif;
  text-decoration: none;
  color: #fff;
  border: 2px solid #ff3b00;
  border-radius: 8px;
  transition: all 0.3s ease;
  background: transparent;
  letter-spacing: 1px;
  animation: fadeInUp 1.2s ease-in-out;
}
.btn-start:hover {
  background: #ff3b00;
  color: #fff;
  transform: scale(1.05);
}

/* === ANIMATIONS === */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===============================
   JOGOS – FUNDO DINÂMICO AJUSTADO
   =============================== */
body.jogo1,
body.jogo2,
body.jogo3 {
  background-color: #000; /* fallback escuro */
  background-image: url('https://passatempo.canalblast.com/jogo-blast/assets/imgs/background-passatempo-11-anos.jpg');
  background-position: center top;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: scroll;

  font-family: 'Roboto Condensed', sans-serif;
  color: #fff;
  text-align: center;

  min-height: 100%;
  width: 100%;
  margin: 0;

  display: flex;
  justify-content: center;
  align-items: flex-start;

  overflow-x: hidden;
  overflow-y: auto;
}

/* Fixa o fundo em ecrãs altos para evitar “buracos” */
@media (min-height: 700px) {
  body.jogo1,
  body.jogo2,
  body.jogo3 {
    background-attachment: fixed;
  }
}
/* ===============================
   FUNDO FIXO SEGURO (corrige branco no iOS)
   =============================== */
body.jogo1,
body.jogo2,
body.jogo3 {
  position: relative;
  font-family: 'Roboto Condensed', sans-serif;
  color: #fff;
  text-align: center;
  margin: 0;
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  background-color: #000;
}

/* Camada de fundo permanente */
body.jogo1::before,
body.jogo2::before,
body.jogo3::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url('https://passatempo.canalblast.com/jogo-blast/assets/imgs/background-passatempo-11-anos.jpg');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  background-color: #000;
}

/* container principal */
.game-container {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  min-height: 100%;
  width: 100%;
  max-width: 1200px;
  padding: 1.5vh 2vw;
  box-sizing: border-box;
  gap: 16px;
}

.game-container {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;

  min-height: 100%;
  width: 100%;
  max-width: 1200px;
  padding: 1.5vh 2vw;
  box-sizing: border-box;
  gap: 16px;
}

/* ======= IMAGEM TÍTULO ======= */
.titulo-img {
  max-width: 700px;
  height: auto;
}

/* ====== CAPAS + BOTÕES (desktop base) ====== */
.capas,
.botoes-filmes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  justify-items: center;
  width: 90%;
  max-width: 1000px;
  margin: 0 auto;
}

/* Jogo 3 – desktop: 3 colunas */
@media (min-width: 901px) {
  body.jogo3 .capas,
  body.jogo3 .botoes-filmes {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Capas */
.capa {
  width: 90%;
  aspect-ratio: 1/1.25;
  border: 3px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  transition: 0.3s;
  cursor: pointer;
}
.capa img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}
.capa:hover,
.capa.selected {
  border-color: #ff3b00;
}
.capa.correct {
  border-color: #00ff88;
  opacity: 0.85;
}

/* Botões */
.botoes-filmes {
  margin-top: 35px;
}
.filme {
  width: 90%;
  aspect-ratio: 1/0.25;
  background: transparent;
  border: 2px solid #fff;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  transition: 0.3s;
  display: flex;
  justify-content: center;
  align-items: center;
}
.filme:hover {
  background: #ff3b00;
  border-color: #ff3b00;
}
.filme:disabled {
  opacity: 0.5;
}

/* ====== RODAPÉ (desktop) ====== */
.rodape {
  display: grid;
  grid-template-columns: 0.5fr 2fr 0.5fr;
  align-items: center;
  justify-items: center;
  width: 100%;
  padding: 30px 60px;
  margin-top: 10px;
  margin-bottom: 20px;
}
.col-validacoes { justify-self: start; }
.indicador {
  font-size: 22px;
  margin: 0 5px;
  color: #fff;
  opacity: 0.9;
}
.col-texto { text-align: center; }
.instrucoes {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1.25;
}
.col-logo {
  justify-self: end;
  display: flex;
  align-items: center;
  height: 100%;
}
.logo-blast {
  width: 100px;
  height: auto;
  display: block;
}

/* ====== RESPONSIVO (tablets/notebooks pequenos) ====== */
@media (max-width: 1100px), (max-height: 750px) {
  .capas, .botoes-filmes { gap: 20px; }
  .capa { width: 85%; aspect-ratio: 1/1.2; }
  .filme { font-size: 0.95rem; }
  .logo-blast { width: 84px; }
  .rodape { padding: 20px 40px; }
}

/* ===============================
   MOBILE ≤ 600px (duas colunas corrigidas)
   =============================== */
@media (max-width: 600px) {

  .game-container {
    min-height: auto !important;
    height: auto !important;
    padding: 20px 0 80px !important;
    gap: 20px !important;
  }

  .titulo-img {
    width: 92%;
    max-width: 540px;
    margin: 12px auto 20px;
  }

  /* layout em 2 colunas */
  .capas,
  .botoes-filmes {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    width: 92%;
    max-width: 540px;
  }

  .capas .capa,
  .botoes-filmes .filme {
    flex: 0 1 calc(50% - 14px);
    max-width: calc(50% - 14px);
  }

  .capa {
    width: 100%;
    aspect-ratio: 3/4;
  }

  .botoes-filmes .filme {
    aspect-ratio: auto;
    min-height: 52px;
    padding: 10px 8px;
    font-size: 0.95rem;
  }

  /* rodapé empilhado central */
  .rodape {
    display: grid;
    grid-template-columns: 1fr;
    row-gap: 10px;
    justify-items: center;
    align-items: center;
    padding: 20px 16px 30px;
    margin-top: 10px;
  }

  .col-validacoes,
  .col-texto,
  .col-logo {
    justify-self: center;
    text-align: center;
  }

  .indicador { font-size: 20px; }
  .instrucoes { font-size: 13px; max-width: 92%; }
  .logo-blast { width: 80px; }
}

/* ===============================
   MOBILE MUITO PEQUENO / ALTURA CURTA
   =============================== */
@media (max-width: 380px), (max-height: 640px) {
  .titulo-img { width: 94%; }
  .capas .capa,
  .botoes-filmes .filme {
    flex: 0 1 calc(50% - 12px);
    max-width: calc(50% - 12px);
  }
  .botoes-filmes .filme {
    min-height: 48px;
    font-size: 0.8rem;
  }
  .indicador { font-size: 18px; }
  .instrucoes { font-size: 12px; }
  .logo-blast { width: 72px; }
}

/* ====== FINAL PAGE ====== */
.mensagem-final { text-align: center; margin-top: 20px; }
.titulo-final {
  color: #ff3b00;
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.texto-final {
  font-size: 1.2rem;
  color: #fff;
  line-height: 1.5;
  margin-bottom: 40px;
}
.acao-final { text-align: center; margin-top: 20px; }
.btn-final {
  background: #ff3b00;
  color: #fff;
  font-weight: 800;
  padding: 18px 45px;
  border-radius: 6px;
  font-size: 1rem;
  text-transform: uppercase;
  text-decoration: none;
  border: 2px solid #ff3b00;
  transition: 0.3s;
}
.btn-final:hover { background: transparent; border-color: #fff; }

@media (max-width: 1100px), (max-height: 750px) {
  .titulo-final { font-size: 2rem; }
  .texto-final   { font-size: 1rem; }
  .btn-final     { padding: 14px 35px; font-size: 0.9rem; }
}

/* ===============================
   FEEDBACK VISUAL DO JOGO
   =============================== */
.capa.selected {
  outline: 3px solid #fff;
  transform: scale(1.03);
  transition: transform 0.2s ease;
}
.capa.correto {
  outline: 3px solid #00ff5f !important;
  box-shadow: 0 0 10px #00ff5f;
  filter: brightness(1.1);
}
.capa.erro {
  outline: 3px solid #ff3b3b !important;
  box-shadow: 0 0 8px #ff3b3b;
}
.filme.correto {
  background-color: #00b74a !important;
  border-color: #00b74a !important;
  color: #fff !important;
}
.filme.erro {
  background-color: #ff3b3b !important;
  border-color: #ff3b3b !important;
  color: #fff !important;
}
.filme, .capa { transition: all 0.3s ease; }
.filme.selected {
  border-color: #ff3b00 !important;
  box-shadow: 0 0 10px rgba(255, 59, 0, .6);
  transform: scale(1.02);
}
.filme.selected:disabled { transform: none; }
/* ===============================
   BOTÃO AVANÇAR (fixo e visível)
   =============================== */
.btn-next {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;

  display: inline-block;
  padding: 16px 50px;
  background: #ff3b00;
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  font-family: 'Roboto Condensed', sans-serif;
  text-transform: uppercase;
  text-decoration: none;
  letter-spacing: 1px;

  border: 2px solid #ff3b00;
  border-radius: 6px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Hover desktop */
.btn-next:hover {
  background: #fff;
  color: #ff3b00;
  border-color: #fff;
  transform: translateX(-50%) scale(1.05);
}

/* Versão mobile (menor e com menos padding) */
@media (max-width: 600px) {
  .btn-next {
    padding: 14px 40px;
    font-size: 1rem;
    bottom: 18px;
  }
}