/* Reset básico */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Corpo da página */
html, body {
  height: 100%;
  font-family: 'Comic Sans MS', cursive, sans-serif;
  background-color: #fffde7;
  color: #3a3a3a;
  position: relative;
  min-height: 100vh;
  padding-bottom: 90px; /* espaço para o footer fixo */
  overflow-x: hidden;
}

/* Canvas de fundo */
#bgCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw !important;
  height: 100vh !important;
  z-index: -1;
  background: linear-gradient(135deg, #fff8dc, #f0e3b8);
}

/* Header */
header {
  background: linear-gradient(90deg, #f7ce83, #ffb74d);
  padding: 15px 20px;
  text-align: center;
  box-shadow: 0 3px 8px rgba(255, 183, 77, 0.6);
  position: sticky;
  top: 0;
  z-index: 10;
  user-select: none;
}

header h1 {
  font-size: 2.4rem;
  color: #fff3e0;
  text-shadow: 1px 1px 4px #b37400;
  margin-bottom: 5px;
}

header .slogan {
  font-size: 1.1rem;
  color: #fff8dc;
  font-style: italic;
  letter-spacing: 0.05em;
}

#contador-bencaos {
  margin-top: 10px;
  font-weight: bold;
  font-size: 1.2rem;
  color: #a56900;
  user-select: text;
}

/* Navegação principal */
nav {
  margin: 15px 10px;
  text-align: center;
}

nav button {
  background-color: #ffcc80;
  border: none;
  padding: 12px 22px;
  border-radius: 20px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  color: #5d4037;
  box-shadow: 0 4px 8px rgba(255, 152, 0, 0.3);
  margin: 6px 10px;
  transition: transform 0.3s ease, background-color 0.3s ease;
  user-select: none;
}

nav button:hover,
nav button:focus {
  background-color: #ffa726;
  transform: scale(1.1);
  outline: none;
}

/* Main conteúdo */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 15px 20px 30px;
}

main h2 {
  font-size: 2rem;
  color: #6d4c41;
  margin-bottom: 20px;
  text-align: center;
  text-shadow: 0 0 5px #ffe0b2;
}

/* Grid dos jogos */
.jogos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(160px,1fr));
  gap: 20px;
  justify-items: center;
}

/* Cartões de jogos */
.jogo-card {
  width: 160px;
  height: 110px;
  border-radius: 20px;
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  user-select: none;
  box-shadow: 0 6px 12px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: center;
  padding: 10px;
}

/* Efeito hover nos cards */
.jogo-card:hover {
  transform: scale(1.07);
  box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

/* Cores específicas para cada jogo */
.jogo-card[style*="#ff9e80"] { background: #ff9e80; } /* Jogo da Memória */
.jogo-card[style*="#f48fb1"] { background: #f48fb1; } /* Caça-Palavras */
.jogo-card[style*="#ce93d8"] { background: #ce93d8; } /* Corrida de Jacó */
.jogo-card[style*="#90caf9"] { background: #90caf9; } /* Caminho do Céu */
.jogo-card[style*="#a5d6a7"] { background: #a5d6a7; } /* Sequencial */
.jogo-card[style*="#ffe082"] { background: #ffe082; color: #5d4037; } /* Quem Sou Eu? */
.jogo-card[style*="#ffcc80"] { background: #ffcc80; color: #5d4037; } /* Jogo dos Versículos */
.jogo-card[style*="#b0bec5"] { background: #b0bec5; color: #37474f; } /* Quem Disse? */

/* Link para jogos (remover decoração) */
.jogos-grid a {
  text-decoration: none;
  color: inherit;
  display: block;
  border-radius: 20px;
  width: 100%;
}

/* Canvas para animações dentro do main */
canvas#canvas {
  display: block;
  margin: 30px auto 0;
  max-width: 90%;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  background-color: #fff8e1;
  height: 250px;
}

/* Footer fixo */
#rodape {
  background-color: #fbe9e7;
  text-align: center;
  padding: 12px 10px;
  border-top: 3px solid #ffccbc;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
  color: #6d4c41;
  user-select: none;
  z-index: 20;
  box-shadow: 0 -3px 6px rgba(255, 183, 77, 0.5);
  line-height: 1.3;
}

/* Texto no footer */
#rodape .footer-texto {
  margin-bottom: 5px;
  font-weight: 600;
}

/* Relógio no footer */
#relogio {
  font-weight: bold;
  font-size: 1.3rem;
  color: #a57100;
  user-select: text;
  letter-spacing: 1.3px;
}

/* Scroll suave para carrossel - mantido conforme original */
.carrossel-container {
  max-width: 90%;
  margin: 0 auto 40px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-bottom: 12px;
}

.carrossel-anuncios {
  display: flex;
  gap: 15px;
  user-select: none;
}

/* Botões do carrossel (visibilidade gerenciada no JS) */
#prevBtn,
#nextBtn {
  position: fixed;
  bottom: 110px;
  background: rgba(255, 183, 77, 0.85);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-weight: bold;
  font-size: 1.5rem;
  color: #5d4037;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  display: none; /* inicialmente escondidos */
  align-items: center;
  justify-content: center;
  user-select: none;
  z-index: 100;
  transition: background-color 0.3s ease;
}

#prevBtn:hover,
#nextBtn:hover {
  background: rgba(255, 152, 0, 0.95);
}

/* Posicionamento dos botões */
#prevBtn {
  left: 10px;
}

#nextBtn {
  right: 10px;
}

/* Responsividade */
@media (max-width: 700px) {
  nav button {
    padding: 10px 16px;
    font-size: 0.9rem;
    margin: 5px 7px;
  }

  main h2 {
    font-size: 1.6rem;
  }

  .jogo-card {
    width: 100%;
    height: 95px;
    font-size: 1rem;
  }

  .jogos-grid {
    grid-template-columns: repeat(2, 1fr); /* ⬅️ força 2 colunas no mobile */
    gap: 16px;
  }

  canvas#canvas {
    height: 180px;
  }

  #contador-bencaos {
    font-size: 1rem;
  }

  #relogio {
    font-size: 1.1rem;
  }
}

@media (max-width: 400px) {
  nav button {
    padding: 8px 12px;
    font-size: 0.85rem;
    margin: 3px 5px;
  }

  main h2 {
    font-size: 1.3rem;
  }

  .jogo-card {
    width: 100%;
    height: 85px;
    font-size: 0.9rem;
  }

  .jogos-grid {
    grid-template-columns: repeat(2, 1fr); /* mantém 2 colunas mesmo em telas menores */
    gap: 14px;
  }
}


#anuncios {
  background: linear-gradient(to bottom, #fffdf5, #fff7db);
  padding: 40px 20px;
  text-align: center;
}

#anuncios h2 {
  font-size: 2rem;
  color: #444;
  margin-bottom: 24px;
  font-weight: bold;
  font-family: 'Comic Sans MS', cursive;
}

/* Container geral */
.carrossel-container {
  max-width: 1600px;
  margin: 0 auto;
  overflow: hidden;
}

/* Estilo base dos cards */
.carrossel-anuncios {
  display: flex;
  gap: 20px;
  transition: transform 0.4s ease;
  will-change: transform;
}

/* Cada anúncio */
.anuncio-card {
  flex: 0 0 300px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
  text-align: center;
  transition: transform 0.3s ease;
}

.anuncio-card:hover {
  transform: scale(1.03);
}

.anuncio-card a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.anuncio-card img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 16px 16px 0 0;
}

.anuncio-card h3 {
  font-size: 1.1rem;
  margin: 10px 0 5px;
  color: #333;
}

.anuncio-card p {
  font-size: 0.9rem;
  color: #666;
  padding-bottom: 12px;
}

/* Botões carrossel */
.btn-carrossel {
  display: none; /* Só ativa no mobile */
}

/* MOBILE: vira carrossel com botões */
@media (max-width: 1023px) {
  .carrossel-container {
    position: relative;
    max-width: 320px;
    margin: 0 auto;
  }

  .carrossel-anuncios {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }

  .anuncio-card {
    flex: 0 0 100%;
    min-width: 100%;
    margin-right: 10px;
  }

  .btn-carrossel {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #ffd700;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1.4rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    color: #333;
    z-index: 10;
  }

  #prevBtn {
    display: block;
    left: 5px;
  }

  #nextBtn {
    display: block;
    right: 5px;
  }
}

/* DESKTOP: mostra todos lado a lado e centralizado */
@media (min-width: 1400px) {
  .carrossel-container {
    overflow: visible;
    max-width: 1800px;
    display: flex;
    justify-content: center;
  }

  .carrossel-anuncios {
    justify-content: center;
    flex-wrap: nowrap;
    overflow: visible;
  }

  .anuncio-card {
    flex: 0 0 auto;
    min-width: 300px;
    max-width: 300px;
  }

  .btn-carrossel {
    display: none !important;
  }
}
