* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

body {
  height: 100vh;
  display: flex;
  background-color: #f1d932;
}

#game {
  width: 750px;
  height: 640px;
  padding: 20px;

  margin: auto;
  display: flex;
  flex-wrap: wrap;
}

.card {
  width: calc(25% - 10px);
  height: calc(33.333% - 10px);
  margin: 5px;
  position: relative;

  transform: scale(1);
  transform-style: preserve-3d;
  transition: transform 0.5s;
}

.card:active {
  transform: scale(0.9);
  transition: transform 0.2s;
}

.front,
.back {
  width: 100%;
  height: 100%;
  position: absolute;
  border-radius: 5px;
  backface-visibility: hidden;
}

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