.details button:hover,
body {
  background-color: var(--bgColor);
}
:root {
  --bgColor: #6563ff;
  --bgWrapper: #f8f8f8;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Poppins, sans-serif;
}
p {
  font-size: 20px;
}
body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
::selection {
  color: #fff;
  background-color: var(--bgColor);
}
.wrapper {
  background-color: var(--bgWrapper);
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}
.card,
.cards,
.details,
.view,
p {
  display: flex;
  align-items: center;
  justify-content: center;
}
.cards {
  width: 330px;
  height: 330px;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
}
.cards .card .view,
.details {
  width: 100%;
  border-radius: 7px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}
.cards .card,
.details {
  height: calc(100% / 4 + 10px);
}
.cards .card {
  cursor: pointer;
  position: relative;
  perspective: 1000px;
  transform-style: preserve-3d;
  width: calc(100% / 4 - 10px);
}
.cards .card .view {
  height: 100%;
  user-select: none;
  pointer-events: none;
  position: absolute;
  background-color: #fff;
  backface-visibility: hidden;
  transition: transform 0.25s linear;
}
.card .front-view img {
  max-width: 17px;
}
.card .back-view img {
  max-width: 40px;
}
.card .back-view {
  transform: rotateY(-180deg);
}
.card.flip .front-view {
  transform: rotateY(180deg);
}
.card.flip .back-view {
  transform: rotateY(0);
}
.card.shake {
  animation: 0.35s ease-in-out shake;
}
@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-13px);
  }
  40% {
    transform: translateX(13px);
  }
  60% {
    transform: translateX(-8px);
  }
  80% {
    transform: translateX(8px);
  }
}
.details {
  margin-top: 5px;
  padding: 20px;
  background: #fff;
  justify-content: space-between;
}
.details p {
  font-size: 18px;
  height: 17px;
  padding-right: 18px;
  border-right: 1px solid #ccc;
}
.details p span {
  margin-left: 4px;
}
.details p b {
  font-weight: 500;
}
.details button {
  cursor: pointer;
  font-size: 14px;
  color: var(--bgColor);
  border-radius: 4px;
  padding: 4px 11px;
  background-color: #fff;
  border: 2px solid var(--bgColor);
  transition: 0.3s;
}
.details button:hover {
  color: #fff;
}
@media screen and (max-width: 700px) {
  .cards {
    height: 350px;
    width: 350px;
  }
  .card .front-view img {
    max-width: 16px;
  }
  .card .back-view img {
    max-width: 40px;
  }
}
@media screen and (max-width: 430px) {
  .cards {
    height: 300px;
    width: 300px;
  }
  .card .back-view img {
    max-width: 35px;
  }
  .details {
    margin-top: 10px;
    padding: 12px;
    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;
    background-color: #fff;
    border: 2px solid var(--bgColor);
  }
}
@media screen and (max-width: 325px) {
  .cards {
    height: 250px;
    width: 250px;
  }
  .card .back-view img {
    max-width: 30px;
  }
  .details {
    margin-top: 10px;
    padding: 12px;
    height: calc(100% / 4 - 20px);
  }
  .details p {
    height: 13px;
    font-size: 15px;
    padding-right: 13px;
  }
  .details button {
    font-size: 13px;
    padding: 2px 4px;
    border: none;
    background-color: #fff;
    border: 2px solid var(--bgColor);
    margin-left: 5px;
  }
}
