* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --bg: #05060d;
    --ink: #cfe3ff;
    --dim: #6f86ad;
    --cyan: #6fd6ff;
    --glass: rgba(14, 20, 38, 0.55);
    --line: rgba(120, 160, 220, 0.14);
}
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--bg); overscroll-behavior: none; }
body { font-family: 'Inter', system-ui, sans-serif; color: var(--ink); user-select: none; cursor: none; }
/* themed glow scrollbars everywhere */
* { scrollbar-width: thin; scrollbar-color: rgba(111,214,255,0.45) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, rgba(111,214,255,0.55), rgba(111,214,255,0.28)); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; box-shadow: 0 0 8px rgba(111,214,255,0.45); }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, rgba(111,214,255,0.85), rgba(111,214,255,0.5)); box-shadow: 0 0 13px rgba(111,214,255,0.75); }
::-webkit-scrollbar-corner { background: transparent; }
#gl { position: fixed; inset: 0; display: block; touch-action: none; }

/* Touch devices: no fake cursor, allow real taps on the chrome. */
body.touch { cursor: auto; }
body.touch #cursor { display: none; }

/* Custom in-style cursor: a small neon dot with a soft halo + faint ring. */
#cursor {
    position: fixed; left: 0; top: 0; z-index: 9999; pointer-events: none;
    width: 26px; height: 26px; margin: -13px 0 0 -13px;
    transition: opacity .2s;
}
/* Just the glowing dot — no ring (it read as covering the topbar buttons). */
#cursor::after {
    content: ''; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px;
    transform: translate(-50%,-50%); border-radius: 50%;
    background: radial-gradient(circle, #fff, var(--cyan) 60%, rgba(111,214,255,0) 100%);
    box-shadow: 0 0 10px var(--cyan), 0 0 18px rgba(111,214,255,0.6);
    transition: width .12s, height .12s, box-shadow .12s;
}
#cursor.hover::after { width: 11px; height: 11px; box-shadow: 0 0 14px var(--cyan), 0 0 26px rgba(111,214,255,0.85); }
#cursor.hidden { opacity: 0; }

/* Chat */
#chat-log {
    position: fixed; top: 112px; left: 50%; transform: translateX(-50%); z-index: 9;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    pointer-events: none; max-width: 70vw;
}
.chat-msg {
    font-size: 12px; letter-spacing: 0.3px; color: var(--ink);
    background: rgba(10,14,28,0.5); border: 1px solid var(--line); border-radius: 14px;
    padding: 4px 12px; backdrop-filter: blur(6px); text-shadow: 0 0 10px rgba(0,0,0,0.8);
    animation: chatIn .3s ease; transition: opacity .8s;
}
.chat-msg .who { color: var(--cyan); font-weight: 500; margin-right: 6px; }
.chat-msg.me { border-color: rgba(111,214,255,0.35); }
.chat-msg.me .who { color: #9ee6ff; }
.chat-msg.fade { opacity: 0; }
@keyframes chatIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; } }
#chat-input {
    position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%); z-index: 30;
    width: 440px; max-width: 80vw; padding: 11px 18px; font-size: 13px; font-family: inherit;
    color: var(--ink); letter-spacing: 0.4px; text-align: center; cursor: text;
    background: rgba(10,14,28,0.7); border: 1px solid var(--cyan); border-radius: 24px;
    outline: none; backdrop-filter: blur(10px); display: none;
    box-shadow: 0 0 30px rgba(111,214,255,0.25);
}
#chat-input.open { display: block; }

/* ---- top bar ---- */
/* CSS GRID layout: three columns that can never overlap (grid tracks are
   exclusive) — controls | gauges | stats. This replaces the old flex layout
   where the centred flex:1 gauges overflowed onto the neighbouring buttons. */
#topbar {
    position: fixed; top: 0; left: 0; right: 0; min-height: 38px; z-index: 10;
    display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 16px;
    padding: env(safe-area-inset-top, 0px) calc(14px + env(safe-area-inset-right, 0px)) 0 calc(14px + env(safe-area-inset-left, 0px));
    font-size: 12px; letter-spacing: 0.5px;
    color: var(--dim);
    background: linear-gradient(180deg, rgba(5,7,14,0.85), rgba(5,7,14,0));
    pointer-events: none;
}
#topbar .seg { display: flex; align-items: center; gap: 11px; pointer-events: auto; min-width: 0; }
#topbar .seg.center { gap: 14px; }
/* stats fill the remaining track, right-aligned, and clip rather than overflow */
#topbar .seg.right { justify-self: end; justify-content: flex-end; overflow: hidden; }
/* Fixed-width slot for the ambient/sound name so the right-hand stats — and the
   centred region cluster — stay put as the track name changes length (long names
   ellipsize; the full name is in the tooltip). */
#hud-music {
    display: inline-block; width: 120px; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom;
}
.sector { color: var(--ink); font-weight: 500; letter-spacing: 2px; text-transform: lowercase; font-size: 13px; }
.galaxy { color: var(--cyan); font-weight: 500; letter-spacing: 2px; text-transform: lowercase; font-size: 12px; opacity: 0.85; }
.region { color: var(--ink); font-weight: 400; letter-spacing: 1.5px; text-transform: lowercase; font-size: 12px; opacity: 0.7; }
.sep { color: var(--dim); opacity: 0.5; margin: 0 2px; }

/* ---- location address (galaxy · region · sector), bottom-left bar ---- */
#location {
    position: fixed; z-index: 9; pointer-events: none;
    left: calc(14px + env(safe-area-inset-left, 0px));
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    display: flex; align-items: center; gap: 12px; max-width: 72vw;
    padding: 8px 16px; border-radius: 16px;
    background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(8px);
}
.loc-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.loc-item b {
    font-weight: 400; font-size: 13px; letter-spacing: 2px; text-transform: lowercase;
    color: var(--ink); opacity: 0.7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30vw;
}
.loc-item:first-child b { color: var(--cyan); opacity: 0.9; }   /* galaxy — the broadest name */
.loc-item.current b { color: #fff; opacity: 1; font-weight: 500; }  /* sector — where you are now */
.loc-item u {
    text-decoration: none; font-size: 8.5px; letter-spacing: 1.6px; text-transform: uppercase;
    color: var(--cyan); opacity: 0.6;
}
.loc-sep { color: var(--dim); opacity: 0.4; }
/* now-playing track name, tucked into the bottom-left location panel */
.loc-music { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.loc-music i { color: var(--cyan); display: inline-flex; } .loc-music i .ico { width: 13px; height: 13px; }
.loc-music b { color: var(--ink); opacity: 0.8; font-weight: 400; font-size: 12px; letter-spacing: 0.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 20vw; }
@media (max-width: 600px) {
    #location { padding: 6px 11px; gap: 8px; }
    .loc-item b { font-size: 11px; letter-spacing: 1px; max-width: 24vw; }
    .loc-item u { font-size: 8px; }
}

/* ---- fuel gauge (centre of the top bar) ---- */
#fuel {
    display: flex; align-items: center; gap: 9px;
    padding: 4px 13px; border-radius: 14px;
    background: rgba(255,255,255,0.03); border: 1px solid var(--line);
}
#fuel .fuel-ico { display: inline-flex; color: var(--cyan); }
#fuel .fuel-ico .ico { width: 15px; height: 15px; }
.fuel-bar { width: 130px; height: 6px; border-radius: 999px; background: rgba(120,160,220,0.16); overflow: hidden; }
.fuel-fill { height: 100%; width: 100%; border-radius: 999px; background: var(--cyan);
    box-shadow: 0 0 8px currentColor; transition: width .25s ease, background .4s ease; }
.fuel-lbl { font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--dim); }
#fuel.low .fuel-fill { animation: fuelLow 1s ease-in-out infinite; }
@keyframes fuelLow { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
/* Empty tank — the whole gauge flashes red. */
#fuel.empty { animation: fuelEmpty 0.7s ease-in-out infinite; }
#fuel.empty .fuel-ico, #fuel.empty .fuel-lbl { color: #ff6a5a; }
@keyframes fuelEmpty {
    0%, 100% { border-color: var(--line); box-shadow: none; background: rgba(255,255,255,0.03); }
    50%      { border-color: rgba(255,90,90,0.95); box-shadow: 0 0 18px rgba(255,90,90,0.6); background: rgba(40,14,14,0.5); }
}

/* cargo gauge — mirrors the fuel gauge (shares .fuel-bar/.fuel-fill/.fuel-lbl) */
#cargo {
    position: relative;
    display: flex; align-items: center; gap: 9px;
    padding: 4px 13px; border-radius: 14px;
    background: rgba(255,255,255,0.03); border: 1px solid var(--line);
}
/* "+N material" readout that floats just under the cargo gauge while scooping */
.cargo-flash {
    position: absolute; top: 100%; left: 50%; transform: translate(-50%, 2px); margin-top: 6px;
    display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 12px; color: #8fe6c0;
    background: rgba(8,12,22,0.92); border: 1px solid var(--line); border-radius: 10px; padding: 3px 10px;
    opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; box-shadow: 0 6px 18px rgba(0,0,0,0.4);
}
.cargo-flash.show { opacity: 1; transform: translate(-50%, 0); }
.cargo-flash i { display: inline-flex; } .cargo-flash i .ico { width: 13px; height: 13px; filter: drop-shadow(0 0 4px currentColor); }
#cargo.gain { animation: cargoGain .45s ease; }
@keyframes cargoGain { 0%, 100% { box-shadow: none; } 50% { box-shadow: 0 0 14px rgba(143,230,192,0.6); border-color: #8fe6c0; } }
#cargo .fuel-ico { display: inline-flex; color: #8fe6c0; }
#cargo .fuel-ico .ico { width: 15px; height: 15px; }
#cargo .fuel-fill { background: #8fe6c0; }
/* Full hold — the whole gauge flashes red (no room to scoop more). */
#cargo.full { animation: fuelEmpty 0.7s ease-in-out infinite; }
#cargo.full .fuel-ico, #cargo.full .fuel-lbl { color: #ff6a5a; }

/* ---- emergency beacon button (top bar, next to fuel) + direction arrows ---- */
#beacon-btn {
    pointer-events: auto;
    display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-family: inherit;
    font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: #ffd2c0;
    background: rgba(40,16,16,0.72); border: 1px solid rgba(255,90,90,0.5); border-radius: 14px;
    padding: 5px 13px; box-shadow: 0 0 16px rgba(255,90,90,0.2);
}
#beacon-btn.hidden { display: none; }
#beacon-btn i { display: inline-flex; color: #ff7a6a; }
#beacon-btn i .ico { width: 15px; height: 15px; }
#beacon-btn.active { color: #fff; border-color: rgba(255,120,90,0.95); animation: beaconPulse 1s ease-in-out infinite; }
@keyframes beaconPulse { 0%, 100% { box-shadow: 0 0 16px rgba(255,90,90,0.3); } 50% { box-shadow: 0 0 36px rgba(255,90,90,0.7); } }
#beacons { position: fixed; inset: 0; z-index: 13; pointer-events: none; }
.beacon-arrow { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.beacon-arrow i { display: inline-flex; color: #ff6a5a; filter: drop-shadow(0 0 6px rgba(255,90,90,0.85)); animation: beaconPulse 1s ease-in-out infinite; }
.beacon-arrow i .ico { width: 28px; height: 28px; }
.beacon-arrow u { text-decoration: none; font-size: 10px; letter-spacing: 0.5px; color: #ffd2c0; white-space: nowrap; text-shadow: 0 0 6px rgba(0,0,0,0.85); }

/* Small left-divider so the ship stats read as a group in the top bar. */
.stat.sep-l { border-left: 1px solid var(--line); padding-left: 12px; margin-left: 2px; }

#radar-wrap {
    position: fixed; right: 14px; top: 48px; z-index: 9;
    display: flex; flex-direction: column; align-items: flex-end;
    pointer-events: none;
}
#radar {
    width: 124px; height: 124px; border-radius: 50%;
    background: rgba(8,12,24,0.4); backdrop-filter: blur(6px);
    border: 1px solid var(--line);
    box-shadow: 0 0 24px rgba(0,0,0,0.4);
    pointer-events: auto;
}
/* The nearest few stations, listed right-aligned under the radar (it sits at the
   screen edge, so the list grows leftward). Closest is highlighted. */
#radar-label {
    width: min(220px, 62vw); margin-top: 7px; display: flex; flex-direction: column; gap: 2px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.75);
}
.rl-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; opacity: 0.72; }
.rl-name {
    color: inherit; font-size: 10px; font-weight: 500; letter-spacing: 0.2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rl-dist { flex: 0 0 auto; color: inherit; font-size: 9px; opacity: 0.85; font-variant-numeric: tabular-nums; }
.rl-row.near { opacity: 1; }
.rl-row.rl-target { opacity: 1; }
.rl-row.rl-target .rl-name { font-weight: 600; font-size: 11px; }
.rl-row.near .rl-name { font-weight: 600; font-size: 11px; }
.stat { display: inline-flex; align-items: center; gap: 5px; }
.stat i { color: var(--cyan); font-style: normal; display: inline-flex; align-items: center; }
.stat i .ico { width: 13px; height: 13px; }
/* SVG icon defaults */
.ico { width: 15px; height: 15px; display: inline-block; vertical-align: middle; }
.icon-btn .ico { width: 18px; height: 18px; display: block; }
.flag { width: 21px; height: 14px; border-radius: 2px; display: block; }
.flag-btn { padding: 4px 5px; line-height: 0; }
.stat b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; display: inline-block; text-align: right; }
.stat.light b { color: var(--cyan); }
.stat .lbl { color: var(--dim); font-size: 9px; letter-spacing: 0.5px; text-transform: uppercase; margin-left: 3px; opacity: 0.75; }
/* Fixed widths so changing digits don't reflow the bar (no flicker). */
#hud-players, #hud-anomalies { min-width: 1.6ch; }
#st-speed { min-width: 4ch; }
#st-glow { min-width: 2.5ch; }
#st-dust { min-width: 5.5ch; transition: color .5s ease, text-shadow .5s ease; }
#hud-time { min-width: 4ch; }
#hud-ly { min-width: 8ch; }
#hud-music { display: inline-block; min-width: 11ch; text-align: left; }
.statbtn {
    background: none; border: none; color: inherit; font: inherit; cursor: pointer;
    padding: 2px 4px; border-radius: 6px; transition: background .2s, color .2s;
}
.statbtn:hover { background: rgba(111,214,255,0.1); color: var(--cyan); }
.statbtn.active { background: rgba(111,214,255,0.15); color: var(--cyan); }

#players-panel {
    position: fixed; top: 184px; right: 14px; z-index: 12; width: 250px;
    background: var(--glass); border: 1px solid var(--line); border-radius: 14px;
    padding: 8px; backdrop-filter: blur(12px); display: flex; flex-direction: column; gap: 2px;
    transition: opacity .2s, transform .2s;
}
#players-panel.hidden { opacity: 0; transform: translateY(-6px); pointer-events: none; }
.players-head {
    font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--dim);
    padding: 4px 8px 6px; opacity: 0.7;
}
.player-row {
    display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink);
    padding: 6px 8px; border-radius: 9px;
}
.player-row.me-row { background: rgba(111,214,255,0.08); }
.player-row .prank { flex: none; width: 18px; text-align: center; font-size: 11px; color: var(--dim); }
.player-row .pdot { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 8px currentColor; flex: none; }
.player-row .pname { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: 0.5px; }
.player-row .pname em { color: var(--dim); font-size: 10px; font-style: normal; margin-left: 4px; }
.player-row .pstats { flex: none; text-align: right; font-size: 11px; line-height: 1.3; color: var(--ink); }
.player-row .pstats .pdust { color: var(--cyan); opacity: 0.85; font-size: 10px; }
.player-row .tp {
    flex: none; background: rgba(111,214,255,0.12); border: 1px solid rgba(111,214,255,0.3);
    color: var(--cyan); border-radius: 8px; padding: 4px 9px; font-size: 11px; cursor: pointer;
    transition: background .15s;
}
.player-row .tp:hover { background: rgba(111,214,255,0.28); }

.icon-btn {
    /* inline-flex so the box tightly wraps + centres the SVG — otherwise the icon
       overflows the clickable area and only a sliver of the button is hittable. */
    display: inline-flex; align-items: center; justify-content: center;
    background: none; border: 1px solid transparent; color: var(--dim); cursor: pointer;
    font-size: 15px; line-height: 1; padding: 7px; border-radius: 9px;
    transition: color .15s, background .15s, border-color .15s;
}
.icon-btn:hover { color: var(--cyan); background: rgba(111,214,255,0.14); border-color: rgba(111,214,255,0.35); }
.icon-btn:active { background: rgba(111,214,255,0.24); border-color: var(--cyan); }
/* Tools dropdown (gear) — tucks the less-used top-bar buttons into a tidy menu. */
.tools-wrap { position: relative; display: inline-flex; }
#tools-btn.open { color: var(--cyan); background: rgba(111,214,255,0.14); border-color: rgba(111,214,255,0.35); }
.tools-menu {
    position: absolute; top: calc(100% + 8px); left: 0; z-index: 60;
    display: flex; flex-direction: column; gap: 2px; padding: 6px; min-width: 196px;
    border-radius: 13px; background: rgba(10,16,28,0.97); border: 1px solid var(--line);
    box-shadow: 0 14px 44px rgba(0,0,0,0.55); backdrop-filter: blur(10px);
}
.tools-menu.hidden { display: none; }
.tools-row {
    display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
    padding: 9px 12px; border: 0; border-radius: 8px; background: transparent;
    color: var(--ink); font: 500 13px Inter, system-ui, sans-serif; cursor: pointer;
    transition: background .12s, color .12s;
}
.tools-row:hover { background: rgba(111,214,255,0.12); color: var(--cyan); }
.tools-row > i { display: inline-flex; flex: none; color: inherit; }
.tools-row .ico { width: 16px; height: 16px; }
#volume-slider { width: 70px; accent-color: var(--cyan); cursor: pointer; height: 3px; }

/* ESC menu hint (top-left text button) */
.menu-hint {
    background: none; border: 1px solid var(--line); color: var(--dim); cursor: pointer;
    font-family: inherit; font-size: 10px; letter-spacing: 1px; text-transform: uppercase;
    padding: 5px 11px; border-radius: 14px; transition: color .2s, border-color .2s, background .2s;
}
.menu-hint:hover { color: var(--cyan); border-color: rgba(111,214,255,0.4); background: rgba(111,214,255,0.08); }

/* ---- ESC pause menu ---- */
#menu {
    position: fixed; inset: 0; z-index: 32; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(ellipse at center, rgba(8,12,28,0.62), rgba(5,6,13,0.9));
    backdrop-filter: blur(3px); transition: opacity .25s;
}
#menu.hidden { opacity: 0; pointer-events: none; }
.menu-panel {
    width: 540px; max-width: 94vw; max-height: 88vh; overflow-y: auto;
    background: var(--glass); border: 1px solid var(--line); border-radius: 18px;
    padding: 22px 26px; backdrop-filter: blur(14px); box-shadow: 0 0 50px rgba(0,0,0,0.5);
}
.menu-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.menu-head h2 { font-weight: 200; font-size: 22px; letter-spacing: 6px; color: #fff; text-transform: lowercase; }
.menu-section { padding: 10px 0; border-top: 1px solid var(--line); }
.menu-section h3 { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--dim); margin-bottom: 8px; opacity: 0.8; }
.menu-audio { display: flex; align-items: center; gap: 12px; }
.menu-langs, .lang-row { display: flex; gap: 8px; flex-wrap: wrap; }
.lang-opt {
    display: flex; align-items: center; gap: 7px; cursor: pointer; font-family: inherit; font-size: 12px;
    color: var(--ink); background: rgba(255,255,255,0.04); border: 1px solid var(--line);
    border-radius: 10px; padding: 7px 12px; transition: border-color .15s, background .15s;
}
.lang-opt:hover { background: rgba(111,214,255,0.08); }
.lang-opt.active { border-color: rgba(111,214,255,0.5); background: rgba(111,214,255,0.12); color: var(--cyan); }
.lang-row { justify-content: center; margin-top: 18px; }
.lang-row .lang-opt { padding: 6px 9px; }
.menu-actions { padding-top: 12px; border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; }
.menu-btn {
    display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-family: inherit;
    font-size: 12px; letter-spacing: 0.5px; color: var(--dim); background: rgba(255,255,255,0.04);
    border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px;
    transition: color .15s, border-color .15s, background .15s;
}
.menu-btn:hover { color: var(--cyan); border-color: rgba(111,214,255,0.4); background: rgba(111,214,255,0.08); }

/* ---- active power-up chips (top-left, under the bar) ---- */
#buffs { position: fixed; left: 14px; top: 46px; z-index: 9; display: flex; flex-direction: row; flex-wrap: wrap; gap: 6px; max-width: 46vw; }
.buff-chip {
    font-size: 11px; color: var(--ink); letter-spacing: 0.5px;
    background: var(--glass); border: 1px solid var(--line); border-radius: 20px;
    padding: 5px 12px; display: flex; align-items: center; gap: 7px;
    backdrop-filter: blur(8px);
    animation: buffChipIn .3s ease;
}
.buff-chip .bn { font-weight: 500; }
.buff-chip .bt { font-style: normal; color: var(--c); opacity: 0.85; font-variant-numeric: tabular-nums; }
@keyframes buffChipIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; box-shadow: 0 0 8px currentColor; }
/* The chip's icon pulses + glows in its power-up colour, like the pickup orb. */
.buff-chip .bico {
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--c); animation: buffDot 1.7s ease-in-out infinite;
}
.buff-chip .bico .ico { width: 16px; height: 16px; }
@keyframes buffDot {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 4px var(--c)); }
    50%      { transform: scale(1.2); filter: drop-shadow(0 0 9px var(--c)); }
}

/* ---- pickup juice: the power-up icon flies up from the collection point ---- */
.fly-badge {
    position: fixed; z-index: 31; pointer-events: none; --c: #6fd6ff;
    transform: translate(-50%, -50%);
    transition: transform .8s cubic-bezier(.2,.7,.3,1), opacity .55s ease;
}
.fly-badge.rise { transform: translate(-50%, calc(-50% - 92px)); }   /* the icon flies up */
.fly-badge.out { opacity: 0; }
.fly-badge .fb-orb {
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--c); transform: scale(0);
    filter: drop-shadow(0 0 8px var(--c)) drop-shadow(0 0 18px var(--c));
    transition: transform .3s cubic-bezier(.2,1.7,.4,1);
}
.fly-badge .fb-orb .ico { width: 30px; height: 30px; }
.fly-badge.pop .fb-orb { transform: scale(1); }
.fly-badge.rise .fb-orb { animation: flyOrbWobble 1.2s ease-in-out infinite; }
@keyframes flyOrbWobble { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.16); } }

/* ---- power-up toast (top-centre, below the ring-hint banner) ---- */
#toast {
    position: fixed; left: 50%; top: 130px; transform: translate(-50%, -12px); z-index: 12;
    background: var(--glass); border: 1px solid rgba(155,108,255,0.4); border-radius: 30px;
    padding: 11px 22px; font-size: 13px; letter-spacing: 0.3px; color: var(--ink);
    backdrop-filter: blur(10px); display: flex; align-items: center; gap: 9px;
    opacity: 0; pointer-events: none; transition: opacity .5s, transform .5s;
    box-shadow: 0 0 30px rgba(155,108,255,0.2);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast b { color: #c9b6ff; font-weight: 600; }

/* ---- notification bar (facts / hints) — bottom, above the power-up toast ---- */
#fact {
    position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 12px); z-index: 12;
    max-width: 720px; text-align: center; font-size: 16px; font-weight: 400;
    line-height: 1.5; color: var(--ink); letter-spacing: 0.4px;
    padding: 13px 28px 13px 48px;
    background: rgba(12, 18, 34, 0.78); border: 1px solid rgba(111, 214, 255, 0.32);
    border-radius: 26px; backdrop-filter: blur(10px);
    box-shadow: 0 0 34px rgba(111, 214, 255, 0.16);
    opacity: 0; pointer-events: none; transition: opacity .6s, transform .6s;
}
#fact::before {
    content: '✦'; position: absolute; left: 22px; top: 50%; transform: translateY(-50%);
    color: var(--cyan); font-size: 16px; text-shadow: 0 0 10px var(--cyan);
}
#fact.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- orbit encounter instructions (top-centre banner) ---- */
#orbit-hint {
    position: fixed; left: 50%; top: 84px; transform: translate(-50%, -10px); z-index: 12;
    max-width: 86vw; font-size: 15px; font-weight: 500;
    line-height: 1.4; color: #fff; letter-spacing: 0.6px;
    display: inline-flex; align-items: center; gap: 10px;
    padding: 12px 26px;
    background: rgba(18, 14, 40, 0.82); border: 1.5px solid rgba(166, 120, 255, 0.75);
    border-radius: 24px; backdrop-filter: blur(10px);
    box-shadow: 0 0 34px rgba(155, 108, 255, 0.35);
    opacity: 0; pointer-events: none; transition: opacity .5s, transform .5s;
}
#orbit-hint .oh-ico { display: inline-flex; color: #c9b6ff; filter: drop-shadow(0 0 6px rgba(166,120,255,0.9)); }
#orbit-hint .oh-name { color: #eae2ff; font-weight: 600; letter-spacing: 0.3px; }
#orbit-hint .oh-ico .ico { width: 22px; height: 22px; }
/* While shown, breathe: a gentle pulse of glow + scale to draw the eye. */
#orbit-hint.show { opacity: 1; transform: translate(-50%, 0); animation: orbitHintPulse 1.8s ease-in-out infinite; }
@keyframes orbitHintPulse {
    0%, 100% { box-shadow: 0 0 28px rgba(155, 108, 255, 0.28); border-color: rgba(166, 120, 255, 0.6); transform: translate(-50%, 0) scale(1); }
    50%      { box-shadow: 0 0 46px rgba(166, 120, 255, 0.6); border-color: rgba(190, 150, 255, 0.95); transform: translate(-50%, 0) scale(1.035); }
}
#orbit-hint.show .oh-ico { animation: orbitHintIcon 1.8s ease-in-out infinite; }
@keyframes orbitHintIcon { 0%,100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.15) rotate(8deg); } }
/* Tank full — the banner turns green and flashes. */
#orbit-hint.full { color: #e2ffee; border-color: rgba(120,255,170,0.8); background: rgba(14,34,24,0.82); }
#orbit-hint.full .oh-ico { color: #7cffb0; filter: drop-shadow(0 0 7px rgba(120,255,170,0.95)); }
#orbit-hint.full.show { animation: orbitHintFull 0.9s ease-in-out infinite; }
/* Haven dock hint: carries the Haven's own emblem + colour tint. */
#orbit-hint.haven { border-color: var(--hc, var(--cyan)); box-shadow: 0 0 22px color-mix(in srgb, var(--hc, #6fd6ff) 45%, transparent); }
#orbit-hint .oh-emblem { width: 22px; height: 22px; flex: 0 0 auto; filter: drop-shadow(0 0 5px var(--hc, #6fd6ff)); }
/* Elite-style "mass lock" docking status — shown while docked, click to reopen the UI. */
/* Warp drive — a top-bar segment beside fuel/cargo when a course is set. */
#warp {
    display: flex; align-items: center; gap: 9px; padding: 4px 13px; border-radius: 14px;
    background: rgba(111,230,160,0.08); border: 1px solid rgba(111,230,160,0.4); cursor: pointer;
    animation: warpSegPulse 2s ease-in-out infinite;
}
#warp .fuel-ico { display: inline-flex; color: #7fffb4; }
#warp .fuel-ico .ico { width: 15px; height: 15px; }
.warp-pips { display: flex; gap: 3px; align-items: center; min-width: 48px; max-width: 130px; }
.warp-pip { flex: 1 1 8px; height: 6px; min-width: 7px; border-radius: 999px; background: rgba(120,160,220,0.18); overflow: hidden; position: relative; }
.warp-pip.done { background: #7fffb4; box-shadow: 0 0 6px rgba(127,255,180,0.6); }
.warp-pip.cur { background: rgba(127,255,180,0.22); }
.warp-pip.cur > i { position: absolute; inset: 0; display: block; width: 0; background: #7fffb4; border-radius: 999px; box-shadow: 0 0 6px rgba(127,255,180,0.7); transition: width .08s linear; }
#warp-dest { color: #9fffc8; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#warp.dock .warp-pip, #warp.lowfuel .warp-pip { background: rgba(255,255,255,0.12); box-shadow: none; }
#warp .warp-key { background: rgba(0,0,0,0.35); color: #d7ffe8; border-radius: 6px; padding: 1px 8px; font: 800 12px Inter, system-ui, sans-serif; }
#warp.charging { animation: none; border-color: #7fffb4; box-shadow: 0 0 22px rgba(111,230,160,0.7); }
#warp.dock { background: rgba(255,194,90,0.08); border-color: rgba(255,194,90,0.4); animation: none; cursor: default; }
#warp.dock .fuel-ico, #warp.dock .fuel-lbl { color: #ffc25a; }
#warp.dock .warp-key { display: none; }
#warp.lowfuel { background: rgba(255,138,138,0.08); border-color: rgba(255,138,138,0.4); animation: none; cursor: default; }
#warp.lowfuel .fuel-ico, #warp.lowfuel .fuel-lbl { color: #ff8a8a; }
#warp.lowfuel .warp-key { display: none; }
@keyframes warpSegPulse { 0%,100% { box-shadow: 0 0 0 rgba(111,230,160,0); } 50% { box-shadow: 0 0 18px rgba(111,230,160,0.5); } }
#dock-status {
    position: fixed; left: 0; top: 0; transform: translate(-50%, -100%); z-index: 25;
    display: flex; align-items: center; gap: 9px; padding: 7px 17px; border: 0; border-radius: 999px;
    background: rgba(8,16,28,0.85); border: 1px solid rgba(120,255,170,0.5); color: #e2ffee;
    font-family: inherit; font-size: 13px; letter-spacing: 1px; cursor: pointer;
    box-shadow: 0 0 18px rgba(120,255,170,0.3); animation: dockPulse 2.2s ease-in-out infinite;
}
#dock-status.hidden { display: none; }
/* Wormhole warning badge — floats over a nearby wormhole. */
#wormhole-warn {
    position: fixed; left: 0; top: 0; transform: translate(-50%, -100%); z-index: 26; pointer-events: none;
    display: flex; align-items: center; gap: 10px; padding: 7px 14px; border-radius: 12px;
    background: rgba(8,18,28,0.92); border: 1px solid rgba(159,239,255,0.55); box-shadow: 0 0 22px rgba(159,239,255,0.4);
    animation: wormPulse 1.6s ease-in-out infinite;
}
#wormhole-warn.hidden { display: none; }
#wormhole-warn > i { display: inline-flex; color: #9fefff; } #wormhole-warn > i .ico { width: 22px; height: 22px; }
#wormhole-warn b { display: block; color: #cdf6ff; font-size: 12px; letter-spacing: 1.5px; }
#wormhole-warn span { display: block; color: rgba(205,246,255,0.6); font-size: 11px; }
@keyframes wormPulse { 0%,100% { box-shadow: 0 0 16px rgba(159,239,255,0.32); } 50% { box-shadow: 0 0 30px rgba(159,239,255,0.7); } }
/* Bank deposit/withdraw — slim, matching the amount input's height. */
.bank-move .shop-btn { padding: 8px 15px; font-size: 13px; }
#dock-status b { color: #7fffb4; letter-spacing: 2.5px; font-weight: 600; }
#dock-status span { color: #fff; }
#dock-status em { color: var(--dim); font-style: normal; font-size: 11px; letter-spacing: 0.5px; }
#dock-status i { display: inline-flex; color: #7fffb4; } #dock-status .ico { width: 15px; height: 15px; }
@keyframes dockPulse { 0%,100% { border-color: rgba(120,255,170,0.45); } 50% { border-color: rgba(120,255,170,0.95); box-shadow: 0 0 28px rgba(120,255,170,0.5); } }
@keyframes orbitHintFull {
    0%, 100% { box-shadow: 0 0 22px rgba(90,255,150,0.4); border-color: rgba(120,255,170,0.6); transform: translate(-50%, 0) scale(1); }
    50%      { box-shadow: 0 0 48px rgba(140,255,190,0.85); border-color: rgba(160,255,200,1); transform: translate(-50%, 0) scale(1.045); }
}

/* ---- help / how-to-play overlay ---- */
#help {
    position: fixed; inset: 0; z-index: 34; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(ellipse at center, rgba(8,12,28,0.62), rgba(5,6,13,0.9));
    backdrop-filter: blur(3px); transition: opacity .25s;
}
#help.hidden { opacity: 0; pointer-events: none; }
.help-panel {
    width: 580px; max-width: 94vw; max-height: 86vh; overflow-y: auto;
    background: var(--glass); border: 1px solid var(--line); border-radius: 18px;
    padding: 22px 26px; backdrop-filter: blur(14px); box-shadow: 0 0 50px rgba(0,0,0,0.5);
}
.help-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.help-head h2 { font-weight: 200; font-size: 22px; letter-spacing: 6px; color: #fff; text-transform: lowercase; }
.help-list { display: flex; flex-direction: column; }
.help-row { display: flex; align-items: flex-start; gap: 14px; padding: 12px 4px; border-top: 1px solid var(--line); }
.help-row:first-child { border-top: none; }
.help-ico {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 11px; color: var(--cyan); margin-top: 1px;
    background: rgba(111,214,255,0.08); border: 1px solid rgba(111,214,255,0.22);
    filter: drop-shadow(0 0 5px rgba(111,214,255,0.35));
}
.help-ico .ico { width: 20px; height: 20px; }
.help-txt { display: flex; flex-direction: column; gap: 3px; }
.help-txt b { color: #fff; font-weight: 500; font-size: 14px; letter-spacing: 0.4px; }
.help-txt span { color: var(--dim); font-size: 13px; font-weight: 300; line-height: 1.5; }
/* power-up legend (under the how-to rows) */
.help-sub { margin: 24px 0 4px; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--cyan); opacity: 0.85; }
.help-sub-d { color: var(--dim); font-size: 12.5px; font-weight: 300; line-height: 1.5; margin-bottom: 10px; }
.help-pwr-grid { display: flex; flex-direction: column; }
.help-pwr { display: flex; align-items: center; gap: 12px; padding: 9px 2px; border-top: 1px solid var(--line); }
.help-pwr:first-child { border-top: none; }
.help-pwr-ico {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 9px;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    filter: drop-shadow(0 0 5px currentColor);
}
.help-pwr-ico .ico { width: 18px; height: 18px; }
.help-pwr-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.help-pwr-txt b { color: #fff; font-weight: 500; font-size: 13px; }
.help-pwr-txt span { color: var(--dim); font-size: 12px; font-weight: 300; line-height: 1.35; }
.help-pwr-tier {
    flex: 0 0 auto; font-style: normal; font-size: 10px; letter-spacing: 0.5px;
    color: var(--cyan); opacity: 0.7; font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* ---- station services overlay (Elite-style) ---- */
#station {
    position: fixed; inset: 0; z-index: 34; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(ellipse at center, rgba(8,14,30,0.66), rgba(5,6,13,0.92));
    backdrop-filter: blur(3px); transition: opacity .25s;
}
#station.hidden { opacity: 0; pointer-events: none; }
.station-panel {
    position: relative; display: flex; flex-direction: column;
    width: min(1500px, 94vw); height: min(940px, 90vh); overflow: hidden;
    background: linear-gradient(160deg, rgba(14,20,34,0.92), rgba(7,9,18,0.94));
    border: 1px solid rgba(111,214,255,0.28); border-radius: 18px;
    padding: 0; backdrop-filter: blur(16px); box-shadow: 0 0 60px rgba(0,0,0,0.55);
}
/* glowing top accent line */
.station-panel::before {
    content: ''; position: absolute; inset: 0 0 auto 0; height: 2px; border-radius: 16px 16px 0 0;
    background: linear-gradient(90deg, transparent, var(--cyan), transparent); opacity: 0.7;
}
.st-close { position: absolute; top: 22px; right: 26px; z-index: 2; }

/* header */
.st-header {
    display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 32px;
    padding: 34px 44px; border-bottom: 1px solid var(--line); flex: 0 0 auto;
}
.st-emblem { width: 132px; height: 132px; flex: 0 0 auto; filter: drop-shadow(0 0 14px rgba(0,0,0,0.5)); }
.st-ident { min-width: 0; }
.st-ident h2 { font-weight: 300; font-size: 40px; letter-spacing: 1.5px; color: #fff; line-height: 1.08; }
.st-class { font-size: 13px; letter-spacing: 3px; text-transform: uppercase; color: var(--cyan); opacity: 0.85; margin-top: 8px; }
.st-tags { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.st-tag {
    font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--dim);
    padding: 5px 13px; border: 1px solid var(--line); border-radius: 20px; font-variant-numeric: tabular-nums;
}
.st-balance { display: flex; flex-direction: column; gap: 12px; text-align: right; }
.st-bal { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.st-bal i { color: var(--cyan); display: inline-flex; } .st-bal i .ico { width: 20px; height: 20px; }
.st-bal b { font-size: 24px; color: #fff; font-variant-numeric: tabular-nums; }
.st-bal em { font-style: normal; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--dim); min-width: 70px; text-align: left; }

/* body: rubric nav + active panel — fills the remaining height */
.st-body { display: grid; grid-template-columns: 300px 1fr; flex: 1; min-height: 0; }
.st-nav { padding: 26px 18px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.st-nav-head { font-size: 10px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--cyan); opacity: 0.55; margin: 18px 10px 8px; }
.st-nav-head:first-child { margin-top: 2px; }
.st-nav-item {
    display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; cursor: pointer;
    font-family: inherit; font-size: 15px; color: var(--ink); background: transparent;
    border: none; border-left: 3px solid transparent; border-radius: 0 10px 10px 0;
    padding: 14px 16px; transition: background .14s, color .14s, border-color .14s;
}
.st-nav-item .st-nav-ico { display: inline-flex; color: var(--dim); } .st-nav-item .st-nav-ico .ico { width: 20px; height: 20px; }
.st-nav-item span { flex: 1; }
.st-nav-item:hover { background: rgba(111,214,255,0.07); }
.st-nav-item.active { background: rgba(111,214,255,0.14); border-left-color: var(--cyan); color: #fff; }
.st-nav-item.active .st-nav-ico { color: var(--cyan); }
.st-nav-item.soon { opacity: 0.55; }
.st-soon {
    font-style: normal; font-size: 9px; letter-spacing: 1px; text-transform: uppercase; color: var(--cyan);
    background: rgba(111,214,255,0.12); border-radius: 10px; padding: 3px 7px;
}
.st-content { padding: 40px 48px; overflow-y: auto; }
/* keep the active service comfortably readable inside the wide panel */
.st-content > * { max-width: 720px; }
.st-content .st-soon-panel { max-width: none; }

/* fuel gauge in the refuel panel */
.st-gauge {
    position: relative; height: 40px; border-radius: 10px; margin-bottom: 22px; overflow: hidden;
    background: rgba(120,160,220,0.1); border: 1px solid var(--line);
}
.st-gauge-fill { height: 100%; background: linear-gradient(90deg, rgba(111,214,255,0.45), var(--cyan)); transition: width .3s; box-shadow: 0 0 14px var(--cyan); }
.st-gauge-txt { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; color: #fff; font-variant-numeric: tabular-nums; text-shadow: 0 1px 3px rgba(0,0,0,0.7); }
/* vertical living fuel tank */
.fuel-tank-wrap { position: relative; width: 176px; height: 320px; margin: 6px auto 20px; }
.fuel-tank { width: 100%; height: 100%; display: block; filter: drop-shadow(0 6px 24px rgba(0,0,0,0.4)); transition: filter .25s ease; }
.fuel-tank-wrap.filling .fuel-tank { filter: drop-shadow(0 0 20px rgba(111,214,255,0.9)) drop-shadow(0 0 46px rgba(111,214,255,0.5)); }
/* refuel button: compact + centred under the tank (display:flex so margin auto works — inline-flex would ignore it) */
.shop-btn.refuel-btn { display: flex; width: 220px; max-width: 90%; margin-left: auto; margin-right: auto; justify-content: center; }
.fuel-tank-num { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; font-size: 21px; font-weight: 600; color: #fff; letter-spacing: 1px; font-variant-numeric: tabular-nums; text-shadow: 0 2px 10px rgba(0,0,0,0.8); pointer-events: none; }

/* "coming soon" placeholder for scaffolded rubrics — fills the tall content area */
.st-soon-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 100%; gap: 18px; color: var(--dim); }
.st-soon-panel i { display: inline-flex; color: var(--cyan); opacity: 0.5; } .st-soon-panel i .ico { width: 56px; height: 56px; }
.st-soon-panel h4 { font-size: 19px; letter-spacing: 3px; text-transform: uppercase; color: var(--ink); font-weight: 400; }
.st-soon-panel p { font-size: 14px; max-width: 320px; line-height: 1.6; }
.shop-row { display: flex; align-items: center; gap: 18px; padding: 13px 0; }
.shop-ico { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px;
    border-radius: 13px; color: var(--cyan); background: rgba(111,214,255,0.08); border: 1px solid rgba(111,214,255,0.22); }
.shop-ico .ico { width: 24px; height: 24px; }
/* live warp-skin preview thumbnail on the effects cards */
.fx-preview { flex: 0 0 auto; width: 66px; height: 46px; border-radius: 11px; display: block;
    background: #04060e; border: 1px solid var(--line); box-shadow: inset 0 0 14px rgba(0,0,0,0.55); }
/* custom-colour mixer (livery) */
.custom-col { display: flex; gap: 20px; align-items: center; margin-top: 10px; }
.cc-swatch { width: 64px; height: 64px; border-radius: 50%; flex: 0 0 auto; border: 2px solid rgba(255,255,255,0.3); box-shadow: 0 0 26px rgba(255,255,255,0.22); }
.cc-sliders { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cc-row { display: flex; align-items: center; gap: 12px; }
.cc-row span { width: 54px; flex: 0 0 auto; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--dim); }
.cc-row input[type=range] { flex: 1; height: 6px; -webkit-appearance: none; appearance: none; border-radius: 999px; background: rgba(120,160,220,0.18); cursor: pointer; }
.cc-row input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--cyan); box-shadow: 0 0 8px rgba(0,0,0,0.6); cursor: pointer; }
.cc-row input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--cyan); cursor: pointer; }
.shop-txt { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.relic-lore { font-style: italic; font-size: 12px; color: rgba(207,234,255,0.6); line-height: 1.35; }
.void-set { display: flex; align-items: center; gap: 12px; padding: 10px 2px; }
.void-set > span { color: var(--dim); font-size: 13px; }
.void-set input[type=range] { flex: 1; accent-color: #c79bff; cursor: pointer; }
.void-set b { color: #c79bff; min-width: 46px; text-align: right; font-variant-numeric: tabular-nums; }
.void-trove { display: flex; flex-wrap: wrap; gap: 9px; padding: 8px 2px; }
.void-relic { display: inline-flex; } .void-relic .ico { width: 26px; height: 26px; filter: drop-shadow(0 0 6px currentColor); }
.bank-balance { display: flex; align-items: baseline; gap: 11px; padding: 14px 4px 4px; }
.bank-balance > i { display: inline-flex; align-self: center; color: #ffd27f; } .bank-balance > i .ico { width: 26px; height: 26px; }
.bank-balance b { font-size: 30px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.bank-balance u { color: var(--dim); text-decoration: none; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; }
.bank-move { display: flex; align-items: center; gap: 8px; padding: 6px 2px 16px; }
.bank-move input { flex: 1; max-width: 190px; }
.shop-txt b { color: #fff; font-weight: 500; font-size: 16px; }
.shop-txt span { color: var(--dim); font-size: 13px; font-weight: 300; line-height: 1.45; }
.shop-pips { display: flex; gap: 5px; margin-top: 5px; }
.shop-pips span { width: 18px; height: 6px; border-radius: 3px; background: rgba(120,160,220,0.2); }
.shop-pips span.on { background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.shop-btn {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-family: inherit;
    font-size: 15px; color: var(--ink); background: rgba(111,214,255,0.08); border: 1px solid rgba(111,214,255,0.3);
    border-radius: 12px; padding: 12px 20px; transition: background .15s, border-color .15s, opacity .15s;
}
.shop-btn.wide { width: 100%; justify-content: center; }
.shop-btn em { font-style: normal; display: inline-flex; align-items: center; gap: 6px; color: var(--cyan); font-variant-numeric: tabular-nums; }
.shop-btn em .ico, .shop-btn i .ico { width: 16px; height: 16px; }
.shop-btn:hover:not(:disabled) { background: rgba(111,214,255,0.16); border-color: rgba(111,214,255,0.6); }
.shop-btn:disabled { opacity: 0.4; cursor: default; }
/* upgrade-purchase celebration */
.shop-row.bought { position: relative; animation: bought .55s ease; }
@keyframes bought {
    0% { transform: none; box-shadow: none; background: transparent; }
    25% { transform: scale(1.015); box-shadow: 0 0 28px rgba(154,255,200,0.6); background: rgba(154,255,200,0.12); }
    100% { transform: none; box-shadow: none; background: transparent; }
}
.reward-pop {
    position: absolute; left: 50%; top: 38%; z-index: 6; pointer-events: none;
    display: flex; align-items: center; gap: 8px; font: 700 28px Inter, system-ui, sans-serif;
    color: #ffd27f; text-shadow: 0 2px 16px rgba(255,210,127,0.8); animation: rewardPop 1.5s ease-out forwards;
}
.reward-pop .ico { width: 24px; height: 24px; }
@keyframes rewardPop {
    0% { opacity: 0; transform: translate(-50%, 14px) scale(0.8); }
    18% { opacity: 1; transform: translate(-50%, 0) scale(1.12); }
    100% { opacity: 0; transform: translate(-50%, -56px) scale(1); }
}
.buy-pop {
    position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
    font-size: 14px; font-weight: 700; letter-spacing: 1px; color: #9affc8; text-shadow: 0 0 12px rgba(154,255,200,0.85);
    pointer-events: none; animation: buyPop .95s ease forwards;
}
@keyframes buyPop {
    0% { opacity: 0; transform: translateY(-50%) scale(0.6); }
    25% { opacity: 1; transform: translateY(-60%) scale(1.12); }
    100% { opacity: 0; transform: translateY(-150%) scale(1); }
}
.station-colours { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 10px; }
.col-cell { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.col-sw { width: 40px; height: 40px; border-radius: 50%; cursor: pointer; border: 2px solid transparent;
    box-shadow: 0 0 10px currentColor; transition: transform .12s, border-color .15s, opacity .15s; }
.col-sw:hover { transform: scale(1.12); }
.col-sw.active { border-color: #fff; }
.col-sw.locked { opacity: 0.5; box-shadow: none; }
.col-sw.locked:hover { opacity: 0.85; }
.col-price { font-style: normal; font-size: 10px; color: var(--cyan); display: inline-flex; align-items: center; gap: 3px; font-variant-numeric: tabular-nums; }
.col-price .ico { width: 11px; height: 11px; }
.col-price.cant { color: var(--dim); opacity: 0.7; }
/* sub-headers inside a service panel */
.st-sub-h { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--cyan); opacity: 0.65; margin: 4px 0 12px; }
.st-sub-h ~ .st-sub-h, .station-colours + .st-sub-h { margin-top: 18px; }
/* effect on/off toggle button */
.shop-btn.toggle { min-width: 76px; justify-content: center; text-transform: uppercase; letter-spacing: 1px; font-size: 13px; }
.shop-btn.toggle.on { background: rgba(111,214,255,0.2); border-color: var(--cyan); color: #fff; box-shadow: 0 0 14px rgba(111,214,255,0.3); }
/* small note line under an upgrade (warp reach + unlock gate) */
.shop-note { font-size: 11px; color: var(--cyan); opacity: 0.85; margin-top: 6px; letter-spacing: 0.3px; }
.shop-note.locked { color: var(--dim); opacity: 0.9; }
/* upgrade button that stacks a dust price + a material cost */
.shop-btn.col { flex-direction: column; align-items: flex-end; gap: 4px; }
.shop-btn .mat-cost { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; }
.shop-btn .mat-cost.cant { opacity: 0.55; }
.shop-btn.deliver { background: rgba(127,255,180,0.16); border-color: #7fffb4; color: #eafff3; }
/* commodities + contracts helpers */
.st-cargo-head { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; margin-bottom: 14px; font-size: 13px; color: var(--ink); }
.st-cargo-head b { color: #fff; font-variant-numeric: tabular-nums; }
.st-demand { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.st-demand .ico { width: 14px; height: 14px; }
.st-tagdemand, .market-star { font-style: normal; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--cyan); }
/* market supply/demand tags */
.market-econ { display: flex; gap: 12px; flex-wrap: wrap; margin: 6px 0 16px; }
.me-tag { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; padding: 6px 13px; border-radius: 20px; border: 1px solid var(--line); background: rgba(255,255,255,0.03); }
.me-tag .ico { width: 15px; height: 15px; }
/* galactic news feed */
.news-list { display: flex; flex-direction: column; }
.news-row { display: flex; align-items: flex-start; gap: 13px; padding: 12px 2px; border-top: 1px solid var(--line); }
.news-row:first-child { border-top: none; }
.news-row > i { display: inline-flex; color: var(--cyan); opacity: 0.7; margin-top: 1px; } .news-row > i .ico { width: 18px; height: 18px; }
.news-row span { color: var(--ink); font-size: 14px; line-height: 1.5; }
.news-row > i { color: var(--cyan); } .news-row > i[style] { filter: drop-shadow(0 0 5px currentColor); }
/* header galactic-news ticker (seamless marquee) */
.st-ticker {
    flex: 0 0 auto; overflow: hidden; border-bottom: 1px solid var(--line); padding: 9px 0; position: relative;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
.st-ticker:empty { display: none; }
.tick-track { display: inline-flex; align-items: center; white-space: nowrap; animation: tickScroll 60s linear infinite; }
.st-ticker:hover .tick-track { animation-play-state: paused; }
.tick-item { display: inline-flex; align-items: center; gap: 8px; margin-right: 44px; font-size: 13px; color: var(--ink); letter-spacing: 0.2px; }
.tick-ai { color: var(--cyan); display: inline-flex; filter: drop-shadow(0 0 5px rgba(111,214,255,0.8)); }
.tick-ai .ico { width: 13px; height: 13px; }
.tick-item i { display: inline-flex; } .tick-item i .ico { width: 15px; height: 15px; }
@keyframes tickScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
/* trade quantity stepper (buy/sell) */
.trade-row .qty { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.qbtn { font-family: inherit; font-size: 14px; color: var(--ink); background: rgba(111,214,255,0.08); border: 1px solid var(--line); border-radius: 8px; min-width: 30px; height: 30px; cursor: pointer; padding: 0 8px; }
.qbtn:hover { background: rgba(111,214,255,0.16); }
.qbtn.qmax { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--cyan); }
.qin { width: 54px; height: 30px; text-align: center; font-family: inherit; font-size: 14px; color: #fff; background: rgba(10,16,30,0.7); border: 1px solid var(--line); border-radius: 8px; font-variant-numeric: tabular-nums; }
.qin:focus { outline: none; border-color: var(--cyan); }
/* fixed-width controls so every row's stepper + sell button line up as a clean table */
.trade-row { gap: 14px; }
.trade-row .qty .qbtn { width: 34px; min-width: 34px; padding: 0; flex: 0 0 auto; }
.trade-row .qty .qbtn.qmax { width: 48px; }
.trade-row .shop-btn.do { width: 200px; flex: 0 0 auto; justify-content: center; }
.shop-btn .qtot { font-weight: 600; }
/* mission action buttons */
.mission-acts { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.shop-btn.sm { padding: 9px 14px; font-size: 13px; gap: 7px; }
.shop-btn.sm i { display: inline-flex; } .shop-btn.sm i .ico { width: 15px; height: 15px; }
.shop-btn.ghost { background: transparent; border-color: rgba(255,120,120,0.3); color: #ff9a9a; }
.shop-btn.ghost:hover:not(:disabled) { background: rgba(255,120,120,0.12); border-color: rgba(255,120,120,0.55); }
.shop-btn.route.on { background: rgba(127,255,180,0.18); border-color: #7fffb4; color: #eafff3; }
.mission-need { font-size: 11px; color: #ffb14c; }
.shop-btn.deliver.ready { animation: deliverGlow 1.4s ease-in-out infinite; }
@keyframes deliverGlow { 0%, 100% { box-shadow: 0 0 14px rgba(127,255,180,0.45); } 50% { box-shadow: 0 0 26px rgba(127,255,180,0.9); filter: brightness(1.12); } }
/* scanner mega tag */
.scan-mega { font-style: normal; font-size: 9px; letter-spacing: 1px; text-transform: uppercase; color: #ffd27f; background: rgba(255,210,127,0.15); border-radius: 8px; padding: 2px 6px; }
/* cartography survey manifest */
/* sell button pinned to the top of the cartography rubric */
.carto-sellbar { position: sticky; top: 0; z-index: 3; padding: 6px 0 10px; margin-top: 6px; background: linear-gradient(180deg, var(--panel, rgba(10,13,22,0.96)) 72%, transparent); backdrop-filter: blur(4px); }
.carto-list { display: flex; flex-direction: column; margin: 6px 0 4px; }
.carto-row { display: flex; align-items: center; gap: 12px; padding: 8px 2px; border-top: 1px solid var(--line); }
.carto-row:first-child { border-top: none; }
.carto-row > i { display: inline-flex; color: var(--cyan); } .carto-row > i .ico { width: 18px; height: 18px; }
.carto-name { flex: 1; color: #fff; font-size: 13px; display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.carto-mat { font-style: normal; font-size: 11px; display: inline-flex; align-items: center; gap: 4px; }
.carto-mat .ico { width: 13px; height: 13px; }
.carto-d { color: var(--dim); font-size: 12px; font-variant-numeric: tabular-nums; }
.carto-v { font-style: normal; color: var(--cyan); font-size: 12px; display: inline-flex; align-items: center; gap: 4px; min-width: 70px; justify-content: flex-end; }
.carto-v .ico { width: 13px; height: 13px; }

/* ---- orb inventory (key I) ---- */
#orb-menu {
    position: fixed; inset: 0; z-index: 34; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(ellipse at center, rgba(8,14,30,0.66), rgba(5,6,13,0.92));
    backdrop-filter: blur(3px); transition: opacity .25s;
}
#orb-menu.hidden { opacity: 0; pointer-events: none; }
.orb-panel {
    position: relative; display: flex; flex-direction: column; width: min(620px, 94vw); max-height: 88vh;
    background: linear-gradient(160deg, rgba(14,20,34,0.94), rgba(7,9,18,0.95));
    border: 1px solid rgba(111,214,255,0.28); border-radius: 18px; backdrop-filter: blur(16px);
    box-shadow: 0 0 60px rgba(0,0,0,0.55); overflow: hidden;
}
.orb-panel::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, transparent, var(--cyan), transparent); opacity: 0.7; }
.orb-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 26px 12px; }
.orb-head h2 { font-weight: 200; font-size: 24px; letter-spacing: 6px; color: #fff; text-transform: lowercase; }
.orb-list { padding: 12px 26px 26px; overflow-y: auto; }
/* redesigned header: orb render + name + avatar + stat strip, then tabs */
.orb-hero { display: flex; align-items: center; gap: 16px; padding: 18px 24px 14px; border-bottom: 1px solid var(--line); }
.orb-render { width: 72px; height: 72px; flex: 0 0 auto; }
.orb-hero-id { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.orb-hero-name { display: flex; align-items: center; gap: 10px; }
.orb-hero-name span { color: #fff; font-size: 20px; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.orb-pavatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; display: none; border: 1px solid var(--line); flex: 0 0 auto; }
.orb-pavatar.show { display: block; }
.orb-hero-stats { display: flex; gap: 16px; font-size: 13px; color: var(--ink); flex-wrap: wrap; }
.orb-hero-stats span { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.orb-hero-stats i { display: inline-flex; color: var(--cyan); } .orb-hero-stats .ico { width: 13px; height: 13px; }
.orb-hero .icon-btn { align-self: flex-start; }
.orb-tabs { display: flex; gap: 4px; padding: 12px 22px 0; }
.orb-tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px; border: 0; background: rgba(255,255,255,0.03); color: var(--dim); font-family: inherit; font-size: 12px; border-radius: 9px 9px 0 0; cursor: pointer; letter-spacing: 0.5px; text-transform: lowercase; }
.orb-tab i { display: inline-flex; } .orb-tab .ico { width: 15px; height: 15px; }
.orb-tab.on { background: rgba(111,214,255,0.14); color: var(--cyan); }
.orb-cargobar { color: var(--dim); font-size: 13px; margin-bottom: 10px; } .orb-cargobar b { color: #fff; }
.orb-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.orb-stat { background: rgba(111,214,255,0.05); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.orb-stat u { text-decoration: none; font-size: 9px; letter-spacing: 1px; text-transform: uppercase; color: var(--dim); }
.orb-stat b { font-size: 16px; color: #fff; font-variant-numeric: tabular-nums; }
.orb-up { display: flex; align-items: center; gap: 12px; padding: 7px 2px; }
.orb-up .shop-ico { width: 34px; height: 34px; } .orb-up .shop-ico .ico { width: 18px; height: 18px; }
.orb-up-name { flex: 1; font-size: 14px; color: var(--ink); }
.orb-missions { display: flex; flex-direction: column; }
.orb-mission { display: flex; align-items: center; gap: 12px; padding: 8px 2px; border-top: 1px solid var(--line); }
.orb-mission:first-child { border-top: none; }
.orb-mission > i { display: inline-flex; filter: drop-shadow(0 0 5px currentColor); } .orb-mission > i .ico { width: 20px; height: 20px; }
.orb-relic { display: flex; align-items: center; gap: 12px; padding: 9px 2px; border-top: 1px solid var(--line); }
.orb-relic:first-child { border-top: none; }
.orb-relic > i { display: inline-flex; filter: drop-shadow(0 0 6px currentColor); } .orb-relic > i .ico { width: 24px; height: 24px; }
.orb-relic > em { font-style: normal; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 4px; } .orb-relic > em .ico { width: 13px; height: 13px; }
.orb-mtxt { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.orb-mtxt b { color: #fff; font-size: 13px; }
.orb-mtxt span { color: var(--dim); font-size: 11px; display: inline-flex; align-items: center; gap: 5px; }
.orb-mtxt span.ok { color: #7fffb4; }
.orb-mtxt span .ico { width: 12px; height: 12px; }
.orb-mtarget {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
    background: rgba(111,214,255,0.06); border: 1px solid var(--line); border-radius: 10px; color: var(--dim);
    cursor: pointer; transition: background .14s, color .14s, border-color .14s;
}
.orb-mtarget:hover { background: rgba(127,255,180,0.12); color: #7fffb4; }
.orb-mtarget.on { background: rgba(127,255,180,0.2); border-color: #7fffb4; color: #7fffb4; box-shadow: 0 0 12px rgba(127,255,180,0.3); }
.orb-mtarget .ico { width: 18px; height: 18px; }
.orb-mats { display: flex; flex-direction: column; }
.orb-mat { display: flex; align-items: center; gap: 12px; padding: 8px 2px; border-top: 1px solid var(--line); }
.orb-mat:first-child { border-top: none; }
.orb-mat i { display: inline-flex; filter: drop-shadow(0 0 5px currentColor); } .orb-mat i .ico { width: 20px; height: 20px; }
.orb-mat-name { flex: 1; color: #fff; font-size: 14px; }
.orb-mat b { color: #fff; font-variant-numeric: tabular-nums; min-width: 40px; text-align: right; }
.orb-mat em { font-style: normal; color: var(--cyan); font-size: 12px; display: inline-flex; align-items: center; gap: 4px; min-width: 80px; justify-content: flex-end; }
.orb-mat em .ico { width: 13px; height: 13px; }
.orb-fxs { display: flex; flex-wrap: wrap; gap: 10px; }
.orb-fx { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-family: inherit; font-size: 13px; color: var(--ink);
    background: rgba(111,214,255,0.06); border: 1px solid var(--line); border-radius: 12px; padding: 9px 14px; transition: background .14s, border-color .14s; }
.orb-fx:hover { background: rgba(111,214,255,0.14); }
.orb-fx.on { background: rgba(111,214,255,0.2); border-color: var(--cyan); color: #fff; box-shadow: 0 0 14px rgba(111,214,255,0.3); }
.orb-fx i { display: inline-flex; color: var(--cyan); } .orb-fx i .ico { width: 16px; height: 16px; }
.orb-fx em { font-style: normal; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--dim); }
.orb-fx.on em { color: var(--cyan); }
/* explorer score column on the scoreboard */
.sb-explore { color: #9ee6ff; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 4px; }

/* ---- material scanner (key C) ---- */
#scanner {
    position: fixed; inset: 0; z-index: 34; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(ellipse at center, rgba(8,14,30,0.66), rgba(5,6,13,0.92)); backdrop-filter: blur(3px); transition: opacity .25s;
}
#scanner.hidden { opacity: 0; pointer-events: none; }
.scan-panel {
    position: relative; display: flex; flex-direction: column; width: min(960px, 94vw); height: min(680px, 90vh); overflow: hidden;
    background: linear-gradient(160deg, rgba(14,20,34,0.94), rgba(7,9,18,0.95)); border: 1px solid rgba(111,214,255,0.28);
    border-radius: 18px; backdrop-filter: blur(16px); box-shadow: 0 0 60px rgba(0,0,0,0.55);
}
.scan-panel::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, transparent, #7fffb4, transparent); opacity: 0.7; }
.scan-head-bar { display: flex; align-items: center; gap: 16px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.scan-head-bar h2 { font-weight: 200; font-size: 22px; letter-spacing: 5px; color: #fff; text-transform: lowercase; }
.scan-summary { flex: 1; color: var(--cyan); font-size: 12px; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.scan-body { display: grid; grid-template-columns: 1fr 360px; flex: 1; min-height: 0; }
#scan-scope { width: 100%; height: 100%; display: block; }
.scan-list { border-left: 1px solid var(--line); overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.scan-row {
    display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer; font-family: inherit;
    background: transparent; border: 1px solid transparent; border-radius: 12px; padding: 9px 11px; color: var(--ink);
    transition: background .14s, border-color .14s;
}
.scan-row:hover { background: rgba(111,214,255,0.08); }
.scan-row.on { background: rgba(127,255,180,0.12); border-color: rgba(127,255,180,0.5); }
.scan-ico { flex: 0 0 auto; display: inline-flex; filter: drop-shadow(0 0 6px currentColor); } .scan-ico .ico { width: 24px; height: 24px; }
.scan-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.scan-txt b { color: #fff; font-size: 13px; }
.scan-txt > span { color: var(--dim); font-size: 11px; }
.scan-comp { display: flex; height: 5px; border-radius: 3px; overflow: hidden; margin-top: 2px; background: rgba(255,255,255,0.06); }
.scan-comp i { display: block; min-width: 2px; }
.scan-meta { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.scan-meta b { color: var(--cyan); font-size: 12px; font-variant-numeric: tabular-nums; }
.scan-meta em { font-style: normal; color: var(--dim); font-size: 11px; display: inline-flex; align-items: center; gap: 4px; }
.scan-meta em .ico { width: 12px; height: 12px; }
@media (max-width: 720px) { .scan-body { grid-template-columns: 1fr; grid-template-rows: 1fr auto; } .scan-list { border-left: none; border-top: 1px solid var(--line); max-height: 40%; } }

/* ---- galaxy map + warp routing ---- */
#galaxy-map {
    position: fixed; inset: 0; z-index: 35; overflow: hidden;
    background: #04050b; transition: opacity .25s;
}
#galaxy-map.hidden { opacity: 0; pointer-events: none; }
#map-canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }
#map-canvas:active { cursor: grabbing; }
body.map-open #cursor { display: none; }
.map-ui { position: absolute; inset: 0; pointer-events: none; }
.map-ui button, .map-ui input, #map-results { pointer-events: auto; }
.map-top {
    position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 18px;
    padding: 16px 22px; background: linear-gradient(180deg, rgba(5,8,18,0.92), rgba(5,8,18,0));
}
.map-title { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 300; font-size: 18px; letter-spacing: 4px; text-transform: lowercase; }
.map-title i { color: var(--cyan); display: inline-flex; } .map-title .ico { width: 22px; height: 22px; }
/* collapsed to a search icon; clicking pops the input open */
.map-searchwrap { position: relative; flex: 0 0 auto; display: flex; align-items: center; border-radius: 12px; }
.map-searchwrap:not(.open) { width: 44px; height: 38px; justify-content: center; background: rgba(255,255,255,0.04); border: 1px solid var(--line); cursor: pointer; pointer-events: auto; transition: background .15s, border-color .15s; }
.map-searchwrap:not(.open):hover { background: rgba(111,214,255,0.1); border-color: rgba(111,214,255,0.3); }
.map-search-ico { color: var(--cyan); opacity: 0.85; display: inline-flex; flex: 0 0 auto; pointer-events: none; }
.map-search-ico .ico { width: 18px; height: 18px; }
.map-searchwrap.open .map-search-ico { position: absolute; left: 13px; opacity: 0.7; }
#map-search {
    width: 0; opacity: 0; padding: 0; border: 0; pointer-events: none;
    font-family: inherit; font-size: 14px; color: var(--ink); background: rgba(10,16,30,0.7);
    border-radius: 12px; outline: none; transition: width .22s ease, opacity .18s, padding .22s;
}
.map-searchwrap.open #map-search { width: min(340px, 38vw); opacity: 1; padding: 11px 14px 11px 40px; border: 1px solid rgba(111,214,255,0.6); pointer-events: auto; }
#map-top .map-actions { margin-left: auto; }
#map-results {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; max-height: 320px; overflow-y: auto;
    background: rgba(8,12,24,0.96); border: 1px solid var(--line); border-radius: 12px; padding: 5px;
    backdrop-filter: blur(8px); box-shadow: 0 14px 40px rgba(0,0,0,0.5); display: flex; flex-direction: column; gap: 2px;
}
#map-results.hidden { display: none; }
.map-res {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px; width: 100%; text-align: left;
    font-family: inherit; font-size: 13px; color: var(--ink); background: transparent; border: none; border-radius: 8px;
    padding: 9px 11px; cursor: pointer;
}
.map-res:hover { background: rgba(111,214,255,0.12); }
.map-res em { font-style: normal; font-size: 11px; color: var(--cyan); font-variant-numeric: tabular-nums; }
.map-res.solar span { color: #ffe9a8; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.map-res.solar span .ico { width: 14px; height: 14px; color: #ffe9a8; }
/* the special Journey Home mission card */
.shop-row.journey { padding: 16px 20px; border: 1px solid rgba(127,255,180,0.35); border-radius: 14px; background: linear-gradient(100deg, rgba(127,255,180,0.08), rgba(111,214,255,0.05)); box-shadow: 0 0 22px rgba(127,255,180,0.12); }
.shop-row.journey .shop-btn { flex: 0 0 auto; }
.shop-row.journey .shop-ico.home { color: #7fffb4; background: rgba(127,255,180,0.1); border-color: rgba(127,255,180,0.3); }
.map-res.dim { color: var(--dim); cursor: default; }
.map-top .icon-btn { margin-left: auto; }

/* light inset frame around the map so the overlay UI reads cleanly */
.map-frame { position: absolute; inset: 12px; border: 1px solid rgba(111,214,255,0.2); border-radius: 14px; pointer-events: none; box-shadow: inset 0 0 80px rgba(0,0,0,0.5); }
/* top-left column: location readout + ore filter, stacked on their own panels */
.map-tl { position: absolute; top: 62px; left: 24px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; max-width: min(320px, 42vw); }
.map-loc {
    position: absolute; top: 60px; left: 22px; z-index: 2;
    display: flex; flex-direction: column; gap: 2px; background: #0a0e18; border: 1px solid var(--line);
    border-radius: 12px; padding: 9px 13px;
}
.map-loc:empty { display: none; }
.map-loc b { color: #fff; font-size: 13px; font-weight: 600; } .map-loc b.dim { color: var(--dim); font-weight: 500; }
.map-loc span { color: var(--dim); font-size: 11px; } .map-loc .loc-ly { color: var(--cyan); font-variant-numeric: tabular-nums; }
/* body info card (click a star / world) */
.map-info { position: absolute; left: 0; top: 0; z-index: 3; width: 330px; max-width: 44vw;
    display: flex; gap: 14px; padding: 15px 16px; background: rgba(8,11,20,0.95); border: 1px solid var(--line);
    border-radius: 16px; box-shadow: 0 18px 50px rgba(0,0,0,0.55); pointer-events: auto; }
.map-info.hidden { display: none; }
.map-info #map-info-close { position: absolute; top: 8px; right: 8px; }
.map-info-vis { width: 88px; height: 88px; flex: 0 0 auto; border-radius: 12px; align-self: flex-start; }
.map-info-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; padding-right: 18px; }
.map-info-body h3 { margin: 0; color: #fff; font-size: 17px; font-weight: 500; }
.map-info-sub { color: var(--cyan); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }
.map-info-lines { display: flex; flex-direction: column; gap: 5px; margin: 8px 0 4px; font-size: 12px; }
.map-info-lines .il { display: flex; justify-content: space-between; gap: 10px; }
.map-info-lines .il > span { color: var(--dim); } .map-info-lines .il b { color: #fff; font-weight: 500; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 5px; }
.map-info-lines .il b .ico { width: 13px; height: 13px; }
.map-info-lines .il.locked b { color: var(--dim); font-style: italic; font-weight: 400; }
.map-info-lines .story { color: var(--ink); line-height: 1.5; font-size: 12px; }
.map-info-route { align-self: flex-start; margin-top: 6px; }
/* account sign-in / register overlay */
#auth { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: rgba(4,7,14,0.92); backdrop-filter: blur(8px); }
#auth.hidden { display: none; }
.auth-card { width: 340px; max-width: 90vw; display: flex; flex-direction: column; gap: 12px; padding: 28px; background: rgba(10,14,24,0.97); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,0.6); }
.auth-logo { display: flex; align-items: center; gap: 10px; justify-content: center; color: #fff; font-size: 20px; font-weight: 300; letter-spacing: 3px; text-transform: lowercase; margin-bottom: 4px; }
.auth-logo i { color: var(--cyan); display: inline-flex; } .auth-logo .ico { width: 24px; height: 24px; }
.auth-tabs { display: flex; gap: 6px; background: rgba(255,255,255,0.04); border-radius: 10px; padding: 4px; }
.auth-tab { flex: 1; padding: 8px; border: 0; background: transparent; color: var(--dim); font-family: inherit; font-size: 13px; border-radius: 8px; cursor: pointer; text-transform: lowercase; letter-spacing: 1px; }
.auth-tab.on { background: rgba(111,214,255,0.16); color: var(--cyan); }
.auth-in { padding: 12px 14px; background: rgba(8,12,22,0.8); border: 1px solid var(--line); border-radius: 10px; color: #fff; font-family: inherit; font-size: 15px; outline: none; }
.auth-in:focus { border-color: var(--cyan); }
.auth-err { min-height: 16px; color: #ff8a6a; font-size: 12px; text-align: center; }
.auth-go { padding: 13px; background: var(--cyan); color: #04101a; border: 0; border-radius: 10px; font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer; letter-spacing: 1px; text-transform: lowercase; }
.auth-go:hover { filter: brightness(1.08); } .auth-go:disabled { opacity: 0.5; cursor: default; }
.auth-guest { padding: 11px; background: rgba(255,255,255,0.04); border: 1px solid var(--line); color: var(--ink); font-family: inherit; font-size: 13px; border-radius: 10px; cursor: pointer; letter-spacing: 1px; text-transform: lowercase; }
.auth-guest:hover { background: rgba(111,214,255,0.1); border-color: rgba(111,214,255,0.3); }
/* admin panel (only for the ADMIN_USER account) */
#admin-open { position: fixed; left: 14px; top: 56px; z-index: 60; padding: 7px 11px; background: rgba(127,255,180,0.12); border: 1px solid rgba(127,255,180,0.4); color: #7fffb4; font-family: inherit; font-size: 11px; letter-spacing: 1px; border-radius: 9px; cursor: pointer; }
#admin-open.hidden { display: none; }
#admin-open:hover { background: rgba(127,255,180,0.2); }
#admin { position: fixed; inset: 0; z-index: 110; display: flex; align-items: center; justify-content: center; background: rgba(4,7,14,0.8); backdrop-filter: blur(6px); }
#admin.hidden { display: none; }
.admin-card { width: 420px; max-width: 92vw; max-height: 86vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 22px; background: rgba(10,14,24,0.98); border: 1px solid rgba(127,255,180,0.3); border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,0.6); }
.admin-head { display: flex; align-items: center; justify-content: space-between; color: #7fffb4; font-size: 13px; letter-spacing: 2px; }
.admin-seed { color: var(--dim); font-size: 12px; } .admin-seed b { color: #fff; font-variant-numeric: tabular-nums; }
.admin-sub { color: var(--cyan); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; margin-top: 6px; display: flex; align-items: center; gap: 8px; }
.admin-grant { display: flex; flex-direction: column; gap: 8px; }
.admin-grant-row { display: flex; gap: 8px; } .admin-grant-row .auth-in { flex: 1; min-width: 0; } .admin-grant-row .auth-go { flex: 0 0 auto; padding: 10px 16px; }
.admin-msg { min-height: 14px; font-size: 12px; color: #7fffb4; }
.admin-mini { background: transparent; border: 0; color: var(--cyan); cursor: pointer; font-size: 14px; }
.admin-list { display: flex; flex-direction: column; gap: 4px; }
.admin-prow { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; padding: 6px 8px; border-radius: 7px; background: rgba(255,255,255,0.03); cursor: pointer; }
.admin-prow:hover { background: rgba(111,214,255,0.1); }
.admin-prow b { color: #fff; font-weight: 500; } .admin-prow.adm b { color: #7fffb4; }
.admin-prow span { color: var(--dim); }
.admin-mk { margin-left: auto; margin-right: 8px; background: rgba(127,255,180,0.1); border: 1px solid rgba(127,255,180,0.3); color: #7fffb4; font-family: inherit; font-size: 10px; padding: 3px 8px; border-radius: 6px; cursor: pointer; letter-spacing: 0.5px; }
.admin-mk:hover { background: rgba(127,255,180,0.2); }
.admin-prow.adm .admin-mk { background: rgba(255,138,138,0.1); border-color: rgba(255,138,138,0.3); color: #ff8a8a; }
.admin-onhead { color: var(--dim); font-size: 11px; margin-bottom: 4px; }
.admin-prow.online { background: rgba(127,255,180,0.08); }
.admin-prow.online b::before { content: '● '; color: #7fffb4; font-size: 10px; vertical-align: middle; }
.admin-prow.online span { color: #7fffb4; }
/* shipyard: commission a Haven */
.haven-card { display: flex; gap: 16px; align-items: center; margin: 10px 0; padding: 14px; background: rgba(255,255,255,0.03); border: 1px solid var(--line); border-radius: 14px; }
.haven-emblem { width: 88px; height: 88px; flex: 0 0 auto; }
.haven-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.haven-info > b { color: #fff; font-size: 17px; }
.haven-name { background: rgba(8,12,22,0.7); border: 1px solid var(--line); border-radius: 8px; color: #fff; font-family: inherit; font-size: 16px; padding: 8px 10px; outline: none; }
.haven-name:focus { border-color: var(--cyan); }
.haven-info > span { color: var(--dim); font-size: 12px; font-style: italic; }
.haven-meta { color: var(--cyan); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }
.haven-own { color: #7fffb4; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; }
.haven-acts { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.haven-acts .shop-btn.do { flex: 1; justify-content: center; }
.haven-msg { min-height: 16px; margin-top: 8px; font-size: 12px; color: #ffb088; }
/* player profile (ORB I page) */
#profile-open { position: relative; overflow: hidden; }
#profile-open.hidden { display: none; }
#profile-avatar-mini { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; border-radius: inherit; }
#profile-avatar-mini.show { display: block; }
.chat-msg.system { font-size: 12px; font-style: normal; }
.chat-msg.system::before { content: '● '; font-size: 9px; vertical-align: middle; }
.chat-msg.system b { font-weight: 600; }
.chat-msg.system.join { color: #7fffb4; } .chat-msg.system.join b { color: #c8ffe2; }
.chat-msg.system.leave { color: #ff8a8a; } .chat-msg.system.leave b { color: #ffc2c2; }
/* "a new version is live" banner */
#update-banner { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; align-items: center; gap: 10px; padding: 9px 16px; background: linear-gradient(180deg, rgba(127,255,180,0.96), rgba(111,214,255,0.92)); color: #04101a; font-family: inherit; font-size: 13px; font-weight: 600; letter-spacing: 0.5px; border-radius: 0 0 12px 12px; box-shadow: 0 8px 30px rgba(0,0,0,0.5); animation: updPulse 2s ease-in-out infinite; }
#update-banner.hidden { display: none; }
#update-banner i { display: inline-flex; } #update-banner .ico { width: 16px; height: 16px; }
#update-reload { padding: 5px 12px; background: rgba(4,16,26,0.85); color: #fff; border: 0; border-radius: 8px; font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
#update-reload:hover { background: #04101a; }
@keyframes updPulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.12); } }
#profile { position: fixed; inset: 0; z-index: 105; display: flex; align-items: center; justify-content: center; background: rgba(4,7,14,0.85); backdrop-filter: blur(8px); }
#profile.hidden { display: none; }
.profile-card { width: 380px; max-width: 92vw; max-height: 88vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 22px; background: rgba(10,14,24,0.98); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,0.6); }
.profile-head { display: flex; align-items: center; gap: 14px; }
#profile-avatar-wrap { position: relative; width: 64px; height: 64px; flex: 0 0 auto; border-radius: 50%; overflow: hidden; background: rgba(111,214,255,0.1); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; color: var(--cyan); cursor: pointer; }
#profile-avatar-wrap .ico { width: 28px; height: 28px; }
#profile-avatar { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; }
#profile-avatar.show { display: block; }
.profile-id { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.profile-name { background: rgba(8,12,22,0.7); border: 1px solid var(--line); border-radius: 8px; color: #fff; font-family: inherit; font-size: 18px; padding: 6px 10px; outline: none; }
.profile-name:focus { border-color: var(--cyan); }
.profile-tag { color: #7fffb4; font-size: 11px; letter-spacing: 2px; min-height: 13px; }
.profile-head .icon-btn { align-self: flex-start; }
.profile-sub { color: var(--cyan); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; margin-top: 10px; }
.profile-stats { display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.profile-stats .il { display: flex; justify-content: space-between; gap: 10px; }
.profile-stats .il span { color: var(--dim); } .profile-stats .il b { color: #fff; font-weight: 500; display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.profile-stats .il b .ico { width: 13px; height: 13px; }
.profile-haven { margin-top: 4px; }
.profile-acct { display: flex; gap: 8px; } .profile-acct .auth-in { flex: 1; min-width: 0; } .profile-acct .auth-go { flex: 0 0 auto; padding: 10px 16px; }
.profile-msg { min-height: 14px; font-size: 12px; color: #7fffb4; }
#profile-logout { margin-top: 4px; }
/* Haven interior (crew + stash) */
#haven { position: fixed; inset: 0; z-index: 105; display: flex; align-items: center; justify-content: center; background: rgba(4,7,14,0.85); backdrop-filter: blur(8px); }
#haven.hidden { display: none; }
.haven-hub { width: 720px; max-width: 95vw; min-height: 70vh; max-height: 90vh; overflow-y: auto; display: flex; flex-direction: column; padding: 26px 28px; background: rgba(10,14,24,0.98); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,0.6); }
.bar-log { flex: 1; min-height: 140px; max-height: 38vh; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; padding: 14px 16px; background: rgba(0,0,0,0.28); border: 1px solid var(--line); border-radius: 11px; margin-bottom: 9px; }
.bar-msg { font-size: 15px; color: var(--ink); line-height: 1.5; }
.bar-msg b { color: var(--cyan); font-weight: 500; margin-right: 6px; }
.bar-input { display: flex; gap: 8px; }
/* Bar: chat + emoji picker on the left, who's-here list on the right */
.bar-wrap { display: flex; gap: 14px; align-items: stretch; }
.bar-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bar-emojis { display: flex; flex-wrap: wrap; gap: 5px; padding: 9px 0; }
.bar-emoji { width: 31px; height: 31px; display: inline-flex; align-items: center; justify-content: center; padding: 0; background: rgba(255,255,255,0.04); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; color: var(--cyan); transition: background .15s, border-color .15s, transform .15s; }
.bar-emoji:hover { background: rgba(111,214,255,0.16); border-color: var(--cyan); transform: translateY(-1px); }
.bar-emoji .ico { width: 17px; height: 17px; }
.bar-ico { display: inline-flex; vertical-align: middle; } .bar-ico .ico { width: 16px; height: 16px; }
.bar-online { width: 162px; flex: none; max-height: 50vh; overflow-y: auto; padding: 11px 13px; background: rgba(0,0,0,0.2); border: 1px solid var(--line); border-radius: 11px; }
.bar-online-h { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--dim); margin-bottom: 9px; }
.bar-on { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); margin-bottom: 7px; }
.bar-on .crew-av { width: 22px; height: 22px; box-shadow: 0 0 0 2px rgba(127,255,180,0.55); }
/* VoidPoker table — main board on the left, the live log down the right (no page scroll) */
.vp-table { display: flex; gap: 14px; align-items: stretch; }
.vp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 11px; }
.vp-board { display: flex; gap: 8px; justify-content: center; min-height: 78px; align-items: center; padding: 14px; background: radial-gradient(ellipse at center, rgba(40,95,72,0.38), rgba(8,18,14,0.65)); border: 1px solid var(--line); border-radius: 14px; }
.vp-felt-note { color: var(--dim); font-size: 13px; }
.vp-card { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 48px; height: 66px; border-radius: 8px; background: rgba(8,12,20,0.92); border: 1.5px solid currentColor; position: relative; box-shadow: 0 2px 8px rgba(0,0,0,0.5); }
.vp-card b { font-size: 15px; font-weight: 700; line-height: 1; color: #fff; }
.vp-card > i { display: inline-flex; } .vp-card > i .ico { width: 20px; height: 20px; }
.vp-card u { position: absolute; bottom: 2px; right: 3px; display: inline-flex; } .vp-card u .ico { width: 9px; height: 9px; }
.vp-card.back { color: #6fd6ff; background: rgba(20,30,52,0.92); } .vp-card.back > i .ico { width: 28px; height: 28px; opacity: 0.65; }
.vp-pot { display: flex; gap: 6px; align-items: center; justify-content: center; color: #ffd27f; font-weight: 700; font-size: 16px; } .vp-pot .ico { width: 16px; height: 16px; }
.vp-seats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.vp-seat { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 9px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,0.03); }
.vp-seat.empty { justify-content: center; min-height: 76px; color: var(--dim); font-size: 12px; }
.vp-seat.active { border-color: #7fffb4; box-shadow: 0 0 16px rgba(127,255,180,0.4); }
.vp-seat.folded { opacity: 0.4; }
.vp-seat .crew-av { width: 32px; height: 32px; }
.vp-seat-id { text-align: center; } .vp-seat-id b { display: block; font-size: 12px; color: #fff; }
.vp-stack { display: inline-flex; align-items: center; gap: 3px; color: #ffd27f; font-size: 11px; } .vp-stack .ico { width: 11px; height: 11px; }
.vp-btn { font-style: normal; background: #ffd27f; color: #000; border-radius: 50%; padding: 1px 5px; font-size: 9px; font-weight: 700; }
.vp-hole { display: flex; gap: 3px; min-height: 42px; } .vp-hole .vp-card { width: 30px; height: 42px; gap: 0; } .vp-hole .vp-card b { font-size: 11px; } .vp-hole .vp-card > i .ico { width: 13px; height: 13px; } .vp-hole .vp-card u { display: none; }
.vp-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 0; }
.vp-actions input[type=range] { flex: 1; min-width: 90px; accent-color: #7fffb4; cursor: pointer; }
.vp-actions .qin { max-width: 120px; }
.vp-actions > b { color: #ffd27f; min-width: 72px; text-align: right; font-variant-numeric: tabular-nums; }
.vp-log { width: 192px; flex: none; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: rgba(207,234,255,0.62); padding: 10px 12px; background: rgba(0,0,0,0.22); border: 1px solid var(--line); border-radius: 11px; }
.vp-banter { color: #c79bff; font-style: italic; }
.vp-seat.won { border-color: #ffd27f; animation: vpWin 0.9s ease infinite alternate; z-index: 1; }
@keyframes vpWin { from { box-shadow: 0 0 12px rgba(255,210,127,0.4); } to { box-shadow: 0 0 30px rgba(255,210,127,0.85); } }
.vp-seat { position: relative; }
.vp-dealer { position: absolute; top: -7px; left: -7px; width: 23px; height: 23px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #d9c089 70%); color: #4a3a10; font-weight: 800; font-size: 11px; display: flex; align-items: center; justify-content: center; border: 2px solid #ffe9b0; box-shadow: 0 1px 6px rgba(0,0,0,0.55); z-index: 3; }
.vp-act { position: absolute; top: -9px; right: -5px; font-size: 9px; font-weight: 700; letter-spacing: 0.4px; padding: 2px 8px; border-radius: 999px; z-index: 3; animation: vpPop .28s ease; }
.vp-act.fold { background: rgba(255,90,90,0.22); color: #ff9a9a; border: 1px solid rgba(255,90,90,0.45); }
.vp-act.check, .vp-act.call { background: rgba(111,214,255,0.22); color: #9fd6ff; border: 1px solid rgba(111,214,255,0.45); }
.vp-act.raise, .vp-act.allin { background: rgba(127,255,180,0.22); color: #8effb4; border: 1px solid rgba(127,255,180,0.5); }
.vp-act.turn { background: rgba(255,210,127,0.2); color: #ffd27f; border: 1px solid rgba(255,210,127,0.4); animation: vpBlink 1.1s infinite; }
@keyframes vpPop { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes vpBlink { 50% { opacity: 0.45; } }
.crew-av[data-bot] { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #2a3550, #161d2c); color: #7fb0e0; font-weight: 700; font-size: 15px; }
.crew-av[data-bot]::before { content: attr(data-bot); }
.vp-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 11px; font-size: 12px; color: var(--dim); padding: 2px 2px 10px; }
.vp-leg-suit { display: inline-flex; align-items: center; gap: 4px; } .vp-leg-suit .ico { width: 13px; height: 13px; }
.vp-legend b { color: #cfeaff; font-weight: 600; }
.bar-input input { flex: 1; background: rgba(255,255,255,0.04); border: 1px solid var(--line); border-radius: 9px; padding: 10px 13px; color: #fff; font-family: inherit; font-size: 13px; outline: none; }
.bar-input input:focus { border-color: var(--cyan); }
.svc-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 15px; background: rgba(255,255,255,0.03); border: 1px solid var(--line); border-radius: 11px; margin-bottom: 8px; font-size: 14px; color: #fff; cursor: pointer; }
/* Neon icon toggle — green glow + ✓ when on, dim red + ✕ when off. Our style, not iOS. */
.rt-tog {
    flex: none; width: 54px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px; cursor: pointer; transition: background .18s, border-color .18s, box-shadow .18s, color .18s;
    background: rgba(255,90,90,0.07); border: 1px solid rgba(255,100,100,0.35); color: #ff8a8a;
}
.rt-tog .ico { width: 18px; height: 18px; }
.rt-tog:hover { border-color: rgba(255,120,120,0.6); }
.rt-tog.on {
    background: rgba(80,230,140,0.16); border-color: rgba(80,230,140,0.6); color: #6effa8;
    box-shadow: 0 0 16px rgba(80,230,140,0.45);
}
.rt-tog.on:hover { box-shadow: 0 0 24px rgba(80,230,140,0.75); }
.hub-head { display: flex; align-items: center; gap: 16px; }
.hub-emblem { width: 76px; height: 76px; flex: 0 0 auto; }
.hub-id { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hub-id b { color: #fff; font-size: 20px; }
.hub-id span { color: var(--dim); font-size: 12px; font-style: italic; }
.hub-id em { color: var(--cyan); font-size: 11px; font-style: normal; letter-spacing: 1px; text-transform: uppercase; }
.hub-head .icon-btn { align-self: flex-start; }
.hub-tabs { display: flex; gap: 6px; background: rgba(255,255,255,0.04); border-radius: 10px; padding: 4px; margin: 14px 0 6px; }
.hub-tab { flex: 1; padding: 8px; border: 0; background: transparent; color: var(--dim); font-family: inherit; font-size: 13px; border-radius: 8px; cursor: pointer; text-transform: lowercase; letter-spacing: 1px; }
.hub-tab.on { background: rgba(111,214,255,0.16); color: var(--cyan); }
.hub-panel.hidden { display: none; }
.hub-sub { color: var(--cyan); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; margin: 10px 0 6px; }
.crew-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.crew-mem { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: rgba(255,255,255,0.03); border: 1px solid var(--line); border-radius: 9px; font-size: 13px; }
.crew-mem b { color: #fff; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.crew-mem em { color: #7fffb4; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; margin-left: auto; }
.crew-class { margin-left: auto; font-style: normal; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: rgba(111,214,255,0.12); color: #8fd6ff; white-space: nowrap; }
.crew-class.owner { background: rgba(120,255,170,0.14); color: #8effb4; }
.crew-class.admin { background: rgba(199,155,255,0.16); color: #c79bff; }
.crew-mem .shop-btn.sm { margin-left: 0; padding: 5px 10px; font-size: 11px; }
.crew-mem .shop-btn.sm.on { background: rgba(199,155,255,0.2); border-color: rgba(199,155,255,0.5); color: #d8bcff; }
.crew-mem.empty { color: var(--dim); font-style: italic; justify-content: center; opacity: 0.45; }
.hub-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.hub-pending { display: inline-flex; align-items: center; padding: 9px 15px; border-radius: 9px; background: rgba(255,210,122,0.1); border: 1px solid rgba(255,210,122,0.3); color: #ffd27a; font-size: 13px; }
.crew-mem.app { background: rgba(255,210,122,0.06); border-color: rgba(255,210,122,0.25); margin-bottom: 6px; }
.crew-mem.app .shop-btn.sm { margin-left: auto; min-width: 78px; justify-content: center; }
.crew-mem.app .crew-kick { margin-left: 6px; }
.crew-kick { margin-left: auto; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,138,138,0.12); border: 1px solid rgba(255,138,138,0.3); color: #ff8a8a; border-radius: 6px; cursor: pointer; padding: 0; }
.crew-kick .ico { width: 12px; height: 12px; }
.crew-kick:hover { background: rgba(255,138,138,0.25); }
.lvl-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 4px 0 16px; }
.lvl-stat { background: rgba(255,255,255,0.03); border: 1px solid var(--line); border-radius: 11px; padding: 14px 16px; }
.lvl-stat u { display: block; text-decoration: none; color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.lvl-stat b { color: #fff; font-size: 22px; font-weight: 300; }
.crew-av { width: 24px; height: 24px; flex: 0 0 auto; border-radius: 50%; background: rgba(111,214,255,0.12) center/cover; }
.stash-head { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink); }
.stash-head b { color: #fff; }
.stash-head .shop-btn { margin-left: auto; }
.stash-bar { height: 8px; border-radius: 999px; background: rgba(120,160,220,0.16); overflow: hidden; margin: 8px 0; }
.stash-bar span { display: block; height: 100%; background: linear-gradient(90deg, rgba(111,214,255,0.5), var(--cyan)); }
.stash-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.stash-row .shop-ico { width: 34px; height: 34px; }
.stash-row .shop-ico .ico { width: 18px; height: 18px; }
.sr-name { flex: 1; color: #fff; min-width: 60px; } .sr-qty { color: var(--cyan); font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; }
.stash-row .qty { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.stash-row .qty .qbtn { width: 30px; min-width: 30px; height: 28px; padding: 0; flex: 0 0 auto; }
.stash-row .qty .qbtn.qmax { width: 42px; }
.stash-row .qin { width: 56px; height: 28px; }
.stash-row .shop-btn.sm { flex: 0 0 auto; min-width: 96px; justify-content: center; }
/* Haven market rows (stock / price / buy) */
.mkt-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.mkt-row .shop-ico { width: 32px; height: 32px; } .mkt-row .shop-ico .ico { width: 17px; height: 17px; }
.mkt-stock { color: var(--dim); font-size: 12px; font-variant-numeric: tabular-nums; min-width: 96px; display: inline-flex; align-items: center; gap: 4px; }
.mkt-stock .ico { width: 12px; height: 12px; }
.mkt-price { display: inline-flex; align-items: center; gap: 5px; color: var(--cyan); } .mkt-price .ico { width: 13px; height: 13px; }
.mkt-plabel { color: var(--dim); font-size: 10px; text-transform: uppercase; letter-spacing: 1px; }
.mkt-price em { color: var(--dim); font-size: 11px; font-style: normal; }
.mkt-id { flex: 1; min-width: 78px; display: flex; flex-direction: column; gap: 2px; } .mkt-id b { color: #fff; font-weight: 500; }
.mkt-galaxy { color: var(--dim); font-size: 11px; min-width: 92px; display: inline-flex; align-items: center; gap: 5px; } .mkt-galaxy b { color: var(--ink); display: inline-flex; align-items: center; gap: 2px; } .mkt-galaxy .ico { width: 11px; height: 11px; }
.mkt-deal { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; min-width: 56px; color: #fff; font-variant-numeric: tabular-nums; } .mkt-deal .ico { width: 13px; height: 13px; color: var(--cyan); }
.mkt-deal.good { color: #7fffb4; } .mkt-deal.good .ico { color: #7fffb4; } .mkt-deal.pricey { color: #ff8a8a; } .mkt-deal.pricey .ico { color: #ff8a8a; }
.mkt-price.up input { color: #ff9a9a; border-color: rgba(255,138,138,0.4); } .mkt-price.down input { color: #8fffc4; border-color: rgba(127,255,180,0.4); }
/* Haven refuel rubric — a vertical fuel tank, station-style */
.refuel-box { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 18px 0; }
.refuel-tank { position: relative; width: 128px; height: 230px; border-radius: 18px; background: rgba(10,16,30,0.55); border: 1px solid var(--line); overflow: hidden; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 24px rgba(0,0,0,0.4); }
.refuel-tank span { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(180deg, #8fe2ff, #2f7fc0); transition: height 0.4s ease; box-shadow: 0 0 26px rgba(111,214,255,0.55); }
.refuel-tank b { position: relative; z-index: 1; color: #fff; font-size: 22px; font-weight: 300; text-shadow: 0 1px 5px rgba(0,0,0,0.7); }
.refuel-box .shop-btn.do { min-width: 230px; justify-content: center; }
.price-in { width: 64px; height: 28px; text-align: center; font-family: inherit; font-size: 13px; color: #fff; background: rgba(10,16,30,0.7); border: 1px solid var(--line); border-radius: 8px; }
.price-in:focus { outline: none; border-color: var(--cyan); }
.mkt-nohave { color: var(--dim); min-width: 96px; text-align: center; }
.mkt-row .qty { display: inline-flex; align-items: center; flex: 0 0 auto; gap: 4px; } .mkt-row .qbtn { width: 28px; min-width: 28px; height: 28px; padding: 0; } .mkt-row .qin { width: 50px; height: 28px; }
.mkt-row .shop-btn.sm { flex: 0 0 auto; min-width: 82px; justify-content: center; }
.hub-foot { display: flex; gap: 10px; margin-top: 14px; }
.hub-foot .hidden { display: none; }
.hub-msg { min-height: 16px; font-size: 12px; color: #ffb088; margin-top: 8px; }
/* logbook panel (discovered places + favourites) */
.map-log {
    position: absolute; top: 62px; right: 20px; width: min(330px, 42vw); max-height: calc(100% - 150px);
    display: flex; flex-direction: column; background: rgba(8,11,20,0.82); border: 1px solid var(--line);
    border-radius: 14px; backdrop-filter: blur(10px); box-shadow: 0 18px 50px rgba(0,0,0,0.5); overflow: hidden; pointer-events: auto;
}
.map-log.hidden { display: none; }
/* the trade computer holds long "A → B" route names — give it more room */
#map-cpu { width: min(470px, 94vw); }
.mlog-head { display: flex; align-items: center; gap: 9px; padding: 11px 12px 11px 14px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; }
.mlog-head > i { display: inline-flex; color: var(--cyan); } .mlog-head > i .ico { width: 16px; height: 16px; }
.mlog-head #map-log-close { margin-left: auto; }
.mlog-body { overflow-y: auto; padding: 4px 10px 12px; }
.mlog-h { margin: 12px 4px 4px; font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--dim); }
.mlog-list { display: flex; flex-direction: column; }
.mlog-row { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 9px; cursor: pointer; }
.mlog-row:hover { background: rgba(111,214,255,0.07); }
.mlog-ico { display: inline-flex; color: var(--cyan); flex: 0 0 auto; } .mlog-ico .ico { width: 17px; height: 17px; }
.mlog-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mlog-name { color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mlog-txt span { color: var(--dim); font-size: 11px; font-variant-numeric: tabular-nums; }
.mlog-acts { display: inline-flex; gap: 3px; flex: 0 0 auto; }
.mlog-b { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; background: none; border: 1px solid transparent; border-radius: 8px; color: var(--dim); cursor: pointer; transition: color .14s, background .14s; }
.mlog-b:hover { background: rgba(111,214,255,0.12); color: var(--cyan); }
.mlog-b .ico { width: 15px; height: 15px; }
.mlog-b.fav.on { color: #ffd27a; } .mlog-b.fav.on:hover { color: #ffdf9a; }
.mlog-b.go.on { color: #7fffb4; background: rgba(127,255,180,0.14); }
.mlog-empty { color: var(--dim); font-size: 12px; padding: 8px 6px; font-style: italic; }
.mlog-rename { width: 100%; font-family: inherit; font-size: 13px; color: #fff; background: rgba(10,16,30,0.8); border: 1px solid var(--cyan); border-radius: 6px; padding: 3px 6px; }
.mlog-rename:focus { outline: none; }
/* legend & layer rows */
.leg-row { display: flex; align-items: center; gap: 11px; padding: 8px 6px; border-radius: 9px; width: 100%; }
button.leg-row { background: none; border: 1px solid transparent; color: var(--ink); font-family: inherit; cursor: pointer; text-align: left; transition: background .14s; }
button.leg-row:hover { background: rgba(111,214,255,0.07); }
.leg-row > i { display: inline-flex; color: var(--cyan); flex: 0 0 auto; } .leg-row > i .ico { width: 17px; height: 17px; }
.leg-row > span { flex: 1; font-size: 13px; }
.leg-row.tog { opacity: 0.55; } .leg-row.tog.on { opacity: 1; }
.leg-sw { flex: 0 0 auto; width: 30px; height: 16px; border-radius: 10px; background: rgba(120,160,220,0.2); position: relative; transition: background .15s; }
.leg-sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #8899aa; transition: transform .15s, background .15s; }
.leg-row.on .leg-sw { background: rgba(127,255,180,0.4); }
.leg-row.on .leg-sw::after { transform: translateX(14px); background: #7fffb4; }
/* trade computer: route finder rows */
.cpu-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cpu-list { display: flex; flex-direction: column; margin-bottom: 4px; }
.cpu-row { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 9px; cursor: pointer; }
.cpu-row:hover { background: rgba(111,214,255,0.07); }
.cpu-row > i { display: inline-flex; flex: 0 0 auto; filter: drop-shadow(0 0 5px currentColor); } .cpu-row > i .ico { width: 18px; height: 18px; }
.cpu-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cpu-txt b { color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cpu-txt span { color: var(--dim); font-size: 11px; display: inline-flex; align-items: center; gap: 5px; } .cpu-txt span .ico { width: 12px; height: 12px; }
.cpu-acts { display: inline-flex; gap: 3px; flex: 0 0 auto; }
#map-log-btn.on { color: var(--cyan); background: rgba(111,214,255,0.14); border-color: rgba(111,214,255,0.35); }
/* top-bar control buttons (filter / logbook) — consistent labelled pills */
.map-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.map-ctl-btn {
    display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 12px;
    background: rgba(255,255,255,0.04); border: 1px solid var(--line); color: var(--ink);
    font-family: inherit; font-size: 12px; letter-spacing: 1px; text-transform: lowercase; cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.map-ctl-btn:hover { background: rgba(111,214,255,0.1); border-color: rgba(111,214,255,0.3); }
.map-ctl-btn.on { background: rgba(111,214,255,0.16); border-color: var(--cyan); color: var(--cyan); }
.map-ctl-btn i { display: inline-flex; color: var(--cyan); } .map-ctl-btn i .ico { width: 15px; height: 15px; }
/* ore filter — now a dropdown anchored under its button (top-right) */
.map-filter {
    position: absolute; top: 60px; right: 22px; z-index: 6; display: flex; flex-wrap: wrap; gap: 6px;
    max-width: min(340px, 64vw);
    background: rgba(8,11,20,0.92); border: 1px solid var(--line); border-radius: 12px; padding: 9px;
    backdrop-filter: blur(10px); box-shadow: 0 14px 40px rgba(0,0,0,0.5);
}
.map-fchip-empty { color: var(--dim); font-size: 12px; padding: 4px 8px; font-style: italic; }
.map-filter.hidden { display: none; }
.map-fchip {
    display: inline-flex; align-items: center; gap: 6px; font-family: inherit; font-size: 11px; color: var(--ink);
    background: rgba(10,16,30,0.72); border: 1px solid var(--line); border-radius: 20px; padding: 5px 11px; cursor: pointer;
    transition: background .14s, border-color .14s;
}
.map-fchip:hover { background: rgba(111,214,255,0.14); }
.map-fchip.on { border-color: var(--cyan); background: rgba(111,214,255,0.18); color: #fff; }
.map-fchip i { width: 9px; height: 9px; border-radius: 50%; }

/* zoom controls sit at the bottom-right (above engage), clear of the wider computer panel */
.map-side { position: absolute; right: 24px; bottom: 96px; display: flex; flex-direction: row; gap: 8px; }
.map-ctl {
    width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center;
    font-family: inherit; font-size: 22px; color: var(--ink); cursor: pointer;
    background: rgba(10,16,30,0.72); border: 1px solid var(--line); border-radius: 11px;
    backdrop-filter: blur(6px); transition: background .14s, border-color .14s;
}
.map-ctl:hover { background: rgba(111,214,255,0.16); border-color: rgba(111,214,255,0.55); }
.map-ctl .ico { width: 19px; height: 19px; color: var(--cyan); }

.map-bottom {
    position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: flex-end; justify-content: space-between;
    gap: 20px; padding: 20px 24px 26px; background: linear-gradient(0deg, rgba(5,8,18,0.94), rgba(5,8,18,0));
}
.map-route { min-height: 48px; min-width: 240px; max-width: 60vw; color: var(--ink); }
.map-route-head { display: flex; flex-direction: column; gap: 3px; }
.map-route-head b { color: #fff; font-size: 18px; font-weight: 400; letter-spacing: 0.4px; }
.map-route-head span { color: var(--cyan); font-size: 12px; font-variant-numeric: tabular-nums; }
.map-leg { margin-top: 8px; font-size: 13px; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }
.map-leg i { color: var(--cyan); display: inline-flex; } .map-leg .ico { width: 15px; height: 15px; }
.map-progress { margin-top: 5px; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--dim); }
.map-route-hint { margin-top: 8px; font-size: 11px; line-height: 1.45; color: var(--dim); opacity: 0.85; max-width: 280px; }
.map-msg { font-size: 14px; color: var(--dim); line-height: 1.5; max-width: 360px; }
.map-msg.dim { opacity: 0.8; }
.map-msg.warn { color: #ffb14c; }
.map-msg.ok { color: #7fffb4; }
.map-actions { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.map-auto {
    font-family: inherit; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; cursor: pointer;
    color: var(--ink); background: rgba(10,16,30,0.7); border: 1px solid var(--line); border-radius: 12px; padding: 13px 18px;
    transition: background .14s, border-color .14s, color .14s;
}
.map-auto:hover { background: rgba(111,214,255,0.14); }
.map-auto.on { background: rgba(127,255,180,0.2); border-color: #7fffb4; color: #eafff3; box-shadow: 0 0 14px rgba(127,255,180,0.3); }
.map-engage {
    display: inline-flex; align-items: center; gap: 10px; font-family: inherit; font-size: 16px; font-weight: 500;
    letter-spacing: 2px; text-transform: uppercase; cursor: pointer; color: #04140c;
    background: linear-gradient(180deg, #9affc8, #41e69a); border: none; border-radius: 12px; padding: 14px 26px;
    box-shadow: 0 0 22px rgba(127,255,180,0.45); transition: filter .14s, transform .1s, opacity .14s;
}
.map-engage i { display: inline-flex; } .map-engage .ico { width: 20px; height: 20px; }
.map-engage:hover:not(:disabled) { filter: brightness(1.1); }
.map-engage:active:not(:disabled) { transform: translateY(1px); }
.map-engage:disabled { opacity: 0.35; cursor: default; box-shadow: none; }

/* full-screen wormhole tunnel animation (sits above everything during a jump) */
#warp-fx { position: fixed; inset: 0; z-index: 60; width: 100vw; height: 100vh; pointer-events: none; }
#warp-fx.hidden { display: none; }

/* ---- remote player labels ---- */
#labels { position: fixed; inset: 0; z-index: 7; pointer-events: none; }
.player-label {
    position: absolute; transform: translate(-50%, -100%);
    font-size: 10px; letter-spacing: 1px; color: var(--ink); opacity: 0.6;
    text-shadow: 0 0 10px rgba(0,0,0,0.9); white-space: nowrap;
}
/* Hyper-warp countdown floating beside a charging Haven. */
.warp-label {
    position: absolute; transform: translate(-50%, -100%); pointer-events: none; white-space: nowrap;
    display: flex; align-items: center; gap: 7px; z-index: 22;
    font-size: 12px; font-weight: 600; letter-spacing: 1.5px; color: #fff; text-transform: uppercase;
    padding: 5px 13px; border-radius: 999px; background: rgba(8,12,24,0.82);
    border: 1px solid var(--wc, #6fd6ff); box-shadow: 0 0 20px color-mix(in srgb, var(--wc, #6fd6ff) 55%, transparent);
    animation: warpLabelPulse 1.1s ease-in-out infinite;
}
.warp-label b { color: var(--wc, #6fd6ff); font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.warp-label i { display: inline-flex; color: var(--wc, #6fd6ff); } .warp-label .ico { width: 14px; height: 14px; }
@keyframes warpLabelPulse { 0%,100% { opacity: 0.92; } 50% { opacity: 1; box-shadow: 0 0 30px color-mix(in srgb, var(--wc, #6fd6ff) 80%, transparent); } }
/* Final 8 seconds — the drive is about to fire: red, bigger, urgent. */
.warp-label.final { border-color: #ff5a5a; color: #fff; transform: translate(-50%, -100%) scale(1.18); animation: warpFinalPulse 0.5s ease-in-out infinite; }
.warp-label.final b { color: #ff7b7b; }
.warp-label.final i { color: #ff5a5a; }
@keyframes warpFinalPulse { 0%,100% { box-shadow: 0 0 22px rgba(255,70,70,0.6); } 50% { box-shadow: 0 0 46px rgba(255,70,70,0.95); } }
.shop-btn.warp-charging { opacity: 0.65; }

/* ---- settings panel ---- */
#settings {
    position: fixed; top: 46px; left: 14px; z-index: 11; width: 240px;
    background: var(--glass); border: 1px solid var(--line); border-radius: 14px;
    padding: 14px; backdrop-filter: blur(12px);
    transform: translateX(-280px); opacity: 0; transition: transform .3s, opacity .3s;
    display: flex; flex-direction: column; gap: 10px;
}
#settings.open { transform: translateX(0); opacity: 1; }
/* ---- grouped settings list (built by settings.js) ---- */
#menu-settings { display: flex; flex-direction: column; }
.set-group {
    font-size: 10px; letter-spacing: 2.5px; text-transform: uppercase;
    color: var(--cyan); opacity: 0.72; margin: 18px 0 4px; padding-top: 13px;
    border-top: 1px solid var(--line);
}
.set-group:first-child { border-top: none; padding-top: 2px; margin-top: 0; }
.set-row {
    display: grid; grid-template-columns: 140px 1fr 54px; align-items: center;
    gap: 16px; padding: 9px 0; font-size: 13px; color: var(--ink); letter-spacing: 0.2px;
}
.set-row > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-row em {
    font-style: normal; text-align: right; color: var(--cyan);
    font-size: 12px; font-variant-numeric: tabular-nums; letter-spacing: 0.5px;
}

/* ---- keybind reference (menu › controls) ---- */
.menu-keybinds { display: flex; flex-direction: column; }
.keybind-row {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 8px 0; border-top: 1px solid var(--line);
}
.keybind-row:first-child { border-top: none; }
.kb-keys { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.kb-keys em { font-style: normal; color: var(--dim); font-size: 11px; }
.kb-act { color: var(--ink); font-size: 13px; letter-spacing: 0.2px; text-align: right; }
.keybind-row kbd {
    font-family: inherit; font-size: 11px; line-height: 1; color: var(--cyan);
    background: rgba(111,214,255,0.08); border: 1px solid rgba(111,214,255,0.28);
    border-radius: 6px; padding: 5px 8px; min-width: 14px; text-align: center;
    box-shadow: 0 1px 0 rgba(0,0,0,0.3);
}

/* ---- custom neon range slider (also styles the audio volume slider) ---- */
#menu input[type=range] {
    -webkit-appearance: none; appearance: none; width: 100%; height: 20px;
    background: transparent; cursor: pointer; margin: 0;
}
#menu .menu-audio input[type=range] { flex: 1; width: auto; }
#menu input[type=range]::-webkit-slider-runnable-track {
    height: 4px; border-radius: 999px;
    background: linear-gradient(to right,
        var(--cyan) 0%, var(--cyan) var(--p, 50%),
        rgba(120,160,220,0.16) var(--p, 50%), rgba(120,160,220,0.16) 100%);
    box-shadow: 0 0 8px rgba(111,214,255,0.22);
}
#menu input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 16px; height: 16px; margin-top: -6px;
    border-radius: 50%; border: none;
    background: radial-gradient(circle at 35% 32%, #ffffff, var(--cyan) 68%);
    box-shadow: 0 0 8px var(--cyan), 0 0 16px rgba(111,214,255,0.55);
    transition: transform .12s ease;
}
#menu input[type=range]:hover::-webkit-slider-thumb { transform: scale(1.18); }
#menu input[type=range]:active::-webkit-slider-thumb { transform: scale(1.3); }
#menu input[type=range]::-moz-range-track { height: 4px; border-radius: 999px; background: rgba(120,160,220,0.16); }
#menu input[type=range]::-moz-range-progress { height: 4px; border-radius: 999px; background: var(--cyan); box-shadow: 0 0 8px rgba(111,214,255,0.4); }
#menu input[type=range]::-moz-range-thumb {
    width: 16px; height: 16px; border: none; border-radius: 50%;
    background: radial-gradient(circle at 35% 32%, #fff, var(--cyan) 68%);
    box-shadow: 0 0 8px var(--cyan), 0 0 16px rgba(111,214,255,0.55);
}

/* ---- version footer ---- */
.menu-version {
    margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--line);
    text-align: center; font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase;
    color: var(--dim); opacity: 0.7;
}
.menu-version em { font-style: normal; color: var(--cyan); opacity: 0.95; text-transform: none; letter-spacing: 1px; font-family: ui-monospace, 'SF Mono', Menlo, monospace; }

/* ---- "what's new" changelog feed ---- */
.menu-changes { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.menu-changes-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.menu-changes-head > span { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--dim); opacity: 0.8; }
#update-btn { padding: 5px 12px; font-size: 11px; }
.menu-changes-list {
    max-height: 76px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 4px;
}
.change-row { display: flex; gap: 9px; font-size: 12px; line-height: 1.4; align-items: baseline; }
.change-row em { font-style: normal; flex: 0 0 auto; color: var(--cyan); opacity: 0.85;
    font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 10.5px; }
.change-row span { color: var(--ink); opacity: 0.85; }
#settings-reset {
    margin-top: 6px; padding: 8px 12px; font-size: 11px; letter-spacing: 0.5px; font-family: inherit;
    color: var(--dim); background: rgba(255,255,255,0.04); border: 1px solid var(--line);
    border-radius: 9px; cursor: pointer; transition: color .15s, border-color .15s, background .15s;
}
#settings-reset:hover { color: var(--cyan); border-color: rgba(111,214,255,0.4); background: rgba(111,214,255,0.08); }

/* ---- first-visit UI guide ---- */
#ui-guide {
    position: fixed; inset: 0; z-index: 40;
    background: radial-gradient(ellipse at center, rgba(5,8,18,0.55), rgba(4,6,13,0.8));
    backdrop-filter: blur(1.5px); transition: opacity .5s;
}
#ui-guide.hidden { opacity: 0; pointer-events: none; }
.guide-hint {
    position: fixed; max-width: 230px; font-size: 12px; line-height: 1.5; font-weight: 300;
    color: var(--ink); letter-spacing: 0.3px; padding: 9px 13px;
    background: rgba(12,18,34,0.85); border: 1px solid rgba(111,214,255,0.3); border-radius: 12px;
    box-shadow: 0 0 24px rgba(111,214,255,0.12); animation: chatIn .5s ease both;
}
.g-topleft { top: 46px; left: 14px; }
.g-topcenter { top: 46px; left: 50%; transform: translateX(-50%); text-align: center; }
.g-topright { top: 46px; right: 14px; text-align: right; }
.g-botleft { bottom: 64px; left: 14px; }
.g-botright { bottom: 150px; right: 14px; text-align: right; }
.guide-center {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    text-align: center; max-width: 440px; padding: 24px;
}
.guide-center h2 { font-weight: 200; font-size: 26px; letter-spacing: 8px; color: #fff; margin-bottom: 14px; text-transform: lowercase; }
.guide-center p { color: var(--dim); font-size: 13px; font-weight: 300; line-height: 1.7; margin-bottom: 12px; }
.guide-center b { color: var(--cyan); font-weight: 500; }
.guide-center .g-keys { font-size: 12px; opacity: 0.8; }
#guide-dismiss {
    margin-top: 10px; padding: 11px 30px; font-size: 12px; letter-spacing: 3px; font-weight: 600;
    color: var(--bg); cursor: pointer; border: none; border-radius: 28px; font-family: inherit;
    background: linear-gradient(135deg, #9ee6ff, var(--cyan)); box-shadow: 0 0 28px rgba(111,214,255,0.45);
    transition: transform .2s, box-shadow .2s;
}
#guide-dismiss:hover { transform: translateY(-2px); box-shadow: 0 0 40px rgba(111,214,255,0.65); }

/* ---- global scoreboard ---- */
#scoreboard {
    position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(ellipse at center, rgba(8,12,28,0.6), rgba(5,6,13,0.9));
    backdrop-filter: blur(3px); transition: opacity .3s;
}
#scoreboard.hidden { opacity: 0; pointer-events: none; }
.sb-panel {
    width: 880px; max-width: 96vw; max-height: 92vh; display: flex; flex-direction: column;
    background: var(--glass); border: 1px solid var(--line); border-radius: 18px;
    padding: 26px 28px; backdrop-filter: blur(14px); box-shadow: 0 0 50px rgba(0,0,0,0.5);
}
.sb-head h2 { font-size: 26px; }
.sb-row { font-size: 15px; padding: 11px 12px; }
.sb-detail {
    display: inline-flex; align-items: center; gap: 5px; background: rgba(255,255,255,0.05);
    border: 1px solid var(--line); border-radius: 14px; color: var(--dim); cursor: pointer;
    padding: 6px 10px; transition: color .15s, border-color .15s, background .15s;
}
.sb-detail:hover { color: var(--cyan); border-color: rgba(111,214,255,0.4); background: rgba(111,214,255,0.1); }
.sb-detail .ico { width: 16px; height: 16px; }
.sb-detail b { font-size: 12px; font-weight: 600; }
.sb-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sb-head h2 { font-weight: 200; font-size: 22px; letter-spacing: 4px; color: #fff; text-transform: lowercase; }
.sb-controls { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
#sb-search {
    flex: 1; padding: 9px 14px; font-size: 13px; font-family: inherit; color: var(--ink);
    background: rgba(255,255,255,0.04); border: 1px solid var(--line); border-radius: 20px;
    outline: none; letter-spacing: 0.5px;
}
#sb-search:focus { border-color: var(--cyan); }
.sb-sort { display: flex; gap: 4px; }
.sb-tab {
    background: none; border: 1px solid var(--line); color: var(--dim); font-family: inherit;
    font-size: 11px; letter-spacing: 0.5px; padding: 7px 12px; border-radius: 16px; cursor: pointer;
    transition: color .15s, border-color .15s, background .15s;
}
.sb-tab:hover { color: var(--ink); }
.sb-tab.active { color: var(--cyan); border-color: rgba(111,214,255,0.4); background: rgba(111,214,255,0.1); }
.sb-list { overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding-right: 4px; }
.sb-row {
    display: grid; grid-template-columns: 34px 1fr auto auto auto; gap: 14px; align-items: center;
    font-size: 13px; color: var(--ink); padding: 8px 10px; border-radius: 9px;
}
.sb-row:nth-child(odd) { background: rgba(255,255,255,0.02); }
.sb-rank { text-align: center; color: var(--dim); font-size: 12px; }
.sb-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: 0.5px; }
.sb-ly { color: var(--cyan); font-weight: 500; white-space: nowrap; }
.sb-dust { color: var(--dim); white-space: nowrap; min-width: 70px; text-align: right; }
.sb-empty { color: var(--dim); text-align: center; padding: 30px; opacity: 0.7; font-size: 13px; }
.sb-badges { display: inline-flex; gap: 5px; margin-left: 10px; vertical-align: middle; }
.sb-badge { width: 18px; height: 18px; display: inline-flex; opacity: 0.95; cursor: help; }
.sb-badge .ico { width: 18px; height: 18px; }

/* ---- per-player achievements + missions detail ---- */
#player-badges {
    position: fixed; inset: 0; z-index: 31; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(ellipse at center, rgba(8,12,28,0.55), rgba(5,6,13,0.92));
    backdrop-filter: blur(4px); transition: opacity .25s;
}
#player-badges.hidden { opacity: 0; pointer-events: none; }
.pb-panel {
    width: 620px; max-width: 94vw; max-height: 86vh; display: flex; flex-direction: column;
    background: var(--glass); border: 1px solid var(--line); border-radius: 18px;
    padding: 24px 26px; backdrop-filter: blur(14px); box-shadow: 0 0 60px rgba(0,0,0,0.6);
}
.pb-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.pb-head h2 { font-weight: 300; font-size: 24px; letter-spacing: 2px; color: #fff; }
.pb-list { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 4px; }
.pb-section {
    font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--cyan);
    opacity: 0.8; margin: 12px 2px 4px;
}
.pb-row { display: grid; grid-template-columns: 56px 1fr; gap: 16px; align-items: center; padding: 8px 6px; }
.pb-badge {
    width: 52px; height: 52px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    color: var(--bc); border: 1.5px solid color-mix(in srgb, var(--bc) 50%, transparent);
    background: color-mix(in srgb, var(--bc) 14%, transparent);
    box-shadow: 0 0 18px color-mix(in srgb, var(--bc) 40%, transparent);
}
.pb-badge .ico { width: 28px; height: 28px; }
.pb-name { font-size: 17px; color: var(--ink); letter-spacing: 0.4px; }
.pb-desc { font-size: 13px; color: var(--dim); margin-top: 2px; }

/* ---- missions + achievements overlay ---- */
#missions {
    position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(ellipse at center, rgba(8,12,28,0.6), rgba(5,6,13,0.9));
    backdrop-filter: blur(3px); transition: opacity .3s;
}
#missions.hidden { opacity: 0; pointer-events: none; }
.ms-panel {
    width: 560px; max-width: 92vw; max-height: 80vh; display: flex; flex-direction: column;
    background: var(--glass); border: 1px solid var(--line); border-radius: 18px;
    padding: 18px 20px; backdrop-filter: blur(14px); box-shadow: 0 0 50px rgba(0,0,0,0.5);
}
.ms-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.ms-head h2 { font-weight: 200; font-size: 22px; letter-spacing: 4px; color: #fff; text-transform: lowercase; }
.ms-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.ms-tab {
    background: none; border: 1px solid var(--line); color: var(--dim); font-family: inherit;
    font-size: 11px; letter-spacing: 0.5px; padding: 7px 14px; border-radius: 16px; cursor: pointer;
    text-transform: lowercase; transition: color .15s, border-color .15s, background .15s;
}
.ms-tab:hover { color: var(--ink); }
.ms-tab.active { color: var(--cyan); border-color: rgba(111,214,255,0.4); background: rgba(111,214,255,0.1); }
.ms-list { overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding-right: 4px; }
.ms-count { font-size: 11px; color: var(--dim); letter-spacing: 0.5px; padding: 2px 2px 8px; }
.ms-count b { color: var(--cyan); }
.ms-row {
    display: grid; grid-template-columns: 40px 1fr auto; gap: 13px; align-items: center;
    padding: 11px 10px; border-radius: 11px; background: rgba(255,255,255,0.02);
}
.ms-row.done { background: rgba(111,214,255,0.06); }
.ms-row.locked .ms-name, .ms-row.locked .ms-desc { opacity: 0.6; }
.ms-badge {
    width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    color: var(--bc); border: 1px solid color-mix(in srgb, var(--bc) 45%, transparent);
    background: color-mix(in srgb, var(--bc) 10%, transparent); opacity: 0.55;
}
.ms-badge.on { opacity: 1; box-shadow: 0 0 16px color-mix(in srgb, var(--bc) 50%, transparent); }
.ms-badge .ico { width: 19px; height: 19px; }
.ms-info { min-width: 0; }
.ms-name { font-size: 13px; color: var(--ink); letter-spacing: 0.4px; }
.ms-desc { font-size: 11px; color: var(--dim); margin: 1px 0 6px; }
.ms-bar { height: 4px; border-radius: 3px; background: rgba(255,255,255,0.08); overflow: hidden; }
.ms-bar i { display: block; height: 100%; border-radius: 3px; transition: width .4s; }
.ms-prog { font-size: 10px; color: var(--dim); margin-top: 4px; letter-spacing: 0.5px; }
.ms-action { display: flex; align-items: center; justify-content: flex-end; min-width: 64px; }
.ms-accept {
    background: rgba(111,214,255,0.12); border: 1px solid rgba(111,214,255,0.4); color: var(--cyan);
    font-family: inherit; font-size: 11px; letter-spacing: 0.5px; padding: 7px 13px; border-radius: 14px;
    cursor: pointer; transition: background .15s; text-transform: lowercase;
}
.ms-accept:hover { background: rgba(111,214,255,0.22); }
.ms-state { font-size: 11px; letter-spacing: 0.5px; text-transform: lowercase; }
.ms-state.active { color: var(--cyan); opacity: 0.8; }
.ms-state.done { color: #9ee6ff; display: inline-flex; }
.ms-state.done .ico { width: 18px; height: 18px; }

/* unlock toast: stacked heading + name + blurb */
.toast-stack { display: flex; flex-direction: column; line-height: 1.3; text-align: left; }
.toast-stack u { text-decoration: none; color: var(--cyan); font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; opacity: 0.85; }
.toast-stack b { color: #fff; font-weight: 600; }
.toast-stack i { font-style: normal; color: var(--dim); font-size: 11px; }

/* ---- start screen ---- */
#start-screen {
    position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; overflow: hidden;
    background: radial-gradient(ellipse at center, rgba(8,12,28,0.6), rgba(5,6,13,0.95));
    transition: opacity .8s; backdrop-filter: blur(2px);
}
#start-screen.hidden { opacity: 0; pointer-events: none; }
.panel { position: relative; z-index: 1; text-align: center; max-width: 440px; padding: 20px; }
/* drifting colour auras behind the panel — colour + life */
/* hyperspace starfield behind the start screen (replaces the colour auras) */
#starfield { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
/* "what's new" loading sign + reveal */
.wu-loading { display: flex; align-items: center; gap: 9px; color: var(--dim); font-size: 12px; letter-spacing: 1px; min-height: 22px; }
.wu-loading.hidden, .wu-news.hidden { display: none; }
.wu-news { display: flex; flex-direction: column; align-items: center; gap: 9px; }
.wu-spin { width: 17px; height: 17px; border-radius: 50%; border: 2px solid rgba(127,255,180,0.25); border-top-color: #7fffb4; animation: wuSpin .8s linear infinite; box-shadow: 0 0 12px rgba(127,255,180,0.4); }
@keyframes wuSpin { to { transform: rotate(360deg); } }
/* start-screen "what's new" banner (above the logo) */
#welcome-updates { display: flex; flex-direction: column; align-items: center; gap: 9px; margin: 0 auto 26px; max-width: 440px; }
#welcome-updates.hidden { display: none; }
.wu-badge {
    font-size: 11px; letter-spacing: 3px; text-transform: uppercase; font-weight: 600;
    color: #04140c; background: linear-gradient(180deg, #9affc8, #41e69a); border-radius: 20px; padding: 5px 15px;
    box-shadow: 0 0 18px rgba(127,255,180,0.5); animation: wuPulse 2.4s ease-in-out infinite;
}
@keyframes wuPulse { 0%, 100% { box-shadow: 0 0 12px rgba(127,255,180,0.4); } 50% { box-shadow: 0 0 26px rgba(127,255,180,0.8); } }
.wu-items { display: flex; flex-direction: column; gap: 5px; text-align: center; max-height: 320px; overflow-y: auto; padding-right: 8px; }
.wu-item { display: flex; gap: 9px; align-items: baseline; font-size: 13px; color: var(--ink); opacity: 0.82; line-height: 1.4; }
.wu-num { flex: none; min-width: 18px; text-align: right; color: var(--cyan); opacity: 0.6; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 11px; }
.wu-item:first-child { font-size: 15px; color: #fff; opacity: 1; font-weight: 500; }
.wu-item:first-child .wu-num { color: #8fe6c0; opacity: 0.95; }

.orb-mark {
    width: 46px; height: 46px; margin: 0 auto 22px; border-radius: 50%;
    background: radial-gradient(circle, #fff, var(--cyan) 45%, rgba(111,214,255,0) 72%);
    box-shadow: 0 0 50px var(--cyan), 0 0 90px rgba(111,214,255,0.5);
    animation: breathe 4s ease-in-out infinite;
}
@keyframes breathe { 0%,100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.12); opacity: 1; } }
.panel h1 { font-weight: 200; font-size: 34px; letter-spacing: 12px; color: #fff; margin-bottom: 10px; }
.panel .sub { color: var(--dim); font-size: 13px; font-weight: 300; letter-spacing: 1px; margin-bottom: 26px; }
#name-input {
    width: 260px; padding: 12px 16px; font-size: 14px; text-align: center; color: var(--ink);
    background: rgba(255,255,255,0.04); border: 1px solid var(--line); border-radius: 30px;
    outline: none; font-family: inherit; letter-spacing: 1px; margin-bottom: 14px;
}
#name-input:focus { border-color: var(--cyan); }
#begin-btn {
    display: block; margin: 0 auto; padding: 12px 38px; font-size: 13px; letter-spacing: 3px;
    color: var(--bg); font-weight: 600; cursor: pointer; border: none; border-radius: 30px;
    background: linear-gradient(135deg, #9ee6ff, var(--cyan)); font-family: inherit;
    box-shadow: 0 0 30px rgba(111,214,255,0.5); transition: transform .2s, box-shadow .2s;
}
#begin-btn:hover { transform: translateY(-2px); box-shadow: 0 0 44px rgba(111,214,255,0.7); }
.panel .hint { color: var(--dim); font-size: 11px; font-weight: 300; letter-spacing: 0.5px; margin-top: 22px; opacity: 0.7; }

/* two-stage start: sound gate → main (changelog · start · drifting orb) */
/* hidden until JS has populated the language buttons (no empty-pill flash) */
#start-gate { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; opacity: 0; transition: opacity .45s ease; }
#start-gate.ready { opacity: 1; }
#start-gate.hidden, #start-main.hidden { display: none; }
.gate-langs { margin: 8px 0 4px; }
.gate-langs .lang-opt { padding: 9px 16px; font-size: 14px; border-radius: 12px; }
#gate-enter {
    display: block; margin: 16px auto 0; padding: 13px 46px; font-size: 14px; letter-spacing: 4px;
    color: var(--bg); font-weight: 600; cursor: pointer; border: none; border-radius: 30px;
    background: linear-gradient(135deg, #9ee6ff, var(--cyan)); font-family: inherit;
    box-shadow: 0 0 30px rgba(111,214,255,0.5); transition: transform .2s, box-shadow .2s;
}
#gate-enter:hover { transform: translateY(-2px); box-shadow: 0 0 46px rgba(111,214,255,0.75); }
#start-main {
    position: relative; z-index: 1; display: grid; grid-template-columns: 1fr auto 1fr;
    align-items: center; gap: 34px; width: min(1180px, 94vw);
}
.start-left { justify-self: end; max-width: 320px; width: 100%; }
.start-left #welcome-updates { margin: 0; max-width: none; align-items: flex-start; }
.start-left .wu-news { align-items: flex-start; }
.start-left .wu-items { text-align: left; }
.start-center { margin: 0; }
.start-right { justify-self: start; display: flex; flex-direction: column; align-items: flex-start; }
/* featured trade route card on the enter screen (under the orb) */
.start-route { margin-top: 16px; width: clamp(220px, 26vw, 340px); background: rgba(8,12,22,0.6); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; backdrop-filter: blur(6px); text-align: left; opacity: 0; transition: opacity .35s ease; }
.start-route.show { opacity: 1; }
.start-route:empty { display: none; }
.sr-head { display: flex; align-items: center; gap: 7px; font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--cyan); margin-bottom: 10px; }
.sr-head i { display: inline-flex; } .sr-head i .ico { width: 14px; height: 14px; }
.sr-mat { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.sr-mat i { display: inline-flex; filter: drop-shadow(0 0 5px currentColor); } .sr-mat i .ico { width: 18px; height: 18px; }
.sr-mat b { color: #fff; font-size: 15px; }
.sr-path { color: var(--ink); font-size: 13px; opacity: 0.85; margin-bottom: 6px; } .sr-path span { color: var(--cyan); margin: 0 4px; }
.sr-meta { color: var(--dim); font-size: 12px; display: inline-flex; align-items: center; gap: 5px; } .sr-meta .ico { width: 12px; height: 12px; }
/* enter-screen galactic news crawl (pinned to the very top of the screen) */
.start-ticker { position: absolute; left: 0; right: 0; top: 8px; overflow: hidden; pointer-events: none;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.start-ticker:empty { display: none; }
.start-ticker .tick-track { display: inline-flex; align-items: center; white-space: nowrap; animation: tickScroll 70s linear infinite; }

/* boot loader — pure HTML/CSS, shows instantly while the JS modules load */
#boot-loader {
    position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px;
    background: radial-gradient(ellipse at center, rgba(8,12,28,0.92), rgba(5,6,13,1)); transition: opacity .5s ease;
}
#boot-loader.hidden { opacity: 0; pointer-events: none; }
.boot-orb {
    width: 40px; height: 40px; border-radius: 50%;
    background: radial-gradient(circle, #fff, var(--cyan) 45%, rgba(111,214,255,0) 72%);
    box-shadow: 0 0 40px var(--cyan), 0 0 80px rgba(111,214,255,0.5); animation: breathe 2.4s ease-in-out infinite;
}
.boot-bar { width: 200px; height: 3px; border-radius: 3px; background: rgba(120,160,220,0.15); overflow: hidden; }
.boot-bar span {
    display: block; width: 42%; height: 100%; border-radius: 3px;
    background: linear-gradient(90deg, transparent, var(--cyan), transparent); box-shadow: 0 0 10px var(--cyan);
    animation: bootSlide 1.1s ease-in-out infinite;
}
@keyframes bootSlide { 0% { transform: translateX(-110%); } 100% { transform: translateX(330%); } }
/* start choices: learn-to-play (secondary) vs enter (primary) */
.start-choices { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.start-choice { min-width: 290px; text-align: center; }
.start-choice.secondary {
    padding: 12px 38px; font-size: 13px; letter-spacing: 3px; font-weight: 600; font-family: inherit; cursor: pointer;
    color: var(--ink); background: rgba(255,255,255,0.05); border: 1px solid var(--line); border-radius: 30px;
    transition: transform .2s, background .2s, border-color .2s, color .2s;
}
.start-choice.secondary:hover { transform: translateY(-2px); background: rgba(127,255,180,0.1); border-color: rgba(127,255,180,0.45); color: #bdf5d6; }
/* live "x / cap drifters online" under the start buttons */
.online-count { margin-top: 2px; font-size: 12px; letter-spacing: 1px; color: var(--dim); display: inline-flex; align-items: center; gap: 7px; }
.online-count:empty { display: none; }
.online-count::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #7fffb4; box-shadow: 0 0 8px #7fffb4; animation: onlineDot 2s ease-in-out infinite; }
.online-count.full { color: #ff9a5a; }
.online-count.full::before { background: #ff6a5a; box-shadow: 0 0 8px #ff6a5a; animation: none; }
@keyframes onlineDot { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* interactive tutorial card (bottom-centre, non-blocking) */
#tutorial { position: fixed; left: 0; right: 0; bottom: 0; z-index: 28; display: flex; justify-content: center; pointer-events: none; padding: 0 16px calc(24px + env(safe-area-inset-bottom, 0px)); }
#tutorial.hidden { display: none; }
.tut-card {
    pointer-events: auto; width: min(560px, 94vw); background: rgba(8,12,22,0.93); border: 1px solid var(--line);
    border-radius: 16px; padding: 15px 20px 16px; backdrop-filter: blur(12px); box-shadow: 0 18px 50px rgba(0,0,0,0.55);
    transition: transform .25s, box-shadow .25s;
}
#tutorial.flash .tut-card { box-shadow: 0 0 0 1px var(--cyan), 0 18px 60px rgba(111,214,255,0.4); transform: translateY(-3px); }
.tut-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.tut-badge { font-size: 10px; letter-spacing: 3px; text-transform: uppercase; font-weight: 600; color: #04140c; background: linear-gradient(180deg, #9affc8, #41e69a); border-radius: 20px; padding: 4px 12px; box-shadow: 0 0 14px rgba(127,255,180,0.5); }
.tut-step { font-size: 11px; letter-spacing: 1px; color: var(--dim); font-variant-numeric: tabular-nums; }
.tut-text { color: #eaf3ff; font-size: 15px; line-height: 1.55; }
.tut-text b { color: var(--cyan); font-weight: 600; }
.tut-keys { display: flex; gap: 6px; margin-top: 11px; }
.tut-keys.hidden { display: none; }
.tut-keys kbd { font-family: inherit; font-size: 12px; color: var(--ink); background: rgba(255,255,255,0.06); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 3px 9px; }
.tut-keys em { color: var(--dim); font-style: normal; align-self: center; }
.tut-actions { display: flex; align-items: center; margin-top: 14px; gap: 12px; }
.tut-skip { background: none; border: none; color: var(--dim); font-family: inherit; font-size: 12px; letter-spacing: 0.5px; cursor: pointer; text-decoration: underline; opacity: 0.7; }
.tut-skip:hover { opacity: 1; color: var(--ink); }
.tut-next { margin-left: auto; padding: 9px 24px; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; font-weight: 600; color: var(--bg); border: none; border-radius: 22px; background: linear-gradient(135deg, #9ee6ff, var(--cyan)); cursor: pointer; box-shadow: 0 0 22px rgba(111,214,255,0.4); transition: transform .15s; }
.tut-next.hidden { display: none; }
.tut-next:hover { transform: translateY(-1px); }
#start-orb { width: clamp(220px, 26vw, 340px); height: clamp(220px, 26vw, 340px); display: block; }
@media (max-width: 900px) {
    #start-main { grid-template-columns: 1fr; gap: 0; }
    .start-left, .start-right { display: none; }
}

/* ====================================================================
   Mobile / touch
   ==================================================================== */

/* ---- floating virtual joystick (steering area, only in-game on touch) ---- */
#stick { display: none; }
body.touch.playing #stick {
    display: block; position: fixed; z-index: 25;
    left: calc(26px + env(safe-area-inset-left, 0px));
    bottom: calc(30px + env(safe-area-inset-bottom, 0px));
    width: 122px; height: 122px; border-radius: 50%;
    background: radial-gradient(circle at 50% 50%, rgba(111,214,255,0.05), rgba(10,16,32,0.32));
    border: 1.5px solid rgba(111,214,255,0.22);
    box-shadow: inset 0 0 18px rgba(111,214,255,0.06);
    opacity: 0.4; pointer-events: none; transition: opacity .15s;
    touch-action: none;
}
/* While steering: the stick floats to the finger (JS sets left/top to the
   touch point, so centre it on that point) and brightens. */
body.touch.playing #stick.active {
    margin: -61px 0 0 -61px; bottom: auto; opacity: 0.95;
    border-color: rgba(111,214,255,0.5);
    box-shadow: 0 0 24px rgba(111,214,255,0.22), inset 0 0 18px rgba(111,214,255,0.1);
}
#stick-knob {
    position: absolute; left: 50%; top: 50%; width: 54px; height: 54px;
    margin: -27px 0 0 -27px; border-radius: 50%;
    background: radial-gradient(circle at 50% 40%, #fff, var(--cyan) 55%, rgba(111,214,255,0.2) 100%);
    box-shadow: 0 0 22px rgba(111,214,255,0.6); will-change: transform;
}

/* ---- on-screen boost button (only in-game on touch devices) ---- */
#boost-btn { display: none; }
body.touch.playing #boost-btn {
    display: flex; align-items: center; justify-content: center;
    position: fixed; z-index: 25;
    right: calc(22px + env(safe-area-inset-right, 0px));
    bottom: calc(30px + env(safe-area-inset-bottom, 0px));
    width: 84px; height: 84px; border-radius: 50%;
    color: var(--cyan); cursor: pointer; -webkit-tap-highlight-color: transparent;
    touch-action: none; -webkit-user-select: none; user-select: none;
    background: radial-gradient(circle at 50% 38%, rgba(111,214,255,0.22), rgba(10,16,32,0.55));
    border: 1.5px solid rgba(111,214,255,0.5);
    box-shadow: 0 0 26px rgba(111,214,255,0.3), inset 0 0 18px rgba(111,214,255,0.12);
    backdrop-filter: blur(6px); transition: transform .1s, box-shadow .1s, background .1s;
}
#boost-btn .ico { width: 34px; height: 34px; }
#boost-btn:active {
    transform: scale(0.92);
    background: radial-gradient(circle at 50% 38%, rgba(111,214,255,0.45), rgba(20,40,70,0.7));
    box-shadow: 0 0 42px rgba(111,214,255,0.6), inset 0 0 22px rgba(111,214,255,0.3);
}

/* ---- chat button (mobile only; sits just above the boost button) ---- */
#chat-btn { display: none; }
body.touch.playing #chat-btn {
    display: flex; align-items: center; justify-content: center;
    position: fixed; z-index: 25;
    right: calc(37px + env(safe-area-inset-right, 0px));
    bottom: calc(126px + env(safe-area-inset-bottom, 0px));
    width: 54px; height: 54px; border-radius: 50%;
    color: var(--cyan); cursor: pointer; -webkit-tap-highlight-color: transparent;
    background: radial-gradient(circle at 50% 40%, rgba(111,214,255,0.16), rgba(10,16,32,0.5));
    border: 1.5px solid rgba(111,214,255,0.4);
    box-shadow: 0 0 18px rgba(111,214,255,0.22);
    backdrop-filter: blur(6px); transition: transform .1s, background .1s;
}
#chat-btn .ico { width: 24px; height: 24px; }
#chat-btn:active {
    transform: scale(0.92);
    background: radial-gradient(circle at 50% 40%, rgba(111,214,255,0.34), rgba(20,40,70,0.65));
}

/* Bigger tap targets for the top-bar controls on touch. */
body.touch .icon-btn { padding: 7px; }
body.touch .menu-hint { padding: 7px 11px; }
body.touch #menu input[type=range] { height: 30px; }
/* Bigger, easier teleport target on touch + roomier rows so taps land. */
body.touch .player-row { padding: 9px 8px; }
body.touch .player-row .tp { padding: 9px 15px; font-size: 13px; }
body.touch #players-panel { touch-action: pan-y; }

/* ---- narrow screens (phones): trim the HUD so it never overflows ---- */
@media (max-width: 760px) {
    #topbar { padding: 0 8px; font-size: 11px; }
    #topbar .seg { gap: 9px; }
    .stat .lbl { display: none; }                 /* drop unit labels */
    .stat.sep-l { border-left: none; padding-left: 0; margin-left: 0; }
    .hide-narrow { display: none !important; }     /* anomalies · music · glow · time */
    #radar-wrap { top: 44px; right: 10px; }
    #radar { width: 92px; height: 92px; }
    #radar-label { width: min(190px, 66vw); }
    #chat-input { bottom: 92px; }
    #fact { font-size: 14px; padding: 11px 18px 11px 40px; max-width: 92vw; }
    #chat-log { top: 96px; max-width: 86vw; }
    #players-panel { width: min(250px, 88vw); }
    /* Station panel: stack header items and put the rubric nav on top. */
    .st-header { grid-template-columns: auto 1fr; gap: 14px; padding: 18px; }
    .st-emblem { width: 72px; height: 72px; }
    .st-ident h2 { font-size: 21px; }
    .st-balance { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; gap: 22px; text-align: left; }
    .st-bal { justify-content: flex-start; }
    .st-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .st-nav { flex-direction: row; flex-wrap: wrap; border-right: none; border-bottom: 1px solid var(--line); gap: 4px; padding: 14px; overflow-y: visible; }
    .st-content { padding: 22px; }
    .st-nav-head { width: 100%; }
    .st-nav-item { width: auto; border-left: none; border-radius: 8px; padding: 8px 11px; }
    .st-nav-item.active { border-left: none; }
}
@media (max-width: 600px) {
    #topbar .center { flex: 0 1 auto; }            /* keep the fuel gauge visible */
    #fuel .fuel-bar, #cargo .fuel-bar { width: 64px; }
    #fuel .fuel-lbl, #cargo .fuel-lbl { display: none; }
    #topbar { font-size: 10px; }
    .stat i .ico { width: 12px; height: 12px; }
    .sector, .galaxy, .region { font-size: 11px; }
    .panel h1 { font-size: 26px; letter-spacing: 6px; }
    .panel .sub { font-size: 12px; }
    .menu-head h2 { font-size: 18px; letter-spacing: 4px; }
    .menu-panel { padding: 16px 16px; }
    #fact { font-size: 13px; padding: 10px 16px 10px 36px; }
    #fact::before { left: 16px; font-size: 14px; }
    .guide-center h2 { font-size: 22px; letter-spacing: 5px; }
    .guide-center p { font-size: 12px; }
    .chat-msg { font-size: 11px; }
    /* On phones the language flag + (iOS-flaky) fullscreen just crowd the bar;
       language still lives in the menu. Keeps menu + exit always reachable. */
    body.touch #lang-flag, body.touch #fullscreen-btn { display: none; }
}

/* Keep the top cluster clear of the notch / Dynamic Island (env() is 0 on
   devices without one, so this is inert on desktop). Placed last so it wins
   over the base top: values above. */
#radar-wrap { top: calc(48px + env(safe-area-inset-top, 0px)); right: calc(14px + env(safe-area-inset-right, 0px)); }
#buffs { top: calc(46px + env(safe-area-inset-top, 0px)); }
#fact  { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
#chat-log { top: calc(112px + env(safe-area-inset-top, 0px)); }
