/* map/map.css — ORBIT NINE's only stylesheet.

   The scene IS the interface; the DOM carries chrome and nothing else. All of it
   lives here rather than in the page because this document is served under
   style-src 'self', which blocks both <style> blocks and style="" attributes.
   Font families are named stacks only — nothing is pulled from anywhere. */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #05030c;
  color: #eaf2ff;
  font-family: 'Segoe UI', Inter, system-ui, -apple-system, Helvetica, Arial, sans-serif;
}

canvas#stage {
  display: block;
  width: 100vw;
  height: 100vh;
  touch-action: none;
  cursor: grab;
}

body.is-pointing canvas#stage {
  cursor: pointer;
}

/* ------------------------------------------------------------------ boot -- */

/* The loading state. It is REMOVED, not faded, the instant scene.js composites
   its first frame: a fade would still be at full opacity in that same
   composited frame, which is precisely the frame a headless screenshot
   captures — so a transition here would hand a pixel gate a picture of the
   loading screen and call it the world. */

#boot {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  pointer-events: none;
  background:
    radial-gradient(58% 46% at 50% 46%, rgba(76, 29, 149, 0.5), rgba(5, 3, 12, 0) 72%),
    #05030c;
}

body:not(.is-booting) #boot {
  display: none;
}

#boot .ring {
  width: 54px;
  height: 54px;
  border: 2px solid rgba(139, 92, 246, 0.24);
  border-top-color: rgba(196, 181, 253, 0.95);
  border-radius: 50%;
  animation: boot-spin 1.15s linear infinite;
}

#boot .line {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: rgba(234, 242, 255, 0.9);
}

#boot .sub {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(184, 176, 208, 0.55);
}

@keyframes boot-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ------------------------------------------------------------------- hud -- */

/* THE HUD OWNS A SAFE AREA AND THE SCENE RESPECTS IT. Every element here is
   positioned against an edge rather than laid out in a flow, so the camera
   poses in stations.js can be solved against known no-go strips: the top-left
   corner and a bottom band. The station rail used to sit against the RIGHT
   edge, vertically centred — straight through the part of the frame where the
   hero pose puts the wallet slab and the card constellation. */

#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

#hud button {
  pointer-events: auto;
}

#brand {
  position: fixed;
  top: clamp(14px, 2.4vw, 30px);
  left: clamp(14px, 2.4vw, 30px);
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-shadow: 0 2px 22px rgba(5, 3, 12, 0.9);
}

#brand .mark {
  font-size: 20px;
  color: #c4b5fd;
}

#brand .name {
  font-size: clamp(15px, 1.5vw, 19px);
  font-weight: 700;
  letter-spacing: 0.26em;
}

#brand .sub {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(184, 176, 208, 0.7);
}

/* left/right:0 with justify-content, NOT left:50% + translateX(-50%): a fixed
   box anchored only on the left is shrink-to-fit against the space RIGHT of
   that anchor, so at left:50% the rail had half a viewport to lay six pills
   out in and wrapped onto two rows on a 1280-wide screen. */
#rail {
  position: fixed;
  bottom: clamp(14px, 2.4vw, 30px);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0 14px;
  gap: 8px;
}

#rail button {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 15px;
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: rgba(234, 242, 255, 0.72);
  background: rgba(11, 6, 24, 0.55);
  border: 1px solid rgba(139, 92, 246, 0.28);
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(9px);
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

#rail button .k {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  font-size: 11px;
  border-radius: 6px;
  color: rgba(196, 181, 253, 0.9);
  background: rgba(139, 92, 246, 0.16);
}

#rail button:hover,
#rail button:focus-visible {
  color: #ffffff;
  border-color: rgba(167, 139, 250, 0.75);
  background: rgba(46, 16, 101, 0.65);
  transform: translateY(-3px);
  outline: none;
}

#rail button.is-active {
  color: #ffffff;
  border-color: rgba(196, 181, 253, 0.95);
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.55), rgba(46, 16, 101, 0.65));
  box-shadow: 0 0 26px rgba(139, 92, 246, 0.35);
}

#hint {
  position: fixed;
  top: calc(clamp(14px, 2.4vw, 30px) + 30px);
  left: clamp(14px, 2.4vw, 30px);
  font-size: 12px;
  letter-spacing: 0.13em;
  color: rgba(184, 176, 208, 0.62);
  text-shadow: 0 2px 18px rgba(5, 3, 12, 0.95);
}

/* --------------------------------------------------------------- dialog -- */

#connect {
  width: min(440px, calc(100vw - 40px));
  padding: 30px 30px 26px;
  color: #eaf2ff;
  background:
    radial-gradient(120% 90% at 20% 0%, rgba(124, 58, 237, 0.42), rgba(124, 58, 237, 0) 62%),
    linear-gradient(160deg, rgba(20, 11, 42, 0.98), rgba(7, 4, 16, 0.99));
  border: 1px solid rgba(167, 139, 250, 0.42);
  border-radius: 20px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.72), 0 0 60px rgba(139, 92, 246, 0.18);
}

#connect::backdrop {
  background: rgba(5, 3, 12, 0.62);
  backdrop-filter: blur(3px);
}

#connect h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

#connect p {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(234, 242, 255, 0.82);
}

#connect .note {
  margin-top: 16px;
  font-size: 12px;
  line-height: 1.65;
  color: rgba(184, 176, 208, 0.66);
}

#connect-status {
  min-height: 20px;
  font-size: 13px;
  color: #c4b5fd;
}

#connect-go {
  width: 100%;
  margin-top: 20px;
  padding: 14px 18px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #ffffff;
  background: linear-gradient(100deg, #8b5cf6, #7c3aed 55%, #4c1d95);
  border: 1px solid rgba(196, 181, 253, 0.6);
  border-radius: 14px;
  cursor: pointer;
  transition: filter 0.18s ease, transform 0.18s ease;
}

#connect-go:hover,
#connect-go:focus-visible {
  filter: brightness(1.14);
  transform: translateY(-1px);
  outline: none;
}

#connect-go.is-armed {
  filter: saturate(0.7) brightness(0.9);
}

#connect-close {
  margin-top: 18px;
  padding: 9px 16px;
  font: inherit;
  font-size: 13px;
  color: rgba(234, 242, 255, 0.75);
  background: transparent;
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 999px;
  cursor: pointer;
}

#connect-close:hover,
#connect-close:focus-visible {
  color: #ffffff;
  border-color: rgba(167, 139, 250, 0.8);
  outline: none;
}

@media (max-width: 720px) {
  #rail button {
    padding: 8px 11px;
  }

  /* This targets the label WRAPPER. The rule that stood here before assumed a
     wrapper that did not exist — the label was a bare text node inside the
     button — so it matched nothing at all and the six pills kept their full
     103px width on a phone. The same missing wrapper also ran each button's
     accessible name together with its key hint. index.html now wraps every
     label, and both problems close together. */
  #rail button .n {
    display: none;
  }

  #hint {
    display: none;
  }
}
