* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  min-height: 100%;
  font-family: "Arial", sans-serif;
}

.wrap {
  position: relative;
  height: 100%;
  min-height: 500px;
  padding-bottom: 20px;
}

.game {
  -webkit-transform-style: preserve-3d;
          transform-style: preserve-3d;
  -webkit-perspective: 500px;
          perspective: 500px;
  min-height: 100%;
  height: 100%;
}

@-webkit-keyframes matchAnim {
  0% {
    background: #bcffcc;
  }

  100% {
    background: white;
  }
}

@keyframes matchAnim {
  0% {
    background: #bcffcc;
  }

  100% {
    background: white;
  }
}

.card {
  float: left;
  width: 25%;
  height: 16.666%;
  padding: 5px;
  text-align: center;
  display: block;
  -webkit-perspective: 500px;
          perspective: 500px;
  position: relative;
  cursor: pointer;
  z-index: 50;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

@media (max-width: 800px) {
  .card {
    width: 25%;
    height: 16.666%;
  }
}

.card .inside {
  width: 100%;
  height: 100%;
  display: block;
  -webkit-transform-style: preserve-3d;
          transform-style: preserve-3d;
  -webkit-transition: 0.4s ease-in-out;
  transition: 0.4s ease-in-out;
  background: white;
}

.card .inside.picked,
.card .inside.matched {
  -webkit-transform: rotateY(180deg);
          transform: rotateY(180deg);
}

.card .inside.matched {
  -webkit-animation: 1s matchAnim ease-in-out;
          animation: 1s matchAnim ease-in-out;
  -webkit-animation-delay: 0.4s;
          animation-delay: 0.4s;
}

.card .front,
.card .back {
  border: 1px solid black;
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 20px;
}

.card .front img,
.card .back img {
  max-width: 100%;
  display: block;
  margin: 0 auto;
  max-height: 100%;
}

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

@media (max-width: 800px) {
  .card .front {
    padding: 5px;
  }
}

.card .back {
  -webkit-transform: rotateX(0);
          transform: rotateX(0);    
    background-color: #F68425;
}

@media (max-width: 800px) {
  .card .back {
    padding: 10px;
  }
}