/* Import Google Font - Poppins */
@import url('https://googleapis.com');

.mcg-wrapper,
.mcg-wrapper * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

.mcg-wrapper {
  width: 100%;
  max-width: 450px;
  padding: 25px;
  border-radius: 10px;
  background: #F8F8F8;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  margin: 0 auto;
}

.mcg-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

.mcg-subtitle {
  text-align: center;
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 18px;
}

.mcg-cards,
.mcg-card,
.mcg-view {
  display: flex;
  align-items: center;
  justify-content: center;
}

.mcg-cards {
  width: 100%;
  aspect-ratio: 1 / 1;
  flex-wrap: wrap;
  justify-content: space-between;
  align-content: space-between;
}

.mcg-cards .mcg-card {
  cursor: pointer;
  list-style: none;
  user-select: none;
  position: relative;
  perspective: 1000px;
  transform-style: preserve-3d;
  height: calc(100% / 4 - 8px);
  width: calc(100% / 4 - 8px);
}

.mcg-card.mcg-shake {
  animation: mcg-shake 0.35s ease-in-out;
}

@keyframes mcg-shake {
  0%, 100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-13px);
  }
  40% {
    transform: translateX(13px);
  }
  60% {
    transform: translateX(-8px);
  }
  80% {
    transform: translateX(8px);
  }
}

.mcg-card .mcg-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;
}

.mcg-card .mcg-front-view img {
  width: clamp(14px, 4vw, 19px);
}

.mcg-card .mcg-back-view img {
  width: 60%;
  max-width: 45px;
}

.mcg-card .mcg-back-view {
  transform: rotateY(-180deg);
}

.mcg-card.mcg-flip .mcg-back-view {
  transform: rotateY(0);
}

.mcg-card.mcg-flip .mcg-front-view {
  transform: rotateY(180deg);
}

@media screen and (max-width: 480px) {
  .mcg-wrapper {
    padding: 15px;
  }

  .mcg-title {
    font-size: 1.25rem;
  }

  .mcg-subtitle {
    font-size: 0.8rem;
    margin-bottom: 14px;
  }

  .mcg-cards .mcg-card {
    height: calc(100% / 4 - 6px);
    width: calc(100% / 4 - 6px);
  }
}

#memory-game {
  position: relative;
  overflow: hidden;
}