/* PROXIMA // Galaxy map (js/galaxy.js). Styled after the Chasmhold system map:
   black hex-grid field, thin white lines, dashed rings, dark discs with bright
   rims, small uppercase labels; faction colours for ownership. */

.gx {
  --gx-panel: hsl(var(--th-bh) calc(13% * var(--th-bs)) 9%);
  --gx-raise: hsl(var(--th-bh) calc(12% * var(--th-bs)) 12.5%);
  --gx-line: hsl(var(--th-bh) calc(10% * var(--th-bs)) 21%);
  --gx-dim: #8f9993;
  --gx-accent: hsl(var(--th-h) calc(62% * var(--th-s)) calc(64% + var(--th-l)));
  --gx-soft: hsl(var(--th-h) calc(55% * var(--th-s)) calc(55% + var(--th-l)) / 0.14);
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: calc(100vh - 128px);
  min-height: 620px;
  color: #dde2dc;
  font-size: 13px;
}
.gx * {
  box-sizing: border-box;
}
.gx input,
.gx select,
.gx textarea {
  width: 100%;
  background: hsl(var(--th-bh) calc(14% * var(--th-bs)) 6.5%);
  border: 1px solid var(--gx-line);
  border-radius: 4px;
  color: #dde2dc;
  padding: 6px 8px;
  font-size: 12.5px;
  font-family: inherit;
}
.gx input[type='checkbox'] {
  width: auto;
}
.gx-muted {
  color: var(--gx-dim);
  font-size: 12px;
  margin: 4px 0;
}
.gx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 10px;
  border: 1px solid var(--gx-line);
  border-radius: 4px;
  background: var(--gx-raise);
  color: #dde2dc;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.gx-btn:hover {
  border-color: hsl(var(--th-bh) 10% 32%);
}
.gx-btn.on {
  border-color: var(--gx-accent);
  color: var(--gx-accent);
  background: var(--gx-soft);
}
.gx-btn.primary {
  background: hsl(var(--th-h) calc(45% * var(--th-s)) calc(30% + var(--th-l)));
  border-color: hsl(var(--th-h) calc(50% * var(--th-s)) calc(42% + var(--th-l)));
  color: #fff;
}
.gx-btn.danger {
  color: #e6a29b;
}
.gx-btn.wide {
  width: 100%;
  margin-top: 6px;
}
.gx-btn.icon {
  width: 26px;
  height: 26px;
  padding: 0;
  flex: none;
}
.gx-link {
  border: 0;
  background: none;
  color: var(--gx-accent);
  padding: 0;
  cursor: pointer;
  font-size: 12px;
}

/* toolbar */
.gx-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--gx-panel);
  border: 1px solid var(--gx-line);
  border-radius: 6px;
}
.gx-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font: 700 12px var(--head, inherit);
  letter-spacing: 1.4px;
  text-transform: uppercase;
}
.gx-crumbs button {
  border: 0;
  background: none;
  color: var(--gx-dim);
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  padding: 2px 0;
}
.gx-crumbs button:hover {
  color: #fff;
}
.gx-crumbs b {
  color: var(--gx-accent);
}
.gx-crumbs span {
  color: #555c58;
}
.gx-tools {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.gx-menu {
  position: relative;
}
.gx-menu > summary {
  list-style: none;
}
.gx-menu > summary::-webkit-details-marker {
  display: none;
}
.gx-menu > div {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  display: grid;
  gap: 6px;
  padding: 8px;
  min-width: 220px;
  background: var(--gx-raise);
  border: 1px solid var(--gx-line);
  border-radius: 6px;
  box-shadow: 0 10px 30px #000a;
}

/* layout */
.gx-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 300px;
  gap: 10px;
}
.gx-left,
.gx-right {
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
}
.gx-sec {
  background: var(--gx-panel);
  border: 1px solid var(--gx-line);
  border-radius: 6px;
  padding: 11px 12px;
}
.gx-sec h4 {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 0 0 8px;
  font: 700 11.5px var(--head, inherit);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--gx-accent);
}
.gx-sec h4 small {
  margin-left: auto;
  color: var(--gx-dim);
  font-weight: 500;
  letter-spacing: 0;
}
.gx-list {
  display: grid;
  gap: 2px;
  max-height: 240px;
  overflow: auto;
  margin-top: 6px;
  scrollbar-width: thin;
}
.gx-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 4px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
  width: 100%;
}
.gx-row:hover {
  background: var(--gx-raise);
}
.gx-row > span:last-child {
  display: grid;
  min-width: 0;
}
.gx-row b {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gx-row small {
  color: var(--gx-dim);
  font-size: 11px;
}
.gx-swatch {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}
.gx-check {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 0;
  cursor: pointer;
}
.gx-legend {
  display: grid;
  gap: 5px;
  font-size: 12px;
}
.gx-legend span {
  display: flex;
  align-items: center;
  gap: 7px;
}
.gx-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.gx-legend i.cap {
  background: none;
  border: 1.5px solid #f4ead2;
  box-shadow: 0 0 6px #f4ead2;
}
.gx-legend small {
  color: var(--gx-dim);
}
.gx-logbox > summary {
  list-style: none;
  cursor: pointer;
}
.gx-logbox > summary h4 {
  margin: 0;
}
.gx-logbox p {
  margin: 5px 0 0;
  font-size: 12px;
  color: #c3cac4;
}
.gx-logbox p small {
  color: var(--gx-dim);
  margin-right: 6px;
}

/* the map */
.gx-stage {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gx-frame {
  flex: 1;
  min-height: 0;
  position: relative;
  border-radius: 34px;
  border: 2px solid #b9bcc2;
  box-shadow:
    0 0 0 6px #2e313a,
    0 0 0 8px #555a64;
  background: #060507;
  overflow: hidden;
  margin: 8px;
}
.gx-svg {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.gx-svg:active {
  cursor: grabbing;
}
.gx-svg.placing {
  cursor: crosshair;
}
.gx-status {
  padding: 0 14px;
  color: var(--gx-dim);
  font-size: 12px;
}
.gx-bg {
  fill: #070608;
}
.gx-hexline {
  fill: none;
  stroke: #ffffff;
  stroke-opacity: 0.065;
  stroke-width: 1;
}
.gx-stars circle {
  fill: #fff;
}
.gx-region,
.gx-lanes,
.gx-orbits,
.gx-sun,
.gx-stars {
  pointer-events: none;
}
.gx-region {
  fill: none;
  stroke: #fff;
  stroke-opacity: 0.38;
  stroke-width: 1.5;
  stroke-dasharray: 7 7;
}
.gx-region-label {
  font: 800 24px var(--head, sans-serif);
  letter-spacing: 4px;
  text-transform: uppercase;
  fill: #8a8d92;
  fill-opacity: 0.32;
  pointer-events: none;
}
.gx-svg.v-galaxy .gx-region-label {
  font-size: 50px;
  letter-spacing: 6px;
}
.gx-region-sub {
  font: 600 26px var(--head, sans-serif);
  letter-spacing: 3px;
  fill: #8a8d92;
  fill-opacity: 0.4;
  pointer-events: none;
}
.gx-sector-label.big {
  font-size: 40px;
  fill-opacity: 0.35;
  letter-spacing: 4px;
}
.gx-lanes.dead line {
  stroke: #ff5a52;
  stroke-opacity: 0.35;
  stroke-dasharray: 8 8;
}
.gx-relay-off {
  fill: #050506;
  stroke: #ff4f47;
  stroke-width: 3;
  stroke-dasharray: 4 3;
}
.gx-relay-off-dot {
  fill: #ff4f47;
}
.gx-sky {
  pointer-events: none;
}
.gx-region-label.small {
  font-size: 70px;
  fill-opacity: 0.5;
  paint-order: stroke;
  stroke: #000;
  stroke-width: 6px;
}
.gx-sector-label {
  font: 700 26px var(--head, sans-serif);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  fill: #7d8187;
  pointer-events: none;
}
.gx-lanes line {
  stroke: #fff;
  stroke-opacity: 0.22;
  stroke-width: 1.4;
}
.gx-orbit {
  fill: none;
  stroke: #f2f2f2;
  stroke-opacity: 0.8;
  stroke-width: 2.4;
}
.gx-orbit-dash {
  fill: none;
  stroke: #fff;
  stroke-opacity: 0.35;
  stroke-width: 1.2;
  stroke-dasharray: 5 6;
}
.gx-node {
  cursor: pointer;
}
.gx-editing .gx-node {
  cursor: move;
}
.gx-ring {
  fill: #050506;
  stroke: #f4f4f4;
  stroke-width: 3;
}
.gx-ring-dash {
  fill: none;
  stroke-width: 2.4;
  stroke-dasharray: 5 4;
}
.gx-dot {
  fill: #f4f4f4;
}
.gx-disc {
  fill: #f4f4f4;
}
.gx-node.k-installation .gx-dot {
  fill: #050506;
}
.gx-line {
  fill: none;
  stroke: #f4f4f4;
  stroke-width: 3;
  stroke-linecap: round;
}
.gx-hexbody {
  stroke: #f4f4f4;
  stroke-width: 2.4;
}
.gx-body {
  stroke: #f6e9e9;
  stroke-width: 3;
}
.gx-body.sun {
  stroke-width: 4;
  filter: drop-shadow(0 0 16px rgba(255, 220, 200, 0.35));
}
.gx-body.world {
  stroke-width: 4;
}
.gx-halo {
  fill: none;
  stroke: #fff;
  stroke-opacity: 0.55;
  stroke-width: 1.4;
}
.gx-site {
  fill: #050506;
  stroke-width: 3;
}
.gx-zone {
  pointer-events: none;
}
.gx-capital {
  fill: none;
  stroke-width: 2;
  stroke-opacity: 0.85;
  filter: drop-shadow(0 0 6px currentColor);
}
.gx-star {
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.6));
}
.gx-node.home .gx-capital {
  stroke-width: 3.5;
  stroke-opacity: 1;
  filter: drop-shadow(0 0 10px #fff) drop-shadow(0 0 18px currentColor);
  animation: gx-home 2.8s ease-in-out infinite;
}
@keyframes gx-home {
  50% {
    stroke-opacity: 0.55;
  }
}
.gx-selring {
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-dasharray: 3 5;
}
.gx-label {
  font: 700 13px var(--head, sans-serif);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  fill: #f2f2f2;
  paint-order: stroke;
  stroke: #050506;
  stroke-width: 4px;
  pointer-events: none;
}
.gx-svg:not(.v-galaxy) .gx-label {
  font-size: 15px;
}
.gx-svg.v-system .gx-label,
.gx-svg.v-body .gx-label {
  font-size: 26px;
}
.gx-svg.v-system .gx-sub,
.gx-svg.v-body .gx-sub {
  font-size: 16px;
}
.gx-sub {
  font: 500 10px var(--font, sans-serif);
  fill: #cfcfcf;
  paint-order: stroke;
  stroke: #050506;
  stroke-width: 4px;
  pointer-events: none;
}
.gx-node.sel .gx-label {
  fill: var(--gx-accent);
}
.gx-fleet path {
  stroke: #050506;
  stroke-width: 1.5;
}
.gx-fleet text {
  font: 800 11px sans-serif;
  fill: #fff;
  paint-order: stroke;
  stroke: #000;
  stroke-width: 3px;
}
.gx-event path {
  fill: hsl(42 90% 58%);
  stroke: #050506;
  stroke-width: 1.5;
}
.gx-event text {
  font: 900 10px sans-serif;
  fill: #111;
  text-anchor: middle;
}
.gx-event-pulse {
  fill: none;
  stroke: hsl(42 90% 58%);
  stroke-width: 2;
  animation: gx-pulse 2s ease-out infinite;
  transform-origin: center;
  transform-box: fill-box;
}
@keyframes gx-pulse {
  from {
    opacity: 0.8;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(2.6);
  }
}
@media (prefers-reduced-motion: reduce) {
  .gx-event-pulse,
  .gx-node.home .gx-capital {
    animation: none;
  }
}
.gx-bookmark {
  fill: hsl(48 80% 62%);
  stroke: #050506;
  stroke-width: 1.5;
}

/* side panel */
.gx-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.gx-head img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  flex: none;
}
.gx-head > div {
  display: grid;
  gap: 5px;
  min-width: 0;
  flex: 1;
}
.gx-head small {
  color: var(--gx-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 10.5px;
}
.gx-head h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.gx-head p {
  margin: 0;
  color: #b9c0ba;
  font-size: 12px;
}
.gx-capline {
  color: hsl(48 70% 72%) !important;
}
.gx-name {
  font-weight: 800 !important;
  font-size: 15px !important;
}
.gx-actions {
  display: flex;
  gap: 6px;
}
.gx-actions .gx-btn {
  flex: 1;
}
.gx-form {
  display: grid;
  gap: 6px;
}
.gx-eventcard {
  display: grid;
  gap: 6px;
  padding: 9px 10px;
  border-left: 3px solid hsl(42 90% 58%);
  background: hsl(42 30% 12%);
  border-radius: 4px;
}
.gx-eventcard p {
  margin: 0;
  color: #d9d2bd;
  font-size: 12px;
}
.gx-fleetrow {
  display: grid;
  grid-template-columns: 9px 1fr 118px 26px;
  align-items: center;
  gap: 7px;
  padding: 5px 0;
  border-bottom: 1px solid hsl(var(--th-bh) calc(10% * var(--th-bs)) 15%);
}
.gx-fleetinfo {
  display: grid;
  min-width: 0;
}
.gx-fleetinfo small {
  color: var(--gx-dim);
  font-size: 11px;
}
.gx-fleetrow select {
  padding: 4px;
  font-size: 11.5px;
}
.gx-addfleet {
  margin-top: 8px;
}
.gx-addfleet > summary {
  cursor: pointer;
  color: var(--gx-accent);
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 6px;
}
.gx-lbl {
  display: grid;
  gap: 3px;
  font-size: 11px;
  color: var(--gx-dim);
  margin-bottom: 6px;
}

@media (max-width: 1250px) {
  .gx {
    height: auto;
  }
  .gx-body {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
  .gx-left {
    grid-column: 1 / -1;
    order: 3;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    align-items: start;
  }
  .gx-stage {
    height: calc(100vh - 200px);
    min-height: 520px;
  }
}
@media (max-width: 820px) {
  .gx-body {
    grid-template-columns: 1fr;
  }
  .gx-stage {
    height: 70vh;
  }
  .gx-frame {
    border-radius: 18px;
  }
}
