@import url("https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap");

body {
  margin: 0;
  overflow: hidden;
  background: #000;
  font-family: "Press Start 2P", cursive;
}

#ui-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  pointer-events: none;
}
.interactive {
  pointer-events: auto;
}

#damage-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(255, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  z-index: 150;
  transition: opacity 0.1s;
}

.cyber-panel {
  background: rgba(0, 0, 0, 0.7);
  border: 4px solid #00f2ff;
  box-shadow: 0 0 20px rgba(0, 242, 255, 0.5);
  width: 90%;
  max-width: 550px;
  padding: 40px;
  position: relative;
}
#menu[style*="display: none"] {
  opacity: 0;
  pointer-events: none;
}

.cyber-title {
  font-size: 2.5rem;
  color: #fff;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 4px 4px 0 #ff00ff, 8px 8px 0 #000;
  margin-bottom: 40px;
  font-family: "Press Start 2P", cursive;
  line-height: 1.2;
}

.mission-btn {
  width: 100%;
  margin: 15px 0;
  padding: 20px;
  font-size: 0.9rem;
  font-family: "Press Start 2P", cursive;
  color: white;
  text-transform: uppercase;
  border: 4px solid #fff;
  background: #000;
  cursor: pointer;
  transition: 0.1s;
  image-rendering: pixelated;
}

.ua-btn {
  border-color: #00f2ff;
  box-shadow: 4px 4px 0 #0066ff;
}
.en-btn {
  border-color: #ff00ff;
  box-shadow: 4px 4px 0 #6600ff;
}

.mission-btn:hover,
.mission-btn:focus,
.mission-btn.selected {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 #fff;
  background: #00f2ff;
  color: #000;
  border-color: #fff;
}

#hud {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(0, 0, 0, 0.7);
  border: 4px solid #00f2ff;
  padding: 20px;
  color: #fff;
  display: none;
  z-index: 101;
  font-size: 0.8rem;
  line-height: 1.8;
}

#shop-ui {
  display: none;
  background: rgba(0, 0, 0, 0.8);
  border: 4px solid #ff00ff;
  padding: 30px;
  max-width: 500px;
  z-index: 200;
  pointer-events: auto;
}

.shop-item {
  border: 4px solid #00f2ff;
  padding: 15px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  background: #000;
  color: #fff; /* Explicitly white text for visibility */
  font-size: 0.75rem;
  transition: 0.2s;
  opacity: 1 !important;
}

.shop-item div, .shop-item span {
  opacity: 1 !important;
  visibility: visible !important;
  color: #fff !important; /* Force white text on children */
}

.shop-item .text-yellow-400 {
  color: #fbbf24 !important; /* Keep yellow for price */
}

.shop-item:hover,
.shop-item.selected {
  background: #00f2ff;
  color: #000;
  border-color: #fff;
  transform: translateX(10px);
}

.shop-item.selected div, .shop-item.selected span {
  color: #000 !important; /* Invert text color when selected */
}

.level-badge {
  color: #ffff00;
  margin-bottom: 15px;
  font-size: 0.7rem;
}

.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 500;
}

.level-choice-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 20px;
}

.level-item {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  color: #fff;
  font-size: 0.8rem;
  cursor: pointer;
}

.level-item.locked { opacity: 0.2; }
.level-item:not(.locked):hover {
  background: #00f2ff;
  color: #000;
}

#gamepad-indicator {
  display: none;
  position: fixed;
  top: 20px;
  right: 20px;
  background: #000;
  border: 2px solid #00ff00;
  color: #00ff00;
  padding: 5px 10px;
  font-size: 10px;
  z-index: 1000;
}

.touch-btn {
  width: 60px;
  height: 60px;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.touch-btn.pressed {
  background: #fff;
  color: #000;
}

/* Background Stars Animation */
@keyframes flicker {
  0% { opacity: 0.8; }
  50% { opacity: 1; }
  100% { opacity: 0.8; }
}

.cyber-panel {
  animation: flicker 1s infinite;
}

@media (max-width: 600px) {
  .cyber-title { font-size: 1.5rem; }
  .mission-btn { font-size: 0.7rem; padding: 15px; }
}

.touch-controls {
  position: fixed;
  bottom: 40px;
  left: 40px;
  right: 40px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  z-index: 1000;
  pointer-events: none;
}
.touch-controls.hidden { display: none !important; }
.touch-controls.visible { display: flex !important; }

.joystick-base {
  width: 120px;
  height: 120px;
  background: rgba(255, 255, 255, 0.05);
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  position: relative;
  pointer-events: auto;
  touch-action: none;
}

#joystick-stick {
  width: 50px;
  height: 50px;
  background: #00f2ff;
  border-radius: 50%;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 15px #00f2ff;
}

.touch-btn {
  width: 70px;
  height: 70px;
  background: rgba(0, 0, 0, 0.6);
  border: 4px solid #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  font-size: 1.5rem;
  touch-action: none;
  user-select: none;
}

.touch-btn.pressed {
  background: #00f2ff;
  color: #000;
  border-color: #fff;
  transform: scale(0.9);
}
