/* SR Mix: the new thin panel (OpenFor colours). The canvas hides its own bottom panels while this is on. */
#mixhud {
  --panel: rgba(9, 16, 32, .93);
  --glass: linear-gradient(180deg, rgba(150, 200, 255, .14), rgba(40, 80, 150, .08) 38%, rgba(4, 10, 24, .3));
  --line: #1f4a78; --edge: rgba(150, 205, 255, .38); --acc: #5fd0ff; --text: #d7e6fa; --dim: #7d93b5;
  --good: #6fe39a; --bad: #ff6b5e; --warn: #ffc65c; --barH: 34px;
  position: fixed; inset: 0; pointer-events: none; z-index: 60; display: none;
  font: 13px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text);
  user-select: none; -webkit-user-select: none;
}
#mixhud.on { display: block; }
#mixhud * { box-sizing: border-box; }
#mixhud .ic { width: 20px; height: 20px; background: currentColor; -webkit-mask: var(--m) center/contain no-repeat; mask: var(--m) center/contain no-repeat; flex: none; }

/* ---- the thin bottom bar ---- */
#hb-bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--barH); pointer-events: auto;
  display: flex; align-items: center; gap: 6px; padding: 0 8px;
  background: linear-gradient(rgba(12, 22, 40, .86), rgba(4, 8, 18, .96)); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 24px rgba(0, 0, 0, .45);
}
#hb-bar::before { content: ''; position: absolute; left: 0; right: 0; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, rgba(95, 208, 255, .75), transparent); }
/* hull and force field: a thin line ABOVE the bar */
#hb-hp { position: absolute; left: 8px; width: 25%; bottom: calc(var(--barH) + 2px); height: 4px; display: flex; background: rgba(4, 8, 18, .75); border-radius: 2px; overflow: hidden; pointer-events: auto; box-shadow: 0 0 0 1px rgba(31, 74, 120, .8); }
#hb-hp i { display: block; height: 100%; transition: width .4s ease; }
#hb-hp .hull { background: linear-gradient(90deg, #3fbf6c, var(--good)); box-shadow: 0 0 6px rgba(111, 227, 154, .6); }
#hb-hp .hull.low { background: linear-gradient(90deg, #c0392b, var(--bad)); box-shadow: 0 0 6px rgba(255, 107, 94, .7); }
#hb-hp .shield { background: repeating-linear-gradient(135deg, #3d7bff 0 4px, #6aa6ff 4px 7px); box-shadow: 0 0 6px rgba(95, 160, 255, .6); }

#mixhud .hb-btn {
  height: 26px; min-width: 26px; padding: 0 8px; border-radius: 7px; border: 1px solid var(--line); color: var(--acc);
  background: linear-gradient(#1a3558, #0f2038); display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(140, 200, 255, .18); font: inherit; transition: border-color .15s, transform .15s, background .15s;
}
#mixhud .hb-btn:hover { border-color: var(--acc); background: linear-gradient(#21436c, #12284a); }
#mixhud .hb-btn:active { transform: scale(.95); }
#mixhud .hb-btn.off { color: var(--dim); opacity: .55; }
#mixhud .hb-btn.lit { color: #fff; border-color: var(--acc); box-shadow: 0 0 10px rgba(95, 208, 255, .45), inset 0 1px 0 rgba(255, 255, 255, .25); }
#mixhud .hb-btn span { color: var(--text); font-size: 12px; }
#hb-msg { flex: 1; min-width: 0; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8px; font-size: 12px; }
#hb-msg.fresh { color: var(--text); }
.hb-stat { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px; border-radius: 7px; border: 1px solid rgba(31, 74, 120, .6); background: rgba(10, 22, 46, .55); white-space: nowrap; }
.hb-stat .ic { width: 16px; height: 16px; color: var(--acc); }
.hb-stat b { font-weight: 600; font-variant-numeric: tabular-nums; }
.hb-stat em { font-style: normal; color: var(--dim); font-size: 11px; }
.hb-stat.na { opacity: .55; }
.hb-stat.warn b { color: var(--warn); }

/* ---- the movable action panel ---- */
#hb-act {
  position: absolute; pointer-events: auto; display: flex; align-items: center; gap: 4px; padding: 4px;
  background: var(--glass), var(--panel); border: 1px solid var(--edge); border-radius: 10px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .22), 0 0 18px rgba(60, 150, 255, .15);
  transition: left .25s cubic-bezier(.2, 1, .3, 1), top .25s cubic-bezier(.2, 1, .3, 1), right .25s, bottom .25s;
}
#hb-act.vert { flex-direction: column; }
#hb-act.dragging { transition: none; opacity: .9; }
#hb-act .grip { width: 14px; height: 40px; cursor: grab; border-radius: 4px; background: radial-gradient(circle, var(--dim) 1.2px, transparent 1.7px) 0 0/6px 6px; opacity: .75; }
#hb-act.vert .grip { width: 40px; height: 14px; }
#hb-act .sep { width: 1px; height: 40px; background: var(--line); margin: 0 3px; }
#hb-act.vert .sep { width: 40px; height: 1px; margin: 3px 0; }
#hb-act .hb-btn { width: 50px; height: 50px; padding: 0; justify-content: center; border-radius: 10px; }
#hb-act .hb-btn .ic { width: 32px; height: 32px; }
#hb-act .tools { display: flex; flex-direction: column; gap: 3px; }
#hb-act.vert .tools { flex-direction: row; }
#hb-act .tool { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--line); background: #0f2038; color: var(--dim); font-size: 11px; line-height: 14px; text-align: center; cursor: pointer; padding: 0; }
#hb-act .tool:hover { color: var(--acc); border-color: var(--acc); }
#hb-act.rev, #hb-act.rev .grp { flex-direction: row-reverse; }
#hb-act.vert.rev, #hb-act.vert.rev .grp { flex-direction: column-reverse; }
/* the afterburner burns red while on */
#mixhud .hb-btn.burn { color: #fff; border-color: #ff6b5e; background: linear-gradient(#5a1a14, #2a0c0a); animation: hbburn .9s ease-in-out infinite; }
#mixhud .hb-btn.burn .ic { color: #ffd2c8; filter: drop-shadow(0 0 6px #ff5a3c); }
@keyframes hbburn { 0%, 100% { box-shadow: 0 0 8px rgba(255, 90, 60, .55), inset 0 0 6px rgba(255, 120, 60, .4); } 50% { box-shadow: 0 0 22px rgba(255, 70, 40, .95), inset 0 0 14px rgba(255, 160, 80, .7); } }
#hb-act .grp { display: flex; gap: 4px; }
#hb-act.vert .grp { flex-direction: column; }
#hb-act .hook { position: relative; }
#hb-act .hook::after { content: ''; position: absolute; right: 2px; bottom: 2px; border: 4px solid transparent; border-right-color: var(--acc); border-bottom-color: var(--acc); }

/* the weapons fly-out (original weapon pictures) */
#hb-weap { position: absolute; pointer-events: auto; display: none; gap: 4px; padding: 5px; background: var(--glass), var(--panel); border: 1px solid var(--edge); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
#hb-weap.open { display: flex; animation: hbpop .18s cubic-bezier(.2, 1.3, .4, 1); }
#hb-weap.vert { flex-direction: column; }
#hb-weap .w { width: 54px; height: 54px; border-radius: 8px; border: 1px solid var(--line); background: rgba(10, 22, 46, .7); display: grid; place-items: center; cursor: pointer; position: relative; }
#hb-weap .w img { max-width: 48px; max-height: 48px; image-rendering: auto; }
#hb-weap .w.sel { border-color: var(--warn); box-shadow: 0 0 10px rgba(255, 198, 92, .5); }
#hb-weap .w.aim::after { content: ''; position: absolute; inset: 3px; border-radius: 6px; border: 1px dashed var(--bad); }
#hb-weap .w.empty { opacity: .35; cursor: default; }
#hb-weap .w b { position: absolute; left: 3px; top: 1px; font-size: 10px; color: var(--dim); }

/* tooltip */
#hb-tip { position: absolute; pointer-events: none; padding: 4px 8px; border-radius: 6px; background: rgba(4, 8, 18, .95); border: 1px solid var(--line); color: var(--text); font-size: 12px; white-space: nowrap; opacity: 0; transition: opacity .12s; }
#hb-tip.on { opacity: 1; }
#hb-tip small { color: var(--dim); }

/* toast */
#hb-toast { position: absolute; left: 50%; bottom: calc(var(--barH) + 14px); transform: translateX(-50%); padding: 6px 14px; border-radius: 8px; background: var(--glass), var(--panel); border: 1px solid var(--edge); opacity: 0; transition: opacity .2s; pointer-events: none; }
#hb-toast.on { opacity: 1; }

/* dock targets shown while dragging */
.hb-dock { position: absolute; border: 1px dashed rgba(95, 208, 255, .5); border-radius: 10px; background: rgba(95, 208, 255, .06); display: none; }
#mixhud.dragmode .hb-dock { display: block; }
.hb-dock.near { background: rgba(95, 208, 255, .18); border-color: var(--acc); }

@keyframes hbpop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }

/* the new main menu (over the original one, which stays one F2 away) */
#mixmenu { position: absolute; inset: 0; pointer-events: auto; display: none; background: #02040a url(/hud/menu_bg.jpg) center/cover no-repeat; }
#mixhud.menu #mixmenu { display: block; }
#mixmenu::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(2, 4, 10, .88) 0%, rgba(2, 4, 10, .55) 34%, transparent 62%); }
#mixmenu .box { position: absolute; left: 7vw; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 14px; width: min(360px, 80vw); animation: hbpop .5s cubic-bezier(.2, 1.1, .3, 1); }
#mixmenu h1 { margin: 0 0 4px; font: 700 34px/1.1 system-ui, sans-serif; letter-spacing: .04em; color: #e9f4ff; text-shadow: 0 0 24px rgba(95, 208, 255, .55); }
#mixmenu h2 { margin: 0 0 22px; font: 500 14px system-ui, sans-serif; letter-spacing: .3em; text-transform: uppercase; color: var(--acc); }
#mixmenu button { position: relative; text-align: left; height: 56px; padding: 0 22px; border-radius: 12px; border: 1px solid rgba(150, 205, 255, .35); cursor: pointer; overflow: hidden;
  font: 600 17px system-ui, sans-serif; letter-spacing: .05em; color: #d7e6fa; background: linear-gradient(180deg, rgba(150, 200, 255, .12), rgba(40, 80, 150, .05) 40%, rgba(4, 10, 24, .3)), rgba(9, 16, 32, .82);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .18); transition: transform .2s cubic-bezier(.2, 1.3, .4, 1), border-color .2s, box-shadow .2s, padding-left .2s; }
#mixmenu button:hover { transform: translateX(8px); padding-left: 30px; border-color: var(--acc); box-shadow: 0 12px 34px rgba(0, 0, 0, .5), 0 0 20px rgba(95, 208, 255, .35); }
#mixmenu button::after { content: ''; position: absolute; left: -40%; top: 0; width: 30%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .16), transparent); transform: skewX(-20deg); transition: left .6s; }
#mixmenu button:hover::after { left: 120%; }
#mixmenu button.main { border-color: rgba(111, 227, 154, .6); }
#mixmenu small { color: var(--dim); font-size: 12px; margin-top: 14px; }

/* the talk in the corner and the live scan (the game keeps running) */
#hb-chat, #hb-scan, #hb-wreck { position: absolute; pointer-events: auto; display: none; flex-direction: column; border-radius: 14px; border: 1px solid rgba(120, 190, 255, .35);
  background: linear-gradient(180deg, rgba(150, 200, 255, .10), rgba(4, 10, 24, .3)), rgba(7, 14, 30, .9); box-shadow: 0 16px 44px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .14);
  backdrop-filter: blur(6px); color: #d7e6fa; font: 13px/1.4 system-ui, sans-serif; animation: hbpop .3s cubic-bezier(.2, 1.1, .3, 1); }
#hb-chat.open, #hb-scan.open, #hb-wreck.open { display: flex; }
#hb-chat { left: 14px; bottom: 50px; width: min(380px, 90vw); max-height: 46vh; }
#hb-chat.hostile { border-color: rgba(255, 107, 94, .5); }
#hb-chat header, #hb-scan header, #hb-wreck header { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid rgba(95, 208, 255, .15); }
#hb-chat header .ic, #hb-scan header .ic { width: 18px; height: 18px; }
#hb-chat header b, #hb-scan header b, #hb-wreck header b { flex: 1; color: #e9f4ff; font-size: 14px; }
#hb-chat header em { font-style: normal; font-size: 11px; color: var(--acc); }
#hb-chat.hostile header em { color: #ff6b5e; }
/* close cross: drawn by two bars (a font's × sits off-centre), a big hit area */
.x { position: relative; flex: none; width: 28px; height: 28px; padding: 0; border-radius: 8px; border: 1px solid #1f4a78; background: rgba(10, 22, 46, .75); color: transparent; cursor: pointer; font-size: 0; transition: border-color .15s, background .15s, transform .15s; z-index: 2; }
.x::before, .x::after { content: ''; position: absolute; left: 50%; top: 50%; width: 14px; height: 2px; border-radius: 1px; background: #9fb3cf; transform: translate(-50%, -50%) rotate(45deg); transition: background .15s; }
.x::after { transform: translate(-50%, -50%) rotate(-45deg); }
.x:hover { border-color: #ff6b5e; background: rgba(80, 20, 20, .6); animation: xpulse 1s ease-in-out infinite; }
@keyframes xpulse { 0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 107, 94, .55); } 50% { transform: scale(1.1); box-shadow: 0 0 0 7px rgba(255, 107, 94, 0); } }
.x:hover::before, .x:hover::after { background: #fff; }
/* a threat or a law claim arrives: the chat shakes / flashes like a police light */
#hb-chat.alert-threat { border-color: #ff6b5e; animation: hbshake .5s 2, hbred 1.2s ease-in-out infinite; }
#hb-chat.alert-law { border-color: #5fb0ff; animation: hbshake .5s 1, hbpolice 1s linear infinite; }
#hb-chat.alert-threat header em, #hb-chat.alert-law header em { font-weight: 700; letter-spacing: .08em; }
#hb-chat .log p.new { animation: hbin .35s cubic-bezier(.2, 1.2, .3, 1); }
#hb-chat .opts .pay { border-color: #6fe39a; } #hb-chat .opts .refuse { border-color: #ff6b5e; }
@keyframes hbshake { 0%,100% { transform: translateX(0) } 20% { transform: translateX(-7px) } 40% { transform: translateX(6px) } 60% { transform: translateX(-4px) } 80% { transform: translateX(3px) } }
@keyframes hbred { 0%,100% { box-shadow: 0 0 0 rgba(255, 70, 60, 0) } 50% { box-shadow: 0 0 26px rgba(255, 70, 60, .55) } }
@keyframes hbpolice { 0%,49% { box-shadow: -10px 0 26px rgba(255, 60, 60, .55) } 50%,100% { box-shadow: 10px 0 26px rgba(70, 140, 255, .6) } }
@keyframes hbin { from { opacity: 0; transform: translateY(8px) scale(.96) } to { opacity: 1; transform: none } }
#hb-chat .log { flex: 1; overflow: auto; padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; min-height: 80px; }
#hb-chat .log p { margin: 0; }
#hb-chat .log .me { color: #bfe9ff; align-self: flex-end; text-align: right; background: rgba(95, 208, 255, .1); padding: 4px 8px; border-radius: 10px 10px 2px 10px; max-width: 85%; }
#hb-chat .log .them { background: rgba(255, 255, 255, .05); padding: 4px 8px; border-radius: 10px 10px 10px 2px; max-width: 85%; }
#hb-chat .log b { color: #ffc65c; font-weight: 600; }
.sys { color: #7d93b5; font-size: 12px; margin: 0; }
#hb-chat .opts { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 10px; }
#hb-chat .opts button { border: 1px solid #1f4a78; background: linear-gradient(#1a3558, #0f2038); color: #d7e6fa; border-radius: 8px; padding: 5px 9px; font: 12px system-ui; cursor: pointer; }
#hb-chat .opts button:hover { border-color: var(--acc); }
#hb-chat .say { display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid rgba(95, 208, 255, .12); }
#hb-chat .say input { flex: 1; height: 30px; border-radius: 8px; border: 1px solid #1f4a78; background: rgba(3, 8, 18, .8); color: #e9f4ff; padding: 0 10px; font: 13px system-ui; outline: none; }
#hb-chat .say input:focus { border-color: var(--acc); }
#hb-chat .say button { width: 36px; border-radius: 8px; border: 1px solid #1f4a78; background: #12305a; color: #9fd8ff; cursor: pointer; }
#hb-scan { right: 14px; top: 250px; width: min(320px, 90vw); max-height: 60vh; }
#hb-scan .body { overflow: auto; padding: 10px 12px; }
#hb-scan .meta { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
#hb-scan .meta span { font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid #1f4a78; color: #9fb3cf; }
#hb-scan .meta .bad { border-color: #ff6b5e; color: #ff6b5e; } #hb-scan .meta .ok { border-color: #3fbf6c; color: #6fe39a; }
#hb-scan .row { display: flex; justify-content: space-between; font-size: 12px; color: #7d93b5; margin: 4px 0; } #hb-scan .row b { color: #d7e6fa; }
#hb-scan .bar { height: 5px; border-radius: 3px; background: rgba(4, 8, 18, .8); overflow: hidden; } #hb-scan .bar i { display: block; height: 100%; background: linear-gradient(90deg, #3fbf6c, #6fe39a); }
#hb-scan h4 { margin: 10px 0 6px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #5f7aa0; }
#hb-scan .chips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
#hb-scan .chip { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 9px; background: rgba(3, 8, 18, .55); border: 1px solid #17365a; font-size: 11px; }
#hb-scan .chip img { width: 28px; height: 28px; object-fit: contain; }
#hb-scan .chip span { flex: 1; color: #9fb3cf; } #hb-scan .chip b { color: #ffc65c; }

#hb-chat .near { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 9px; background: rgba(255, 255, 255, .04); }
#hb-chat .near b { flex: 1; color: #e9f4ff; font-weight: 600; } #hb-chat .near.bad b { color: #ff9a8a; } #hb-chat .near span { color: #7d93b5; font-size: 11px; }
#hb-chat .near button { border: 1px solid #1f4a78; background: #12305a; color: #d7e6fa; border-radius: 7px; padding: 3px 8px; font: 11px system-ui; cursor: pointer; }
#hb-chat .near button:hover { border-color: var(--acc); }

/* ---- the in-game menu: a glass panel like the inventory's, buttons rise one after another ---- */
#gmenu { position: absolute; inset: 0; display: none; pointer-events: auto; background: radial-gradient(ellipse at center, rgba(4, 10, 22, .55), rgba(2, 5, 12, .92)), url(/hud/menu_bg.jpg) center/cover no-repeat; }
#gmenu::before { content: ''; position: absolute; inset: 0; backdrop-filter: blur(6px); }
#mixhud.gmenu #gmenu { display: grid; place-items: center; animation: hbfade .18s ease-out; }
#mixhud.gmenu #hb-act, #mixhud.gmenu #hb-weap, #mixhud.gmenu #hb-chat, #mixhud.gmenu #hb-scan { display: none !important; }
.glass-hud { position: relative; border-radius: 18px; border: 1px solid rgba(120, 190, 255, .35); background: linear-gradient(160deg, rgba(18, 40, 72, .82), rgba(6, 14, 30, .9)); box-shadow: 0 30px 80px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .08); }
.glass-hud .br { position: absolute; width: 16px; height: 16px; border: 2px solid var(--acc); opacity: .8; }
.glass-hud .tl { left: -2px; top: -2px; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.glass-hud .tr { right: -2px; top: -2px; border-left: 0; border-bottom: 0; border-radius: 0 6px 0 0; }
.glass-hud .bl { left: -2px; bottom: -2px; border-right: 0; border-top: 0; border-radius: 0 0 0 6px; }
.glass-hud .br2 { right: -2px; bottom: -2px; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }
#gmenu .gm { width: min(380px, 88vw); padding: 26px 24px 22px; display: flex; flex-direction: column; gap: 10px; animation: hbpop .32s cubic-bezier(.2, 1.15, .3, 1); }
#gmenu h3 { margin: 0; font: 700 22px system-ui, sans-serif; letter-spacing: .18em; text-transform: uppercase; color: #e9f4ff; text-shadow: 0 0 18px rgba(95, 208, 255, .5); }
#gmenu .live { margin: 0 0 10px; font-size: 12px; color: var(--dim); display: flex; align-items: center; gap: 8px; }
#gmenu .live i { width: 8px; height: 8px; border-radius: 50%; background: #6fe39a; box-shadow: 0 0 8px #6fe39a; animation: hbblink 1.2s ease-in-out infinite; }
#gmenu button { position: relative; display: flex; align-items: center; gap: 12px; height: 50px; padding: 0 16px; border-radius: 12px; border: 1px solid rgba(150, 205, 255, .28); background: linear-gradient(90deg, rgba(26, 53, 88, .85), rgba(12, 26, 46, .7)); color: #e3efff; font: 600 15px system-ui, sans-serif; letter-spacing: .04em; cursor: pointer; overflow: hidden; opacity: 0; animation: hbrise .3s cubic-bezier(.2, 1.1, .3, 1) forwards; animation-delay: calc(var(--i) * 45ms + 60ms); transition: transform .15s, border-color .15s, box-shadow .15s, padding .15s; }
#gmenu button .ic { width: 20px; height: 20px; }
#gmenu button kbd, #gmenu button small { margin-left: auto; font: 11px system-ui; color: var(--dim); }
#gmenu button:hover { transform: translateX(6px); padding-left: 22px; border-color: var(--acc); box-shadow: 0 0 22px rgba(95, 208, 255, .3); }
#gmenu button::after { content: ''; position: absolute; left: -40%; top: 0; width: 30%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .14), transparent); transform: skewX(-20deg); transition: left .5s; }
#gmenu button:hover::after { left: 120%; }
#gmenu button.exit:hover { border-color: #ff6b5e; box-shadow: 0 0 22px rgba(255, 107, 94, .3); }
#hb-help { position: absolute; inset: 0; display: none; pointer-events: auto; place-items: center; background: rgba(2, 5, 12, .55); z-index: 5; }
#mixhud.help #hb-help { display: grid; animation: hbfade .15s; }
#hb-help .hp { width: min(620px, 92vw); max-height: 80vh; display: flex; flex-direction: column; animation: hbpop .28s cubic-bezier(.2, 1.15, .3, 1); }
#hb-help header { display: flex; align-items: center; padding: 12px 14px; border-bottom: 1px solid rgba(95, 208, 255, .15); }
#hb-help header b { flex: 1; font-size: 16px; letter-spacing: .1em; text-transform: uppercase; color: #e9f4ff; }
#hb-help .body { overflow: auto; padding: 6px 18px 16px; color: #c8d8ee; font-size: 13px; line-height: 1.55; }
#hb-help h4 { margin: 14px 0 4px; color: var(--acc); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
#hb-help p { margin: 0 0 4px; } #hb-help kbd, #gmenu kbd { padding: 1px 6px; border-radius: 5px; border: 1px solid #2a5584; background: rgba(10, 24, 46, .8); font: 11px system-ui; color: #d7e6fa; }
@keyframes hbfade { from { opacity: 0 } to { opacity: 1 } }
@keyframes hbrise { from { opacity: 0; transform: translateY(12px) } to { opacity: 1; transform: none } }
@keyframes hbblink { 50% { opacity: .35 } }

/* ---- the post-mortem screen ---- */
#hb-death { position: absolute; inset: 0; display: none; pointer-events: auto; background: #02040a url(/hud/bg/death.webp) center/cover no-repeat; }
#mixhud.dead #hb-death { display: block; animation: hbdeath 1.6s ease-out; }
#mixhud.dead #hb-bar, #mixhud.dead #hb-act, #mixhud.dead #hb-hp, #mixhud.dead #hb-weap, #mixhud.dead #hb-chat, #mixhud.dead #hb-scan { display: none !important; }
#hb-death::before { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(2, 4, 10, .95) 0%, rgba(2, 4, 10, .5) 45%, rgba(40, 6, 6, .25) 100%); }
#hb-death .dz { position: absolute; left: 50%; bottom: 7vh; transform: translateX(-50%); width: min(720px, 92vw); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; }
#hb-death h2 { margin: 0; font: 800 clamp(26px, 4vw, 46px) system-ui, sans-serif; letter-spacing: .22em; text-transform: uppercase; color: #ffd7d0; text-shadow: 0 0 30px rgba(255, 80, 60, .7); animation: hbrise .8s .4s both; }
#hb-death .txt { max-height: 30vh; overflow: auto; white-space: pre-wrap; color: #c9d6ea; font-size: 14px; line-height: 1.55; animation: hbrise .8s .8s both; }
#hb-death button { position: relative; height: 54px; padding: 0 34px; border-radius: 27px; border: 1px solid rgba(255, 140, 120, .6); background: linear-gradient(90deg, rgba(90, 20, 20, .85), rgba(30, 10, 14, .85)); color: #ffe9e4; font: 700 15px system-ui; letter-spacing: .12em; text-transform: uppercase; cursor: pointer; overflow: hidden; animation: hbrise .6s 1.2s both; transition: transform .15s, box-shadow .2s; }
#hb-death button::before { content: ''; position: absolute; inset: -2px; border-radius: inherit; box-shadow: 0 0 0 0 rgba(255, 107, 94, .6); animation: hbring 2s 2s infinite; }
#hb-death button:hover { transform: scale(1.05); box-shadow: 0 0 30px rgba(255, 107, 94, .5); }
@keyframes hbdeath { 0% { filter: brightness(3) saturate(0); } 30% { filter: brightness(1.4); } 100% { filter: none; } }
@keyframes hbring { 0% { box-shadow: 0 0 0 0 rgba(255, 107, 94, .55); } 100% { box-shadow: 0 0 0 18px rgba(255, 107, 94, 0); } }

#hb-temp.hot b { color: #ffb070; } #hb-temp.cold b { color: #8fd0ff; }
#hb-ctx [data-act="heat"] { width: 30px; min-width: 30px; height: 30px; align-self: center; margin-left: -4px; opacity: .85; }
#hb-ctx [data-act="heat"] .ic { width: 16px; height: 16px; }

#hb-wreck { right: 14px; top: 270px; width: min(360px, 92vw); max-height: 60vh; border-color: rgba(230, 170, 90, .55); background: linear-gradient(160deg, rgba(40, 28, 12, .92), rgba(10, 10, 18, .94)); color: #e8dcc8; font: 13px system-ui; }
#hb-wreck .body { padding: 10px 12px; overflow: auto; }
#hb-wreck .meta { display: flex; gap: 10px; color: #c9a777; font-size: 12px; margin-bottom: 6px; }
#hb-wreck p.ok { color: #6fe39a; margin: 6px 0; } #hb-wreck p.bad { color: #ffb08a; margin: 6px 0; } #hb-wreck p.sys { color: #a99; }
#hb-wreck h4 { margin: 10px 0 4px; color: #ffc65c; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
#hb-wreck .chips { display: flex; flex-direction: column; gap: 4px; }
#hb-wreck .chip { display: grid; grid-template-columns: 30px 1fr auto auto; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 8px; background: rgba(255, 255, 255, .05); }
#hb-wreck .chip img { width: 28px; height: 28px; object-fit: contain; }
#hb-wreck .chip button, #hb-wreck .wbtn { border: 1px solid #c98a3a; background: rgba(80, 50, 16, .8); color: #ffe2c4; border-radius: 7px; padding: 4px 9px; cursor: pointer; font: 600 12px system-ui; }
#hb-wreck button:disabled { opacity: .4; cursor: default; }
#hb-wreck .wrow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
#hb-wreck .chip > i { display: block; width: 28px; height: 28px; border-radius: 6px; background: rgba(255, 198, 92, .12); }

/* ---- Mix: the hover window (a ship, a planet, the star, a gate) in the panel's style ---- */
#hb-hover { position: fixed; display: none; pointer-events: none; z-index: 30; max-width: 320px; padding: 9px 12px; border-radius: 12px; border: 1px solid rgba(120, 190, 255, .4);
  background: linear-gradient(160deg, rgba(18, 40, 72, .92), rgba(6, 14, 30, .94)); color: #d7e6fa; font: 12px/1.45 system-ui; box-shadow: 0 10px 28px rgba(0, 0, 0, .5); }
#hb-hover.on { display: block; }
#hb-hover b { display: block; color: #fff; font-size: 13px; margin-bottom: 4px; letter-spacing: .03em; }
#hb-hover .kv { display: flex; justify-content: space-between; gap: 14px; }
#hb-hover .kv span { color: #8fb0d8; } #hb-hover .kv em { font-style: normal; color: #e9f4ff; text-align: right; }
#hb-hover p { margin: 2px 0; color: #c8d8ee; }

/* ---- Mix: the new game (character creation) ---- */
#hb-newgame { position: fixed; inset: 0; display: none; pointer-events: auto; z-index: 40; background: radial-gradient(ellipse at 50% 40%, rgba(10, 30, 60, .35), rgba(2, 4, 10, .85)), url(/hud/menu_bg.jpg) center/cover; }
#mixhud.ngame #hb-newgame { display: grid; place-items: center; }
#hb-newgame .ng { position: relative; width: min(1180px, 96vw); max-height: 96vh; overflow: visible; display: grid; grid-template-columns: 1fr 1.05fr 1.1fr; grid-template-rows: auto 1fr auto; gap: 14px 22px; padding: 20px 24px;
  border-radius: 18px; border: 1px solid rgba(120, 190, 255, .35); background: linear-gradient(160deg, rgba(14, 32, 60, .9), rgba(5, 10, 24, .93)); box-shadow: 0 24px 60px rgba(0, 0, 0, .6); color: #d7e6fa; font: 13px system-ui; backdrop-filter: blur(6px); }
#hb-newgame header { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 14px; }
#hb-newgame header h2 { margin: 0; font: 700 24px system-ui; color: #fff; letter-spacing: .04em; } #hb-newgame header span { color: #7d93b5; text-transform: uppercase; letter-spacing: .14em; font-size: 11px; }
#hb-newgame h4 { margin: 4px 0 8px; color: #5fd0ff; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; display: flex; justify-content: space-between; }
#hb-newgame .ng-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
#hb-newgame .ng-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px; border-radius: 12px; border: 1px solid #1f4a78; background: linear-gradient(180deg, rgba(26, 53, 88, .7), rgba(10, 22, 40, .85)); color: #c8d8ee; cursor: pointer; font: 600 12px system-ui; transition: border-color .15s, box-shadow .15s, transform .15s; }
#hb-newgame .ng-card:hover { border-color: #5fd0ff; transform: translateY(-1px); }
#hb-newgame .ng-card.on { border-color: #6fe39a; box-shadow: 0 0 0 1px #6fe39a, 0 0 18px rgba(111, 227, 154, .35); color: #fff; }
#hb-newgame .ng-card .em { width: 44px; height: 44px; display: grid; place-items: center; } #hb-newgame .ng-card .em img { max-width: 44px; max-height: 44px; }
#hb-newgame .ng-card.ch .gl { font-size: 26px; line-height: 44px; color: #ffd166; }
#hb-newgame .ng-c { display: flex; flex-direction: column; align-items: center; gap: 12px; }
#hb-newgame .ng-face { display: flex; align-items: center; gap: 10px; }
#hb-newgame .ng-port { width: 190px; height: 190px; border-radius: 16px; border: 1px solid rgba(120, 190, 255, .45); background: radial-gradient(circle at 50% 35%, rgba(60, 120, 190, .35), rgba(4, 10, 24, .9)); display: grid; place-items: center; overflow: hidden; box-shadow: inset 0 0 30px rgba(0, 0, 0, .6); }
#hb-newgame .ng-port img { width: 100%; height: 100%; object-fit: contain; }
#hb-newgame .ng-arr { width: 38px; height: 80px; border-radius: 12px; border: 1px solid #1f4a78; background: rgba(10, 24, 46, .85); color: #cfe3ff; font: 28px system-ui; cursor: pointer; } #hb-newgame .ng-arr:hover { border-color: #5fd0ff; }
#hb-newgame .ng-name { display: flex; align-items: center; gap: 8px; width: 100%; } #hb-newgame .ng-name span { color: #7d93b5; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
#hb-newgame .ng-name input { flex: 1; min-width: 0; padding: 9px 12px; border-radius: 10px; border: 1px solid #1f4a78; background: rgba(4, 10, 24, .8); color: #ffd166; font: 600 16px system-ui; outline: none; } #hb-newgame .ng-name input:focus { border-color: #5fd0ff; }
#hb-newgame .ng-name button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid #1f4a78; background: rgba(10, 24, 46, .85); cursor: pointer; font-size: 18px; }
#hb-newgame .ng-desc { margin: 0; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .04); color: #c8d8ee; line-height: 1.5; min-height: 72px; }
#hb-newgame .ng-presets { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
#hb-newgame .ng-lv { padding: 7px 4px; border-radius: 9px; border: 1px solid #1f4a78; background: rgba(10, 24, 46, .85); color: #c8d8ee; font: 600 11px system-ui; cursor: pointer; } #hb-newgame .ng-lv.on { border-color: #6fe39a; color: #fff; box-shadow: 0 0 12px rgba(111, 227, 154, .3); }
#hb-newgame .ng-groups { display: none; margin-top: 8px; } #hb-newgame .ng-diff.open .ng-groups { display: block; }
#hb-newgame .ng-grp { display: grid; grid-template-columns: 1.2fr repeat(4, 1fr); gap: 4px; align-items: center; margin: 3px 0; font-size: 11px; }
#hb-newgame .ng-grp span { color: #8fb0d8; } #hb-newgame .ng-grp button { padding: 4px 2px; border-radius: 7px; border: 1px solid #1f4a78; background: rgba(10, 24, 46, .8); color: #b8c8de; font: 11px system-ui; cursor: pointer; } #hb-newgame .ng-grp button.on { border-color: #ffd166; color: #fff; }
#hb-newgame .ng-sub { color: #7d93b5; font-size: 11px; margin: 8px 0 5px; }
#hb-newgame .ng-icons { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
#hb-newgame .ng-ic { aspect-ratio: 1; border-radius: 10px; border: 1px solid #1f4a78; background: linear-gradient(180deg, rgba(40, 90, 150, .45), rgba(6, 24, 52, .9)); cursor: pointer; display: grid; place-items: center; padding: 3px; }
#hb-newgame .ng-ic img { max-width: 100%; max-height: 100%; object-fit: contain; } #hb-newgame .ng-ic.on { border-color: #6fe39a; box-shadow: 0 0 0 1px #6fe39a, 0 0 14px rgba(111, 227, 154, .4); } #hb-newgame .ng-ic:hover { border-color: #5fd0ff; }
#hb-newgame footer { grid-column: 1 / -1; display: flex; justify-content: space-between; margin-top: 4px; }
#hb-newgame .ng-btn { padding: 11px 22px; border-radius: 12px; border: 1px solid #1f4a78; background: rgba(10, 24, 46, .9); color: #d7e6fa; font: 700 14px system-ui; cursor: pointer; letter-spacing: .04em; }
#hb-newgame .ng-btn.pri { border-color: #6fe39a; background: linear-gradient(180deg, rgba(30, 90, 60, .9), rgba(10, 40, 26, .95)); color: #fff; } #hb-newgame .ng-btn:disabled { opacity: .4; cursor: default; }
#hb-newgame .br { position: absolute; width: 14px; height: 14px; border: 2px solid rgba(95, 208, 255, .6); }

/* ---- Mix: the settings ---- */
#hb-cfg { position: fixed; inset: 0; display: none; pointer-events: auto; z-index: 45; background: rgba(2, 4, 10, .6); backdrop-filter: blur(4px); }
#mixhud.cfgon #hb-cfg { display: grid; place-items: center; }
#hb-cfg .cf { width: min(620px, 94vw); max-height: 88vh; display: flex; flex-direction: column; border-radius: 16px; border: 1px solid rgba(120, 190, 255, .4); background: linear-gradient(160deg, rgba(16, 36, 66, .95), rgba(6, 12, 26, .96)); color: #d7e6fa; font: 13px system-ui; }
#hb-cfg header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid rgba(95, 208, 255, .15); } #hb-cfg header b { font-size: 17px; color: #fff; }
#hb-cfg .body { padding: 6px 16px 12px; overflow: auto; }
#hb-cfg h4 { margin: 12px 0 6px; color: #5fd0ff; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
#hb-cfg .cf-row { display: grid; grid-template-columns: 1fr 1.2fr; gap: 12px; align-items: center; padding: 7px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); }
#hb-cfg .cf-row span { color: #c8d8ee; } #hb-cfg input[type=range] { width: 100%; accent-color: #5fd0ff; }
#hb-cfg .cf-seg { display: flex; flex-wrap: wrap; gap: 4px; } #hb-cfg .cf-seg button { padding: 6px 10px; border-radius: 8px; border: 1px solid #1f4a78; background: rgba(10, 24, 46, .85); color: #c8d8ee; cursor: pointer; font: 12px system-ui; } #hb-cfg .cf-seg button.on { border-color: #6fe39a; color: #fff; }
#hb-cfg footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid rgba(95, 208, 255, .15); }
#hb-cfg footer button { padding: 9px 18px; border-radius: 10px; border: 1px solid #1f4a78; background: rgba(10, 24, 46, .9); color: #d7e6fa; font: 600 13px system-ui; cursor: pointer; } #hb-cfg footer .pri { border-color: #6fe39a; }

/* Mix: how-to hints live in the tutorial */
.howto{display:none!important}

/* Mix: the tutorial */
#hb-tut{position:fixed;inset:0;z-index:70;display:none;pointer-events:none}
#hb-tut.on{display:block}
#hb-tut .tb{position:absolute;left:50%;top:18%;transform:translateX(-50%);width:min(560px,92vw);padding:18px 22px 16px;pointer-events:auto;border-radius:14px;color:#dbe9ff;font:14px/1.5 system-ui;animation:hbfade .2s}
#hb-tut .tb.offer{top:30%}
#hb-tut h3{margin:2px 0 8px;font:700 18px system-ui;color:#eaf4ff;letter-spacing:.3px}
#hb-tut small{color:#7f9cc0;font-size:11px}
#hb-tut p{margin:0 0 12px;color:#c8daf2}
#hb-tut kbd{display:inline-block;padding:0 6px;border-radius:5px;border:1px solid rgba(140,190,255,.4);background:rgba(30,60,100,.55);font:600 12px system-ui;color:#fff}
#hb-tut .dots{display:flex;gap:5px;margin-bottom:12px}
#hb-tut .dots i{width:7px;height:7px;border-radius:50%;background:rgba(140,180,230,.3)}
#hb-tut .dots i.on{background:#6fe3c0}
#hb-tut .tbtn{display:flex;gap:8px;justify-content:flex-end}
#hb-tut button{padding:7px 14px;border-radius:9px;border:1px solid rgba(120,180,255,.35);background:rgba(30,56,92,.7);color:#dbe9ff;font:600 13px system-ui;cursor:pointer}
#hb-tut button:hover{background:rgba(50,90,140,.85)}
#hb-tut button.pri{background:rgba(30,130,100,.8);border-color:rgba(110,230,180,.55);color:#fff}
.tut-hl{outline:2px solid #6fe3c0!important;outline-offset:3px;box-shadow:0 0 18px rgba(111,227,192,.55)!important;animation:tutpulse 1.4s infinite}
@keyframes tutpulse{50%{outline-color:rgba(111,227,192,.35)}}
