*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Silkscreen', sans-serif;
}
body {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FF9787;
  margin: 0;
  height: 100vh;
}
.wrapper{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 85%;
}
.cards, .card, .view{
  display: flex;
  align-items: center;
  justify-content: center;
}
.cards{
  display: flex;
  flex-wrap: wrap;
  margin-top: 25px;
  justify-content: space-between;
  align-content: space-between;
  width: 100%;
  height: 100%;
}
.cards .card{
  cursor: pointer;
  list-style: none;
  user-select: none;
  position: relative;
  perspective: 1000px;
  transform-style: preserve-3d;
  height: calc(100% / 4 - 5px);
  width: calc(100% / 4 - 5px);
}
.card.shake{
  animation: shake 0.35s ease-in-out;
}

.arcade-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 400px;
  height: 350px;
  background: #FFAEAF;
  border-radius: 10px;
  box-sizing: border-box;
}

#score {
  font-size: 18px;
  color: #333;
  font-weight: 600;
  text-align: center;
  background: #fff;
  margin-top: -200px;
  border-radius: 8px;
  width: 100%;
}

@keyframes shake {
  0%, 100%{
    transform: translateX(0);
  }
  20%{
    transform: translateX(-13px);
  }
  40%{
    transform: translateX(13px);
  }
  60%{
    transform: translateX(-8px);
  }
  80%{
    transform: translateX(8px);
  }
}
.card .view{
  width: 100%;
  height: 100%;
  position: absolute;
  border-radius: 7px;
  background: #fff;
  pointer-events: none;
  backface-visibility: hidden;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  transition: transform 0.25s linear;
}
.card .front-view img{
  width: 19px;
}
.card .back-view img{
  max-width: 45px;
}
.card .back-view{
  transform: rotateY(-180deg);
}
.card.flip .back-view{
  transform: rotateY(0);
}
.card.flip .front-view{
  transform: rotateY(180deg);
}

@media screen and (max-width: 530px) {
  .cards{
    height: 325px;
    width: 325px;
  }
  .card .front-view img{
    width: 15px;
  }
  .card .back-view img{
    max-width: 35px;
  }
}