@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
  justify-content: space-between;
}

p{
  font-size: 20px;
  text-decoration: underline wavy rgba(0, 0, 0, 0.1);
}

body{
  padding: 15px;
  margin-bottom: 20%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: linear-gradient(to right top, #00ffff, #00ffea, #00ffcb, #00ffa5, #11ff76, #94f03f, #cede07, #f9c800, #ff9520, #ff4b60, #ff00ab, #ff00ff);
}

body::-webkit-scrollbar{
  width: 0;
}

::selection{
  color: #fff;
  background-image: linear-gradient(to right top, #00ffff, #00ffea, #00ffcb, #00ffa5, #11ff76, #94f03f, #cede07, #f9c800, #ff9520, #ff4b60, #ff00ab, #ff00ff);
} 

.wrapper{
  height: 650px;
  width: 500px;
  background: #f8f8f8;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.7);
}

.cards,
 .card, 
 .view,
 .details,
 p{
  display: flex;
  align-items: center;
  justify-content: center;
}

.cards{
  margin-top: 3px;
  height: 500px;
  width: 500px;
  flex-wrap: wrap;
}
.cards .card{
  margin: 5px;
  cursor: pointer;
  position: relative;
  perspective: 800px;
  transform-style: preserve-3d;
  height: calc(100% / 5 - 10px);
  width: calc(100% / 5 - 10px);
}

.card.shake{
  animation: shake 0.35s ease-in-out;
}
@keyframes shake {

  0%, 100%{
    transform: translateX(0);
  }

  20%{
    transform: translateX(-13px);
  }

  40%{
    transform: translateX(13px);
  }

  60%{
    transform: translateX(-8px);
  }

  80%{
    transform: translateX(8px);
  }
}

.cards .card .view{
  width: 100%;
  height: 100%;
  user-select: none;
  pointer-events: none;
  position: absolute;
  background: #fff;
  border-radius: 7px;
  backface-visibility: hidden;
  transition: transform 0.25s linear;
  box-shadow: 0 3px 10px rgba(0,0,0,0.5);
}

.card .front-view img{
    width: 85px;
    height: 85px;
    border-radius: 7px;
}

.card .back-view{
  transform: rotateY(-180deg);
}

.card .back-view img{
  width: 85px;
  height: 85px;
  border-radius: 7px;
}

.card.flip .front-view{
  transform: rotateY(180deg);
}

.card.flip .back-view{
  transform: rotateY(0);
}

.details{
  width: 110%;
  margin-top: 15px;
  padding: 0 10px;
  border-radius: 7px;
  background: #ccc;
  height: calc(100% / 5 - 30px);
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.details p{
  font-size: 18px;
  height: 17px;
  padding-right: 18px;
  margin-right: 2px;
  border-right: 1px solid #ccc;
}

.details p span{
  margin-left: 8px;
}

.details p b{
  font-weight: 500;
}

.details button{
  cursor: pointer;
  font-size: 14px;
  color: #11ff76;
  border-radius: 4px;
  padding: 4px 11px;
  background: #fff;
  font-weight: 899;
  border: 2px solid #ff00ab;
  transition: 0.3s ease;
}

.details button:hover{
  color: #fff;
  background-image: linear-gradient(to left top, #00ffff, #00ffea, #00ffcb, #00ffa5, #11ff76, #94f03f, #cede07, #f9c800, #ff9520, #ff4b60, #ff00ab, #ff00ff);
}

@media screen and (max-width: 700px) {

  .cards{
    margin-top: 2px;
    height: 450px;
    width: 500px;
  }

  .card{
    margin: 2px;
  }

  .card .front-view img{
    max-width: 64px;
  }

  .card .back-view img{
    max-width: 100px;
  }

}

@media screen and (max-width: 530px) 
 {

*{
  margin: auto;
}

  .cards
  {
    margin-top: 5px;
    height: 400px;
    width: 400px;
  }

  .card{
    margin: 5px;
  }
  .card .back-view img{
    width: 30px;
    height: 30px;
  }

  .card .front-view img{
    height: 50px;
    width: 50px;
  }

  .card .back-view img{
    height: 50px;
    width: 50px;
  }

  .details{
    margin-top: 20px;
    padding: 0 15px;
    height: calc(100% / 4 - 20px);
  }

  .details p{
    height: 15px;
    font-size: 17px;
    padding-right: 13px;
  }

  .details button{
    font-size: 13px;
    padding: 5px 10px;
    border: none;
    color: #fff;
    background: #6563ff;
  }

}