*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #16161d;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#game {
  display: block;
  width: 100vw;
  height: 100vh;
  cursor: crosshair;
}

#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  font-family: "Consolas", "Courier New", monospace;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 1px;
  line-height: 1;
  color: #b7b7ff;
  padding: 12px;
}

#catalog {
  position: absolute;
  top: 12px;
  left: 12px;
  max-width: min(45vw, 420px);
  max-height: 55vh;
  overflow: hidden;
  white-space: pre;
  opacity: 0;
  transition: opacity 1s step-end;
  font-size: 9px;
  line-height: 9px;
}

#catalog.visible {
  opacity: 1;
}

#telemetry {
  white-space: pre;
  opacity: 0;
  transition: opacity 1s step-end;
}

#telemetry.visible {
  opacity: 1;
}

#autopilot-line {
  color: #4285f4;
  margin-bottom: 6px;
  opacity: 0;
  transition: opacity 1s step-end;
}

#autopilot-line.visible {
  opacity: 1;
}

#bottom-row {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

#auto-btn {
  pointer-events: auto;
  cursor: pointer;
  padding: 6px 10px;
  border: 1px solid #b7b7ff;
  background: transparent;
  color: #b7b7ff;
  font: inherit;
  letter-spacing: inherit;
  opacity: 0;
  transition: opacity 1s step-end, background 0.15s;
}

#auto-btn.visible {
  opacity: 1;
}

#auto-btn.active {
  background: #4285f4;
  color: #fff;
  border-color: #4285f4;
}

#auto-btn:hover {
  background: rgba(183, 183, 255, 0.15);
}

#auto-btn.active:hover {
  background: #5a95f5;
}

@media (max-width: 600px) {
  #catalog, #telemetry {
    max-width: calc(100vw - 24px);
    font-size: 10px;
    line-height: 12px;
  }
}
