:root {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.5;
  font-weight: 400;
  color-scheme: dark;
  color: rgba(255, 255, 255, 0.87);
  background-color: #000;
}

body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
}

#app {
  width: 100%;
  height: 100%;
  display: block;
}

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

#score,
#level {
  position: absolute;
  top: 20px;
  font-size: 24px;
  font-weight: bold;
  text-shadow: 0 0 10px #0ff, 0 0 20px #0ff;
  color: #fff;
}

#score {
  left: 20px;
  top: 60px;
}

#level {
  left: 20px;
}
/* Battery UI */
#battery-container {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
    flex-direction: row;
    /* Horizontal */
    align-items: center;
    filter: drop-shadow(0 0 5px #0f0);
  }
  
  .battery-head {
    width: 6px;
    height: 15px;
    background: #0f0;
    margin-left: 2px;
    /* Right side */
    margin-bottom: 0;
    border-radius: 0 2px 2px 0;
    order: 2;
    /* Head on right */
  }
  
    .battery-body {
  height: 30px;
    border: 2px solid #0f0;
    border-radius: 4px;
    padding: 2px;
    display: flex;
  flex-direction: row;
    /* Fill from left */
    gap: 2px;
    background: rgba(0, 20, 0, 0.5);
    order: 1;
  transition: width 0.3s ease;
    /* Smooth resize */
}
  
  .battery-segment {
    height: 100%;
    width: 25%;
    /* Dynamic width */
    flex-grow: 1;
    background: #0f0;
    box-shadow: 0 0 8px #0f0;
    border-radius: 1px;
    transition: all 0.3s ease;
  }
  
  .battery-segment.empty {
    background: transparent;
    box-shadow: none;
}

/* Item Popup */
#item-popup {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #fff;
  border-radius: 10px;
  padding: 15px 30px;
  color: #fff;
  font-size: 24px;
  font-weight: bold;
  text-align: center;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2000;
}

#item-popup.show {
  opacity: 1;
  animation: popup-bounce 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popup-bounce {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
  }

  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}
#start-screen,
#game-over-screen,
#details-screen {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  background: rgba(0, 0, 0, 0.9);
  padding: 40px;
  border: 2px solid #0ff;
  border-radius: 10px;
  box-shadow: 0 0 20px #0ff, inset 0 0 20px #0ff;
  pointer-events: auto;
  min-width: 300px;
}

h1 {
  font-size: clamp(32px, 10vw, 64px);
  margin: 0 0 30px 0;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 4px;
  text-shadow:
    0 0 5px #fff,
    0 0 10px #fff,
    0 0 20px #f0f,
    0 0 30px #f0f,
    0 0 40px #f0f;
  animation: neon-pulse 1.5s infinite alternate;
}

h2 {
  color: #0ff;
  text-shadow: 0 0 10px #0ff;
  margin-bottom: 15px;
}
p {
  font-size: 18px;
  margin: 10px 0;
  color: #ccc;
}

button {
  background: transparent;
  color: #0ff;
  border: 2px solid #0ff;
  padding: 10px 30px;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  margin: 10px;
  text-transform: uppercase;
  box-shadow: 0 0 10px #0ff;
  transition: all 0.2s ease;
}

button:hover {
  background: #0ff;
  color: #000;
  box-shadow: 0 0 20px #0ff;
}

.item-list {
  list-style: none;
  padding: 0;
  text-align: left;
  margin: 20px 0;
}

.item-list li {
  margin: 5px 0;
  font-size: 18px;
}

.item-list span {
  font-size: 24px;
  margin-right: 10px;
}
.hidden {
  display: none !important;
}

@keyframes neon-pulse {
  from {
    text-shadow:
      0 0 5px #fff,
      0 0 10px #fff,
      0 0 20px #f0f,
      0 0 30px #f0f,
      0 0 40px #f0f;
  }

  to {
    text-shadow:
      0 0 2px #fff,
      0 0 5px #fff,
      0 0 10px #f0f,
      0 0 15px #f0f,
      0 0 20px #f0f;
  }
}

.joystick-base {
  position: absolute;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  pointer-events: none;
  display: none;
  z-index: 1000;
}

.joystick-knob {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}
/* Boss Health */
#boss-health-container {
  position: absolute;
  width: 100px;
  height: 10px;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid #f00;
  border-radius: 5px;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 100;
}

#boss-health-bar {
  width: 100%;
  height: 100%;
  background: #f00;
  box-shadow: 0 0 10px #f00;
  transition: width 0.2s;
}