/* Orbital Mechanics Laboratory — offline, no external resources. */

:root {
  --bg: #04060d;
  --line: rgba(120, 140, 190, 0.25);
  --text: #dbe4ff;
  --dim: #8fa0c9;
  --accent: #6fb7ff;
  --accent2: #ffd27a;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
}

/* ---------- header ---------- */

header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px 8px;
  flex: 0 0 auto;
}

h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.4px;
}

.badge {
  font-size: 12px;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---------- control bar ---------- */

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(20, 28, 54, 0.55), rgba(10, 14, 28, 0.55));
  flex: 0 0 auto;
}

button {
  font: inherit;
  color: var(--text);
  background: rgba(45, 60, 105, 0.55);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 14px;
  min-height: 42px;
  min-width: 44px;
  cursor: pointer;
  transition: background 120ms ease, transform 60ms ease;
  white-space: nowrap;
}

button:hover { background: rgba(64, 84, 140, 0.75); }
button:active { transform: translateY(1px); }

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 150px;
  flex: 1 1 150px;
  max-width: 260px;
}

.field label {
  font-size: 12px;
  color: var(--dim);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.field output {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  width: 100%;
  height: 30px;
  accent-color: var(--accent);
  margin: 0;
  touch-action: manipulation;
}

/* ---------- readout ---------- */

.readout {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 160px;
  flex: 0 1 auto;
}

.readout-label {
  font-size: 12px;
  color: var(--dim);
}

.readout output {
  font-size: 19px;
  font-weight: 600;
  color: var(--accent2);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.readout .sub {
  font-size: 11px;
  color: var(--dim);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-variant-numeric: tabular-nums;
}

/* ---------- stage ---------- */

main {
  flex: 1 1 auto;
  position: relative;
  min-height: 0;
}

canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

/* ---------- footer ---------- */

footer {
  display: flex;
  gap: 8px 16px;
  flex-wrap: wrap;
  padding: 6px 16px 8px;
  font-size: 12px;
  color: var(--dim);
  border-top: 1px solid var(--line);
  flex: 0 0 auto;
}

kbd {
  background: rgba(70, 90, 150, 0.35);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 6px;
  font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

code {
  font: 12px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text);
}

/* ---------- responsive: phones (~375px) ---------- */

@media (max-width: 600px) {
  header { padding: 8px 12px 6px; }
  h1 { font-size: 15px; }
  .badge { font-size: 11px; }

  .controls {
    gap: 8px 10px;
    padding: 8px 12px;
  }

  button { flex: 1 1 auto; padding: 8px 10px; }

  .field { flex: 1 1 42%; max-width: none; min-width: 130px; }
  .readout { flex: 1 1 100%; min-width: 0; }
  .readout output { font-size: 17px; }

  footer { padding: 6px 12px; font-size: 11px; }
}
