#cardsMatching {
  background-color: lightcoral;
  min-height: 100vh;
  width: 100%;
}
#cardsMatching h1 {
  color: #fff;
  text-align: center;
  padding: 50px 0;
  font-size: 50px;
  text-shadow: 1px 1px 3px red;
}
.cards {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px 50px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 50px;
}
.card {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
  background-color: #fff;
  padding: 20px;
  color: black;
  display: flex;
  align-items: center;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  cursor: pointer;
  transition-duration: 200ms;
  perspective: 1000px;
  position: relative;
  min-height: 400px;
}
.card:hover {
  transform: scale(1.03);
}

.card img {
  max-width: 100%;
  object-fit: cover;
}

.cardCover {
  position: absolute;
  transform: rotateY(0deg);
  backface-visibility: hidden;
  transition: transform 0.6s;
}
.mainCard {
  transform: rotateY(180deg);
  /* display: none; */
  backface-visibility: hidden;
  transition: transform 0.6s;
}
.clickedCount {
  position: absolute;
  top: 50px;
  right: 30px;
  color: #fff;
  font-size: 24px;
  border: 2px solid #fff;
  border-radius: 50%;
  background-color: lightcoral;
  box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
}
.winMessage {
  position: fixed;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: green;
  text-shadow: 0px 5px 4px black;
  font-size: 60px;
  z-index: 3;
  font-weight: bold;
  opacity: 0;
  transition-duration: 500ms;
  text-align: center;
}

@media only screen and (max-width: 1200px) {
  .cards {
    max-width: 900px;
  }
  .card {
    min-height: 300px;
  }
}
@media only screen and (max-width: 800px) {
  .cards {
    gap: 30px;
  }
  #cardsMatching h1 {
    padding: 50px 0 100px;
  }
  .clickedCount {
    position: absolute;
    top: 130px;
    right: 30px;
  }
}
@media only screen and (max-width: 600px) {
  .cards {
    gap: 20px;
    grid-template-columns: 1fr 1fr 1fr;
  }
  .card {
    min-height: 300px;
  }
  #cardsMatching h1 {
    font-size: 30px;
    padding: 50px 0 120px;
  }
  .clickedCount {
    position: absolute;
    top: 140px;
    right: 30px;
  }
  .winMessage {
    font-size: 30px;
  }
}
@media only screen and (max-width: 450px) {
  .card {
    min-height: 150px;
    height: 150px;
  }
}
