/* Void Throne – UI styles (menus, galaxy map panels, battle HUD) */
:root {
  --bg: #04060b;
  --panel: rgba(9, 14, 24, 0.86);
  --panel2: rgba(14, 22, 36, 0.92);
  --line: rgba(150, 190, 255, 0.16);
  --line2: rgba(150, 190, 255, 0.32);
  --text: #dbe4f0;
  --muted: #8796ab;
  --acc: #5fd4ff;
  --heg: #e5483b;
  --accd: #2fd3c0;
  --cor: #e8913a;
  --good: #5ee07a;
  --bad: #ff5a4a;
  --warn: #f5c242;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --display: "Bahnschrift", "DIN Alternate", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font: 14px/1.4 var(--font); user-select: none; -webkit-user-select: none; }
canvas#view { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui > * { pointer-events: auto; }
/* the full-screen HUD layers let clicks through to the map / battlefield; only their panels take the mouse
   (the id selector above would otherwise beat their own pointer-events: none) */
#ui > .ghud, #ui > .bhud, #ui > .mm { pointer-events: none; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: 0.45; }
.ic { display: inline-block; vertical-align: middle; flex: none; }
kbd { font: 10px var(--font); }
.muted { color: var(--muted); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: 0.06em; margin: 0; }

/* ------------------------------------------------------------------ boot */
.boot { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 18px; background: radial-gradient(ellipse at center, #0c1426 0%, #03050a 70%); z-index: 50; transition: opacity .6s; }
.boot.done { opacity: 0; pointer-events: none; }
.boot h1 { font-size: 46px; letter-spacing: 0.32em; font-weight: 300; color: #f2f6ff; text-shadow: 0 0 24px rgba(120, 180, 255, 0.5); margin-right: -0.32em; }
.boot p { margin: 0; color: var(--muted); letter-spacing: 0.2em; text-transform: uppercase; font-size: 12px; }
.boot .bar { width: 280px; height: 2px; background: rgba(255,255,255,0.08); overflow: hidden; }
.boot .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--heg), var(--accd)); transition: width .2s; }

/* ------------------------------------------------------------------ generic widgets */
.btn { display: inline-flex; align-items: center; gap: 8px; justify-content: center; padding: 9px 18px; border: 1px solid var(--line2); background: linear-gradient(180deg, rgba(40,56,84,0.55), rgba(16,24,40,0.75)); color: var(--text); letter-spacing: 0.08em; text-transform: uppercase; font-size: 12px; font-weight: 600; clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:hover:not(:disabled) { border-color: var(--acc); background: linear-gradient(180deg, rgba(60,90,130,0.6), rgba(20,34,56,0.85)); box-shadow: 0 0 16px rgba(95, 212, 255, 0.25) inset; }
.btn.primary { border-color: var(--acc); background: linear-gradient(180deg, rgba(40,130,170,0.55), rgba(12,50,80,0.8)); }
.btn.danger { border-color: rgba(255,90,74,0.6); background: linear-gradient(180deg, rgba(120,30,24,0.55), rgba(50,12,10,0.8)); }
.btn.small { padding: 6px 12px; font-size: 11px; }
.btn.big { padding: 14px 28px; font-size: 14px; }
.overlay { position: fixed; inset: 0; background: rgba(2, 4, 10, 0.72); display: flex; align-items: center; justify-content: center; z-index: 30; backdrop-filter: blur(3px); pointer-events: auto; }
.dialog { background: var(--panel2); border: 1px solid var(--line2); padding: 26px 30px; max-width: min(860px, 94vw); max-height: 90vh; overflow: auto; position: relative; box-shadow: 0 30px 80px rgba(0,0,0,0.6); clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px); }
.dialog.small { max-width: 520px; }
.dialog h2 { font-size: 20px; margin-bottom: 14px; text-transform: uppercase; }
.dialog .buttons { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }
.dialog p { color: #b9c5d6; }
.row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.controls-help p { margin: 6px 0; font-size: 13px; }
.tooltip { position: fixed; z-index: 100; max-width: 320px; background: rgba(8, 12, 22, 0.96); border: 1px solid var(--line2); padding: 8px 11px; font-size: 12.5px; color: var(--text); pointer-events: none; box-shadow: 0 8px 30px rgba(0,0,0,0.5); }
.tooltip b { color: #fff; }
.tooltip small { color: var(--muted); }
.chip { display: inline-block; padding: 2px 8px; margin: 2px; border: 1px solid var(--line); background: rgba(255,255,255,0.04); font-size: 12px; }
.tag { display: inline-block; font-size: 10px; letter-spacing: 0.12em; padding: 1px 6px; border: 1px solid var(--warn); color: var(--warn); margin-left: 8px; vertical-align: middle; }
input[type=range] { accent-color: var(--acc); }
select, input[type=text], input[type=number] { background: rgba(0,0,0,0.4); color: var(--text); border: 1px solid var(--line2); padding: 6px 8px; font: inherit; }

/* ------------------------------------------------------------------ battle HUD */
.bhud { position: fixed; inset: 0; pointer-events: none; font-size: 13px; }
.bhud > * { pointer-events: auto; }
.bh-top { position: absolute; top: 0; left: 0; right: 0; height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; background: linear-gradient(180deg, rgba(4,8,16,0.92), rgba(4,8,16,0.55) 70%, transparent); }
.bh-title { display: flex; flex-direction: column; line-height: 1.15; }
.bh-kicker { font-size: 10px; letter-spacing: 0.25em; color: var(--muted); }
.bh-title strong { font-family: var(--display); font-size: 16px; letter-spacing: 0.08em; }
.bh-center { display: flex; align-items: center; gap: 4px; }
.bh-right { display: flex; gap: 8px; }
.bh-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; background: rgba(20,30,50,0.7); border: 1px solid var(--line2); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.bh-btn:hover { border-color: var(--acc); }
.bh-btn.on { border-color: var(--warn); color: var(--warn); }
.bh-btn.danger { border-color: rgba(255,90,74,0.55); }
.bh-btn.danger:hover { background: rgba(120,30,24,0.6); }
.bh-speed { padding: 5px 8px; background: rgba(20,30,50,0.6); border: 1px solid var(--line); font-size: 12px; min-width: 36px; }
.bh-speed.on { border-color: var(--acc); color: var(--acc); }
.bh-time { font-family: var(--display); font-size: 16px; margin-left: 10px; min-width: 52px; letter-spacing: 0.06em; }
.bh-meter { position: absolute; top: 50px; left: 50%; transform: translateX(-50%); width: min(420px, 50vw); height: 8px; display: flex; align-items: center; background: rgba(0,0,0,0.5); border: 1px solid var(--line); }
.bh-meter-a, .bh-meter-b { height: 100%; transition: width .4s; }
.bh-meter-a { box-shadow: 0 0 10px currentColor; }
.bh-meter-l, .bh-meter-r { position: absolute; top: -1px; font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); }
.bh-meter-l { right: calc(100% + 8px); white-space: nowrap; }
.bh-meter-r { left: calc(100% + 8px); white-space: nowrap; }
.bh-msgs { position: absolute; top: 70px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; }
.bh-msg { padding: 4px 14px; background: rgba(6,10,20,0.78); border-left: 2px solid var(--acc); font-size: 13px; transition: opacity .6s, transform .6s; white-space: nowrap; }
.bh-msg.good { border-color: var(--good); }
.bh-msg.bad { border-color: var(--bad); }
.bh-msg.warn { border-color: var(--warn); }
.bh-msg.out { opacity: 0; transform: translateY(-6px); }
.bh-flash { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%); font-family: var(--display); font-size: 18px; letter-spacing: 0.1em; color: var(--warn); text-shadow: 0 2px 8px #000; opacity: 0; pointer-events: none; }
.bh-flash.on { animation: flash 1.2s ease-out; }
@keyframes flash { 0% { opacity: 0; } 15% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }
.bh-miniwrap { position: absolute; left: 12px; bottom: 12px; padding: 6px; background: var(--panel); border: 1px solid var(--line2); }
.bh-mini { display: block; cursor: crosshair; }
.bh-panel { position: absolute; left: 276px; right: 300px; bottom: 12px; min-height: 120px; display: flex; gap: 10px; background: var(--panel); border: 1px solid var(--line2); padding: 10px; clip-path: polygon(12px 0, 100% 0, 100% 100%, 0 100%, 0 12px); }
.bh-sel { flex: 1; min-width: 0; overflow: hidden; }
.bh-hint { display: flex; flex-direction: column; gap: 6px; color: var(--muted); padding: 10px 6px; font-size: 12.5px; }
.bh-hint b { color: var(--text); font-family: var(--display); letter-spacing: 0.08em; text-transform: uppercase; }
.bh-one { display: flex; gap: 12px; align-items: flex-start; }
.bh-portrait { width: 150px; height: 96px; background: radial-gradient(ellipse at center, rgba(60,90,140,0.35), rgba(0,0,0,0.4)); border: 1px solid var(--line); flex: none; }
.bh-info { flex: 1; min-width: 160px; }
.bh-name { font-family: var(--display); font-size: 16px; letter-spacing: 0.05em; }
.bh-role { color: var(--muted); font-size: 12px; }
.bh-desc { color: #9eabbe; font-size: 11.5px; margin-top: 4px; max-height: 32px; overflow: hidden; }
.bh-bars { display: flex; flex-direction: column; gap: 3px; margin: 6px 0; max-width: 260px; }
b.bar { display: block; height: 6px; background: rgba(255,255,255,0.08); position: relative; overflow: hidden; }
b.bar > i { display: block; height: 100%; width: 100%; background: var(--good); transition: width .2s; }
b.bar.shield > i { background: #58b6ff; }
.bh-hps { display: grid; grid-template-columns: repeat(auto-fill, 40px); gap: 4px; width: 232px; flex: none; align-content: start; max-height: 104px; overflow: auto; }
.bh-hp { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 3px 2px 2px; border: 1px solid var(--line); background: rgba(255,255,255,0.03); color: #b8c4d4; }
.bh-hp.k-shield { color: #7cc4ff; } .bh-hp.k-engine { color: #ffb36b; } .bh-hp.k-weapon { color: #ff8a7a; } .bh-hp.k-hangar { color: #ffd54a; } .bh-hp.k-gravity { color: #c08aff; } .bh-hp.k-tractor { color: #7fe0a0; }
.bh-hp b.bar { height: 3px; width: 100%; }
.bh-hp b.bar > i { background: #ff9a5a; }
.bh-hp.dead { color: #4c5460; opacity: 0.6; }
.bh-hp.dead b.bar > i { width: 0 !important; }
.bh-grid { display: flex; flex-wrap: wrap; gap: 5px; max-height: 104px; overflow: auto; }
.bh-cell { position: relative; width: 76px; height: 54px; padding: 0; background: rgba(255,255,255,0.03); border: 1px solid var(--line); }
.bh-cell:hover, .bh-cell.hl { border-color: var(--acc); }
.bh-cell img { width: 72px; height: 48px; display: block; }
.bh-cell .n { position: absolute; right: 3px; top: 1px; font-size: 11px; font-weight: 700; text-shadow: 0 1px 2px #000; }
.bh-cell b.bar { position: absolute; left: 2px; right: 2px; bottom: 2px; height: 3px; }
.bh-abilities { display: grid; grid-template-columns: repeat(2, 52px); gap: 6px; align-content: start; }
.bh-ab { position: relative; width: 52px; height: 52px; background: linear-gradient(180deg, rgba(40,60,90,0.6), rgba(14,22,38,0.9)); border: 1px solid var(--line2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.bh-ab.ready { border-color: rgba(95,212,255,0.6); color: #e8f6ff; }
.bh-ab.on { border-color: var(--warn); color: var(--warn); box-shadow: 0 0 12px rgba(245,194,66,0.35) inset; }
.bh-ab kbd { position: absolute; left: 3px; top: 2px; color: var(--muted); }
.bh-ab .cd { position: absolute; inset: 0; pointer-events: none; }
.bh-res { position: absolute; right: 12px; bottom: 12px; width: 276px; background: var(--panel); border: 1px solid var(--line2); padding: 8px; }
.bh-res-head { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.bh-supply { color: var(--text); letter-spacing: 0.05em; }
.bh-auto { margin-left: auto; margin-right: 8px; padding: 0 7px; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); background: transparent; border: 1px solid var(--line); }
.bh-auto.on { color: var(--good); border-color: var(--good); }
.bh-reserve { display: flex; flex-wrap: wrap; gap: 4px; max-height: 128px; overflow: auto; }
.bh-card { position: relative; width: 62px; height: 46px; padding: 0; background: rgba(255,255,255,0.03); border: 1px solid var(--line); }
.bh-card img { width: 60px; height: 40px; display: block; }
.bh-card:hover { border-color: var(--good); }
.bh-card.off { opacity: 0.4; }
.bh-card .n { position: absolute; right: 2px; top: 0; font-size: 11px; font-weight: 700; text-shadow: 0 1px 2px #000; }
.bh-card .p { position: absolute; left: 2px; bottom: 0; font-size: 10px; color: var(--muted); }
.bh-empty { color: var(--muted); font-size: 12px; padding: 6px; }
.bh-bomb { width: 100%; margin-top: 8px; padding: 7px; display: flex; align-items: center; gap: 8px; background: rgba(60,20,10,0.5); border: 1px solid rgba(255,140,80,0.4); text-transform: uppercase; letter-spacing: 0.1em; font-size: 12px; }
.bh-bomb i { margin-left: auto; font-style: normal; color: var(--muted); }
.bh-bomb.ready { border-color: #ff9a5a; color: #ffd0b0; }
.bh-bomb.on { border-color: var(--warn); }
.result-box { text-align: center; min-width: min(640px, 92vw); }
.result-box h1 { font-size: 54px; letter-spacing: 0.3em; font-weight: 300; margin: 6px 0 4px; }
.result-box.won h1 { color: #9fffd0; text-shadow: 0 0 30px rgba(90,255,160,0.4); }
.result-box.lost h1 { color: #ffb0a0; text-shadow: 0 0 30px rgba(255,90,74,0.4); }
.result-kicker { letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted); font-size: 11px; }
.result-sub { margin: 0 0 18px; }
.result-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; text-align: left; }
.result-cols h3 { font-size: 12px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; letter-spacing: 0.15em; }
.result-time { margin-top: 14px; color: var(--muted); font-size: 12px; }
.result .buttons { justify-content: center; }

@media (max-width: 1100px) {
  .bh-panel { left: 12px; right: 12px; bottom: 170px; }
  .bh-miniwrap { display: none; }
  .bh-res { bottom: 12px; right: 12px; left: 12px; width: auto; }
}
