/* General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  body {
    font-family: 'Bubblegum Sans', cursive;
    background-color: #f7f3e9;
    color: #444;
    min-height: 100vh;
    display: block;  /* Changed from flex to block */
    padding: 20px 0;
    overflow-y: auto; /* Changed from hidden to auto to allow vertical scrolling */
}
  
.game-container {
    max-width: 90vw;
    max-height: 95vh;
    width: 95%;
    padding: 15px;
    background-color: #ffffff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    position: relative; /* Added position relative */
    height: 95vh;
}
  
  header {
    margin-bottom: 10px;
  }
  
  h1 {
    color: #ff6b6b;
    font-size: 2rem;
    margin-bottom: 2px;
    letter-spacing: 2px;
  }
  
  .tagline {
    color: #777;
    font-size: 0.9rem;
    margin-bottom: 5px;
  }
  
  /* Game Controls */
  .game-controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 1rem;
    border: 2px solid #ddd;  /* Add border around entire controls */
    border-radius: 10px;        /* Rounded corners */
    padding: 10px;              /* Add some padding */
    background-color: rgba(255, 107, 107, 0.05); /* Light pink background */

    /* Style the individual containers */
    .score-container,
    .timer-container,
    .grid-size-container {
        padding: 5px 10px;
        border-radius: 5px;
        background-color: rgba(255, 255, 255, 0.7);
    }
    .site-footer p:last-child {
      margin-top: 15px;
      font-size: 0.9rem;
      color: #666;
    }
    .site-footer a[rel="dofollow"] {
      color: #ff6b6b;
      text-decoration: none;
      font-weight: bold;
    }
    .site-footer a[rel="dofollow"]:hover {
      text-decoration: underline;
    }
  }
  


  .timer-options {
    margin-bottom: 10px;
  }
  
  select {
    font-family: 'Bubblegum Sans', cursive;
    padding: 3px 8px;
    border-radius: 5px;
    border: 2px solid #ddd;
    font-size: 0.8rem;
    cursor: pointer;
  }
  
/* Game Board */
.game-board {
  flex: 1;
  display: grid;
  grid-gap: 8px;
  padding: 10px;
  margin: 0 auto 10px;
  max-width: 100%;
  perspective: 1000px;
  flex-grow: 1;
  overflow: auto; /* Add scroll if needed */
}
  
/* Fix card shape */
.card {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s;
  cursor: pointer;
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  margin: 0;
  min-width: 80px;
  min-height: 120px;
  /* Remove the too restrictive max-width */
}

/* Grid Layouts with sizing adjustments */
.grid-3x2 {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
}

.grid-3x2 .card {
  /* Remove overly restrictive max-width/max-height */
}

.grid-3x4 {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(4, 1fr);
}

.grid-3x4 .card {
  /* Remove overly restrictive max-width/max-height */
}

.grid-4x4 {
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
}

.grid-4x4 .card {
  /* Remove overly restrictive max-width/max-height */
}
  
  .card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .card-front {
    background-color: #fff;
    transform: rotateY(180deg);
  }

  .card-back {
    background-color: #80cbc4;
    background-image: repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.1),
      rgba(255, 255, 255, 0.1) 10px,
      transparent 10px,
      transparent 20px
    );
    transform: rotateY(0deg);
  }

  .card.flipped {
    transform: rotateY(180deg);
  }
  
  .fruit-image {
    max-width: 90% !important; /* Increase from 80% to 90% for mobile */
    max-height: 90% !important;
    object-fit: contain;
  }
  
  /* Buttons */
  .restart-btn {
    background-color: #ff6b6b;
    color: white;
    border: none;
    padding: 8px 20px;
    font-size: 1rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: 'Bubblegum Sans', cursive;
    transition: background-color 0.3s;
    width: 33%; /* About 2 cards out of 3 columns (2/3 would be 66%) */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 5px;
    max-width: 180px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .restart-btn:hover {
    background-color: #ff5252;
  }
  
  /* Game Over Modal */
  .game-over {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 100;
    justify-content: center;
    align-items: center;
  }
  
  .game-over.active {
    display: flex;
  }
  
  .game-over-content {
    background-color: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    max-width: 350px;
    width: 85%;
  }
  
  .game-over h2 {
    color: #ff6b6b;
    margin-bottom: 15px;
  }
  
  .game-over p {
    margin-bottom: 20px;
    font-size: 1.1rem;
  }
  
  #play-again-btn {
    background-color: #ff6b6b;
    color: white;
    border: none;
    padding: 8px 20px;
    font-size: 1rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: 'Bubblegum Sans', cursive;
  }
  
  /* Confetti Container */
  .confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
  }
  
  .confetti {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: #ff6b6b;
    opacity: 0.8;
  }
  

/* Game Mechanics Styles */
.game-mechanics {
    max-width: 90vw;
    width: 95%;
    margin: 40px auto;  /* Increased top margin */
    padding: 20px;
    background-color: #ffffff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 60px;  /* Added bottom margin */
}

/* benefits section Styles */
.benefits-section {
  max-width: 90vw;
  width: 95%;
  margin: 40px auto;  /* Increased top margin */
  padding: 20px;
  background-color: #ffffff;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  margin-bottom: 60px;  /* Added bottom margin */
}

/* benefits section Styles */
.usage-section {
  max-width: 90vw;
  width: 95%;
  margin: 40px auto;  /* Increased top margin */
  padding: 20px;
  background-color: #ffffff;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  margin-bottom: 60px;  /* Added bottom margin */
}

.recommendations-section {
  max-width: 90vw;
  width: 95%;
  margin: 40px auto;  /* Increased top margin */
  padding: 20px;
  background-color: #ffffff;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  margin-bottom: 60px;  /* Added bottom margin */
}

.mechanics-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 10px;
}

.mechanic-item {
    padding: 15px;
    background-color: #f8f8f8;
    border-radius: 10px;
    border-left: 4px solid #ff6b6b;
}

.mechanic-item h3 {
    color: #444;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.mechanic-item ul {
    list-style-position: inside;
    padding-left: 10px;
}

.mechanic-item li {
    margin-bottom: 8px;
    color: #666;
    line-height: 1.4;
}

.mechanic-item p {
    color: #666;
    line-height: 1.4;
}


  /* Responsive Styles */
  @media (max-width: 768px) {
    .game-container {
      height: auto;
      min-height: 80vh;
      max-height: 95vh;
      display: flex;
      flex-direction: column;
      padding: 10px;
      overflow: auto;
    }
    
    h1 {
      font-size: 1.5rem;
    }
    
    .game-board {
      grid-gap: 5px;
      padding: 5px;
      max-height: 50vh;
      overflow: visible;
    }
    
    .card {
      aspect-ratio: 2/3;
    }

    .grid-3x2 .card {
      max-width: calc((100% - 10px) / 3);
      max-height: calc((100% - 5px) / 2);
    }
    
    .grid-3x4 .card {
      max-width: calc((100% - 10px) / 3);
      max-height: calc((100% - 15px) / 4);
    }
    
    .grid-4x4 .card {
      max-width: calc((100% - 15px) / 4);
      max-height: calc((100% - 15px) / 4);
      min-width: 70px;
      min-height: 105px;
    }

    .game-controls {
      flex-direction: row;
      flex-wrap: wrap;
      justify-content: center;
      gap: 10px;
      display: flex;
      justify-content: space-between;
      width: 100%;
      margin-bottom: 10px;
      padding: 8px;
    }
    
    .score-container, .timer-container, .grid-size-container {
      margin: 0 5px;
      font-size: 0.9rem;
      flex: 1;
      min-width: 100px;
      text-align: center;
    }
    
    .fruit-image {
      max-width: 95% !important;  /* Increase from 80% to 95% */
      max-height: 95% !important; /* Increase from 80% to 95% */
      object-fit: contain;  
    }

    .fruit-icon {
      font-size: 2rem;
    }

    .game-mechanics {
        margin: 15px auto;
        padding: 15px;
    }

    .mechanics-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .mechanic-item {
        padding: 12px;
    }

    .game-mechanics h2 {
        font-size: 1.5rem;
    }


  }
  
  
  
  /* Animations */
  @keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
  }
  
  .shake {
    animation: shake 0.5s;
  }
  
  @keyframes confetti-fall {
    0% {
      transform: translateY(-50px) rotate(0deg);
      opacity: 1;
    }
    100% {
      transform: translateY(100vh) rotate(360deg);
      opacity: 0;
    }
  }