:root {
  --bg: #080b10;
  --panel: #10151e;
  --surface: #151d29;
  --line: #283443;
  --text: #edf1f7;
  --muted: #a4b1c1;
  --quiet: #8294a8;
  --accent: #f4c97c;
  --ink: #231806;
  --blue: #a2d1eb;
  --hostile: #ff8b83;
  --success: #94dcc6;
  --edge: 8px;
  --display: Bahnschrift, "Arial Narrow", "Segoe UI", sans-serif;
  --mono: "Cascadia Mono", Consolas, monospace;
  color-scheme: dark;
  font: 14px/1.45 "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { color: var(--text); background: var(--bg); }
[hidden] { display: none !important; }
button, select, input, output { color: inherit; font: inherit; }
button, select, input, summary { -webkit-tap-highlight-color: transparent; }
button, select, input {
  min-height: 38px;
  padding: .5rem .75rem;
  border: 1px solid var(--line);
  border-radius: var(--edge);
  background: var(--surface);
}
button, summary { cursor: pointer; }
button:hover, summary:hover { border-color: #74879a; background-color: #202d3c; }
button:disabled { opacity: .5; cursor: default; }
button[aria-pressed="true"], .primary {
  color: var(--ink);
  border-color: var(--accent);
  background: var(--accent);
  font-weight: 700;
}
.primary:hover, button[aria-pressed="true"]:hover { color: var(--ink); background-color: #ffdc9e; border-color: #ffdc9e; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[data-empty]:empty::before { content: attr(data-empty); color: var(--muted); }

.menu {
  --menu-gold: #e8b571;
  --menu-line: #85705a78;
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: end;
  isolation: isolate;
  padding: clamp(2rem, 5.2vw, 6.75rem);
  background: #090b0f;
}
.menu::before, .menu::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}
.menu::before {
  background:
    linear-gradient(90deg, #090b10 0%, #090b10e6 18%, #090b1033 51%, transparent 78%),
    linear-gradient(0deg, #090b10 0%, #090b10c4 15%, transparent 56%),
    url("/releases/diaspora-20261202-ba87386c/art/expedition-title.webp") 65% 41% / cover no-repeat;
}
.menu::after {
  inset: clamp(.75rem, 1.6vw, 1.8rem);
  border: 1px solid #ceb9903f;
  mask: conic-gradient(at 24px 24px, transparent 75%, #000 0) 0 0 / calc(100% - 24px) calc(100% - 24px);
}
.menu-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(275px, 355px);
  gap: clamp(1.5rem, 5vw, 5.5rem);
  align-items: end;
  width: 100%;
  max-width: 91rem;
  margin-inline: auto;
}
.menu-heading { min-width: 0; }
.wordmark {
  margin: 0 0 clamp(1.8rem, 5vh, 3.4rem);
  text-transform: uppercase;
}
.wordmark small {
  display: block;
  margin-bottom: .9rem;
  padding-left: .38em;
  color: #d5c9b7;
  font: 650 clamp(.72rem, 1.25vw, 1.02rem)/1 var(--display);
  letter-spacing: .46em;
}
.wordmark b { color: var(--menu-gold); }
.wordmark > span {
  display: block;
  width: max-content;
  max-width: 100%;
  color: #f8f1e5;
  font: 800 clamp(4rem, 9vw, 10rem)/.85 var(--display);
  letter-spacing: -.064em;
  background: linear-gradient(#fcf7ee 14%, #f4e8d3 62%, #b8a791 100%);
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.menu-modes { display: grid; justify-items: start; gap: 1px; }
.menu-modes button {
  display: flex;
  align-items: center;
  gap: .85rem;
  width: clamp(15rem, 28vw, 23rem);
  min-height: 52px;
  padding: .4rem .8rem .4rem 0;
  border: 0;
  border-bottom: 1px solid #c6b89a28;
  border-radius: 0;
  color: #b9b9b3;
  background: transparent;
  text-align: left;
  font: 650 clamp(1.15rem, 2.05vw, 1.55rem)/1 var(--display);
  text-transform: uppercase;
  letter-spacing: .075em;
}
.menu-modes button::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-inline: .43rem .35rem;
  border: 1px solid #a6a294;
  rotate: 45deg;
}
.menu-modes button:hover { color: #fff8e8; background: linear-gradient(90deg, #a8804626, transparent); }
.menu-modes button[aria-pressed="true"] {
  color: #ffe2b6;
  background: linear-gradient(90deg, #d5994938, #d5994905);
  border-bottom-color: #c98c41b0;
}
.menu-modes button[aria-pressed="true"]::before { background: var(--menu-gold); border-color: var(--menu-gold); box-shadow: 0 0 14px #e8b5718a; }
#btn-load-game {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  min-height: 42px;
  margin-top: .9rem;
  padding-left: .42rem;
  border: 0;
  background: transparent;
  color: #d2cbbe;
  font-size: .93rem;
}
#btn-load-game span { color: var(--menu-gold); }
#btn-load-game:hover { color: #ffe4b8; }
.launch-block {
  display: grid;
  min-width: 0;
  gap: 1rem;
  padding: clamp(1rem, 2.25vw, 1.7rem);
  border: 1px solid var(--menu-line);
  border-top: 2px solid var(--menu-gold);
  border-radius: 0;
  background: linear-gradient(133deg, #25241ff7, #12171efc 86%);
  box-shadow: 0 14px 46px #0008;
}
.briefing-heading p { margin: 0; }
#briefing-mode { color: var(--menu-gold); font: 600 .74rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: .13em; }
#briefing-title { margin: .45rem 0 .38rem; color: #f6efe3; font: 700 clamp(1.7rem, 3vw, 2.4rem)/.98 var(--display); letter-spacing: -.018em; }
#briefing-copy { color: #ccd1d1; font-size: .95rem; line-height: 1.45; }
.setup-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.menu-field { display: grid; min-width: 0; gap: .32rem; color: #c4bfb3; font: .72rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.menu-field input, .menu-field select, .seat select {
  width: 100%;
  min-width: 0;
  border-color: #544b42;
  border-radius: 2px;
  background: #15191d;
  color: var(--text);
  font: 14px/1.25 "Segoe UI", sans-serif;
  letter-spacing: normal;
  text-transform: none;
}
.setup > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 37px;
  padding: .35rem 0;
  border-block: 1px solid #81746067;
  list-style: none;
  color: #e0d4c0;
  font-size: .91rem;
}
.setup > summary:hover { color: #ffe5b8; background: transparent; }
.setup > .menu-field { margin-top: .55rem; }
.setup > summary::-webkit-details-marker, #stockpile summary::-webkit-details-marker { display: none; }
.setup > summary::after, #stockpile > summary::after {
  content: "";
  width: .38rem;
  height: .38rem;
  margin: -.2rem .15rem 0 .15rem;
  border: solid currentColor;
  border-width: 0 1px 1px 0;
  rotate: 45deg;
}
details[open] > summary::after { rotate: 225deg; margin-top: .15rem; }
#seat-list { display: grid; gap: .34rem; margin-top: .55rem; }
.seat { display: grid; grid-template-columns: auto 1fr minmax(7rem, 1.25fr); align-items: center; gap: .5rem; min-width: 0; font-size: .84rem; }
.seat-swatch { width: 7px; height: 7px; rotate: 45deg; background: var(--seat-color); }
.seat select { min-height: 32px; padding: .25rem .46rem; }
.launch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 48px;
  border: 1px solid #ffe0ab;
  border-radius: 2px;
  background: linear-gradient(110deg, #f9d394, #e6ad67);
  color: #1f160f;
  text-align: left;
  font: 750 .98rem/1.1 var(--display);
  letter-spacing: .065em;
  text-transform: uppercase;
}
.launch:hover { background: #ffdc9e; }
.launch > span:last-child { font-size: 1.25rem; }
#menu-status, #resume-status { margin: .55rem 0 0; color: #ffd49a; font-size: .84rem; }
#menu-status:empty, #resume-status:empty { display: none; }

.game {
  --panel: #11181c;
  --surface: #1a252a;
  --line: #405054;
  --accent: #edc38a;
  --blue: #a6e0d1;
  --edge: 2px;
  display: grid;
  height: 100svh;
  min-height: 460px;
  grid-template:
    "top top" auto
    "map side" minmax(0, 1fr)
    "orders side" auto
    / minmax(0, 1fr) clamp(350px, 32vw, 460px);
}
#topbar {
  grid-area: top;
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: clamp(.55rem, 1.4vw, 1.4rem);
  min-width: 0;
  min-height: 70px;
  padding: .6rem clamp(.65rem, 1.7vw, 1.6rem);
  border-bottom: 1px solid #64706b;
  background: linear-gradient(100deg, #232520 0, #141e22 30%, #151d20 100%);
}
.command-brand { display: flex; align-items: center; gap: .75rem; min-width: 0; margin-right: auto; }
.command-brand > div { min-width: 0; }
.brand {
  display: grid;
  grid-auto-flow: column;
  place-content: center;
  width: 48px;
  height: 41px;
  flex: none;
  padding-right: 3px;
  border: 0;
  clip-path: polygon(13% 0, 100% 0, 87% 100%, 0 100%);
  background: linear-gradient(135deg, #4a3a28, #2a2e2a);
  color: #f5f0e4;
  font: 750 1.28rem/1 var(--display);
}
.brand b { color: var(--accent); }
#status-mission, .empire { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#status-mode { display: block; margin-bottom: .15rem; color: #bdb099; font: .64rem/1 var(--mono); text-transform: uppercase; letter-spacing: .095em; }
#status-mode:empty { display: none; }
#status-mission { font: 700 1.25rem/1.1 var(--display); letter-spacing: .045em; text-transform: uppercase; }
.empire { margin-top: .23rem; color: var(--seat-accent, var(--muted)); font-size: .8rem; }
.metrics { display: flex; gap: clamp(.75rem, 1.8vw, 1.7rem); align-items: center; flex: none; margin: 0; }
.metrics > div { padding-inline-start: .72rem; border-inline-start: 1px solid #636f6380; }
.metrics dt { color: #b6c5c2; font: .66rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: .045em; }
.metrics dd { margin: .2rem 0 0; color: #f1f0eb; font: 650 1rem/1 var(--mono); }
#stockpile { position: relative; flex: none; }
#stockpile > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .33rem;
  min-height: 38px;
  padding: .45rem .55rem;
  border: 1px solid var(--line);
  border-radius: var(--edge);
  background: #1b292c;
  list-style: none;
  font-size: .83rem;
}
#stockpile > summary:hover { background: #32413d; }
.resources {
  position: absolute;
  right: 0;
  top: calc(100% + 9px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .42rem;
  width: min(34rem, 84vw);
  margin: 0;
  padding: .85rem;
  max-height: 62svh;
  overflow: auto;
  border: 1px solid #536962;
  border-radius: var(--edge);
  background: #1b282a;
  box-shadow: 0 1rem 2.8rem #000a;
}
.resources > div { display: flex; justify-content: space-between; align-items: baseline; gap: .55rem; padding: .42rem .45rem; border-bottom: 1px solid #435351; }
.resources dt { color: var(--muted); font-size: .83rem; }
.resources dd { margin: 0; color: var(--accent); font: 600 .76rem/1 var(--mono); }
.time, .session-tools { display: flex; align-items: center; gap: .35rem; flex: none; }
.time .date { min-width: 3.45rem; color: var(--text); font: 600 .85rem/1 var(--mono); text-align: center; }
.time button, .session-tools button { padding-inline: .65rem; font-size: .79rem; }
#btn-speed-down, #btn-speed-up { width: 33px; min-height: 33px; padding: 0; }
#speed-label { min-width: 2.1rem; color: var(--blue); text-align: center; font: .77rem/1 var(--mono); }
#btn-pause { min-width: 5.05rem; }

#map-stage {
  grid-area: map;
  container-type: size;
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: clip;
  background-image: radial-gradient(ellipse at 50% 44%, #0a151719, #03070875 67%, #030708c7), url("/releases/diaspora-20261202-ba87386c/art/vale-dust.webp");
  background-color: #070c10;
  background-position: center, center 56%;
  background-size: cover;
}
#map-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at center, #b7d7c624 .65px, transparent 1px) center / 24px 24px,
    linear-gradient(#c2d5be10 1px, transparent 1px) center / 96px 96px,
    linear-gradient(90deg, #c2d5be10 1px, transparent 1px) center / 96px 96px;
}
#map-frame {
  --map-aspect: 1.6;
  position: relative;
  width: min(100cqw, 100cqh * var(--map-aspect));
  aspect-ratio: var(--map-aspect);
  transform-origin: 50% 50%;
}
#galaxy-canvas { display: block; width: 100%; height: 100%; }
#map-stage[data-zoomed] { cursor: grab; touch-action: none; }
#map-stage[data-dragging] { cursor: grabbing; }
.atlas-header {
  position: absolute;
  pointer-events: none;
  top: 1.4rem;
  left: 1.5rem;
  padding-left: .82rem;
  border-left: 3px solid var(--accent);
  text-shadow: 0 2px 8px #050707, 0 0 14px #050707;
}
.atlas-header h2 { margin: 0 0 .19rem; font: 700 clamp(1.25rem, 2.2vw, 2rem)/1 var(--display); letter-spacing: .075em; text-transform: uppercase; }
#atlas-summary { color: #c1cdcb; font: .74rem/1.3 var(--mono); }
.sector-clock {
  position: absolute;
  top: 1.4rem;
  right: 1.4rem;
  display: grid;
  justify-items: end;
  gap: .24rem;
  padding: .58rem .75rem;
  border: 1px solid #a9926d86;
  border-right: 2px solid var(--accent);
  background: #11191de8;
  color: #e8c897;
  font: .65rem/1 var(--mono);
  letter-spacing: .07em;
  text-transform: uppercase;
  pointer-events: none;
}
.sector-clock strong { color: #fff1d6; font-size: 1.26rem; letter-spacing: .015em; }
.map-tools {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  gap: 1px;
  overflow: hidden;
  border: 1px solid #596d67;
  border-radius: var(--edge);
  background: #596d67;
}
.map-tools button { min-width: 41px; min-height: 40px; border: 0; border-radius: 0; padding: .3rem .6rem; background: #18262be8; }
.map-tools button:hover { background: #354744; }
.map-tools button:nth-child(-n + 2) { font-size: 1.3rem; }
.map-tools button:focus-visible { outline-offset: -3px; }
.map-legend {
  position: absolute;
  left: 1.5rem;
  bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: .9rem;
  pointer-events: none;
  padding: .45rem .62rem;
  border-bottom: 1px solid #9ebfb286;
  background: #101a1de0;
  color: #d0ded8;
  font-size: .72rem;
}
.map-legend span { display: flex; gap: .42rem; align-items: center; }
.map-legend span::before { content: ""; width: 7px; height: 7px; background: var(--blue); border-radius: 50%; }
.map-legend .legend-owned::before { background: transparent; border: 1px solid var(--accent); }
.map-legend .legend-fleet::before { border-radius: 0; rotate: 45deg; }
.map-legend .legend-unknown::before { background: #778395; }
.map-legend .legend-deposits::before { background: conic-gradient(#e8eef6, #ff6b5a, #5fd47a, #9aa3ae, #5aa8ff, #c08a52, #e8eef6); }
.map-pins { position: absolute; inset: 0; pointer-events: none; }
.star-pin {
  position: absolute;
  width: 38px;
  height: 38px;
  min-height: 0;
  transform: translate(-50%, -50%) scale(var(--pin-scale, 1));
  padding: 0;
  color: var(--blue);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 50%;
  pointer-events: auto;
}
.star-pin:hover, .star-pin[aria-pressed="true"]:hover { border-color: #c4d8ed93; background: #d7e5ff15; }
.star-pin[aria-pressed="true"] { z-index: 1; border-color: transparent; background: transparent; }
.star-pin span {
  position: absolute;
  top: calc(50% + 10px);
  left: 50%;
  transform: translateX(-50%);
  padding: .12rem .3rem;
  border-radius: 1px;
  background: #0a1519db;
  color: var(--owner, #c3d8ea);
  pointer-events: none;
  white-space: nowrap;
  font: 650 .77rem/1.2 var(--display);
  letter-spacing: .035em;
  text-shadow: 0 1px 4px #000;
}
.star-pin[aria-pressed="true"] span { border-bottom: 1px solid #d1a66c; background: #352a1eee; color: #ffe2ac; }
.star-pin.fog span { color: #c3ced0; background: #09141980; }
.star-pin.contested span { color: var(--hostile); }

#orders-panel {
  grid-area: orders;
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  min-width: 0;
  min-height: 68px;
  padding: .65rem 1.15rem;
  background: linear-gradient(90deg, #262923, #172326 63%);
  border-top: 1px solid #687769;
}
.order-brief { flex: 1 1 13rem; min-width: 0; }
#order-title { display: block; color: #efd7ae; font: 600 .72rem/1.25 var(--mono); letter-spacing: .075em; text-transform: uppercase; }
#current-action { margin-top: .28rem; color: #dbe3ee; overflow-wrap: anywhere; }
.order-brief:has(#flight-transit:not([hidden])) #current-action:empty { display: none; }
#flight-transit { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .65rem; margin-top: .35rem; color: #eef0e6; }
#btn-flight-advance { flex-shrink: 0; }
.order-shortcuts { display: flex; gap: .42rem; }
.order-shortcuts button { min-height: 36px; min-width: 6.8rem; padding: .4rem .58rem; font-size: .8rem; text-align: start; }
.order-shortcuts span { margin-inline-start: .45rem; color: var(--accent); }
.order-open .order-shortcuts, #orders-panel:has(#construction-locate:not([hidden])) .order-shortcuts { display: none; }
#orders-form { display: flex; flex: 0 1 auto; gap: .55rem; align-items: flex-end; min-width: 0; }
#orders-panel:has(#construction-brief:not([hidden])) :is(.order-brief, #orders-form) { flex-basis: 100%; }
#orders-panel:has(#construction-brief:not([hidden])) #orders-form { order: 2; justify-content: space-between; }
#construction-brief {
  order: 1;
  flex: 1 1 100%;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 4fr);
  gap: .65rem 1.2rem;
  padding: .57rem .72rem;
  border-inline-start: 2px solid var(--accent);
  background: #111b1e;
  color: #dbe7e2;
}
#construction-brief p { margin: 0; font-size: .88rem; }
#construction-facts { display: grid; align-content: start; gap: .25rem; margin: 0; font-size: .82rem; }
#construction-facts > div { display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: .35rem; }
#construction-facts > div:has(dd:empty) { display: none; }
#construction-facts dt { color: #f0c995; font: .7rem/1.4 var(--mono); text-transform: uppercase; align-self: baseline; }
#construction-facts dd { margin: 0; overflow-wrap: anywhere; }
#construction-locate { color: #ffe0ab; border-color: #957853; background: #433627; }
#construction-locate:hover { background: #644b30; }
#orders-fields {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  min-width: 0;
  max-height: min(36svh, 230px);
  overflow: auto;
  padding: 3px;
}
#orders-fields:empty { display: none; }
#orders-fields label { display: grid; gap: .22rem; min-width: 0; color: var(--muted); font-size: .75rem; }
#orders-fields select, #orders-fields input { min-width: 0; max-width: min(100%, 16rem); min-height: 34px; padding: .3rem .45rem; font-size: .87rem; }
#orders-fields input[type=number] { width: 7.7rem; }
.orders-actions { display: flex; flex: none; gap: .4rem; }

#command-panel {
  grid-area: side;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: var(--panel);
  border-left: 1px solid #65746b;
}
.inspector {
  flex: none;
  position: relative;
  display: flex;
  align-items: end;
  min-height: clamp(132px, 24vh, 210px);
  padding: 1.05rem 1.35rem;
  background-color: #0b1317;
  background-image: linear-gradient(90deg, #0b1418 3%, #0b141887 55%, #0b141814 84%), linear-gradient(0deg, #0b1418ee, transparent 68%), var(--planet-art, url("/releases/diaspora-20261202-ba87386c/art/vale-dust.webp"));
  background-repeat: no-repeat;
  background-size: cover, cover, cover;
  background-position: center, center, right 53%;
  border-bottom: 1px solid #4f6058;
}
.inspector[data-world="0"] { --planet-art: url("/releases/diaspora-20261202-ba87386c/art/world-ice.webp"); }
.inspector[data-world="1"] { --planet-art: url("/releases/diaspora-20261202-ba87386c/art/world-volcanic.webp"); }
.inspector[data-world="2"] { --planet-art: url("/releases/diaspora-20261202-ba87386c/art/world-verdant.webp"); }
.inspector[data-world="3"] { --planet-art: url("/releases/diaspora-20261202-ba87386c/art/world-arid.webp"); }
.inspector[data-world="4"] { --planet-art: url("/releases/diaspora-20261202-ba87386c/art/world-ocean.webp"); }
.inspector[data-world="5"] { --planet-art: url("/releases/diaspora-20261202-ba87386c/art/world-russet.webp"); }
.inspector-info { position: relative; z-index: 1; min-width: 0; }
.intel-state { display: flex; align-items: center; gap: .5rem; margin: 0 0 .48rem; color: var(--blue); font: .69rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: .11em; }
.intel-state:not(:empty)::before { content: ""; width: 6px; height: 6px; flex: none; rotate: 45deg; border: 1px solid currentColor; }
#system-name { margin: 0; font: 700 clamp(1.9rem, 3.3vw, 3.3rem)/.98 var(--display); letter-spacing: -.02em; }
#system-controller { margin: .49rem 0 0; color: #d3dfdd; font-size: .84rem; }
#command-tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-bottom: 1px solid var(--line); background: #1c292b; }
#command-tabs [role="tab"] {
  min-height: 43px;
  padding: .3rem .16rem;
  color: #bdcbc9;
  border-color: transparent;
  border-radius: 0;
  background: transparent;
  font-size: .76rem;
  font-weight: 550;
}
#command-tabs [role="tab"]:hover { background: #30423e; }
#command-tabs [aria-selected="true"] { color: #ffe1b6; border-bottom: 2px solid var(--accent); background: #51423160; font-weight: 700; }
#command-tabs [role="tab"]:focus-visible { outline-offset: -4px; }
.pane { flex: 1; min-height: 0; overflow: auto; padding: 1.05rem 1.35rem; scrollbar-color: #5d7268 #151e21; scrollbar-width: thin; }
.pane h3 { margin: 0 0 .6rem; color: #f3dcc0; font: 670 .88rem/1.18 var(--display); letter-spacing: .12em; text-transform: uppercase; }
.section-summary { margin: .15rem 0 .68rem; color: #dce5ef; font-size: .94rem; }
.pane [data-empty]:not(:empty) { display: grid; gap: .85rem; }
.ui-section { min-width: 0; padding: .65rem 0 0; border-top: 1px solid #65776f70; }
.ui-section.objectives { padding: .75rem .78rem; border-top-color: #b59465; background: linear-gradient(120deg, #372c23, #20292a 80%); }
.kv { display: grid; grid-template-columns: minmax(4.4rem, 31%) minmax(0, 1fr); gap: .4rem .68rem; margin: 0; font-size: .88rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: #e2e9f3; overflow-wrap: anywhere; }
.ui-section .row-list { margin-top: .6rem; }
.ui-section .row-list:first-child { margin-top: 0; }
.row-list { list-style: none; margin: 0; padding: 0; display: grid; }
.row-list > li { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .28rem .5rem; padding: .5rem .22rem; border-bottom: 1px solid #394746; }
.row-list > li[aria-current="true"] { border-left: 2px solid var(--accent); }
.row-label { display: flex; align-items: baseline; gap: .4rem; min-width: 0; color: #e2e8f2; font-size: .9rem; }
.row-purpose { grid-column: 1 / -1; margin: .08rem 0; color: #c1d3ce; font-size: .81rem; }
.colony[data-site]:focus, .row-list [data-site]:focus { outline: 1px solid var(--accent); outline-offset: 1px; }
.row-list > .hazard .row-label { color: #e0b9ad; }
.swatch { width: 7px; height: 7px; flex: none; rotate: 45deg; background: var(--c); }
.chip { display: inline-flex; padding: .13rem .22rem; color: #b4ccc5; font-size: .75rem; overflow-wrap: anywhere; }
.row-detail { grid-column: 2; justify-self: end; max-width: 10rem; text-align: right; }
.row-actions { display: flex; gap: .35rem; flex-wrap: wrap; grid-column: 1 / -1; margin-top: .15rem; }
.row-list progress { grid-column: 1 / -1; width: 100%; height: 5px; margin: .18rem 0; border: 0; border-radius: 4px; accent-color: var(--accent); }
.row-list > .hull-card { grid-template-columns: 90px minmax(0, 1fr); padding: .45rem; align-content: start; }
.hull-art { grid-row: 1 / span 2; width: 90px; height: 74px; object-fit: cover; border-radius: 4px; background-color: #0a101a; }
.hull-card .row-label { grid-column: 2; font-weight: 650; }
.hull-card .row-detail { justify-self: start; max-width: unset; text-align: left; border: 0; padding: 0; }
.row-actions button, .button-row button { min-height: 33px; padding: .32rem .56rem; font-size: .79rem; }
.button-row { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .6rem; }
.button-row:first-child { margin-top: 0; }
.objectives .button-row:first-of-type button { border-color: #796849; color: #ffdc9d; }
.ui-section.colony .button-row button:first-child { border-color: #b49265; color: #ffe0b3; background: #433627; }
.ui-section.colony .button-row button:first-child:hover { background: #604934; }
.report-log { list-style: none; margin: 0; padding: 0; }
.report-log > li { padding: .6rem .72rem; border-left: 2px solid #4b627c; background: var(--surface); border-radius: 0 5px 5px 0; }
.report-log > li.alert { border-left-color: var(--hostile); }
.report-log > li.gain { border-left-color: var(--success); }
.report-log time { display: block; margin-bottom: .16rem; color: var(--quiet); font: .7rem/1.3 var(--mono); }
.report-log [data-site] { display: block; margin-top: .38rem; min-height: 34px; border-color: #b492657a; color: #ffe1b6; }

dialog {
  width: min(34rem, calc(100% - 1.4rem));
  padding: 1.35rem;
  color: var(--text);
  background: #151e2af5;
  border: 1px solid #586677;
  border-top-color: #c9a36a;
  border-radius: var(--edge);
  box-shadow: 0 1.5rem 4rem #0008;
}
dialog::backdrop { background: #05080ed2; }
#codex-dialog { width: min(46rem, calc(100% - 2rem)); max-height: 85dvh; }
.codex-header { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
#codex-dialog details { border-top: 1px solid var(--line); padding: .7rem 0; }
#codex-dialog summary { cursor: pointer; font-weight: 650; }
#codex-dialog p { line-height: 1.55; }
.codex-materials { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .9rem; }
.codex-materials h3, .codex-materials ol { margin: .25rem 0; }
.codex-materials ol { padding-left: 1.35rem; }
dialog h2 { margin: 0 0 .65rem; font: 650 1.8rem/1.1 var(--display); }
.dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }

@media (max-width: 1040px) {
  .metrics { gap: .65rem; }
  .metrics > div:last-child { display: none; }
  .session-tools { gap: .25rem; }
}

@media (max-width: 850px) {
  .game { grid-template-columns: minmax(0, 1fr) 302px; }
  #topbar { flex-wrap: wrap; column-gap: .6rem; }
  .metrics { margin-left: auto; }
  .brand { width: 34px; height: 34px; }
  .map-legend { gap: .58rem; font-size: .66rem; }
  .map-tools button { min-width: 34px; }
  #command-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .order-shortcuts button { min-width: 0; }
}

@media (max-width: 680px) {
  .menu { padding: clamp(8.4rem, 30svh, 22rem) 1.15rem 1.7rem; }
  .menu::before {
    background:
      linear-gradient(0deg, #090b10 37%, #090b10e6 47%, transparent 78%),
      url("/releases/diaspora-20261202-ba87386c/art/expedition-title.webp") 74% top / auto max(390px, 53svh) no-repeat;
  }
  .menu-content { grid-template-columns: minmax(0, 1fr); gap: 1.05rem; }
  .wordmark { margin-bottom: 1.2rem; }
  .wordmark > span { font-size: clamp(3rem, 14vw, 6rem); }
  .wordmark small { margin-bottom: .65rem; }
  .menu-modes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .menu-modes button {
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: .35rem .18rem;
    text-align: center;
    font-size: clamp(.72rem, 2.5vw, .95rem);
    letter-spacing: .035em;
  }
  .menu-modes button::before { display: none; }
  #btn-load-game { margin-top: .45rem; }

  .game {
    height: auto;
    min-height: 100svh;
    grid-template:
      "top" auto
      "map" minmax(310px, 48svh)
      "orders" auto
      "side" auto
      / minmax(0, 1fr);
  }
  #topbar { gap: .5rem; padding: .48rem .6rem; }
  .command-brand { flex: 1 1 45%; margin-right: 0; }
  .metrics { gap: .55rem; }
  .metrics > div { padding-inline-start: .38rem; }
  .metrics dt { font-size: .59rem; }
  .metrics dd { font-size: .78rem; }
  #stockpile > summary { min-height: 34px; font-size: .77rem; }
  .resources { right: 0; top: 100%; }
  .time { margin-right: auto; gap: .22rem; }
  .time .date { min-width: 2.5rem; }
  #btn-pause { min-width: 4.45rem; }
  .time button, .session-tools button { min-height: 37px; }
  .session-tools { flex: 0 1 auto; }

  .atlas-header { top: .62rem; left: .65rem; }
  .sector-clock { top: .62rem; right: .65rem; padding: .44rem .44rem; font-size: .57rem; }
  .sector-clock strong { font-size: 1.05rem; }
  .map-legend { bottom: .55rem; left: .65rem; gap: .5rem; max-width: calc(100% - 9rem); }
  .map-tools { right: .65rem; bottom: .55rem; }
  .star-pin span { font-size: .69rem; }
  .star-pin.fog:not([aria-pressed="true"]):not(:hover) span { clip-path: inset(50%); }
  #command-panel { border-left: 0; border-top: 1px solid #374452; }
  .inspector { min-height: 142px; }
  #command-tabs [role="tab"] { min-height: 42px; }
  .pane { overflow: visible; }
  #orders-panel { padding: .55rem .72rem; min-height: 58px; }
  .order-brief { flex-basis: 100%; }
  .order-shortcuts button { min-height: 42px; }
  .game.order-open { padding-bottom: 12rem; }
  .game.order-open #orders-panel {
    position: fixed;
    z-index: 5;
    right: 0;
    bottom: 0;
    left: 0;
    max-height: 55svh;
    overflow: auto;
    gap: .45rem;
    padding-bottom: max(.6rem, env(safe-area-inset-bottom));
    box-shadow: 0 -12px 34px #05080ead;
  }
  #orders-form { flex: 1 1 100%; flex-direction: column; align-items: stretch; }
  .orders-actions button { flex: 1; }
  #construction-brief { grid-template-columns: 1fr; gap: .5rem; }
}

@media (max-width: 355px) {
  .metrics > div:nth-child(2) { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  button, summary { transition: background-color .13s ease, border-color .13s ease; }
}
/* Expedition instruments, structure plates and the fitting cradle. */
:root {
  --frame: #8d736255;
  --panel: #151c24;
  --surface: #19222a;
  --spectrum: linear-gradient(100deg, #e3eef3, #ed6c50 19%, #8bca83 37%, #aebfc9 54%, #6c97ea 73%, #b38250 91%, transparent);
}
.spectrum-rule {
  width: min(18rem, 60%);
  height: 2px;
  margin: -1.65rem 0 1.35rem .32rem;
  background: var(--spectrum);
  opacity: .8;
}
.menu { padding-bottom: clamp(2rem, 7.8vh, 7rem); }
.menu::before {
  background:
    linear-gradient(95deg, #0a0a0f 0%, #0a0a0fce 15%, transparent 58%),
    linear-gradient(0deg, #0c0a0ef7, #0a0a0f46 34%, transparent 72%),
    url('/releases/diaspora-20261202-ba87386c/art/expedition-title.webp') 62% 49% / cover no-repeat;
}
.menu::after { mask: none; border-color: #cfac7c49; }
.wordmark > span { text-shadow: 0 0 34px #fcedbc24; }
.menu-content { grid-template-columns: minmax(0, 1fr) minmax(280px, 375px); }
.menu-modes { max-width: 29rem; }
.menu-modes button { width: 100%; border-left: 1px solid #a28d7052; }
.menu-modes button[aria-pressed='true'] { border-left-color: #f6c787; }
.launch-block {
  position: relative;
  border-top-width: 1px;
  border-color: #c69c637b;
  background: linear-gradient(150deg, #211c1aee, #12171eea 67%);
  box-shadow: 0 15px 55px #030407bc, inset 0 0 30px #79492514;
}
.launch-block::after {
  content: '';
  inset: 0 34% auto 0;
  height: 2px;
  position: absolute;
  background: var(--spectrum);
  pointer-events: none;
}
.briefing-heading {
  margin: -.42rem -.42rem 0;
  padding: .97rem .61rem .70rem;
  border-bottom: 1px solid #b99b7140;
  background: linear-gradient(90deg, #1b171ae6 17%, #18171ba7 70%), url('/releases/diaspora-20261202-ba87386c/art/colony/ground-volcanic.webp') center 43% / cover;
}
.menu:has([data-mode='skirmish'][aria-pressed='true']) .briefing-heading {
  background: linear-gradient(90deg, #1b171aec 17%, #18171baa 70%), url('/releases/diaspora-20261202-ba87386c/art/vale-dust.webp') center 29% / cover;
}
.menu:has([data-mode='pocket'][aria-pressed='true']) .briefing-heading {
  background: linear-gradient(90deg, #201615eb 17%, #201615b0 70%), url('/releases/diaspora-20261202-ba87386c/art/colony/mine.webp') center 50% / cover;
}
.menu:has([data-mode='skirmish'][aria-pressed='true']) { --menu-gold: #ffcb91; }
.menu:has([data-mode='pocket'][aria-pressed='true']) { --menu-gold: #ebd486; }
#briefing-copy { color: #e1e3df; }

#topbar { background: linear-gradient(104deg, #302820 0, #1b1d24 29%, #151b22 100%); border-bottom-color: var(--frame); }
.brand { background: linear-gradient(135deg, #684630, #282835); }
#map-stage {
  background-image: radial-gradient(ellipse at 52% 48%, #090d1766, #070a16a0 75%, #080b15e8),
    url('/releases/diaspora-20261202-ba87386c/art/vale-dust.webp');
  background-position: center, center 48%;
}
#map-stage::before {
  background:
    radial-gradient(ellipse at center, transparent 59%, #9ba1b82e 59.2%, transparent 59.5%),
    radial-gradient(ellipse at center, transparent 66%, #9ba1b821 66.2%, transparent 66.5%),
    linear-gradient(#c2cde012 1px, transparent 1px) center / 74px 74px,
    linear-gradient(90deg, #c2cde012 1px, transparent 1px) center / 74px 74px;
  mask: radial-gradient(ellipse at center, #000 60%, #0006 92%);
}
.atlas-header h2 { color: #f4e6d1; }
.sector-clock { background: #151820f0; }
.map-legend { background: #141a23ed; border-color: #a58a675c; }
.star-pin span { color: #dfe6f0; background: #111721e6; }
.star-pin.fog span { color: #aebaca; background: #1015207e; }
#map-stage[data-zoomed] #map-frame { outline: 1px solid #ab9a8349; }
.inspector {
  background-image: linear-gradient(90deg, #11151dfa, #11151d85 48%, #11151d04 87%),
    linear-gradient(0deg, #141a23dc, transparent 70%), var(--planet-art, url('/releases/diaspora-20261202-ba87386c/art/vale-dust.webp'));
  border-color: var(--frame);
}
.inspector[data-world] { background-size: cover, cover, auto 162%; background-position: center, center, right 53%; }
#command-panel { background: #151b24; border-color: var(--frame); }
#command-tabs { background: #1d242d; border-color: var(--frame); }
#command-tabs [role='tab']:hover { background: #2c3440; }
#command-tabs [aria-selected='true'] { background: #604a3d60; }
#orders-panel { background: linear-gradient(95deg, #28221f, #1a222c 61%); border-color: var(--frame); }
.pane, #shipyard-detail { scrollbar-color: #77675d #151b24; }
#shipyard-detail { display: grid; gap: .85rem; }

.ui-section.colony {
  padding: 1.02rem .83rem .85rem;
  border: 1px solid var(--frame);
  border-top: 1px solid #b7976a9e;
  background:
    linear-gradient(0deg, #151b24 26%, #141a23ef 54%, #141a2350 88%, #271f23b2),
    var(--colony-art) center top / 100% auto no-repeat, #151b24;
}
.pane .colony h3 {
  min-height: 5rem;
  display: flex;
  align-items: end;
  color: #fff1dc;
  font-size: 1.15rem;
  letter-spacing: .036em;
  text-shadow: 0 3px 9px #050509, 0 0 5px #050509;
}
.colony .kv { padding: .65rem 0 .3rem; border-top: 1px solid #b49c7752; }
.row-list > .structure-card, .row-list > .hull-card {
  grid-template-columns: 5.8rem minmax(0, 1fr);
  gap: .28rem .65rem;
  padding: .62rem .25rem .59rem;
  background: linear-gradient(90deg, #2823293b, transparent);
}
.hull-art, .structure-art {
  grid-column: 1;
  grid-row: 1 / span 3;
  align-self: start;
  width: 100%;
  height: auto;
  aspect-ratio: 1.48;
  object-fit: cover;
  border: 1px solid #9c846675;
  border-radius: 2px;
  background: #0e1420;
}
.structure-card .row-label, .structure-card .row-purpose, .hull-card .row-label { grid-column: 2; }
.structure-card .row-detail, .hull-card .row-detail {
  grid-column: 2;
  justify-self: start;
  max-width: unset;
  text-align: start;
  padding: 0;
}
.structure-card .row-label { font-weight: 650; }
.structure-card .row-actions, .hull-card .row-actions { grid-column: 2; }
.hull-card .inspect-ship { grid-column: 2; grid-row: 3; justify-self: start; min-height: 32px; padding: .28rem .52rem; font-size: .74rem; }
.hull-card .inspect-ship[aria-pressed='true'] { color: #f6d9a9; background: #57422f; border-color: #b39265; }
#construction-brief {
  grid-template-columns: minmax(100px, 180px) minmax(9rem, .95fr) minmax(13rem, 1.25fr);
  align-items: center;
  background: linear-gradient(105deg, #252127, #17202b);
}
#construction-art { width: 100%; height: auto; aspect-ratio: 1.7; object-fit: cover; border: 1px solid #ae8a6570; }
#construction-purpose { align-self: center; }

#ship-bench {
  position: relative;
  isolation: isolate;
  display: grid;
  margin: 0 0 .75rem;
  overflow: clip;
  border: 1px solid #ad8b647a;
  background: linear-gradient(0deg, #101620 6%, transparent 38%),
    radial-gradient(ellipse at center, #3c4c60 0%, #212d40 35%, #10161f 83%);
}
#ship-bench::before {
  position: absolute;
  inset: 10px;
  z-index: -1;
  content: '';
  pointer-events: none;
  background:
    linear-gradient(#bdd3e91c 1px, transparent 1px) center / 26px 26px,
    linear-gradient(90deg, #bdd3e91c 1px, transparent 1px) center / 26px 26px;
  border: 1px solid #8099b63a;
  mask: radial-gradient(ellipse, #000 24%, #0004 67%, #000 96%);
}
#ship-bench canvas { display: block; width: 100%; height: clamp(170px, 23vh, 240px); cursor: grab; touch-action: none; }
#ship-bench canvas:active { cursor: grabbing; }
#ship-bench canvas:focus-visible { outline-offset: -4px; }
#ship-bench figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  min-height: 40px;
  padding: .36rem .56rem;
  color: #f1e2c7;
  background: #141922ef;
  border-top: 1px solid #a3866061;
  font: .72rem/1.3 var(--mono);
}
#ship-bench figcaption button { min-height: 30px; padding: .3rem .5rem; font: inherit; white-space: nowrap; }
#fit-dialog {
  width: min(1050px, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border-color: #a78962;
  border-radius: 3px;
  background: #171d26;
}
.fit-heading {
  padding: .93rem 1.2rem;
  border-bottom: 1px solid #8c755c70;
  background: linear-gradient(100deg, #3d2b25, #222935 65%);
}
.fit-heading h2 { margin: 0; color: #f2dfc6; font: 720 1.5rem/1.1 var(--display); text-transform: uppercase; }
.fit-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(19rem, 1fr); padding: .95rem; gap: .9rem; }
#fit-preview #ship-bench { margin: 0; }
#fit-preview canvas { height: clamp(260px, 50dvh, 505px); }
#fit-summary { color: #ead5af; min-height: 1.3em; margin: 0 0 .55rem; font: .78rem/1.3 var(--mono); }
#fit-summary.fit-error { color: #ffae98; }
#fit-controls #orders-form { display: grid; gap: .75rem; }
#fit-controls #orders-fields {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  max-height: min(52dvh, 530px);
  scrollbar-color: #88735b #141922;
}
#fit-controls #orders-fields fieldset {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
  margin: .25rem 0 0;
  padding: .5rem;
  gap: .56rem;
  border: 1px solid #89775f70;
  background: #202833;
}
#fit-controls legend { color: #f1d9ad; font: .74rem/1 var(--mono); text-transform: uppercase; }
#fit-controls #orders-fields :is(select, input) { width: 100%; max-width: none; }
#fit-controls .orders-actions { justify-content: flex-end; }
.fit-open #orders-panel { position: static; }
@media (max-width: 680px) {
  .menu { padding-bottom: 1.4rem; }
  .menu::before {
    background: linear-gradient(0deg, #0b0a11 31%, #0b0a11f0 42%, #0b0a1164 65%, transparent 83%),
      url('/releases/diaspora-20261202-ba87386c/art/expedition-title.webp') 73% top / auto max(390px, 56svh) no-repeat;
  }
  .menu-content { grid-template-columns: minmax(0, 1fr); }
  .spectrum-rule { margin: -.63rem 0 .74rem .21rem; }
  .menu-modes { max-width: none; }
  .menu-modes button { border-left: 0; border-bottom: 1px solid #9e835c65; }
  .menu-modes button[aria-pressed='true'] { border-bottom-color: var(--menu-gold); }
  #construction-brief { grid-template-columns: minmax(4rem, 7.25rem) minmax(0, 1fr); }
  #construction-facts { grid-column: 1 / -1; }
  #fit-dialog { width: calc(100% - 1rem); max-height: calc(100dvh - 1rem); }
  .fit-layout { grid-template-columns: minmax(0, 1fr); padding: .55rem; gap: .55rem; }
  #fit-preview canvas { height: max(155px, 24dvh); }
  #fit-controls #orders-fields { max-height: min(42dvh, 405px); }
  #fit-controls #orders-fields :is(select, input) { min-height: 40px; }
}

#ground-dialog {
  width: min(1240px, calc(100% - 2rem));
  height: min(810px, calc(100dvh - 2rem));
  max-height: none;
  padding: 0;
  border-radius: 3px;
  border-color: #ab8a64;
  overflow: hidden;
  background: #171e28;
}
#ground-dialog[open] { display: grid; grid-template-columns: minmax(0, 1.52fr) minmax(330px, 1fr); }
#ground-surface {
  position: relative;
  display: flex;
  align-items: end;
  min-height: 0;
  padding: clamp(1.15rem, 3vw, 2.4rem);
  border-right: 1px solid #a17c57;
  background: linear-gradient(0deg, #11131bf5, #11131b27 37%, transparent 71%), var(--ground-art) center / cover;
}
.ground-label h2 {
  margin: 0 0 .6rem;
  color: #fff3dc;
  font: 750 clamp(1.6rem, 4vw, 3.75rem)/.96 var(--display);
  text-shadow: 0 2px 12px #08080a;
}
.ground-label button { border-color: #b59870a3; background: #201d1ad9; color: #fff0d6; }
#ground-detail {
  display: grid;
  align-content: start;
  gap: .85rem;
  padding: .95rem;
  overflow: auto;
  scrollbar-color: #77675d #151b24;
}
#ground-detail .colony { background: linear-gradient(135deg, #2d272b, #1a232e); }
#ground-detail .colony h3 { min-height: 0; margin: 0 0 .72rem; color: #f4e2c0; }
#ground-detail > article > h3 { color: #efd9b7; margin: 0 0 .65rem; font-size: .98rem; }
#ground-detail .structure-art { aspect-ratio: 1.28; }
@media (max-width: 680px) {
  #ground-dialog { width: calc(100% - 1rem); height: calc(100dvh - 1rem); }
  #ground-dialog[open] { grid-template: minmax(165px, 29dvh) minmax(0, 1fr) / 1fr; }
  #ground-surface { border-right: 0; border-bottom: 1px solid #a17c57; }
}
