* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; color: #9ff; font-family: "Consolas", "Courier New", monospace; }
#view { position: fixed; inset: 0; }
#view canvas { display: block; }


#hud { position: fixed; left: 18px; top: 16px; pointer-events: none; text-shadow: 0 0 6px #0ff; }
.hud-block { background: rgba(0,20,30,.45); border: 1px solid rgba(0,255,255,.35); padding: 10px 14px; min-width: 210px; }
.label { font-size: 11px; opacity: .65; letter-spacing: 2px; margin-top: 6px; }
.value { font-size: 16px; }
.value.big { font-size: 26px; }

#throttle { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); width: 320px; height: 18px;
  border: 1px solid rgba(0,255,255,.5); background: rgba(0,20,30,.5); pointer-events: none; }
#throttle-fill { height: 100%; width: 0; background: linear-gradient(90deg, #0aa, #ff2bd6); }
#throttle span { position: absolute; inset: 0; text-align: center; font-size: 11px; line-height: 18px; letter-spacing: 3px; color: #fff; }

#toast { position: fixed; top: 22%; left: 50%; transform: translateX(-50%); font-size: 18px; color: #fff;
  text-shadow: 0 0 8px #f0f; opacity: 0; transition: opacity .3s; pointer-events: none; }
#toast.show { opacity: 1; }

#help { position: fixed; right: 18px; bottom: 18px; background: rgba(0,15,25,.85); border: 1px solid rgba(0,255,255,.4);
  padding: 12px 18px; font-size: 13px; }
#help h2 { margin: 0 0 8px; font-size: 14px; letter-spacing: 3px; color: #ff6be6; }
#help td { padding: 2px 10px 2px 0; }
#help td:first-child { color: #fff; }
#help p { margin: 8px 0 0; opacity: .7; font-size: 12px; }
#help.hidden { display: none; }

/* ---- Dev editor panel (only in the dev app) ---- */
#editor { position: fixed; right: 0; top: 0; bottom: 0; width: 300px; overflow-y: auto; background: rgba(10,10,20,.92);
  border-left: 2px solid #ff2bd6; padding: 12px 14px; font-size: 13px; color: #ddd; }
#editor h3 { margin: 14px 0 6px; color: #ff6be6; font-size: 13px; letter-spacing: 2px; border-bottom: 1px solid #333; padding-bottom: 4px; }
#editor h3:first-child { margin-top: 0; }
#editor .tag { display: inline-block; background: #ff2bd6; color: #000; font-weight: bold; padding: 1px 6px; margin-bottom: 6px; }
#editor button, #editor select { width: 100%; margin: 3px 0; padding: 6px; background: #1b1b2e; color: #9ff; border: 1px solid #355;
  font-family: inherit; cursor: pointer; }
#editor button:hover { background: #26264a; }
#editor .row { display: flex; gap: 6px; }
#editor .row button { flex: 1; }
#editor label { display: block; margin-top: 6px; }
#editor input[type=range] { width: 100%; }
#editor .num { float: right; color: #fff; }
#editor .note { opacity: .6; font-size: 11px; margin: 4px 0; }
body.dev #help { right: 318px; }

/* ---- v1.1 ---- */
.bar { height: 8px; border: 1px solid rgba(0,255,255,.4); margin-top: 3px; }
#hud-hull { height: 100%; width: 100%; background: #39ff14 url(../assets/gui/bar_hull.png); background-blend-mode: multiply; transition: width .2s, background-color .2s; }
#hud small, #help small { opacity: .6; font-size: 10px; }
#hud-status { position: fixed; left: 50%; bottom: 212px; transform: translateX(-50%); color: #ffcc00; font-size: 13px; letter-spacing: 1px; text-shadow: 0 0 6px #f80; pointer-events: none; white-space: nowrap; }

#marker { position: fixed; left: 0; top: 0; pointer-events: none; transform: translate(-50%, -50%); text-align: center; }
#marker .diamond { width: 16px; height: 16px; border: 2px solid #ffcc00; transform: rotate(45deg); margin: 0 auto; }
#marker .arrow { display: none; color: #ffcc00; font-size: 22px; }
#marker.off .diamond { display: none; }
#marker.off .arrow { display: block; }
#marker .mlabel { color: #ffcc00; font-size: 12px; margin-top: 6px; white-space: nowrap; text-shadow: 0 0 4px #000; }

#charge { position: fixed; top: 32%; left: 50%; transform: translateX(-50%); width: 360px; height: 16px; display: none;
  border: 1px solid #5af; background: rgba(0,10,30,.6); }
#charge.show { display: block; }
#charge-fill { height: 100%; width: 0; background: linear-gradient(90deg, #36f, #9cf); }
#charge span { position: absolute; inset: 0; text-align: center; font-size: 11px; line-height: 16px; letter-spacing: 3px; color: #fff; }

#cruise-fx { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity .6s;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(40,90,255,.35) 100%); }
#cruise-fx.on { opacity: 1; }
#flash { position: fixed; inset: 0; pointer-events: none; background: #fff; opacity: 0; }

#dock { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 340px; padding: 20px 24px;
  background: rgba(8,4,20,.9); border: 2px solid #ff2bd6; box-shadow: 0 0 30px rgba(255,43,214,.4); text-align: center; }
#dock[hidden] { display: none; }
.dock-title { color: #39ff14; letter-spacing: 6px; font-size: 13px; }
.dock-name { color: #fff; font-size: 24px; margin: 6px 0 4px; text-shadow: 0 0 10px #ff2bd6; }
.dock-info { opacity: .8; margin-bottom: 12px; }
#dock button { display: block; width: 100%; margin: 6px 0; padding: 9px; font-family: inherit; font-size: 14px; letter-spacing: 2px;
  background: #13132a; color: #9ff; border: 1px solid #355; cursor: pointer; }
#dock button:hover:not([disabled]) { background: #22224a; }
#dock button[disabled] { opacity: .35; cursor: default; }
#dock button.launch { border-color: #39ff14; color: #39ff14; }

/* ---- v2 multiplayer ---- */
#tags { position: fixed; inset: 0; pointer-events: none; }
.pilot-tag { position: absolute; transform: translate(-50%, -100%); color: #7dffb0; font-size: 12px; white-space: nowrap;
  text-shadow: 0 0 4px #000, 0 0 8px #0a4; display: none; }
#chat { position: fixed; left: 18px; bottom: 56px; width: 420px; pointer-events: none; }
#chat-log { font-size: 13px; }
.chat-line { background: rgba(0,10,20,.55); padding: 3px 8px; margin-top: 3px; color: #dff; transition: opacity 1s; }
.chat-line b { color: #7dffb0; }
.chat-line.system { color: #ffcc00; font-style: italic; }
.chat-line.old { opacity: 0; }
#chat-input { pointer-events: auto; width: 100%; margin-top: 6px; padding: 7px 9px; background: rgba(0,10,25,.9); color: #fff;
  border: 1px solid #0ff; font-family: inherit; font-size: 13px; outline: none; }
#net-status { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); font-size: 12px; letter-spacing: 2px; pointer-events: none; }
#net-status.on { color: #7dffb0; } #net-status.off { color: #ff8060; }

#login { position: fixed; inset: 0; background: radial-gradient(ellipse at center, rgba(20,0,40,.75), rgba(0,0,0,.92)); display: flex;
  align-items: center; justify-content: center; z-index: 10; }
#login[hidden] { display: none; }
.login-box { width: 360px; padding: 28px; border: 2px solid #ff2bd6; background: rgba(8,4,20,.92); box-shadow: 0 0 40px rgba(255,43,214,.35); text-align: center; }
.login-title { font-size: 30px; letter-spacing: 8px; color: #fff; text-shadow: 0 0 14px #ff2bd6; }
.login-sub { font-size: 11px; letter-spacing: 6px; color: #0ff; margin: 4px 0 18px; }
.login-body p { margin: 0 0 10px; color: #ccd; }
.login-name { font-size: 22px; color: #7dffb0; margin-bottom: 14px; }
.login-body input { width: 100%; padding: 10px; font-family: inherit; font-size: 16px; background: #0b0b1e; color: #fff; border: 1px solid #355; text-align: center; outline: none; }
.login-body input:focus { border-color: #0ff; }
.login-err { color: #ff8060; font-size: 12px; min-height: 18px; margin: 6px 0; }
.login-body button { display: block; width: 100%; margin-top: 8px; padding: 10px; font-family: inherit; letter-spacing: 3px; cursor: pointer; }
.login-body button.primary { background: #13132a; color: #39ff14; border: 1px solid #39ff14; font-size: 15px; }
.login-body button.primary:hover { background: #1c2a1c; }
.login-body button.link { background: none; border: none; color: #889; font-size: 12px; text-decoration: underline; }

#editor pre#ed-log { background: #05050c; border: 1px solid #333; color: #9c9; font-size: 10.5px; max-height: 180px; min-height: 40px;
  overflow: auto; white-space: pre-wrap; word-break: break-all; padding: 6px; margin: 4px 0; }
#editor button[disabled] { opacity: .4; cursor: default; }

/* ---- v3 owner admin ---- */
#announce { position: fixed; top: 44px; left: 50%; transform: translateX(-50%); max-width: 70%; padding: 10px 22px; text-align: center;
  background: rgba(40,0,50,.85); border: 1px solid #ff2bd6; color: #fff; font-size: 17px; letter-spacing: 1px; text-shadow: 0 0 8px #ff2bd6;
  opacity: 0; transition: opacity .4s; pointer-events: none; }
#announce.show { opacity: 1; }
#announce:empty { display: none; }
#removed { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: flex; align-items: center; justify-content: center; z-index: 20; }
#removed[hidden] { display: none; }
.removed-title { color: #ff5050; font-size: 20px; letter-spacing: 4px; margin-bottom: 12px; }
.removed-reason { color: #ddd; margin-bottom: 16px; min-height: 18px; }
#removed button { padding: 9px 30px; font-family: inherit; background: #13132a; color: #9ff; border: 1px solid #355; cursor: pointer; }
#editor .mode-row button.on { background: #ff2bd6; color: #000; font-weight: bold; }
#editor .admin-row { display: flex; align-items: center; gap: 4px; padding: 3px 0; border-bottom: 1px solid #222; }
#editor .admin-row span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#editor .admin-row small { color: #888; }
#editor .admin-row button { width: auto; margin: 0; padding: 3px 7px; font-size: 11px; }
#editor input[type=text] { width: 100%; padding: 5px; margin: 3px 0; background: #0b0b1e; color: #fff; border: 1px solid #355; font-family: inherit; }
#editor .admin-msg { color: #ffcc00; font-size: 11px; min-height: 14px; }

/* ---- v3 ship console (skins are PNGs in assets/gui) ---- */
#console { position: fixed; bottom: 8px; left: 50%; transform: translateX(-50%); width: min(1120px, 97vw); height: 196px;
  display: flex; gap: 10px; align-items: stretch; padding: 12px 16px;
  border: 22px solid transparent; border-image: url(../assets/gui/panel.png) 24 fill / 22px / 0 stretch; box-sizing: border-box; }
body.dev #console { left: calc((100vw - 300px) / 2); width: min(1120px, calc(97vw - 300px)); }
body.hide-console #console { display: none; }
.cscreen { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; padding: 6px 8px; margin: -12px 0;
  border: 16px solid transparent; border-image: url(../assets/gui/screen.png) 24 fill / 16px / 0 stretch; }
.ctabs { display: flex; gap: 3px; margin: -6px -4px 4px; }
.ctabs button, .ctitle button { flex: 1; font-family: inherit; font-size: 10px; letter-spacing: 1px; color: #9ff; background: none; cursor: pointer;
  padding: 3px 4px; border: 8px solid transparent; border-image: url(../assets/gui/button.png) 24 fill / 8px / 0 stretch; }
.ctabs button.on { border-image-source: url(../assets/gui/button_on.png); color: #fff; }
#cs-content { flex: 1; overflow: hidden; font-size: 12px; }
.crow { display: flex; align-items: center; gap: 6px; padding: 2px 3px; cursor: default; }
.crow[data-target] { cursor: pointer; }
.crow[data-target]:hover { background: rgba(0,230,255,0.1); }
.crow.tgt { color: #ffcc00; }
.crow img { width: 14px; height: 14px; }
.crow span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.crow b { font-weight: normal; opacity: .85; }
.cline { display: flex; justify-content: space-between; padding: 2px 3px; border-bottom: 1px solid rgba(0,230,255,0.1); }
.cline span { opacity: .6; letter-spacing: 1px; font-size: 11px; } .cline b { font-weight: normal; color: #fff; }
.cnote { opacity: .6; padding: 8px 3px; font-size: 11px; }
#cs-throttle { position: relative; width: 22px; border: 1px solid rgba(0,230,255,.5); background: rgba(0,20,30,.6); margin: 2px 0; }
#cs-thr-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(0deg, #0aa, #ff2bd6); }
#cs-throttle span { position: absolute; top: -16px; left: -4px; font-size: 9px; letter-spacing: 1px; }
#cs-scanner { position: relative; flex: 0 0 auto; display: flex; align-items: center; }
#scanner { width: 330px; height: 165px; display: block; }
#scan-range { position: absolute; bottom: -4px; right: 0; font-size: 10px; color: #7dffb0; }
.ctitle { display: flex; justify-content: space-between; align-items: center; font-size: 11px; letter-spacing: 2px; margin: -6px -4px 4px; }
.ctitle span { display: flex; gap: 3px; } .ctitle button { flex: none; min-width: 26px; }
#minimap { flex: 1; width: 100%; min-height: 0; display: block; }
#help { right: 18px; top: 60px; bottom: auto; }
body.dev #help { right: 318px; }
#help-hint { position: fixed; top: 16px; right: 18px; font-size: 11px; opacity: .55; pointer-events: none; }
body.dev #help-hint { right: 318px; }
#chat { bottom: 214px; }

/* ---- v3 touch controls (phones / tablets) ---- */
body { touch-action: none; -webkit-user-select: none; user-select: none; }
#touch[hidden] { display: none; }
#t-stick { position: fixed; left: max(18px, env(safe-area-inset-left)); bottom: 18px; width: 150px; height: 150px;
  background: url(../assets/gui/stick_base.png) center / contain no-repeat; touch-action: none; }
#t-knob { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; pointer-events: none;
  background: url(../assets/gui/stick_knob.png) center / contain no-repeat; }
#t-thr { position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: 18px; width: 56px; height: 180px; touch-action: none;
  background: url(../assets/gui/throttle_track.png) center / 100% 100% no-repeat; }
#t-thr-knob { position: absolute; left: -12px; right: -12px; top: 0; height: 24px; pointer-events: none;
  background: url(../assets/gui/throttle_knob.png) center / 100% 100% no-repeat; }
#t-buttons { position: fixed; right: calc(max(18px, env(safe-area-inset-right)) + 70px); bottom: 18px; display: grid; grid-template-columns: repeat(2, 64px); gap: 6px; }
#t-buttons button, #t-full { width: 64px; height: 40px; font-family: inherit; font-size: 10px; letter-spacing: 1px; color: #9ff; background: none;
  border: 12px solid transparent; border-image: url(../assets/gui/button.png) 24 fill / 12px / 0 stretch; padding: 0; touch-action: none; }
#t-buttons button.down { border-image-source: url(../assets/gui/button_on.png); color: #fff; }
#t-full { position: fixed; top: 10px; right: max(12px, env(safe-area-inset-right)); width: 44px; height: 40px; font-size: 16px; }
#rotate-hint { display: none; }
body.touch #help-hint, body.touch #help { display: none; }
body.touch #hud { transform: scale(.8); transform-origin: top left; left: 8px; top: 8px; }
body.touch #console { width: min(470px, calc(100vw - 420px)); min-width: 260px; height: 132px; padding: 6px 8px; bottom: 6px; border-width: 14px; }
body.touch #cs-left { display: none; }
body.touch #scanner { width: 180px; height: 90px; }
body.touch #cs-right { margin: -6px 0; }
body.touch .ctitle button { min-width: 22px; padding: 2px; }
body.touch #chat { width: 40vw; bottom: 150px; left: 180px; }
body.touch #marker .mlabel { font-size: 10px; }
body.touch #dock { width: 300px; padding: 12px 16px; }
body.touch #dock button { padding: 7px; }
@media (orientation: portrait) {
  body.touch #rotate-hint { display: flex; position: fixed; inset: 0; z-index: 30; align-items: center; justify-content: center;
    background: rgba(0,0,0,.92); color: #9ff; font-size: 18px; letter-spacing: 2px; text-align: center; padding: 30px; }
}

body.touch #console { width: min(440px, calc(100vw - 480px)); min-width: 230px; }
body.touch .ctitle { font-size: 0; } body.touch .ctitle button { font-size: 10px; }
body.touch #map-in, body.touch #map-out { display: none; }

/* ---- v4 galaxy + hyperspace ---- */
.value.small { font-size: 13px; }
#hyper-fx { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s; overflow: hidden; z-index: 5;
  background: radial-gradient(ellipse at center, #fff 0%, rgba(120,160,255,.6) 12%, rgba(40,0,80,.9) 45%, #000 80%); }
#hyper-fx.on { opacity: 1; }
#hyper-fx .tunnel { position: absolute; inset: -50%; background: repeating-conic-gradient(from 0deg, rgba(0,230,255,.0) 0deg 6deg, rgba(0,230,255,.35) 7deg 8deg, rgba(255,43,214,.0) 9deg 14deg);
  animation: hyperspin 1.2s linear infinite; mask-image: radial-gradient(circle, transparent 8%, #000 40%); -webkit-mask-image: radial-gradient(circle, transparent 8%, #000 40%); }
@keyframes hyperspin { from { transform: rotate(0deg) scale(1); } to { transform: rotate(40deg) scale(1.15); } }
#galmap { position: fixed; inset: 0; z-index: 9; background: #02030a; }
#galmap[hidden] { display: none; }
#gal-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.gal-top { position: absolute; top: 12px; left: 0; right: 0; text-align: center; color: #9ff; font-size: 12px; letter-spacing: 2px; pointer-events: none; }
.gal-tools { position: absolute; top: 36px; left: 16px; display: flex; gap: 4px; }
.gal-tools button, #gal-info button { font-family: inherit; font-size: 11px; letter-spacing: 1px; color: #9ff; background: none; cursor: pointer; padding: 4px 8px;
  border: 10px solid transparent; border-image: url(../assets/gui/button.png) 24 fill / 10px / 0 stretch; }
#gal-info button { display: block; width: 100%; margin-top: 8px; font-size: 13px; color: #39ff14; }
#gal-info button[disabled] { opacity: .35; }
#gal-info { position: absolute; right: 16px; top: 40px; width: 290px; max-height: calc(100% - 80px); overflow: auto; margin: 0; font-size: 12px; }
body.dev #gal-info { right: 316px; }
.gal-title { font-size: 17px; color: #fff; margin-bottom: 8px; text-shadow: 0 0 8px #0ff; }
.gal-hub { font-size: 10px; color: #000; background: #39ff14; padding: 1px 5px; vertical-align: middle; }
.gal-note { opacity: .75; } .gal-warn { color: #ff8060; }
body.touch #gal-info { width: 230px; top: 70px; right: 8px; font-size: 11px; }
body.touch #t-buttons { grid-template-columns: repeat(2, 60px); }
body.touch #t-buttons button { width: 60px; height: 34px; }

/* ---- v4.5 workshop ---- */
#workshop { position: fixed; left: 12px; top: 12px; bottom: 12px; width: 340px; overflow-y: auto; z-index: 6; margin: 0; font-size: 12px; }
#workshop[hidden] { display: none; }
body.workshop #hud, body.workshop #console, body.workshop #dock, body.workshop #marker, body.workshop #crosshair, body.workshop #chat { display: none !important; }
.ws-title { font-size: 18px; color: #fff; letter-spacing: 4px; text-shadow: 0 0 8px #ff2bd6; margin-bottom: 8px; }
.ws-title small { font-size: 11px; color: #9ff; letter-spacing: 1px; }
.ws-label { display: block; margin: 10px 0 4px; color: #ff6be6; letter-spacing: 2px; font-size: 11px; }
.ws-label small { color: #889; letter-spacing: 0; }
#workshop select, #workshop input[type=text] { width: 100%; padding: 5px; background: #0b0b1e; color: #fff; border: 1px solid #355; font-family: inherit; font-size: 12px; }
.ws-stats { margin-top: 6px; } .ws-stats i { font-style: normal; font-size: 11px; } .ws-stats i.up { color: #39ff14; } .ws-stats i.down { color: #ff6050; }
.ws-mount { padding: 4px 0; border-bottom: 1px solid rgba(0,230,255,.12); }
.ws-mount span { display: block; margin-bottom: 3px; } .ws-mount small { color: #889; }
.ws-mount.sel { background: rgba(255,43,214,.12); outline: 1px solid #ff2bd6; }
#workshop button { display: block; width: 100%; margin-top: 8px; padding: 7px; font-family: inherit; letter-spacing: 2px; cursor: pointer;
  color: #9ff; background: none; border: 10px solid transparent; border-image: url(../assets/gui/button.png) 24 fill / 10px / 0 stretch; }
#workshop button.on { border-image-source: url(../assets/gui/button_on.png); color: #fff; }
#workshop button.primary { color: #39ff14; }
#workshop .row { display: flex; gap: 6px; } #workshop .row > * { flex: 1; }
.ws-editor { margin-top: 6px; padding: 6px; border: 1px dashed #ff2bd6; }
.ws-editor label { display: block; margin-top: 5px; } .ws-editor input[type=range] { width: 100%; } .ws-editor .num { float: right; color: #fff; }
body.touch #workshop { width: 260px; font-size: 11px; }

/* ---- v5 trade + shipyard ---- */
.station-panel { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(820px, 96vw); max-height: 92vh; overflow-y: auto; z-index: 7; margin: 0; font-size: 12px; }
body.dev .station-panel { left: calc((100vw - 300px) / 2); width: min(820px, calc(96vw - 300px)); }
.station-panel[hidden] { display: none; }
body.station-screen #dock, body.station-screen #console, body.station-screen #hud { display: none !important; }
.st-head { display: flex; justify-content: space-between; align-items: center; }
.st-close { font-size: 18px; background: none; color: #9ff; border: 1px solid #355; cursor: pointer; padding: 2px 10px; }
.st-wallet { display: flex; gap: 24px; align-items: center; margin: 6px 0 10px; }
.st-wallet b { color: #fff; } .st-wallet .bar { flex: 1; height: 8px; } .st-wallet .bar div { height: 100%; background: linear-gradient(90deg, #0aa, #ff2bd6); }
.st-table { width: 100%; border-collapse: collapse; }
.st-table th { text-align: left; color: #ff6be6; font-weight: normal; letter-spacing: 1px; font-size: 11px; padding: 4px; border-bottom: 1px solid #355; }
.st-table td { padding: 3px 4px; border-bottom: 1px solid rgba(0,230,255,.1); }
.st-table tr.owned td:first-child { color: #39ff14; }
.st-btns { white-space: nowrap; text-align: right; }
.st-btns button { font-family: inherit; font-size: 10px; padding: 3px 6px; margin-left: 2px; background: #13132a; color: #9ff; border: 1px solid #355; cursor: pointer; }
.st-btns button:hover:not([disabled]) { background: #22224a; } .st-btns button[disabled] { opacity: .3; cursor: default; }
em.cheap, b.cheap { color: #39ff14; font-style: normal; font-size: 10px; } em.wanted { color: #ffcc00; font-style: normal; font-size: 10px; }
#dock button[disabled] { opacity: .45; }
body.touch .station-panel { font-size: 11px; width: 98vw; max-height: 96vh; }
body.touch .st-table td:nth-child(2), body.touch .st-table th:nth-child(2) { display: none; }

#workshop button.mini { display: inline; width: auto; margin: 0; padding: 2px 8px; font-size: 10px; letter-spacing: 1px; border-width: 6px; }
body.station-screen #crosshair, body.station-screen #chat, body.station-screen #toast:empty { display: none !important; }

/* ---- v6 star map ---- */
#map-crumbs { position: absolute; top: 86px; left: 16px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; max-width: calc(100% - 340px); }
#map-crumbs { font-size: 14px; letter-spacing: 2px; color: #fff; text-shadow: 0 0 8px #0ff; pointer-events: none; }
.flogo { width: 16px; height: 16px; image-rendering: pixelated; vertical-align: -3px; margin-right: 5px; }
.gal-legend { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; border-top: 1px solid #244; padding-top: 8px; }
#minimap { cursor: pointer; }
body.touch #map-crumbs { top: 84px; max-width: calc(100% - 250px); }
body.touch #map-crumbs { font-size: 11px; }
body.touch .gal-top { display: none; }

#editor button.bb { color: #ffb000; border-color: #6a4a00; }

/* ---- v6 combat ---- */
#crosshair { position: fixed; left: 50%; top: 50%; width: 32px; height: 32px; margin: -16px 0 0 -16px; pointer-events: none; image-rendering: pixelated; z-index: 3; }
#lead { position: fixed; width: 24px; height: 24px; margin: -12px 0 0 -12px; pointer-events: none; image-rendering: pixelated; z-index: 3; }
#lead[hidden] { display: none; }
#brackets { position: fixed; inset: 0; pointer-events: none; z-index: 2; }
.bracket { position: absolute; transform: translate(-50%, -50%); }
.bracket img { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.bracket span { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); white-space: nowrap; font-size: 11px; color: #ff2bd6; text-shadow: 0 0 4px #000; }
.bar { background: url(../assets/gui/bar_frame.png) center / 100% 100%; }
#hud-shield, #hud-fuel, #hud-ammo, #hud-ct-shield, #hud-ct-hull { height: 100%; width: 100%; transition: width .15s; image-rendering: pixelated; }
#hud-shield, #hud-ct-shield { background: url(../assets/gui/bar_shield.png); }
#hud-ct-hull { background: #39ff14 url(../assets/gui/bar_hull.png); background-blend-mode: multiply; }
#hud-fuel { background: url(../assets/gui/bar_fuel.png); }
#hud-ammo { background: url(../assets/gui/bar_ammo.png); }
.bars2 { display: flex; gap: 8px; } .bars2 > div { flex: 1; }
#hud-boost.on { color: #ffb000; }
#hud-wanted { margin-top: 6px; padding: 2px 6px; color: #fff; background: #c01020; font-weight: bold; letter-spacing: 2px; text-align: center; animation: blink 1s steps(2) infinite; }
#hud-wanted[hidden] { display: none; }
@keyframes blink { 50% { background: #600010; } }
#hud-ctarget { margin-top: 10px; border-top: 1px solid rgba(0,255,255,.25); padding-top: 6px; min-width: 190px; }
#hud-ctarget[hidden] { display: none; }
#hud-ct-bars[hidden] { display: none; }
body.workshop #lead, body.workshop #brackets, body.station-screen #lead, body.station-screen #brackets { display: none !important; }
#t-buttons .t-fire { background-color: rgba(200, 20, 40, .45); }
#t-buttons .t-boost { background-color: rgba(255, 150, 0, .35); }
.pilot-tag.wanted { color: #ff5050; border-color: #ff5050; }

/* ---- v7: one console (the old top-left card now lives in here) ---- */
#cs-flight { flex: 0 0 236px; font-size: 11px; gap: 3px; padding: 4px 8px; }
.fl-top { display: flex; justify-content: space-between; align-items: baseline; margin-top: -4px; }
#hud-speed { font-size: 22px; color: #fff; text-shadow: 0 0 6px #0ff; }
#hud-mode { font-size: 10px; letter-spacing: 1px; opacity: .8; }
.fl-bar { display: flex; align-items: center; gap: 6px; } .fl-bar span { width: 32px; font-size: 9px; letter-spacing: 1px; opacity: .7; }
.fl-bar .bar { flex: 1; margin: 0; height: 7px; }
.fl-bars2 { display: flex; gap: 8px; } .fl-bars2 .fl-bar { flex: 1; }
#hud-boost.on { color: #ffb000; opacity: 1; }
.fl-line { display: flex; gap: 5px; white-space: nowrap; overflow: hidden; } .fl-line b { font-weight: normal; color: #fff; overflow: hidden; text-overflow: ellipsis; }
.fl-line span { opacity: .6; } .fl-line i { font-style: normal; opacity: .7; margin-left: auto; }
#hud-target { color: #ffcc00 !important; }
#hud-ctarget #hud-ct-bars { display: flex; flex-direction: column; gap: 2px; } #hud-ctarget .bar { height: 5px; margin: 0; }
#hud-ctarget { border-top: 1px solid rgba(255,43,214,.35); padding-top: 2px; }
.fl-foot { margin-top: auto; display: flex; justify-content: space-between; font-size: 10px; opacity: .85; white-space: nowrap; gap: 6px; }
#hud-system { overflow: hidden; text-overflow: ellipsis; } #hud-credits { color: #ffcc00; }
#hud-wanted { margin: 0; padding: 1px 4px; font-size: 10px; }
body.touch #cs-scanner { display: none; }
body.touch #cs-flight { flex-basis: 200px; }
body.touch #hud-status { bottom: 146px; font-size: 11px; }

/* ---- v7 missions + factions screens ---- */
.station-panel h4 { margin: 10px 0 4px; font-size: 12px; letter-spacing: 2px; color: #ff6be6; } .station-panel h4 small { color: #9ff; opacity: .6; }
.ms-rep { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; } .ms-rep b { color: #fff; font-weight: normal; } .ms-rep small { opacity: .6; }
.ms-job { border: 1px solid rgba(0,230,255,.25); background: rgba(0,20,30,.5); padding: 5px 8px; margin: 4px 0; }
.ms-job.ready { border-color: #39ff14; box-shadow: 0 0 8px rgba(57,255,20,.35); } .ms-job.locked { opacity: .55; }
.ms-t { display: flex; justify-content: space-between; color: #fff; font-size: 13px; gap: 8px; } .ms-t b { color: #ffcc00; font-weight: normal; white-space: nowrap; }
.ms-d { font-size: 11px; opacity: .8; margin-top: 2px; }
.ms-b { display: flex; gap: 6px; justify-content: flex-end; margin-top: 4px; }
.station-panel button.go { color: #39ff14; } .station-panel button.danger { color: #ff6060; margin-top: 10px; }
.pf-card { display: flex; gap: 12px; align-items: center; border: 2px solid; padding: 8px; background: rgba(0,20,30,.5); }
.pf-logo { width: 64px; height: 64px; image-rendering: pixelated; } .pf-name { font-size: 18px; }
.pf-members { max-height: 160px; overflow: auto; margin: 6px 0; } .pf-members button { font-size: 10px; padding: 1px 6px; margin-left: 8px; }
.pf-row { display: flex; gap: 6px; align-items: center; margin: 6px 0; flex-wrap: wrap; }
.station-panel input[type=text], .station-panel input:not([type]) { flex: 1; min-width: 120px; background: #071018; color: #fff; border: 1px solid #355; padding: 5px; font-family: inherit; }
.pf-file { border: 1px solid #355; padding: 4px 8px; cursor: pointer; } .pf-file input { display: none; }
.chat-line.faction { color: #b8ffd0; border-left: 3px solid #39ff14; } .chat-line.faction b { color: #39ff14; }
#hud-speed, #hud-mode { white-space: nowrap; }
/* phones: the console is just the flight panel + the nav map (the right-hand slider is the throttle) */
body.touch #fl-nav, body.touch .fl-foot #hud-credits { display: none; }
body.touch #console { width: min(470px, calc(100vw - 440px)); }
body.touch #cs-flight { flex: 1 1 0; min-width: 0; font-size: 9px; padding: 2px 6px; gap: 2px; }
body.touch #hud-speed { font-size: 15px; } body.touch #hud-mode { font-size: 8px; }
body.touch .fl-bar span { width: 26px; font-size: 7px; } body.touch .fl-bar .bar { height: 5px; }
body.touch .fl-foot { font-size: 8px; }
body.touch #cs-right { flex: 1 1 0; min-width: 0; }
/* buttons inside station screens */
.station-panel .ms-b button, .pf-row button, .pf-members button, #pf-create, #p2p-send, .p2p-form .cnote button, .station-panel .cline button, .station-panel button.danger {
  font-family: inherit; font-size: 11px; letter-spacing: 1px; color: #9ff; background: rgba(0,20,30,.85); border: 1px solid #2a6a7a; padding: 4px 10px; cursor: pointer; }
.station-panel .ms-b button:hover, .pf-row button:hover, #pf-create:hover, #p2p-send:hover { background: rgba(0,60,80,.9); color: #fff; }
.station-panel .ms-b button[disabled] { opacity: .35; cursor: default; }
#pf-create { width: 100%; color: #39ff14; padding: 7px; }
.station-panel button.danger { width: 100%; color: #ff6060; border-color: #6a2a2a; }
.station-panel input[type=color] { width: 40px; height: 26px; border: 1px solid #355; background: none; padding: 0; vertical-align: middle; }
body.touch .fl-bars2 { gap: 4px; } body.touch .fl-bars2 .fl-bar span { width: auto; } body.touch .fl-bars2 .fl-bar .bar { min-width: 30px; }

/* ---- v8: one round display (scanner + nav map) ---- */
#cs-scanner { flex: 1 1 0; min-width: 0; justify-content: center; }
#scanner { width: 100%; max-width: 420px; height: auto; aspect-ratio: 2 / 1; cursor: pointer; }
#scan-range { left: 50%; right: auto; transform: translateX(-50%); bottom: -6px; white-space: nowrap; }
#scan-tools { position: absolute; top: -8px; right: 0; display: flex; gap: 3px; }
#scan-tools button { font-family: inherit; font-size: 10px; color: #9ff; background: none; cursor: pointer; min-width: 26px; padding: 2px 4px;
  border: 8px solid transparent; border-image: url(../assets/gui/button.png) 24 fill / 8px / 0 stretch; }
body.touch #cs-scanner { display: flex; }
body.touch #scanner { max-width: 230px; }
body.touch #map-in, body.touch #map-out { display: inline-block; }
body.touch #scan-tools { top: -10px; } body.touch #scan-tools button { font-size: 9px; min-width: 22px; padding: 1px 2px; }
#heat { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0; z-index: 1; transition: opacity .3s; }

/* v8 trade with pilots */
.p2p-form label { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin: 3px 0; font-size: 12px; }
.p2p-form input { width: 90px; background: rgba(0,0,0,.5); color: #cff; border: 1px solid rgba(0,230,255,.35); font: inherit; padding: 2px 4px; }
.p2p-form #p2p-to { width: 180px; flex: 0 0 auto; margin-right: auto; } .p2p-form label:first-child { justify-content: flex-start; } #p2p-send { margin-top: 6px; }
.p2p-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 6px 0; }
.p2p-cols > div > b { display: block; color: #ffd24a; margin-bottom: 4px; }
@media (max-width: 640px) { .p2p-cols { grid-template-columns: 1fr; } }

/* ---- v8.5 console: every part in its own panel, same on PC and phones ----
   stick | tabs | gauges | map | buttons | throttle */
#console { border: none; border-image: none; padding: 0; gap: 6px; height: 176px; width: min(1500px, 99vw); align-items: stretch; }
body.dev #console { width: min(1500px, calc(99vw - 300px)); }
#console > .cscreen { margin: 0; flex: 0 0 auto; padding: 4px 6px; border-width: 14px; border-image: url(../assets/gui/screen.png) 24 fill / 14px / 0 stretch; position: relative; }
#cs-stickp { display: flex; align-items: center; justify-content: center; }
#t-stick { position: relative; width: 132px; height: 132px; background: url(../assets/gui/stick_base.png) center / contain no-repeat; touch-action: none; cursor: grab; }
#t-knob { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; pointer-events: none;
  background: url(../assets/gui/stick_knob.png) center / contain no-repeat; transition: transform .05s; }
#console > #cs-left { flex: 1 1 0; min-width: 220px; }
#cs-left .ctabs { margin: -2px -2px 4px; }
#cs-left .ctabs button { font-size: 9px; padding: 2px 1px; border-width: 7px; position: relative; }
#cs-left .ctabs button[data-unread]:not([data-unread=""])::after { content: attr(data-unread); position: absolute; top: -9px; right: -9px; min-width: 14px; height: 14px;
  border-radius: 7px; background: #ff2bd6; color: #fff; font-size: 9px; line-height: 14px; text-align: center; }
#cs-content { overflow: hidden; }
#cs-chat { display: flex; flex-direction: column; min-height: 0; flex: 1; }
#cs-chat[hidden] { display: none; }
#chat-log { flex: 1; overflow-y: auto; font-size: 11px; min-height: 0; }
#chat-log .chat-line { background: none; padding: 1px 2px; margin: 0; border-bottom: 1px solid rgba(0,230,255,.08); }
#chat-log .chat-line.faction { color: #8fd8ff; }
#chat-input { margin-top: 3px; padding: 3px 6px; font-size: 11px; }
.cs-open { margin-top: 4px; font-family: inherit; font-size: 9px; letter-spacing: 1px; color: #9ff; background: none; cursor: pointer; padding: 2px;
  border: 7px solid transparent; border-image: url(../assets/gui/button.png) 24 fill / 7px / 0 stretch; }
.cline .flogo { width: 12px; height: 12px; vertical-align: -2px; margin-right: 4px; }
#console > #cs-flight { flex: 0 0 236px; }
#hud-status { position: static; transform: none; bottom: auto; left: auto; min-height: 13px; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin: -2px 0 2px; text-align: center; letter-spacing: .5px; text-shadow: 0 0 5px #f80; }
#console > #cs-scanner { display: flex; align-items: center; justify-content: center; padding: 2px 4px; }
#scanner { width: 290px; height: 145px; }
#scan-range { bottom: 0; right: 6px; }
#scan-tools { top: 0; right: 4px; }
.cs-btns { display: grid; grid-template-columns: repeat(2, 78px); grid-template-rows: repeat(4, 1fr); gap: 4px; }
.cs-btns button { position: relative; font-family: inherit; font-size: 10px; letter-spacing: 1px; color: #9ff; background: none; cursor: pointer; padding: 0 2px;
  border: 9px solid transparent; border-image: url(../assets/gui/button.png) 24 fill / 9px / 0 stretch; line-height: 1; white-space: nowrap; touch-action: none; }
.cs-btns button:hover { color: #fff; }
.cs-btns button.down { border-image-source: url(../assets/gui/button_on.png); color: #fff; }
.cs-btns button small { position: absolute; right: -4px; top: -7px; font-size: 7px; opacity: .5; letter-spacing: 0; }
.cs-btns .t-fire { background-color: rgba(200, 20, 40, .45); }
.cs-btns .t-boost { background-color: rgba(255, 150, 0, .35); }
#cs-thrp { display: flex; flex-direction: column; align-items: center; gap: 2px; }
#cs-thrp > span { font-size: 9px; letter-spacing: 1px; opacity: .7; }
#console #cs-throttle { position: relative; flex: 1; width: 34px; margin: 0; border: none; cursor: ns-resize; touch-action: none;
  background: url(../assets/gui/throttle_track.png) center / 100% 100% no-repeat; }
#cs-thr-fill { left: 9px; right: 9px; opacity: .55; }
#cs-thr-knob { position: absolute; left: -6px; right: -6px; top: 0; height: 18px; pointer-events: none;
  background: url(../assets/gui/throttle_knob.png) center / 100% 100% no-repeat; }
#cs-throttle > span { display: none; }

/* menu (top right) + about / privacy pages */
#menu-btn { position: fixed; top: 10px; right: max(12px, env(safe-area-inset-right)); z-index: 30; font-family: inherit; font-size: 11px; letter-spacing: 2px; color: #9ff;
  background: none; cursor: pointer; padding: 4px 10px; border: 10px solid transparent; border-image: url(../assets/gui/button.png) 24 fill / 10px / 0 stretch; }
#menu { position: fixed; top: 54px; right: max(12px, env(safe-area-inset-right)); z-index: 30; display: flex; flex-direction: column; gap: 4px; width: 200px; }
#menu[hidden] { display: none; }
#menu button { font-family: inherit; font-size: 11px; letter-spacing: 1px; color: #9ff; text-align: left; background: rgba(0,10,20,.85); cursor: pointer; padding: 6px 10px;
  border: 10px solid transparent; border-image: url(../assets/gui/button.png) 24 fill / 10px / 0 stretch; }
#menu button:hover { color: #fff; border-image-source: url(../assets/gui/button_on.png); }
#help-hint { right: 140px; }
#page { position: fixed; z-index: 40; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(720px, 94vw); max-height: 86vh; overflow-y: auto; }
#page[hidden] { display: none; }
#page-body { font-size: 12px; line-height: 1.55; color: #cfe; } #page-body h2 { font-size: 13px; color: #ff2bd6; letter-spacing: 2px; margin: 14px 0 4px; }
#page-body a { color: #7dffb0; }

/* small screens + phones: same parts, smaller */
@media (max-width: 1280px) { #console > #cs-flight { flex-basis: 200px; } #scanner { width: 230px; height: 115px; } .cs-btns { grid-template-columns: repeat(2, 70px); } }
body.touch #console { height: 128px; width: 100vw; bottom: 4px; gap: 3px; padding: 0 max(4px, env(safe-area-inset-left)); }
body.touch #console > .cscreen { border-width: 9px; padding: 1px 3px; }
body.touch #t-stick { width: 104px; height: 104px; }
body.touch #t-knob { width: 46px; height: 46px; margin: -23px 0 0 -23px; }
body.touch #console > #cs-left { display: flex; min-width: 150px; }
body.touch #cs-left .ctabs button { font-size: 7px; letter-spacing: 0; border-width: 5px; }
body.touch #cs-content, body.touch #chat-log { font-size: 9px; }
body.touch .crow img { width: 10px; height: 10px; }
body.touch #console > #cs-flight { flex: 0 0 150px; font-size: 8px; }
body.touch #hud-speed { font-size: 15px; }
body.touch #hud-status { font-size: 8px; }
body.touch #fl-nav { display: none; }
body.touch #console > #cs-scanner { display: flex; }
body.touch #scanner { width: 150px; height: 75px; }
body.touch #scan-tools button { padding: 0 4px; font-size: 9px; }
body.touch .cs-btns { grid-template-columns: repeat(2, 58px); gap: 3px; }
body.touch .cs-btns button { font-size: 8px; border-width: 6px; letter-spacing: 0; }
body.touch .cs-btns button small { display: none; }
body.touch #console #cs-throttle { display: block; width: 28px; }
body.touch #menu-btn { top: 6px; font-size: 9px; padding: 2px 6px; }
/* narrow phones (most phones held sideways are 640-930 px wide): everything shrinks a bit so all six panels fit */
@media (max-width: 930px) {
  body.touch #console > .cscreen { border-width: 7px; padding: 1px 2px; }
  body.touch #t-stick { width: 80px; height: 80px; } body.touch #t-knob { width: 36px; height: 36px; margin: -18px 0 0 -18px; }
  body.touch #console > #cs-left { min-width: 120px; }
  body.touch #console > #cs-flight { flex-basis: 118px; font-size: 7px; } body.touch #hud-speed { font-size: 12px; }
  body.touch #scanner { width: 118px; height: 59px; }
  body.touch .cs-btns { grid-template-columns: repeat(2, 48px); } body.touch .cs-btns button { font-size: 7px; border-width: 5px; }
  body.touch #console #cs-throttle { width: 22px; }
}
.login-links { margin-top: 14px; font-size: 11px; opacity: .7; } .login-links a { color: #7dffb0; }
/* phones: the docked panel sits between the top of the screen and the console, two buttons per row */
body.touch #dock { top: 6px; bottom: 140px; transform: translateX(-50%); width: min(560px, 62vw); max-height: none; overflow-y: auto; padding: 6px 10px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; align-content: start; }
body.touch #dock[hidden] { display: none; }
body.touch #dock .dock-title, body.touch #dock .dock-name, body.touch #dock .dock-info { grid-column: 1 / -1; margin: 0; }
body.touch #dock .dock-title { font-size: 9px; } body.touch #dock .dock-name { font-size: 15px; } body.touch #dock .dock-info { font-size: 10px; }
body.touch #dock button { margin: 0; padding: 5px 4px; font-size: 10px; letter-spacing: 1px; }
body.touch #dock button small { display: none; }
body.touch #menu { top: 40px; width: 170px; gap: 2px; } body.touch #menu button { font-size: 9px; padding: 3px 8px; border-width: 7px; }
body.touch #net-status { left: max(8px, env(safe-area-inset-left)); top: 6px; transform: none; font-size: 9px; letter-spacing: 1px; text-align: left; max-width: 30vw; }

/* v10: on the ground the throttle panel isn't needed */
body.on-ground #cs-thrp { display: none; }
.cs-btns[data-set="landed"], .cs-btns[data-set="rover"] { grid-template-rows: repeat(2, 1fr); }
.cs-btns[data-set="foot"] { grid-template-rows: repeat(3, 1fr); }
.help-sub { color: #ff2bd6; letter-spacing: 2px; padding-top: 8px; }
.cs-btns[data-set="foot"] { grid-template-rows: repeat(4, 1fr); }

/* v10.5 skin screen */
.skin-wrap { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
#skin-3d { background: radial-gradient(#1b2a3a, #05070d); border: 1px solid rgba(0,230,255,.3); }
.skin-side { flex: 1; min-width: 220px; }
.skin-side button, .skin-up { font-family: inherit; font-size: 11px; letter-spacing: 1px; color: #9ff; background: none; cursor: pointer; padding: 4px 8px;
  border: 9px solid transparent; border-image: url(../assets/gui/button.png) 24 fill / 9px / 0 stretch; display: inline-block; }
.skin-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.skin-side ol { padding-left: 18px; } .skin-side li { margin: 8px 0; }
#page { top: calc((100vh - 190px) / 2); max-height: calc(100vh - 210px); }
body.touch #page { top: calc((100vh - 140px) / 2); max-height: calc(100vh - 150px); }

/* v10.5 guns on foot */
#holo-sight { position: fixed; left: 50%; top: 50%; width: 46vmin; height: 46vmin; transform: translate(-50%, -50%); pointer-events: none; z-index: 6;
  filter: drop-shadow(0 0 4px rgba(0, 230, 255, .8)); opacity: .9; }
#holo-sight svg { width: 100%; height: 100%; }
#hitmark { position: fixed; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; pointer-events: none; z-index: 7; opacity: 0; transition: opacity .08s;
  background: linear-gradient(45deg, transparent 45%, #fff 45%, #fff 55%, transparent 55%), linear-gradient(-45deg, transparent 45%, #fff 45%, #fff 55%, transparent 55%);
  -webkit-mask: radial-gradient(circle, transparent 5px, #000 6px); mask: radial-gradient(circle, transparent 5px, #000 6px); }
#hitmark.kill { filter: drop-shadow(0 0 3px #ff3030) hue-rotate(0deg); background-color: transparent; transform: scale(1.4); }
#armoury .arm-table td small { opacity: .6; font-size: 10px; }
#armoury .holo { color: #00e6ff; }
body.touch #armoury .arm-table td small { display: none; }
body.scoped #crosshair { display: none; }
#dock button.raid { border-color: #ff4060; color: #ff7080; }
/* v11 your capital ship's hangar panel */
#base { position: fixed; right: 14px; top: 64px; width: 250px; padding: 12px 14px; background: rgba(8, 10, 24, .88); border: 1px solid #00e6ff; z-index: 8; font-size: 12px; }
#base[hidden] { display: none; }
#base button { display: block; width: 100%; margin: 5px 0; padding: 7px; font-family: inherit; font-size: 12px; letter-spacing: 1px; background: #11132c; color: #cfe; border: 1px solid #2a6a8a; cursor: pointer; }
#base button:hover { background: #22224a; }
#base .dock-name { font-size: 16px; margin: 2px 0 4px; } #base .dock-info { opacity: .75; font-size: 11px; margin: 3px 0; }
body.touch #base { top: 6px; right: 6px; width: 200px; padding: 6px 8px; font-size: 10px; }
body.touch #base button { padding: 4px; margin: 3px 0; font-size: 10px; }
.st-capital { margin: 10px 0 4px; padding: 8px 10px; border: 1px solid #7fd0ff; font-size: 12px; line-height: 1.5; }
.st-capital button { margin-left: 8px; }
/* v12 first paint: a real page (for players + search engines) until the game is running */
#intro { position: fixed; inset: 0; z-index: 30; overflow-y: auto; background: #05070d; color: #cfe; font: 14px/1.6 "Courier New", monospace; padding: 28px 20px 40px; box-sizing: border-box; }
#intro header, #intro section, #intro footer { max-width: 760px; margin: 0 auto; }
#intro h1 { color: #fff; letter-spacing: 6px; font-size: 24px; text-shadow: 0 0 12px #ff2bd6; margin: 0 0 6px; }
#intro h2 { color: #ff2bd6; letter-spacing: 3px; font-size: 13px; margin: 22px 0 4px; }
#intro .intro-tag { color: #9fe; } #intro .intro-loading { color: #7dffb0; animation: blinky 1.2s infinite; }
#intro a, .intro-links a { color: #7dffb0; } .intro-links { margin-top: 26px !important; font-size: 13px; }
@keyframes blinky { 50% { opacity: .35; } }
body.playing #intro { display: none; }
body.login-open #intro { z-index: 9; }
body.login-open #intro .intro-loading { display: none; }

/* v12 BUILD */
#build { width: min(1100px, 98vw); height: min(720px, 94vh); max-height: 94vh; display: flex; flex-direction: column; overflow: hidden; }
#build[hidden] { display: none; }
body.dev #build { width: min(1100px, calc(98vw - 300px)); }
#build .st-head { gap: 8px; }
#build .bd-tabs { flex: 0 1 320px; margin: 0; }
.bd-body { flex: 1; display: flex; gap: 8px; min-height: 0; }
#bd-view { flex: 1 1 0; min-width: 0; height: 100%; background: radial-gradient(#0d2230, #050a10); border: 1px solid #234; touch-action: none; cursor: grab; }
#bd-side { flex: 0 0 290px; background: rgba(2,10,16,.92); padding: 4px; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; }
.bd-row { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
#build button { font-family: inherit; font-size: 10px; color: #9ff; background: rgba(0,40,60,.6); border: 1px solid #2a6a7a; padding: 4px 6px; cursor: pointer; }
#build button.on { background: #0a5a70; color: #fff; border-color: #5ef; }
#build button.go { background: #0a5a30; border-color: #39ff14; color: #dfd; }
#build button:disabled { opacity: .4; cursor: default; }
#build input { flex: 1; font-family: inherit; font-size: 12px; background: #021018; color: #cff; border: 1px solid #2a6a7a; padding: 4px; }
.bd-paint button { width: 24px; height: 20px; padding: 0 !important; }
.bd-paint button.on { outline: 2px solid #fff; }
.bd-tray { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.bd-tray button { display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.bd-tray b { font-size: 16px; } .bd-tray small { color: #8aa; font-size: 9px; }
.bd-tray button.del { color: #f88; border-color: #844; }
.bd-stats { width: 100%; font-size: 11px; border-collapse: collapse; } .bd-stats td { padding: 2px 3px; border-bottom: 1px solid rgba(0,230,255,.1); } .bd-stats td:nth-child(odd) { color: #8ab; }
.bd-cost { font-size: 12px; color: #ffcc66; padding: 4px; border: 1px solid #554; text-align: center; } .bd-cost.short { color: #f66; border-color: #844; }
.bd-note { font-size: 10px; color: #8ab; line-height: 1.35; }
.bd-help { font-size: 10px; color: #688; text-align: center; padding-top: 3px; }
body.touch #build { width: 99vw; height: 98vh; }
body.touch #bd-side { flex-basis: 200px; } body.touch .bd-tray { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 700px) { .bd-body { flex-direction: column; } #bd-side { flex: 0 0 45%; } }

/* v14 accounts */
.login-tabs { display: flex; gap: 4px; margin-bottom: 10px; }
.login-tabs button { flex: 1; margin: 0 !important; background: #0b0b1e; color: #889; border: 1px solid #355; font-size: 12px; }
.login-tabs button.on { color: #0ff; border-color: #0ff; }
.login-body input + input { margin-top: 6px; }
.login-code { font-size: 22px; letter-spacing: 3px; color: #ffe066; border: 1px dashed #ffe066; padding: 10px; margin: 8px 0; user-select: all; }
.login-small { font-size: 11px; color: #99a; line-height: 1.4; }
.login-small input { width: auto !important; display: inline; }
.login-spin { width: 28px; height: 28px; margin: 10px auto; border: 3px solid #355; border-top-color: #0ff; border-radius: 50%; animation: lspin 0.8s linear infinite; }
@keyframes lspin { to { transform: rotate(360deg); } }
/* v14 BUILD: the selected part */
.bd-sel { border: 1px solid #ffe040; padding: 4px; font-size: 11px; color: #ffe8a0; }
.bd-grid { display: grid; grid-template-columns: 14px repeat(5, 1fr); gap: 2px; align-items: center; margin: 4px 0; }
.bd-grid span { font-weight: bold; text-align: center; }
#build .bd-grid button { padding: 3px 1px; font-size: 9px; }
/* v14 map autopilot buttons */
#gal-info button.gi-go, .gi-go { color: #39ff14 !important; border-color: #39ff14 !important; font-weight: bold; }
.gi-go small { font-weight: normal; opacity: .75; }

/* ============ v14 CONSOLE LOOK: skeuominimal hardware (Braun / studio-gear style) ============
   Only textures + colours change here - nothing moves. Pop-up screens (market, shipyard, build, maps, login, menu list)
   keep the holographic look. Textures: assets/gui/hw_*.png (scripts: make_hw_gui.py) - repaint them freely. */
#console > .cscreen { border-image-source: url(../assets/gui/hw_screen.png); }
#console .ctabs button { border-image-source: url(../assets/gui/hw_tab.png); color: #c9ccd0; text-shadow: none; }
#console .ctabs button.on { border-image-source: url(../assets/gui/hw_tab_on.png); color: #fff; }
#console .ctabs button.on::before, .cs-btns button.down::before, #t-buttons button.down::before {   /* a little status LED */
  content: ''; position: absolute; left: 3px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%;
  background: #6fffe0; box-shadow: 0 0 6px 2px rgba(60, 230, 200, .7); }
.cs-btns button.down::before, #t-buttons button.down::before { background: #ffb070; box-shadow: 0 0 6px 2px rgba(255, 120, 40, .8); }
.cs-btns button, #t-buttons button, #t-full, #console .cs-open, #scan-tools button, #menu-btn {
  border-image-source: url(../assets/gui/hw_key.png); color: #2b2c30; text-shadow: 0 1px 0 rgba(255,255,255,.45); font-weight: bold; }
.cs-btns button:hover, #scan-tools button:hover, #menu-btn:hover { color: #000; }
.cs-btns button.down, #t-buttons button.down { border-image-source: url(../assets/gui/hw_key_on.png); color: #111; }
.cs-btns button small { color: #2b2c30; opacity: .6; }
.cs-btns .t-fire, #t-buttons .t-fire { background-color: transparent; border-image-source: url(../assets/gui/hw_key_red.png); color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.35); }
.cs-btns .t-fire.down, #t-buttons .t-fire.down { border-image-source: url(../assets/gui/hw_key_red_on.png); color: #fff; }
.cs-btns .t-boost, #t-buttons .t-boost { background-color: transparent; border-image-source: url(../assets/gui/hw_key_orange.png); color: #2a1600; }
.cs-btns .t-boost.down, #t-buttons .t-boost.down { border-image-source: url(../assets/gui/hw_key_orange_on.png); }
.cs-btns .t-fire small, .cs-btns .t-boost small { color: inherit; }
#t-stick, #console #t-stick { background-image: url(../assets/gui/hw_stick_base.png); }
#t-knob, #console #t-knob { background-image: url(../assets/gui/hw_stick_knob.png); }
#console #cs-throttle, #t-throttle { background-image: url(../assets/gui/hw_throttle_track.png); }
#cs-thr-knob, #t-thr-knob { background-image: url(../assets/gui/hw_throttle_knob.png); }
#cs-thr-fill { opacity: .25; }
#console .bar { background-image: url(../assets/gui/hw_bar_frame.png); border-radius: 3px; }
#console .fl-bar > span, #cs-thrp > span { color: #c9ccd0; letter-spacing: 1px; }
