:root {
  --bg: #11151c;
  --panel: #1a2029;
  --grid: #171d25;
  --snake: #4ade80;
  --snake-head: #86efac;
  --food: #f87171;
  --text: #e5e7eb;
  --muted: #8b95a5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

.game {
  padding: 24px 16px;
  width: 100%;
  max-width: 440px;
}

.scoreboard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.scoreboard h1 {
  font-size: 1.4rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin: 0;
}

.score {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 64px;
  font-size: 1.3rem;
  font-variant-numeric: tabular-nums;
}

.label {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.board-wrap {
  position: relative;
}

canvas {
  width: 100%;
  height: auto;
  display: block;
  background: var(--panel);
  border-radius: 12px;
  touch-action: none;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  background: rgba(17, 21, 28, 0.85);
  text-align: center;
}

.overlay.hidden {
  display: none;
}

#overlay-title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
}

#overlay-text {
  margin: 0;
  color: var(--muted);
}

.controls {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

button {
  flex: 1;
  padding: 10px;
  border: 1px solid #2c3543;
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
}

button:hover {
  background: #232b36;
}

.hint {
  margin-top: 14px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}
