*,
*::after,
*::before {
  box-sizing: border-box;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
}

.snake-game {
  position: relative;
  width: 100vmin;
  height: 100vmin;
}

.board {
  --grid-size: 0;
  position: relative;
  z-index: 2;
  display: grid;
  width: 100%;
  height: 100%;
  grid-template-rows: repeat(var(--grid-size), 1fr);
  grid-template-columns: repeat(var(--grid-size), 1fr);
}

.grid {
  display: grid;
  grid-template-rows: repeat(20, 1fr);
  grid-template-columns: repeat(20, 1fr);
  position: absolute;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.grid .grid-item {
  outline: 1px solid #ddd;
}

.snake {
  position: relative;
  line-height: 1em;
  font-size: calc(100vmin / var(--grid-size));
}

.food {
  line-height: 1em;
  font-size: calc(100vmin / var(--grid-size));
}
