body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  height: 100vh;
  font-family: 'Orbitron', sans-serif;
  color: white;
}

#game-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

canvas {
  background: radial-gradient(circle, #1a1a2a 0%, #0c0c14 70%, #000000 100%);
  display: block;
  cursor: crosshair;
  width: 100vw;
  height: 100vh;
}

#ui-container {
  position: absolute;
  top: 20px;
  left: 20px;
  background-color: rgba(0, 0, 0, 0.5);
  padding: 15px;
  border-radius: 10px;
  border: 1px solid #00ffff;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

#ui-container h2 {
  margin-top: 0;
  margin-bottom: 5px;
}

#powerup-status {
  margin-top: 15px;
  min-height: 50px;
}

.powerup-text {
  font-size: 1em;
  margin-bottom: 5px;
}

#final-score-text {
  margin: 0;
}

#final-score {
  margin: 0;
  font-weight: bold;
  font-size: 2.5em;
}

#game-over-modal,
#start-modal,
#pause-overlay {
  position: absolute;
  background-color: rgba(0, 0, 0, 0.8);
  padding: 40px;
  border-radius: 15px;
  text-align: center;
  border: 2px solid #ff4500;
  box-shadow: 0 0 20px rgba(255, 69, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  z-index: 10;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

#wave-banner {
  /* No longer needs absolute positioning or left/top properties */
  /* The animation transform is now simpler */
  transform: translateY(-200%) scale(0.5); /* Start further up and smaller */
  background-color: rgba(71, 92, 114, 0.3);
  color: rgb(224, 224, 224);
  border: 2px solid rgb(224, 224, 224);
  box-shadow: 0 0 1vh rgba(224, 224, 224, 0.7);
  padding: 15px 30px;
  border-radius: 15px;
  font-size: clamp(0.7em, 4vw, 1em);
  z-index: 20;
  transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
  font-weight: bold;
  text-align: center;
  opacity: 0;
}

#wave-banner.show {
  /* The final state is a simple identity transform */
  transform: translateY(0) scale(1);
  opacity: 1;
}

#start-modal p {
  max-width: 500px;
  line-height: 1.6;
}

.start-options {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5rem; /* Adds space between checkbox and button */
  color: #eee;
  font-size: 1.1em;
}

.start-options label {
  margin-left: 0.5rem;
  cursor: pointer; /* Makes it clear the label is clickable */
}

.start-options input[type="checkbox"] {
  cursor: pointer;
  /* Optional: Style the checkbox to be larger */
  width: 18px;
  height: 18px;
}

#game-over-modal h2,
#start-modal h2,
#pause-overlay h2 {
  margin: 0;
  font-size: 2.5em;
  color: #ff4500;
}

.legal-text {
  font-size: 0.8em; /* Makes the legal text smaller */
  color: #bbb;       /* A lighter grey for less emphasis */
  margin-top: 2rem;
}

/* Style for links within the legal text */
.legal-text a,
.legal-text a:visited {
  color: #00d1ff; /* The same cyan color as the buttons */
  text-decoration: none;
}

.legal-text a:hover {
  text-decoration: underline;
}

.button {
  background-color: #00d1ff;
  color: #111;
  border: none;
  padding: 0.8rem 1.5rem;
  font-size: 1.2em;
  font-weight: bold;
  cursor: pointer;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 1rem;
  transition: all 0.2s ease-in-out; /* Add transition for smooth hover effects */
}

/* --- Primary Button Hover Effect --- */
.button:not(.secondary):hover {
  transform: translateY(-3px); /* Lifts the button slightly */
  box-shadow: 0 8px 20px rgba(0, 209, 255, 0.4); /* Adds a cyan glow */
}

/* --- Secondary Button Styling --- */
.button.secondary {
  background-color: transparent;
  border: 2px solid #00d1ff;
  color: #00d1ff;
  /* Make it smaller */
  padding: 0.4rem 0.8rem;
  font-size: 0.8em;
  margin-top: 0.8rem;
}

/* --- Secondary Button Hover Effect --- */
.button.secondary:hover {
  background-color: rgba(0, 209, 255, 0.2); /* Fills with a subtle cyan */
  color: #fff; /* Makes text brighter */
}

/* --- NEW CONTAINER STYLES --- */
#top-ui-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding-top: clamp(5px, 1vh, 30px); /* Use padding to push content from the top */

  /* Use Flexbox to stack and center the children */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5vh; /* Creates responsive space between the bar and the banner */

  /* Make the container non-interactive */
  pointer-events: none;
}

/* --- MODIFIED TOP-BAR STYLES --- */
#top-bar {
  /* No longer needs absolute positioning or transforms */
  display: flex;
  justify-content: center;
  gap: 3vw;
  color: rgb(224, 224, 224);
  font-size: clamp(12px, 1.8vh, 32px);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  text-align: center;
}

#bottom-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: clamp(5px, 1vh, 20px) clamp(10px, 2vw, 40px);
  box-sizing: border-box;

  display: flex;
  justify-content: space-between; /* This still pushes the outer two items to the edges */
  align-items: center;

  color: rgba(224, 224, 224, 0.5);
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(10px, 1.5vh, 16px);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

/* --- NEW RULE FOR THE CENTERED TEXT --- */
#pause-text {
  /* Take the element out of the normal flex flow */
  position: absolute;
  /* Position its left edge at the 50% mark of the parent */
  left: 50%;
  /* Use transform to pull it back by half of its own width, centering it perfectly */
  transform: translateX(-50%);
  font-style: italic;
  opacity: 0.8;
  display: none; /* Hide by default, will be shown on non-touch devices */
}

/* --- MODIFIED VERSION DISPLAY --- */
#version-display {
  /* Remove absolute positioning as it's now a flex item */
  position: static;
  /* Inherit color and font from the parent #bottom-bar */
  color: inherit;
  font-size: inherit;
}
