html,
body {
  min-width: 100%;
  min-height: 100%;
  margin: 0;
  background: #111;
  color: #e8e8e8;
}

body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  font: 16px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.game {
  width: min(86vmin, 620px);
  padding: 24px;
  box-sizing: border-box;
}

.game-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

h1,
p {
  margin: 0;
}

h1 {
  font-size: 18px;
  font-weight: 600;
}

.game-header p,
.help {
  color: #a8a8a8;
  font-size: 13px;
}

#score {
  color: #fff;
}

.board-wrap {
  position: relative;
  aspect-ratio: 1;
}

.board {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid #555;
  background: #080808;
  box-sizing: border-box;
  shape-rendering: crispEdges;
}

.board-background {
  fill: #080808;
}

.board-grid {
  fill: url(#grid-pattern);
}

.grid-line {
  fill: none;
  stroke: #3a3a3a;
  stroke-width: 0.04;
}

.snake-segment {
  fill: #d8d8d8;
}

.snake-head {
  fill: #fff;
}

.food {
  fill: #e05252;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: rgba(8, 8, 8, 0.08);
  color: #fff;
  font-size: 14px;
}

.overlay[hidden] {
  display: none;
}

.help {
  margin-top: 10px;
  text-align: center;
}

@media (max-width: 520px) {
  .game {
    width: 96vw;
    padding: 14px;
  }
}
