:root {
  --bg: #101419;
  --panel: #161c21;
  --line: #34414a;
  --muted: #aebac1;
  --cyan: #83f4cd;
  --text: #edf2ed;
  --gold: #ffc177;
}
body {
  background: radial-gradient(ellipse at 30% 0%, #203031, #101419 490px);
}
.shell {
  max-width: 1280px;
}
.top {
  border-bottom-color: #485751;
}
.brand h1 {
  letter-spacing: 0.08em;
  font-weight: 900;
}
.eyebrow {
  color: #bcd1c9;
}
.mark {
  border-radius: 3px;
  background: #1b3733;
  box-shadow: none;
}
button {
  background: #20292e;
  border-color: #455659;
}
.primary,
.mobile-nav .primary {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #091d16;
  text-transform: none;
}
.panel,
.stat {
  background: #171e23;
  box-shadow: none;
}
.panelhead h2 {
  letter-spacing: 0.09em;
  font-size: 12px;
}
.stats .stat {
  padding: 9px 12px;
}
.stats .stat b {
  color: #f4faf5;
}
.mapwrap {
  padding: 8px;
  background: #0e1417;
  position: relative;
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0 29px,
    #9bb7a505 29px 30px
  );
}
#map {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 3px;
}
.mapwrap.zoom #map {
  min-width: 680px;
}
.maphint {
  position: static;
  margin-top: 7px;
  border: 0;
  background: none;
}
.district {
  padding: 0;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  aspect-ratio: 1.14;
  border-radius: 3px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--owner);
  color: #dfefe8;
  background: linear-gradient(150deg, #293739, #111a1e 75%);
  background: linear-gradient(
    150deg,
    color-mix(in srgb, var(--owner) 22%, #202a2e),
    #131b1f 75%
  );
}
.district::before,
.district::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: -1;
}
.district::before {
  inset: 20% 11% 14%;
  opacity: 0.52;
  border: 1px solid #a0b3a04d;
  background:
    repeating-linear-gradient(0deg, #102123 0 2px, transparent 2px 5px),
    repeating-linear-gradient(90deg, #424f51 0 7px, #0c1418 7px 10px);
  transform: skewY(-9deg);
  box-shadow:
    2px 4px #0a0f11,
    4px 8px #0a0f1160;
}
.district::after {
  width: 100%;
  height: 17%;
  bottom: 8%;
  left: 0;
  background: #0d1316;
  border-block: 1px dashed #667d7750;
}
.district[data-kind="works"]::before {
  inset: 28% 9% 14%;
  background: repeating-linear-gradient(135deg, #59635b 0 4px, #323735 4px 8px);
}
.district[data-kind="data"]::before {
  inset: 20% 23% 14%;
  border-color: #80aabc;
  background: repeating-linear-gradient(0deg, #46616e 0 3px, #253740 3px 6px);
}
.district[data-kind="clinic"]::before {
  inset: 23% 13% 17%;
  border-color: #b7baa0;
  background: #676957;
}
.district[data-kind="relay"]::before {
  inset: 10% 37% 14%;
  border-style: dotted;
}
.district[data-kind="hq"]::before {
  inset: 12% 19% 16%;
  border-color: var(--owner);
  opacity: 0.85;
}
.district:hover:not(:disabled) {
  background-color: #344;
}
.district[aria-pressed="true"] {
  outline: 2px solid #f3f5ec;
  outline-offset: -2px;
  z-index: 1;
}
.district.fog {
  color: #a9b9b8;
  border-color: #333f43;
  background: #171e22;
}
.district.fog::before {
  opacity: 0.2;
}
.district.move,
.district.target {
  outline: 2px solid #96fdd5;
  outline-offset: -2px;
  color: #e7ffec;
  background: #244940;
}
.district.target {
  outline-style: dashed;
}
.district.cut {
  border-style: dashed;
  border-color: #ffc177;
}
.district.alert {
  box-shadow: inset 0 0 0 2px #ff9979;
}
.coordinate {
  position: absolute;
  top: 2px;
  left: 4px;
  font:
    700 9px ui-monospace,
    monospace;
  color: #e1ede8;
  text-shadow: 0 1px 3px #000;
}
.district-icon {
  font-size: clamp(16px, 2.8vw, 28px);
  text-shadow: 0 2px 4px #000;
}
.occupants {
  display: flex;
  gap: 2px;
  position: absolute;
  right: 2px;
  bottom: 2px;
  font-size: 10px;
}
.occupants b {
  background: #a5f1cb;
  color: #13251e;
  border-radius: 3px;
  padding: 0 3px;
}
.occupants .hostile {
  background: #ffab98;
  color: #2e1915;
}
.district-class {
  margin: 8px 0;
  color: #bbc9cc;
  line-height: 1.4;
}
.district-class b {
  color: #f2e3bd;
}
#sheet .sheet-top {
  background: #1b2629;
}
#sheet:not([hidden]) {
  background: linear-gradient(165deg, #263436, #131c20 70%);
}
#sheet .sheet-local button {
  min-height: 44px;
}
#sheet .orders {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
#sheet .orders button {
  min-height: 44px;
  font-size: 12px;
}
#sheet .sheet-meta {
  max-height: 55px;
  overflow: auto;
}
#sheet .sheet-intel .district-title {
  display: none;
}
#sheet .sheet-intel .district-title + .row {
  display: flex;
}
#sheet .sheet-actions {
  padding-bottom: 5px;
}
#sheet .sheet-local:empty {
  display: none;
}
.report-modal {
  border-color: #59726e;
  background: #1a262b;
}
.report-event {
  min-height: 44px;
}
#toast {
  bottom: calc(64px + env(safe-area-inset-bottom));
}
@media (max-width: 700px), (max-width: 1050px) and (pointer: coarse) {
  .shell {
    padding: max(8px, env(safe-area-inset-top))
      max(8px, env(safe-area-inset-right))
      calc(72px + env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
  }
  .stats .stat {
    padding: 6px 5px;
  }
  .stat b {
    font-size: 15px;
  }
  .header-actions button {
    min-height: 44px;
    font-size: 10px;
  }
  .mapwrap {
    padding: 4px;
  }
  #map {
    gap: 2px;
  }
  .mapwrap:not(.zoom) .maphint {
    display: block;
  }
  .mapwrap.zoom {
    max-height: 53dvh;
  }
  .mobile-nav {
    position: fixed;
    inset: auto 0 0;
    margin: 0;
    border-radius: 0;
    padding: 6px max(8px, env(safe-area-inset-right))
      calc(6px + env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
  }
  .mobile-nav button {
    min-height: 44px;
  }
  #sheet:not([hidden]) {
    max-height: min(70dvh, 540px);
  }
  #zoom {
    min-width: 44px;
    min-height: 44px;
  }
}
@media (max-width: 360px) {
  .brand .mark {
    display: none;
  }
  #sheet .orders button {
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.duel-link {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 5px 9px;
  background: #20292e;
  border: 1px solid #455659;
  border-radius: 7px;
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  text-align: center;
}
.duel-link:focus-visible {
  outline: 2px solid var(--cyan);
}
.mobile-nav .duel-link {
  flex: 1;
  font-size: 11px;
  padding: 5px;
}
@media (max-width: 700px), (max-width: 1050px) and (pointer: coarse) {
  .desktop-duel {
    display: none;
  }
}
