:root {
  --card-width: 125px;
  --card-height: 175px;
}

body {
  margin: 0;
  background: url(img/background.png);
  background-position: center;
  background-size: cover;
  color: #5e5447;
  font-family: "Kanit", sans-serif;
  text-shadow: 2px 2px 3px rgb(177, 177, 177);
  min-height: 100vh;
}

h1 {
  font-size: caster;
  text-align: center;
}

#ui-container {
  text-align: center;
}

#ui-container h3 {
  margin: 0;
  display: inline-block;
  font-size: 40px;
  text-align: center;
}

#ui-container h3:first-child {
  margin-right: 40px;
}

#card-container {
  font-size: 0;
  margin: 50px auto;
  width: calc((var(--card-width) + 2vw + 12px) * 4);
}

.card {
  display: inline-block;
  position: relative;
  margin: 1vw;
  width: var(--card-width);
  height: var(--card-height);
  border: 2px solid transparent;
  overflow: hidden;
}

/* Style the two logo images themselves. */
.card-down,
.card-up {
  /* Take images out of the flow. */
  position: absolute;
  width: 100%;
  height: 100%;
  /* When facing away from the screen each image should be hidden. */
  backface-visibility: hidden;
  border-radius: 5px;
  transition-duration: 0.3s;
}

.card-down {
  background-image: url(img/card.png);
  background-position: center;
  background-size: cover;
}

.card-up {
  background-position: center;
  background-size: cover;
  transform: rotateY(180deg);
}

.flipped .card-down {
  transform: rotateY(180deg);
}

.flipped .card-up {
  transform: rotateY(0deg);
}

.image-1 .card-up {
  background-image: url(img/image-1.png), linear-gradient(#72dbf4, #72dbf4);
}

.image-2 .card-up {
  background-image: url(img/image-2.png), linear-gradient(#72dbf4, #72dbf4);
}

.image-3 .card-up {
  background-image: url(img/image-3.png), linear-gradient(#72dbf4, #72dbf4);
}

.image-4 .card-up {
  background-image: url(img/image-4.png), linear-gradient(#72dbf4, #72dbf4);
}

.image-5 .card-up {
  background-image: url(img/image-5.png), linear-gradient(#72dbf4, #72dbf4);
}

.image-6 .card-up {
  background-image: url(img/image-6.png), linear-gradient(#72dbf4, #72dbf4);
}

/* Glow effect for matched cards */
.matched {
  box-shadow: 0 0 15px 5px rgba(0, 255, 255, 0.8),
    /* Cyan glow */ 0 0 25px 10px rgba(0, 255, 255, 0.4);
  border: 2px solid rgba(0, 255, 255, 0.8);
  transition: box-shadow 0.3s ease, border 0.3s ease;
}

@keyframes glow-pulse {
  0% {
    box-shadow: 0 0 5px 2px rgba(0, 255, 255, 0.5);
  }
  50% {
    box-shadow: 0 0 20px 8px rgba(0, 255, 255, 0.9);
  }
  100% {
    box-shadow: 0 0 15px 5px rgba(0, 255, 255, 0.8);
  }
}

.matched {
  animation: glow-pulse 0.5s ease-in-out;
}

.btn-container {
  display: flex;
  justify-content: center;
}

.reset-btn {
  margin: 0 0 30px 0;
  padding: 20px 40px;
  background-color: #5e5447;
  color: white;
  border: 0px;
  border-radius: 10px;
  font-family: "Kanit", sans-serif;
  font-size: 1.5em;
}

.reset-btn:hover {
  cursor: pointer;
  background-color: #534a3d;
}
.reset-btn:hover {
  cursor: pointer;
  background-color: #534a3d;
}
