@font-face {
  font-family: "Plumbers Display";
  src: url("../assets/fonts/ArchivoBlack-Regular.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Plumbers Work";
  src: url("../assets/fonts/BarlowSemiCondensed-SemiBold.ttf") format("truetype");
  font-display: swap;
  font-weight: 600;
}

@font-face {
  font-family: "Plumbers Work";
  src: url("../assets/fonts/BarlowSemiCondensed-Black.ttf") format("truetype");
  font-display: swap;
  font-weight: 900;
}

:root {
  color-scheme: dark;
  --navy: #091727;
  --cream: #fff1c2;
  --paper: #f4e7cb;
  --copper: #c5733f;
  --copper-light: #efaa62;
  --gold: #f2c44e;
  --red: #cf5747;
  --blue: #62a6ba;
}

* { box-sizing: border-box; }

html,
body { min-height: 100%; }

body {
  margin: 0;
  color: var(--cream);
  background: #070c12;
  font-family: "Plumbers Work", "Arial Narrow", sans-serif;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100% - 32px), 1600px);
  min-height: 64px;
  gap: 24px;
  margin: 14px auto;
  padding: 10px 12px 10px 18px;
  color: #17263c;
  background: #fffaf0;
  border-radius: 15px;
}

.preview-toolbar div,
.preview-toolbar nav { display: flex; align-items: center; }
.preview-toolbar div { gap: 12px; }
.preview-toolbar div b { font-family: "Plumbers Display", sans-serif; font-size: 0.82rem; }
.preview-toolbar div span { color: #68717c; font-size: 0.72rem; }
.preview-toolbar nav { gap: 7px; }
.preview-toolbar a {
  min-width: 74px;
  padding: 8px 13px;
  color: #fff3ba;
  background: linear-gradient(#bd794a, #86482e);
  border: 2px solid #7e432b;
  border-radius: 9px;
  box-shadow: inset 0 1px rgb(255 255 255 / 35%), 0 3px 0 #572e20;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
}

.map-viewport {
  width: 100%;
  padding: 0 16px 20px;
  overflow-x: auto;
}

.system-map {
  position: relative;
  width: min(1600px, 100%);
  min-width: 1000px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  margin: 0 auto;
  background:
    radial-gradient(circle at 50% 50%, rgb(28 55 78 / 46%), transparent 58%),
    linear-gradient(135deg, rgb(255 255 255 / 2%), transparent 42%),
    #07111d;
  border: 1px solid rgb(218 144 83 / 28%);
  box-shadow: 0 24px 70px rgb(0 0 0 / 48%), inset 0 0 70px rgb(0 0 0 / 42%);
}

.system-map__surface {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgb(93 136 164 / 8%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(93 136 164 / 8%) 1px, transparent 1px),
    linear-gradient(rgb(93 136 164 / 3%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(93 136 164 / 3%) 1px, transparent 1px);
  background-position: center;
  background-size: 80px 80px, 80px 80px, 16px 16px, 16px 16px;
  opacity: 0.75;
}

.system-map__heading {
  position: absolute;
  top: 5.2%;
  left: 5.1%;
  z-index: 4;
  display: grid;
  max-width: 64%;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  gap: 0 19px;
}

.system-map__heading p,
.system-map__heading h1,
.system-map__heading span { margin: 0; }
.system-map__heading p {
  grid-column: 1 / -1;
  margin-bottom: 3px;
  color: var(--copper-light);
  font-size: clamp(0.55rem, 0.7vw, 0.72rem);
  font-weight: 900;
  letter-spacing: 0.16em;
}
.system-map__heading h1 {
  color: var(--cream);
  font-family: "Plumbers Display", sans-serif;
  font-size: clamp(1.5rem, 2.65vw, 2.7rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 0.95;
}
.system-map__heading span {
  max-width: 430px;
  padding-bottom: 2px;
  color: rgb(255 241 194 / 62%);
  font-size: clamp(0.55rem, 0.82vw, 0.82rem);
  font-weight: 600;
  line-height: 1.1;
}

.system-map__pipes,
.system-map__nodes,
.system-map__labels {
  position: absolute;
  inset: 0;
}

.system-map__pipes { z-index: 1; }
.system-map__labels { z-index: 2; pointer-events: none; }
.system-map__nodes { z-index: 3; }

.system-pipe path {
  fill: none;
  stroke-linecap: square;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.system-pipe__shadow { stroke: #03070b; stroke-width: 20; opacity: 0.94; }
.system-pipe__body { stroke: #b96738; stroke-width: 13; }
.system-pipe__shine { stroke: rgb(255 207 139 / 58%); stroke-width: 2.8; transform: translateY(-2px); }
.system-pipe.is-planned { opacity: 0.62; stroke-dasharray: 8 6; }

.pipe-junction circle { vector-effect: non-scaling-stroke; }
.pipe-junction__shadow { fill: #03070b; stroke: #03070b; stroke-width: 5; }
.pipe-junction__body {
  fill: #a85b35;
  stroke: #e5a061;
  stroke-width: 2.5;
}
.pipe-junction__rim { fill: #67351f; stroke: #f0b26e; stroke-width: 2; }
.pipe-junction__bolt { fill: #f8ca83; stroke: #3b1d13; stroke-width: 1.5; }

.pipe-label {
  position: absolute;
  z-index: 2;
  padding: 3px 7px;
  color: #ffe0a8;
  background: rgb(6 16 28 / 93%);
  border: 1px solid rgb(255 241 194 / 18%);
  border-radius: 4px;
  font-size: clamp(0.42rem, 0.56vw, 0.58rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-align: center;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}
.pipe-label.is-planned { color: #d5b5ad; border-style: dashed; }

.system-node {
  position: absolute;
  min-height: 15.5%;
  padding: 1.15% 1.25%;
  color: var(--cream);
  background:
    linear-gradient(145deg, rgb(255 255 255 / 7%), transparent 48%),
    rgb(9 23 39 / 94%);
  border: 2px solid rgb(205 126 71 / 64%);
  border-radius: clamp(8px, 0.9vw, 14px);
  box-shadow: 0 9px 18px rgb(0 0 0 / 42%), inset 0 0 0 1px rgb(255 255 255 / 4%);
  transform: translateY(0);
}

.system-node__port {
  position: absolute;
  left: 50%;
  width: 24px;
  height: 11px;
  background: linear-gradient(#6f3e25, #e0a25d 42%, #754128);
  border: 2px solid #3d2519;
  border-radius: 3px;
  transform: translateX(-50%);
}
.system-node__port--top { top: -8px; }
.system-node__port--bottom { bottom: -8px; }

.system-node__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.system-node__topline span,
.system-node__topline b {
  font-size: clamp(0.42rem, 0.58vw, 0.59rem);
  font-weight: 900;
  letter-spacing: 0.13em;
}
.system-node__topline span { color: var(--copper-light); }
.system-node__topline b {
  padding: 3px 6px;
  color: #18263a;
  background: var(--gold);
  border-radius: 4px;
}
.system-node h2 {
  margin: 5.5% 0 2.5%;
  font-family: "Plumbers Display", sans-serif;
  font-size: clamp(0.78rem, 1.32vw, 1.32rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1;
}
.system-node p {
  margin: 0;
  color: rgb(255 241 194 / 68%);
  font-size: clamp(0.48rem, 0.7vw, 0.71rem);
  font-weight: 600;
  line-height: 1.18;
}
.system-node > i {
  position: absolute;
  right: 5%;
  bottom: 8%;
  width: 7px;
  height: 7px;
  background: #64c694;
  border-radius: 50%;
  box-shadow: 0 0 8px #64c694;
}

.system-node--hero {
  color: #17263c;
  background: linear-gradient(145deg, #fff0a7, #d99e3f);
  border-color: #ffd968;
  box-shadow: 0 11px 24px rgb(209 135 44 / 30%);
}
.system-node--hero .system-node__topline span,
.system-node--hero p { color: rgb(23 38 60 / 75%); }
.system-node--hero .system-node__topline b { color: #fff2c4; background: #17263c; }
.system-node--paper { color: #17263c; background: linear-gradient(145deg, #fff4d2, #d8c7a3); }
.system-node--paper .system-node__topline span,
.system-node--paper p { color: rgb(23 38 60 / 70%); }
.system-node--gold { border-color: var(--gold); }
.system-node--copper { border-color: var(--copper-light); background: rgb(44 29 30 / 95%); }
.system-node--red { border-color: var(--red); background: rgb(47 27 38 / 96%); }
.system-node--planned { border-style: dashed; border-color: rgb(255 241 194 / 40%); }
.system-node--planned .system-node__topline b { color: var(--cream); background: #7c5560; }
.system-node--planned > i { background: #c1a7a1; box-shadow: none; }

.system-map__legend {
  position: absolute;
  right: 5%;
  bottom: 3.5%;
  left: 5%;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 1.55%;
  padding-top: 0.8%;
  border-top: 1px solid rgb(255 241 194 / 19%);
}
.system-map__legend span,
.system-map__legend b {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: clamp(0.42rem, 0.57vw, 0.59rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.system-map__legend span { color: rgb(255 241 194 / 64%); }
.system-map__legend b { margin-left: auto; color: var(--gold); }
.legend-swatch {
  width: 22px;
  height: 6px;
  background: linear-gradient(#e8a062, #9c4f2c);
  border-radius: 4px;
  box-shadow: 0 0 0 2px #24130d;
}

body.is-exporting .preview-toolbar { display: none; }
body.is-exporting .map-viewport { padding: 0; }
body.is-exporting .system-map { width: 1600px; min-width: 1600px; }

@media (max-width: 720px) {
  .preview-toolbar { align-items: stretch; flex-direction: column; gap: 9px; }
  .preview-toolbar div { justify-content: space-between; }
  .preview-toolbar div span { display: none; }
  .preview-toolbar nav { display: grid; grid-template-columns: repeat(3, 1fr); }
  .preview-toolbar a { min-width: 0; }
}


.global-nav__casino {
  position: relative;
  isolation: isolate;
}

.global-nav__casino-lights {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  pointer-events: none;
}

.global-nav__casino-lights i {
  position: absolute;
  display: block;
  width: 4px;
  height: 4px;
  background: #ffe88d;
  border: 1px solid #753615;
  border-radius: 50%;
  box-shadow: 0 0 2px rgb(255 217 87 / 32%);
  opacity: 0.24;
  animation: global-nav-casino-chase 1.6s linear infinite;
}

.global-nav__casino-lights i:nth-child(1) { top: 2px; left: 18%; transform: translate(-50%, -50%); }
.global-nav__casino-lights i:nth-child(2) { top: 2px; left: 50%; animation-delay: -1.4s; transform: translate(-50%, -50%); }
.global-nav__casino-lights i:nth-child(3) { top: 2px; left: 82%; animation-delay: -1.2s; transform: translate(-50%, -50%); }
.global-nav__casino-lights i:nth-child(4) { top: 50%; right: 2px; animation-delay: -1s; transform: translate(50%, -50%); }
.global-nav__casino-lights i:nth-child(5) { bottom: 2px; left: 82%; animation-delay: -0.8s; transform: translate(-50%, 50%); }
.global-nav__casino-lights i:nth-child(6) { bottom: 2px; left: 50%; animation-delay: -0.6s; transform: translate(-50%, 50%); }
.global-nav__casino-lights i:nth-child(7) { bottom: 2px; left: 18%; animation-delay: -0.4s; transform: translate(-50%, 50%); }
.global-nav__casino-lights i:nth-child(8) { top: 50%; left: 2px; animation-delay: -0.2s; transform: translate(-50%, -50%); }

@keyframes global-nav-casino-chase {
  0%, 11% {
    background: #fffbd2;
    box-shadow: 0 0 4px #fff4a8, 0 0 9px #ffc539;
    opacity: 1;
  }
  12%, 100% {
    background: #c37a25;
    box-shadow: 0 0 2px rgb(255 197 57 / 22%);
    opacity: 0.24;
  }
}

@media (prefers-reduced-motion: reduce) {
  .global-nav__casino-lights i {
    animation: none;
    opacity: 0.58;
  }
}
