/* Basic styling */
body {
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  background-color: black; /* Set background to black */

  /* Background image settings */
  background-image: url("https://raw.githubusercontent.com/Noobiecoderlol/Snake-gamez/main/Background.jpg"); /* Correct raw URL */
  background-size: cover; /* Cover the entire viewport */
  background-position: center center; /* Center the image */
  background-attachment: fixed; /* Keeps the image fixed while scrolling */
  color: white; /* Adjust text color for better visibility */
  background-repeat: no-repeat; /* Prevent background repetition */
  overflow: hidden; /* Prevent scrolling */
}

/* Media query to handle mobile screens */
@media (max-width: 768px) {
  body {
    background-attachment: scroll; /* Disable fixed background for mobile devices to improve performance */
  }

  #game-container {
    display: flex; /* Center game container */
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically */
    width: 100%; /* Full viewport width */
    height: 100vh; /* Full viewport height */
    padding: 0; /* Remove any extra padding */
  }

  canvas {
    width: 90vw; /* Adjust canvas width */
    height: 90vw; /* Maintain square aspect ratio */
    max-width: 100%; /* Ensure it doesn't overflow */
    max-height: 100%; /* Keep within viewport */
  }
}

/* Rest of your existing styles */

#title-container {
  text-align: center;
  margin-bottom: 20px; /* Space between title and links */
}

#title-container h1 {
  font-size: 36px;
  margin: 0;

  /* Rainbow gradient text effect */
  background-image: linear-gradient(
    to right,
    red,
    orange,
    yellow,
    green,
    blue,
    indigo,
    violet
  );
  -webkit-background-clip: text; /* For Chrome, Safari, and newer versions of Edge */
  color: transparent; /* Make the text transparent so the background gradient shows */
}

#links-container {
  position: relative;
  margin-top: 10px; /* Space between title and links */
  font-size: 14px;
  color: #333;
  text-align: center; /* Center-align the links */
  background-color: #333; /* Darker background for links section */
  padding: 10px; /* Padding around the links */
  border-radius: 5px; /* Rounded corners for the links container */
  z-index: 1001; /* Ensure links stay above score */
}

#links-container a {
  color: #ffffff; /* White color for the links */
  text-decoration: none;
  margin-bottom: 10px;
  font-weight: bold;
  display: block; /* Make links block-level for vertical stacking */
}

#links-container a:hover {
  color: #ff6600; /* Orange hover effect for better visibility */
}

.text-link {
  font-size: 18px; /* Adjust text size */
  margin-bottom: 10px;
}

/* Score section */
#score-container {
  position: relative;
  margin-top: 20px;
  text-align: center;
  z-index: 1000;
  background-color: rgba(0, 0, 0, 0.8);
  padding: 10px 20px;
  border-radius: 5px;
  color: white;
}

.score-pop {
  animation: scorePop 0.3s ease;
}

@keyframes scorePop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
    background-color: #ff6600;
  }
  100% {
    transform: scale(1);
    background-color: rgba(0, 0, 0, 0.8);
  }
}

/* Game container for dynamic resizing */
#game-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100vh;
  padding: 0;
  box-sizing: border-box;
}

/* Canvas styling */
canvas {
  display: block;
  margin: 0 auto;
  border: 2px solid black;
  background-color: white;
}

/* Game over message container */
#game-over-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  background-color: rgba(0, 0, 0, 0.712);
  padding: 30px;
  border-radius: 10px;
  z-index: 1000;
  width: 300px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

#game-over-message {
  font-size: 28px;
  margin-bottom: 15px;
  color: white;
  font-weight: bold;
}

#you-win-message {
  font-size: 20px;
  margin-bottom: 25px;
  color: #ff6600;
}

#reset-button {
  padding: 12px 25px;
  font-size: 16px;
  background-color: #ff6600;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: bold;
}

#reset-button:hover {
  background-color: #ff8533;
  transform: scale(1.05);
}

/* Media query for mobile devices */
@media (max-width: 768px) {
  #game-container {
    padding: 10px;
  }
  
  canvas {
    width: 90vw;
    height: 90vw;
    max-width: 500px;
    max-height: 500px;
  }
}
