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

* {
  box-sizing: border-box;
}

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

body {
  background:
    radial-gradient(circle at 20% 18%, rgba(79, 140, 162, 0.16), transparent 34rem),
    linear-gradient(135deg, #090b0f 0%, #151719 52%, #0b0d11 100%);
}

#viewport {
  display: block;
  width: 100vw;
  height: 100vh;
  cursor: crosshair;
  position: fixed;
  inset: 0;
  z-index: 0;
}

#axis-gizmo {
  position: fixed;
  right: 16px;
  top: 16px;
  width: 128px;
  height: 128px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(8, 10, 13, 0.68);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(12px);
  pointer-events: none;
  z-index: 19;
}

#telemetry {
  position: fixed;
  right: 16px;
  top: 154px;
  width: 220px;
  max-width: calc(100vw - 32px);
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(8, 10, 13, 0.68);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(12px);
  pointer-events: none;
  z-index: 19;
  color: #d4dae2;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 10px;
  line-height: 1.45;
  text-align: left;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

#hud {
  position: fixed;
  top: 16px;
  left: 16px;
  min-width: 260px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(8, 10, 13, 0.76);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
  pointer-events: auto;
  z-index: 20;
}

.title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #ffffff;
}

#status {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.45;
  color: #d4dae2;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.controls span {
  min-width: 48px;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 11px;
  line-height: 1;
  text-align: center;
  color: #f8fafc;
}

.settings {
  display: grid;
  grid-template-columns: minmax(88px, auto) 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.range-control {
  grid-column: 1 / -1;
}

.toggle,
.range-control {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  font-size: 12px;
  color: #eef2f7;
}

.toggle input {
  width: 16px;
  height: 16px;
  accent-color: #9fd3e6;
}

.range-control {
  min-width: 0;
}

.range-control input {
  flex: 1;
  min-width: 72px;
  accent-color: #9fd3e6;
}

.range-control button {
  width: 26px;
  height: 24px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.range-control button:hover {
  background: rgba(255, 255, 255, 0.16);
}

.scale-control {
  padding-left: 34px;
}

#speed-value,
#scale-value {
  min-width: 34px;
  text-align: right;
  color: #d4dae2;
}

#lock {
  position: fixed;
  right: 16px;
  bottom: 16px;
  min-width: 156px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: #f2f4f8;
  color: #111418;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  z-index: 21;
}

#lock:hover {
  background: #ffffff;
}

@media (max-width: 640px) {
  #hud {
    top: 10px;
    left: 10px;
    max-width: calc(100vw - 20px);
  }

  #lock {
    right: 10px;
    bottom: 10px;
  }

  #axis-gizmo {
    right: 10px;
    top: 10px;
    width: 104px;
    height: 104px;
  }

  #telemetry {
    right: 10px;
    top: 124px;
    width: 190px;
  }

  .settings {
    grid-template-columns: 1fr;
  }

  .scale-control {
    padding-left: 0;
  }
}
