body {
  font-family: "Exo 2", sans-serif;
  background-color: #000010;
  color: #e0e0e0;
  overflow: hidden;
  margin: 0;
  padding: 0;
  height: 100vh;
}
.game-wrapper {
  border: none;
  background-color: #050515;
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}
canvas {
  background-color: transparent;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}
#starfield {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  background-color: #000010;
  width: 100vw;
  height: 100vh;
}

#gameCanvas {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: 100vw;
  height: 100vh;
}
.ui-bar {
  background-color: rgba(10, 10, 30, 0.95);
  border-bottom: 2px solid #4f4f4f;
  position: relative;
  z-index: 2;
  padding: 25px 30px;
  min-height: 70px;
  display: flex;
  align-items: center;
  line-height: 1.2;
}
.fuel-bar-container {
  background-color: #222;
  border: 1px solid #888;
  width: 250px;
  height: 25px;
  border-radius: 4px;
}
#fuel-bar {
  background: linear-gradient(90deg, #34d399, #fde047, #ef4444);
  transition: width 0.3s ease-out;
  border-radius: 4px;
}
#timer {
  color: #facc15;
}

/* Ensure text is visible and properly spaced */
.ui-bar span {
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  display: inline-block;
  vertical-align: top;
  line-height: 1.4;
}

.ui-bar {
  font-family: "Exo 2", sans-serif;
  font-weight: 400;
}

.world-map {
  position: absolute;
  top: 100px;
  right: 20px;
  width: 200px;
  height: 170px;
  background-color: rgba(0, 0, 0, 0.7);
  border: 2px solid #4f4f4f;
  border-radius: 8px;
  z-index: 3;
  box-shadow: 0 0 20px rgba(0, 191, 255, 0.3);
  transition: opacity 0.3s ease;
}

.world-map.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Mobile Touch Controls */
.mobile-controls {
  position: fixed;
  bottom: 20px;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 20px;
  pointer-events: none;
}

/* Joystick Container */
.joystick-container {
  width: 120px;
  height: 120px;
  pointer-events: auto;
}

.joystick-base {
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle,
    rgba(233, 175, 81, 0.2) 0%,
    rgba(233, 175, 81, 0.1) 70%,
    transparent 100%
  );
  border: 3px solid rgba(233, 175, 81, 0.6);
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 20px rgba(233, 175, 81, 0.3),
    inset 0 0 20px rgba(233, 175, 81, 0.1);
  transition: all 0.3s ease;
}

.joystick-base:active {
  transform: scale(0.95);
  box-shadow: 0 0 30px rgba(233, 175, 81, 0.5),
    inset 0 0 30px rgba(233, 175, 81, 0.2);
}

.joystick-center {
  width: 20px;
  height: 20px;
  background: radial-gradient(
    circle,
    rgba(233, 175, 81, 0.8) 0%,
    rgba(233, 175, 81, 0.4) 100%
  );
  border: 2px solid rgba(233, 175, 81, 0.9);
  border-radius: 50%;
  position: absolute;
  box-shadow: 0 0 10px rgba(233, 175, 81, 0.5);
}

.joystick-stick {
  width: 40px;
  height: 40px;
  background: radial-gradient(
    circle,
    rgba(233, 175, 81, 0.9) 0%,
    rgba(233, 175, 81, 0.6) 100%
  );
  border: 2px solid rgba(233, 175, 81, 1);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 15px rgba(233, 175, 81, 0.7),
    inset 0 0 10px rgba(255, 255, 255, 0.2);
  transition: all 0.1s ease;
  cursor: grab;
}

.joystick-stick:active {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(0.9);
  box-shadow: 0 0 20px rgba(233, 175, 81, 0.9),
    inset 0 0 15px rgba(255, 255, 255, 0.3);
}

/* Fire Button */
.fire-button-container {
  width: 80px;
  height: 80px;
  pointer-events: auto;
}

.fire-button {
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle,
    rgba(239, 68, 68, 0.8) 0%,
    rgba(239, 68, 68, 0.4) 100%
  );
  border: 3px solid rgba(239, 68, 68, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.4),
    inset 0 0 20px rgba(239, 68, 68, 0.1);
  position: relative;
  overflow: hidden;
}

.fire-button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.3) 0%,
    transparent 70%
  );
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.3s ease;
}

.fire-button:active {
  transform: scale(0.9);
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.7),
    inset 0 0 30px rgba(239, 68, 68, 0.2);
}

.fire-button:active::before {
  width: 100%;
  height: 100%;
}

.fire-button-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 70%
  );
}

.fire-icon {
  font-size: 24px;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .mobile-controls {
    bottom: 15px;
    padding: 0 15px;
  }

  .joystick-container {
    width: 100px;
    height: 100px;
  }

  .fire-button-container {
    width: 70px;
    height: 70px;
  }

  .fire-icon {
    font-size: 20px;
  }

  .ui-bar {
    padding: 15px 20px;
    min-height: 60px;
  }

  .ui-bar span {
    font-size: 14px;
  }

  .world-map {
    top: 80px;
    right: 15px;
    width: 150px;
    height: 130px;
  }

  /* Improve mobile UI layout */
  .ui-bar .flex {
    flex-direction: column;
    gap: 10px;
  }

  .ui-bar .flex > div {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 480px) {
  .mobile-controls {
    bottom: 10px;
    padding: 0 10px;
  }

  .joystick-container {
    width: 90px;
    height: 90px;
  }

  .fire-button-container {
    width: 60px;
    height: 60px;
  }

  .fire-icon {
    font-size: 18px;
  }

  .joystick-stick {
    width: 35px;
    height: 35px;
  }

  .joystick-center {
    width: 15px;
    height: 15px;
  }

  /* Further improve small screen layout */
  .ui-bar {
    padding: 10px 15px;
    min-height: 50px;
  }

  .ui-bar span {
    font-size: 12px;
  }

  .world-map {
    top: 70px;
    right: 10px;
    width: 120px;
    height: 100px;
  }

  .fuel-bar-container {
    width: 150px;
    height: 20px;
  }
}

/* Hide mobile controls on desktop */
@media (min-width: 769px) {
  .mobile-controls {
    display: none;
  }
}

/* Show mobile controls only on touch devices */
@media (hover: none) and (pointer: coarse) {
  .mobile-controls {
    display: flex;
  }
}

/* Hide on non-touch devices */
@media (hover: hover) and (pointer: fine) {
  .mobile-controls {
    display: none;
  }
}

/* Map Toggle Button */
.map-toggle {
  background-color: rgba(0, 0, 0, 0.8);
  border: 1px solid #4f4f4f;
  border-radius: 4px;
  color: #00bfff;
  padding: 8px 12px;
  font-family: "Exo 2", sans-serif;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-left: 15px;
}

.map-toggle:hover {
  background-color: rgba(0, 191, 255, 0.2);
  border-color: #00bfff;
}

.world-map-title {
  position: absolute;
  top: 10px;
  left: 10px;
  color: #00bfff;
  font-size: 14px;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Docking Indicators */
.docking-indicators {
  position: absolute;
  bottom: 20px;
  left: 20px;
  background-color: rgba(0, 0, 0, 0.8);
  border: 1px solid #4f4f4f;
  border-radius: 4px;
  padding: 15px;
  z-index: 3;
  display: none;
}

.indicator {
  display: flex;
  align-items: center;
  margin: 5px 0;
}

.indicator-bar {
  width: 150px;
  height: 10px;
  background-color: #333;
  border-radius: 4px;
  margin-left: 15px;
  overflow: hidden;
}

.indicator-fill {
  height: 100%;
  transition: width 0.2s ease;
}

.indicator-good {
  background-color: #10b981;
}

.indicator-warning {
  background-color: #f59e0b;
}

.indicator-danger {
  background-color: #ef4444;
}

/* Gravity Warning */
.gravity-warning {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(255, 0, 0, 0.3);
  border: 2px solid #ff0000;
  border-radius: 10px;
  padding: 10px 20px;
  color: #ff0000;
  font-weight: bold;
  font-size: 18px;
  text-align: center;
  z-index: 10;
  animation: gravityPulse 1s infinite;
}

@keyframes gravityPulse {
  0% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.5;
  }
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background-color: #1a1a2e;
  border: 2px solid #4f4f4f;
  border-radius: 8px;
  padding: 30px;
  max-width: 600px;
  width: 90%;
  color: #e0e0e0;
  box-shadow: 0 0 30px rgba(0, 191, 255, 0.3);
}

/* Gravity Warning Content */
.gravity-warning-content {
  display: flex;
  align-items: center;
  justify-content: center;
}
