/* THE SACKULATOR. Classic dark-glass spaceship UI: smoked translucent panels, hairline frames,
   small-caps headings, cold steel palette over a starfield. */
:root {
  --void: #04070a;
  --glass: rgba(14, 20, 26, 0.80);
  --glass-hi: rgba(26, 35, 44, 0.86);
  --glass-lo: rgba(8, 12, 16, 0.70);
  --frame: rgba(160, 184, 200, 0.24);
  --frame-hi: rgba(200, 222, 236, 0.55);
  --text: #d3dde5;
  --text-2: #93a3b0;
  --text-3: #66747f;
  --steel: #b9cfdd;
  --accent: #e2edf4;
  --you: #8fc9ff;
  --friend: #7fd6a8;
  --hostile: #ff6b5e;
  --cap: #f0c95a;
  --shield: #7fb5ff;
  --armor: #d2a868;
  --hull: #b9bfc6;
  --heat: #ff9447;
  --active: #3f7fb0;
  --font-d: 'Chakra Petch', 'IBM Plex Sans', system-ui, sans-serif;
  --font: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--void); color: var(--text); font: 15px/1.45 var(--font); }
body { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.flex { flex: 1; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.row.tight { margin-top: 0; gap: 6px; }

#stars { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.screen { position: fixed; inset: 0; z-index: 1; }

/* --- type --- */
.title { font: 700 clamp(44px, 7vw, 92px)/0.95 var(--font-d); letter-spacing: 0.14em; margin: 0; color: var(--accent);
  text-shadow: 0 0 1px rgba(255,255,255,0.4); }
.title.small { font-size: 22px; letter-spacing: 0.22em; }
.title-sub { font: 600 15px var(--font-d); letter-spacing: 0.42em; text-transform: uppercase; color: var(--text-2); margin-bottom: 14px; }
h2, h3 { font-family: var(--font-d); font-weight: 600; text-transform: uppercase; letter-spacing: 0.18em; margin: 0 0 10px; color: var(--steel); }
h2 { font-size: 16px; }
h3 { font-size: 13px; color: var(--text-2); }
.hint { color: var(--text-2); margin: 0 0 8px; font-size: 15px; }
.empty { color: var(--text-3); padding: 14px 0; }

/* --- controls --- */
button { background: var(--glass-hi); border: 1px solid var(--frame); padding: 8px 16px; cursor: pointer;
  font: 600 14px var(--font-d); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text); transition: border-color .15s, background .15s, color .15s; }
button:hover { border-color: var(--frame-hi); color: var(--accent); }
button:active { background: rgba(60, 80, 96, 0.9); }
button.primary { background: rgba(40, 70, 92, 0.88); border-color: rgba(143, 201, 255, 0.45); color: var(--accent); }
button.primary:hover { background: rgba(52, 92, 120, 0.95); border-color: var(--you); }
button.ghost { background: transparent; }
button.big { padding: 13px 30px; font-size: 16px; }
button.sm { padding: 4px 10px; font-size: 12px; }
button:disabled { opacity: .45; cursor: default; }
input[type=text], input[type=number], select, textarea { background: var(--glass-lo); border: 1px solid var(--frame); padding: 8px 10px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--frame-hi); }
input[type=number] { width: 84px; }
textarea { width: 100%; resize: vertical; font: 14px/1.4 var(--mono); }
select { padding-right: 24px; }
input[type=range] { accent-color: var(--steel); }
label { color: var(--text-2); display: inline-flex; gap: 8px; align-items: center; }

/* --- panels: smoked glass + hairline frame + small-caps header strip --- */
.panel { background: var(--glass); border: 1px solid var(--frame); padding: 16px 18px 18px; position: relative; backdrop-filter: blur(6px); }
.panel::before { content: ''; position: absolute; left: -1px; top: -1px; width: 18px; height: 18px; border-left: 2px solid var(--frame-hi); border-top: 2px solid var(--frame-hi); pointer-events: none; }
.panel::after { content: ''; position: absolute; right: -1px; bottom: -1px; width: 18px; height: 18px; border-right: 2px solid var(--frame-hi); border-bottom: 2px solid var(--frame-hi); pointer-events: none; }
.panel h2 { border-bottom: 1px solid var(--frame); padding-bottom: 8px; margin: -2px 0 12px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--frame); margin-bottom: 12px; padding-bottom: 8px; }
.panel-head h2 { border: 0; padding: 0; margin: 0; }

/* --- splash & menu --- */
.splash, .menu-screen { display: flex; align-items: center; justify-content: center; text-align: center; }
.splash-inner, .menu-inner { animation: rise 1.2s ease-out both; }
.splash .title { margin-bottom: 44px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.menu-screen .title { margin-bottom: 52px; }
.menu-nav { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.menu-item { width: 320px; padding: 14px 0; font-size: 17px; letter-spacing: 0.3em; background: var(--glass); }
.menu-item:hover { background: rgba(40, 62, 80, 0.9); }
.now-playing { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  background: var(--glass); border: 1px solid var(--frame); padding: 8px 14px; }
.np-text { min-width: 230px; text-align: left; }
.np-label { font: 600 12px var(--font-d); letter-spacing: .2em; text-transform: uppercase; color: var(--text-3); }
#np-title { color: var(--accent); }

#settings { display: flex; align-items: center; justify-content: center; }
.settings-inner { width: min(620px, 92vw); }
.settings-inner h3 { margin-top: 20px; }
.set-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid rgba(160,184,200,.1); }
.set-row label { color: var(--text); }

/* --- setup --- */
#setup { overflow: auto; padding: 22px 28px 40px; }
.setup-head { display: flex; align-items: center; gap: 22px; margin-bottom: 18px; }
.setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 1280px; animation: rise .6s ease-out both; }
.setup-grid .wide { grid-column: 1 / -1; }
.setup-grid #kill-url { flex: 1; min-width: 260px; }
.status { margin-top: 10px; color: var(--text-2); min-height: 22px; }
.status.err { color: var(--hostile); }
.summary { color: var(--text-2); }
.summary b { color: var(--accent); font-weight: 600; }
.enemy { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; padding: 12px 0; border-bottom: 1px solid rgba(160,184,200,.12); }
.enemy:last-child { border-bottom: 0; }
.enemy .name { font-weight: 600; color: var(--accent); }
.enemy .meta { color: var(--text-2); font-size: 14px; }
.enemy .src { font: 600 12px var(--font-d); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); margin-left: 8px; }
.enemy .src.warn { color: var(--heat); }
.enemy textarea { grid-column: 1 / -1; }
.enemy .pilot { color: var(--text-2); margin-left: 6px; }
.fitpick { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.fitpick select { max-width: 460px; }
.fitpick a { color: var(--you); font-size: 14px; }
.fitpick .hint { margin: 0; font-size: 14px; }
.enemy .ctl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.actions .row:first-child { margin-top: 0; }
.batch-label { margin-left: 8px; }
.batch-out { margin-top: 14px; }
.batch-out table { border-collapse: collapse; }
.batch-out td, .batch-out th { padding: 5px 16px 5px 0; text-align: left; }
.batch-out th { font: 600 12px var(--font-d); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.big-num { font: 700 34px var(--font-d); color: var(--accent); }

/* --- fight --- */
#fight { display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--glass); border-bottom: 1px solid var(--frame); z-index: 3; }
.clock { font: 600 22px var(--mono); min-width: 74px; text-align: center; color: var(--accent); }
.seg { display: flex; }
.seg button { padding: 6px 10px; border-right-width: 0; }
.seg button:last-child { border-right-width: 1px; }
.seg button.on { background: rgba(52, 92, 120, 0.95); color: var(--accent); }
.keys { color: var(--text-3); font-size: 13px; }
.stage { flex: 1; display: grid; grid-template-columns: 300px 1fr 300px; min-height: 0; }
.left, .right { background: var(--glass-lo); border-right: 1px solid var(--frame); overflow: auto; padding: 12px; }
.right { border-right: 0; border-left: 1px solid var(--frame); display: flex; flex-direction: column; }
.block { margin-bottom: 18px; }
.overview { width: 100%; border-collapse: collapse; font-size: 14px; }
.overview th { text-align: left; font: 600 11px var(--font-d); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); padding: 4px 4px; border-bottom: 1px solid var(--frame); }
.overview td { padding: 6px 4px; border-bottom: 1px solid rgba(160,184,200,.08); white-space: nowrap; font-variant-numeric: tabular-nums; }
.overview tr { cursor: pointer; }
.overview tr:hover td { background: rgba(120,150,170,.08); }
.overview tr.sel td { background: rgba(143,201,255,.12); }
.overview tr.hostile td:first-child { color: var(--hostile); }
.overview tr.friend td:first-child { color: var(--friend); }
.overview tr.dead td { color: var(--text-3); text-decoration: line-through; }
.tag { display: inline-block; font: 600 10px var(--font-d); letter-spacing: .1em; padding: 0 4px; margin-left: 4px; color: #0b0f13; background: var(--text-2); vertical-align: 1px; }
.tag.scram { background: #c48cff; } .tag.point { background: #9fa8ff; } .tag.web { background: #6fd0ff; } .tag.jam { background: var(--cap); } .tag.locked { background: var(--hostile); }
.sel-info { color: var(--text-2); margin-bottom: 8px; min-height: 40px; }
.sel-info b { color: var(--accent); font-weight: 600; }
.sel-icons { display: flex; gap: 4px; margin-bottom: 6px; }
.ib { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; background: var(--glass); }
.ib svg { width: 20px; height: 20px; fill: none; stroke: var(--steel); stroke-width: 1.6; stroke-linecap: square; }
.ib:hover svg { stroke: var(--accent); }
.ib.on { background: rgba(120, 40, 36, .55); border-color: var(--hostile); }
.sel-defaults { color: var(--text-3); font-size: 13px; }
.sel-defaults span { color: var(--text-2); font-family: var(--mono); }
.sel-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sel-actions button { padding: 7px 6px; font-size: 13px; }
.drone-info { color: var(--text-2); margin-bottom: 8px; }

.center { position: relative; min-width: 0; }
.space3d { position: absolute; inset: 0; }
.space-gl, .space-ov { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.space-ov { cursor: crosshair; }
.targets { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; z-index: 2; }
.tcard { width: 150px; background: var(--glass); border: 1px solid var(--frame); padding: 7px 9px; cursor: pointer; }
.tcard.active { border-color: var(--hostile); }
.tcard .tn { font-weight: 600; font-size: 14px; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcard .td { font: 13px var(--mono); color: var(--text-2); }
.bar { height: 6px; background: rgba(255,255,255,.07); margin-top: 4px; }
.bar > i { display: block; height: 100%; }
.bar.s > i { background: var(--shield); } .bar.a > i { background: var(--armor); } .bar.h > i { background: var(--hull); }
.tcard .lockprog { height: 3px; background: var(--hostile); margin-top: 5px; }

.hud { position: absolute; bottom: 0; left: 0; right: 0; display: flex; align-items: flex-end; gap: 16px; padding: 10px 14px 12px;
  background: linear-gradient(to top, rgba(4,7,10,.92), rgba(4,7,10,0)); z-index: 2; pointer-events: none; }
.hud > * { pointer-events: auto; }
.gauges { display: flex; align-items: flex-end; gap: 12px; }
#gauge { width: 176px; height: 176px; }
.speed { width: 150px; }
.speed-num { font: 600 18px var(--mono); color: var(--accent); margin-bottom: 4px; }
.throttle { position: relative; height: 16px; background: var(--glass-lo); border: 1px solid var(--frame); cursor: pointer; margin-bottom: 6px; }
#throttle-fill { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(143,201,255,.45); }
#throttle-set { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--accent); }
.racks { position: relative; flex: none; }
.cell { position: absolute; width: 68px; height: 60px; outline: 1px dashed rgba(160,184,200,.07); outline-offset: -3px; }
.cell.hot { outline: 1px solid var(--frame-hi); background: rgba(143,201,255,.06); }
.rack-heat { position: absolute; left: -10px; width: 4px; height: 52px; background: rgba(255,255,255,.08); }
.rack-heat i { position: absolute; bottom: 0; left: 0; right: 0; height: 0; background: var(--heat); }
.mod { position: absolute; width: 64px; height: 56px; background: var(--glass); border: 1px solid var(--frame); cursor: pointer; padding: 3px 4px;
  font-size: 11px; line-height: 1.15; overflow: hidden; user-select: none; transition: left .12s, top .12s; }
.mod.dragging { transition: none; z-index: 5; opacity: .85; cursor: grabbing; border-color: var(--frame-hi); }
.mod .fk { position: absolute; left: 4px; bottom: 2px; z-index: 1; font: 10px var(--mono); color: var(--text-3); }
.mod .mn { position: relative; z-index: 1; color: var(--text); }
.mod .mc { position: absolute; right: 3px; bottom: 2px; z-index: 1; font: 11px var(--mono); color: var(--text-2); }
.mod .ring { position: absolute; inset: 0; z-index: 0; }
.mod.active { background: rgba(40, 90, 130, .85); border-color: var(--you); }
.mod.stopping { background: rgba(40, 90, 130, .45); }
.mod.reloading { background: rgba(110, 90, 40, .45); }
.mod.offline { background: rgba(120, 30, 30, .5); }
.mod.passive { opacity: .5; cursor: default; }
.mod.oh { box-shadow: inset 0 -3px 0 var(--heat); }
.mod .dmg { position: absolute; left: 0; top: 0; height: 2px; background: var(--hostile); z-index: 1; }
.mod:hover { border-color: var(--frame-hi); }

.right h3 { margin-bottom: 8px; }
.log { flex: 1; overflow: auto; font-size: 13.5px; }
.log div { padding: 2px 0; border-bottom: 1px solid rgba(160,184,200,.05); }
.log .t { font: 12px var(--mono); color: var(--text-3); margin-right: 6px; }
.log .out { color: #ffd0a0; } .log .in { color: #ff9f96; } .log .sys { color: var(--text-2); } .log .good { color: var(--friend); }

.toast { position: absolute; top: 96px; left: 50%; transform: translateX(-50%); background: var(--glass-hi); border: 1px solid var(--frame-hi);
  padding: 8px 16px; z-index: 4; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }
.result { position: absolute; top: 34%; left: 50%; transform: translate(-50%, -50%); z-index: 5; text-align: center; min-width: 380px; }
.result h2 { font-size: 26px; letter-spacing: .3em; color: var(--accent); border: 0; }
.result .row { justify-content: center; }

.menu { position: fixed; z-index: 10; background: var(--glass-hi); border: 1px solid var(--frame-hi); min-width: 190px; padding: 4px 0; }
.menu div { padding: 6px 14px; cursor: pointer; }
.menu div:hover { background: rgba(143,201,255,.14); }
.menu .sep { height: 1px; background: var(--frame); padding: 0; margin: 4px 0; }
.menu .hdr { font: 600 11px var(--font-d); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); cursor: default; }
.menu .hdr:hover { background: none; }

@media (max-width: 1100px) {
  .stage { grid-template-columns: 240px 1fr; }
  .right { display: none; }
  .setup-grid { grid-template-columns: 1fr; }
  .keys { display: none; }
}

/* ---- fight layout v2: overview right, quick bar top right, locked-target rings ---- */
.stage { grid-template-columns: 290px 1fr 360px; }
.left { display: flex; flex-direction: column; }
.left .log { flex: 1; }
.right { border-left: 1px solid var(--frame); }
.selbar { display: flex; align-items: center; gap: 12px; }
.sel-name { text-align: right; font-size: 14px; max-width: 360px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sel-name b { color: var(--accent); font-weight: 600; }
.muted { color: var(--text-3); }
.overview td.ic { width: 18px; padding-right: 0; }
.overview td.nm { max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
.overview tr.locked td.nm { text-decoration: underline; text-decoration-color: var(--hostile); text-underline-offset: 3px; }
.overview td.closing { color: #ffb0a0; } .overview td.opening { color: #a8d8ff; }
.hd { width: 12px; height: 12px; display: block; fill: var(--text-2); }
.hostile .hd { fill: var(--hostile); }
.hd.still { width: 6px; height: 6px; margin: 3px; background: var(--text-3); }
.targets { position: absolute; top: 12px; right: 12px; left: auto; transform: none; display: flex; flex-direction: column; gap: 10px; z-index: 2; }
.tgt { width: 96px; height: 96px; cursor: pointer; background: rgba(8, 12, 16, .55); border-radius: 50%; }
.tgt svg { width: 100%; height: 100%; display: block; }
.tgt .bg { fill: none; stroke: rgba(255,255,255,.07); stroke-width: 5; }
.tgt .sh, .tgt .ar, .tgt .hu { fill: none; stroke-width: 5; }
.tgt .sh { stroke: var(--shield); } .tgt .ar { stroke: var(--armor); } .tgt .hu { stroke: var(--hull); }
.tgt .lockring { fill: none; stroke: var(--hostile); stroke-width: 3; stroke-dasharray: 10 8; animation: spin 1.2s linear infinite; transform-origin: 50% 50%; }
@keyframes spin { to { transform: rotate(360deg); } }
.tgt .tn { fill: var(--accent); font: 600 10px var(--font); text-anchor: middle; }
.tgt .td { fill: var(--text-2); font: 10px var(--mono); text-anchor: middle; }
.tgt.active { box-shadow: none; }
.tgt svg { overflow: visible; }
.tgt .selarrows { fill: #f4f8fa; stroke: rgba(10, 16, 20, .7); stroke-width: .8; transform-box: view-box; transform-origin: 50px 50px;
  animation: spin 3s linear infinite; filter: drop-shadow(0 0 2px rgba(255, 255, 255, .55)); }
.mod .gc { position: absolute; right: 3px; top: 2px; z-index: 1; font: 10px var(--mono); color: var(--text-2); }
.menu .mi { display: flex; align-items: baseline; gap: 8px; padding: 6px 14px; cursor: pointer; white-space: nowrap; }
.menu .mi:hover { background: rgba(143,201,255,.14); }
.menu .mi span { flex: 1; }
.menu .mi i { font-style: normal; color: var(--text-3); }
.menu .mi small { color: var(--text-3); font: 12px var(--mono); }
.menu .mi.on span { color: var(--you); }
.menu.ammo-menu { max-height: 70vh; overflow: auto; }
.menu.ammo-menu .mi { flex-direction: column; align-items: flex-start; gap: 0; }

.selbar { min-width: 0; flex-shrink: 1; }
.sel-name { min-width: 0; flex-shrink: 1; }
.sel-icons { flex-shrink: 0; }
.center { overflow: hidden; }

/* floating combat text */
.floats { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: none; z-index: 3; }
.fl { font-size: 14px; white-space: nowrap; animation: flt 1.3s ease-out forwards; }
.fl span { opacity: .45; }
.fl b { font: 700 16px var(--mono); opacity: 1; }
.fl.out b { color: #ffd0a0; } .fl.in b { color: #ff8f84; } .fl.good b { color: var(--friend); }
@keyframes flt { 0% { opacity: 0; transform: translateY(6px); } 12% { opacity: 1; transform: none; } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }
/* overheat bar on top of each module; red when overheated */
.mod .ohbar { position: absolute; left: 0; right: 0; top: 0; height: 6px; z-index: 2; background: rgba(255,148,71,.18); cursor: pointer; }
.mod .ohbar:hover { background: rgba(255,148,71,.5); }
.mod.oh { background: rgba(140, 28, 24, .7); border-color: var(--hostile); box-shadow: none; }
.mod.oh .ohbar { background: var(--hostile); }
.mod .mn { margin-top: 5px; }
.mod .dmg { top: auto; bottom: 0; height: 3px; background: var(--heat); }

.tgt.dead { cursor: default; animation: deadpop .35s ease-out; }
.tgt .deadfill { fill: rgba(150, 24, 20, .75); stroke: var(--hostile); stroke-width: 3; }
.tgt .x { stroke: #ffe3df; stroke-width: 7; stroke-linecap: round; stroke-dasharray: 57; stroke-dashoffset: 57; animation: xdraw .25s ease-out forwards; }
.tgt .x2 { animation-delay: .18s; }
.tgt.dead .tn { fill: #ffd6d0; font-size: 9px; }
@keyframes xdraw { to { stroke-dashoffset: 0; } }
@keyframes deadpop { 0% { transform: scale(1); } 40% { transform: scale(1.15); } 100% { transform: scale(1); } }

/* ---- HUD centred at the bottom; round module buttons with icons ---- */
.hud { justify-content: center; align-items: flex-end; gap: 18px; background: none; }
.hud::before { content: ''; position: absolute; inset: auto 0 0 0; height: 260px; background: linear-gradient(to top, rgba(4,7,10,.9), rgba(4,7,10,0)); z-index: -1; pointer-events: none; }
.gauges { flex-direction: column; align-items: center; gap: 6px; }
.speed { width: 176px; text-align: center; }
.speed .row { justify-content: center; }
.cell { width: 60px; height: 72px; outline: none; }
.cell::after { content: ''; position: absolute; left: 7px; top: 10px; width: 46px; height: 46px; border-radius: 50%; border: 1px dashed rgba(160,184,200,.08); }
.cell.hot::after { border: 1px solid var(--frame-hi); background: rgba(143,201,255,.06); }
.rack-heat { height: 48px; top: 10px; }
.mod { width: 60px; height: 72px; background: none; border: 0; padding: 0; overflow: visible; }
.mod .disc { position: absolute; left: 7px; top: 10px; width: 46px; height: 46px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #1d2731, #0b1015);
  border: 1px solid var(--frame); overflow: hidden; display: grid; place-items: center; transition: border-color .15s, box-shadow .15s; }
.mod .disc img { width: 40px; height: 40px; position: relative; z-index: 1; pointer-events: none; }
.mod .disc .mn { position: absolute; inset: 0; display: none; font-size: 9px; line-height: 1.1; text-align: center; padding-top: 12px; margin: 0; }
.mod .disc img[style*="none"] + .mn { display: block; }
.mod .ring { position: absolute; inset: -1px; border-radius: 50%; z-index: 2; pointer-events: none;
  -webkit-mask: radial-gradient(circle, transparent 19px, #000 20px); mask: radial-gradient(circle, transparent 19px, #000 20px); }
.mod:hover .disc { border-color: var(--frame-hi); }
.mod.active .disc { border-color: var(--you); box-shadow: 0 0 10px rgba(143,201,255,.35); }
.mod.stopping .disc { border-color: rgba(143,201,255,.45); }
.mod.reloading .disc { border-color: var(--cap); }
.mod.offline .disc { border-color: var(--hostile); filter: grayscale(1) brightness(.5); }
.mod.oh .disc { border-color: var(--hostile); box-shadow: 0 0 10px rgba(255,107,94,.55); background: radial-gradient(circle at 50% 40%, #4a1814, #1a0806); }
.mod.oh { background: none; }
.mod .ohbar { left: 15px; right: 15px; top: 2px; height: 5px; border-radius: 3px; }
.mod .gc { right: 3px; top: 6px; left: auto; z-index: 3; min-width: 16px; height: 16px; border-radius: 8px; background: #0b1015; border: 1px solid var(--frame); font: 10px/14px var(--mono); text-align: center; color: var(--accent); }
.mod .mc { right: auto; left: 0; width: 100%; bottom: 3px; text-align: center; font-size: 10px; }
.mod .fk { left: 0; width: 100%; bottom: -9px; text-align: center; font-size: 9px; }
.mod .dmg { left: 13px; bottom: 12px; height: 2px; }
.mod .mn { margin: 0; }
.mod.active, .mod.stopping, .mod.reloading, .mod.offline, .mod.passive { background: none; border: 0; }
@media (max-width: 1100px) { .stage { grid-template-columns: 210px 1fr 280px; } .right { display: block; } .keys { display: none; } }

/* lost connection / errors */
#notice { z-index: 6; }
/* loaded ammo icon on the gun disc */
.mod .ammo { position: absolute; right: 2px; top: 38px; width: 20px; height: 20px; border-radius: 50%; background: #0b1015; border: 1px solid var(--frame); z-index: 3; pointer-events: none; }
/* module hover panel */
.modtip { position: fixed; z-index: 11; background: var(--glass-hi); border: 1px solid var(--frame-hi); padding: 8px 12px 9px; min-width: 210px; pointer-events: none; backdrop-filter: blur(6px); }
.modtip .tt-h { font: 600 14px var(--font); color: var(--accent); margin-bottom: 6px; white-space: nowrap; }
.modtip table { border-collapse: collapse; font-size: 13px; }
.modtip th { text-align: left; color: var(--text-3); font-weight: 400; padding: 1px 14px 1px 0; white-space: nowrap; }
.modtip td { font-family: var(--mono); color: var(--text); white-space: nowrap; }
.modtip .tt-f { margin-top: 6px; color: var(--text-3); font-size: 12px; }
/* quick bar: EVE-style frameless glyphs */
.sel-icons { gap: 2px; }
.ib { width: 34px; height: 34px; background: transparent; border: 0; border-radius: 3px; }
.ib svg { width: 22px; height: 22px; stroke: #c9d6df; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.ib svg .f { fill: #c9d6df; stroke: none; }
.ib:hover { background: rgba(200, 222, 236, .1); }
.ib:hover svg { opacity: 1; stroke: #fff; }
.ib:hover svg .f { fill: #fff; }
.ib.on { background: rgba(255, 107, 94, .18); border: 0; }
.ib.on svg { stroke: var(--hostile); opacity: 1; }
.ib.on svg .f { fill: var(--hostile); }

/* ---- right sidebar windows: Selected Item + Overview, in the in-game layout ---- */
.right { padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.win { background: rgba(10, 13, 16, .92); border: 1px solid rgba(160,184,200,.14); padding: 8px 10px 10px; }
.win-h { font: 500 13px var(--font); color: var(--text-2); letter-spacing: .02em; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; text-transform: none; }
.si-top { display: flex; gap: 6px; align-items: flex-start; margin-bottom: 8px; min-height: 64px; }
.si-img { width: 64px; height: 64px; object-fit: cover; background: #05080b; }
.si-text { font: 14px/1.35 var(--mono); color: var(--text); padding-left: 6px; min-width: 0; }
.si-text .si-name { color: #f2f5f7; font-family: var(--font); font-weight: 500; }
.si-text .muted { font-size: 12px; }
.sel-icons { display: flex; gap: 1px; justify-content: flex-start; }
.ib { width: 36px; height: 34px; }
.ib svg { width: 24px; height: 24px; stroke: #dfe6ea; stroke-width: 1.5; opacity: .85; }
.ib svg .f { fill: #dfe6ea; }
.ib svg .x { stroke: #ff4d3d; opacity: 0; }
.ib.on svg { stroke: #dfe6ea; }
.ib.on svg .x { opacity: 1; }
.ib.on { background: rgba(255, 77, 61, .14); }
#warp-btn svg { stroke-width: 1.7; }
.ovwin { flex: 1; min-height: 0; overflow: auto; }
.kv { border-collapse: collapse; font-size: 13px; width: 100%; }
.kv th { text-align: left; color: var(--text-3); font-weight: 400; padding: 2px 10px 2px 0; }
.kv td { font-family: var(--mono); text-align: right; }
/* movement status above the HUD, like the in-game "Orbiting / Venture - 1,000 m" */
.cmdline { text-align: center; min-height: 44px; }
.cmdline .cl-a { font: 400 22px var(--font); color: #eef3f6; }
.cmdline .cl-b { font: 13px var(--font); color: var(--text-2); }
/* locked-target circles with the ship render inside and labels underneath */
.targets { gap: 18px; }
.tgt { width: 96px; height: auto; background: none; border-radius: 0; }
.tgt svg { width: 96px; height: 96px; border-radius: 50%; background: rgba(8, 12, 16, .55); }
.tgt image.dim { opacity: .45; }
.tgt .td.big { font-size: 14px; fill: #ffd2cc; }
.tgt-cap { text-align: center; font-size: 12px; line-height: 1.25; margin-top: 2px; }
.tgt-cap .tn { color: #eef3f6; } .tgt-cap .tsub { color: var(--text-2); } .tgt-cap .td { color: var(--text-2); font-family: var(--mono); }
.tgt.active svg { box-shadow: 0 0 0 2px var(--hostile); }
.tgt.active { box-shadow: none; }
.tgt.dead svg { background: none; }

/* incoming hostile effects above the capacitor: red-ringed module icons */
.ewar { display: flex; gap: 8px; justify-content: center; min-height: 0; }
.ew { position: relative; width: 44px; text-align: center; animation: ewin .25s ease-out; }
.ew img { width: 38px; height: 38px; border-radius: 50%; border: 2px solid #ff3b2f; background: radial-gradient(circle, #3a0d0a, #140504);
  box-shadow: 0 0 10px rgba(255, 59, 47, .55); display: block; margin: 0 auto; }
.ew .ewn { position: absolute; right: 0; top: -2px; min-width: 16px; height: 16px; border-radius: 8px; background: #ff3b2f; color: #fff; font: 700 10px/16px var(--mono); }
.ew .ewl { font: 600 10px var(--font-d); letter-spacing: .08em; text-transform: uppercase; color: #ff8f84; margin-top: 2px; }
@keyframes ewin { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
/* combat text: a little lower; only the number is coloured (light blue = your damage, red = damage to you) */
.floats { top: 54px; }
.fl.out b { color: #8fd8ff; } .fl.in b { color: #ff5a4f; }

/* drones window (bottom right) */
.dronewin { flex: none; max-height: 38%; overflow: auto; }
.dr-ctl { margin-bottom: 6px; }
.dsec { font: 500 12px var(--font); color: var(--text-2); padding: 4px 2px; border-bottom: 1px solid rgba(160,184,200,.12); margin-top: 4px; }
.dzone { min-height: 30px; padding: 2px 0; }
.dzone.dropok, .overview tr.dropok td { background: rgba(143,201,255,.12); }
.dl { display: flex; align-items: center; gap: 8px; padding: 3px 4px; cursor: pointer; font-size: 13px; user-select: none; }
.dl:hover { background: rgba(120,150,170,.08); }
.dl.sel { background: rgba(143,201,255,.16); }
.dl img { width: 22px; height: 22px; }
.dl .dn { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.dl .dn small { font-size: 11px; color: var(--text-3); }
.dl .dn small.st-attack { color: #ffb0a0; } .dl .dn small.st-return { color: var(--cap); } .dl .dn small.st-orbit { color: var(--you); }
.dl .dc { font: 13px var(--mono); color: var(--text-2); }
.dhp { display: flex; flex-direction: column; gap: 2px; width: 56px; }
.dhp b { display: block; height: 3px; background: rgba(255,255,255,.08); }
.dhp i { display: block; height: 100%; }
.dhp i.shield { background: var(--shield); } .dhp i.armor { background: var(--armor); } .dhp i.hull { background: var(--hull); }
.dempty { color: var(--text-3); font-size: 12px; padding: 4px; }
.tag.drone { background: #9aa7b3; }
/* setup page centred in the window */
.setup-head, .setup-grid { max-width: 1280px; margin-left: auto; margin-right: auto; }
.setup-head { justify-content: center; position: relative; }
.setup-head #setup-back { position: absolute; left: 0; }

/* room for the spinning arrows around the active target */
#targets { padding-top: 14px; }

/* modules running on a target, under its circle */
.tgt-mods { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; margin-top: 4px; }
.tgt-mods .tm { position: relative; width: 26px; height: 26px; border-radius: 50%; background: rgba(8, 12, 16, .7);
  box-shadow: inset 0 0 0 1.5px rgba(143, 201, 255, .55); display: grid; place-items: center; }
.tgt-mods .tm img { width: 22px; height: 22px; border-radius: 50%; }
.tgt-mods .tm.stopping { box-shadow: inset 0 0 0 1.5px rgba(143, 201, 255, .2); opacity: .6; }
.tgt-mods .tm b { position: absolute; right: -4px; bottom: -3px; font: 700 10px var(--mono); color: #eef3f6;
  background: rgba(8, 12, 16, .9); border-radius: 6px; padding: 0 3px; line-height: 13px; }

/* a long ammo list scrolls instead of running off the bottom of a short window */
.menu { max-height: calc(100vh - 20px); overflow-y: auto; }

/* CCP credit on the main menu */
.fan-note { margin: 40px auto 0; max-width: 460px; font-size: 13px; line-height: 1.45; color: var(--text-3); text-align: center; }

/* Load fight: spinner while a kill is loading */
#kill-load.loading { opacity: .85; cursor: progress; display: inline-flex; align-items: center; gap: 8px; }
#kill-load .spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(220,235,245,.25); border-top-color: #eef3f6;
  animation: spin .8s linear infinite; }

/* Module state rings: a solid 3px ring outside the disc (2px thicker than the old border) so it's obvious what's
   running, overheated, reloading or waiting on a lock; the cycle sweep inside is a wider, brighter band. */
.mod .ring { inset: 0; -webkit-mask: radial-gradient(circle, transparent 16px, #000 17px); mask: radial-gradient(circle, transparent 16px, #000 17px); }
.mod.active .disc { border-color: var(--you); box-shadow: 0 0 0 3px var(--you), 0 0 14px rgba(143,201,255,.45); }
.mod.stopping .disc { border-color: rgba(143,201,255,.5); box-shadow: 0 0 0 3px rgba(143,201,255,.4); }
.mod.reloading .disc { border-color: var(--cap); box-shadow: 0 0 0 3px var(--cap); }
.mod.oh .disc { border-color: var(--hostile); box-shadow: 0 0 0 3px var(--hostile), 0 0 14px rgba(255,107,94,.6); }
.mod.queued .disc { border-color: var(--you); animation: queued 1s ease-in-out infinite; }
@keyframes queued { 0%, 100% { box-shadow: 0 0 0 3px rgba(143,201,255,.25); } 50% { box-shadow: 0 0 0 3px rgba(143,201,255,.9); } }
.mod .disc { overflow: visible; }
.mod .disc img { border-radius: 50%; }

/* Start: twice the size, top centre, until the fight begins */
#play.start-big { position: fixed; top: 72px; left: 50%; transform: translateX(-50%); z-index: 30;
  font-size: 26px; letter-spacing: .22em; padding: 18px 64px; box-shadow: 0 0 0 2px var(--you), 0 6px 28px rgba(0,0,0,.55); }
