@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700&display=swap');
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Open Sans', sans-serif;
}
/* Body Style */
body {
  display: flex;
  flex-direction: column; /* Align children vertically */
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #d0e9fa;   /* Light mode background */
}

body.dark {
  background: #686e6e; /* Dark mode background */
}
/* Centered Title */
h1 {
  text-align: center;
  font-size: 2rem;
  color: #293447;
  margin-bottom: 20px;
}

/* Centered Footer */
footer {
  text-align: center;
  font-size: 0.9rem;
  color: #293447;
  margin-top: 20px;
}

/* Main div */
.wrapper {
  width: 75vmin;
  height: 75vmin;
  display: flex;
  overflow: hidden;
  flex-direction: column;
  justify-content: center;
  border-radius: 5px;
  background: #794089;
  box-shadow: 0 20px 40px rgba(52, 87, 220, 0.2);
}
/* Score */
.game-details {
  color: #fcfdfe;
  font-weight: 500;
  font-size: 1.2rem;
  padding: 20px 27px;
  display: flex;
  justify-content: space-between;
}
/* Board */
.play-board {
  height: 100%;
  width: 100%;
  display: grid;
  background: #2e4a4a;
  grid-template: repeat(30, 1fr) / repeat(30, 1fr);
}
/* Food */
.play-board .food {
  background: #5781f7;
}
/* Snake */
.play-board .head {
  background: #3ff311;
}

.controls {
  display: none;
  justify-content: space-between;
}
.controls i {
  padding: 25px 0;
  text-align: center;
  font-size: 1.3rem;
  color: #B8C6DC;
  width: calc(100% / 4);
  cursor: pointer;
  border-right: 1px solid #171B26;
}

@media screen and (max-width: 800px) {
  .wrapper {
    width: 90vmin;
    height: 115vmin;
  }
  .game-details {
    font-size: 1rem;
    padding: 15px 27px;
  }
  .controls {
    display: flex;
  }
  .controls i {
    padding: 15px 0;
    font-size: 1rem;
  }
}

/* Game Over Modal */
.game-over-modal {
  display: none; /* Hidden by default */
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4); /* Black with opacity */
}

.modal-content {
  background-color: #fefefe;
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 400px;
  text-align: center;
}

/* Btn's */
#playAgainBtn, #exitBtn {
  background-color: #79c8f9;
  color: white;
  padding: 10px 20px;
  margin: 10px;
  border: none;
  cursor: pointer;
  border-radius: 5px;
  font-size: 1rem;
}

#playAgainBtn:hover, #exitBtn:hover {
  background-color: #f887b6;
}


/* Dark mode styling */
body {
  position: relative; /* Ensures that the positioning context is set for the page */
  min-height: 100vh; /* Make sure body takes up at least the height of the viewport */
  margin: 0; /* Remove default margin */
}

.toggle-button {
  position: fixed; /* Use fixed to keep it in view even on scroll */
  top: 10px;  /* Adjust this value to change the vertical position */
  right: 10px; /* Adjust this value to change the horizontal position */
  width: 50px;  /* Set the width of the button */
  height: 50px; /* Set the height of the button */
  background-color: #fff; /* Light mode background color */
  border-radius: 50%; /* Makes it circular */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2); /* Optional: Adds shadow for better visibility */
  transition: background-color 0.3s;
}

.toggle-button i {
  position: absolute;
  transition: opacity 0.3s;
}

.toggle-button .fa-moon {
  opacity: 1; /* Moon visible by default */
}

.toggle-button .fa-sun {
  opacity: 0; /* Sun hidden by default */
}

body.dark .toggle-button {
  background-color: #9dd9fb; /* Dark mode background color */
}

body.dark .toggle-button .fa-moon {
  opacity: 0; /* Hide moon in dark mode */
}

body.dark .toggle-button .fa-sun {
  opacity: 1; /* Show sun in dark mode */
}
/* Light mode styles (default) */
h1 {
  color: #293447; /* Dark color for light mode */
}

footer {
  color: #293447; /* Dark color for light mode */
  background-color: #d0e9fa; /* Light background color for footer in light mode */
}

/* Dark mode styles */
body.dark h1 {
  color: #eef7fd; /* Light color for dark mode */
}

body.dark footer {
  color: #10f3ba; /* Light color for dark mode */
  background-color: #5d5a5a; 
}
