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

body {
  background: #090b10;
  color: #eef3ff;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.hud {
  position: fixed;
  left: 18px;
  top: 18px;
  z-index: 5;
  width: min(560px, calc(100vw - 36px));
  pointer-events: none;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.65);
}

.title {
  font-size: 17px;
  font-weight: 760;
  letter-spacing: 0.01em;
}

.subtitle {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.35;
  opacity: 0.72;
}

.legend-block {
  margin-top: 14px;
  width: 220px;
}

.legend-label {
  margin-bottom: 5px;
  font-size: 11px;
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.legend-bar {
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(
    90deg,
    #020309 0%,
    #061f57 18%,
    #0094b8 40%,
    #9ecc2e 64%,
    #ffb814 82%,
    #ff1f08 100%
  );
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.35);
}

.legend-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 10px;
  opacity: 0.56;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#status-pill {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 6;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(10, 12, 18, 0.82);
  backdrop-filter: blur(12px);
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.control-panel {
  position: fixed;
  right: 14px;
  top: 14px;
  z-index: 10;
  width: 320px;
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: 12px;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(14, 16, 23, 0.86);
  backdrop-filter: blur(16px);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.28);
}

.control-panel h3 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 760;
  letter-spacing: 0.01em;
}

.control-note {
  margin: 0 0 12px;
  font-size: 11px;
  line-height: 1.35;
  opacity: 0.62;
}

.control-group {
  margin: 12px 0 4px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.6;
}

.control-row {
  display: grid;
  grid-template-columns: 1fr 132px;
  gap: 10px;
  align-items: center;
  min-height: 28px;
  margin: 4px 0;
}

.control-row label {
  font-size: 11px;
  line-height: 1.2;
  opacity: 0.86;
}

.control-row input[type="range"] {
  width: 100%;
}

.control-row input[type="checkbox"] {
  justify-self: end;
}

.control-row select,
.control-row input[type="text"],
.control-row button {
  width: 100%;
  min-width: 0;
  color: inherit;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 6px;
  padding: 5px 8px;
  font: inherit;
}

.control-row button {
  cursor: pointer;
}

.control-row button:hover,
.control-button-row button:hover {
  background: rgba(255, 255, 255, 0.13);
}

.control-value {
  display: inline-block;
  min-width: 42px;
  margin-left: 6px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  opacity: 0.56;
}

.control-button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.control-button-row button {
  width: 100%;
  color: inherit;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 7px;
  padding: 8px;
  font: inherit;
  cursor: pointer;
}

.small-metrics {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 10px;
  font-size: 11px;
}

.metric {
  padding: 8px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.metric-label {
  opacity: 0.56;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 10px;
}

.metric-value {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 900px) {
  .control-panel {
    width: 280px;
  }

  .hud {
    width: calc(100vw - 312px);
  }
}

@media (max-width: 720px) {
  .control-panel {
    left: 12px;
    right: 12px;
    top: auto;
    bottom: 12px;
    width: auto;
    max-height: 46vh;
  }

  .hud {
    width: calc(100vw - 24px);
  }

  #status-pill {
    bottom: calc(46vh + 28px);
  }
}

.control-row input[type="text"] {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  color: inherit;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 6px;
  padding: 5px 8px;
  font: inherit;
}
