:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #111827;
  --muted: #4b5563;
  --grid: #d1d5db;
  --snake: #111827;
  --food: #dc2626;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app {
  max-width: 520px;
  margin: 1.5rem auto;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--grid);
}

h1 {
  margin: 0 0 0.75rem;
  font-size: 1.4rem;
}

.hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.actions {
  display: flex;
  gap: 0.5rem;
}

button {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--grid);
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.status {
  min-height: 1.3rem;
  margin-bottom: 0.5rem;
  color: var(--muted);
}

.board {
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  grid-template-rows: repeat(20, 1fr);
  gap: 1px;
  width: min(90vw, 460px);
  aspect-ratio: 1 / 1;
  border: 1px solid var(--grid);
  background: var(--grid);
}

.cell {
  background: #fff;
}

.cell.snake {
  background: var(--snake);
}

.cell.food {
  background: var(--food);
}

.controls {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.5rem;
  justify-items: center;
}

.controls .row {
  display: flex;
  gap: 0.5rem;
}

.help {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}
