*, *::before, *::after {
  box-sizing: border-box;
  font-family: 'Faruma';
}

@font-face {
  font-family: 'Faruma';
  src: url(../fonts/Faruma.otf);
}

.num-font {
  font-family: sans-serif;
}

body {
  background-color: #333;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
  font-size: 10.5vmin;
}

#game-board {
  display: grid;
  grid-template-columns: repeat(var(--grid-size), var(--cell-size));
  grid-template-rows: repeat(var(--grid-size), var(--cell-size));
  background-color: #CCC;
  gap: var(--cell-gap);
  border-radius: 1vmin;
  padding: var(--cell-gap);
  position: relative;
}

.cell {
  background-color: #AAA;
  border-radius: 1vmin;
}

.tile {
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  width: var(--cell-size);
  height: var(--cell-size);
  border-radius: 1vmin;
  top: calc(var(--y) * (var(--cell-size) + var(--cell-gap)) + var(--cell-gap));
  left: calc(var(--x) * (var(--cell-size) + var(--cell-gap)) + var(--cell-gap));
  background-color: hsl(200, 50%, var(--background-lightness));
  color: hsl(200, 25%, var(--text-lightness));
  animation: show 200ms ease-in-out;
  transition: 100ms ease-in-out;
}

#game-over-message {
  text-align: center;
  font-size: 1.25rem;
  color: red;
  margin-top: 1rem;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 200ms ease-in-out, transform 200ms ease-in-out;
}

#game-over-message.show {
  opacity: 1;
  transform: scale(1);
}

#restart-button {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  cursor: pointer;
  background-color: hsl(200, 50%, 50%);
  color: white;
  border: none;
  border-radius: 0.5rem;
  transition: background-color 200ms ease-in-out;
}

#restart-button:active {
  scale: 0.95;
}

.hidden {
  display: none !important;
}

@keyframes show {
  0% {
    opacity: .5;
    transform: scale(0);
  }
}

#score-container {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 400px;
  margin-bottom: 1rem;
  color: white;
  font-size: 1.5rem;
  padding: 0 1rem;
}