/* Sudoku — grade 9x9, solo e online. */

.grade { display: grid; grid-template-columns: repeat(9, minmax(28px, 1fr)); max-width: 594px; margin: 0 auto; border: 2px solid #3b82f6; background: #29385c; gap: 1px; }
.celula { width: 100%; aspect-ratio: 1; border: 0; border-radius: 0; padding: 0; color: #ffffff; background: #0d1424; font-size: clamp(16px, 3vw, 25px); font-weight: bold; line-height: 1; text-align: center; appearance: textfield; -moz-appearance: textfield; }
.celula::-webkit-outer-spin-button, .celula::-webkit-inner-spin-button { margin: 0; appearance: none; -webkit-appearance: none; }
.celula:nth-child(3n) { border-right: 2px solid #3b82f6; }
.celula:nth-child(9n) { border-right: 0; }
.celula:nth-child(n+19):nth-child(-n+27), .celula:nth-child(n+46):nth-child(-n+54) { border-bottom: 2px solid #3b82f6; }
.celula:focus { outline: 2px solid #9dc2ff; outline-offset: -2px; }
.celula.preenchida { color: #7db4ff; background: #16233d; cursor: not-allowed; }
.celula.erro { color: #ff7070; background: #4d2028; }

@media (max-height: 800px) {
  #tela-jogo .cabecalho-jogo { margin-bottom: 4px; }
  #tela-jogo .voltar { margin-bottom: 8px; }
  #tela-jogo .mensagem { margin: 8px 0; }
  #tela-jogo .grade { max-width: min(594px, 54vh, 82vw); }
  #tela-jogo .acoes { margin-top: 12px; }
  #tela-jogo .historico { margin-top: 18px; padding-top: 14px; }
}
