body {
  height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url('img/background.jpg') no-repeat;
  background-size: cover;
  overflow-y: hidden;
  overflow-x: hidden;
}
#wraper-container {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
}
#wraper-container.disable-click {
  z-index: 1;
}
.wraper {
  width: 100%;
}
#timer {
  width: 222px;
  height: 49px;
  position: absolute;
  top: 50px;
  font-size: 22px;
  color: #efdda5;
  font-family: 'Shojumaru', cursive;
  left: 50%;
  margin-left: -111px;
  background: url('img/scoreboard.png');
  background-size: cover;
  display: flex;
  justify-content: center;
  line-height: 46px;
  text-shadow: 2px 2px #171717;
}
#timer span.animate {
  animation: 0.2s timeranimation;
}
#timer span {
  display: inline-block;
  width: 40px;
  padding: 0 10px;
}
#timer span:nth-child(1) {
  text-align: right;
}
#timer span:nth-child(2) {
  text-align: left;
}

@keyframes timeranimation {
  0% {
    transform: scale3d(1,1,1);
  }
  50% {
    transform: scale3d(1.3,1.3,1);
  }
  100% {
    transform: scale3d(1,1,1);
  }
}
#items-container {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
}
.flip-card {
  background-color: transparent;
  width: calc(100% / 8);
  height: 220px;
  perspective: 1000px;
  -webkit-perspective: 1000px;
  margin-top: 10px;
}
.flip-card:hover {
  cursor: pointer;
}
.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.5s;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}
.flip-card .flip-card-inner.active {
  transform: rotateY(180deg);
}
.flip-card-front, .flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  -moz-backface-visibility: hidden;
  -ms-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: rotateX(0deg);
}
.flip-card-front img {
 height: 100%;
}
.flip-card-back {
  transform: rotateY(180deg);
}
.flip-card-back img {
  height: 100%;
}
#items-container .flip-card, #items-container .flip-card-back, #items-container .flip-card-front, 
#items-container .flip-card-inner, #items-container .flip-card-back img, #items-container .flip-card-front img {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
#game-over.popup, #victory.popup {
  display: none;
  width: 640px;
  height: 250px;
  position: absolute;
  left: 50%;
  margin-left: -330px;
  top: 50%;
  margin-top: -125px;
  background-size: cover;
}
#victory {
  background: url('img/victory.png');
}
#game-over {
  background: url('img/game-over.png');
}
@keyframes popup {
  0% {
    transform: scale3d(0.8, 0.8, 0.8);
  }
  100% {
    transform: scale3d(1, 1, 1);
  }
}
#victory.show-up, #game-over.show-up {
  display: block;
  animation-name: popup;
  animation-duration: 0.4s;
}

@media only screen and (max-width: 1024px) {
  .flip-card {
    width: calc(100% / 4);
  }
}
@media screen and (max-width: 768px) , screen and (max-height: 720px) {
  .flip-card {
    height: 100px;
  }
  #timer { 
    top: 25px;
  }
}
@media only screen and (max-width: 768px) {
  .flip-card {
    height: 160px;
  }
}
@media only screen and (max-width: 600px) {
  #items-container {
    width: 90%;
    margin: 0 auto;
  }
  .flip-card {
    height: 130px;
  }
  #game-over.popup, #victory.popup {
    width: 440px;
    height: 150px;
    margin-left: -220px;
    margin-top: -75px;
  }
}
@media only screen and (max-width: 420px) {
  .flip-card {
    height: 80px;
  }
  #game-over.popup, #victory.popup {
    width: 300px;
    height: 110px;
    margin-left: -150px;
    margin-top: -55px;
  }
}
@media only screen and (max-width: 320px) {
  #timer {
    width: 180px;
    height: 39px;
    top: 25px;
    margin-left: -90px;
    font-size: 18px;
    line-height: 39px;
  }
}
@media only screen and (max-width: 240px) {
  #timer {
    width: 130px;
    height: 28px;
    margin-left: -65px;
    font-size: 17px;
    line-height: 28px;
  }
  .flip-card {
    height: 40px;
  }
  #game-over.popup, #victory.popup {
    width: 200px;
    height: 80px;
    margin-left: -100px;
    margin-top: -40px;
  }
}
@media screen and (max-width: 640px) and (orientation: landscape) { 
  .flip-card {
    width: calc(100% / 8);
    height: 60px;
  }
 }

