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

body {
  margin: 20px 0;
  background: url(background.jpg) no-repeat;
  background-size: cover;
}

.grid {
  padding-top: 20px;
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-evenly;
}

.card {
  margin: 5px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center center;
  height: 200px;
  width: 150px;
}

.card {
  position: relative;
  transition: all .4s linear;
  transform-style: preserve-3d;
  margin: 5px;
}

.card,
.back,
.front {
  height: 200px;
  width: 150px;
}

.back,
.front {
  position: absolute;
  backface-visibility: hidden;
}

.front {
  background: url('front.png') no-repeat center center / contain;
}

.back {
  transform: rotateY(180deg);
  background-color: none;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center center;
}
.selected {
  transform: rotateY(180deg);
}

.match .front {
  background: none; !important;
}
