:root {
  color-scheme: dark;
  --bg: #101619;
  --panel: #192226;
  --line: #344247;
  --text: #eef0e8;
  --muted: #a3b0b3;
  --amber: #f3c46b;
  --red: #f07872;
  --mint: #91d9bd;
  --scroll-thumb: #65777b;
  --scroll-hover: #91a4a7;
}
* {
  box-sizing: border-box;
  scrollbar-color: var(--scroll-thumb) var(--bg);
  scrollbar-width: thin;
}
::-webkit-scrollbar {
  width: 9px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-hover);
}
::-webkit-scrollbar-thumb:active {
  background: var(--amber);
}
html {
  scrollbar-gutter: stable;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    15px/1.6 "PingFang SC",
    "Microsoft YaHei",
    system-ui,
    sans-serif;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  cursor: pointer;
  color: inherit;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
button:focus-visible,
a:focus-visible,
canvas:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 4px;
}
button[hidden],
[hidden] {
  display: none !important;
}
.shell {
  max-width: 1280px;
  margin: auto;
  padding: 0 44px;
}
.topbar {
  height: 87px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.12em;
}
.brand-symbol {
  font-size: 35px;
  color: var(--amber);
  line-height: 1;
}
.edition {
  font: 11px monospace;
  letter-spacing: 0.14em;
  color: var(--muted);
  border-left: 1px solid var(--line);
  padding-left: 22px;
  margin-left: 12px;
}
.other-game {
  font-size: 13px;
  color: var(--muted);
}
.other-game:hover {
  color: var(--amber);
}
.mission-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 108px;
}
.sector {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 180px;
}
.status-dot {
  background: var(--amber);
  height: 7px;
  width: 7px;
  border-radius: 50%;
  box-shadow: 0 0 0 5px #f3c46b11;
}
.sector strong {
  font-weight: 500;
  font-size: 15px;
}
.sector small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}
.clock {
  text-align: center;
}
.clock > span {
  display: block;
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--muted);
}
.clock > strong {
  font:
    38px/1.3 ui-monospace,
    "SFMono-Regular",
    monospace;
  letter-spacing: -0.06em;
  color: var(--amber);
  font-weight: 500;
}
.stats {
  display: flex;
  align-items: center;
  gap: 32px;
  min-width: 180px;
  justify-content: flex-end;
}
.stats > div {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.stats > div > span {
  font-size: 11px;
  color: var(--muted);
}
.stats strong {
  font: 22px monospace;
}
.icon-button {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 5px;
  width: 43px;
  height: 43px;
  font: 23px monospace;
}
.icon-button:hover:not(:disabled) {
  border-color: var(--amber);
}
.arena {
  position: relative;
  height: min(65vh, 650px);
  min-height: 440px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: #151e21;
  border-radius: 7px;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.arena-top {
  position: absolute;
  top: 23px;
  left: 25px;
  width: 230px;
  pointer-events: none;
  text-shadow: 0 1px 3px var(--bg);
}
.health-label,
.xp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}
.health-label {
  color: var(--text);
  margin-bottom: 6px;
}
.health-label strong {
  font: 11px monospace;
}
.health-track,
.xp-track {
  height: 5px;
  background: #45505077;
  border-radius: 4px;
  overflow: hidden;
}
.health-track > div {
  height: 100%;
  background: var(--amber);
  width: 100%;
}
.xp-row {
  color: var(--muted);
  margin: 8px 0 5px;
  font-size: 10px;
}
.xp-track {
  height: 2px;
}
.xp-track > div {
  width: 0;
  background: var(--mint);
  height: 100%;
}
.arena-bottom {
  position: absolute;
  bottom: 20px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  font: 11px monospace;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.dash-status {
  color: var(--amber);
}
.support-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  padding: 16px 0;
}
.support-bar p {
  display: flex;
  gap: 4px;
  align-items: center;
  margin: 0;
}
.support-bar p > span {
  margin: 0 16px 0 7px;
}
kbd {
  min-width: 22px;
  height: 23px;
  border: 1px solid var(--line);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  font: 11px monospace;
  color: var(--text);
}
.loadout {
  border-top: 1px solid var(--line);
  display: flex;
  gap: 19px;
  align-items: center;
  padding: 20px 0;
  min-height: 77px;
  font-size: 12px;
}
.loadout-label {
  color: var(--muted);
  flex-shrink: 0;
}
.loadout #upgrades {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.equipment-chip {
  border: 1px solid var(--line);
  padding: 5px 11px;
  border-radius: 4px;
  color: var(--text);
}
.round-note {
  margin-left: auto;
  color: var(--muted);
  white-space: nowrap;
}
footer {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--line);
  padding: 19px 0 28px;
}
footer > span {
  font-size: 11px;
}
dialog {
  border: 1px solid #68716a;
  max-width: calc(100vw - 32px);
  width: 488px;
  padding: 0;
  color: var(--text);
  background: #182225f5;
  border-radius: 10px;
  box-shadow: 0 25px 100px #0008;
  max-height: 90svh;
  overflow-y: auto;
}
dialog::backdrop {
  background: #071012a3;
  backdrop-filter: blur(3px);
}
.menu-inner {
  padding: 36px 39px;
}
.menu-eyebrow {
  color: var(--amber);
  font: 11px monospace;
  letter-spacing: 0.17em;
  margin: 0 0 16px;
}
h1 {
  font-size: 58px;
  line-height: 1.16;
  letter-spacing: 0.06em;
  font-weight: 800;
  margin: 0 0 22px;
}
h1 > span {
  color: var(--amber);
  margin-left: 8px;
}
#menu-copy {
  color: #bec8c9;
  font-size: 14px;
  line-height: 1.9;
  margin: 0 0 25px;
}
.intro-guide {
  display: grid;
  gap: 16px;
  margin-bottom: 28px;
}
.intro-guide > div {
  display: flex;
  align-items: start;
  gap: 17px;
}
.intro-guide b {
  font: 12px monospace;
  color: var(--amber);
  padding-top: 5px;
}
.intro-guide span {
  font-size: 14px;
}
.intro-guide small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.primary-button,
.secondary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  width: 100%;
  border: 0;
  border-radius: 5px;
  padding: 12px 20px;
  background: var(--amber);
  color: var(--bg);
  font-size: 15px;
  font-weight: 600;
}
.primary-button:hover {
  background: #ffe0a1;
}
.primary-button:active {
  transform: translateY(1px);
}
.secondary-button {
  justify-content: center;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  margin-top: 10px;
}
.secondary-button:hover {
  border-color: var(--amber);
}
.menu-footnote {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  line-height: 1.8;
  margin: 16px 0 0;
}
.upgrade-choice {
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  padding: 16px;
  background: var(--bg);
  border-radius: 5px;
  margin: 9px 0;
  min-height: 88px;
}
.upgrade-choice:hover {
  border-color: var(--amber);
  background: var(--panel);
}
.upgrade-choice b {
  display: block;
  font-size: 16px;
  font-weight: 500;
}
.upgrade-choice small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}
.upgrade-number {
  color: var(--amber);
  font: 24px monospace;
}
.upgrade-copy {
  flex: 1;
}
#upgrade-options {
  margin-top: 20px;
  margin-bottom: 20px;
}
.touch-controls {
  display: none;
  position: absolute;
  inset: 0;
  pointer-events: none;
}
#joystick {
  position: absolute;
  bottom: 45px;
  left: 26px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: #91a4a712;
  border: 1px solid #91a4a766;
  touch-action: none;
  pointer-events: auto;
  user-select: none;
}
#stick {
  position: absolute;
  left: 33px;
  top: 33px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #f3c46b88;
  border: 1px solid var(--amber);
  pointer-events: none;
}
#joystick small {
  position: absolute;
  bottom: -23px;
  width: 100%;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}
#dash-touch {
  position: absolute;
  right: 25px;
  bottom: 59px;
  width: 69px;
  height: 69px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--amber);
  border-radius: 50%;
  background: #192226ba;
  color: var(--amber);
  font-size: 14px;
  touch-action: none;
  pointer-events: auto;
  user-select: none;
}
#dash-touch span {
  font-size: 10px;
  color: var(--muted);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (pointer: coarse) {
  .touch-controls {
    display: block;
  }
  .support-bar p {
    display: none;
  }
  .support-bar {
    justify-content: center;
  }
}
@media (max-width: 680px) {
  .shell {
    padding: 0 15px;
  }
  .topbar {
    height: 64px;
  }
  .brand {
    font-size: 16px;
  }
  .edition {
    display: none;
  }
  .other-game {
    font-size: 12px;
  }
  .mission-bar {
    height: 89px;
  }
  .sector {
    min-width: 0;
    gap: 9px;
  }
  .sector strong {
    font-size: 12px;
  }
  .sector small {
    font-size: 10px;
  }
  .clock strong {
    font-size: 31px;
  }
  .stats {
    min-width: 0;
    gap: 12px;
  }
  .stats strong {
    font-size: 18px;
  }
  .stats > div > span {
    font-size: 10px;
  }
  .clock > span {
    font-size: 10px;
  }
  .icon-button {
    width: 36px;
    height: 39px;
  }
  .arena {
    height: calc(100svh - 270px);
    min-height: 410px;
  }
  .arena-top {
    left: 15px;
    top: 17px;
    width: 190px;
  }
  .arena-bottom {
    left: 16px;
    right: 16px;
    bottom: 13px;
    font-size: 10px;
  }
  .touch-controls {
    display: block;
  }
  .support-bar p {
    display: none;
  }
  .support-bar {
    justify-content: center;
    padding: 12px 0;
  }
  .loadout {
    padding: 13px 0;
    gap: 10px;
  }
  .round-note {
    display: none;
  }
  .loadout-label {
    font-size: 11px;
  }
  .equipment-chip {
    padding: 4px 8px;
    font-size: 11px;
  }
  footer {
    font-size: 11px;
    padding-top: 15px;
  }
  footer > span {
    display: none;
  }
  .menu-inner {
    padding: 27px 26px;
  }
  h1 {
    font-size: 49px;
  }
  .intro-guide {
    gap: 13px;
  }
  .menu-eyebrow {
    font-size: 10px;
  }
  #menu-copy {
    font-size: 13px;
  }
  .menu-footnote {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media (forced-colors: active) {
  * {
    scrollbar-color: auto;
  }
  button,
  .equipment-chip {
    border: 1px solid ButtonText;
  }
  dialog::backdrop {
    background: Canvas;
    opacity: 0.8;
  }
}

.menu-home { display:flex; align-items:center; justify-content:center; min-height:44px; font-size:12px; color:var(--muted); margin-top:6px; }
.menu-home:hover { color:var(--amber); }
