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


.grid {
  max-width: 960px;
  margin: 0 auto;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
      flex-wrap: wrap;
  -webkit-box-pack: space-evenly;
      -ms-flex-pack: space-evenly;
          justify-content: space-evenly;
}

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

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

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

.front {
  background: #012337 url('../img/Match_.jpg') no-repeat center center / contain;
}

.back {
  -webkit-transform: rotateY(180deg);
          transform: rotateY(180deg);
  background-color: #6589F9;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center center;
}

.selected {
  -webkit-transform: rotateY(180deg);
          transform: rotateY(180deg);
}

.match .front {
  background: #012337 url('../img/Match_0.jpg') no-repeat center center / contain;
}
