html, body {
  margin: 0;
  height: 100%;
  background: #000;
  overflow: hidden;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --hud-gutter: 430px;
}

#hud {
  position: absolute;
  top: 10px;
  left: 12px;
  width: min(430px, calc(100vw - 24px));
  box-sizing: border-box;
  padding: 7px 11px 8px;
  font-size: 13px;
  line-height: 1.65;
  color: #7ee7ff;
  z-index: 10;
  pointer-events: none;
  text-shadow: 0 0 8px rgba(0, 120, 160, .9);
  /* The scene behind can be a wall of lit windows, which the text-shadow
     alone does not survive. */
  background: rgba(2, 10, 14, .62);
  border: 1px solid rgba(60, 140, 165, .22);
  border-radius: 5px;
  backdrop-filter: blur(2px);
}

body.hud-docked #hud {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(430px, 45vw);
  max-height: 100vh;
  border-width: 0 1px 0 0;
  border-radius: 0;
  overflow-y: auto;
  pointer-events: auto;
}

#hud .hud-toolbar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-bottom: 4px;
  margin-bottom: 3px;
  border-bottom: 1px solid rgba(60, 140, 165, .22);
  pointer-events: auto;
}

#hud-drag {
  flex: 1;
  color: #ffd479;
  letter-spacing: .08em;
  cursor: move;
  user-select: none;
  touch-action: none;
}

#hud .hud-toolbar button { padding: 1px 5px; }

#hud b { color: #ffd479; font-weight: 400; }
#hud .dim { color: #3d8fa3; }

#hud input[type="range"] {
  pointer-events: auto;
  vertical-align: middle;
  width: 110px;
  accent-color: #7ee7ff;
}

#hud .row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 3px;
}

/* The select carries city names of any length. Without a min-width of 0 a flex
   item refuses to shrink below its content, which pushed Load past the HUD. */
#hud .row > select {
  flex: 1 1 8em;
  min-width: 0;
  max-width: 100%;
}

#hud .row > button { flex: 0 0 auto; }

/* Typing your own city is the more capable path, so it gets its own labelled
   row rather than a squeezed third of a crowded one. */
#hud .city-search { cursor: text; }
#hud .city-search > .dim { flex: 0 0 auto; }
#hud .row input[type="text"] { min-width: 0; flex: 1 1 10em; }

#hud .keys > div { text-indent: -1.1em; padding-left: 1.1em; }

#hud .keys-group {
  color: #3d8fa3;
  text-transform: uppercase;
  font-size: .82em;
  letter-spacing: .07em;
}

#hud .radio-row { display: flex; gap: 5px; align-items: center; pointer-events: auto; }
#hud .radio-row button { padding: 0 4px; }

#hud select,
#hud input[type="text"],
#hud button {
  pointer-events: auto;
  font: inherit;
  color: #7ee7ff;
  background: rgba(0, 22, 30, .78);
  border: 1px solid #1d5f70;
  border-radius: 3px;
  padding: 2px 5px;
}

#hud input[type="text"] { width: auto; }
#hud input[type="text"]::placeholder { color: #2f6d7d; }

#hud select:focus,
#hud input[type="text"]:focus,
#hud button:focus { outline: 1px solid #7ee7ff; }

#hud button { cursor: pointer; color: #ffd479; }
#hud button:hover { background: rgba(0, 44, 58, .9); }
#hud button:disabled { opacity: .45; cursor: default; }

#hud .where {
  color: #ffd479;
  letter-spacing: .06em;
  min-height: 1.8em;
}

/* The name a place name actually resolved to, so a wrong match is visible. */
#hud .found { color: #ffd479; }

#hud .err { color: #ff9b7a; }
#hud a { color: #3d8fa3; }

/* LIVE = real clock; SIM = time warped/scrubbed away from the present. */
#hud .live { color: #7dffb0; }
#hud .sim { color: #ffd479; }

canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  background: #000;
  cursor: crosshair;
}

body.hud-docked canvas {
  width: calc(100vw - var(--hud-gutter));
  margin-left: var(--hud-gutter);
}

@media (max-width: 760px) {
  body.hud-docked #hud { width: min(360px, 55vw); }
}
