:root {
  color-scheme: dark;
  --lime: #c6ed65;
  --text: #edf0e5;
  --muted: #a4b09e;
  --line: #4b58413b;
  --panel: #121a16ee;
}
.matchmaking-panel { max-width: 620px; margin: 0 auto; }
.matchmaking-panel > button { margin: 12px 8px 0 0; }
.mode-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin: 16px 0; }
.mode-grid button { padding: 24px 10px; font-size: 17px; }
.mode-grid button[aria-pressed="true"] { border-color: var(--lime); color: var(--lime); background: #c6ed6510; }
.menu-modes { width: 100%; }
.menu-modes .eyebrow { margin-bottom: 0; }
.menu-modes .mode-grid { grid-template-columns: 1fr 1fr; margin: 8px 0; }
.menu-modes .mode-grid button { padding: 14px 8px; font-size: 15px; justify-content: center; }
.matchmaking-panel > .eyebrow { margin-top: 22px; }
.searching-panel { text-align: center; padding: 40px 24px; }
.search-pulse { width: 65px; height: 65px; margin: 12px auto 30px; border: 2px solid #c6ed6540; border-top-color: var(--lime); border-radius: 50%; animation: searching-spin 1.4s linear infinite; }
@keyframes searching-spin { to { transform: rotate(360deg); } }
.match-found-panel { max-width: 1000px; margin: 0 auto; text-align: center; }
.team-columns { display: grid; grid-template-columns: 1fr 50px 1fr; gap: 20px; text-align: left; margin: 30px 0; }
.versus { align-self: center; text-align: center; color: var(--muted); font: 700 20px Consolas, monospace; }
.roster-player { border-bottom: 1px solid var(--line); padding: 12px 0; overflow-wrap: anywhere; }
.roster-player p { margin: 5px 0 0; }
.team-a { color: #77cad0; }.team-b { color: #ed9b65; }
.match-countdown { color: var(--lime); font: 700 clamp(32px,7vw,72px) Consolas, monospace; }
#matchFoundError { color: #ffc1a0; }
@media (max-width: 600px) { .mode-grid { grid-template-columns: 1fr 1fr; } .team-columns { gap: 10px; grid-template-columns: 1fr 26px 1fr; } .roster-player { font-size: 12px; } .match-found-panel { padding: 16px; } }
@media (prefers-reduced-motion: reduce) { .search-pulse { animation: none; } }
fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.pilot-account,
.account-tabs,
.account-menu {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.pilot-account {
  max-width: 440px;
  margin-top: 16px;
}
#accountName {
  width: 100%;
  color: var(--lime);
  font:
    12px Consolas,
    monospace;
  overflow-wrap: anywhere;
}
.account-menu {
  max-width: 420px;
}
.account-menu button,
.pilot-account button {
  padding: 9px 12px;
}
.account-screen {
  overflow-y: auto;
  pointer-events: auto;
  padding: 16px 0;
}
.auth-panel {
  width: min(460px, 100%);
  margin: 0 auto;
}
.auth-panel h1 {
  font-size: clamp(28px, 4vw, 40px);
}
.auth-panel form button {
  margin-top: 20px;
  width: 100%;
}
.auth-panel .account-tabs {
  margin-bottom: 10px;
}
.auth-panel [role="status"] {
  font-size: 13px;
  color: var(--lime);
  overflow-wrap: anywhere;
  margin: 14px 0;
}
.library-panel {
  width: min(1120px, 100%);
  margin: 0 auto;
}
.library-panel h1 {
  font-size: clamp(26px, 4vw, 40px);
}
.library-panel h2 {
  margin-top: 24px;
}
.robot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  gap: 16px;
  margin: 24px 0;
}
.robot-card {
  padding: 20px;
  background: #0d1714;
  border: 1px solid var(--line);
  border-top: 3px solid var(--robot-color, var(--lime));
  overflow-wrap: anywhere;
}
.robot-card h2 {
  margin-top: 0;
}
.robot-card .account-tabs button {
  padding: 9px;
  font-size: 11px;
}
.danger {
  color: #ffc1a0;
  border-color: #885e49;
}
.summary-counts {
  color: var(--lime);
  font:
    20px Consolas,
    monospace;
  margin: 20px 0;
}
.admin-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
.admin-row > div {
  flex: 1 1 280px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.admin-row p {
  margin: 5px 0;
}
.library-panel > .account-tabs {
  margin: 20px 0;
}
dialog.panel {
  color: var(--text);
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 24px;
}
dialog::backdrop {
  background: #020906bb;
  backdrop-filter: blur(5px);
}
dialog textarea {
  width: 100%;
  background: #0a130f;
  color: var(--text);
  border: 1px solid #536145;
  padding: 10px;
  font: inherit;
  resize: vertical;
}
.robot-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}
@media (max-height: 850px) {
  .menu {
    padding-top: 1vh !important;
    overflow-y: auto;
    pointer-events: auto;
  }
  .menu h1 {
    font-size: clamp(42px, 5vw, 72px) !important;
    margin: 10px 0 16px !important;
  }
  .menu-actions {
    margin: 16px 0 !important;
  }
}
@media (max-width: 700px) {
  .library-panel {
    padding: 16px;
  }
  .library-panel > .split {
    align-items: flex-start;
    flex-direction: column;
  }
  .robot-form-grid {
    grid-template-columns: 1fr;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #0d1512;
  color: var(--text);
  font:
    16px/1.5 "Segoe UI",
    Arial,
    sans-serif;
  overflow: hidden;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  border: 1px solid #6c7d525e;
  color: var(--text);
  background: #1c291e;
  padding: 13px 18px;
  letter-spacing: 0.7px;
  font:
    700 12px/1.5 Consolas,
    monospace;
  transition: background 0.15s;
}
button:hover {
  background: #37472c;
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.primary {
  background: var(--lime);
  color: #14210d;
  border-color: var(--lime);
}
.primary:hover {
  background: #dbff8b;
}
.text-button {
  background: none;
  border-color: transparent;
  padding: 8px;
  color: var(--muted);
}
:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}
input,
select {
  width: 100%;
  padding: 10px;
  background: #0a130f;
  border: 1px solid #536145;
  color: var(--text);
  border-radius: 0;
}
input[type="color"] {
  height: 42px;
  padding: 3px;
}
label {
  display: block;
  font:
    11px Consolas,
    monospace;
  letter-spacing: 1px;
  color: var(--muted);
  margin: 12px 0 8px;
}
h1,
h2,
p {
  margin-top: 0;
}
h1 {
  font-size: clamp(28px, 3vw, 48px);
  line-height: 1.05;
  letter-spacing: -1.5px;
  margin-bottom: 20px;
}
h1 span,
em {
  color: var(--lime);
  font-style: normal;
}
h2 {
  font-size: 22px;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
}
.eyebrow {
  font:
    11px/1.6 Consolas,
    monospace;
  letter-spacing: 2px;
  color: var(--lime);
  margin-bottom: 12px;
}
.small {
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}
#world {
  position: fixed;
  inset: 0;
}
#world canvas {
  width: 100%;
  height: 100%;
  display: block;
}
#labels {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.robot-label {
  position: absolute;
  transform: translate(-50%, -100%);
  font:
    11px Consolas,
    monospace;
  text-shadow: 0 1px 4px #000;
  background: #102018b3;
  padding: 3px 7px;
  white-space: nowrap;
  border-bottom: 2px solid #657459;
}
.robot-label.self {
  border-color: var(--lime);
  color: var(--lime);
}
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 91px;
  padding: 24px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(#0c150fed, transparent);
  z-index: 10;
  pointer-events: none;
}
header > * {
  pointer-events: auto;
}
.brand {
  font-size: 29px;
  line-height: 1;
  letter-spacing: -1.5px;
  text-decoration: none;
  color: var(--text);
  font-weight: 950;
}
.brand span {
  color: var(--lime);
}
.brand small {
  display: block;
  font:
    9px/2 Consolas,
    monospace;
  letter-spacing: 2.5px;
  color: var(--muted);
  margin-top: 5px;
}
nav {
  display: flex;
  align-items: center;
  gap: 18px;
}
#wallet {
  font:
    12px Consolas,
    monospace;
  color: var(--lime);
  padding-left: 18px;
  border-left: 1px solid #566944;
}
#connection {
  font:
    10px Consolas,
    monospace;
  color: var(--muted);
}
#ui {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
.screen {
  position: absolute;
  inset: 95px 36px 24px;
  pointer-events: none;
}
.screen button,
.screen input,
.screen select,
.panel {
  pointer-events: auto;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 24px;
  backdrop-filter: blur(8px);
}
.menu {
  padding: 8vh 0 0 4vw;
}
.menu h1 {
  font-size: clamp(50px, 6.4vw, 98px);
  font-weight: 950;
  line-height: 0.94;
  letter-spacing: -4px;
  margin: 18px 0 25px;
}
.intro {
  color: #bfcbba;
  font-size: 16px;
  max-width: 330px;
}
.menu-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 280px;
  margin: 28px 0 20px;
}
.menu-actions button {
  display: flex;
  justify-content: space-between;
}
.menu .small {
  max-width: 290px;
}
.scene-heading {
  position: absolute;
  left: 0;
  top: 12px;
}
.scene-heading h1 {
  font-size: 34px;
}
.garage-left {
  position: absolute;
  left: 0;
  top: 105px;
  width: 210px;
  max-height: calc(100% - 185px);
  overflow: auto;
  padding: 18px;
}
#categories {
  display: flex;
  flex-direction: column;
  margin-top: 20px;
  gap: 3px;
}
#categories button {
  text-align: left;
  background: none;
  border: 0;
  border-left: 2px solid transparent;
}
#categories button.active {
  color: var(--lime);
  background: #c6ed6510;
  border-left-color: var(--lime);
}
.garage-right {
  position: absolute;
  right: 0;
  top: 15px;
  width: 285px;
  max-height: calc(100% - 95px);
  overflow: auto;
  padding: 18px;
}
#parts {
  display: grid;
  gap: 6px;
}
.part {
  display: block;
  text-align: left;
  padding: 10px 12px;
  width: 100%;
  background: #19251b;
}
.part.active {
  border-color: var(--lime);
  color: var(--lime);
}
.part small {
  display: block;
  font-size: 10px;
  margin-top: 4px;
  color: var(--muted);
}
#partInfo {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
#partInfo strong {
  display: block;
  font-size: 16px;
  color: var(--text);
  margin-bottom: 7px;
}
#partInfo button {
  width: 100%;
  margin-top: 8px;
}
#stats {
  padding-top: 13px;
}
.stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 12px;
  color: var(--muted);
}
.stat b {
  color: var(--text);
  font:
    13px Consolas,
    monospace;
}
.orbit-hint {
  position: absolute;
  bottom: 110px;
  left: 35%;
  font:
    10px Consolas,
    monospace;
  letter-spacing: 1px;
  color: var(--muted);
}
.garage-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #102017de;
  border-top: 1px solid var(--line);
  padding: 14px 18px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}
.garage-bottom > span {
  margin-right: auto;
  font:
    10px Consolas,
    monospace;
  color: var(--muted);
}
.room-browser {
  position: absolute;
  top: 110px;
  left: 0;
  width: min(55%, 680px);
  max-height: calc(100% - 130px);
  overflow: auto;
}
.create-room {
  position: absolute;
  right: 0;
  top: 110px;
  width: 330px;
}
.create-room button {
  width: 100%;
}
.split,
.room-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.room-row {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  font-size: 14px;
}
.room-row small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 20px;
}
.inline-form input {
  width: 110px;
  text-transform: uppercase;
}
.inline-form label {
  white-space: nowrap;
  margin: 0;
  font-size: 10px;
}
.lobby-panel {
  position: absolute;
  top: 115px;
  left: 0;
  width: 390px;
  max-height: calc(100% - 120px);
  overflow: auto;
}
.lobby-player {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  font-size: 14px;
}
.lobby-player .swatch {
  width: 8px;
  height: 28px;
  flex-shrink: 0;
}
.lobby-player small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.lobby-player .status {
  margin-left: auto;
  font:
    10px Consolas,
    monospace;
  color: var(--lime);
}
.stack {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}
.results {
  display: grid;
  place-items: center;
}
.results > .panel {
  width: min(540px, 100%);
  max-height: 100%;
  overflow: auto;
}
.results button {
  width: 100%;
  margin-top: 10px;
}
.result-row {
  display: flex;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  gap: 10px;
  font-size: 14px;
}
.result-row small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.result-row b {
  color: var(--lime);
}
.match {
  inset: 0;
}
.match-top {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: #0c181ce0;
  border: 1px solid #7a956039;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 8px 18px;
  font:
    12px Consolas,
    monospace;
  white-space: nowrap;
}
.match-top strong {
  font-size: 24px;
  color: var(--lime);
}
.match-bottom {
  position: absolute;
  left: 30px;
  right: 30px;
  bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
}
.hud-meter {
  background: #0c181de6;
  padding: 15px 18px;
  width: 260px;
  border-left: 2px solid var(--lime);
}
.hud-meter label {
  display: flex;
  justify-content: space-between;
  margin: 0 0 9px;
  color: var(--text);
}
progress {
  width: 100%;
  height: 7px;
  border: 0;
  appearance: none;
  background: #394436;
}
progress::-webkit-progress-bar {
  background: #394436;
}
progress::-webkit-progress-value {
  background: var(--lime);
}
progress::-moz-progress-bar {
  background: var(--lime);
}
#energy::-webkit-progress-value {
  background: #77cad0;
}
#energy::-moz-progress-bar {
  background: #77cad0;
}
.weapon-hud {
  background: #0c181de6;
  padding: 15px 18px;
  min-width: 200px;
  border-right: 2px solid var(--lime);
  font:
    14px Consolas,
    monospace;
  text-align: right;
}
.weapon-hud small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 5px;
}
#trainingBanner {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  font:
    10px Consolas,
    monospace;
  color: #e8c98b;
  background: #171a0fe0;
  padding: 8px 14px;
  white-space: nowrap;
}
#destroyed {
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  padding: 25px;
  background: #0d191bd9;
}
#destroyed h2 {
  color: #f5b788;
  margin-bottom: 6px;
}
#destroyed p {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}
#onboarding {
  position: absolute;
  bottom: 125px;
  left: 50%;
  transform: translateX(-50%);
  background: #111d17e8;
  padding: 8px 16px;
  font-size: 12px;
  white-space: nowrap;
}
#toast {
  position: fixed;
  left: 50%;
  bottom: 110px;
  transform: translateX(-50%);
  z-index: 30;
  background: #24351f;
  border: 1px solid var(--lime);
  color: #e9f1dc;
  padding: 14px 22px;
  max-width: 90%;
  font-size: 14px;
}
#loading,
#fatal {
  position: fixed;
  inset: 0;
  background: #0d1712;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 30px;
  text-align: center;
  font:
    14px Consolas,
    monospace;
  color: var(--lime);
}
#fatal {
  color: #ffc1a0;
}
#touchControls {
  display: none;
}
[hidden] {
  display: none !important;
}
@media (max-width: 1050px) {
  header {
    padding: 20px;
  }
  .screen {
    left: 20px;
    right: 20px;
  }
  nav {
    gap: 7px;
  }
  .garage-right {
    width: 240px;
  }
  .garage-left {
    width: 180px;
  }
  .garage-bottom {
    gap: 6px;
    padding: 10px;
  }
  .garage-bottom > span {
    display: none;
  }
  .orbit-hint {
    left: 30%;
    font-size: 9px;
  }
  .create-room {
    width: 280px;
  }
  .room-browser {
    width: 54%;
  }
  .menu {
    padding-left: 1vw;
  }
  #connection {
    display: none;
  }
  .garage-bottom button {
    font-size: 10px;
  }
  .lobby-panel {
    width: 340px;
  }
}
@media (max-width: 700px) {
  body {
    overflow: hidden;
  }
  header {
    height: 75px;
    padding: 16px;
  }
  .brand {
    font-size: 23px;
  }
  .brand small {
    font-size: 7px;
  }
  nav .text-button {
    display: none;
  }
  #wallet {
    font-size: 11px;
    border: 0;
    padding: 0;
  }
  .screen {
    inset: 80px 14px 14px;
  }
  .menu {
    padding: 6vh 0 0;
  }
  .menu h1 {
    font-size: 60px;
  }
  .menu .intro {
    max-width: 220px;
    font-size: 14px;
  }
  .menu-actions {
    width: 240px;
  }
  .menu .small {
    font-size: 11px;
    width: 230px;
  }
  .scene-heading {
    top: 0;
  }
  .scene-heading h1 {
    font-size: 27px;
  }
  .garage-left {
    top: 70px;
    left: 0;
    width: 145px;
    padding: 10px;
    max-height: calc(100% - 140px);
  }
  .garage-right {
    top: 70px;
    right: 0;
    width: 175px;
    padding: 10px;
    max-height: calc(100% - 140px);
  }
  #categories button {
    padding: 9px 5px;
    font-size: 10px;
  }
  .part {
    font-size: 10px;
    padding: 8px;
  }
  .part small {
    font-size: 9px;
  }
  .stat {
    font-size: 10px;
  }
  .stat b {
    font-size: 11px;
  }
  #partInfo {
    font-size: 11px;
  }
  #partInfo strong {
    font-size: 13px;
  }
  .garage-bottom {
    left: -14px;
    right: -14px;
    bottom: -14px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .garage-bottom button {
    padding: 10px;
    font-size: 9px;
  }
  .orbit-hint {
    display: none;
  }
  .garage-left label {
    font-size: 9px;
  }
  .garage-left input {
    font-size: 12px;
  }
  .room-browser {
    top: 85px;
    left: 0;
    width: 100%;
    max-height: 45%;
    padding: 16px;
  }
  .create-room {
    top: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 16px;
  }
  .create-room .small {
    margin: 8px 0;
    font-size: 11px;
  }
  .create-room h2 {
    margin: 0 0 10px;
    font-size: 18px;
  }
  .create-room .eyebrow {
    display: none;
  }
  .inline-form {
    gap: 6px;
  }
  .inline-form label {
    font-size: 9px;
  }
  .inline-form button {
    font-size: 10px;
    padding: 10px;
  }
  .room-row {
    font-size: 12px;
  }
  .lobby-panel {
    top: 85px;
    width: 100%;
    max-height: calc(100% - 90px);
    padding: 16px;
    background: #121a16dd;
  }
  .lobby-player {
    padding: 8px 0;
  }
  .stack {
    grid-template-columns: 1fr 1fr;
  }
  .stack button {
    font-size: 10px;
  }
  .match {
    inset: 0;
  }
  .match-top {
    top: 10px;
    gap: 10px;
    font-size: 10px;
    padding: 6px 9px;
  }
  .match-top strong {
    font-size: 20px;
  }
  .match-top button {
    font-size: 9px;
  }
  #trainingBanner {
    top: 63px;
    font-size: 8px;
    white-space: normal;
    text-align: center;
    width: 90%;
  }
  .match-bottom {
    left: 12px;
    right: 12px;
    bottom: 14px;
    gap: 8px;
  }
  .hud-meter {
    width: 33%;
    padding: 9px;
  }
  .hud-meter label {
    font-size: 9px;
  }
  .weapon-hud {
    min-width: 0;
    width: 34%;
    padding: 9px;
    font-size: 10px;
  }
  .weapon-hud small {
    font-size: 8px;
  }
  #onboarding {
    white-space: normal;
    width: 90%;
    font-size: 11px;
    bottom: 100px;
  }
  #destroyed {
    width: 80%;
  }
  #destroyed h2 {
    font-size: 20px;
  }
  .results h1 {
    font-size: 28px;
  }
}
@media (pointer: coarse) {
  #touchControls {
    display: flex;
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 96px;
    justify-content: space-between;
    touch-action: none;
  }
  #touchControls > div {
    display: flex;
    gap: 5px;
  }
  #touchControls button {
    width: 45px;
    height: 45px;
    padding: 0;
    background: #233821dd;
    touch-action: none;
    user-select: none;
    font-size: 20px;
  }
  #touchControls button:last-child {
    font-size: 14px;
  }
  #touchControls button.pressed {
    background: var(--lime);
    color: #152210;
  }
  #onboarding {
    bottom: 155px;
  }
}
@media (max-width: 700px) {
  .garage-left {
    top: auto;
    bottom: 74px;
    width: 125px;
    height: 36%;
    max-height: none;
  }
  .garage-right {
    top: auto;
    bottom: 74px;
    width: calc(100% - 137px);
    height: 36%;
    max-height: none;
  }
  .garage-right #parts {
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }
  .garage .scene-heading {
    pointer-events: none;
  }
  .garage-left #categories {
    margin-top: 12px;
  }
  .garage-right .part {
    padding: 7px;
    font-size: 9px;
  }
}
