:root {
  --bg: #f6f7fb;
  --fg: #1d2433;
  --accent: #2f7d32;
  --danger: #c62828;
  --cell: #ffffff;
  --line: #d4d9e1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
}

.app {
  max-width: 560px;
  margin: 24px auto;
  padding: 16px;
}

.hud {
  margin-bottom: 12px;
}

.hud h1 {
  margin: 0 0 8px;
  font-size: 24px;
}

.hud p {
  margin: 4px 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(20, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: var(--line);
  gap: 1px;
  width: min(92vw, 520px);
  aspect-ratio: 1;
}

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

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

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

.controls {
  margin-top: 14px;
  display: inline-flex;
  flex-direction: column;
  gap: 8px;
}

.row {
  display: flex;
  gap: 8px;
  justify-content: center;
}

button {
  min-width: 80px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
}

button:active {
  transform: translateY(1px);
}
