:root {
  color-scheme: dark;
  --bg: #161d19;
  --panel: #202820;
  --line: #414b3c;
  --ink: #e4e8d5;
  --muted: #abb69d;
  --green: #c7dda1;
  --orange: #e3a47b;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 14px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #2c352a;
  padding: 9px 12px;
  text-align: center;
  transition:
    background 0.12s,
    border-color 0.12s;
}
button:hover:enabled {
  background: #3b4736;
  border-color: #93aa75;
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid #e5d989;
  outline-offset: 3px;
}
input,
select {
  width: 100%;
  background: #172019;
  border: 1px solid #55604c;
  padding: 10px;
  border-radius: 3px;
}
input[type="checkbox"] {
  width: auto;
  accent-color: var(--green);
}
label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin: 12px 0 6px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
p {
  line-height: 1.65;
  margin: 10px 0;
  color: #c7cebc;
}
h2 {
  font-size: 22px;
  line-height: 1.2;
}
h3 {
  font-size: 16px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 800;
  color: var(--green);
}
header {
  height: 77px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  background: #19211b;
}
.wordmark {
  color: var(--ink);
  font-size: 26px;
  letter-spacing: 3px;
  font-weight: 900;
  text-decoration: none;
  line-height: 1;
}
.wordmark span {
  color: var(--green);
}
.wordmark small {
  font-size: 8px;
  display: block;
  letter-spacing: 3px;
  color: var(--muted);
  margin-top: 8px;
}
.header-right {
  display: flex;
  gap: 18px;
  align-items: center;
}
.version {
  font:
    11px ui-monospace,
    monospace;
  letter-spacing: 1px;
  color: var(--green);
  border: 1px solid var(--line);
  padding: 5px 9px;
}
.quiet {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
kbd {
  font:
    11px ui-monospace,
    monospace;
  border: 1px solid #6b765e;
  border-radius: 3px;
  padding: 2px 5px;
  opacity: 0.7;
  margin-left: 10px;
}
.primary {
  color: #192215;
  background: var(--green);
  border-color: var(--green);
  font-weight: 800;
}
.primary:hover:enabled {
  background: #e0efbf;
  border-color: #e0efbf;
}
.wide {
  width: 100%;
  margin-top: 9px;
}
.menu {
  max-width: 1240px;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 80px;
  margin: 0 auto;
  padding: 65px 45px;
}
.hero h1 {
  font-size: clamp(34px, 3.4vw, 53px);
  line-height: 1.12;
  letter-spacing: -2px;
  margin: 22px 0;
}
.hero h1 em {
  font-style: normal;
  color: var(--green);
  font-size: 0.69em;
  line-height: 1.5;
}
.hero > p {
  font-size: 16px;
  max-width: 490px;
}
.hero-art {
  border-bottom: 1px solid var(--line);
  padding: 10px 0 20px;
}
.hero-art svg {
  width: 100%;
  height: auto;
}
.hero-art span {
  font:
    10px ui-monospace,
    monospace;
  color: var(--muted);
  letter-spacing: 1.5px;
}
.lore-card {
  border-left: 2px solid #818e6b;
  margin-top: 25px;
  padding-left: 20px;
  font-size: 12px;
}
.lore-card b {
  font:
    11px ui-monospace,
    monospace;
  letter-spacing: 1px;
  color: var(--green);
}
.operation {
  background: linear-gradient(150deg, #2a3327, #20271f);
  border: 1px solid var(--line);
  padding: 30px;
  box-shadow: 0 15px 60px #0003;
}
.operation h2 {
  margin-top: 14px;
  font-size: 28px;
}
.brief {
  list-style: none;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  line-height: 2;
  font-size: 12px;
  color: var(--muted);
}
.brief b {
  color: var(--ink);
}
.form-row {
  display: flex;
  gap: 10px;
}
.form-row > div {
  flex: 1;
  min-width: 0;
}
.doctrine-note {
  font-size: 12px;
  min-height: 40px;
}
.check {
  display: flex;
  gap: 9px;
  align-items: center;
}
.launch {
  width: 100%;
  display: flex;
  justify-content: space-between;
  margin-top: 17px;
  padding: 14px 17px;
}
.footnote {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.55;
}
.error {
  color: #f3b899;
  font-size: 12px;
}
.command {
  padding: 0 20px 14px;
  max-width: 1840px;
  margin: 0 auto;
}
.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 15px;
}
.statusbar h1 {
  font-size: 25px;
  margin-top: 4px;
}
.statusbar h1 small {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}
.score {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 10px;
  letter-spacing: 1px;
}
.score b {
  font:
    35px ui-monospace,
    monospace;
  margin: 0 8px;
  color: var(--green);
}
.score-divider {
  color: var(--muted);
}
.enemy-score b {
  color: var(--orange);
}
.requisition {
  display: flex;
  flex-direction: column;
  text-align: right;
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--muted);
}
.requisition b {
  font:
    25px ui-monospace,
    monospace;
  color: var(--ink);
  margin-top: 3px;
}
.resolve {
  min-width: 175px;
  padding: 14px;
}
.battle-layout {
  display: grid;
  grid-template-columns: 205px minmax(450px, 1fr) 255px;
  gap: 14px;
  align-items: start;
}
.panel-head {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}
.panel-head span {
  font-size: 9px;
  letter-spacing: 0;
  color: #c2cbb1;
}
.roster-panel,
.orders-panel,
.event-panel {
  background: var(--panel);
  border: 1px solid var(--line);
}
.roster-unit {
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  width: 100%;
  display: flex;
  align-items: center;
  text-align: left;
  gap: 6px;
  padding: 7px 5px;
  background: transparent;
}
.roster-unit.active {
  background: #39462e;
  border-left: 3px solid var(--green);
}
.roster-unit b {
  font-size: 10px;
  font-weight: 650;
  display: block;
  line-height: 1.5;
}
.roster-unit small {
  display: block;
  font-size: 9px;
  color: var(--muted);
  margin-top: 2px;
}
.roster-icon {
  width: 37px;
  flex-shrink: 0;
}
.roster-icon svg {
  width: 100%;
  height: 40px;
}
.reinforcements {
  padding: 12px 10px;
}
.reinforcements summary {
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.reinforcements summary span {
  float: right;
  color: var(--green);
}
.reinforcements select {
  padding: 6px;
  font-size: 11px;
  margin-bottom: 10px;
}
.purchase {
  display: flex;
  justify-content: space-between;
  text-align: left;
  font-size: 10px;
  width: 100%;
  padding: 8px 6px;
  margin-bottom: 4px;
  background: #242e23;
}
.purchase b {
  font:
    11px ui-monospace,
    monospace;
  color: var(--green);
}
.map-top {
  display: flex;
  justify-content: space-between;
  font:
    9px ui-monospace,
    monospace;
  letter-spacing: 1px;
  color: var(--muted);
  padding: 7px 4px 12px;
}
.seed {
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.map-wrap {
  border: 1px solid #56624d;
  background: #1b2420;
  position: relative;
  overflow: hidden;
}
#battlefield {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
}
.hex {
  cursor: pointer;
}
.hex-face {
  stroke: #8a947c;
  stroke-width: 0.7;
  stroke-opacity: 0.4;
}
.hex:hover .hex-face,
.hex:focus .hex-face {
  stroke: #e6edb6;
  stroke-width: 2;
  stroke-opacity: 1;
}
.hex.unknown .hex-face {
  stroke: #343d32;
  fill: #242c26;
}
.hex.remembered {
  filter: brightness(0.58) saturate(0.45);
}
.hex.route .hex-face {
  stroke: #b7d889;
  stroke-width: 2;
}
.hex-coord {
  fill: #d1d7c0;
  font:
    6px ui-monospace,
    monospace;
  opacity: 0.5;
  pointer-events: none;
}
.unknown .hex-coord {
  opacity: 0.2;
}
.objective-marker {
  stroke: #dadcca;
  stroke-width: 2;
  fill: #17201c88;
  stroke-dasharray: 3 3;
  pointer-events: none;
}
.objective-marker.owner-0 {
  stroke: #daefb6;
  stroke-dasharray: none;
  fill: #314c30aa;
}
.objective-marker.owner-1 {
  stroke: #efb68c;
  stroke-dasharray: none;
  fill: #674630aa;
}
.obj-label {
  fill: #f3edd3;
  font:
    bold 12px ui-monospace,
    monospace;
  text-anchor: middle;
  pointer-events: none;
}
.map-caption {
  fill: #89977b;
  font:
    9px ui-monospace,
    monospace;
  letter-spacing: 1px;
}
.unit {
  cursor: pointer;
}
.selection-ring {
  stroke: transparent;
  fill: transparent;
}
.unit:hover .selection-ring,
.unit:focus .selection-ring {
  stroke: #ecdfaa;
  stroke-width: 1;
}
.unit.selected .selection-ring {
  stroke: #e4efc3;
  stroke-width: 2;
  fill: #afce7820;
}
.unit.ghost {
  opacity: 0.45;
}
.unit.ghost path,
.unit.ghost ellipse {
  stroke-dasharray: 3 3;
}
.unit .facing {
  opacity: 0.8;
}
.altitude-stem {
  stroke: #cedbac;
  stroke-width: 1;
  stroke-dasharray: 2 3;
  opacity: 0.6;
}
.contact-label {
  fill: #e2e8cd;
  text-anchor: middle;
  font:
    7px ui-monospace,
    monospace;
  paint-order: stroke;
  stroke: #16201b;
  stroke-width: 2px;
}
.enemy .contact-label {
  fill: #edb790;
}
.order-line {
  stroke: #b3cb8c;
  stroke-width: 1.2;
  stroke-dasharray: 5 5;
  opacity: 0.45;
  fill: none;
  pointer-events: none;
}
.order-line.active {
  stroke-width: 2;
  opacity: 1;
}
.order-end {
  fill: none;
  stroke: #e4e7a7;
  stroke-width: 2;
  pointer-events: none;
}
.map-key {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 7px 0;
  font-size: 9px;
  color: var(--muted);
}
.map-key span {
  white-space: nowrap;
}
.map-key i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border: 1px solid #98a37e;
}
.known {
  background: #687457;
}
.remembered-key {
  background: #363d32;
}
.unknown-key {
  background: #171f19;
}
.map-key button {
  font-size: 10px;
  padding: 4px;
}
.objectives {
  display: flex;
  gap: 7px;
  margin: 4px 0 10px;
}
.objective {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  text-align: left;
  padding: 8px 6px;
}
.objective b {
  font-size: 10px;
  display: block;
}
.objective small {
  display: block;
  font-size: 9px;
  color: var(--muted);
  margin-top: 3px;
}
.objective .number {
  font:
    19px ui-monospace,
    monospace;
  color: var(--ink);
}
.objective.owner-0 {
  border-color: #829a60;
  background: #2d3c27;
}
.objective.owner-1 {
  border-color: #986e51;
  background: #433126;
}
.objective.owner-1 .number {
  color: var(--orange);
}
.inspect {
  font:
    10px ui-monospace,
    monospace;
  color: var(--muted);
  padding: 9px 2px;
  min-height: 38px;
  line-height: 1.5;
}
.event-log {
  height: 155px;
  overflow: auto;
  scrollbar-color: #667651 #202820;
}
.event {
  font:
    10px ui-monospace,
    monospace;
  padding: 5px 10px;
  margin: 0;
  border-bottom: 1px solid #34402f;
  line-height: 1.5;
  color: #bcc8aa;
  overflow-wrap: anywhere;
}
.event span {
  color: #83996b;
  margin-right: 10px;
}
.event.turn {
  background: #2b3826;
  color: #d1dfa8;
}
.event.destroy,
.event.result {
  color: var(--orange);
}
.orders-panel {
  padding: 18px 14px;
  min-height: 505px;
}
.orders-panel h2 {
  font-size: 21px;
  margin-top: 9px;
}
.native {
  font-size: 10px;
  color: #a3b791;
  line-height: 1.6;
}
.unit-portrait {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 14px 0;
}
.unit-portrait svg {
  width: 70px;
  height: 65px;
  flex-shrink: 0;
}
.unit-portrait span {
  font:
    9px ui-monospace,
    monospace;
  color: var(--green);
}
.unit-portrait small {
  display: block;
  color: var(--muted);
  font: 10px system-ui;
  margin-top: 6px;
  line-height: 1.4;
}
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stats div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stats span {
  font-size: 10px;
  color: var(--muted);
}
.stats b {
  font:
    12px ui-monospace,
    monospace;
}
.route-summary {
  font:
    11px ui-monospace,
    monospace;
  background: #172018;
  padding: 10px;
  line-height: 1.5;
  margin: 15px 0;
  color: var(--green);
}
fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}
legend {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--muted);
  text-transform: uppercase;
}
fieldset select {
  font-size: 11px;
  padding: 7px;
}
fieldset button {
  font-size: 10px;
}
.weapons {
  font-size: 10px;
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 6px;
}
.empty {
  text-align: center;
  padding-top: 45px;
}
.empty svg {
  width: 90px;
  margin-bottom: 20px;
}
.empty p {
  font-size: 12px;
  margin-top: 20px;
}
.empty h3 {
  color: var(--green);
}
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  margin-top: 15px;
  padding-top: 12px;
  font-size: 10px;
  color: var(--muted);
}
footer button {
  font-size: 10px;
  padding: 6px 9px;
  margin-left: 4px;
}
.tutorial {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  background: #303d29;
  border: 1px solid #718954;
  padding: 15px 20px;
  margin-bottom: 15px;
}
.tutorial h3 {
  margin-top: 6px;
}
.tutorial p {
  font-size: 12px;
  margin: 5px 0 0;
  max-width: 900px;
}
.tutorial > div:last-child {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}
.tutorial button {
  font-size: 11px;
}
.manual {
  max-width: 780px;
  width: calc(100% - 40px);
  max-height: 90vh;
  padding: 30px;
  background: #222d22;
  color: var(--ink);
  border: 1px solid #83946e;
  border-radius: 5px;
}
.manual::backdrop {
  background: #0a130dcc;
}
.manual h1 {
  margin: 10px 0 20px;
  font-size: 30px;
}
.manual h2 {
  font-size: 18px;
  margin-top: 25px;
  color: var(--green);
}
.manual p {
  font-size: 13px;
}
.result-overlay {
  position: fixed;
  inset: 0;
  background: #0b130ebf;
  display: grid;
  place-items: center;
  z-index: 5;
  backdrop-filter: blur(5px);
}
.result-card {
  max-width: 510px;
  background: #293525;
  border: 1px solid #94a875;
  padding: 35px;
  margin: 20px;
  box-shadow: 0 20px 100px #0008;
}
.result-card h1 {
  font-size: 35px;
  margin: 18px 0;
}
.result-name {
  font:
    12px ui-monospace,
    monospace;
  color: var(--green);
  letter-spacing: 3px;
}
#toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translate(-50%, 20px);
  padding: 13px 20px;
  background: #d1dfaf;
  color: #20291b;
  border: 1px solid #ecf5d5;
  border-radius: 3px;
  font-size: 12px;
  box-shadow: 0 3px 20px #0008;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s;
  z-index: 12;
  max-width: 90vw;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.tracer {
  stroke-width: 2;
  stroke-dasharray: 800;
  animation: fire 0.3s ease-out both;
}
.impact {
  stroke: #efd1a0;
  fill: #efbb6c44;
  animation: impact 0.5s ease-out both;
}
@keyframes fire {
  0% {
    opacity: 0;
    stroke-dashoffset: 800;
  }
  40% {
    opacity: 1;
    stroke-dashoffset: 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes impact {
  0% {
    opacity: 0;
    transform: scale(0.7);
    transform-origin: center;
    transform-box: fill-box;
  }
  40% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: scale(1.3);
    transform-origin: center;
    transform-box: fill-box;
  }
}
@media (min-width: 1600px) {
  .battle-layout {
    grid-template-columns: 235px minmax(500px, 1fr) 280px;
  }
  .orders-panel {
    padding: 22px 18px;
  }
  .roster-unit b {
    font-size: 12px;
  }
  .roster-unit small {
    font-size: 10px;
  }
  .purchase {
    font-size: 12px;
  }
}
@media (max-width: 1100px) {
  header {
    padding: 0 20px;
  }
  .command {
    padding: 0 10px 10px;
  }
  .battle-layout {
    grid-template-columns: 170px minmax(380px, 1fr) 210px;
    gap: 8px;
  }
  .orders-panel {
    padding: 14px 10px;
  }
  .statusbar {
    gap: 10px;
  }
  .score {
    gap: 2px;
    font-size: 9px;
  }
  .score b {
    font-size: 28px;
  }
  .menu {
    gap: 35px;
    padding: 40px 25px;
  }
  .objective b {
    font-size: 9px;
  }
  .objective small {
    font-size: 8px;
  }
  .map-key {
    gap: 5px;
    font-size: 8px;
  }
}
@media (max-width: 850px) {
  .menu {
    grid-template-columns: 1fr;
    max-width: 600px;
  }
  .hero-art {
    max-width: 460px;
  }
  .battle-layout {
    grid-template-columns: 150px minmax(350px, 1fr);
  }
  .orders-panel {
    grid-column: 1/-1;
    min-height: 0;
  }
  .orders-panel .stats {
    grid-template-columns: repeat(6, 1fr);
  }
  .statusbar {
    flex-wrap: wrap;
  }
  .requisition {
    display: none;
  }
  .command {
    min-width: 530px;
  }
  .header-right {
    gap: 5px;
  }
  .tutorial {
    align-items: start;
    padding: 12px;
  }
  .tutorial > div:last-child {
    flex-direction: column;
  }
  footer {
    gap: 15px;
  }
  .score b {
    font-size: 26px;
  }
  .wordmark {
    font-size: 22px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

.result-overlay {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border: 0;
  padding: 0;
  margin: 0;
  color: var(--ink);
}
.result-overlay:not([open]) {
  display: none;
}
