/*
 * Global styles for Phobos‑Like. This sheet defines layout for the canvas,
 * heads‑up display, menus and touch overlays. It also provides color
 * variables and respects the user's reduced motion preference.
 */

:root {
  --hud-bg: rgba(0, 0, 0, 0.6);
  --hud-fg: #fff;
  --flash-color: rgba(255, 0, 0, 0.4);
  --menu-bg: rgba(0, 0, 0, 0.9);
  --accent: #ff9800;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #111;
  color: var(--hud-fg);
  font-family: sans-serif;
  overflow: hidden;
}

#game-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#gameCanvas {
  /* The rendering canvas scales to fit while preserving aspect ratio. */
  width: 100%;
  height: 100%;
  background: #000;
  display: block;
}

/* Heads‑up display */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 8px;
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  background: var(--hud-bg);
  pointer-events: none;
}

#hud.hidden {
  display: none;
}

#damageFlash {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--flash-color);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

#menu,
#settings {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--menu-bg);
  padding: 20px;
  border-radius: 4px;
  text-align: center;
  min-width: 250px;
  z-index: 10;
}

#menu.hidden,
#settings.hidden {
  display: none;
}

button {
  display: block;
  margin: 10px auto;
  padding: 8px 16px;
  font-size: 16px;
  border: none;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

button:focus {
  outline: 2px solid #fff;
}

label {
  display: block;
  margin: 10px 0;
  font-size: 14px;
}

input[type="range"] {
  width: 100%;
}

/* Touch control placeholders; the game will create these elements dynamically. */
.touch-joystick {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

.touch-thumb {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* Crosshair overlay */
#crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin-left: -10px;
  margin-top: -10px;
  pointer-events: none;
}
#crosshair::before,
#crosshair::after {
  content: '';
  position: absolute;
  background: var(--hud-fg);
}
#crosshair::before {
  width: 2px;
  height: 20px;
  left: 9px;
  top: 0;
}
#crosshair::after {
  width: 20px;
  height: 2px;
  left: 0;
  top: 9px;
}

@media (prefers-reduced-motion: reduce) {
  #damageFlash {
    transition: none;
  }
}

/* Objective text overlay */
#objective {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--hud-bg);
  color: var(--hud-fg);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 14px;
  pointer-events: none;
}