* {
  box-sizing: border-box;
}
html {
  background-color: #101714;
  color: #e8ebdf;
  font-family: Inter, "Avenir Next", system-ui, sans-serif;
  touch-action: manipulation;
}
body {
  margin: 0;
  overflow: hidden;
  touch-action: manipulation;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  cursor: pointer;
  color: inherit;
  border: 1px solid #34423a;
  background: #1a241f;
  transition:
    background 0.15s,
    border-color 0.15s;
}
button:hover {
  background: #28382c;
  border-color: #849074;
}
button:focus-visible,
canvas:focus-visible,
a:focus-visible {
  outline: 2px solid #ecb75c;
  outline-offset: -2px;
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
button[hidden],
[hidden] {
  display: none !important;
}
#app {
  height: 100dvh;
  display: grid;
  grid-template-rows: 88px 1fr 56px;
  min-height: 590px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 24px;
  background: #121c17;
  border-bottom: 1px solid #394338;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #e9ebdb;
  text-decoration: none;
  font-size: 20px;
  font-weight: 850;
  letter-spacing: 2px;
}
.brand-mark {
  display: flex;
  gap: 3px;
  transform: skewY(-18deg);
}
.brand-mark i {
  display: block;
  width: 7px;
  height: 23px;
  background: #e6b35a;
}
.brand-mark i:nth-child(2) {
  height: 17px;
  margin-top: 6px;
}
.brand-mark i:nth-child(3) {
  height: 11px;
  margin-top: 12px;
}
.build-tag {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  max-width: 85px;
  padding: 5px 7px;
  border: 1px solid #445044;
  line-height: 1.6;
  color: #9aa690;
}
.resources {
  display: flex;
  gap: 24px;
}
.resources > div {
  min-width: 80px;
}
.resource-label {
  display: block;
  color: #9daa9b;
  letter-spacing: 1px;
  font-size: 13px;
  margin-bottom: 3px;
}
.resources strong {
  font-size: 28px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #edc378;
}
.resources > div:nth-child(2) strong {
  color: #b3c7a4;
}
.resources > div:nth-child(3) strong {
  color: #dddccb;
}
.resources strong.low {
  color: #fa8d75;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-actions #clock {
  font:
    16px ui-monospace,
    monospace;
  color: #b1b9a7;
}
.icon-button {
  border: 0;
  background: transparent;
  font-size: 13px;
  letter-spacing: 1px;
  color: #a2ad99;
  padding: 8px;
}
.pause-button {
  padding: 10px 13px;
  font-size: 14px;
  letter-spacing: 1px;
}
.pause-button kbd {
  margin-left: 9px;
}
kbd {
  font:
    12px ui-monospace,
    monospace;
  border: 1px solid #465045;
  padding: 3px 5px;
  border-radius: 2px;
  color: #aab4a2;
}
main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  overflow: hidden;
}
.battlefield {
  position: relative;
  overflow: hidden;
  background: #293226;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}
.sector-label {
  position: absolute;
  top: 20px;
  left: 24px;
  font:
    14px ui-monospace,
    monospace;
  letter-spacing: 1.6px;
  color: #d9ddc7;
  pointer-events: none;
  text-shadow: 0 1px 3px #000;
}
.sector-label > span:last-child {
  color: #a4ad94;
  margin-left: 6px;
}
.signal-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  background: #ddba65;
  border-radius: 50%;
  box-shadow: 0 0 9px #d5b66b66;
  margin-right: 7px;
}
.camera-hint {
  position: absolute;
  left: 24px;
  bottom: 19px;
  color: #aab49a;
  font:
    12px ui-monospace,
    monospace;
  letter-spacing: 1px;
  pointer-events: none;
}
.camera-hint span {
  margin-left: 20px;
}
#toast {
  position: absolute;
  left: 50%;
  bottom: 55px;
  transform: translateX(-50%);
  padding: 12px 20px;
  background: #101c17ed;
  border: 1px solid #6b785b;
  color: #e7e4c7;
  font-size: 16px;
  max-width: 80%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  text-align: center;
  z-index: 5;
}
#toast.show {
  opacity: 1;
}
#order-mode {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #c9a963;
  color: #142019;
  padding: 10px 16px;
  font-size: 14px;
  letter-spacing: 1px;
  pointer-events: none;
}
#order-mode span {
  display: block;
  font-size: 13px;
  letter-spacing: 0;
  margin-top: 4px;
}
.command-deck {
  background: #131d17;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #44513f;
  padding: 0 18px;
  overflow: auto;
}
.deck-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 22px 0 18px;
  font-size: 13px;
  letter-spacing: 1.6px;
  color: #a1ad97;
}
.team-chip {
  background: #e7b35b1a;
  color: #edbf6c;
  border: 1px solid #665631;
  padding: 4px 7px;
  font-size: 12px;
  letter-spacing: 1px;
}
.eyebrow {
  font:
    13px ui-monospace,
    monospace;
  letter-spacing: 1.8px;
  color: #b6bfaa;
}
.selection {
  min-height: 126px;
  border-bottom: 1px solid #34402f;
  margin-bottom: 16px;
}
.selection h2 {
  font-size: 22px;
  margin: 10px 0 8px;
  font-weight: 550;
  letter-spacing: -0.5px;
}
.selection p {
  font-size: 15px;
  line-height: 1.7;
  color: #9da995;
  margin: 0 0 10px;
}
.health-track {
  height: 3px;
  width: 100%;
  background: #283729;
  margin: 10px 0;
}
.health-track i {
  display: block;
  height: 100%;
  background: #9aae7f;
}
.deck-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid #34402f;
  margin-bottom: 10px;
}
.deck-tabs button {
  border: 0;
  background: transparent;
  color: #829079;
  font-size: 13px;
  letter-spacing: 1px;
  padding: 10px 0;
}
.deck-tabs button.active {
  color: #edc578;
  border-bottom: 2px solid #edc578;
}
.build-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.build-button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 86px;
  padding: 11px;
  text-align: left;
  width: 100%;
  background: #1a261d;
  border-color: #34432e;
}
.build-button.chosen {
  border-color: #e4b562;
  background: #343525;
}
.build-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  color: #b3b993;
}
.build-button strong {
  display: block;
  font-size: 17px;
  font-weight: 600;
}
.build-button small {
  display: block;
  font-size: 13px;
  color: #92a084;
  margin-top: 5px;
  line-height: 1.35;
}
.build-button .cost {
  margin-left: auto;
  align-self: flex-start;
  font:
    15px ui-monospace,
    monospace;
  color: #e2be77;
}
.build-button.unaffordable .cost {
  color: #a87d61;
}
.section-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: 1px;
  color: #9fa98f;
  margin-bottom: 9px;
}
.queue-section {
  margin-top: 22px;
}
.queue-empty {
  color: #5e705b;
  font-size: 14px;
  padding: 12px 0;
  border-bottom: 1px solid #2a3829;
}
.queue-item {
  position: relative;
  font-size: 14px;
  border: 1px solid #3c4934;
  padding: 11px 28px 12px 9px;
  margin-bottom: 6px;
  overflow: hidden;
  min-height: 35px;
}
.queue-item .progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  background: #dbb467;
}
.queue-item button {
  position: absolute;
  right: 3px;
  top: 4px;
  background: none;
  border: 0;
  color: #a6af98;
  padding: 4px 6px;
}
.queue-item small {
  display: block;
  color: #9ba78b;
  margin-top: 4px;
  font-size: 12px;
}
.objective {
  margin-top: 24px;
  border-top: 1px solid #34402f;
  padding-top: 17px;
}
.objective h3 {
  font-size: 15px;
  font-weight: 500;
  margin: 9px 0 12px;
}
.objective ol {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: orders;
}
.objective li {
  font-size: 14px;
  color: #8f9e82;
  line-height: 2.3;
  counter-increment: orders;
}
.objective li:before {
  content: counter(orders, decimal-leading-zero);
  font:
    13px ui-monospace,
    monospace;
  color: #68795c;
  margin-right: 10px;
}
.objective li.done {
  color: #c1caa9;
}
.objective li.done:before {
  color: #d8b36a;
}
.deck-foot {
  margin-top: auto;
  padding: 25px 0 18px;
  font:
    12px ui-monospace,
    monospace;
  letter-spacing: 0.6px;
  color: #a1ad8e;
}
.deck-foot small {
  display: block;
  font:
    13px system-ui,
    sans-serif;
  color: #687b60;
  margin: 7px 0 0 14px;
}
footer {
  background: #101912;
  border-top: 1px solid #35412f;
  padding: 0 18px;
  display: flex;
  gap: 25px;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: #8d9d7e;
}
footer kbd {
  margin: 0 3px 0 8px;
  font-size: 12px;
}
footer button {
  background: transparent;
  border: 0;
  font-size: 12px;
  letter-spacing: 1px;
  color: #c6ccad;
}
.title-screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 50px 6%;
  background: linear-gradient(
    90deg,
    #111c16f5 0%,
    #111c16dc 35%,
    #111c1666 70%,
    #111c1610
  );
}
.title-content {
  max-width: 500px;
}
.title-content .eyebrow {
  color: #c7b77d;
  font-size: 14px;
  letter-spacing: 2px;
}
.title-content h1 {
  font-size: clamp(65px, 6.8vw, 103px);
  line-height: 1.02;
  letter-spacing: -5px;
  font-weight: 600;
  margin: 24px 0;
}
.title-content h1 em {
  font-style: normal;
  color: #e7b35c;
}
.title-content p {
  font-size: 16px;
  color: #aab59f;
  line-height: 1.8;
  margin-bottom: 28px;
}
.primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #e7b35c;
  color: #1c2519;
  border: 1px solid #e7b35c;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 17px 22px;
  min-width: 240px;
}
.primary:hover {
  background: #f4c87f;
  border-color: #f4c87f;
}
.primary > span {
  font-size: 21px;
  font-weight: 400;
  margin-left: 28px;
}
.primary kbd {
  color: #4d512f;
  border-color: #797044;
  margin-left: 20px;
}
.session-note {
  font:
    12px ui-monospace,
    monospace;
  letter-spacing: 0.7px;
  color: #87977d;
  margin-top: 16px;
}
.title-note {
  align-self: flex-end;
  position: absolute;
  bottom: 65px;
  right: 35px;
  font-size: 14px;
  line-height: 1.8;
  border-left: 1px solid #6f795a;
  padding-left: 18px;
  color: #bfc5ac;
}
.title-note > span {
  font:
    12px ui-monospace,
    monospace;
  color: #e3b96c;
  letter-spacing: 1px;
}
.title-note small {
  font-size: 12px;
  color: #8f9d80;
}
.pause-panel {
  position: absolute;
  right: 24px;
  top: 65px;
  background: #121e17f5;
  border: 1px solid #9b9260;
  padding: 25px;
  box-shadow: 0 15px 40px #0005;
  max-width: 340px;
}
.pause-panel h2 {
  font-size: 27px;
  font-weight: 500;
  margin: 12px 0;
}
.pause-panel p {
  font-size: 16px;
  color: #a3b095;
  line-height: 1.7;
}
.menu-row {
  display: flex;
  gap: 6px;
  margin-top: 15px;
}
.menu-row button {
  font-size: 14px;
  padding: 8px;
}
.result-screen {
  position: absolute;
  inset: 0;
  background: #101b16da;
  display: grid;
  place-items: center;
  backdrop-filter: blur(5px);
}
.result-card {
  max-width: 500px;
  padding: 40px;
  border: 1px solid #566243;
  background: #142019;
  width: 85%;
}
.result-card h2 {
  font-size: 50px;
  letter-spacing: -2px;
  font-weight: 500;
  margin: 18px 0;
  color: #e8bf73;
}
.result-card p {
  font-size: 16px;
  color: #acb79d;
  line-height: 1.8;
}
.result-card small {
  display: block;
  font-size: 14px;
  color: #819473;
  margin-top: 18px;
}
#result-stats {
  display: flex;
  gap: 30px;
  margin: 25px 0;
  font-size: 14px;
  color: #94a585;
}
#result-stats strong {
  display: block;
  font:
    22px ui-monospace,
    monospace;
  color: #e3dfc3;
  margin-bottom: 5px;
}
.restart-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #18251b;
  border: 1px solid #c9aa62;
  padding: 30px;
  z-index: 10;
  box-shadow: 0 0 0 2000px #07110caa;
}
.restart-panel p {
  color: #a8b69b;
  font-size: 16px;
}
.restart-panel button:last-child {
  margin-top: 12px;
  padding: 10px;
  width: 100%;
}
dialog {
  max-width: 610px;
  background: #18241c;
  color: #d9dfca;
  border: 1px solid #6f7c57;
  padding: 32px;
}
dialog::backdrop {
  background: #07110bcc;
}
dialog h2 {
  font-size: 28px;
  font-weight: 500;
}
dialog dl {
  font-size: 16px;
  line-height: 1.6;
}
dialog dt {
  color: #e5bd73;
  margin-top: 13px;
}
dialog dd {
  margin-left: 0;
  color: #a5b398;
}
dialog p {
  font-size: 16px;
  line-height: 1.8;
  color: #b0bca1;
}
.close-dialog {
  position: absolute;
  right: 10px;
  top: 10px;
  border: 0;
  background: none;
  font-size: 24px;
}
.small-screen {
  display: none;
  padding: 30px;
  min-height: 100dvh;
  background: #101c15;
}
.small-screen h1 {
  font-weight: 500;
  font-size: 45px;
  letter-spacing: -2px;
  color: #e5bb71;
}
.small-screen p {
  font-size: 15px;
  line-height: 1.8;
  color: #a9b79c;
  max-width: 400px;
}
@media (max-width: 1150px) {
  .build-tag {
    display: none;
  }
  .resources {
    gap: 22px;
  }
  .header-actions {
    gap: 8px;
  }
  .topbar {
    padding: 0 18px;
  }
  .wordmark {
    font-size: 17px;
    letter-spacing: 1px;
  }
  main {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
  footer > span:nth-child(2) {
    display: none;
  }
  .title-note {
    display: none;
  }
  .resources > div {
    min-width: 65px;
  }
  .resources strong {
    font-size: 24px;
  }
}
@media (max-width: 999px), (max-height: 589px) {
  body {
    overflow: auto;
  }
  #app {
    display: none;
  }
  .small-screen {
    display: block;
  }
}
@media (prefers-reduced-motion: reduce) {
  button,
  #toast {
    transition: none;
  }
}

/* Readable command UI at normal browser zoom. Supporting metadata never drops below 12px. */
.build-button > span:not(.cost) {
  min-width: 0;
}
.build-button small {
  font-size: 14px;
  color: #b2bea6;
  line-height: 1.45;
}
.build-button .cost {
  font-size: 17px;
}
.selection p {
  font-size: 16px;
  color: #b1bea6;
}
.deck-tabs button {
  font-size: 14px;
  color: #acb89e;
}
.objective li {
  font-size: 15px;
  color: #aebda1;
}
.queue-item {
  font-size: 15px;
  padding-right: 38px;
}
.queue-item small {
  font-size: 14px;
  color: #b0bda1;
}
.queue-item button {
  min-width: 32px;
  min-height: 32px;
  font-size: 22px;
}
.queue-empty {
  color: #a0b18f;
  font-size: 14px;
}
.deck-foot small {
  color: #9dad8c;
  font-size: 13px;
}
.primary {
  font-size: 16px;
}
.title-content p {
  font-size: 18px;
}
.resources strong {
  font-size: 28px;
}
.header-actions #clock {
  font-size: 16px;
}
footer {
  font-size: 13px;
  gap: 10px;
  padding: 0 12px;
}
footer kbd {
  font-size: 12px;
  margin-left: 4px;
  padding: 2px 4px;
}
footer button {
  min-height: 40px;
  font-size: 13px;
}
.pause-panel {
  max-width: 350px;
}
.menu-row {
  flex-wrap: wrap;
}
@media (max-width: 1350px) {
  .build-tag {
    display: none;
  }
  .title-note {
    display: none;
  }
  footer > span:nth-child(2) {
    display: none;
  }
  .resources {
    gap: 18px;
  }
}
@media (max-width: 1150px) {
  .icon-button {
    font-size: 12px;
    padding: 6px;
  }
  .pause-button {
    font-size: 13px;
    padding: 10px;
  }
  .pause-button kbd {
    display: none;
  }
  .topbar {
    gap: 10px;
    padding: 0 14px;
  }
  .resources {
    gap: 14px;
  }
  .resources > div {
    min-width: 70px;
  }
}

/* Keep the essential production controls visible while retaining readable type. */
.deck-heading {
  margin: 18px 0 12px;
}
.selection {
  min-height: 112px;
  margin-bottom: 10px;
}
.build-button {
  min-height: 80px;
}
.queue-section {
  margin-top: 16px;
}
.objective {
  margin-top: 16px;
  padding-top: 12px;
}
.objective h3 {
  margin: 7px 0 8px;
}
.command-deck > * {
  flex-shrink: 0;
}
