.cards {
  max-width: 800px;
  display: flex;
  flex-wrap: wrap;
  margin: 0 auto;
}

.card {
  width: calc(33.333% - 10px);
  padding-bottom: calc(33.333% - 10px);
  position: relative;
  margin: 5px;
  perspective: 1000px; /* Remove this if you don't want the 3D effect */
  box-sizing: border-box;
}

.card-inner {
  height: 100%;
  width: 100%;
  position: absolute;
}

.faces {
  height: 100%;
  width: 100%;
  position: absolute;
  text-align: center;
  border: 1px solid #626262;
  border-radius: 8px;
  box-sizing: border-box;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.is-checked .faces,
.is-matched .faces {
  transform: rotateY(180deg);
}

/* Position the front and back side */
.front, .back {
  height: 100%;
  width: 100%;
  position: absolute;
  -webkit-backface-visibility: hidden; /* Safari */
  backface-visibility: hidden;
  background-color: #ffffff;
  border-radius: 8px;
}

.back {
  cursor: pointer;
}

.front {
  transform: rotateY(180deg);
}

@media (min-width: 992px) {
  .card {
    width: calc(25% - 10px);
    padding-bottom: calc(25% - 10px);
  }
}