/* vibe.css — the HUD reskin: "abyssal instrument glass".
   Brass hairlines, corner brackets, dark glass, one live glow that follows
   --primary-cyan (so the Grave Choir turns it violet on its own).
   Restyle only: no element, ID or behaviour is touched. Removable by deleting one <link>. */

#hud, #reactor-hud, #core-offer {
  --v-glow: var(--primary-cyan, #5ef2e0);
  --v-brass: #c9a25c;
  --v-brass-dim: rgba(201,162,92,.42);
  --v-ink: #e8f0ee;
  --v-muted: #8aa1a4;
  --v-glass: linear-gradient(165deg, rgba(12,26,36,.80) 0%, rgba(4,9,15,.88) 62%, rgba(2,5,9,.92) 100%);
  --v-scan: repeating-linear-gradient(0deg, rgba(255,255,255,.022) 0 1px, transparent 1px 3px);
  --v-label: 600 9.5px/1.2 "Space Grotesk", ui-monospace, monospace;
}

/* soft lens vignette: the cockpit edge, never over the play centre */
#hud::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background: radial-gradient(ellipse 120% 95% at 50% 50%, transparent 62%, rgba(0,3,8,.55) 100%);
}

/* ── panels ─────────────────────────────────────────────────────────── */
body #hud .hud-card {
  position: relative;
  background: var(--v-scan), var(--v-glass);
  -webkit-backdrop-filter: blur(9px) saturate(1.25);
  backdrop-filter: blur(9px) saturate(1.25);
  border: 1px solid var(--v-brass-dim);
  border-radius: 3px;
  box-shadow:
    inset 0 1px 0 rgba(255,236,206,.07),
    inset 0 0 28px color-mix(in srgb, var(--v-glow) 7%, transparent),
    0 10px 30px rgba(0,0,0,.45);
  color: var(--v-ink);
}
body #hud .hud-card::before,
body #hud .hud-card::after {
  content: ""; position: absolute; width: 11px; height: 11px; pointer-events: none;
  border: 0 solid var(--v-brass); opacity: .95;
}
body #hud .hud-card::before { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; }
body #hud .hud-card::after  { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; }

/* ── identity card ──────────────────────────────────────────────────── */
body #hud .core-avatar {
  border-radius: 2px; transform: rotate(45deg) scale(.82);
  border: 1px solid var(--v-brass);
  box-shadow: 0 0 0 3px rgba(0,0,0,.5), 0 0 16px color-mix(in srgb, var(--v-glow) 55%, transparent);
}
body #hud .game-title, body #hud #hud-callsign {
  font: 700 15px/1.25 "Outfit", system-ui, sans-serif;
  letter-spacing: .16em; text-transform: uppercase; color: var(--v-ink);
  text-shadow: 0 0 14px color-mix(in srgb, var(--v-glow) 35%, transparent);
}
body #hud .forge-badge, body #hud #hud-crew {
  font: var(--v-label); letter-spacing: .18em; text-transform: uppercase;
  color: var(--v-brass); background: rgba(201,162,92,.08);
  border: 1px solid var(--v-brass-dim); border-radius: 1px; padding: 3px 7px;
}
body #hud .stage-label {
  font: 500 10.5px/1.5 "Space Grotesk", system-ui, sans-serif;
  letter-spacing: .12em; text-transform: uppercase; color: var(--v-muted);
}

/* ── gauges ─────────────────────────────────────────────────────────── */
body #hud .vital-label {
  font: var(--v-label); letter-spacing: .2em; text-transform: uppercase; color: var(--v-brass);
}
body #hud .vital-value {
  font: 600 11.5px/1 "Space Grotesk", ui-monospace, monospace;
  font-variant-numeric: tabular-nums; color: var(--v-ink); letter-spacing: .06em;
}
body #hud .bar-track {
  height: 7px; border-radius: 0; overflow: hidden;
  background:
    repeating-linear-gradient(90deg, transparent 0 9px, rgba(0,0,0,.55) 9px 10px),
    rgba(255,255,255,.06);
  box-shadow: inset 0 0 0 1px rgba(201,162,92,.28);
}
body #hud .bar-fill {
  border-radius: 0;
  background-image:
    repeating-linear-gradient(90deg, transparent 0 9px, rgba(0,0,0,.45) 9px 10px),
    linear-gradient(90deg, color-mix(in srgb, var(--v-glow) 55%, #000), var(--v-glow));
  box-shadow: 0 0 10px color-mix(in srgb, var(--v-glow) 60%, transparent);
}

/* ── radar: a brass bezel around the scope ──────────────────────────── */
body #hud .radar-box {
  border: 1px solid var(--v-brass);
  box-shadow:
    0 0 0 3px rgba(2,6,10,.85),
    0 0 0 4px var(--v-brass-dim),
    0 0 26px color-mix(in srgb, var(--v-glow) 28%, transparent),
    inset 0 0 22px rgba(0,0,0,.7);
  background: radial-gradient(circle, rgba(8,24,30,.85), rgba(2,6,10,.95));
}

/* ── ability box ────────────────────────────────────────────────────── */
body #hud .ability-slot-icon {
  border-radius: 2px; border: 1px solid var(--v-brass);
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--v-glow) 22%, transparent), rgba(0,0,0,.6));
  box-shadow: 0 0 14px color-mix(in srgb, var(--v-glow) 30%, transparent);
}
body #hud .ability-title { font: 700 12px/1.3 "Outfit", sans-serif; letter-spacing: .14em; text-transform: uppercase; }
body #hud .ability-key-hint { font: var(--v-label); letter-spacing: .16em; color: var(--v-brass); }
body #hud .cd-bar-track { border-radius: 0; background: rgba(255,255,255,.07); box-shadow: inset 0 0 0 1px rgba(201,162,92,.25); }
body #hud .cd-bar-fill  { border-radius: 0; background: var(--v-glow); box-shadow: 0 0 8px var(--v-glow); }

/* ── command chips: Shipyard, Sector chart, Controls, F1 ────────────── */
body #hud .hud-center-actions .btn {
  position: relative; overflow: hidden;
  font: 700 10.5px/1 "Space Grotesk", system-ui, sans-serif;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--v-ink);
  padding: 11px 20px;
  border: 0; border-radius: 0;
  clip-path: polygon(9px 0, 100% 0, calc(100% - 9px) 100%, 0 100%);
  background: var(--v-scan), linear-gradient(180deg, rgba(20,34,44,.92), rgba(5,10,16,.95));
  box-shadow: inset 0 0 0 1px var(--v-brass-dim), inset 0 -2px 0 rgba(201,162,92,.55);
  transition: color .15s, box-shadow .15s, transform .15s;
}
body #hud .hud-center-actions .btn::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255,236,206,.18) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .45s ease;
}
body #hud .hud-center-actions .btn:hover::after,
body #hud .hud-center-actions .btn:focus-visible::after { transform: translateX(120%); }
body #hud .hud-center-actions .btn:hover,
body #hud .hud-center-actions .btn:focus-visible {
  color: #fff; transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px var(--v-brass), inset 0 -2px 0 var(--v-glow),
              inset 0 0 18px color-mix(in srgb, var(--v-glow) 18%, transparent);
}
body #hud .hud-center-actions .btn:focus-visible { outline: 2px solid var(--v-glow); outline-offset: 2px; }
/* the two primary doors carry the live glow */
body #hud #btn-open-designer.btn, body #hud #btn-open-map.btn {
  color: color-mix(in srgb, var(--v-glow) 70%, #fff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--v-glow) 45%, transparent), inset 0 -2px 0 var(--v-glow),
              inset 0 0 16px color-mix(in srgb, var(--v-glow) 12%, transparent);
  background: var(--v-scan), linear-gradient(180deg, color-mix(in srgb, var(--v-glow) 16%, rgba(10,20,28,.94)), rgba(4,9,15,.96));
  border: 0;
  animation: none;
}
body #hud .icon-circle-btn {
  border-radius: 2px; transform: rotate(45deg);
  border: 1px solid var(--v-brass-dim);
  background: rgba(5,10,16,.92);
}
body #hud .icon-circle-btn > * { transform: rotate(-45deg); }
body #hud .icon-circle-btn:hover { border-color: var(--v-brass); box-shadow: 0 0 12px color-mix(in srgb, var(--v-glow) 35%, transparent); }

body #hud .ctrl-hint {
  font: 500 10px/1.7 "Space Grotesk", ui-monospace, monospace;
  letter-spacing: .1em; text-transform: uppercase; color: var(--v-muted);
}

/* ── reactor doctrine tabs (colours stay owned by energy.js) ────────── */
#reactor-hud { font-family: "Space Grotesk", ui-monospace, monospace !important; letter-spacing: .18em !important; }
#reactor-hud > div:first-child {
  width: 260px !important; height: 3px !important; border-radius: 0 !important;
  box-shadow: 0 0 0 1px rgba(201,162,92,.3), 0 0 10px rgba(0,0,0,.6);
}
#reactor-hud > div:last-child { gap: 3px !important; }
#reactor-hud > div:last-child > span {
  padding: 5px 14px !important; border-radius: 0 !important;
  clip-path: polygon(7px 0, 100% 0, calc(100% - 7px) 100%, 0 100%);
  font-size: 9.5px;
}

/* ── phone ──────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  body #hud .hud-card::before, body #hud .hud-card::after { width: 7px; height: 7px; }
  body #hud .hud-center-actions .btn { padding: 9px 13px; letter-spacing: .12em; font-size: 9.5px; }
  body #hud .game-title, body #hud #hud-callsign { font-size: 13px; letter-spacing: .1em; }
  #reactor-hud > div:last-child > span { padding: 4px 8px !important; font-size: 8.5px; }
  #reactor-hud > div:first-child { width: 190px !important; }
  body #hud .forge-badge, body #hud #hud-crew { white-space: nowrap; letter-spacing: .1em; padding: 2px 5px; }
  body #hud .mass-row { flex-wrap: wrap; row-gap: 3px; }
  body #hud .mass-row .vital-label { letter-spacing: .06em; font-size: 8px; margin-right: 8px; }
  body #hud .mass-row .vital-value { margin-left: auto; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  body #hud .hud-center-actions .btn, body #hud .hud-center-actions .btn::after { transition: none; }
  body #hud .hud-center-actions .btn:hover { transform: none; }
}

/* ── B7 THE HUNT: chain counter + overdrive ─────────────────────────── */
#hunt-chain {
  position: fixed; right: 30px; top: 40%; z-index: 45; pointer-events: none;
  display: flex; flex-direction: column; align-items: flex-end;
  opacity: 0; transform: translateX(14px); transition: opacity .2s, transform .2s;
}
#hunt-chain.on { opacity: 1; transform: none; }
#hunt-chain .hc-n {
  font: 800 56px/1 "Outfit", system-ui, sans-serif; color: #e8c478; letter-spacing: .01em;
  text-shadow: 0 0 22px rgba(232,196,120,.55), 3px 3px 0 rgba(0,0,0,.65);
}
#hunt-chain .hc-l { font: 700 10px/1.6 "Space Grotesk", monospace; letter-spacing: .42em; color: #c9a25c; margin-right: -.42em; }
#hunt-chain .hc-bar { display: block; width: 120px; height: 3px; margin-top: 6px; background: rgba(255,255,255,.1); box-shadow: 0 0 0 1px rgba(201,162,92,.3); }
#hunt-chain .hc-bar > i { display: block; height: 100%; background: #e8c478; transform-origin: right; box-shadow: 0 0 10px #e8c478; }
#hunt-chain.punch .hc-n { animation: hcPunch .24s cubic-bezier(.2,1.6,.4,1); }
@keyframes hcPunch { 0% { transform: scale(1.5) rotate(-4deg); } 100% { transform: none; } }
body.hunt-overdrive #hunt-chain .hc-n { color: #ff9a52; text-shadow: 0 0 26px rgba(255,140,66,.85), 3px 3px 0 rgba(0,0,0,.65); }
body.hunt-overdrive #hunt-chain .hc-l { color: #ff8c42; }
body.hunt-overdrive #hunt-chain .hc-bar > i { background: #ff8c42; box-shadow: 0 0 12px #ff8c42; }
body.hunt-overdrive #hud .hud-card { border-color: rgba(255,140,66,.65); }
#event-banner.hunt { color: #ffc28f; border-color: rgba(255,140,66,.7); text-shadow: 0 0 12px rgba(255,140,66,.5); letter-spacing: .14em; }
@media (max-width: 760px) {
  #hunt-chain { right: 14px; top: 30%; }
  #hunt-chain .hc-n { font-size: 40px; }
}
@media (prefers-reduced-motion: reduce) { #hunt-chain.punch .hc-n { animation: none; } }

/* ── B9 CONTRACTS board ─────────────────────────────────────────────── */
#contracts { position: fixed; left: 24px; top: 104px; width: 262px; z-index: 44; pointer-events: none;
  display: flex; flex-direction: column; gap: 6px; font-family: "Space Grotesk", system-ui, sans-serif; }
#contracts .ct-head { font: 700 9px/1 "Space Grotesk", monospace; letter-spacing: .32em; color: #c9a25c; display: flex; justify-content: space-between; }
#contracts .ct-head b { color: #8aa1a4; font-weight: 600; letter-spacing: .14em; }
#contracts .ct { position: relative; padding: 7px 10px 8px; color: #e8f0ee;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.02) 0 1px, transparent 1px 3px), linear-gradient(90deg, rgba(10,22,32,.82), rgba(4,9,15,.55));
  border-left: 2px solid rgba(201,162,92,.75); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: border-color .2s, background .2s; }
#contracts .ct-t { font: 600 11px/1.3 "Space Grotesk", sans-serif; letter-spacing: .05em; display: flex; justify-content: space-between; gap: 8px; }
#contracts .ct-t span:last-child { font-variant-numeric: tabular-nums; color: #e8c478; white-space: nowrap; }
#contracts .ct-r { font: 600 8.5px/1.4 "Space Grotesk", monospace; letter-spacing: .16em; color: #8aa1a4; text-transform: uppercase; margin-top: 2px; }
#contracts .ct-bar { height: 2px; margin-top: 5px; background: rgba(255,255,255,.08); }
#contracts .ct-bar > i { display: block; height: 100%; background: #e8c478; box-shadow: 0 0 8px rgba(232,196,120,.7); transition: width .25s; }
#contracts .ct.done { border-left-color: #5ef2e0; background: linear-gradient(90deg, rgba(94,242,224,.22), rgba(4,9,15,.5)); }
#contracts .ct.done .ct-t span:last-child { color: #5ef2e0; }
#contracts .ct.bump { animation: ctBump .3s ease-out; }
@keyframes ctBump { 0% { transform: translateX(6px); } 100% { transform: none; } }
#hud[style*="display: none"] ~ #contracts, body.gc-zone #contracts { opacity: .85; }
@media (max-width: 760px) {
  #contracts { top: 200px; left: 12px; width: 200px; }
  #contracts .ct:not(:nth-child(2)) { display: none; }
}
@media (prefers-reduced-motion: reduce) { #contracts .ct.bump { animation: none; } }

/* ── B10 boss bar ───────────────────────────────────────────────────── */
#boss-bar { position: fixed; top: 138px; left: 50%; transform: translateX(-50%); width: min(560px, 84vw);
  z-index: 45; pointer-events: none; --bb: #ff3366; text-align: center; }
#boss-bar[hidden] { display: none; }
#boss-bar .bb-name { font: 700 12px/1 "Outfit", system-ui, sans-serif; letter-spacing: .42em; color: #f2f5f4;
  text-shadow: 0 0 14px var(--bb); margin-bottom: 7px; }
#boss-bar .bb-name b { color: var(--bb); margin-left: .8em; letter-spacing: .22em; font-size: 9px; }
#boss-bar .bb-track { position: relative; height: 9px; background: rgba(4,9,15,.8); border: 1px solid rgba(201,162,92,.65);
  clip-path: polygon(7px 0, 100% 0, calc(100% - 7px) 100%, 0 100%); }
#boss-bar .bb-hp { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, var(--bb), rgba(255,255,255,.35));
  box-shadow: 0 0 14px var(--bb); transition: width .15s; }
#boss-bar .bb-sh { position: absolute; left: 0; top: 0; height: 3px; background: #5ef2e0; box-shadow: 0 0 8px #5ef2e0; transition: width .15s; }
#boss-bar .bb-track s { position: absolute; top: 0; bottom: 0; width: 2px; background: #c9a25c; }
@media (max-width: 760px) { #boss-bar { top: 64px; } #boss-bar .bb-name { font-size: 10px; letter-spacing: .28em; } }
@media (prefers-reduced-motion: reduce) { #boss-bar .bb-hp, #boss-bar .bb-sh { transition: none; } }
