/* Reset */
* {
  box-sizing: border-box;
  user-select: none;
}

body {
  margin: 0;
  font-family: 'Comic Sans MS', cursive, sans-serif;
  background-color: #fffde7;
  color: #333;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header, footer {
  background-color: #ffecb3;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: bold;
}

header button.btn-voltar {
  background-color: #f48fb1;
  border: none;
  border-radius: 12px;
  padding: 8px 14px;
  font-size: 1em;
  cursor: pointer;
  color: white;
  transition: background-color 0.3s;
}

header button.btn-voltar:hover {
  background-color: #ec407a;
}

.bencaos-contador {
  font-size: 1.1em;
  color: #d2691e;
}

main {
  flex: 1;
  padding: 15px 20px;
}

h1 {
  text-align: center;
  margin-bottom: 15px;
  font-size: 2em;
  color: #6a1b9a;
}

.game-area {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: flex-start;
  max-width: 1200px;
  margin: 0 auto;
}

/* Grid do jogo */
.grid {
  display: grid;
  grid-template-columns: repeat(10, 40px);
  grid-template-rows: repeat(10, 40px);
  gap: 4px;
  background-color: #fff;
  border: 3px solid #6a1b9a;
  border-radius: 12px;
  padding: 10px;
  user-select: none;
  touch-action: none;
}

/* Cada célula */
.celula {
  background-color: #ffe082;
  border-radius: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  font-size: 1.25rem;
  color: #4a148c;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
}

.celula.selecionada {
  background-color: #ce93d8;
  color: white;
}

.celula.encontrada {
  background-color: #7b1fa2;
  color: white;
  cursor: default;
}

/* Área lateral das palavras */
.palavras-area {
  max-width: 280px;
}

.palavras-area h2 {
  color: #6a1b9a;
  margin-bottom: 8px;
  font-size: 1.4em;
  text-align: center;
}

.palavras-lista {
  list-style: none;
  padding-left: 0;
  margin-bottom: 20px;
  font-size: 1.1em;
  color: #4a148c;
  max-height: 400px;
  overflow-y: auto;
}

.palavras-lista li {
  margin-bottom: 6px;
}

.palavras-lista li.encontrada {
  text-decoration: line-through;
  color: #7b1fa2;
  font-weight: bold;
}

.btn-reiniciar {
  display: block;
  width: 100%;
  padding: 10px 0;
  background-color: #d81b60;
  border: none;
  border-radius: 15px;
  color: white;
  font-weight: bold;
  font-size: 1.1em;
  cursor: pointer;
  transition: background-color 0.3s;
}

.btn-reiniciar:hover {
  background-color: #ad1457;
}

/* Footer */
#rodape {
  background-color: #ffecb3;
  text-align: center;
  padding: 10px;
  font-weight: bold;
  color: #4a148c;
  border-top: 3px solid #6a1b9a;
}

/* Relógio footer */
#relogioFooter {
  font-size: 1.1em;
}

/* Versão Mobile */
@media (max-width: 768px) {
  .game-area {
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }

  .grid {
    grid-template-columns: repeat(10, 8vw);
    grid-template-rows: repeat(10, 8vw);
    width: 90vw;
    max-width: 90vw;
    height: auto;
    padding: 5px;
  }

  .celula {
    font-size: 1.8vw;
  }

  .palavras-area {
    max-width: 100%;
    width: 90vw;
  }

  .palavras-lista {
    max-height: 200px;
    font-size: 4vw;
  }

  .btn-reiniciar {
    font-size: 4vw;
    padding: 12px 0;
  }

  header {
    flex-wrap: wrap;
    gap: 10px;
  }

  header button.btn-voltar {
    font-size: 4vw;
    padding: 8px 14px;
  }

  .bencaos-contador {
    font-size: 4vw;
  }
}
