* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', sans-serif; }

:root {
  --tam: 70px;   /* tamanho das letras e dos quadrinhos (o script.js ajusta conforme a palavra) */
  --gap: 10px;
}

body {
  background-color: #333; /* Cor do seu Paint */
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh; /* no celular, respeita a barra do navegador */
}

.game-container {
  width: 100%;
  max-width: 800px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ui-button {
  background: #555;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.2s;
}
.ui-button:hover { background: #777; }
.btn-primary { background: #00f0ff; color: #000; }
.btn-primary:hover { background: #00c0cc; }

.timer-container {
  font-size: 1.5rem;
  font-weight: bold;
  color: #8ecfff;
}

.hint-container {
  text-align: center;
  margin-bottom: 20px;
}
.hint-container h2 {
  font-size: 1.2rem;
  color: #aaa;
  letter-spacing: 2px;
}
.hint-container p {
  font-size: 2rem;
  color: #9dff00; /* Verde limão do seu Paint */
  font-weight: bold;
  margin-top: 5px;
}

.game-board {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.letters-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--gap);
}

/* Letras do topo */
.letter-tile {
  width: var(--tam);
  height: var(--tam);
  background: white;
  color: black;
  font-size: calc(var(--tam) * 0.55);
  font-weight: bold;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 0 #aaa;
  user-select: none;
  transition: transform 0.1s, opacity 0.3s;
}

.letter-tile:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 #aaa;
}

/* Letra já usada: some, mas deixa o espaço, para as outras não "pularem" de lugar */
.letter-tile.used {
  opacity: 0;
  pointer-events: none;
}

/* Efeito de erro */
.letter-tile.shake {
  animation: shake 0.3s;
  background: #ff4d4d;
  color: white;
}
@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-5px); }
  100% { transform: translateX(0); }
}

/* Barra de resposta */
.answer-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;            /* palavra grande quebra em duas linhas, em vez de estourar a tela */
  gap: var(--gap);
  background: rgba(255,255,255,0.1);
  padding: 20px;
  border-radius: 12px;
  min-height: calc(var(--tam) + 50px);
  align-items: center;
  transition: background 0.6s ease, gap 0.6s ease;
}

.answer-slot {
  width: var(--tam);
  height: var(--tam);
  border: 2px dashed #666;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: calc(var(--tam) * 0.5);
  font-weight: bold;
  color: transparent; /* Esconde a letra até acertar */
  transition: width 0.6s ease, background 0.6s ease, border-color 0.6s ease,
              color 0.6s ease, font-size 0.6s ease, text-shadow 0.6s ease;
}

.answer-slot.filled {
  background: #9dff00; /* Verde limão */
  color: #000;
  border: 2px solid #9dff00;
  animation: pop 0.3s;
}
@keyframes pop {
  0% { transform: scale(0.8); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* ACERTOU A PALAVRA: os quadrinhos somem e as letras se juntam, formando a palavra */
.answer-bar.vitoria {
  background: transparent;
  gap: 2px;
}
.answer-bar.vitoria .answer-slot,
.answer-bar.vitoria .answer-slot.filled {
  width: calc(var(--tam) * 0.62);
  background: transparent;
  border-color: transparent;
  color: #9dff00;
  font-size: calc(var(--tam) * 0.85);
  text-shadow: 0 0 16px rgba(157, 255, 0, 0.55);
  animation: none;
}

.score-container {
  text-align: center;
  font-size: 1.5rem;
  font-weight: bold;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}
.modal.hidden { display: none; }
.modal-content {
  background: #222;
  padding: 40px;
  border-radius: 12px;
  text-align: center;
  border: 2px solid #9dff00;
}
.modal-content h2 { margin-bottom: 10px; color: #9dff00; }
.modal-content p { margin-bottom: 20px; font-size: 1.2rem; }

/* Celular */
@media (max-width: 480px) {
  .game-container { padding: 12px; gap: 14px; }
  .hint-container p { font-size: 1.5rem; }
  .hint-container h2 { font-size: 1rem; }
  .game-board { gap: 24px; }
  .answer-bar { padding: 12px; }
  .modal-content { padding: 24px; margin: 16px; }
}
