:root {
  --bg: #080a0f;
  --panel: #0b1220;
  --panel-2: #111827;
  --panel-3: #020617;
  --line: #0f172a;
  --line-soft: #334155;
  --text: #dbeafe;
  --muted: #8b98aa;
  --cyan: #06b6d4;
  --blue: #2563eb;
  --pink: #ec4899;
  --yellow: #f59e0b;
  --green: #10b981;
  --red: #ef4444;
  --orange: #f97316;
  --crt-glow-cyan: 0 0 8px rgba(6, 182, 212, 0.42), 0 0 18px rgba(6, 182, 212, 0.18);
  --crt-glow-pink: 0 0 8px rgba(236, 72, 153, 0.44), 0 0 18px rgba(236, 72, 153, 0.18);
  --crt-glow-gold: 0 0 8px rgba(245, 158, 11, 0.44), 0 0 18px rgba(245, 158, 11, 0.18);
  color-scheme: dark;
  font-family: "Share Tech Mono", "Cascadia Mono", "Courier New", "Microsoft YaHei UI", "Microsoft YaHei", monospace;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(rgba(34, 211, 238, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.028) 1px, transparent 1px),
    linear-gradient(180deg, rgba(6, 182, 212, 0.055), transparent 18rem),
    linear-gradient(0deg, rgba(236, 72, 153, 0.045), transparent 16rem),
    var(--bg);
  background-size: 20px 20px, 20px 20px, auto, auto, auto;
  color: var(--text);
  image-rendering: pixelated;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
}

body::before {
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 50%, rgba(0, 0, 0, 0.11) 50%),
    linear-gradient(90deg, rgba(255, 0, 102, 0.028), rgba(0, 255, 255, 0.018), rgba(255, 255, 255, 0.018));
  background-size: 100% 4px, 6px 100%;
  mix-blend-mode: screen;
  opacity: 0.42;
}

body::after {
  background: radial-gradient(ellipse at center, transparent 56%, rgba(0, 0, 0, 0.28) 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

a {
  color: inherit;
}

code {
  color: var(--yellow);
}

.top-strip {
  position: fixed;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--cyan), var(--pink), var(--yellow));
  z-index: 20;
}

.screen-center {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.app-shell {
  width: min(1120px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 26px 0 42px;
}

.pixel-card,
.pixel-card-blue,
.pixel-card-gold,
.pixel-card-pink {
  position: relative;
  border: 4px solid var(--line);
  border-radius: 0;
  background:
    linear-gradient(rgba(6, 182, 212, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6, 182, 212, 0.026) 1px, transparent 1px),
    rgba(11, 18, 32, 0.95);
  background-size: 18px 18px;
  box-shadow:
    0 -4px 0 -2px var(--bg),
    0 4px 0 -2px var(--bg),
    -4px 0 0 -2px var(--bg),
    4px 0 0 -2px var(--bg),
    0 0 0 2px var(--cyan),
    0 0 18px rgba(6, 182, 212, 0.20),
    inset 0 0 22px rgba(6, 182, 212, 0.055);
}

.pixel-card::after,
.pixel-card-blue::after,
.pixel-card-gold::after,
.pixel-card-pink::after {
  content: "";
  position: absolute;
  inset: 6px;
  pointer-events: none;
  border-top: 1px solid rgba(219, 234, 254, 0.10);
  border-left: 1px solid rgba(219, 234, 254, 0.08);
  box-shadow:
    inset 0 0 0 1px rgba(2, 6, 23, 0.56),
    inset 0 0 18px rgba(6, 182, 212, 0.035);
}

.pixel-card-gold {
  box-shadow:
    0 -4px 0 -2px var(--bg),
    0 4px 0 -2px var(--bg),
    -4px 0 0 -2px var(--bg),
    4px 0 0 -2px var(--bg),
    0 0 0 2px var(--yellow),
    0 0 18px rgba(245, 158, 11, 0.20),
    inset 0 0 22px rgba(245, 158, 11, 0.06);
}

.pixel-card-pink {
  box-shadow:
    0 -4px 0 -2px var(--bg),
    0 4px 0 -2px var(--bg),
    -4px 0 0 -2px var(--bg),
    4px 0 0 -2px var(--bg),
    0 0 0 2px var(--pink),
    0 0 20px rgba(236, 72, 153, 0.24),
    inset 0 0 22px rgba(236, 72, 153, 0.06);
}

.panel-pad {
  padding: 22px;
}

.terminal-title {
  margin: 0;
  color: var(--pink);
  font-size: clamp(30px, 7vw, 44px);
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  text-shadow: var(--crt-glow-pink);
}

.terminal-subtitle {
  margin: 8px 0 0;
  color: var(--cyan);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  margin: 24px 0 18px;
}

.tab {
  min-height: 44px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}

.tab.active {
  border-color: var(--pink);
  color: var(--pink);
}

.form-stack {
  display: grid;
  gap: 15px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label,
.field-title {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  text-shadow: var(--crt-glow-cyan);
}

.pixel-input,
.pixel-select {
  width: 100%;
  min-height: 43px;
  border: 2px solid #1f2937;
  border-radius: 3px;
  padding: 0 12px;
  background: #050812;
  color: #fff;
  outline: none;
  box-shadow: inset 0 0 12px rgba(6, 182, 212, 0.055);
}

.pixel-input:focus,
.pixel-select:focus {
  border-color: var(--pink);
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.24);
}

.pixel-btn,
.pixel-btn-blue,
.pixel-btn-cyan,
.pixel-btn-ghost,
.pixel-btn-danger {
  display: inline-grid;
  place-items: center;
  min-height: 42px;
  border: 3px solid #020617;
  border-radius: 2px;
  padding: 0 15px;
  background: var(--pink);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0;
  text-decoration: none;
  box-shadow:
    0 -3px 0 -1px #020617,
    0 3px 0 -1px #020617,
    -3px 0 0 -1px #020617,
    3px 0 0 -1px #020617,
    0 0 12px rgba(236, 72, 153, 0.22);
}

.pixel-btn:hover,
.pixel-btn-blue:hover,
.pixel-btn-cyan:hover,
.pixel-btn-ghost:hover,
.pixel-btn-danger:hover,
.pixel-btn:focus-visible,
.pixel-btn-blue:focus-visible,
.pixel-btn-cyan:focus-visible,
.pixel-btn-ghost:focus-visible,
.pixel-btn-danger:focus-visible {
  filter: brightness(1.12);
  outline: 1px solid rgba(255, 255, 255, 0.24);
  outline-offset: 2px;
}

.pixel-btn:active,
.pixel-btn-blue:active,
.pixel-btn-cyan:active,
.pixel-btn-ghost:active,
.pixel-btn-danger:active {
  transform: translate(1px, 1px);
  box-shadow: none;
}

.pixel-btn-blue {
  background: var(--blue);
  box-shadow:
    0 -3px 0 -1px #020617,
    0 3px 0 -1px #020617,
    -3px 0 0 -1px #020617,
    3px 0 0 -1px #020617,
    0 0 12px rgba(37, 99, 235, 0.28);
}

.pixel-btn-cyan {
  background: #0891b2;
  box-shadow:
    0 -3px 0 -1px #020617,
    0 3px 0 -1px #020617,
    -3px 0 0 -1px #020617,
    3px 0 0 -1px #020617,
    0 0 12px rgba(6, 182, 212, 0.28);
}

.pixel-btn-ghost {
  background: #1f2937;
  color: var(--text);
  box-shadow:
    0 -3px 0 -1px #020617,
    0 3px 0 -1px #020617,
    -3px 0 0 -1px #020617,
    3px 0 0 -1px #020617,
    0 0 10px rgba(6, 182, 212, 0.16);
}

.pixel-btn-danger {
  background: #b91c1c;
  box-shadow:
    0 -3px 0 -1px #020617,
    0 3px 0 -1px #020617,
    -3px 0 0 -1px #020617,
    3px 0 0 -1px #020617,
    0 0 12px rgba(239, 68, 68, 0.28);
}

.message {
  display: none;
  padding: 12px;
  border: 1px solid #7f1d1d;
  border-radius: 2px;
  background: rgba(127, 29, 29, 0.45);
  color: #fca5a5;
  font-size: 12px;
  line-height: 1.6;
}

.message.show {
  display: block;
}

.message.success {
  border-color: #166534;
  background: rgba(20, 83, 45, 0.48);
  color: #86efac;
}

.hint-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}

.create-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.9fr);
  gap: 24px;
  align-items: start;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.section-heading h1,
.section-heading h2 {
  margin: 0;
  color: var(--blue);
  font-size: 20px;
  letter-spacing: 0;
}

.section-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.option-grid {
  display: grid;
  gap: 10px;
}

.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.option-btn {
  min-height: 36px;
  border: 2px solid #374151;
  border-radius: 2px;
  background: #111827;
  color: var(--text);
  font-weight: 700;
  font-size: 12px;
}

.option-btn.active {
  border-color: var(--blue);
  background: #1e3a8a;
  color: #bfdbfe;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.35);
}

.range-row {
  display: grid;
  gap: 10px;
}

input[type="range"] {
  accent-color: var(--blue);
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.swatch {
  width: 26px;
  height: 26px;
  border: 2px solid var(--line);
  border-radius: 2px;
  padding: 0;
}

.swatch.active {
  border-color: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.45);
}

.preview-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 290px);
  aspect-ratio: 1;
  margin: 0 auto;
  overflow: hidden;
  border: 4px solid #020617;
  border-radius: 0;
  background:
    linear-gradient(rgba(34, 211, 238, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.12) 1px, transparent 1px),
    #020617;
  background-size: 16px 16px;
}

.preview-frame::after,
.crt::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.22) 50%);
  background-size: 100% 4px;
  opacity: 0.65;
}

#avatarCanvas,
#menuAvatar {
  width: min(76%, 210px);
  height: min(76%, 210px);
  image-rendering: pixelated;
}

.bio-box,
.data-box {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 2px;
  padding: 12px;
  background: #020617;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.data-box strong,
.bio-box strong {
  color: var(--text);
}

.header-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 2px solid var(--yellow);
  border-radius: 2px;
  background: #020617;
  color: var(--yellow);
  font-weight: 900;
}

.header-hud h1 {
  margin: 0;
  color: var(--yellow);
  font-size: clamp(20px, 4vw, 28px);
  line-height: 1.05;
  text-shadow: var(--crt-glow-gold);
}

.header-hud p {
  margin: 5px 0 0;
  color: var(--cyan);
  font-size: 12px;
  text-shadow: var(--crt-glow-cyan);
}

.hud-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.hud-chip {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 3px;
  padding: 8px 10px;
  background: #020617;
  color: var(--muted);
  font-size: 12px;
  box-shadow: inset 0 0 10px rgba(6, 182, 212, 0.055);
}

.hud-chip strong {
  color: var(--green);
  text-shadow: 0 0 8px rgba(16, 185, 129, 0.42);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.button-row > a,
.button-row > button {
  display: grid;
  place-items: center;
  text-decoration: none;
}

.menu-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(330px, 0.85fr);
  gap: 22px;
  margin-top: 22px;
}

.profile-shell {
  width: min(1040px, calc(100vw - 24px));
}

.profile-page-head {
  align-items: center;
  justify-content: flex-start;
}

.profile-page-head .brand-row {
  flex: 1;
}

.profile-back-btn {
  text-decoration: none;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.25fr);
  gap: 18px;
  margin-top: 22px;
}

.main-menu-panel {
  background:
    linear-gradient(rgba(245, 158, 11, 0.048) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 158, 11, 0.038) 1px, transparent 1px),
    rgba(11, 18, 32, 0.96);
  background-size: 18px 18px;
}

.terminal-menu {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  border: 2px solid #111827;
  border-radius: 0;
  padding: 14px;
  background: #020617;
}

.terminal-frame-title {
  width: fit-content;
  border: 2px solid var(--yellow);
  border-radius: 2px;
  padding: 5px 9px;
  color: var(--yellow);
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: var(--crt-glow-gold);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.18);
}

.main-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.main-status-grid strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.menu-command-groups {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

#quick-menu-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#district-command-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.menu-divider {
  margin-bottom: 8px;
  border-block: 1px solid rgba(148, 163, 184, 0.18);
  padding: 6px 0;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  text-shadow: var(--crt-glow-cyan);
}

.command-grid,
.transport-grid {
  display: grid;
  gap: 8px;
}

.command-btn,
.transport-btn {
  display: grid;
  gap: 4px;
  min-height: 48px;
  border: 2px solid var(--line-soft);
  border-radius: 3px;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.86);
  color: var(--text);
  text-align: left;
  box-shadow: inset 0 0 12px rgba(6, 182, 212, 0.04);
  transition: transform 90ms ease, border-color 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

#quick-menu-grid .command-btn {
  align-content: center;
  justify-items: center;
  aspect-ratio: 1;
  min-height: 0;
  padding: 7px;
  text-align: center;
}

#district-command-grid .command-btn {
  align-content: center;
  justify-items: center;
  aspect-ratio: 1;
  min-height: 0;
  padding: 8px;
  text-align: center;
}

#quick-menu-grid .command-btn span {
  font-size: 11px;
}

#district-command-grid .command-btn span {
  font-size: 11px;
}

#quick-menu-grid .command-btn strong {
  font-size: 12px;
  line-height: 1.2;
}

#district-command-grid .command-btn strong {
  font-size: 12px;
  line-height: 1.2;
}

.command-btn:hover,
.transport-btn:hover,
.command-btn.current {
  border-color: var(--yellow);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.22), inset 0 0 12px rgba(245, 158, 11, 0.06);
}

.command-btn:active,
.transport-btn:active,
.location-card:active {
  transform: translate(1px, 1px);
  filter: brightness(0.9);
}

.command-btn span,
.transport-btn span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.command-btn strong,
.transport-btn strong {
  color: var(--text);
  font-size: 12px;
  overflow-wrap: anywhere;
  text-shadow: 0 0 6px rgba(219, 234, 254, 0.18);
}

.command-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.transport-panel {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(251, 191, 36, 0.34);
  border-radius: 3px;
  padding: 12px;
  background: rgba(24, 18, 6, 0.92);
  box-shadow: inset 0 0 14px rgba(245, 158, 11, 0.08);
}

.transport-panel p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.transport-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stack {
  display: grid;
  gap: 18px;
}

.worldview-map-wrap {
  position: relative;
  overflow: hidden;
  border: 2px solid #111827;
  border-radius: 0;
  background: #020617;
}

.worldview-map-art {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.map-grid {
  position: absolute;
  inset: 0;
}

.district-node {
  position: relative;
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 96px;
  border: 2px solid var(--line-soft);
  border-radius: 3px;
  padding: 10px;
  background: rgba(15, 23, 42, 0.78);
  color: var(--text);
  text-align: left;
}

.worldview-map-hotspots .district-node {
  position: absolute;
  width: clamp(72px, 13.5%, 134px);
  min-height: 52px;
  transform: translate(-50%, -50%);
  border-color: rgba(34, 211, 238, 0.14);
  padding: 7px;
  background: rgba(2, 6, 23, 0.18);
  opacity: 0.16;
}

.worldview-map-hotspots .district-node:hover,
.worldview-map-hotspots .district-node.current,
.worldview-map-hotspots .district-node.target {
  opacity: 1;
  background: rgba(2, 6, 23, 0.74);
}

.district-node.current {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.45), 0 0 12px rgba(16, 185, 129, 0.24);
}

.district-node.target {
  border-color: var(--pink);
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.24);
}

.district-index {
  position: absolute;
  top: 6px;
  right: 7px;
  color: #020617;
  background: var(--cyan);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 900;
}

.district-name {
  padding-right: 28px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
}

.district-meta {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.worldview-map-hotspots .district-meta {
  display: none;
}

.district-quote {
  margin: 14px 0 0;
  border-left: 4px solid var(--orange);
  padding: 10px 12px;
  background: #020617;
  color: var(--text);
  font-size: 12px;
  line-height: 1.7;
}

.location-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.location-card {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  aspect-ratio: 1;
  min-height: 0;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 3px;
  padding: 7px 5px;
  background: #020617;
  color: var(--text);
  text-align: center;
  cursor: pointer;
  transition: transform 90ms ease, border-color 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.location-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.location-icon {
  display: grid;
  flex: 0 0 24px;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(251, 191, 36, 0.45);
  border-radius: 4px;
  background: rgba(251, 191, 36, 0.12);
  font-size: 14px;
}

.location-card strong {
  min-width: 0;
  color: var(--yellow);
  font-size: 11px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.location-card p {
  display: none;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.location-card button {
  align-self: end;
}

.location-card:hover,
.location-card:focus-visible {
  border-color: var(--yellow);
  outline: none;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.24);
}

.row-list {
  display: grid;
  gap: 10px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  color: var(--muted);
  font-size: 12px;
}

.info-row span:last-child {
  color: var(--text);
  text-align: right;
}

.stat-row {
  display: grid;
  gap: 6px;
}

.stat-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.stat-bar {
  height: 12px;
  border: 1px solid #1f2937;
  border-radius: 0;
  padding: 2px;
  overflow: hidden;
  background: #020617;
}

.stat-fill {
  width: 0;
  height: 100%;
  border-radius: 0;
  background: var(--blue);
  transition: width 180ms ease;
  box-shadow: 0 0 10px currentColor;
}

.list-card {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 3px;
  padding: 11px;
  background: #020617;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.list-card strong {
  color: var(--text);
  text-shadow: 0 0 6px rgba(219, 234, 254, 0.18);
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.log-box {
  min-height: 150px;
  max-height: 230px;
  overflow: auto;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 2px;
  padding: 10px;
  background: #020617;
  color: var(--green);
  font-size: 12px;
  line-height: 1.6;
}

.login-card {
  width: min(100%, 460px);
}

.hidden {
  display: none !important;
}

.map-shell {
  width: min(1280px, calc(100vw - 24px));
}

.map-panel {
  margin-top: 22px;
}

.map-frame-wrap {
  position: relative;
  min-height: min(72vh, 720px);
  margin-top: 14px;
  overflow: hidden;
  border: 3px solid #111827;
  border-radius: 0;
  background:
    linear-gradient(rgba(34, 211, 238, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.08) 1px, transparent 1px),
    #020617;
  background-size: 18px 18px;
}

.godot-frame {
  display: block;
  width: 100%;
  height: min(72vh, 720px);
  border: 0;
  background: #020617;
}

.map-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 10px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

.map-placeholder strong {
  color: var(--cyan);
  font-size: 16px;
}

.map-bridge-status {
  margin-top: 12px;
}

@media (max-width: 900px) {
  .create-grid,
  .menu-grid {
    grid-template-columns: 1fr;
  }

  .header-hud {
    align-items: flex-start;
    flex-direction: column;
  }

  .hud-chip-row {
    justify-content: flex-start;
    width: 100%;
  }

  .map-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .location-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .main-status-grid,
  .transport-grid {
    grid-template-columns: 1fr;
  }

  .menu-command-groups {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .panel-pad {
    padding: 16px;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .section-heading > .pixel-btn,
  .section-heading > .pixel-btn-blue,
  .section-heading > .pixel-btn-cyan,
  .section-heading > .pixel-btn-ghost,
  .section-heading > .pixel-btn-danger,
  .section-heading > a {
    width: 100%;
    min-height: 40px;
    display: grid;
    place-items: center;
    text-align: center;
  }

  .button-row {
    display: grid;
  }

  .cols-2,
  .cols-3,
  .cols-4,
  .action-grid {
    grid-template-columns: 1fr;
  }

  .location-grid {
    gap: 6px;
  }

  .location-card {
    padding: 6px 4px;
  }

  .location-card strong {
    font-size: 10px;
  }

  .map-grid {
    grid-template-columns: 1fr;
  }

  .hint-row {
    flex-direction: column;
  }

  .command-input-row {
    grid-template-columns: 1fr;
  }

  #quick-menu-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  #quick-menu-grid .command-btn {
    min-height: 74px;
  }

  #district-command-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  #quick-menu-grid .command-btn strong {
    font-size: 11px;
  }

  #district-command-grid .command-btn strong {
    font-size: 10px;
  }
}
