html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #13244d;
  color: #fff;
  color-scheme: light;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
#stage, #stage canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
/* Trip back to the summit: a quick fade through navy. */
#fade {
  position: fixed;
  inset: 0;
  background: #13244d;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
}
#fade.on { opacity: 1; }
/* The lift ride fades through black. */
#fade.black { background: #000; }
/* Debug menu (Tab). */
#debug {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 2;
  background: rgba(13, 22, 48, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  font: 13px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
#debug[hidden] { display: none; }
#debug ul { list-style: none; margin: 0; padding: 4px 0; max-height: calc(100vh - 26px); overflow-y: auto; }
#debug li { display: flex; align-items: center; gap: 8px; padding: 7px 16px 7px 10px; cursor: pointer; }
#debug li.sel, #debug li:hover { background: rgba(255, 255, 255, 0.1); }
#debug .box { width: 9px; height: 9px; border: 1.5px solid rgba(255, 255, 255, 0.8); border-radius: 2px; }
#debug li[aria-checked="true"] .box { background: #f4c542; border-color: #f4c542; }
#debug .box.dot { border-radius: 50%; }
/* HUD map: minimap top left, full map over a navy dim. */
.hudmap-mini {
  position: fixed;
  top: 12px;
  left: max(14px, env(safe-area-inset-left));
  pointer-events: none;
}
.hudmap-mini[hidden] { display: none; }
.hudmap-full {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: rgba(19, 36, 77, 0.5);
  pointer-events: none;
}
.hudmap-full[hidden] { display: none; }
.hudmap-full canvas { position: fixed; }
.hudmap-full canvas:first-child { border-radius: 4px; box-shadow: 0 0 0 3px #fff, 0 4px 18px rgba(0, 0, 0, 0.4); }
/* Laser notes (freecam): the red dot at screen centre, what it hits, the note box and the notes panel. */
.laser-dot {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: #ff2a2a;
  box-shadow: 0 0 6px 2px rgba(255, 40, 40, 0.75);
  pointer-events: none;
}
.laser-read {
  position: fixed;
  left: 50%;
  top: calc(50% + 12px);
  transform: translateX(-50%);
  font: 600 12px ui-monospace, Menlo, monospace;
  color: #fff;
  text-shadow: 0 1px 2px #13244d;
  white-space: nowrap;
  pointer-events: none;
}
.note-box {
  position: fixed;
  left: 50%;
  top: calc(50% + 34px);
  transform: translateX(-50%);
  z-index: 3;
  width: min(420px, calc(100vw - 32px));
  box-sizing: border-box;
  padding: 10px;
  background: rgba(13, 22, 48, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  font: 13px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.note-box label { display: block; margin-bottom: 6px; color: #ff8a8a; }
.note-box input {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 8px;
  font: inherit;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  outline: none;
  -webkit-user-select: text;
  user-select: text;
}
.note-box small, .notes-panel small { display: block; margin-top: 6px; opacity: 0.7; }
.notes-panel {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  width: 280px;
  max-height: 45vh;
  overflow-y: auto;
  padding: 8px 10px;
  background: rgba(13, 22, 48, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  font: 12px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.note-box[hidden], .notes-panel[hidden], .laser-dot[hidden], .laser-read[hidden] { display: none; }
.notes-head { display: flex; align-items: center; gap: 6px; }
.notes-head b { flex: 1; }
.notes-panel button {
  font: inherit;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  padding: 3px 7px;
  cursor: pointer;
}
.notes-panel ol { margin: 6px 0 0; padding-left: 22px; }
.notes-panel li { padding: 2px 0; }
.notes-panel li span { word-break: break-word; }
.notes-panel li button { margin-left: 6px; padding: 0 5px; }
