body,
html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #000;
  font-family: 'Courier New', Courier, monospace;
  user-select: none;
}

#game-container {
  width: 100%;
  height: 100%;
  display: block;
}

/* Overlay UI */
#ui-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* The Banjo Weapon */
#weapon-container {
  position: absolute;
  bottom: -20px;
  right: 20%;
  font-size: 250px;
  transform-origin: bottom center;
  transition: transform 0.05s ease-out;
  filter: drop-shadow(5px 5px 10px rgba(0, 0, 0, 0.5));
  z-index: 10;
}

.strum {
  transform: rotate(-15deg) translateY(20px) scale(1.1);
}

/* HUD */
#hud {
  background-color: #222;
  border-top: 4px solid #555;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  color: #ffcc00;
  font-size: 24px;
  font-weight: bold;
  text-shadow: 2px 2px 0 #000;
  padding: 0 20px;
}

.hud-stat {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Crosshair */
#crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255, 255, 255, 0.5);
  font-size: 20px;
  font-weight: bold;
}

/* Menus */
#overlay-menu {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  pointer-events: auto;
  z-index: 100;
}

h1 {
  color: #ffaa00;
  font-size: 48px;
  margin-bottom: 10px;
  text-shadow: 4px 4px 0px #880000;
  text-align: center;
}

p {
  font-size: 18px;
  margin-bottom: 30px;
  color: #ccc;
  text-align: center;
  max-width: 600px;
  line-height: 1.5;
}

button {
  padding: 15px 30px;
  font-size: 24px;
  font-family: 'Courier New', Courier, monospace;
  font-weight: bold;
  background-color: #ffaa00;
  border: 4px solid #fff;
  color: #000;
  cursor: pointer;
  transition: all 0.2s;
}

button:hover {
  background-color: #fff;
  color: #000;
  transform: scale(1.05);
}

/* Damage flash effect */
#damage-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: red;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s;
}

/* Mobile Controls */
#mobile-controls {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* Let events pass for camera looking */
  z-index: 50;
}

#joystick-container {
  position: absolute;
  bottom: 80px; /* Shifted up to avoid HUD overlap if it's there */
  left: 40px;
  width: 150px;
  height: 150px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  pointer-events: auto;
  touch-action: none; /* Prevent default scrolling/gestures */
}

#joystick-base {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

#joystick-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #00ffff, #ff00cc);
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
  cursor: pointer;
  touch-action: none;
}

#shoot-btn {
  position: absolute;
  bottom: 100px;
  right: 40px;
  width: 100px;
  height: 100px;
  background: rgba(255, 0, 204, 0.2);
  border: 4px solid #ff00cc;
  border-radius: 50%;
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 0 10px #ff00cc;
  box-shadow: 0 0 20px rgba(255, 0, 204, 0.4);
  pointer-events: auto;
  user-select: none;
  touch-action: none;
}

#shoot-btn:active {
  transform: scale(0.90);
  background: rgba(255, 0, 204, 0.4);
}

/* Media Queries for Mobile Landscape */
@media (max-width: 900px) {
  #weapon-container {
    font-size: 150px; /* Scale down banjo on mobile */
    right: 15%;
    bottom: -10px;
  }

  h1 {
    font-size: 32px;
  }

  p {
    font-size: 14px;
    max-width: 90%;
  }

  /* Smaller HUD for mobile */
  #hud {
    height: 50px;
    font-size: 18px;
  }
}
