:root {
  --bg: #03060d; --bg2: #07101e; --panel: rgba(8, 16, 30, .78); --panel2: rgba(14, 26, 46, .85);
  --line: rgba(110, 190, 255, .16); --line2: rgba(110, 190, 255, .32);
  --text: #dfeaff; --muted: #8597b8; --cyan: #5ee6ff; --amber: #ffb547; --gold: #ffd15c; --green: #6ff2a4; --red: #ff5d6c; --violet: #b48cff;
  --r: 12px; --display: 'Orbitron', 'Inter', system-ui, sans-serif; --ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --hud-h: 58px; --log-h: 112px; --rail-w: 78px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.45 var(--ui); -webkit-font-smoothing: antialiased; }
body { overflow: hidden; }
body.busy { cursor: progress; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--cyan); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
h4 { font: 600 11px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); margin: 18px 0 8px; opacity: .9; }
h4 small { font: 400 11px var(--ui); letter-spacing: 0; text-transform: none; margin-left: 6px; }
p { margin: 0 0 10px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.gold { color: var(--gold); } .ok { color: var(--green); } .bad { color: var(--red); }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; } .row.end { justify-content: flex-end; } .row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.icon { width: 18px; height: 18px; vertical-align: -4px; flex: none; }
.icon.sm { width: 14px; height: 14px; vertical-align: -2px; }
.glass { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); box-shadow: 0 10px 40px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(160, 220, 255, .06); }

/* Buttons & form controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line2); background: rgba(40, 70, 110, .35); color: var(--text); cursor: pointer; font-weight: 600; font-size: 13px; text-decoration: none; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; }
.btn:hover:not(:disabled) { background: rgba(70, 120, 180, .45); border-color: var(--cyan); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, #23b9e0, #1479a8); border-color: #5ee6ff; color: #fff; box-shadow: 0 0 18px rgba(94, 230, 255, .25); }
.btn.primary:hover:not(:disabled) { background: linear-gradient(180deg, #3fd0f5, #1a8dc3); }
.btn.danger { background: linear-gradient(180deg, #c7344a, #8a1e31); border-color: #ff5d6c; color: #fff; }
.btn.danger:hover:not(:disabled) { background: linear-gradient(180deg, #e04459, #a2263b); border-color: #ff8a95; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover:not(:disabled) { background: rgba(94, 230, 255, .08); border-color: var(--line2); }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn.block { width: 100%; }
.icon-btn { position: relative; padding: 6px 8px; }
input, select, textarea { width: 100%; background: rgba(2, 6, 14, .7); border: 1px solid var(--line2); border-radius: 8px; padding: 9px 11px; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(94, 230, 255, .15); }
label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 500; }
.pill { display: inline-block; font-style: normal; font: 600 10px/1 var(--display); letter-spacing: .08em; padding: 4px 7px; border-radius: 999px; border: 1px solid var(--line2); color: var(--cyan); background: rgba(94, 230, 255, .07); }
.pill.green { color: var(--green); border-color: rgba(111, 242, 164, .4); background: rgba(111, 242, 164, .08); }
.pill.gold { color: var(--gold); border-color: rgba(255, 209, 92, .4); }
.tag { font-style: normal; color: var(--amber); font-weight: 600; font-size: 12px; }
.badge { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--red); color: #fff; font: 700 10px/16px var(--ui); text-align: center; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #3b4760; vertical-align: 1px; }
.dot.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.bar { display: block; height: 4px; border-radius: 2px; background: rgba(120, 160, 220, .15); overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), #9ff3ff); border-radius: 2px; transition: width .4s; }
.tabs { display: flex; gap: 4px; padding: 3px; background: rgba(2, 6, 14, .6); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 14px; overflow-x: auto; }
.tabs button { flex: 1; padding: 7px 12px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-weight: 600; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.tabs button.on { background: rgba(94, 230, 255, .14); color: var(--text); box-shadow: inset 0 0 0 1px var(--line2); }
.tabs button:disabled { opacity: .4; }
.tabs.sm { margin: 0; } .tabs.sm button { padding: 5px 9px; font-size: 12px; }
.eyebrow { font: 600 10px/1.2 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); opacity: .85; margin-bottom: 4px; }
.eyebrow.danger { color: var(--red); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; padding: 12px 14px; background: rgba(2, 6, 14, .45); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; }
.kv > span { color: var(--muted); font-size: 12.5px; }
.kv > b { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.kv.big > b { font-size: 16px; }
.list { display: flex; flex-direction: column; gap: 4px; }
.li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; background: rgba(2, 6, 14, .45); border: 1px solid var(--line); border-radius: 9px; width: 100%; text-align: left; color: inherit; font: inherit; }
button.li { cursor: pointer; } button.li:hover { border-color: var(--line2); }
.li.hostile { border-color: rgba(255, 93, 108, .35); } .li.own { border-color: rgba(111, 242, 164, .35); }
.li > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.alert { padding: 10px 12px; border-radius: 9px; background: rgba(255, 93, 108, .12); border: 1px solid rgba(255, 93, 108, .4); color: #ffb3ba; font-weight: 600; margin-bottom: 8px; }

/* Boot & auth */
.boot { height: 100vh; display: grid; place-content: center; text-align: center; background: radial-gradient(ellipse at center, #0d1d36, #02040a 70%); }
.boot-logo, .logo { font: 900 30px/1 var(--display); letter-spacing: .14em; color: #fff; }
.logo span, .boot-logo span { color: var(--cyan); }
.boot-sub { color: var(--muted); margin-top: 10px; }
.logo { font-size: 15px; white-space: nowrap; text-shadow: 0 0 20px rgba(94, 230, 255, .35); }
.logo.big { font-size: 34px; margin-bottom: 12px; }
.auth { min-height: 100vh; display: flex; align-items: center; padding: 32px max(16px, 6vw); background-size: cover; background-position: center; background-color: #02040a; overflow-y: auto; height: 100vh; }
.auth-card { width: min(440px, 100%); padding: 32px; }
.auth .tag { color: #b7c6e2; font-size: 15px; font-weight: 400; display: block; margin-bottom: 18px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form .err { color: var(--red); min-height: 18px; font-size: 13px; }
.features { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 8px; color: #b7c6e2; font-size: 13px; }
.features li { display: flex; gap: 10px; align-items: center; }
.announce { padding: 10px 12px; border-radius: 9px; border: 1px solid rgba(255, 181, 71, .4); background: rgba(255, 181, 71, .08); color: #ffd99a; margin-bottom: 14px; font-size: 13px; }
#turnstile { min-height: 65px; }

/* Shell layout */
.shell { position: fixed; inset: 0; display: grid; grid-template-columns: var(--rail-w) 1fr; grid-template-rows: var(--hud-h) 1fr var(--log-h); }
.hud { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; padding: 0 14px; background: linear-gradient(180deg, rgba(10, 20, 38, .96), rgba(5, 11, 22, .96)); border-bottom: 1px solid var(--line); z-index: 5; min-width: 0; }
.sector-chip { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 9px; border: 1px solid var(--line2); background: rgba(94, 230, 255, .07); cursor: pointer; white-space: nowrap; }
.sector-chip b { font: 700 13px var(--display); letter-spacing: .05em; }
.sector-chip span { color: var(--muted); font-size: 12px; }
.stats { display: flex; gap: 6px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.stats::-webkit-scrollbar { display: none; }
.stat { position: relative; display: flex; align-items: center; gap: 8px; padding: 5px 10px 7px; border-radius: 9px; background: rgba(2, 6, 14, .5); border: 1px solid var(--line); white-space: nowrap; }
.stat b { display: block; font: 700 13px/1.1 var(--display); letter-spacing: .02em; }
.stat b small { font: 500 10px var(--ui); color: var(--muted); }
.stat span { display: block; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.stat .bar { position: absolute; left: 8px; right: 8px; bottom: 3px; height: 2px; }
.stat.gold b { color: var(--gold); } .stat.low b { color: var(--red); } .stat.rank b { color: var(--violet); font-size: 12px; }
.hud-right { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.day { font: 600 12px var(--display); color: var(--muted); padding: 0 8px; white-space: nowrap; }
.rail { grid-row: 2 / 4; display: flex; flex-direction: column; gap: 2px; padding: 8px 6px; background: rgba(5, 11, 22, .96); border-right: 1px solid var(--line); overflow-y: auto; z-index: 4; }
.rail button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 2px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--muted); font-size: 10.5px; font-weight: 600; cursor: pointer; letter-spacing: .02em; }
.rail button .icon { width: 22px; height: 22px; opacity: .75; }
.rail button:hover { color: var(--text); background: rgba(94, 230, 255, .06); }
.rail button.on { color: var(--text); background: rgba(94, 230, 255, .12); border-color: var(--line2); box-shadow: inset 3px 0 0 var(--cyan); }
.rail button.on .icon { opacity: 1; }
.rail .badge { top: 4px; right: 10px; }
.stage { position: relative; overflow: hidden; background: radial-gradient(ellipse at 50% 40%, #0b1730, #02040a 75%); }
.stage canvas.gl { position: absolute; inset: 0; display: block; touch-action: none; }
.nogl { position: absolute; inset: 0; display: grid; place-content: end center; padding: 30px; text-align: center; color: var(--muted); }
.nogl-art { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .5; z-index: -1; }
.announce-bar { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 3; padding: 8px 14px; border-radius: 999px; background: rgba(40, 24, 4, .85); border: 1px solid rgba(255, 181, 71, .5); color: #ffd99a; font-size: 13px; max-width: 60%; text-align: center; }
.logbar { grid-column: 2; border-top: 1px solid var(--line); background: rgba(3, 7, 15, .97); z-index: 4; min-width: 0; }
.log-lines { height: 100%; overflow-y: auto; padding: 8px 14px; font: 12.5px/1.55 'JetBrains Mono', ui-monospace, Menlo, monospace; }
.ll { color: #b3c3df; } .ll time { color: #4c5d7d; margin-right: 10px; }
.ll.good { color: var(--green); } .ll.bad, .ll.death { color: var(--red); } .ll.warn { color: var(--amber); } .ll.dim { color: #7284a6; } .ll.hit { color: #ff9aa4; } .ll.ach { color: var(--gold); }

/* 3D overlays */
.gl-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.gl-label { position: absolute; left: 0; top: 0; font: 600 11px var(--ui); color: #c6d6f5; text-shadow: 0 1px 3px #000, 0 0 6px #000; white-space: nowrap; will-change: transform; }
.gl-label b { font: 700 10.5px var(--display); color: #fff; margin-right: 3px; }
.gl-label.here { color: var(--cyan); } .gl-label.sel { color: var(--amber); } .gl-label.dock b, .gl-label.dock { color: var(--gold); }
.gl-label.s { padding: 2px 7px; border-radius: 6px; background: rgba(3, 8, 18, .6); border: 1px solid var(--line); font-size: 11px; }
.gl-label.s.port { color: var(--gold); border-color: rgba(255, 209, 92, .35); }
.gl-label.s.mine { color: var(--green); border-color: rgba(111, 242, 164, .35); }
.gl-label.s.hostile { color: var(--red); border-color: rgba(255, 93, 108, .4); }
.gl-label.s.wl { color: var(--cyan); cursor: default; } .gl-label.s.wl.unk { color: var(--violet); }
.gl-label.s.ship { color: #ffd6a8; }
.gl-tip { position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; padding: 7px 10px; border-radius: 8px; background: rgba(4, 10, 22, .92); border: 1px solid var(--line2); font-size: 12px; white-space: nowrap; }
.gl-tip span { color: var(--muted); }
.warpflash { position: absolute; inset: 0; pointer-events: none; z-index: 2; background: radial-gradient(circle, rgba(200, 245, 255, .9), rgba(94, 230, 255, .3) 40%, transparent 70%); opacity: 0; }
.warpflash.go { animation: warpflash .7s ease-out; }
@keyframes warpflash { 0% { opacity: 0; } 25% { opacity: .9; } 100% { opacity: 0; } }

/* Side command panel */
.side { position: absolute; left: 14px; top: 14px; bottom: 14px; width: 340px; display: flex; flex-direction: column; z-index: 3; overflow: hidden; }
.side-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.side-head h2, .sheet-hero h2 { font: 700 19px/1.2 var(--display); letter-spacing: .03em; }
.side-head h2 span { display: block; font: 500 13px var(--ui); color: var(--muted); letter-spacing: 0; margin-top: 2px; }
.side-scroll { overflow-y: auto; padding: 4px 16px 16px; flex: 1; }
.warps { display: flex; flex-wrap: wrap; gap: 6px; }
.warp { position: relative; min-width: 54px; padding: 10px 10px; border-radius: 10px; border: 1px solid rgba(94, 230, 255, .45); background: linear-gradient(180deg, rgba(94, 230, 255, .15), rgba(94, 230, 255, .04)); color: #fff; cursor: pointer; font: 700 15px var(--display); transition: transform .1s, box-shadow .15s; }
.warp:hover { box-shadow: 0 0 16px rgba(94, 230, 255, .4); transform: translateY(-1px); }
.warp.unk { border-color: rgba(180, 140, 255, .45); background: linear-gradient(180deg, rgba(180, 140, 255, .16), rgba(180, 140, 255, .04)); }
.warp i { font-style: normal; font-size: 10px; margin-left: 3px; color: var(--amber); }
.card { border: 1px solid var(--line2); border-radius: 11px; overflow: hidden; margin-top: 12px; cursor: pointer; background: rgba(2, 6, 14, .5); }
.card:hover { border-color: var(--cyan); }
.card-art { height: 92px; background-size: cover; background-position: center; }
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.prices { display: flex; gap: 6px; flex-wrap: wrap; font-size: 12px; }
.prices span { padding: 3px 7px; border-radius: 6px; background: rgba(2, 6, 14, .6); border: 1px solid var(--line); }
.prices .sell b { color: var(--amber); } .prices .buy b { color: var(--green); }
.scan-out { margin-top: 4px; }
.density.mid { color: var(--amber); } .density.hi { color: var(--red); font-weight: 700; }
.holo { padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 5px; font-size: 12.5px; background: rgba(2, 6, 14, .45); }
.course { padding: 12px; border-radius: 10px; border: 1px solid rgba(255, 181, 71, .35); background: rgba(255, 181, 71, .06); margin-bottom: 10px; display: flex; flex-direction: column; gap: 8px; }
.path { display: flex; flex-wrap: wrap; gap: 3px; font: 600 11px var(--display); color: var(--muted); }
.path span { color: var(--amber); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: 0; box-shadow: 0 0 6px currentColor; }

/* Right sheet (panels) */
.sheet { position: absolute; right: 14px; top: 14px; bottom: 14px; width: min(600px, calc(100% - 380px)); display: flex; flex-direction: column; z-index: 3; overflow: hidden; animation: slidein .2s ease-out; }
@keyframes slidein { from { transform: translateX(24px); opacity: 0; } }
.sheet-hero { position: relative; min-height: 150px; padding: 18px 18px 14px; display: flex; justify-content: space-between; align-items: flex-end; background-size: cover; background-position: center 35%; border-bottom: 1px solid var(--line); flex: none; }
.sheet-hero p { margin: 4px 0 0; color: #c7d4ee; font-size: 13px; }
.sheet-hero [data-close-sheet] { position: absolute; top: 10px; right: 10px; background: rgba(0, 0, 0, .4); }
.sheet-body { overflow-y: auto; padding: 16px 18px 22px; flex: 1; }
.npc { padding: 12px 14px; border-left: 3px solid var(--amber); background: rgba(255, 181, 71, .06); border-radius: 0 10px 10px 0; margin-bottom: 14px; }
.npc b { color: var(--amber); } .npc small { color: var(--muted); margin-left: 8px; }
.npc p { margin: 4px 0 0; font-style: italic; color: #d8e2f5; }

/* Trade rows */
.trade { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.trade-row { display: grid; grid-template-columns: 1.4fr 70px .8fr .5fr auto; gap: 10px; align-items: center; padding: 12px; border-radius: 11px; border: 1px solid var(--line); background: rgba(2, 6, 14, .5); }
.trade-row.sell { border-left: 3px solid var(--amber); } .trade-row.buy { border-left: 3px solid var(--green); }
.tr-name { display: flex; gap: 10px; align-items: center; } .tr-name .icon { width: 26px; height: 26px; }
.tr-name small, .tr-price small, .tr-hold small { display: block; color: var(--muted); font-size: 11px; }
.tr-gauge { height: 6px; border-radius: 3px; background: rgba(120, 160, 220, .15); overflow: hidden; }
.tr-gauge i { display: block; height: 100%; background: linear-gradient(90deg, #2a7fb0, var(--cyan)); }
.tr-price b { font: 700 18px var(--display); }
.sell .tr-price b { color: var(--amber); } .buy .tr-price b { color: var(--green); }
.tr-price em { display: block; font-style: normal; font-size: 11px; font-weight: 600; }
.tr-price em.up { color: var(--green); } .tr-price em.down { color: var(--red); }
.tr-hold b { font: 700 14px var(--display); }
.tr-act { display: flex; gap: 4px; }
.danger-zone { margin-top: 14px; padding: 10px 12px; border: 1px dashed rgba(255, 93, 108, .35); border-radius: 10px; }
.danger-zone summary { cursor: pointer; color: #ffa7b0; font-weight: 600; }
.danger-zone p { margin-top: 8px; }

/* Hulls & hardware */
.hulls { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.hull { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: rgba(2, 6, 14, .5); display: flex; flex-direction: column; }
.hull.cur { border-color: rgba(111, 242, 164, .5); }
.hull-art { height: 120px; background-size: cover; background-position: center; background-color: #0a1426; }
.hull-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.hull-body .btn { margin-top: auto; }
.specs { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: #c0cfea; }
.specs span { display: inline-flex; align-items: center; gap: 4px; }
.hw { display: flex; flex-direction: column; gap: 6px; }
.hw-row { display: grid; grid-template-columns: auto 1fr auto auto auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(2, 6, 14, .5); }
.hw-row > .icon { width: 26px; height: 26px; }
.hw-info small { display: block; color: var(--muted); font-size: 11.5px; }
.hw-have small { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; } .hw-have { text-align: center; }
.hw-price b { color: var(--gold); white-space: nowrap; }
.bank { margin-bottom: 8px; }

/* Planets */
.planets { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.planet-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; background: rgba(2, 6, 14, .5); }
.planet-card:hover { border-color: var(--cyan); }
.pc-art { height: 96px; background-size: cover; background-position: center; }
.pc-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 5px; }
.roster { display: flex; flex-direction: column; gap: 6px; }
.roster label { display: grid; grid-template-columns: 1fr 110px 80px; align-items: center; gap: 10px; color: var(--text); font-size: 13px; }
.roster label input { padding: 6px 9px; }
.roster label em { font-style: normal; color: var(--green); font-size: 12px; text-align: right; }
.xfers { display: flex; flex-direction: column; gap: 5px; }
.xfer { display: grid; grid-template-columns: 1fr 80px 90px auto; gap: 8px; align-items: center; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--line); background: rgba(2, 6, 14, .45); font-size: 13px; }

/* Corp, rankings, news, mail, pilot */
.memo { padding: 10px 12px; border-radius: 10px; background: rgba(255, 181, 71, .07); border: 1px solid rgba(255, 181, 71, .3); margin-bottom: 8px; }
.ranks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 5px; }
.ranks li { display: grid; grid-template-columns: 30px 56px 1fr auto; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border-radius: 10px; border: 1px solid var(--line); background: rgba(2, 6, 14, .5); cursor: pointer; }
.ranks li:hover { border-color: var(--line2); }
.ranks li.me { border-color: rgba(94, 230, 255, .5); background: rgba(94, 230, 255, .07); }
.ranks .pos { font: 800 15px var(--display); text-align: center; color: var(--muted); }
.ranks li:nth-child(1) .pos { color: var(--gold); } .ranks li:nth-child(2) .pos { color: #d5dfee; } .ranks li:nth-child(3) .pos { color: #e09a62; }
.r-art { width: 56px; height: 38px; border-radius: 6px; background-size: cover; background-position: center; background-color: #0a1426; }
.r-name small { display: block; color: var(--muted); font-size: 11.5px; }
.r-val { font: 700 13px var(--display); color: var(--gold); white-space: nowrap; }
.news { display: flex; flex-direction: column; gap: 4px; }
.news-item { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 9px 12px; border-radius: 9px; background: rgba(2, 6, 14, .45); border: 1px solid var(--line); }
.news-item p { margin: 0; } .news-item time { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.news-item.kill, .news-item.raider, .news-item.crime { border-left: 3px solid var(--red); }
.news-item.announce { border-left: 3px solid var(--amber); }
.mail { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; }
.mail-item { border: 1px solid var(--line); border-radius: 10px; background: rgba(2, 6, 14, .45); }
.mail-item summary { display: grid; grid-template-columns: 140px 1fr auto; gap: 10px; padding: 10px 12px; cursor: pointer; list-style: none; }
.mail-item summary::-webkit-details-marker { display: none; }
.mail-item.unread summary { font-weight: 700; } .mail-item.unread { border-color: rgba(94, 230, 255, .45); }
.mail-item summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-item time { color: var(--muted); font-size: 11.5px; }
.mail-item p { padding: 0 12px; color: #cfdaf0; } .mail-item .row { padding: 0 12px 10px; }
.xp { margin-bottom: 12px; } .xp .bar { height: 6px; margin-top: 4px; }
.achs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.ach { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line); background: rgba(2, 6, 14, .45); opacity: .5; }
.ach.got { opacity: 1; border-color: rgba(255, 209, 92, .4); }
.ach small { display: block; color: var(--muted); font-size: 11.5px; }
.dossier-art { height: 140px; border-radius: 10px; background-size: cover; background-position: center; margin-bottom: 12px; background-color: #0a1426; }
.dossier h3 { font: 700 18px var(--display); margin-bottom: 4px; }

/* Encounter */
.encounter { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; padding: 16px; background: radial-gradient(ellipse at center, rgba(60, 0, 10, .35), rgba(0, 0, 0, .65)); animation: fadein .2s; }
@keyframes fadein { from { opacity: 0; } }
.enc { width: min(560px, 100%); overflow: hidden; border-color: rgba(255, 93, 108, .5); box-shadow: 0 0 60px rgba(255, 60, 80, .25); }
.enc-art { height: 170px; background-size: cover; background-position: center; }
.enc-body { padding: 16px 18px 18px; }
.enc-body h2 { font: 700 20px var(--display); margin-bottom: 12px; }
.vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; text-align: center; margin-bottom: 10px; }
.vs b { display: block; font: 800 26px var(--display); } .vs small { display: block; color: var(--muted); font-size: 11.5px; }
.vs > div:first-child b { color: var(--cyan); } .vs > div:last-child b { color: var(--red); }
.vs > span { font: 800 14px var(--display); color: var(--muted); }
.bar.odds { height: 6px; background: rgba(255, 93, 108, .4); } .bar.odds > i { background: var(--cyan); }
.enc-act { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin: 14px 0 8px; }
.enc-act label { flex: 1 1 140px; }

/* Social drawer */
.social { position: fixed; top: var(--hud-h); right: 0; bottom: 0; width: 360px; max-width: 100%; z-index: 7; display: flex; flex-direction: column; background: rgba(5, 11, 22, .97); border-left: 1px solid var(--line); transform: translateX(100%); transition: transform .2s ease; box-shadow: -10px 0 40px rgba(0, 0, 0, .5); }
.social.open { transform: none; }
.social-head { display: flex; gap: 6px; align-items: center; padding: 10px; border-bottom: 1px solid var(--line); }
.social-head .tabs { flex: 1; }
.social-body { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 0 10px 10px; }
.chat { flex: 1; overflow-y: auto; padding: 10px 2px; display: flex; flex-direction: column; gap: 8px; }
.msg b { cursor: pointer; color: var(--cyan); font-size: 13px; } .msg .tag { margin-left: 4px; font-size: 11px; }
.msg time { color: #4c5d7d; font-size: 11px; margin-left: 6px; }
.msg p { margin: 1px 0 0; color: #d4dff4; overflow-wrap: anywhere; }
.msg.sys { color: var(--amber); font-size: 12.5px; font-style: italic; }
.chat-form { display: flex; gap: 6px; } .chat-form input { padding: 8px 10px; }
.online { display: flex; flex-direction: column; gap: 4px; padding-top: 10px; overflow-y: auto; }

/* Toasts & modal */
#toasts { position: fixed; bottom: calc(var(--log-h) + 14px); left: 50%; transform: translateX(-50%); z-index: 20; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; width: min(520px, calc(100% - 32px)); }
.toast { padding: 10px 16px; border-radius: 10px; background: rgba(8, 18, 34, .96); border: 1px solid var(--line2); box-shadow: 0 8px 30px rgba(0, 0, 0, .5); font-weight: 500; text-align: center; animation: fadein .2s; }
.toast.good { border-color: rgba(111, 242, 164, .5); color: #c9ffe0; } .toast.error { border-color: rgba(255, 93, 108, .6); color: #ffc6cc; } .toast.ach { border-color: rgba(255, 209, 92, .7); color: var(--gold); }
.modal-back { position: fixed; inset: 0; z-index: 30; background: rgba(0, 3, 10, .7); display: grid; place-items: center; padding: 16px; animation: fadein .15s; }
.modal { width: min(460px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--bg2); border: 1px solid var(--line2); border-radius: 14px; box-shadow: 0 20px 80px rgba(0, 0, 0, .7); }
.modal.wide { width: min(820px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font: 700 15px var(--display); letter-spacing: .04em; }
.modal-body { padding: 16px; overflow-y: auto; }
.qty-form { display: flex; flex-direction: column; gap: 12px; }

/* Narrow screens */
@media (max-width: 1100px) {
  .side { width: 300px; }
  .sheet { width: calc(100% - 340px); }
  .stat span { display: none; }
}
@media (max-width: 760px) {
  :root { --hud-h: 50px; --log-h: 74px; --rail-w: 0px; }
  .shell { grid-template-columns: 1fr; grid-template-rows: var(--hud-h) 1fr var(--log-h) 58px; }
  .hud { gap: 8px; padding: 0 8px; }
  .hud .logo { display: none; }
  .sector-chip span, .sector-chip .pill { display: none; }
  .stat { padding: 4px 8px 6px; } .stat .icon { width: 14px; height: 14px; }
  .day { display: none; }
  .rail { grid-row: 4; grid-column: 1; flex-direction: row; padding: 4px; border-right: 0; border-top: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; }
  .rail button { flex: 0 0 64px; padding: 6px 2px; font-size: 10px; }
  .rail button.on { box-shadow: inset 0 3px 0 var(--cyan); }
  .logbar { grid-column: 1; grid-row: 3; }
  .log-lines { padding: 5px 10px; font-size: 11.5px; }
  .side { left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; max-height: 52%; }
  .sheet { left: 0; right: 0; top: 0; bottom: 0; width: auto; border-radius: 0; }
  .sheet-hero { min-height: 120px; }
  .trade-row { grid-template-columns: 1fr auto; }
  .tr-gauge, .tr-hold { display: none; }
  .tr-act { grid-column: 1 / -1; } .tr-act .btn.primary { flex: 1; }
  .hw-row { grid-template-columns: auto 1fr auto; } .hw-have { display: none; } .hw-row > .row { grid-column: 1 / -1; justify-content: flex-end; }
  .xfer { grid-template-columns: 1fr auto; } .xfer > span:nth-child(2), .xfer > span:nth-child(3) { font-size: 11px; }
  .roster label { grid-template-columns: 1fr 90px; } .roster label em { grid-column: 1 / -1; text-align: left; margin-top: -4px; }
  .mail-item summary { grid-template-columns: 1fr auto; } .mail-item summary span { grid-column: 1 / -1; grid-row: 2; }
  .social { top: 0; width: 100%; }
  #toasts { bottom: calc(var(--log-h) + 70px); }
  .announce-bar { max-width: 90%; }
  .auth-card { padding: 22px; }
  .logo.big { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
