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

html,
body {
  overscroll-behavior-y: contain;
}

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

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

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

.tile {
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  background-color: hsl(200, 50%, var(--background-lightness));
  color: hsl(200, 25%, var(--text-lightness));
  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));
  animation: show 200ms ease-in-out;
  transition: 100ms ease-in-out;
}

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

.footer {
  width: 100%;
  color: #aaa;
  text-align: center;
  font-size: 2.8vmin;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 600px) {
  .footer {
    position: absolute;
    bottom: 0;
  }
}

.footer img {
  width: 2.5vmin;
}
a {
  color: inherit;
}
a:hover {
  color: #fff;
  transition: ease-in-out 300ms;
}

.howToPlayButton {
  position: absolute;
  right: 0;
  margin-right: 3vmin;
  cursor: help;
}
.howToPlayButton img {
  width: 6vmin;
}
