* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: -apple-system, system-ui, sans-serif;
  background: #050b05;
  color: #7dff7d;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

#app {
  width: 100%;
  max-width: 400px;
  padding: 16px;
  text-align: center;
}

.topo h1 {
  margin: 0 0 4px;
  font-size: 1.4rem;
  color: #39ff39;
  text-shadow: 0 0 8px rgba(57, 255, 57, 0.5);
  letter-spacing: 0.05em;
}

.pontuacao {
  font-weight: 700;
  color: #39ff39;
  margin: 4px 0 12px;
}

.area-jogo {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.tabuleiro {
  display: grid;
  gap: 0;
  background: #0a1a0a;
  border: 3px solid #1f4d1f;
  border-radius: 4px;
}

.celula {
  width: 100%;
  height: 100%;
  background: transparent;
}

.celula.cobra-cabeca {
  background: #39ff39;
  border-radius: 3px;
}

.celula.cobra-corpo {
  background: #1f9d1f;
  border-radius: 2px;
}

.celula.comida {
  background: #ff5b3d;
  border-radius: 50%;
}

.controles {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.linha-controles {
  display: flex;
  gap: 40px;
}

.botao {
  border: none;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  padding: 12px 16px;
  font-size: 1.1rem;
}

.botao-seta {
  background: #1f4d1f;
  color: #7dff7d;
  min-width: 52px;
}

.instrucoes {
  color: #4a7a4a;
  font-size: 0.78rem;
}

.tela-fim {
  position: fixed;
  inset: 0;
  background: rgba(5, 11, 5, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tela-fim[hidden] {
  display: none;
}

.tela-fim-cartao {
  background: #0a1a0a;
  border: 2px solid #39ff39;
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  max-width: 320px;
}

.tela-fim-cartao h2 {
  margin-top: 0;
  color: #39ff39;
}

.botao-reiniciar {
  background: #39ff39;
  color: #050b05;
  padding: 14px 28px;
  margin-top: 12px;
}
