* {
  box-sizing: border-box;
}

/* Sets a minimum height for the HTML document */
html {
  min-height: 100vh;
}

/* Removes margin and sets a background color for the body */
body {
  margin: 0;
  background: #ff60ad;
}

/* Styles the logos */
.logo {
  position: absolute;
  width: 100px; /* Adjust size as needed */
  height: auto;
}

/* Positions the left logo */
.logo-left {
  top: 10px;
  left: 10px;
}

/* Positions the right logo */
.logo-right {
  top: 10px;
  right: 10px;
}

/* Styles the page title */
.page-title {
  color: #162a72;
  font-family: "fruits memory game", cursive;
  font-weight: normal;
  text-align: center;
  font-size: 40px; /* fixed syntax */
  margin: 0; /* Remove default margin */
  position: relative; /* Allows for precise positioning */
  top: -10px; /* Adjust this value to move the title upwards */
}

/* Styles the game info container to use flexbox and spread its items */
.game-info-container {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
}

/* Styles the game information text */
.game-info {
  font-family: "fruits memory game", cursive;
  color: #162a72;
  font-size: 2em;
}

/* Sets up a grid layout for the game container */
.game-container {
  display: grid;
  grid-template-columns: repeat(4, auto);
  grid-gap: 10px;
  margin: 50px;
  justify-content: center;
  perspective: 500px;
}

/* Styles individual cards */
.card {
  position: relative;
  height: 175px;
  width: 125px;
}

/* Styles the front and back faces of the cards */
.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 12px;
  border-width: 1px;
  border-style: solid;
  transition: transform 500ms ease-in-out;
}

/* Shows the front face of the card when visible */
.card.visible .card-back {
  transform: rotateY(-180deg);
}

/* Rotates the front face to 0 when the card is visible */
.card.visible .card-front {
  transform: rotateY(0);
}

/* Adds animation to matched cards */
.card.matched .card-value {
  animation: dance 1s linear infinite 500ms;
}

/* Styles images inside cards */
img {
  height: 150px !important;
  width: 110px !important;
}

/* Styles the overlay text */
.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: #162a72;
  font-family: "fruits memory game", cursive;
}

/* Styles smaller overlay text */
.overlay-text-small {
  font-size: 0.8em;
}

/* Makes the overlay text visible and animates it */
.overlay-text.visible {
  display: flex;
  flex-direction: column;
  animation: overlay-grow 500ms forwards;
}

/* Keyframes for the overlay grow animation */
@keyframes overlay-grow {
  from {
    background-color: rgba(0, 0, 0, 0);
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    background-color: rgba(0, 0, 0, 0.8);
    opacity: 1;
    transform: scale(1);
  }
}

/* Keyframes for the dance animation */
@keyframes dance {
  0%,
  100% {
    transform: rotate(0);
  }
  25% {
    transform: rotate(-30deg);
  }
  75% {
    transform: rotate(30deg);
  }
}

/* Styles the back face of the card */
.card-back {
  background-color: #b1bcdb;
  border: 3px solid #162a72;
  background-image: url('images/logo.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Styles the front face of the card */
.card-front {
  background-color: #b1bcdb;
  border: 3px solid #162a72;
  transform: rotateY(180deg);
}

/* Adds transition to the card value */
.card-value {
  transition: transform 100ms ease-in-out;
  transform: scale(0.9);
}

/* Scales up the card value on hover */
.card-front:hover .card-value {
  transform: scale(1);
}

/* Media query for smaller screens */
@media (max-width: 600px) {
  .game-container {
    grid-template-columns: repeat(2, auto);
  }

  .game-info-container {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  /* Make cards more responsive */
  .card {
    width: 90vw;
    max-width: 200px;
    height: auto;
  }

  img {
    width: 80vw;
    max-width: 180px;
    height: auto;
  }

  .game-info {
    font-size: 1.5em;
  }

  .page-title {
    font-size: 18px;
  }
}

/* Adjust logos on very small screens */
@media (max-width: 400px) {
  .logo {
    width: 60px;
  }
  .logo-left {
    top: 5px;
    left: 5px;
  }
  .logo-right {
    top: 5px;
    right: 5px;
  }
}
/* Adjust the page title for very small screens */  