:root {
  font-family:
    Inter,
    Segoe UI,
    Arial,
    sans-serif;
  color: #e7eeef;
  background: #05090e;
  font-synthesis: none;
  --accent: #79e7d6;
  --muted: #80929c;
  --line: #ffffff12;
  --panel: #09131beb;
  --gold: #d7b487;
  --danger: #ff7183;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  overflow: hidden;
  font-size: 13px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
a {
  color: var(--accent);
  text-decoration: none;
}
button {
  color: inherit;
  border: 1px solid var(--line);
  background: #11212c;
  border-radius: 5px;
  padding: 10px 14px;
  transition: 0.16s;
}
button:hover {
  background: #1b3341;
  border-color: #79e7d655;
}
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #07201d;
  font-weight: 700;
}
button.primary:hover {
  background: #a4f5e8;
}
button.danger {
  color: var(--danger);
}
button.flat {
  background: transparent;
}
button.small {
  padding: 6px 9px;
  font-size: 11px;
}
input,
select,
textarea {
  background: #07121b;
  color: #dfebee;
  border: 1px solid #29404d;
  border-radius: 5px;
  padding: 11px;
  min-width: 0;
}
textarea {
  resize: vertical;
}
label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #9cabb2;
  font-size: 12px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h2 {
  font-weight: 500;
  font-size: 25px;
  letter-spacing: -0.7px;
}
h3 {
  font-weight: 500;
  font-size: 15px;
}
p {
  line-height: 1.65;
  color: #9aafb8;
}
.muted {
  color: var(--muted);
}
.mono {
  font-family: Consolas, monospace;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 2.4px;
  font-size: 10px;
  color: var(--gold);
  font-weight: 600;
}
.badge {
  font-size: 10px;
  padding: 5px 8px;
  border: 1px solid #79e7d630;
  color: var(--accent);
  border-radius: 3px;
  letter-spacing: 1px;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.spread {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.divider {
  height: 1px;
  background: var(--line);
  margin: 20px 0;
}
.hidden {
  display: none !important;
}
#space {
  position: fixed;
  inset: 0;
}
#space canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
#app {
  position: relative;
  z-index: 1;
}
.glass {
  background: var(--panel);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  border-radius: 7px;
}
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 76px;
  padding: 0 30px 0 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(#050b12f5, #050b1200);
  pointer-events: none;
}
.topbar > * {
  pointer-events: auto;
}
.brand {
  display: flex;
  gap: 13px;
  align-items: center;
  font-size: 14px;
  letter-spacing: 3px;
  font-weight: 600;
}
.brand-mark {
  width: 29px;
  height: 29px;
  transform: rotate(45deg);
  border: 1px solid var(--accent);
  position: relative;
}
.brand-mark:before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid var(--accent);
}
.brand small {
  display: block;
  color: #7d929d;
  font-size: 8px;
  letter-spacing: 4.3px;
  margin-top: 5px;
}
.top-meta {
  gap: 24px;
  color: #afbdc4;
  font-size: 12px;
}
.dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 7px;
  box-shadow: 0 0 10px var(--accent);
}
.rail {
  position: fixed;
  top: 115px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rail button {
  width: 67px;
  height: 65px;
  background: #08131bad;
  border-color: #ffffff09;
  padding: 8px 4px;
  color: #8398a5;
  font-size: 9px;
  letter-spacing: 0.5px;
}
.rail button span {
  display: block;
  font-size: 22px;
  margin-bottom: 5px;
  line-height: 20px;
}
.rail button.active {
  border-color: #79e7d64a;
  color: var(--accent);
  background: #12333499;
}
.sector-title {
  position: fixed;
  left: 120px;
  top: 113px;
  pointer-events: none;
}
.sector-title h1 {
  font-size: 30px;
  letter-spacing: -1px;
  font-weight: 400;
  margin: 8px 0;
}
.sector-title .muted {
  font-size: 11px;
  letter-spacing: 0.7px;
}
.sector-subtitle {
  display: flex;
  gap: 12px;
  align-items: center;
}
.sector-pill {
  background: #09151d99;
  padding: 5px 9px;
  color: #9cacb3;
  border: 1px solid var(--line);
  border-radius: 3px;
}
.contacts {
  position: fixed;
  right: 24px;
  top: 113px;
  width: 245px;
  padding: 18px;
}
.contacts header {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #77929f;
  letter-spacing: 1.5px;
  margin-bottom: 15px;
}
.contact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
}
.contact:hover {
  color: var(--accent);
}
.contact .name {
  font-size: 12px;
}
.contact small {
  font-size: 10px;
  color: #8398a5;
  display: block;
  margin-top: 5px;
}
.contact i {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--danger);
  border-radius: 50%;
  margin-right: 8px;
}
.contact.friendly i {
  background: var(--accent);
}
.sector-action {
  position: fixed;
  right: 24px;
  top: 350px;
  width: 245px;
  padding: 16px;
}
.sector-action p {
  font-size: 11px;
  margin-bottom: 12px;
}
.sector-action button {
  width: 100%;
  margin-top: 8px;
}
.cockpit {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 560px;
  padding: 18px 23px;
}
.cockpit .ship-name {
  font-size: 13px;
  letter-spacing: 1px;
}
.cockpit .flight-state {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--accent);
}
.meters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 18px;
}
.meter-label {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  letter-spacing: 1px;
  color: #9dafb9;
}
.bar {
  height: 3px;
  background: #25333b;
  margin-top: 9px;
  border-radius: 4px;
  overflow: hidden;
}
.bar b {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 0.2s;
}
.bar.shield b {
  background: #82adf8;
}
.bar.energy b {
  background: var(--gold);
}
.cockpit-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 17px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  color: #8397a3;
}
.kbd {
  border: 1px solid #40515d;
  border-radius: 3px;
  padding: 2px 5px;
  font-size: 9px;
}
.chatbox {
  position: fixed;
  left: 120px;
  bottom: 28px;
  width: 290px;
  font-size: 10px;
  color: #859aa5;
}
.chatbox .channel {
  color: var(--accent);
  font-size: 9px;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
}
.chat-message {
  margin: 8px 0;
  line-height: 1.5;
  max-width: 290px;
  word-break: break-word;
}
.chat-message.danger {
  color: #db8a93;
}
.chat-message.reward {
  color: var(--gold);
}
.chatbox form {
  margin-top: 10px;
}
.chatbox input {
  font-size: 10px;
  padding: 9px;
  width: 100%;
  background: #08151ba8;
}
.hint {
  position: fixed;
  left: 50%;
  bottom: 161px;
  transform: translateX(-50%);
  font-size: 10px;
  color: #8ca1ad;
  letter-spacing: 0.3px;
  background: #07121b99;
  border-radius: 4px;
  padding: 8px 15px;
}
.toast {
  position: fixed;
  left: 50%;
  top: 85px;
  transform: translateX(-50%);
  padding: 12px 20px;
  max-width: 580px;
  background: #142730;
  border: 1px solid #47706f;
  border-radius: 5px;
  z-index: 40;
  font-size: 12px;
  box-shadow: 0 8px 40px #0008;
}
.toast.error {
  background: #321c24;
  border-color: #864354;
}
.panel {
  position: fixed;
  top: 95px;
  right: 24px;
  bottom: 182px;
  width: 410px;
  padding: 25px;
  overflow: auto;
  z-index: 8;
  box-shadow: 0 20px 80px #0006;
}
.panel.wide {
  width: 620px;
}
.panel h2 {
  margin: 10px 0 8px;
}
.panel-close {
  position: absolute;
  right: 16px;
  top: 15px;
  padding: 3px 8px;
  background: transparent;
  border: none;
  font-size: 20px;
  color: #81939b;
}
.panel-header {
  margin-bottom: 22px;
}
.tabs {
  display: flex;
  gap: 6px;
  margin: 22px 0;
}
.tabs button {
  flex: 1;
  padding: 9px 5px;
  font-size: 11px;
}
.tabs button.active {
  color: var(--accent);
  background: #18362e;
  border-color: #79e7d636;
}
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stat {
  padding: 14px;
  background: #ffffff04;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.stat small {
  display: block;
  color: #7e949f;
  font-size: 10px;
  margin-bottom: 7px;
}
.stat b {
  font-size: 16px;
  font-weight: 500;
}
.market-row {
  display: grid;
  grid-template-columns: 1fr 60px 65px 65px;
  align-items: center;
  gap: 6px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.market-row small {
  display: block;
  color: #7d939e;
  font-size: 10px;
  margin-top: 6px;
}
.market-row input {
  padding: 7px;
  width: 60px;
}
.market-row button {
  padding: 8px 3px;
  font-size: 10px;
}
.quest-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 5px;
  margin-bottom: 10px;
  background: #ffffff03;
}
.quest-card h3 {
  margin: 0;
}
.quest-card p {
  font-size: 11px;
  margin: 10px 0;
}
.quest-card footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.power-row {
  display: grid;
  grid-template-columns: 95px 1fr 36px;
  gap: 12px;
  align-items: center;
  margin: 20px 0;
  font-size: 12px;
}
.power-row input {
  padding: 0;
  width: 100%;
  accent-color: var(--accent);
}
.preset-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.preset-row button {
  font-size: 10px;
  padding: 8px;
}
.route-list {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 15px 0;
}
.route-list span {
  padding: 5px 8px;
  background: #15302d;
  color: var(--accent);
  border-radius: 3px;
  font-size: 10px;
}
.editor-layout {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 20px;
}
.grid-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  cursor: crosshair;
  touch-action: none;
  background: #061016;
  border: 1px solid #253e49;
  border-radius: 5px;
}
.editor-tools {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.editor-tools select,
.editor-tools input {
  padding: 8px;
  width: 100%;
}
.editor-tools label {
  font-size: 10px;
}
.color-input {
  height: 35px;
}
.legend {
  display: flex;
  gap: 12px;
  font-size: 9px;
  flex-wrap: wrap;
  margin-top: 12px;
  color: #8ea6af;
}
.legend i {
  width: 6px;
  height: 6px;
  display: inline-block;
  margin-right: 4px;
}
.decal-grid {
  width: 176px;
  height: 176px;
  cursor: crosshair;
  background: #10202c;
  image-rendering: pixelated;
  border: 1px solid #28414b;
}
.editor-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}
.death {
  position: fixed;
  inset: 0;
  background: #04090dcc;
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 20;
  text-align: center;
}
.death h2 {
  font-size: 38px;
  font-weight: 300;
}
.death .content {
  max-width: 420px;
}
.death .eyebrow {
  color: var(--danger);
}
.login {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: linear-gradient(90deg, #04090eee 0%, #04090e75 52%, #04090e70);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10vw;
}
.login-copy {
  max-width: 510px;
}
.login-copy h1 {
  font-size: clamp(46px, 5vw, 78px);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -4px;
  margin: 25px 0;
}
.login-copy h1 em {
  font-style: normal;
  color: var(--accent);
}
.login-copy p {
  max-width: 360px;
  margin: 25px 0;
  font-size: 14px;
  line-height: 1.85;
}
.login-copy .coordinates {
  font-size: 9px;
  letter-spacing: 3px;
  color: #718994;
  margin-top: 50px;
}
.login-card {
  width: 355px;
  padding: 32px;
  background: #0a151ee8;
}
.login-card h2 {
  font-size: 24px;
  margin: 10px 0 25px;
}
.login-card input,
.login-card select {
  width: 100%;
}
.login-card label {
  margin-top: 15px;
}
.login-card button.primary {
  width: 100%;
  margin-top: 24px;
  padding: 13px;
}
.login-card .switch {
  margin-top: 20px;
  text-align: center;
  font-size: 11px;
  color: #92a6b0;
}
.login-card .switch button {
  background: transparent;
  border: 0;
  color: var(--accent);
  padding: 0;
}
.login-error {
  font-size: 11px;
  color: var(--danger);
  line-height: 1.6;
  margin-top: 15px;
}
.login-footer {
  position: fixed;
  bottom: 25px;
  left: 10vw;
  right: 10vw;
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  letter-spacing: 1px;
  color: #526c7b;
}
.faction-row {
  border-left: 2px solid var(--accent);
  padding: 12px 15px;
  background: #ffffff04;
  margin: 10px 0;
}
.faction-row small {
  display: block;
  color: #819aa6;
  margin-top: 6px;
}
.webgl-error {
  padding: 40px;
  color: var(--danger);
}
.mobile-warning {
  display: none;
}
.admin-body {
  overflow: auto;
  background: #070d13;
}
.admin-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 80px;
  background: #0b151dee;
  border-bottom: 1px solid var(--line);
  padding: 0 35px;
}
.admin-shell {
  display: grid;
  grid-template-columns: 210px 1fr;
  min-height: calc(100vh - 80px);
}
.admin-nav {
  padding: 25px 15px;
  border-right: 1px solid var(--line);
}
.admin-nav button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  color: #8fa5b2;
  margin-bottom: 5px;
  font-size: 12px;
}
.admin-nav button.active {
  background: #14312e;
  color: var(--accent);
}
.admin-main {
  padding: 30px 35px;
  min-width: 0;
}
.admin-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 1fr);
  gap: 25px;
}
.admin-list {
  max-height: 65vh;
  overflow: auto;
}
.admin-item {
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 7px;
  padding: 12px;
  background: #0c1922;
}
.admin-item small {
  display: block;
  color: #708896;
  font-size: 10px;
  margin-top: 5px;
}
.admin-form {
  padding: 25px;
}
.admin-form textarea {
  font:
    12px/1.65 Consolas,
    monospace;
  min-height: 280px;
  width: 100%;
}
.admin-form label {
  margin-bottom: 15px;
}
.admin-form input {
  width: 100%;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.admin-table th,
.admin-table td {
  text-align: left;
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  max-width: 400px;
  word-break: break-word;
}
.admin-table th {
  font-size: 9px;
  color: #7d98a6;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.admin-callout {
  padding: 15px 20px;
  border: 1px solid #79e7d626;
  background: #112621;
  color: #9cbcb5;
  font-size: 12px;
  margin-bottom: 25px;
  line-height: 1.6;
}
@media (max-width: 1200px) {
  .chatbox {
    left: 108px;
    width: 210px;
  }
  .cockpit {
    width: 460px;
  }
  .contacts,
  .sector-action {
    width: 215px;
  }
  .top-meta {
    gap: 12px;
  }
  .panel.wide {
    width: 550px;
  }
  .login {
    padding: 8vw;
  }
  .login-copy {
    max-width: 400px;
  }
  .admin-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 900px) {
  .topbar {
    padding: 0 18px;
  }
  .top-meta .optional {
    display: none;
  }
  .brand {
    font-size: 11px;
  }
  .rail {
    left: 12px;
    top: 100px;
  }
  .rail button {
    width: 54px;
    height: 55px;
  }
  .sector-title {
    left: 85px;
    top: 100px;
  }
  .sector-title h1 {
    font-size: 24px;
  }
  .contacts {
    display: none;
  }
  .sector-action {
    top: auto;
    bottom: 158px;
    width: 180px;
    right: 15px;
  }
  .cockpit {
    bottom: 15px;
    width: calc(100% - 30px);
  }
  .chatbox {
    display: none;
  }
  .hint {
    bottom: 157px;
    width: 50%;
    text-align: center;
    left: 29%;
    font-size: 9px;
  }
  .panel,
  .panel.wide {
    left: 85px;
    right: 15px;
    width: auto;
    bottom: 170px;
    top: 95px;
  }
  .login {
    padding: 8vw;
    gap: 35px;
  }
  .login-copy h1 {
    font-size: 45px;
  }
  .login-copy p {
    font-size: 12px;
  }
  .login-card {
    padding: 23px;
    width: 320px;
    flex-shrink: 0;
  }
  .editor-layout {
    grid-template-columns: 1fr 140px;
  }
  .admin-shell {
    grid-template-columns: 160px 1fr;
  }
  .admin-main {
    padding: 20px;
  }
  .admin-grid {
    grid-template-columns: 1fr;
  }
  .admin-header {
    padding: 0 20px;
  }
  .admin-form {
    padding: 18px;
  }
}
@media (max-width: 650px) {
  .login-copy {
    display: none;
  }
  .login {
    justify-content: center;
    padding: 20px;
  }
  .login-card {
    width: 100%;
    max-width: 365px;
  }
  .login-footer {
    left: 20px;
    right: 20px;
  }
  .sector-title .sector-subtitle {
    display: none;
  }
  .editor-layout {
    grid-template-columns: 1fr;
  }
  .editor-tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .sector-action {
    width: 135px;
    padding: 10px;
  }
  .sector-action p {
    display: none;
  }
  .sector-action button {
    font-size: 10px;
  }
  .cockpit {
    padding: 14px;
  }
  .meters {
    gap: 12px;
  }
  .top-meta {
    font-size: 10px;
  }
  .admin-shell {
    display: block;
  }
  .admin-nav {
    display: flex;
    overflow: auto;
    padding: 10px;
    border: 0;
  }
  .admin-nav button {
    white-space: nowrap;
    width: auto;
  }
  .admin-main {
    padding: 15px;
  }
  .decal-grid {
    width: 132px;
    height: 132px;
  }
}

/* Keep the login branding above its full-screen scene overlay. */
#app:has(.login) > .topbar,
.login-footer {
  z-index: 21;
}
