* {
  box-sizing: border-box;
}

html {
  min-height: 100vh;
}

body {
  margin: 0;
  background: #c03b3b;
}

.page-title {
  color: #3bc0c0;
  font-family: "Mountains of Christmas", cursive;
  font-weight: normal;
  text-align: center;
  font-size: 6em;
}

.game-info-container {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
}

.game-info {
  font-family: "Mountains of Christmas", cursive;
  color: #3bc0c0;
  font-size: 4em;
}

.game-container {
  display: grid;
  grid-template-columns: repeat(4, auto);
  grid-gap: 10px;
  margin: 50px;
  justify-content: center;
  perspective: 500px;
}

.card {
  position: relative;
  height: 175px;
  width: 125px;
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 12px;
  border-width: 1px;
  border-style: solid;
  transition: transform 500ms ease-in-out;
}

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

.card.visible .card-front {
  transform: rotateY(0);
}

.card.matched .card-value {
  animation: dance 1s linear infinite 500ms;
}
img {
  height: 150px !important;
  width: 110px !important;
}

.overlay-text {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  font-size: 5em !important;
  justify-content: center;
  align-items: center;
  z-index: 100;
  color: #3bc0c0;
  font-family: "Mountains of Christmas", cursive;
}

.overlay-text-small {
  font-size: 0.8em;
}

.overlay-text.visible {
  display: flex;
  flex-direction: column;
  animation: overlay-grow 500ms forwards;
}

@keyframes overlay-grow {
  from {
    background-color: rgba(0, 0, 0, 0);
    font-size: 0;
  }
  to {
    background-color: rgba(130, 124, 124, 0.8);
    font-size: 10em;
  }
}

@keyframes dance {
  0%,
  100% {
    transform: rotate(0);
  }
  25% {
    transform: rotate(-30deg);
  }
  75% {
    transform: rotate(30deg);
  }
}

.card-back {
  background-color: #b1bcdb;

  border: 3px solid #3bc0c0;
}

.card-front {
  background-color: #b1bcdb;

  border: 3px solid #3bc0c0;
  transform: rotateY(180deg);
}

.card-value {
  transition: transform 100ms ease-in-out;
  transform: scale(0.9);
}

.card-front:hover .card-value {
  transform: scale(1);
}

@media (max-width: 600px) {
  .game-container {
    grid-template-columns: repeat(2, auto);
  }

  .game-info-container {
    flex-direction: column;
    align-items: center;
  }
  .overlay-text.visible {
    display: flex;
   
  }
}
