/* Chrome is deliberately quiet: the model is the page. Type is the same
   tracked-caps + monospace-figures pairing used across this project. */
:root {
  color-scheme: dark;
  --ink: #0a0d14;
  --paper: #dce2ea;
  --muted: #8492a6;
  --faint: #5c6980;
  --amber: #c7864e;
  --real: #7fd18c;
  --unreal: #ff5a4a;
  --line: rgba(150, 172, 204, 0.16);
  --panel: rgba(9, 12, 20, 0.84);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "DejaVu Sans Mono", Menlo, monospace;
  --pad: clamp(12px, 2vw, 26px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

#view { position: fixed; inset: 0; }
#view canvas { display: block; cursor: crosshair; }

/* --- loading ------------------------------------------------------------- */
#loading {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 4px;
  background: linear-gradient(180deg, #15568f, #9aa2b2);
  z-index: 10;
  transition: opacity .5s ease;
}
#loading.hidden { opacity: 0; pointer-events: none; }
#loading .eyebrow {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .3em;
  color: rgba(255, 255, 255, .72);
}
#loading h1 {
  margin: 6px 0;
  font-size: clamp(30px, 6vw, 60px);
  font-weight: 200;
  letter-spacing: .04em;
}
#loading .sub { margin: 0; font-size: 13px; color: rgba(255, 255, 255, .8); }
#loading .small { margin-top: 12px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }

/* --- crosshair ----------------------------------------------------------- */
#crosshair {
  position: fixed;
  left: 50%; top: 50%;
  width: 14px; height: 14px;
  margin: -7px 0 0 -7px;
  pointer-events: none;
  z-index: 4;
}
#crosshair::before, #crosshair::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, .75);
  box-shadow: 0 0 3px rgba(0, 0, 0, .9);
}
#crosshair::before { left: 6px; top: 0; width: 2px; height: 14px; }
#crosshair::after { top: 6px; left: 0; height: 2px; width: 14px; }

/* --- the readout ---------------------------------------------------------
   Modelled on the block-info tooltips mod packs use: name on top, provenance
   underneath in a colour that cannot be mistaken for the name. */
#waila {
  position: fixed;
  left: 50%;
  top: calc(50% + 34px);
  transform: translateX(-50%);
  min-width: 260px;
  max-width: min(560px, 88vw);
  padding: 10px 14px 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  backdrop-filter: blur(12px);
  text-align: center;
  pointer-events: none;
  z-index: 5;
  transition: opacity .12s ease;
}
#waila.empty { opacity: 0; }
#waila-label {
  font-size: 14.5px;
  letter-spacing: .02em;
  color: #fff;
}
#waila-status {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--unreal);
}
#waila-detail {
  margin-top: 7px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}
#waila-dist {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--faint);
}

/* --- chrome -------------------------------------------------------------- */
.brand {
  position: fixed;
  top: var(--pad); left: var(--pad);
  pointer-events: none;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .8);
}
.brand h1 {
  margin: 0;
  font-size: clamp(15px, 1.9vw, 21px);
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.brand h1 span { color: var(--amber); margin-left: .45em; font-weight: 200; }
.brand p {
  margin: 8px 0 0;
  padding-top: 7px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--faint);
}

#hint {
  position: fixed;
  right: var(--pad);
  top: var(--pad);
  text-align: right;
  pointer-events: none;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .85);
  transition: opacity .2s;
}
#hint.hidden { opacity: 0; }
#hint .k { margin: 0 0 5px; font-size: 11px; color: var(--muted); }
#hint b {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255, 255, 255, .05);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  color: var(--paper);
}

#legend {
  position: fixed;
  left: var(--pad); bottom: var(--pad);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  align-items: center;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .04em;
  color: var(--muted);
  text-shadow: 0 2px 14px rgba(0, 0, 0, .85);
  pointer-events: none;
}
#legend .sw {
  display: inline-block;
  width: 9px; height: 9px;
  margin-right: 6px;
  border-radius: 2px;
  vertical-align: -1px;
}
#legend .sw.existing { background: var(--real); }
#legend .sw.proposed { background: var(--unreal); }
#legend #mode {
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--paper);
}
#legend #mode.drive { border-color: var(--amber); color: var(--amber); }
#legend #mode.fly { border-color: #7fb0d1; color: #7fb0d1; }
#legend #speed { font-variant-numeric: tabular-nums; color: var(--amber); }

body.hud-hidden .brand,
body.hud-hidden #legend,
body.hud-hidden #hint,
body.hud-hidden #waila { opacity: 0; }

@media (max-width: 640px) {
  #hint { display: none; }
  #waila { min-width: 0; }
}
