body {
  display: flex;
  justify-content: center;
  align-items: center;
}
h2 {
  text-align: center;
}
#memGame {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 10px;
}
.memory-game {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 700px;
}
.best-score {
  font-size: 3em;
  font-weight: bold;
  text-align: center;
  color: red;
}
.card {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 20px;
}
.card .cardFront,
.card .cardBack {
  width: 100%;
  height: 100%;
  position: absolute;
  backface-visibility: hidden;
  transition: transform 0.5s linear;
}
.card .cardFront {
  position: absolute;
  width: 100px;
  height: 100px;
  padding: 8px;
  background-image: url("mm-g.jpg");
  background-size: cover;
}
.card .cardBack {
  display: flex;
  justify-content: center;
  align-items: center;
  transform: rotateY(180deg);
  background-color: white;
  width: 120px;
  height: 120px;
  font-size: 5em;
  font-weight: bold;
  color: red;
}
.card.flip .cardFront {
  transform: rotateY(180deg);
}
.card.flip .cardBack {
  transform: rotateY(360deg);
}
.count {
  text-align: center;
  margin-top: 20px;
  font-size: 3em;
  font-weight: bold;
}
@media (max-width: 480px) {
  h1 {
    font-size: 1.25em;
  }
  #memGame {
    gap: 5px;
    padding: 5px;
  }
  .memory-game {
    max-width: 355px;
  }
  .best-score {
    font-size: 1.5em;
  }
  .card {
    width: 50px;
    height: 50px;
    margin: 10px;
  }
  .card .cardFront {
    width: 50px;
    height: 50px;
    padding: 4px;
  }
  .card .cardBack {
    width: 60px;
    height: 60px;
    font-size: 3.5em;
  }
  .count {
    font-size: 1.5em;
  }
  
}
