:root {
  color-scheme: dark;
  font:
    14px system-ui,
    sans-serif;
  color: #edf4f3;
  background: #0c1822;
}
.version {
  color: #a9e8b8;
  font-size: 12px;
  letter-spacing: 1px;
  margin-bottom: 12px;
}
.unit-portrait {
  width: 80px;
  height: 65px;
  object-fit: contain;
}
.guide-grid button {
  grid-template-columns: 80px 1fr;
  align-items: center;
}
.guide-grid .unit-portrait {
  grid-row: span 2;
}
.guide-grid small {
  grid-column: 2;
}
.guide-grid strong {
  text-align: left;
}
#hud #capacity {
  margin-left: 0;
  background: transparent;
  padding: 5px 8px;
  font-size: 12px;
  white-space: nowrap;
}
.selection-line {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.selection-line #status {
  margin: 0;
  flex: 1;
  min-width: 0;
}
.selection-line button {
  font-size: 12px;
  padding: 6px 10px;
}
#selection-help {
  color: #bdcfd3;
  font-size: 12px;
  margin-bottom: 6px;
}
#production {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  overflow: auto;
  min-height: 44px;
}
.queue-label {
  font-size: 11px;
  white-space: nowrap;
  color: #9cb5bf;
}
.queue-list {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  min-width: 0;
}
.queue-item {
  border: 1px solid #46616a;
  background: #17323c;
  border-radius: 6px;
  min-width: 100px;
  padding: 6px 9px;
  font-size: 12px;
  display: grid;
  gap: 3px;
}
.queue-item.current {
  border-color: #a9e8b8;
}
.queue-empty {
  font-size: 12px;
  color: #b8c5ca;
  padding: 8px 0;
}
progress {
  width: 100%;
  height: 6px;
  accent-color: #a9e8b8;
}
dialog#intel {
  width: min(640px, calc(100vw - 28px));
  max-height: calc(100dvh - 32px);
  padding: 20px;
  color: #edf4f3;
  background: #102530;
  border: 1px solid #6e919a;
  border-radius: 16px;
  overscroll-behavior: contain;
}
dialog::backdrop {
  background: #06151bd9;
}
#intel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
#intel h2 {
  font-size: 24px;
  margin: 5px 0;
}
#intel h3 {
  font-size: 17px;
}
#intel p {
  font-size: 14px;
}
.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.guide-grid button {
  display: grid;
  text-align: left;
  gap: 6px;
  min-height: 80px;
}
.guide-grid small {
  font-weight: 400;
}
.item-emblem {
  font-size: 40px;
  color: #a9e8b8;
}
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: #0b1b25;
  padding: 14px;
  border-radius: 8px;
}
.stat-grid dt {
  color: #adc5cc;
}
.stat-grid dd {
  margin: 0;
  text-align: right;
}
.tip {
  border-left: 3px solid #a9e8b8;
  padding-left: 12px;
}
.inventory {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: #0b1b25;
  border-radius: 8px;
  font-size: 13px;
}
.producer {
  border: 1px solid #3b5b64;
  border-radius: 8px;
  padding: 10px;
  margin-top: 10px;
}
.producer-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
@media (max-width: 420px) {
  #hud {
    gap: 6px;
  }
  .brand {
    letter-spacing: 1px;
  }
  .brand b {
    font-size: 11px;
  }
  #clock {
    font-size: 12px;
  }
  #resources {
    font-size: 13px;
  }
  .guide-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-height: 500px) {
  #selection-help {
    display: none;
  }
  .selection-line button {
    min-height: 34px;
  }
  .selection-line {
    margin-bottom: 3px;
  }
  #production {
    min-height: 36px;
  }
  .queue-item {
    padding: 3px 8px;
  }
  .queue-item small {
    font-size: 10px;
  }
  #intel {
    padding: 14px !important;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}
button,
select {
  font: inherit;
  color: inherit;
  background: #1a3340;
  border: 1px solid #46616a;
  border-radius: 8px;
  min-height: 44px;
  padding: 10px 14px;
  touch-action: manipulation;
}
button {
  cursor: pointer;
  font-weight: 650;
}
button:active {
  background: #376578;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:focus-visible,
select:focus-visible {
  outline: 2px solid #a8ecb8;
}
canvas#game {
  display: block;
  width: 100vw;
  height: 100dvh;
  touch-action: none;
}
#hud {
  position: fixed;
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  top: max(8px, env(safe-area-inset-top));
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 6px 10px;
  background: #0b1b25ed;
  border: 1px solid #38545d;
  border-radius: 10px;
  pointer-events: none;
}
#hud button {
  pointer-events: auto;
  margin-left: auto;
}
.brand {
  font-size: 10px;
  letter-spacing: 2px;
}
.brand b {
  display: block;
  color: #a9e8b8;
  font-size: 13px;
}
#resources {
  color: #80e9df;
}
#clock {
  font-variant-numeric: tabular-nums;
  color: #c1cdd1;
}
#notice {
  position: fixed;
  top: calc(max(8px, env(safe-area-inset-top)) + 65px);
  left: 16px;
  right: 16px;
  text-align: center;
  color: #e0efdd;
  font-size: 12px;
  pointer-events: none;
  text-shadow: 0 1px 4px #000;
}
#tools {
  position: fixed;
  left: max(10px, env(safe-area-inset-left));
  top: 110px;
  display: grid;
  gap: 6px;
}
#tools button {
  background: #102631e8;
  padding: 8px;
  min-width: 44px;
}
#minimap {
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  bottom: calc(var(--command-height, 112px) + 10px);
  width: 144px;
  height: 88px;
  border: 1px solid #69818b;
  border-radius: 6px;
  touch-action: none;
  background: #0b1c24;
}
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px max(12px, env(safe-area-inset-right))
    calc(10px + env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
  background: #0b1b25f5;
  border-top: 1px solid #38545d;
  min-height: 112px;
}
#status {
  font-size: 12px;
  color: #aec5cc;
  margin-bottom: 8px;
}
#panel {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  min-height: 44px;
}
#panel button {
  white-space: nowrap;
  font-size: 12px;
}
.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: radial-gradient(ellipse at 70% 20%, #224745e8, #07131bf5 70%);
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
  overflow: auto;
}
.overlay section {
  width: min(100%, 430px);
  max-height: 100%;
  overflow: auto;
  padding: 28px;
  background: #102530;
  border: 1px solid #3b5b64;
  border-radius: 18px;
  box-shadow: 0 22px 70px #0006;
}
h1 {
  font-size: 46px;
  line-height: 1.02;
  margin: 18px 0;
  letter-spacing: -2px;
}
h1 em {
  font-style: normal;
  color: #a9e8b8;
}
p {
  color: #b5c9cd;
  line-height: 1.55;
}
.eyebrow {
  font-size: 10px;
  color: #a9e8b8;
  letter-spacing: 2px;
}
label {
  display: grid;
  gap: 6px;
  margin: 15px 0;
  font-size: 12px;
  color: #b5c9cd;
}
select {
  width: 100%;
}
.primary {
  width: 100%;
  background: #a9e8b8;
  color: #10271f;
  border: 0;
  margin: 5px 0 10px;
}
#resume {
  width: 100%;
}
details {
  margin: 12px 0;
  font-size: 12px;
}
summary {
  cursor: pointer;
  padding: 8px 0;
}
small {
  font-size: 11px;
  color: #96adb7;
}
[hidden] {
  display: none !important;
}
@media (max-height: 500px) {
  .overlay section {
    width: min(94%, 650px);
    padding: 18px;
  }
  h1 {
    font-size: 32px;
    margin: 10px 0;
  }
  h1 br {
    display: none;
  }
  .overlay label {
    display: inline-grid;
    width: 48%;
    margin: 8px 0;
  }
  .overlay p {
    margin: 8px 0;
  }
  .brand b {
    font-size: 11px;
  }
  #minimap {
    bottom: calc(var(--command-height, 95px) + 8px);
    width: 126px;
    height: 77px;
  }
  footer {
    min-height: 95px;
    padding-top: 6px;
  }
  #tools {
    top: 90px;
    grid-template-columns: repeat(4, auto);
  }
  #notice {
    top: 70px;
    font-size: 11px;
  }
}
:root {
  --game-version: 2;
}
@media (max-height: 500px) {
  #tools {
    left: auto;
    right: max(12px, env(safe-area-inset-right));
  }
}
