html {
  font-family: "Lato", sans-serif;
  font-weight: 300;
}

.display {
  position: relative;
}

#snakegame {
  position: relative;
  border: 3px solid black;
  border-radius: 10px;
  display: inline-block;
  box-sizing: border-box;
  overflow: hidden;
  float: left;
  opacity: 0;
}

.snakegame-container {
  margin: auto auto;
  text-align: center;
}

.newgame, .gameover,
.highscore-entry, .highscores,
.current-score {
  display: none;
}

.newgame.active,
.gameover.active {
  display: block;
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
  text-align: center;
  background-color: rgba(70, 70, 70, 0.4);
}

.how-to-play {
  font-weight: 400;
}

.difficulty {
  border-radius: 5px;
  padding: 15px 30px;
  margin: 0px 15px;
  font-size: 16px;
}

.current-score.active,
.highscores.active,
.highscore-entry.active {
  display: block;
}

.current-score.active {
  position: absolute;
  right: 5%;
  margin-top: -20px;
}

.newgame .info,
.gameover .info {
  background-color: rgba(220, 220, 220, 0.8);
  border-radius: 10px;
  padding: 10px;
  margin-top: 40%;
  transform: translateX(50%);
  width: 45%;
}

.gameover .info {
  margin-top: 16%;
  transform: translateX(21.3%);
  width: 66%;
}

.container {
  position: absolute;
  display: flex;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

.row {
  display: inline-block;
  float: left;
  clear: left;
  line-height: 0;
}

.cell {
  display: inline-block;
  box-sizing: border-box;
  width: 20px;
  height: 20px;
  background-color: white;
}

.cell.snake {
  background-color: green;
}

.cell.apple {
  background-color: red;
}

.cell.dead {
  background-color: #254117;
}

.snake, .dead, .apple {
  border-radius: 5px;
  border: 1px solid white;
}

.strong {
  font-weight: bold;
}

.fadein {
  opacity: 0;
  animation: fadeIn ease-in 1;
  animation-fill-mode: forwards;
  animation-duration: 1s;
}

.title .fadein {
  animation-duration: 0.8s;
}

#snakegame.fadein {
  animation-delay: 0.5s;
  animation-duration: 1.5s;
}

.gameover.fadein {
  animation-delay: .75s;
  animation-duration: 0.75s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
