body {
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: vh;
  margin: 0;
  background-color: #f0f0f0;
  /* background: url('plants-bg.jpg') no-repeat center center fixed; */
  background-size: cover;
  padding: 20px;
  box-sizing: border-box;
}



.memory-game {
  width: 100%;
  max-width: 640px;
  aspect-ratio: 1;
  display: flex;
  flex-wrap: wrap;
  perspective: 1000px;
}

.memory-card {
  width: 19%;
  height: 19%;
  margin: 2%;
  position: relative;
  transform: scale(1);
  transform-style: preserve-3d;
  transition: transform 0.5s;
  cursor: pointer;
}

.memory-card:active {
  transform: scale(0.97);
  transition: transform 0.2s;
}

.memory-card.flip {
  transform: rotateY(180deg);
}

.memory-card .front,
.memory-card .back {
  width: 100%;
  height: 100%;
  position: absolute;
  backface-visibility: hidden;
  border-radius: 5px;
}

.congratulations {
  font-size: 2rem;
  font-weight: bold; /* Make text bold */
  color: #0077ff;
  background-color: white; /* Box background color */
  padding: 20px; /* Space inside the box */
  border: 5px solid #575200; /* Box border */
  border-radius: 10px; /* Rounded corners */
  display: none; /* Hidden by default */
  margin-top: 20px;
  text-align: center; /* Center text */
}



.memory-card .front {
  background: #575200;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 1rem;
  transform: rotateY(180deg);
  padding: 5px;
  text-align: center;
}

.memory-card .back {
  background:  #575200;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 1rem;
  padding: 5px;
  text-align: center;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: -2%;
  width: 100%;
  height: 102%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4);
  animation: fadeIn 0.3s;
  overflow: hidden;
}

@keyframes fadeIn {
  from {opacity: 0;}
  to {opacity: 1;}
}
.modal-content {
  background-color: #fefefe;
  margin: 15% auto;
  padding: 20px;
  border: none;
  width: 600px;
  text-align: center;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  overflow: hidden;
}
.modal-content p {
  font-size: 24px;
  color: #000000;
  margin-bottom: 20px;
}
.modal-content .popButton {
  padding: 10px 20px;
  font-size: 24px;
  background-color: #8460de;
  color: #000000;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.modal-content .popButton:hover {
  background-color: #000000;
}
/* Position the button at the top-left corner */
/* .howToPlayBtn {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
} */

/* Style the button to match the game theme */
/* .howToPlayBtn {
  font-family: "Poppins", sans-serif; 
  font-size: 26px;
   background-color: #793DAE;  
  color: #8460de;
  border: none;
  font-weight: bolder;
  
  border-radius: 5px;
  padding: 10px 20px;
  cursor: pointer;
  box-shadow: 5px 10px 10px rgba(0, 0, 0, 0.2); 
  transition: background-color 0.3s ease; 
} */
.howToPlayBtn {
  position: absolute;
  top: 25px;
  left: 10px;
  z-index: 1;
}

/* Style the button to match the game theme */
.howToPlayBtn {
  font-family: "Poppins", sans-serif; /* Use the same font as the game */
  font-size: 16px; /* Adjust the font size as needed */
  background-color: transparent;  
  /* color: #8460de;  */
  border: none;
  font-weight: bolder;
  background-color: none;
  border-radius: 5px;
  padding: 10px 20px;
  cursor: pointer;
  /* box-shadow: 5px 10px 10px rgba(0, 0, 0, 0.2);  */
  /* transition: background-color 0.3s ease; */
}

/* Add a hover effect */
/* .howToPlayBtn:hover {
  background-color: #c2b7b7; 
} */

.close {
  font-family: "Poppins", sans-serif;
  color: #8460de;
  float: right;
  font-size: 24px;
  font-weight: bold;
}

.close:hover,
.close:focus {
  font-family: "Poppins", sans-serif;
  color: black;
  text-decoration: none;
  cursor: pointer;
}


.modal-header {
  text-align: center;
  margin-bottom: 10px;
}

.modal-header img {
  max-width: 50%; /* Set the maximum width to 50% of the parent container */
  height: auto; /* Maintain aspect ratio */
  display: block; /* Make the image a block-level element */
  margin: 0 auto; /* Center the image horizontally */
}
.modal-content iframe {
  margin-top: 20px; /* Added margin-top for the iframe */
}

.homeBtn {
  position: absolute;
  top: 145px; /* Adjust the top position as needed */
  left: 10px;
  z-index: 1;

}

/* Style the home button */
.homeBtn button {
  font-family: "Poppins", sans-serif;
  background-color: transparent;  
  font-size: 16px; 
  border: none;
  font-weight: bolder;
  border-radius: 5px;
  padding: 15px 20px;
  cursor: pointer;
  /* box-shadow: 5px 10px 10px rgba(0, 0, 0, 0.2); */
  transition: background-color 0.3s ease;
}

.rules{
  text-align: left;
  font-weight: bold;
}

/* Add a hover effect */
/* .homeBtn button:hover {
  background-color: #c2b7b7;
} */












/* For tablets */
@media (max-width: 768px) {
.memory-card {
    width: 18%;
    height: 18%;
    margin: 1%;
}

.memory-card .back {
  background: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 1rem;
  padding: 5px;
  text-align: center;
}

.memory-card .front {
background: transparent;
display: flex;
justify-content: center;
align-items: center;
color: white;
font-size: 1rem;
padding: 5px;
text-align: center;
}
.congratulations {
    font-size: 1.5rem;
    padding: 15px;
}

.modal-content {
    width: 80%;
}

.modal-content p {
    font-size: 1.2rem;
}

.modal-content .popButton {
    font-size: 0.9rem;
    padding: 8px 16px;
}
}

/* For mobile devices */
@media (max-width: 480px) {
.memory-card {
    width: 19%;
    height: 19%;
    margin: 2%;
}


.memory-card .back {
  background: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 1rem;
  padding: 5px;
  text-align: center;
  height: 65px;
  width: 65px;
}

.memory-card .front {
background: #575200;
display: flex;
justify-content: center;
align-items: center;
color: white;
font-size: 0.6rem;
padding: 5px;
text-align: center;
height: 65px;
width: 65px;
}

.howToPlayBtn img{
width: 50%;
height: 40%;
margin-top: 10px;

}

img{
  height: 70px;
  width: 70px;
}

.congratulations {
    font-size: 1.2rem;
    padding: 10px;
}

.modal-content {
    width: 90%;
}

h1{
font-size: 20px;
}

.modal-content p {
    font-size: 1rem;
}

.modal-content .popButton {
    font-size: 0.4rem;
    /* padding: 6px 12px; */
}
}
