* {
  font-family: "Montserrat", sans-serif;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  overflow: hidden; /* Prevent scrollbars */
}

canvas.webgl {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1; /* Ensure canvas is below UI elements */
}

.progress-bar-container {
  position: fixed;
  inset: 0;
  z-index: 10000; /* Higher than menu to ensure it’s on top during loading */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1em;
  text-align: center;
  background: rgba(0, 0, 0, 0.85); /* Slightly darker for contrast */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: opacity 0.5s ease; /* Smooth fade-out */
  pointer-events: none; /* Prevent interaction after loading */
  opacity: 1;
}

/* Ensure loading screen hides properly */
.progress-bar-container[style*="display: none"] {
  opacity: 0;
  pointer-events: none;
}

.progress-bar-container label {
  font-size: 1.2rem;
  letter-spacing: 0.5px;
  color: #00e5ff; /* Bright cyan for futuristic look */
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}

#progress-bar {
  width: 60%;
  height: 12px;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
  background-color: rgba(255, 255, 255, 0.1);
}

#progress-bar::-webkit-progress-bar {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

#progress-bar::-webkit-progress-value {
  background: linear-gradient(90deg, #00e5ff, #0088ff);
  border-radius: 10px;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.6);
  transition: width 0.2s ease-in-out;
}

#progress-bar::-moz-progress-bar {
  background: linear-gradient(90deg, #00e5ff, #0088ff);
  border-radius: 10px;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.6);
  transition: width 0.2s ease-in-out;
}

.menu-container {
  position: fixed;
  z-index: 10000; /* Above all game elements */
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: url("./assets/images/copy.jpeg") no-repeat center center/cover; /* Replace with your image file name */
  color: #ffffff; /* Ensure text is visible against the image */
  font-family: "Exo 2", sans-serif; /* Recommended font */
  text-align: center;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.5s ease; /* Smooth fade-out */
  pointer-events: auto; /* Ensure clicks are registered */
  animation: menuFadeIn 0.6s ease forwards; /* Smooth entrance */
}

.menu-container {
  position: fixed;
  z-index: 10000; /* Above all game elements */
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: flex-end; /* Align content to the right */
  justify-content: flex-start; /* Align content to the top */
  background: url("./assets/images/copy.jpeg") no-repeat center center/cover; /* Background image */
  color: #ffffff; /* Ensure text is visible */
  font-family: "Exo 2", sans-serif; /* Recommended futuristic font */
  text-align: right; /* Right-align text */
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.5s ease; /* Smooth fade-out */
  pointer-events: auto; /* Ensure clicks are registered */
  animation: menuFadeIn 0.6s ease forwards; /* Smooth entrance */
}

/* Ensure menu hides properly */
.menu-container[style*="display: none"] {
  opacity: 0;
  pointer-events: none; /* Prevent interaction when hidden */
}

/* Container for top-right content (title and instructions) */
.menu-container .top-right-content {
  position: absolute;
  top: 20px; /* Distance from top */
  right: 20px; /* Distance from right */
  max-width: 40%; /* Limit width to avoid overflow */
  padding: 10px;
  border-radius: 10px;
  z-index: 2;
}

/* Menu title */
.menu-container h1 {
  font-size: 3.5rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.9), 0 0 24px rgba(0, 229, 255, 0.6); /* Neon glow */
  margin-bottom: 0.5rem;
}

/* Instructions */
.menu-container h3 {
  font-size: 1.2rem;
  font-weight: 400;
  color: #ffffff;
  margin: 0.5rem 0;
  line-height: 1.5;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); /* Improve readability */
}

/* Start button (positioned lower) */
.menu-container h2 {
  position: absolute;
  bottom: 50px; /* Distance from bottom */
  right: 50%; /* Center horizontally */
  transform: translateX(50%); /* Adjust for center alignment */
  font-size: 2rem;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(45deg, #00b7eb, #00e5ff); /* Futuristic button */
  padding: 1rem 2rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 183, 235, 0.6);
  pointer-events: auto;
  user-select: none;
  z-index: 2;
}

/* Hover effect for start button */
.menu-container h2:hover {
  transform: translateX(50%) translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 183, 235, 0.8);
  background: linear-gradient(45deg, #00e5ff, #00b7eb);
}

/* Animation for menu appearance */
@keyframes menuFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#score-container {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9000; /* Above canvas, below menu/loading */
  color: #ffffff;
  font-size: 2rem;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}

.score {
  margin: 0.5rem 0;
}

#level-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9000;
  color: #ffffff;
  font-size: 2rem;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}

#level-container div {
  margin: 0.5rem 0;
}

/* Animations */
@keyframes pulseGlow {
  0%,
  100% {
    text-shadow: 0 0 12px rgba(0, 229, 255, 0.9),
      0 0 24px rgba(0, 229, 255, 0.6);
  }
  50% {
    text-shadow: 0 0 18px rgba(0, 229, 255, 1), 0 0 36px rgba(0, 229, 255, 0.8);
  }
}

@keyframes floatParticles {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 80px 80px;
  }
}
