* {
  box-sizing: border-box;
}

body {
  margin: 0;
  position: relative;
}

.intro-container {
  width: 100vw;
  height: 100vh;
  background-color: rgba(5, 193, 245, 98%);
  position: absolute;
  z-index: 100;
  display: flex;
  justify-content: center;
}

.intro {
  margin-top: 30px;
  padding: 20px;
  text-align: center;
  width: 500px;
  font-size: 30px;
}

.intro p {
  font-weight: bold;
}

.intro button {
  font-size: 30px;
  width: 200px;
  background-color: #333;
  color: #05c1f5;
  border: none;
  border-radius: 4px;
  padding: 10px;
  cursor: pointer;
}

.container {
  margin: auto;
  width: 900px;
}

.info-container {
  padding: 10px;
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  border: 2px solid #05c1f5;
  position: relative;
  top: 5px;
  font-size: 20px;
}

.wrong-tries {
  position: relative;
  top: 1px;
}

/* win and lose */
.result {
  position: absolute;
  width: 280px;
  height: 150px;
  background-color: #333;
  left: calc(50% - 140px);
  top: 100px;
  text-align: center;
  font-size: 22px;
  z-index: 9;
  border: 2px solid #05c1f5;
}

.win {
  color: #07cd07;
}

.lose {
  color: red;
}

.hide {
  visibility: hidden;
}

.try-again {
  background-color: #05c1f5;
  border: none;
  color: #333;
  padding: 8px;
  border-radius: 4px;
  cursor: pointer;
}

/* cards section */

.cards-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.card {
  flex: 1 1 200px;
  height: 150px;
  position: relative;
  transition: transform 0.5s;
  transform-style: preserve-3d;
  border: 2px solid #05c1f5;
  cursor: pointer;
}

.face {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  backface-visibility: hidden;
}

.front {
  background-color: #333;
  font-size: 100px;
}

.back {
  transform: rotateY(180deg);
}

.back img {
  width: 100%;
  height: 100%;
}

.card.clicked,
.card .matched {
  transform: rotateY(180deg);
}

.prevent-click {
  pointer-events: none;
}

@media (min-width: 721px) and (max-width: 930px) {
  .container {
    width: 690px;
  }

  .card {
    flex-basis: 150px;
    height: 150px;
  }
}

@media (min-width: 470px) and (max-width: 720px) {
  .container {
    width: 450px;
  }

  .card {
    flex-basis: 100px;
    height: 100px;
  }
}

@media (max-width: 469px) {
  .intro,
  .intro button {
    font-size: 20px;
  }

  .container {
    width: 280px;
  }

  .info-container {
    font-size: 14px;
  }

  .card {
    flex-basis: 100px;
    height: 100px;
  }
}
