:root {
  --bg: #07080c;
  --fg: #e6e8ee;
  --dim: #8b94a7;
  --accent: #ffd479;
  --panel: rgba(12, 14, 20, 0.78);
  --border: rgba(255, 255, 255, 0.08);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#sky {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  cursor: grab;
  touch-action: none;
}
#sky:active { cursor: grabbing; }

.hud {
  position: fixed;
  left: 0;
  right: 0;
  padding: 12px 16px;
  background: var(--panel);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-color: var(--border);
  z-index: 5;
  pointer-events: none;
}
.hud > * { pointer-events: auto; }

.hud-top {
  top: 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 0 1 auto;
  min-width: 0;
}

.hud-bottom {
  bottom: 0;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.title {
  letter-spacing: 0.3em;
  font-weight: 600;
  font-size: 12px;
  color: var(--accent);
}

.accuracy {
  color: var(--dim);
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
}

.readout {
  flex: 0 1 auto;
  font-size: 12px;
  color: var(--dim);
  white-space: pre;
  text-align: right;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

button, select, input[type="datetime-local"] {
  background: rgba(255, 255, 255, 0.04);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 10px;
  font: inherit;
  font-size: 12px;
}

button { cursor: pointer; min-width: 32px; }
button:hover { background: rgba(255, 255, 255, 0.08); }

label.speed, label.scale, label.toggle {
  font-size: 11px;
  color: var(--dim);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

label.toggle input { accent-color: var(--accent); }

input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
}

.scrubLabel {
  font-size: 11px;
  color: var(--dim);
  min-width: 60px;
  text-align: right;
}

@media (max-width: 640px) {
  .hud-top {
    align-items: flex-start;
    gap: 10px;
  }

  .accuracy {
    max-width: 44vw;
    white-space: normal;
  }

  .readout {
    font-size: 10px;
  }
}

@media (orientation: portrait) and (max-width: 900px) {
  .hud-top {
    align-items: flex-start;
    gap: 10px;
  }

  .brand {
    flex-basis: 42%;
  }

  .accuracy {
    max-width: 100%;
    white-space: normal;
  }

  .readout {
    flex-basis: 54%;
    font-size: 9px;
    line-height: 1.25;
    white-space: normal;
  }
}
