* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #000;
}

body {
  display: grid;
  place-items: center;
}

#game-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: radial-gradient(circle at center, #05101a 0%, #010205 70%, #000 100%);
  cursor: crosshair;
  user-select: none;
}

#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#cockpit {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  z-index: 5;
  filter: contrast(1.05) saturate(1.1);
}

#hud {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  color: #7ffcff;
  text-shadow: 0 0 8px rgba(0, 230, 255, .9);
  font-weight: 700;
  letter-spacing: .12em;
}

.hud-block {
  position: absolute;
  top: 3.2vh;
  font-size: clamp(10px, 1vw, 16px);
}

.hud-block.left {
  left: 3vw;
  width: min(22vw, 250px);
}

.hud-block.right {
  right: 3vw;
  text-align: right;
}

.hud-block.center {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.label {
  opacity: .72;
  font-size: .8em;
}

.meter {
  width: 100%;
  height: 10px;
  border: 1px solid rgba(100, 255, 255, .8);
  margin: 5px 0;
  background: rgba(0, 20, 25, .75);
  box-shadow: inset 0 0 8px #00191d, 0 0 7px rgba(0, 235, 255, .35);
}

#health-bar {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #00ffb7, #60faff);
  box-shadow: 0 0 10px #00e5ff;
  transition: width .15s linear;
}

#crosshair {
  position: relative;
  width: 76px;
  height: 76px;
  margin: 0 auto 14px;
  border: 1px solid rgba(100, 255, 255, .55);
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(0, 234, 255, .28);
}

#crosshair .h-line,
#crosshair .v-line {
  position: absolute;
  background: #8bffff;
  box-shadow: 0 0 7px #00e5ff;
}

#crosshair .h-line {
  width: 106px;
  height: 1px;
  left: -15px;
  top: 37px;
}

#crosshair .v-line {
  width: 1px;
  height: 106px;
  left: 37px;
  top: -15px;
}

#crosshair .dot {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  left: 35px;
  top: 35px;
  box-shadow: 0 0 9px #00efff;
}

#target-readout {
  font-size: 11px;
  opacity: .85;
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  background: rgba(0, 4, 9, .72);
  backdrop-filter: blur(4px);
}

.overlay.visible {
  display: grid;
}

.panel {
  width: min(92vw, 620px);
  padding: clamp(24px, 4vw, 48px);
  border: 1px solid rgba(0, 240, 255, .65);
  background: linear-gradient(180deg, rgba(3, 20, 28, .95), rgba(1, 8, 12, .96));
  box-shadow: 0 0 45px rgba(0, 225, 255, .18), inset 0 0 30px rgba(0, 225, 255, .06);
  text-align: center;
}

.small-panel {
  width: min(80vw, 380px);
}

h1, h2 {
  margin: 0 0 12px;
  color: #bffeff;
  letter-spacing: .16em;
  text-shadow: 0 0 18px rgba(0, 230, 255, .85);
}

p {
  color: #b8d7dc;
  line-height: 1.5;
}

.controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 24px 0;
  text-align: left;
}

.controls div {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 11px;
  border: 1px solid rgba(85, 230, 245, .18);
  background: rgba(0, 25, 31, .55);
}

kbd {
  display: inline-block;
  min-width: 74px;
  padding: 5px 7px;
  border: 1px solid rgba(122, 250, 255, .7);
  border-bottom-width: 3px;
  border-radius: 4px;
  color: #d9ffff;
  background: #061319;
  font: inherit;
  font-size: 12px;
  text-align: center;
}

button {
  border: 1px solid #80fbff;
  padding: 13px 30px;
  background: linear-gradient(180deg, #0d6471, #08343c);
  color: white;
  font: inherit;
  font-weight: 800;
  letter-spacing: .15em;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(0, 231, 255, .25);
}

button:hover {
  filter: brightness(1.25);
}

.small {
  font-size: 12px;
  opacity: .7;
}

@media (max-width: 650px) {
  .controls {
    grid-template-columns: 1fr;
  }
  .hud-block.left {
    left: 4vw;
    width: 28vw;
  }
  #cockpit {
    object-fit: cover;
  }
}


.radar-block {
  left: 3vw;
  top: auto;
  bottom: 3.5vh;
  width: 180px;
  text-align: center;
  z-index: 20;
  pointer-events: none;
}

#radar {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 2px solid rgba(120, 255, 255, .95);
  background: radial-gradient(circle, rgba(0, 42, 52, .97), rgba(0, 7, 12, .99));
  box-shadow: 0 0 18px rgba(0, 235, 255, .28), inset 0 0 25px rgba(0, 235, 255, .08);
}

#missile-status {
  margin-top: 7px;
  font-size: 11px;
  color: #9affff;
  text-shadow: 0 0 8px rgba(0, 230, 255, .9);
}

#missile-status.locking {
  color: #ffe96a;
  text-shadow: 0 0 9px #ffb300;
}

#missile-status.locked {
  color: #ff6d6d;
  text-shadow: 0 0 10px #ff233f;
}

@media (max-width: 650px) {
  .radar-block {
    width: 125px;
    left: 2vw;
    bottom: 2vh;
  }

  #radar {
    width: 125px;
    height: 125px;
  }
}


.shield-label {
  margin-top: 10px;
}

.shield-meter {
  border-color: rgba(90, 145, 255, .9);
}

#shield-bar {
  display: block;
  height: 100%;
  width: 50%;
  background: linear-gradient(90deg, #466dff, #8ddcff);
  box-shadow: 0 0 12px #4e8cff;
  transition: width .15s linear;
}

#combo-readout {
  margin-top: 8px;
  color: #ffe577;
  font-size: 13px;
  opacity: 0;
  transform: scale(.85);
  transition: opacity .12s, transform .12s;
  text-shadow: 0 0 12px #ff9d00;
}

#combo-readout.active {
  opacity: 1;
  transform: scale(1);
}

#pickup-message {
  min-height: 18px;
  margin-top: 6px;
  color: #b7ffff;
  font-size: 12px;
  text-shadow: 0 0 12px #00eaff;
}

#laser-level {
  margin-top: 7px;
  color: #ffce66;
  font-size: 11px;
  text-shadow: 0 0 9px #ff8a00;
}

.collision-alert {
  animation: collisionPulse .22s ease-out;
}

@keyframes collisionPulse {
  0% { filter: brightness(2.2) saturate(1.8); }
  100% { filter: none; }
}


#pickup-message.shoot-hint {
  color: #fff1a6;
  text-shadow: 0 0 12px #ff9d00;
}
