* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
  background: linear-gradient(135deg, #e06060, #e1b34f);
}

.title {
  font-size: 30px;
  margin-bottom: 20px;
}

.wrapper {
  width: 90%;
  max-width: 500px;
  height: auto;
  aspect-ratio: 1/1;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0px 3px 3px rgba(0, 0, 0, 0.3);
}

.cards,
.card,
.view {
  display: flex;
  justify-content: center;
  align-items: center;
}

.cards {
  height: 100%;
  width: 100%;
  list-style-type: none;
  padding: 20px;
  flex-wrap: wrap;
  justify-content: space-between;
}

@media (max-width: 500px) {
  .cards {
    padding: 10px;
  }
}

.cards .card {
  cursor: pointer;
  position: relative;
  perspective: 800px;
  transform-style: preserve-3d;
  height: calc(100% / 4 - 10px);
  width: calc(100% / 4 - 10px);
}

.cards .card .view {
  height: 100%;
  width: 100%;
  position: absolute;
  user-select: none;
  pointer-events: none;
  background-color: #fff;
  transition: transform 0.25s linear;
  backface-visibility: hidden;
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.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);
  }
}
.back-view {
  transform: rotateY(-180deg);
}

.card.flip .front-view {
  transform: rotateY(180deg);
}

.card.flip .back-view {
  transform: rotateY(0);
}

.front-view span {
  color: #e06060;
  font-weight: 600;
  font-size: 30px;
}

.card-img {
  width: 80px;
  height: 80px;
}
