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

body {
  margin: 0;
  background: url(img/background.png);
  background-position: center;
  background-size: cover;
  color: #86d6f6;
  font-family: Handlee;
  text-shadow: 2px 2px #000000;
  min-height: 100vh;
}

h1 {
  font-size: 60px;
  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) + 24px) * 4);
}

@media (max-width: 768) {

  /* Adjust the breakpoint according to your tablet size */
  #card-container {
    width: calc((var(--card-width) + 24px) * 3);
  }

  h1 {
    font-size: 40px;
    text-align: center;
  }

  #ui-container h3 {
    font-size: 30px;
    text-align: center;
  }
}

@media (max-width: 480px) {

  /* Adjust the breakpoint according to your tablet size */
  :root {
    --card-width: 62px;
    --card-height: 82px;
  }

  #card-container {
    width: calc((var(--card-width) + 24px) * 3);
  }

  h1 {
    font-size: 30px;
    text-align: center;
  }

  #ui-container h3 {
    font-size: 20px;
    text-align: center;
  }
}

.card {
  display: inline-block;
  position: relative;
  margin: 10px;
  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: .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.jpg), linear-gradient(#72dbf4, #72dbf4);
}

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

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

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

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

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

button {
  margin-top: 100px;
  font-size: clamp(14px, 2vw, 20px);
  background-color: rgba(36, 64, 221, 0.904);
  color: rgb(245, 245, 245);
  border: rgb(0, 0, 0) solid 2px;
  border-radius: 5px;
  text-align: center;
}

button.restart {
  padding: 5px 5px 5px 5px;
}

button.win {
  padding: 5px 5px 15px 5px;
}

.restart {
  margin-top: 20px;
}

.restart img {
  width: 20px;
  height: 20px;
}

.hidden {
  display: none;
}

.glow {
  box-shadow: 0 0 5px 2px red;
}

#canvas {
  position: fixed;
  z-index: -100;
}