/* Ensures all elements use border-box sizing */
* {
    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: #f0f067;
  }

  /* 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;
    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);
      font-size: 0;
    }
    to {
      background-color: rgba(0, 0, 0, 0.8);
      font-size: 6em;
    }
  }
  
  /* 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;
  }
  
  /* 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;
    }
  }
  .card-back {
    background-image: url('images/logo.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
  }
  @media (max-width: 768px) {
  .logo {
    width: 60px;
  }

  .page-title {
    font-size: 28px;
    top: -5px;
  }

  .game-info-container {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 10px;
  }

  .game-info {
    font-size: 1.5em;
    text-align: center;
  }

  .game-container {
    grid-template-columns: repeat(2, auto);
    margin: 20px;
    grid-gap: 8px;
  }

  .card {
    height: 140px;
    width: 100px;
  }

  img {
    height: 120px !important;
    width: 90px !important;
  }

  .overlay-text {
    font-size: 2.5em !important;
    padding: 10px;
    text-align: center;
  }

  .overlay-text-small {
    font-size: 0.7em;
  }
}
