/* HELION RIFT — UI stylesheet (owner: ui). Linked by index.html / sandbox.html (ui.js links it if missing).
   Visual language: ice-cyan primary, amber caution, red danger; thin 1–2 px lines, angled corner brackets,
   skewed panels, subtle glow, tabular numerals, eased 150–300 ms motion. All sizes scale with --hx-s (HUD) /
   --hx-m (menus), set by the UI on resize (× Settings → HUD scale). Text never drops below --hx-min (labels) /
   --hx-min-s (tiny tags): font-size: max(var(--hx-min), calc(Npx * var(--hx-s))). Prefix: hx-. The core boot
   overlay (.hr-boot) is restyled at the end of this file into the title's logo lockup, so loading hands over to
   the title without a second loader.
   Fonts: Saira / Saira Condensed from Google Fonts when online; offline the embedded 'HX Condensed' and
   'JetBrains Mono' (src/ui/fonts.js) and macOS faces (Avenir Next [Condensed], Menlo) take over. */

/* ============================================================================================================
   base
   ============================================================================================================ */
#ui-root {
  color: #9ff3ff;
  font-family: 'Saira Condensed', 'HX Condensed', 'Avenir Next Condensed', 'Roboto Condensed', 'Arial Narrow', system-ui, sans-serif;
}
#ui-root button, #ui-root a, #ui-root input, #ui-root select { pointer-events: auto; }
html.hx-nocursor, html.hx-nocursor body, html.hx-nocursor canvas, html.hx-nocursor #ui-root * { cursor: none !important; }

.hx-root {
  --hx-s: 1;
  --hx-m: 1;
  --c: #9ff3ff;
  --c-hi: #e6fdff;
  --c-mid: rgba(159, 243, 255, 0.72);
  --c-dim: rgba(159, 243, 255, 0.5);
  --c-lbl: rgba(170, 240, 252, 0.76);   /* small text labels: never below ~0.7 alpha over the ink backing */
  --c-faint: rgba(159, 243, 255, 0.16);
  --c-ghost: rgba(159, 243, 255, 0.07);
  --amber: #ffb547;
  --amber-dim: rgba(255, 181, 71, 0.55);
  --red: #ff4d5e;
  --red-dim: rgba(255, 77, 94, 0.5);
  --white: #f3fcff;
  --ink: rgba(2, 7, 13, 0.74);
  --ink-soft: rgba(2, 7, 13, 0.5);
  --f-cond: 'Saira Condensed', 'HX Condensed', 'Avenir Next Condensed', 'Roboto Condensed', 'Arial Narrow', system-ui, sans-serif;
  --f-sans: 'Saira', 'Avenir Next', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --f-mono: 'JetBrains Mono', Menlo, ui-monospace, 'SF Mono', Consolas, 'Liberation Mono', monospace;
  --hx-min: 11px;       /* readable floor for HUD / menu labels (720p and up) */
  --hx-min-s: 10px;     /* floor for tiny tags (boss segment names, phone HUD) */
  --hx-sub: 1;          /* Settings → Subtitle size */
  --hx-subbg: 0;        /* Settings → Subtitle backing: 0 standard, 1 dark, 2 solid */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --glow: 0 0 calc(10px * var(--hx-s)) rgba(111, 232, 255, 0.35);
  position: absolute;
  inset: 0;
  pointer-events: none;
  color: var(--c);
  font-family: var(--f-cond);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
  line-height: 1.2;
}
.hx-root *, .hx-root *::before, .hx-root *::after { box-sizing: border-box; }
.hx-root h1, .hx-root h2, .hx-root p { margin: 0; }
.hx-root .hx-gone { display: none !important; }
.hx-root svg { display: block; }

/* shared little label */
.hx-kick {
  font: 500 max(var(--hx-min), calc(11px * var(--hx-m))) / 1.2 var(--f-mono);
  letter-spacing: 0.42em;
  color: var(--c-lbl);
  text-transform: uppercase;
}
.hx-kick i { font-style: normal; color: var(--c-faint); margin: 0 0.4em; }
.hx-kick-amber { color: var(--amber); }
.hx-kick-red { color: var(--red); }

/* ============================================================================================================
   HUD — container + canvas
   ============================================================================================================ */
.hx-hud {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--ease), visibility 0s linear 0.35s;
}
.hx-hud.hx-on { opacity: 1; visibility: visible; transition: opacity 0.35s var(--ease); }
.hx-hud.hx-cine > :not(.hx-cv) { opacity: 0; transition: opacity 0.4s var(--ease); }
.hx-hud > * { transition: opacity 0.4s var(--ease); }
.hx-cv { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }
.hx-nohud .hx-hud, .hx-nohud .hx-ovl { display: none !important; }

/* ---- top-left: section / progress / objective -------------------------------------------------------------- */
.hx-tl {
  position: absolute;
  left: calc(34px * var(--hx-s) + env(safe-area-inset-left, 0px));
  top: calc(28px * var(--hx-s) + env(safe-area-inset-top, 0px));
  width: calc(380px * var(--hx-s));
  padding: calc(8px * var(--hx-s)) calc(14px * var(--hx-s)) calc(10px * var(--hx-s)) calc(12px * var(--hx-s));
  border-left: 2px solid var(--c-mid);
  isolation: isolate;
}
.hx-tl::after, .hx-tr::after, .hx-status::after, .hx-weap::after { /* feathered readability backing */
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  inset: calc(-26px * var(--hx-s)) calc(-70px * var(--hx-s)) calc(-26px * var(--hx-s)) calc(-36px * var(--hx-s));
  background: radial-gradient(farthest-side at 18% 50%, rgba(1, 5, 11, 0.62), rgba(1, 5, 11, 0.3) 55%, rgba(1, 5, 11, 0));
}
/* the objective line runs long to the right, often over a bright hull / ring: a soft left-to-right shade under it */
.hx-tl::after {
  background:
    radial-gradient(farthest-side at 18% 50%, rgba(1, 5, 11, 0.62), rgba(1, 5, 11, 0.3) 55%, rgba(1, 5, 11, 0)),
    radial-gradient(farthest-side at 0% 50%, rgba(1, 4, 9, 0.45), rgba(1, 4, 9, 0.4) 62%, rgba(1, 4, 9, 0));
}
.hx-tr::after, .hx-weap::after {
  inset: calc(-26px * var(--hx-s)) calc(-36px * var(--hx-s)) calc(-26px * var(--hx-s)) calc(-70px * var(--hx-s));
  background: radial-gradient(farthest-side at 82% 50%, rgba(1, 5, 11, 0.62), rgba(1, 5, 11, 0.3) 55%, rgba(1, 5, 11, 0));
}
.hx-sec { display: flex; align-items: baseline; gap: calc(12px * var(--hx-s)); white-space: nowrap; }
.hx-sec-idx { font: 500 max(var(--hx-min), calc(10px * var(--hx-s))) / 1 var(--f-mono); letter-spacing: 0.3em; color: var(--c-lbl); }
.hx-sec-name {
  font: 600 calc(17px * var(--hx-s)) / 1 var(--f-cond);
  letter-spacing: 0.28em;
  color: var(--white);
  text-shadow: 0 0 12px rgba(111, 232, 255, 0.3);
}
.hx-prog {
  position: relative;
  margin-top: calc(8px * var(--hx-s));
  width: calc(230px * var(--hx-s));
  height: 2px;
  background: var(--c-faint);
}
.hx-prog i {
  position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, rgba(159, 243, 255, 0.4), var(--c));
  box-shadow: 0 0 6px rgba(159, 243, 255, 0.6);
}
.hx-prog::after { /* end tick */
  content: ''; position: absolute; right: -1px; top: -3px; width: 1px; height: 8px; background: var(--c-dim);
}
.hx-obj {
  display: flex; align-items: flex-start; gap: calc(9px * var(--hx-s));
  margin-top: calc(9px * var(--hx-s));
  font: 500 max(13px, calc(14.5px * var(--hx-s))) / 1.35 var(--f-sans);
  color: #d9f7ff;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  opacity: 0;
}
.hx-obj.hx-on { opacity: 1; }
.hx-bannered .hx-tl > * { opacity: 0; transition: opacity 0.3s var(--ease); }
.hx-tl > * { transition: opacity 0.5s var(--ease); }
.hx-obj b {
  flex: none; width: calc(7px * var(--hx-s)); height: calc(7px * var(--hx-s)); margin-top: calc(6px * var(--hx-s));
  border: 1.5px solid var(--amber); transform: rotate(45deg); box-shadow: 0 0 6px rgba(255, 181, 71, 0.6);
}

/* ---- top-right: score --------------------------------------------------------------------------------------- */
.hx-tr {
  position: absolute;
  right: calc(34px * var(--hx-s) + env(safe-area-inset-right, 0px));
  top: calc(22px * var(--hx-s) + env(safe-area-inset-top, 0px));
  display: flex; flex-direction: column; align-items: flex-end;
  padding: calc(6px * var(--hx-s)) calc(12px * var(--hx-s)) calc(8px * var(--hx-s)) calc(40px * var(--hx-s));
  border-right: 2px solid var(--c-mid);
  isolation: isolate;
}
.hx-score-lbl { font: 500 max(var(--hx-min), calc(10px * var(--hx-s))) / 1 var(--f-mono); letter-spacing: 0.4em; color: var(--c-lbl); margin-right: -0.4em; }
.hx-score {
  display: flex; align-items: flex-end;
  margin-top: calc(4px * var(--hx-s));
  font: 800 calc(42px * var(--hx-s)) / 1 var(--f-cond);
  letter-spacing: 0.02em;
  color: var(--white);
  text-shadow: 0 0 16px rgba(111, 232, 255, 0.35), 0 2px 3px rgba(0, 0, 0, 0.6);
}
.hx-dcol { display: inline-block; height: 1em; line-height: 1em; width: 0.56em; text-align: center; transition: opacity 0.3s; }
.hx-dsep { display: inline-block; width: 0.22em; text-align: center; transition: opacity 0.3s; }
.hx-dcol.hx-z, .hx-dsep.hx-z { opacity: 0.16; }
.hx-score { transition: color 0.25s, text-shadow 0.25s; }
.hx-score.hx-counting { color: #ffffff; text-shadow: 0 0 20px rgba(159, 243, 255, 0.75), 0 0 4px rgba(200, 250, 255, 0.9), 0 2px 3px rgba(0, 0, 0, 0.6); }
.hx-combo {
  display: grid; grid-template-columns: auto auto; align-items: center; column-gap: calc(10px * var(--hx-s));
  margin-top: calc(6px * var(--hx-s));
  opacity: 0; transform: translate3d(0, -4px, 0);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.hx-combo.hx-on { opacity: 1; transform: none; }
.hx-mult {
  grid-row: span 2;
  font: 800 calc(34px * var(--hx-s)) / 0.9 var(--f-cond);
  color: var(--amber);
  text-shadow: 0 0 14px rgba(255, 181, 71, 0.55);
  letter-spacing: 0.02em;
}
.hx-combo.hx-hot .hx-mult { color: #ffd98a; text-shadow: 0 0 18px rgba(255, 170, 60, 0.9); }
.hx-chain { display: flex; align-items: baseline; gap: 0.4em; justify-content: flex-end; }
.hx-chain b { font: 700 calc(17px * var(--hx-s)) / 1 var(--f-cond); color: var(--white); letter-spacing: 0.06em; }
.hx-chain em { font: 500 max(var(--hx-min), calc(9.5px * var(--hx-s))) / 1 var(--f-mono); font-style: normal; letter-spacing: 0.3em; color: rgba(255, 196, 110, 0.82); }
.hx-ctimer { position: relative; width: calc(96px * var(--hx-s)); height: 3px; background: rgba(255, 181, 71, 0.16); }
.hx-ctimer i { position: absolute; inset: 0; transform-origin: 100% 50%; background: var(--amber); box-shadow: 0 0 6px rgba(255, 181, 71, 0.7); }
.hx-gain {
  margin-top: calc(4px * var(--hx-s));
  font: 700 calc(15px * var(--hx-s)) / 1 var(--f-cond); letter-spacing: 0.12em; color: var(--amber);
  opacity: 0; white-space: nowrap;
}
.hx-muted {
  display: none; align-items: center; gap: 6px; margin-top: calc(6px * var(--hx-s));
  font: 500 max(var(--hx-min), calc(10px * var(--hx-s))) / 1 var(--f-mono); letter-spacing: 0.3em; color: var(--amber);
}
.hx-muted svg { width: calc(14px * var(--hx-s)); height: calc(14px * var(--hx-s)); }
.hx-muted.hx-on { display: flex; }

/* ---- top-centre: boss bar ----------------------------------------------------------------------------------- */
.hx-boss {
  position: absolute; left: 50%; top: calc(24px * var(--hx-s) + env(safe-area-inset-top, 0px));
  width: calc(660px * var(--hx-s)); max-width: 46vw;
  transform: translate3d(-50%, -8px, 0);
  opacity: 0; visibility: hidden;
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), visibility 0s 0.5s;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}
.hx-boss.hx-on { opacity: 1; visibility: visible; transform: translate3d(-50%, 0, 0); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
.hx-boss::before { /* soft shade: the sublabels stay readable under crossing beams and bright hulls */
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  inset: calc(-16px * var(--hx-s)) calc(-56px * var(--hx-s)) calc(-20px * var(--hx-s));
  background: radial-gradient(closest-side, rgba(1, 4, 9, 0.5), rgba(1, 4, 9, 0.4) 62%, rgba(1, 4, 9, 0));
}
.hx-boss-head { display: flex; align-items: baseline; gap: calc(12px * var(--hx-s)); margin-bottom: calc(7px * var(--hx-s)); white-space: nowrap; }
.hx-boss-name {
  font: 800 calc(21px * var(--hx-s)) / 1 var(--f-cond); letter-spacing: 0.34em; color: #ffe3e6;
  text-shadow: 0 0 14px rgba(255, 77, 94, 0.65);
}
.hx-boss-sub { font: 500 max(var(--hx-min-s), calc(9.5px * var(--hx-s))) / 1 var(--f-mono); letter-spacing: 0.2em; color: rgba(255, 180, 188, 0.86); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9); }
.hx-boss-phase {
  margin-left: auto; font: 600 max(var(--hx-min), calc(11.5px * var(--hx-s))) / 1 var(--f-mono); letter-spacing: 0.2em; color: var(--amber);
}
.hx-boss-bar { display: flex; gap: calc(3px * var(--hx-s)); height: calc(13px * var(--hx-s)); padding: 0 calc(4px * var(--hx-s)); }
.hx-bseg {
  position: relative; flex: 1 1 0; min-width: 0;
  background: rgba(255, 77, 94, 0.1);
  border: 1px solid rgba(255, 77, 94, 0.45);
  transform: skewX(-24deg);
}
.hx-bseg.hx-bgap { margin-left: calc(9px * var(--hx-s)); }
.hx-bseg i {
  position: absolute; inset: 1px; transform-origin: 0 50%;
  background: linear-gradient(180deg, #ff8791, #ff3048 70%, #c0162c);
  box-shadow: 0 0 10px rgba(255, 60, 80, 0.55);
  transition: opacity 0.3s;
}
.hx-bseg span {
  position: absolute; left: 0; right: 0; top: calc(100% + 5px * var(--hx-s)); transform: skewX(24deg);
  font: 500 max(var(--hx-min-s), calc(8.5px * var(--hx-s))) / 1 var(--f-mono); letter-spacing: 0.08em; color: rgba(255, 186, 192, 0.85);
  text-align: center; white-space: nowrap; overflow: hidden;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}
.hx-bseg span em { font-style: normal; }
.hx-bseg.hx-bs-sealed { border-color: rgba(255, 77, 94, 0.22); background: repeating-linear-gradient(-45deg, rgba(255, 77, 94, 0.14) 0 3px, transparent 3px 7px); }
.hx-bseg.hx-bs-sealed i { opacity: 0.22; }
.hx-bseg.hx-bs-sealed span { color: rgba(255, 176, 184, 0.64); }
.hx-bseg.hx-bs-live { border-color: #ff8c97; box-shadow: 0 0 10px rgba(255, 77, 94, 0.45); }
.hx-bseg.hx-bs-live span { color: #ffd0d5; }
.hx-bseg.hx-bs-dead {
  border-color: rgba(255, 110, 124, 0.38);
  background: linear-gradient(to top right, rgba(30, 4, 8, 0.72) calc(50% - 1px), rgba(255, 110, 124, 0.55) 50%, rgba(30, 4, 8, 0.72) calc(50% + 1px));
}
.hx-bseg.hx-bs-dead i { opacity: 0; }
.hx-bseg.hx-bs-dead span { color: rgba(255, 150, 160, 0.62); text-decoration: line-through; }

/* ---- incoming missile warning -------------------------------------------------------------------------------- */
.hx-mwarn {
  position: absolute; left: 50%; top: 18.5%;
  display: flex; align-items: center; gap: calc(12px * var(--hx-s));
  padding: calc(6px * var(--hx-s)) calc(30px * var(--hx-s));
  transform: translate3d(-50%, 0, 0);
  font: 700 calc(15px * var(--hx-s)) / 1 var(--f-cond); letter-spacing: 0.36em; color: #fff1f3;
  background: linear-gradient(90deg, rgba(90, 0, 14, 0), rgba(90, 0, 14, 0.78) 22%, rgba(90, 0, 14, 0.78) 78%, rgba(90, 0, 14, 0));
  border-top: 1px solid rgba(255, 77, 94, 0.5); border-bottom: 1px solid rgba(255, 77, 94, 0.5);
  text-shadow: 0 0 10px rgba(255, 60, 80, 0.9), 0 1px 2px rgba(0, 0, 0, 0.8);
  opacity: 0; visibility: hidden;
  transition: opacity 0.2s, visibility 0s 0.2s;
}
/* the plate strobes, the words stay readable */
.hx-mwarn.hx-on { opacity: 1; visibility: visible; transition: opacity 0.15s; animation: hx-strobe 0.5s steps(2, jump-none) infinite; }
.hx-bossfight .hx-mwarn { top: calc(96px * var(--hx-s) + 4%); }
/* a hazard warning (.hx-warned, set by hud.js while it shows) owns the slot at 15.5 %: the missile warning drops just
   below its plate. In the boss fight the warning always sits under the missile slot (see .hx-bossfight .hx-warn). */
.hx-warned:not(.hx-bossfight):not(.hx-compact) .hx-mwarn { top: calc(15.5% + 94px * var(--hx-s)); }
.hx-mwarn b { font: 800 calc(17px * var(--hx-s)) / 1 var(--f-cond); color: var(--red); letter-spacing: 0.1em; }
.hx-mwarn i { width: 0; height: 0; border: calc(6px * var(--hx-s)) solid transparent; }
.hx-mwarn i:first-child { border-right-color: var(--red); border-left: 0; }
.hx-mwarn i:last-child { border-left-color: var(--red); border-right: 0; }

/* ---- bottom-left: ship status ------------------------------------------------------------------------------- */
.hx-status {
  position: absolute;
  left: calc(34px * var(--hx-s) + env(safe-area-inset-left, 0px));
  bottom: calc(32px * var(--hx-s) + env(safe-area-inset-bottom, 0px));
  width: calc(340px * var(--hx-s));
  padding: calc(9px * var(--hx-s)) calc(26px * var(--hx-s)) calc(10px * var(--hx-s)) calc(14px * var(--hx-s));
  border-left: 2px solid var(--c-mid);
  isolation: isolate;
}
.hx-status::before { /* corner bracket */
  content: ''; position: absolute; left: -2px; top: calc(-7px * var(--hx-s)); width: calc(26px * var(--hx-s)); height: calc(7px * var(--hx-s));
  border-top: 1px solid var(--c-dim); border-left: 2px solid var(--c-mid);
}
.hx-call { display: flex; align-items: center; justify-content: space-between; margin-bottom: calc(7px * var(--hx-s)); }
.hx-call-id { font: 600 max(var(--hx-min), calc(12px * var(--hx-s))) / 1 var(--f-cond); letter-spacing: 0.32em; color: var(--c-lbl); }
.hx-lives { display: flex; gap: calc(4px * var(--hx-s)); }
.hx-lives i { display: block; width: calc(15px * var(--hx-s)); height: calc(11px * var(--hx-s)); color: var(--c-faint); transition: color 0.3s; }
.hx-lives i svg { width: 100%; height: 100%; }
.hx-lives i path { fill: currentColor; }
.hx-lives i.hx-on { color: var(--c); filter: drop-shadow(0 0 3px rgba(159, 243, 255, 0.6)); }
.hx-lives i.hx-hide { display: none; }

.hx-row {
  display: grid; grid-template-columns: max(calc(34px * var(--hx-s)), 2.9em) 1fr max(calc(40px * var(--hx-s)), 3.7em);
  align-items: center; column-gap: calc(10px * var(--hx-s));
  height: max(15px, calc(19px * var(--hx-s)));
  font-size: max(var(--hx-min), calc(10.5px * var(--hx-s)));
}
.hx-row > b { font: 500 max(var(--hx-min), calc(10.5px * var(--hx-s))) / 1 var(--f-mono); letter-spacing: 0.12em; color: var(--c-lbl); }
.hx-val {
  font: 600 max(13px, calc(15px * var(--hx-s))) / 1 var(--f-cond); letter-spacing: 0.04em; color: var(--white); text-align: right;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}
.hx-bar {
  position: relative; height: calc(10px * var(--hx-s));
  background: rgba(159, 243, 255, 0.09);
  box-shadow: inset 0 0 0 1px rgba(159, 243, 255, 0.14);
  transform: skewX(-24deg);
  overflow: hidden;
}
.hx-bar.hx-thin { height: calc(5px * var(--hx-s)); }
.hx-bar i { position: absolute; inset: 0; transform-origin: 0 50%; will-change: transform; }
.hx-bar::after { /* segment gaps */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 calc(13px * var(--hx-s) - 2px), rgba(1, 5, 10, 0.85) calc(13px * var(--hx-s) - 2px) calc(13px * var(--hx-s)));
}
.hx-bar.hx-thin::after { display: none; }
.hx-fill { background: linear-gradient(180deg, #d9fcff, #8eeeff 55%, #4fc8e6); box-shadow: 0 0 10px rgba(111, 232, 255, 0.55); }
.hx-ghost { background: rgba(255, 255, 255, 0.85); }
.hx-shield.hx-low .hx-fill { background: linear-gradient(180deg, #e7fdff, #9ff3ff); }
.hx-shield.hx-empty > b { color: var(--amber); }
.hx-hull .hx-fill { background: linear-gradient(180deg, #ffffff, #dbe6ec 55%, #aebfc9); box-shadow: 0 0 8px rgba(220, 240, 250, 0.35); }
.hx-hull .hx-ghost { background: #ff4d5e; }
.hx-hull.hx-warnc .hx-fill { background: linear-gradient(180deg, #ffe3b0, #ffb547); box-shadow: 0 0 10px rgba(255, 181, 71, 0.6); }
.hx-hull.hx-crit .hx-fill { background: linear-gradient(180deg, #ffb0b8, #ff4d5e); box-shadow: 0 0 12px rgba(255, 77, 94, 0.8); animation: hx-pulse 0.7s ease-in-out infinite alternate; }
.hx-hull.hx-crit > b, .hx-hull.hx-crit .hx-val { color: var(--red); }
/* critical hull: the whole HUL row frame breathes red (slow opacity pulse, no hard blink) */
.hx-hull.hx-crit { position: relative; }
.hx-hull.hx-crit::before {
  content: ''; position: absolute; inset: calc(-3px * var(--hx-s)) calc(-6px * var(--hx-s)); pointer-events: none;
  border: 1px solid rgba(255, 77, 94, 0.85); box-shadow: 0 0 12px rgba(255, 60, 80, 0.55), inset 0 0 10px rgba(255, 60, 80, 0.25);
  animation: hx-alertPulse 1.1s ease-in-out infinite alternate;
}
.hx-boost .hx-fill { background: linear-gradient(90deg, rgba(159, 243, 255, 0.45), #bff8ff); box-shadow: none; }
.hx-boost.hx-active .hx-fill { background: linear-gradient(90deg, #7fe8ff, #ffffff); box-shadow: 0 0 12px rgba(159, 243, 255, 0.9); }
.hx-boost.hx-brake .hx-fill { background: linear-gradient(90deg, rgba(255, 181, 71, 0.5), #ffd28a); }
.hx-boost.hx-dry .hx-fill { background: rgba(255, 77, 94, 0.7); }
.hx-bstate { font: 600 max(var(--hx-min-s), calc(9.5px * var(--hx-s))) / 1 var(--f-mono); letter-spacing: 0.1em; color: var(--c-hi); text-align: right; white-space: nowrap; justify-self: end; }
.hx-boost.hx-brake .hx-bstate { color: var(--amber); }
.hx-boost.hx-dry .hx-bstate { color: var(--red); }
.hx-alert {
  height: 0; overflow: hidden; margin-top: 0;
  font: 700 max(12px, calc(13px * var(--hx-s))) / 1.3 var(--f-mono); letter-spacing: 0.3em;
  transition: height 0.2s, margin 0.2s;
}
.hx-alert.hx-on { height: 1.3em; margin-top: calc(6px * var(--hx-s)); animation: hx-alertPulse 1.1s ease-in-out infinite alternate; }
.hx-alert.hx-red { color: #ff6a78; text-shadow: 0 0 10px rgba(255, 77, 94, 0.95), 0 1px 2px rgba(0, 0, 0, 0.8); }
.hx-alert.hx-amber { color: var(--amber); text-shadow: 0 0 8px rgba(255, 181, 71, 0.6); }

/* ---- bottom-right: weapons ---------------------------------------------------------------------------------- */
.hx-weap {
  position: absolute;
  right: calc(34px * var(--hx-s) + env(safe-area-inset-right, 0px));
  bottom: calc(32px * var(--hx-s) + env(safe-area-inset-bottom, 0px));
  width: calc(270px * var(--hx-s));
  padding: calc(10px * var(--hx-s)) calc(14px * var(--hx-s)) calc(11px * var(--hx-s)) calc(26px * var(--hx-s));
  border-right: 2px solid var(--c-mid);
  isolation: isolate;
  display: flex; flex-direction: column; gap: calc(8px * var(--hx-s)); align-items: flex-end;
}
.hx-weap::before {
  content: ''; position: absolute; right: -2px; top: calc(-7px * var(--hx-s)); width: calc(26px * var(--hx-s)); height: calc(7px * var(--hx-s));
  border-top: 1px solid var(--c-dim); border-right: 2px solid var(--c-mid);
}
.hx-wrow, .hx-mrow { display: flex; align-items: center; gap: calc(10px * var(--hx-s)); }
.hx-wlbl { font: 500 max(var(--hx-min), calc(10.5px * var(--hx-s))) / 1 var(--f-mono); letter-spacing: 0.2em; color: var(--c-lbl); }
.hx-wmk { font: 700 calc(19px * var(--hx-s)) / 1 var(--f-cond); letter-spacing: 0.14em; color: var(--white); min-width: calc(58px * var(--hx-s)); text-align: right; }
.hx-wpips, .hx-mpips { display: flex; gap: calc(3px * var(--hx-s)); }
.hx-wpips i, .hx-mpips i {
  display: block; width: calc(7px * var(--hx-s)); height: calc(15px * var(--hx-s));
  background: rgba(159, 243, 255, 0.12); box-shadow: inset 0 0 0 1px rgba(159, 243, 255, 0.22);
  transform: skewX(-20deg); transition: background 0.2s, box-shadow 0.2s;
}
.hx-wpips i.hx-on { background: var(--c); box-shadow: 0 0 8px rgba(111, 232, 255, 0.7); }
.hx-mpips i { width: calc(6px * var(--hx-s)); height: calc(13px * var(--hx-s)); }
.hx-mpips i.hx-on { background: #e8fbff; box-shadow: 0 0 6px rgba(200, 250, 255, 0.55); }
.hx-mpips i.hx-lk { background: var(--amber); box-shadow: 0 0 9px rgba(255, 181, 71, 0.9); }
.hx-mpips i.hx-hide { display: none; }
.hx-mcount { font: 700 calc(19px * var(--hx-s)) / 1 var(--f-cond); color: var(--white); min-width: calc(16px * var(--hx-s)); text-align: right; }
.hx-weap.hx-mempty .hx-mcount { color: var(--red); }

/* ---- right: pickup feed --------------------------------------------------------------------------------------- */
.hx-feed {
  position: absolute; right: calc(34px * var(--hx-s) + env(safe-area-inset-right, 0px)); top: 34%;
  display: flex; flex-direction: column; align-items: flex-end; gap: calc(6px * var(--hx-s));
}
.hx-fitem {
  display: flex; align-items: baseline; gap: calc(8px * var(--hx-s));
  padding: calc(6px * var(--hx-s)) calc(12px * var(--hx-s)) calc(6px * var(--hx-s)) calc(34px * var(--hx-s));
  background: linear-gradient(270deg, rgba(2, 7, 13, 0.7), rgba(2, 7, 13, 0));
  border-right: 2px solid var(--fc, var(--c));
  opacity: 0; transform: translate3d(24px, 0, 0);
  transition: opacity 0.25s var(--ease), transform 0.3s var(--ease);
  white-space: nowrap;
}
.hx-fitem.hx-on { opacity: 1; transform: none; }
.hx-fitem b { font: 700 calc(15px * var(--hx-s)) / 1 var(--f-cond); letter-spacing: 0.2em; color: var(--white); }
.hx-fitem span { font: 500 max(var(--hx-min), calc(10px * var(--hx-s))) / 1 var(--f-mono); letter-spacing: 0.22em; color: var(--c); }
.hx-fitem.hx-p-missiles { --fc: var(--amber); }
.hx-fitem.hx-p-missiles span { color: var(--amber); }
.hx-fitem.hx-p-weapon { --fc: #ffe07a; }
.hx-fitem.hx-p-weapon span { color: #ffe07a; }

/* ---- dead-state message ------------------------------------------------------------------------------------ */
.hx-dead {
  position: absolute; left: 0; right: 0; top: 40%; text-align: center; isolation: isolate;
  opacity: 0; transition: opacity 0.3s;
}
.hx-dead::before { /* the same soft elliptical shade as the title card: readable over planets and ring lines */
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  inset: calc(-30px * var(--hx-s)) 18%;
  background: radial-gradient(closest-side, rgba(1, 4, 9, 0.6), rgba(1, 4, 9, 0.34) 55%, rgba(1, 4, 9, 0));
}
.hx-dead.hx-on { opacity: 1; transition: opacity 0.6s var(--ease) 0.7s; }
.hx-dead b {
  display: block; font: 800 calc(40px * var(--hx-s)) / 1 var(--f-cond); letter-spacing: 0.5em; margin-right: -0.5em;
  color: #ffd6da; text-shadow: 0 0 22px rgba(255, 60, 80, 0.8), 0 2px 4px rgba(0, 0, 0, 0.7);
}
.hx-dead span {
  display: block; margin-top: calc(12px * var(--hx-s)); font: 500 max(var(--hx-min), calc(12px * var(--hx-s))) / 1 var(--f-mono); letter-spacing: 0.4em; margin-right: -0.4em;
  color: rgba(255, 208, 213, 0.9); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95), 0 0 10px rgba(255, 60, 80, 0.45);
}

/* ============================================================================================================
   overlay (survives cinematics): radio, toast, section banner, warning, title card, fps
   ============================================================================================================ */
.hx-ovl { position: absolute; inset: 0; pointer-events: none; }

/* ---- radio ---------------------------------------------------------------------------------------------------- */
/* Centred between the ship-status panel (left, 34+340 u) and the weapons panel (right): the box never reaches
   either panel's inner edge. When that gap gets too narrow it moves up one row, above them (.hx-radio-up). */
.hx-radio {
  --tone: var(--c);
  --tone-dim: rgba(159, 243, 255, 0.35);
  position: absolute; left: 50%;
  bottom: calc(40px * var(--hx-s) + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: calc(16px * var(--hx-s));
  width: max-content;
  max-width: min(calc(820px * var(--hx-s)), calc(100vw - 2 * (374px * var(--hx-s) + 18px + env(safe-area-inset-left, 0px))));
  padding: calc(11px * var(--hx-s)) calc(22px * var(--hx-s)) calc(12px * var(--hx-s)) calc(12px * var(--hx-s));
  background: linear-gradient(90deg, rgba(2, 8, 14, calc(0.82 + 0.075 * var(--hx-subbg))), rgba(2, 8, 14, calc(0.62 + 0.175 * var(--hx-subbg))));
  border-left: 3px solid var(--tone);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
  transform: translate3d(-50%, 10px, 0);
  opacity: 0; visibility: hidden;
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease), visibility 0s 0.28s;
}
.hx-radio.hx-on { opacity: 1; visibility: visible; transform: translate3d(-50%, 0, 0); transition: opacity 0.22s var(--ease), transform 0.22s var(--ease); }
.hx-radio.hx-tone-command { --tone: var(--amber); --tone-dim: rgba(255, 181, 71, 0.35); }
.hx-radio.hx-tone-enemy { --tone: var(--red); --tone-dim: rgba(255, 77, 94, 0.4); }
.hx-port {
  flex: none; position: relative;
  width: calc(54px * var(--hx-s)); height: calc(54px * var(--hx-s));
  display: flex; align-items: center; justify-content: center; gap: calc(3px * var(--hx-s));
  border: 1px solid var(--tone-dim);
  background:
    linear-gradient(var(--tone-dim), var(--tone-dim)) left top / 8px 1px no-repeat,
    linear-gradient(var(--tone-dim), var(--tone-dim)) left top / 1px 8px no-repeat,
    radial-gradient(circle at 50% 55%, rgba(159, 243, 255, 0.1), rgba(0, 0, 0, 0) 70%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 3px);
}
.hx-port::after { /* sweep line */
  content: ''; position: absolute; left: 0; right: 0; height: 1px; top: 0; background: var(--tone); opacity: 0.35;
  animation: hx-scan 2.2s linear infinite;
}
.hx-port i {
  display: block; width: calc(3px * var(--hx-s)); height: calc(28px * var(--hx-s));
  background: var(--tone); box-shadow: 0 0 6px var(--tone);
  transform: scaleY(0.2); transform-origin: 50% 50%;
  animation: hx-eq 0.9s ease-in-out infinite alternate;
}
.hx-port i:nth-child(1) { animation-duration: 0.61s; }
.hx-port i:nth-child(2) { animation-duration: 0.47s; animation-delay: -0.2s; }
.hx-port i:nth-child(3) { animation-duration: 0.73s; animation-delay: -0.4s; }
.hx-port i:nth-child(4) { animation-duration: 0.39s; animation-delay: -0.1s; }
.hx-port i:nth-child(5) { animation-duration: 0.67s; animation-delay: -0.5s; }
.hx-port i:nth-child(6) { animation-duration: 0.52s; animation-delay: -0.3s; }
.hx-port i:nth-child(7) { animation-duration: 0.81s; animation-delay: -0.15s; }
.hx-radio:not(.hx-on) .hx-port i { animation-play-state: paused; }
.hx-tone-enemy .hx-port { animation: hx-glitch 2.8s steps(1) infinite; }
.hx-rbody { min-width: 0; }
.hx-rhead { display: flex; align-items: baseline; gap: calc(12px * var(--hx-s)); margin-bottom: calc(5px * var(--hx-s)); white-space: nowrap; }
.hx-rhead b { font: 700 max(13px, calc(14px * var(--hx-s) * var(--hx-sub))) / 1 var(--f-cond); letter-spacing: 0.28em; color: var(--tone); }
.hx-rhead em { font: 500 max(var(--hx-min-s), calc(9.5px * var(--hx-s))) / 1 var(--f-mono); font-style: normal; letter-spacing: 0.18em; color: rgba(205, 238, 247, 0.7); }
.hx-rtext {
  /* subtitles are the only story channel: never under 16 px, × Settings → Subtitle size */
  font: 500 max(calc(16px * var(--hx-sub)), calc(17px * var(--hx-s) * var(--hx-sub))) / 1.38 var(--f-sans); letter-spacing: 0.01em; color: #f2fbff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}
/* .hx-radio-up (set by hud.js when the gap between the panels is under ~560 px: narrow windows, big HUD scale) */
.hx-radio-up:not(.hx-compact) .hx-radio {
  bottom: calc(32px * var(--hx-s) + max(128px * var(--hx-s), 108px) + 14px + env(safe-area-inset-bottom, 0px));
  max-width: min(calc(820px * var(--hx-s)), calc(100vw - 48px));
}
.hx-w { display: inline-block; opacity: 0; animation: hx-word 0.32s var(--ease) forwards; }

/* ---- toast (checkpoint) ------------------------------------------------------------------------------------- */
.hx-toast {
  position: absolute; left: 50%; top: 13%;
  display: flex; align-items: center; gap: calc(12px * var(--hx-s));
  padding: calc(8px * var(--hx-s)) calc(34px * var(--hx-s));
  font: 700 calc(15px * var(--hx-s)) / 1 var(--f-cond); letter-spacing: 0.42em; color: var(--white);
  background: linear-gradient(90deg, rgba(2, 8, 14, 0), rgba(2, 8, 14, 0.7) 20%, rgba(2, 8, 14, 0.7) 80%, rgba(2, 8, 14, 0));
  border-top: 1px solid var(--c-faint); border-bottom: 1px solid var(--c-faint);
  transform: translate3d(-50%, 0, 0) scaleX(0.6);
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0s 0.3s;
  white-space: nowrap;
}
.hx-bossfight .hx-toast { top: calc(96px * var(--hx-s) + 8%); }
/* the beam warning outranks a kill toast in the same slot */
.hx-ovl:has(.hx-warn.hx-on) .hx-toast { opacity: 0; }
.hx-toast.hx-on { opacity: 1; visibility: visible; transform: translate3d(-50%, 0, 0); transition: opacity 0.25s var(--ease), transform 0.3s var(--ease); }
.hx-toast-ico {
  width: calc(14px * var(--hx-s)); height: calc(14px * var(--hx-s)); border: 1.5px solid var(--c); transform: rotate(45deg);
  box-shadow: 0 0 8px rgba(159, 243, 255, 0.6), inset 0 0 0 3px rgba(2, 8, 14, 0.9), inset 0 0 0 10px var(--c);
}
.hx-toast.hx-kill { color: #ffe6e9; border-color: rgba(255, 77, 94, 0.35); text-shadow: 0 0 12px rgba(255, 60, 80, 0.7); }
.hx-toast.hx-kill .hx-toast-ico { border-color: var(--red); box-shadow: 0 0 8px rgba(255, 77, 94, 0.7), inset 0 0 0 3px rgba(2, 8, 14, 0.9), inset 0 0 0 10px var(--red); }

/* ---- section banner ---------------------------------------------------------------------------------------- */
/* section banner: high in the frame (below the top HUD rows, above the aim zone) */
.hx-banner {
  position: absolute; left: 0; right: 0; top: 13%; text-align: center; pointer-events: none;
  opacity: 0; visibility: hidden; transition: opacity 0.6s var(--ease), visibility 0s 0.6s;
}
.hx-banner.hx-on { opacity: 1; visibility: visible; transition: opacity 0.3s var(--ease); }
.hx-banner-idx { font: 500 max(var(--hx-min), calc(12px * var(--hx-s))) / 1 var(--f-mono); letter-spacing: 0.6em; margin-right: -0.6em; color: var(--amber); }
.hx-banner-name {
  position: relative; display: inline-block;
  margin-top: calc(12px * var(--hx-s)); padding: calc(4px * var(--hx-s)) calc(40px * var(--hx-s));
  font: 800 calc(52px * var(--hx-s)) / 1 var(--f-cond); letter-spacing: 0.3em; margin-right: -0.3em; color: var(--white);
  text-shadow: 0 0 26px rgba(111, 232, 255, 0.45), 0 2px 4px rgba(0, 0, 0, 0.6);
}
.hx-banner-name::before, .hx-banner-name::after {
  content: ''; position: absolute; top: 50%; width: calc(90px * var(--hx-s)); height: 1px;
  background: linear-gradient(90deg, rgba(159, 243, 255, 0), var(--c));
}
.hx-banner-name::before { right: 100%; }
.hx-banner-name::after { left: 100%; transform: scaleX(-1); }
.hx-banner-obj { margin-top: calc(10px * var(--hx-s)); font: 500 max(13px, calc(14px * var(--hx-s))) / 1.3 var(--f-sans); letter-spacing: 0.12em; color: var(--c-hi); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9); }
/* a checkpoint at the section change joins the banner as one small tag (no separate centre toast) */
.hx-banner-cp {
  display: none; align-items: center; justify-content: center; gap: 0.7em;
  margin-top: calc(9px * var(--hx-s));
  font: 600 max(var(--hx-min), calc(11px * var(--hx-s))) / 1 var(--f-mono); letter-spacing: 0.34em; margin-right: -0.34em;
  color: #bdf8ff; text-shadow: 0 0 10px rgba(111, 232, 255, 0.5), 0 1px 2px rgba(0, 0, 0, 0.9);
}
.hx-banner-cp.hx-on { display: flex; }
.hx-banner-cp i { width: 0.75em; height: 0.75em; border: 1.5px solid var(--c); transform: rotate(45deg); box-shadow: inset 0 0 0 2px rgba(2, 8, 14, 0.9), inset 0 0 0 6px var(--c); }
.hx-banner.hx-on .hx-banner-cp { animation: hx-fadeUp 0.6s var(--ease) 0.45s both; }
.hx-banner.hx-on .hx-banner-name { animation: hx-bannerIn 0.9s var(--ease) both; }
.hx-banner.hx-on .hx-banner-idx, .hx-banner.hx-on .hx-banner-obj { animation: hx-fadeUp 0.7s var(--ease) 0.25s both; }
.hx-banner.hx-on .hx-banner-name::before, .hx-banner.hx-on .hx-banner-name::after { animation: hx-lineIn 0.9s var(--ease) 0.15s both; }

/* ---- warning banner (hazard stripes) ------------------------------------------------------------------------ */
.hx-warn {
  position: absolute; left: 50%; top: 15.5%;
  width: calc(560px * var(--hx-s)); max-width: 88vw;
  transform: translate3d(-50%, 0, 0) scaleY(0.2);
  opacity: 0; visibility: hidden;
  transition: opacity 0.2s, transform 0.25s var(--ease), visibility 0s 0.25s;
}
.hx-warn.hx-on { opacity: 1; visibility: visible; transform: translate3d(-50%, 0, 0); transition: opacity 0.15s, transform 0.25s var(--ease); }
.hx-haz {
  height: calc(7px * var(--hx-s));
  background: repeating-linear-gradient(-45deg, #ff4d5e 0 calc(10px * var(--hx-s)), rgba(40, 0, 6, 0.55) calc(10px * var(--hx-s)) calc(20px * var(--hx-s)));
  background-size: calc(28.28px * var(--hx-s)) 100%;
  box-shadow: 0 0 14px rgba(255, 60, 80, 0.5);
  animation: hx-haz 0.9s linear infinite;
  opacity: 0.9;
}
.hx-warn-body {
  padding: calc(8px * var(--hx-s)) 0 calc(9px * var(--hx-s));
  background: linear-gradient(90deg, rgba(34, 0, 7, 0.45), rgba(34, 0, 7, 0.86) 28%, rgba(34, 0, 7, 0.86) 72%, rgba(34, 0, 7, 0.45));
  text-align: center;
}
/* flashes between white-hot and red — never drops out, so it reads over bright planets */
.hx-warn-t {
  font: 800 calc(30px * var(--hx-s)) / 1 var(--f-cond); letter-spacing: 0.62em; margin-right: -0.62em; color: #ff5f6f;
  text-shadow: 0 0 18px rgba(255, 60, 80, 0.95), 0 2px 3px rgba(0, 0, 0, 0.7);
  animation: hx-warnflash 0.6s steps(2, jump-none) infinite;
}
.hx-warn-s { margin-top: calc(6px * var(--hx-s)); font: 600 max(12px, calc(12.5px * var(--hx-s))) / 1.2 var(--f-mono); letter-spacing: 0.3em; color: #ffe1e4; }
/* boss fight: under the boss bar and the missile warning (its slot is 96 u + 4 % tall 31 u: a 9 u gap), compact, and
   see-through (the reticle is often up here) */
.hx-bossfight .hx-warn { top: calc(136px * var(--hx-s) + 4%); width: calc(480px * var(--hx-s)); }
.hx-bossfight .hx-warn-body { padding: calc(5px * var(--hx-s)) 0 calc(6px * var(--hx-s)); background: linear-gradient(90deg, rgba(34, 0, 7, 0.18), rgba(34, 0, 7, 0.4) 28%, rgba(34, 0, 7, 0.4) 72%, rgba(34, 0, 7, 0.18)); }
.hx-bossfight .hx-warn-t { font-size: calc(23px * var(--hx-s)); }
.hx-bossfight .hx-haz { height: calc(5px * var(--hx-s)); opacity: 0.7; }
.hx-warn-meter { display: none; position: relative; width: 60%; height: 3px; margin: calc(8px * var(--hx-s)) auto 0; background: rgba(255, 77, 94, 0.2); }
.hx-warn.hx-meter .hx-warn-meter { display: block; }
.hx-warn-meter i { position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(0); background: #ff6b79; box-shadow: 0 0 8px rgba(255, 77, 94, 0.9); }

/* ---- cinematic title card ------------------------------------------------------------------------------------ */
.hx-card {
  --cc: 159, 243, 255;
  position: absolute; left: 0; right: 0; top: 34%; text-align: center; isolation: isolate;
  padding: calc(34px * var(--hx-s)) 0;
  opacity: 0; visibility: hidden; transition: opacity 0.7s var(--ease), visibility 0s 0.7s;
}
.hx-card::before { /* soft elliptical shade — no hard-edged band over bright planets */
  content: ''; position: absolute; inset: 0 8%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(1, 4, 9, 0.6), rgba(1, 4, 9, 0.34) 55%, rgba(1, 4, 9, 0));
}
.hx-card-enemy { --cc: 255, 92, 108; }
.hx-card.hx-on { opacity: 1; visibility: visible; transition: opacity 0.2s; }
.hx-card.hx-out { opacity: 0; transition: opacity 0.7s var(--ease); }
.hx-card-line {
  position: relative;
  width: calc(620px * var(--hx-s)); max-width: 80vw; height: 1px; margin: 0 auto;
  background: linear-gradient(90deg, rgba(var(--cc), 0), rgba(var(--cc), 0.85), rgba(var(--cc), 0));
  transform: scaleX(0);
}
.hx-card-line::after { /* centre notch */
  content: ''; position: absolute; left: 50%; top: -3px; width: calc(38px * var(--hx-s)); height: 7px; margin-left: calc(-19px * var(--hx-s));
  border-left: 1px solid rgba(var(--cc), 0.8); border-right: 1px solid rgba(var(--cc), 0.8);
}
.hx-card.hx-on .hx-card-line { animation: hx-lineIn 1.2s var(--ease) 0.1s forwards; }
.hx-card-t {
  margin: calc(22px * var(--hx-s)) 0 calc(14px * var(--hx-s));
  font: 800 calc(58px * var(--hx-s)) / 1.05 var(--f-cond); letter-spacing: 0.42em; margin-right: -0.42em; color: var(--white);
  text-shadow: 0 0 30px rgba(var(--cc), 0.55), 0 2px 4px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}
.hx-card-enemy .hx-card-t { color: #fff0f2; font-size: calc(72px * var(--hx-s)); letter-spacing: 0.5em; margin-right: -0.5em; }
.hx-card-t span { display: inline-block; opacity: 0; }
.hx-card.hx-on .hx-card-t span { animation: hx-letter 0.9s var(--ease) forwards; }
.hx-card-s {
  margin-bottom: calc(22px * var(--hx-s));
  font: 600 calc(14px * var(--hx-s)) / 1.3 var(--f-mono); letter-spacing: 0.5em; margin-right: -0.5em; color: rgb(var(--cc));
  text-shadow: 0 0 12px rgba(var(--cc), 0.5), 0 1px 2px rgba(0, 0, 0, 0.8);
  opacity: 0;
}
.hx-card-enemy .hx-card-s { color: #ff8a96; }
.hx-card.hx-on .hx-card-s { animation: hx-fadeUp 0.9s var(--ease) 0.9s forwards; }

/* ---- cinematic skip hint ---------------------------------------------------------------------------------------- */
.hx-skip {
  position: absolute; right: calc(34px * var(--hx-s) + env(safe-area-inset-right, 0px)); bottom: calc(10.5% + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center;
  opacity: 0; visibility: hidden; transform: translate3d(8px, 0, 0);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0s 0.35s;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}
.hx-skip.hx-on { opacity: 0.9; visibility: visible; transform: none; transition: opacity 0.35s var(--ease), transform 0.35s var(--ease); }
.hx-skip .hx-hint { margin-left: 0; }
.hx-skip .hx-hint em { color: var(--c-hi); }

/* ---- fps ----------------------------------------------------------------------------------------------------------- */
.hx-fps {
  position: absolute; right: calc(10px + env(safe-area-inset-right, 0px)); bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  font: 500 11px / 1 var(--f-mono); letter-spacing: 0.1em; color: var(--c-mid);
  display: none;
}
.hx-fps.hx-on { display: block; }
.hx-fps::after { content: ' FPS'; color: var(--c-dim); }

/* ---- mute tag: answers the M key on any screen (title, menus, pause, flight) ------------------------------------- */
.hx-mutetag {
  position: absolute; left: 50%; top: calc(14px + env(safe-area-inset-top, 0px)); z-index: 40;
  display: flex; align-items: center; gap: 9px;
  padding: 7px 18px 7px 13px;
  font: 600 max(var(--hx-min), calc(11px * var(--hx-s))) / 1 var(--f-mono); letter-spacing: 0.3em; color: var(--c-hi);
  background: linear-gradient(90deg, rgba(2, 8, 14, 0.9), rgba(2, 8, 14, 0.78));
  border: 1px solid rgba(159, 243, 255, 0.28); border-left: 2px solid var(--c);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  transform: translate3d(-50%, -6px, 0); opacity: 0; visibility: hidden;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0s 0.25s;
  white-space: nowrap;
}
.hx-mutetag.hx-on { opacity: 1; visibility: visible; transform: translate3d(-50%, 0, 0); transition: opacity 0.16s var(--ease), transform 0.16s var(--ease); }
.hx-mutetag svg { width: 15px; height: 15px; flex: none; }
.hx-mutetag .hx-mt-x { display: none; }
.hx-mutetag.hx-m { color: var(--amber); border-color: rgba(255, 181, 71, 0.4); border-left-color: var(--amber); }
.hx-mutetag.hx-m .hx-mt-x { display: inline; }
.hx-mutetag.hx-m .hx-mt-w { display: none; }
.hx-bossfight .hx-mutetag { top: calc(82px * var(--hx-s) + env(safe-area-inset-top, 0px)); }
.hx-touching .hx-mutetag { top: calc(58px + env(safe-area-inset-top, 0px)); }

/* ============================================================================================================
   menus — shared
   ============================================================================================================ */
.hx-screen {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.3s var(--ease), visibility 0s linear 0.3s;
}
.hx-screen.hx-on { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity 0.3s var(--ease); }
.hx-screen.hx-under { pointer-events: none; }

.hx-list { display: flex; flex-direction: column; gap: calc(3px * var(--hx-m)); }
.hx-item {
  position: relative; display: flex; align-items: center; gap: calc(14px * var(--hx-m));
  height: calc(48px * var(--hx-m)); padding: 0 calc(24px * var(--hx-m));
  font: 600 calc(21px * var(--hx-m)) / 1 var(--f-cond); letter-spacing: 0.26em;
  color: rgba(225, 248, 255, 0.58);
  cursor: pointer; white-space: nowrap;
  transition: color 0.18s var(--ease), transform 0.2s var(--ease);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}
.hx-item::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(159, 243, 255, 0.26), rgba(159, 243, 255, 0.08) 55%, rgba(159, 243, 255, 0));
  transform: scaleX(0); transform-origin: 0 50%;
  transition: transform 0.22s var(--ease);
  clip-path: polygon(0 0, 100% 0, calc(100% - 16px) 100%, 0 100%);
}
.hx-item::after {
  content: ''; position: absolute; left: 0; top: 22%; bottom: 22%; width: 3px;
  background: var(--c); box-shadow: 0 0 10px rgba(159, 243, 255, 0.9);
  opacity: 0; transform: scaleY(0.4); transition: opacity 0.18s, transform 0.22s var(--ease);
}
.hx-item.hx-focus { color: var(--white); transform: translate3d(calc(8px * var(--hx-m)), 0, 0); }
.hx-item.hx-focus::before { transform: scaleX(1); }
.hx-item.hx-focus::after { opacity: 1; transform: scaleY(1); }
.hx-item .hx-idx { font: 500 max(var(--hx-min), calc(11px * var(--hx-m))) / 1 var(--f-mono); letter-spacing: 0.1em; color: var(--c-lbl); transition: color 0.18s; }
.hx-item .hx-iglyph { display: inline-flex; align-items: center; }
.hx-item.hx-focus .hx-idx { color: var(--c); }
.hx-lbl { position: relative; }
.hx-list { isolation: isolate; }

/* centred / horizontal lists */
.hx-list-c { align-items: center; }
.hx-list-c .hx-item { justify-content: center; min-width: calc(320px * var(--hx-m)); }
.hx-list-c .hx-item::before { background: linear-gradient(90deg, rgba(159, 243, 255, 0), rgba(159, 243, 255, 0.22) 30%, rgba(159, 243, 255, 0.22) 70%, rgba(159, 243, 255, 0)); transform: scaleX(0); transform-origin: 50% 50%; clip-path: none; }
.hx-list-c .hx-item::after { left: 50%; top: auto; bottom: 0; width: 40%; height: 2px; transform: translateX(-50%) scaleX(0.3); }
.hx-list-c .hx-item.hx-focus { transform: none; }
.hx-list-c .hx-item.hx-focus::after { transform: translateX(-50%) scaleX(1); }
.hx-list-h { flex-direction: row; gap: calc(14px * var(--hx-m)); justify-content: center; }
.hx-list-h .hx-item { justify-content: center; min-width: calc(220px * var(--hx-m)); border: 1px solid rgba(159, 243, 255, 0.2); }
.hx-list-h .hx-item::before { transform-origin: 50% 50%; clip-path: none; background: linear-gradient(180deg, rgba(159, 243, 255, 0.22), rgba(159, 243, 255, 0.08)); }
.hx-list-h .hx-item::after { left: 0; right: 0; top: auto; bottom: -1px; width: auto; height: 2px; transform: scaleX(0.2); }
.hx-list-h .hx-item.hx-focus { transform: none; border-color: rgba(159, 243, 255, 0.55); }
.hx-list-h .hx-item.hx-focus::after { transform: scaleX(1); }

/* footer hint bar */
.hx-foot {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: space-between;
  height: calc(52px * var(--hx-m));
  padding: 0 calc(40px * var(--hx-m) + env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) calc(40px * var(--hx-m) + env(safe-area-inset-left, 0px));
  border-top: 1px solid var(--c-faint);
  background: linear-gradient(0deg, rgba(1, 4, 9, 0.72), rgba(1, 4, 9, 0.35));
  font: 500 max(var(--hx-min), calc(10.5px * var(--hx-m))) / 1 var(--f-mono); letter-spacing: 0.24em; color: var(--c-lbl);
}
.hx-foot-l i { font-style: normal; margin: 0 0.5em; color: var(--c-faint); }
.hx-foot-l b { font-weight: 500; color: var(--white); margin-left: 0.6em; }
.hx-foot-r { display: flex; align-items: center; }

/* input hints + glyphs */
.hx-hint { display: inline-flex; align-items: center; gap: calc(8px * var(--hx-m)); margin-left: calc(24px * var(--hx-m)); }
.hx-hint em { font-style: normal; font: 500 max(var(--hx-min), calc(10.5px * var(--hx-m))) / 1 var(--f-mono); letter-spacing: 0.24em; color: var(--c-hi); opacity: 0.85; }
.hx-for-kbm, .hx-for-pad, .hx-for-touch { display: none; align-items: center; gap: calc(4px * var(--hx-m)); }
.hx-dev-kbm .hx-for-kbm, .hx-dev-gamepad .hx-for-pad, .hx-dev-touch .hx-for-touch { display: inline-flex; }
.hx-dev-touch .hx-hint:has(.hx-for-touch:empty) { display: none; }
.hx-kc {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: calc(23px * var(--hx-m)); height: calc(23px * var(--hx-m)); padding: 0 calc(6px * var(--hx-m));
  border: 1px solid rgba(159, 243, 255, 0.5); border-bottom-width: 2px; border-radius: calc(4px * var(--hx-m));
  background: linear-gradient(180deg, rgba(159, 243, 255, 0.14), rgba(159, 243, 255, 0.04));
  font: 600 max(var(--hx-min-s), calc(10.5px * var(--hx-m))) / 1 var(--f-mono); letter-spacing: 0.04em; color: var(--white);
}
.hx-kc-w { padding: 0 calc(9px * var(--hx-m)); }
.hx-g { width: calc(25px * var(--hx-m)); height: calc(25px * var(--hx-m)); color: var(--c-hi); overflow: visible; }
.hx-g-opt { width: calc(31px * var(--hx-m)); }
.hx-g-sh { width: calc(35px * var(--hx-m)); }
.hx-g-tx-sh { font-size: 9px; }
.hx-g-bg { fill: rgba(6, 18, 28, 0.85); stroke: rgba(159, 243, 255, 0.55); stroke-width: 1.1; }
.hx-g-tx { font: 700 6.4px var(--f-mono); fill: var(--white); letter-spacing: 0; }
.hx-g-tx-l { font: 800 11.5px var(--f-cond); }
/* controller families: one glyph variant per family, picked by the root class (Gamepad.id) */
.hx-gv { display: none; }
.hx-pad-ps .hx-gv-ps, .hx-pad-xb .hx-gv-xb, .hx-pad-nx .hx-gv-nx { display: inline-flex; }
.hx-pad-xb .hx-cpage-pad .hx-cdia-wrap, .hx-pad-nx .hx-cpage-pad .hx-cdia-wrap { display: none; }
.hx-pad-xb .hx-cpage-pad .hx-cgrid, .hx-pad-nx .hx-cpage-pad .hx-cgrid { display: grid; }
.hx-g-stick .hx-g-tx { font-size: 7.5px; }
.hx-g-on { fill: var(--c); }
.hx-g-off { fill: rgba(159, 243, 255, 0.22); }
.hx-g-mouse .hx-g-on { fill: var(--amber); }

/* ============================================================================================================
   title
   ============================================================================================================ */
.hx-scrim { position: absolute; left: 0; right: 0; pointer-events: none; }
.hx-scrim-t { top: 0; height: 48%; background: linear-gradient(180deg, rgba(1, 4, 10, 0.78), rgba(1, 4, 10, 0.42) 45%, rgba(1, 4, 10, 0)); }
.hx-scrim-b { bottom: 0; height: 52%; background: linear-gradient(0deg, rgba(1, 4, 10, 0.82), rgba(1, 4, 10, 0.4) 40%, rgba(1, 4, 10, 0)); }
.hx-title::after { /* left vignette behind the menu */
  content: ''; position: absolute; left: 0; bottom: 0; width: 46%; height: 62%; pointer-events: none;
  background: radial-gradient(ellipse at 0% 100%, rgba(1, 4, 10, 0.62), rgba(1, 4, 10, 0) 70%);
  opacity: 0; transition: opacity 0.6s var(--ease);
}
.hx-title.hx-mainmode::after { opacity: 1; }
.hx-logo {
  position: absolute; left: 50%; top: 9.5vh;
  display: flex; flex-direction: column; align-items: center;
  transform: translate3d(-50%, 0, 0);
  transition: transform 0.6s var(--ease), opacity 0.4s;
  --hx-m: var(--hx-m0, 1);
  --lg: clamp(52px, calc(128px * var(--hx-m0, 1)), 11.5vw);
}
.hx-logo-top {
  display: flex; align-items: center; gap: 1.2em;
  font: 500 max(var(--hx-min), calc(10.5px * var(--hx-m))) / 1 var(--f-mono); letter-spacing: 0.46em; color: var(--c-lbl);
  margin-bottom: calc(18px * var(--hx-m));
  animation: hx-fadeUp 1.2s var(--ease) 0.2s both;
}
.hx-logo-top i { width: calc(46px * var(--hx-m)); height: 1px; background: var(--c-faint); }
.hx-logo-main {
  position: relative; display: flex; align-items: center;
  font: 800 var(--lg) / 0.86 var(--f-cond);
  letter-spacing: 0.07em;
  animation: hx-logoIn 1.4s var(--ease) both;
}
.hx-lw { position: relative; display: block; }
.hx-lw1 {
  color: #f6feff;
  background-image:
    linear-gradient(100deg, rgba(255, 255, 255, 0) 42%, rgba(255, 255, 255, 0.95) 50%, rgba(255, 255, 255, 0) 58%),
    linear-gradient(180deg, #ffffff 0%, #eafcff 38%, #a9e9f8 72%, #6fc7df 100%);
  background-size: 300% 100%, 100% 100%;
  background-position: 120% 0, 0 0;
  background-repeat: no-repeat;
  animation: hx-shine 7s ease-in-out 1.8s infinite;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 22px rgba(111, 232, 255, 0.35)) drop-shadow(0 3px 2px rgba(0, 0, 0, 0.55));
}
.hx-lw2 {
  color: rgba(159, 243, 255, 0.08);
  -webkit-text-stroke: max(1.5px, calc(2.2px * var(--hx-m))) #9ff3ff;
  filter: drop-shadow(0 0 14px rgba(111, 232, 255, 0.55));
  margin-right: -0.07em;
}
/* chromatic shimmer: offset red / cyan ghosts that twitch every few seconds */
.hx-lw::before, .hx-lw::after {
  content: attr(data-t); position: absolute; left: 0; top: 0; pointer-events: none;
  -webkit-text-fill-color: currentColor; -webkit-text-stroke: 0; background: none;
  mix-blend-mode: screen; opacity: 0;
}
.hx-lw::before { color: rgba(255, 50, 90, 0.75); animation: hx-chromaA 5.2s steps(1) infinite; }
.hx-lw::after { color: rgba(40, 210, 255, 0.75); animation: hx-chromaB 5.2s steps(1) infinite; }
.hx-lw2::before, .hx-lw2::after { color: transparent; -webkit-text-stroke: 1.5px currentColor; }
.hx-lw2::before { -webkit-text-stroke-color: rgba(255, 50, 90, 0.7); }
.hx-lw2::after { -webkit-text-stroke-color: rgba(40, 210, 255, 0.7); }
/* the rift: a slanted tear of light between the words */
.hx-rift {
  position: relative; display: block;
  width: 0.09em; height: 1.02em; margin: 0 0.2em 0 0.17em;
  transform: skewX(-21deg);
}
.hx-rift i {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #ffffff 16%, #bff8ff 40%, #6fe8ff 62%, #ff5aa8 86%, rgba(255, 90, 168, 0) 100%);
  box-shadow: 0 0 18px rgba(111, 232, 255, 0.9), 0 0 42px rgba(111, 232, 255, 0.45), 0 0 70px rgba(255, 90, 168, 0.25);
  animation: hx-riftPulse 3.2s ease-in-out infinite;
}
.hx-rift b { /* core line */
  position: absolute; left: 42%; top: 6%; bottom: 6%; width: 16%; background: #ffffff; filter: blur(0.5px);
}
.hx-logo-sub {
  display: flex; align-items: center; gap: calc(18px * var(--hx-m));
  margin-top: calc(22px * var(--hx-m));
  font: 500 calc(14px * var(--hx-m)) / 1 var(--f-mono); letter-spacing: 0.62em; margin-right: -0.62em; color: #dff8ff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  animation: hx-fadeUp 1.2s var(--ease) 0.6s both;
}
.hx-logo-sub em { font-style: normal; color: var(--amber); }
.hx-logo-sub i { width: calc(70px * var(--hx-m)); height: 1px; background: linear-gradient(90deg, rgba(159, 243, 255, 0), var(--c-mid)); }
.hx-logo-sub i:last-child { transform: scaleX(-1); }

.hx-press {
  position: absolute; left: 50%; bottom: 19vh;
  display: flex; align-items: center; gap: calc(14px * var(--hx-m));
  padding: calc(12px * var(--hx-m)) calc(34px * var(--hx-m));
  transform: translate3d(-50%, 0, 0);
  /* soft shade: the prompt stays readable over the lit ring plane */
  background: radial-gradient(closest-side, rgba(1, 4, 9, 0.62), rgba(1, 4, 9, 0.42) 58%, rgba(1, 4, 9, 0));
  cursor: pointer;
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s, visibility 0s 0.3s;
}
.hx-press::before, .hx-press::after {
  content: ''; position: absolute; top: 50%; width: calc(60px * var(--hx-m)); height: 1px;
  background: linear-gradient(90deg, rgba(159, 243, 255, 0), var(--c-mid));
}
.hx-press::before { right: 100%; }
.hx-press::after { left: 100%; transform: scaleX(-1); }
.hx-press-t { font: 600 calc(17px * var(--hx-m)) / 1 var(--f-cond); letter-spacing: 0.5em; color: var(--white); text-shadow: 0 0 12px rgba(111, 232, 255, 0.5), 0 1px 3px rgba(0, 0, 0, 0.9); white-space: nowrap; }
.hx-press .hx-g, .hx-press .hx-kc { transform: scale(1.1); }
.hx-attract .hx-press { opacity: 1; visibility: visible; transition: opacity 0.6s var(--ease) 0.9s; animation: hx-breatheSoft 2.4s ease-in-out 1.5s infinite; }

.hx-main {
  position: absolute; isolation: isolate;
  left: calc(6.5vw + env(safe-area-inset-left, 0px)); bottom: calc(52px * var(--hx-m) + 4vh);
  width: calc(430px * var(--hx-m));
  padding: calc(20px * var(--hx-m)) 0 calc(18px * var(--hx-m));
  opacity: 0; visibility: hidden; transform: translate3d(-16px, 0, 0);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0s 0.35s;
}
.hx-main::before { /* dark glass backing with a slanted trailing edge — the menu reads over the bright ring sheet */
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  left: calc(-6.5vw - 20px); right: calc(-56px * var(--hx-m)); top: 0; bottom: 0;
  background: linear-gradient(90deg, rgba(1, 5, 11, 0.8), rgba(1, 5, 11, 0.66) 62%, rgba(1, 5, 11, 0.2));
  clip-path: polygon(0 0, 100% 0, calc(100% - 44px * var(--hx-m)) 100%, 0 100%);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.hx-main::after { /* top rule */
  content: ''; position: absolute; left: calc(-6.5vw - 20px); right: calc(-56px * var(--hx-m)); top: 0; height: 1px;
  background: linear-gradient(90deg, rgba(159, 243, 255, 0.55), rgba(159, 243, 255, 0.2) 70%, rgba(159, 243, 255, 0));
}
.hx-main-kick {
  display: flex; align-items: center; gap: calc(12px * var(--hx-m));
  margin: 0 0 calc(12px * var(--hx-m)) calc(24px * var(--hx-m));
  font: 500 max(var(--hx-min), calc(10px * var(--hx-m))) / 1 var(--f-mono); letter-spacing: 0.36em; color: var(--c-lbl);
}
.hx-main-kick i { width: calc(40px * var(--hx-m)); height: 1px; background: var(--c-faint); }
.hx-main-kick b { font-weight: 500; color: #7dffc4; text-shadow: 0 0 8px rgba(125, 255, 196, 0.6); }
.hx-main-kick b::before {
  content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 0.8em; vertical-align: 1px; border-radius: 50%;
  background: #7dffc4; box-shadow: 0 0 8px #7dffc4; animation: hx-breathe 1.8s ease-in-out infinite;
}
.hx-main-desc {
  min-height: 2.9em; max-width: calc(380px * var(--hx-m));
  margin: calc(14px * var(--hx-m)) 0 0 calc(24px * var(--hx-m));
  font: 400 calc(13px * var(--hx-m)) / 1.45 var(--f-sans); color: rgba(205, 238, 247, 0.76);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}
.hx-mainmode .hx-main { opacity: 1; visibility: visible; transform: none; transition: opacity 0.45s var(--ease) 0.1s, transform 0.45s var(--ease) 0.1s; }
.hx-main .hx-item { min-width: calc(330px * var(--hx-m)); }
.hx-record {
  position: absolute; right: calc(5vw + env(safe-area-inset-right, 0px)); bottom: calc(52px * var(--hx-m) + 7vh);
  text-align: right; padding-right: calc(14px * var(--hx-m)); border-right: 2px solid var(--amber-dim);
  opacity: 0; visibility: hidden; transform: translate3d(12px, 0, 0);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), visibility 0s 0.4s;
}
.hx-mainmode .hx-record.hx-on { opacity: 1; visibility: visible; transform: none; transition: opacity 0.5s var(--ease) 0.25s, transform 0.5s var(--ease) 0.25s; }
.hx-record-l { font: 500 max(var(--hx-min), calc(10px * var(--hx-m))) / 1 var(--f-mono); letter-spacing: 0.36em; margin-right: -0.36em; color: var(--amber); }
.hx-record-v { display: flex; align-items: center; justify-content: flex-end; gap: calc(12px * var(--hx-m)); margin: calc(8px * var(--hx-m)) 0 calc(6px * var(--hx-m)); }
.hx-record-v b { font: 800 calc(34px * var(--hx-m)) / 1 var(--f-cond); letter-spacing: 0.04em; color: var(--white); text-shadow: 0 0 16px rgba(111, 232, 255, 0.35), 0 2px 3px rgba(0, 0, 0, 0.7); }
.hx-record-rk {
  --rk: #9ff3ff;
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: calc(36px * var(--hx-m)); height: calc(36px * var(--hx-m));
  font: 800 calc(21px * var(--hx-m)) / 1 var(--f-cond); color: var(--rk);
  text-shadow: 0 0 10px color-mix(in srgb, var(--rk) 70%, transparent);
}
.hx-record-rk::before {
  content: ''; position: absolute; inset: 15%; transform: rotate(45deg);
  border: 1.5px solid var(--rk); box-shadow: 0 0 10px color-mix(in srgb, var(--rk) 45%, transparent);
}
.hx-record-s { font: 500 max(var(--hx-min-s), calc(9.5px * var(--hx-m))) / 1 var(--f-mono); letter-spacing: 0.2em; color: var(--c-lbl); white-space: pre; }
.hx-title .hx-foot { opacity: 0; transition: opacity 0.4s; }
.hx-mainmode .hx-foot { opacity: 1; }
.hx-attract .hx-foot { opacity: 1; }
.hx-attract .hx-foot-r { visibility: hidden; }
.hx-title.hx-under .hx-logo, .hx-title.hx-under .hx-main, .hx-title.hx-under .hx-foot { opacity: 0; transition: opacity 0.25s; }
.hx-title.hx-leaving { opacity: 0; transition: opacity 0.35s var(--ease); }
/* straight from the loading screen: the loader's wordmark already sits exactly here, so no blur-in */
.hx-title.hx-fromboot .hx-logo-main, .hx-title.hx-fromboot .hx-logo-top, .hx-title.hx-fromboot .hx-logo-sub { animation: none; }

/* ============================================================================================================
   panels (settings / controls)
   ============================================================================================================ */
.hx-panelscr {
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 45%, rgba(2, 7, 14, 0.55), rgba(1, 3, 8, 0.82));
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.hx-panel {
  position: relative; display: flex; flex-direction: column;
  width: calc(760px * var(--hx-m)); max-width: calc(100vw - 32px); max-height: calc(100vh - 48px);
  background: linear-gradient(180deg, rgba(8, 20, 32, 0.94), rgba(3, 9, 17, 0.95));
  border: 1px solid rgba(159, 243, 255, 0.16);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(159, 243, 255, 0.1);
  transform: translate3d(0, 10px, 0); transition: transform 0.35s var(--ease);
}
.hx-on .hx-panel { transform: none; }
.hx-panel::before, .hx-panel::after { /* corner brackets */
  content: ''; position: absolute; width: 26px; height: 26px; pointer-events: none;
}
.hx-panel::before { left: 8px; top: 8px; border-left: 2px solid var(--c); border-top: 2px solid var(--c); }
.hx-panel::after { right: 8px; bottom: 8px; border-right: 2px solid var(--c); border-bottom: 2px solid var(--c); }
.hx-ph {
  display: flex; flex-wrap: wrap; align-items: baseline; column-gap: calc(18px * var(--hx-m));
  padding: calc(28px * var(--hx-m)) calc(40px * var(--hx-m)) calc(16px * var(--hx-m));
  border-bottom: 1px solid var(--c-faint);
}
.hx-ph .hx-kick { width: 100%; margin-bottom: calc(6px * var(--hx-m)); }
.hx-ph h2 { font: 800 calc(38px * var(--hx-m)) / 1 var(--f-cond); letter-spacing: 0.26em; color: var(--white); text-shadow: 0 0 20px rgba(111, 232, 255, 0.3); }
.hx-pbody {
  flex: 1 1 auto; overflow-y: auto; padding: calc(8px * var(--hx-m)) calc(22px * var(--hx-m)) calc(10px * var(--hx-m)); scrollbar-width: thin; scrollbar-color: rgba(159, 243, 255, 0.3) transparent;
  scroll-padding: 26px 0 40px;   /* keyboard / pad focus never parks a row under the fades below */
}
/* scroll cue (menus.js attachScrollCue): the list fades at an edge with more content; "MORE" until the end */
.hx-panel.hx-sc-dn .hx-pbody { -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 40px), rgba(0, 0, 0, 0.1)); mask-image: linear-gradient(180deg, #000 calc(100% - 40px), rgba(0, 0, 0, 0.1)); }
.hx-panel.hx-sc-up .hx-pbody { -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.1), #000 26px); mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.1), #000 26px); }
.hx-panel.hx-sc-up.hx-sc-dn .hx-pbody {
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.1), #000 26px, #000 calc(100% - 40px), rgba(0, 0, 0, 0.1));
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.1), #000 26px, #000 calc(100% - 40px), rgba(0, 0, 0, 0.1));
}
.hx-more { position: relative; height: 0; z-index: 2; }
.hx-more span {
  position: absolute; left: 50%; bottom: 3px; transform: translate3d(-50%, 4px, 0);
  display: flex; align-items: center; gap: 0.7em; padding: 4px 12px;
  font: 600 max(var(--hx-min), calc(10px * var(--hx-m))) / 1 var(--f-mono); letter-spacing: 0.34em; margin-right: -0.34em; color: var(--c-hi);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  opacity: 0; visibility: hidden; pointer-events: auto; cursor: pointer;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0s 0.2s;
}
.hx-more span::before { /* down chevron */
  content: ''; width: 7px; height: 7px; margin-top: -4px;
  border-right: 2px solid var(--c); border-bottom: 2px solid var(--c); transform: rotate(45deg);
  animation: hx-bob 1.4s ease-in-out infinite;
}
.hx-sc-dn .hx-more span { opacity: 0.92; visibility: visible; transform: translate3d(-50%, 0, 0); transition: opacity 0.2s var(--ease), transform 0.2s var(--ease); }
.hx-more span:hover { color: var(--white); }
.hx-pdesc {
  min-height: calc(46px * var(--hx-m)); padding: calc(12px * var(--hx-m)) calc(40px * var(--hx-m));
  border-top: 1px solid var(--c-faint);
  font: 400 calc(13.5px * var(--hx-m)) / 1.45 var(--f-sans); color: rgba(200, 236, 245, 0.72);
}
.hx-pfoot {
  display: flex; justify-content: flex-end; align-items: center;
  padding: calc(12px * var(--hx-m)) calc(40px * var(--hx-m)) calc(16px * var(--hx-m));
  background: rgba(0, 0, 0, 0.2);
}
.hx-hdr {
  display: flex; align-items: center; gap: 14px;
  margin: calc(16px * var(--hx-m)) calc(18px * var(--hx-m)) calc(6px * var(--hx-m));
  font: 500 max(var(--hx-min), calc(10px * var(--hx-m))) / 1 var(--f-mono); letter-spacing: 0.42em; color: rgba(255, 196, 110, 0.82);
}
.hx-hdr::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(255, 181, 71, 0.25), rgba(255, 181, 71, 0)); }
.hx-pbody > .hx-hdr:first-child { margin-top: calc(10px * var(--hx-m)); }
.hx-pbody .hx-item {
  height: calc(42px * var(--hx-m)); padding: 0 calc(18px * var(--hx-m));
  font: 600 calc(16px * var(--hx-m)) / 1 var(--f-cond); letter-spacing: 0.16em; text-transform: uppercase;
  justify-content: space-between;
}
/* settings: 15 rows in 5 groups — tighter rows and chrome so the whole list fits a 1280×800 / 1440×900 /
   1600×900 / 1920×1080 window (shorter windows, phones and big HUD scales scroll, with the cue above) */
.hx-settings .hx-panel { max-height: calc(100vh - 32px); }
.hx-settings .hx-ph { padding: calc(22px * var(--hx-m)) calc(40px * var(--hx-m)) calc(12px * var(--hx-m)); }
.hx-settings .hx-ph h2 { font-size: calc(34px * var(--hx-m)); }
.hx-settings .hx-pbody { padding-top: calc(4px * var(--hx-m)); padding-bottom: calc(6px * var(--hx-m)); }
.hx-settings .hx-hdr { margin: calc(12px * var(--hx-m)) calc(18px * var(--hx-m)) calc(4px * var(--hx-m)); }
.hx-settings .hx-pbody > .hx-hdr:first-child { margin-top: calc(8px * var(--hx-m)); }
.hx-settings .hx-pbody .hx-item { height: calc(33px * var(--hx-m)); }
.hx-settings .hx-pdesc { padding-top: calc(10px * var(--hx-m)); padding-bottom: calc(10px * var(--hx-m)); min-height: calc(42px * var(--hx-m)); }
.hx-settings .hx-pfoot { padding: calc(10px * var(--hx-m)) calc(40px * var(--hx-m)) calc(12px * var(--hx-m)); }
.hx-pbody .hx-item.hx-focus { transform: none; }
.hx-sel { display: flex; align-items: center; gap: calc(6px * var(--hx-m)); }
.hx-selv {
  min-width: calc(150px * var(--hx-m)); text-align: center;
  font: 700 calc(15px * var(--hx-m)) / 1 var(--f-cond); letter-spacing: 0.2em; color: var(--white);
}
.hx-arr {
  position: relative; display: inline-block; flex: none;
  width: calc(28px * var(--hx-m)); height: calc(28px * var(--hx-m));
  color: var(--c-dim); transition: color 0.15s, transform 0.15s, opacity 0.15s; cursor: pointer;
}
.hx-arr::before {
  content: ''; position: absolute; left: 50%; top: 50%;
  width: calc(8px * var(--hx-m)); height: calc(8px * var(--hx-m));
  border-left: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translate(-30%, -50%) rotate(45deg);
}
.hx-arr-r::before { transform: translate(-70%, -50%) rotate(-135deg); }
.hx-focus .hx-arr { color: var(--c); }
.hx-arr:hover { color: var(--white); }
.hx-min .hx-arr-l, .hx-max .hx-arr-r { opacity: 0.2; }
.hx-selm { display: flex; flex-direction: column; align-items: center; gap: calc(5px * var(--hx-m)); }
.hx-opts { display: flex; gap: calc(4px * var(--hx-m)); }
.hx-opts i { width: calc(12px * var(--hx-m)); height: 2px; background: rgba(159, 243, 255, 0.18); transition: background 0.15s, box-shadow 0.15s; }
.hx-opts i.hx-on { background: var(--c); box-shadow: 0 0 6px rgba(111, 232, 255, 0.8); }
.hx-sw {
  display: inline-flex; margin-right: calc(28px * var(--hx-m));
  border: 1px solid rgba(159, 243, 255, 0.28);
  font: 700 calc(12px * var(--hx-m)) / 1 var(--f-cond); letter-spacing: 0.2em;
}
.hx-sw i {
  font-style: normal; display: inline-flex; align-items: center; justify-content: center;
  width: calc(64px * var(--hx-m)); height: calc(24px * var(--hx-m)); color: var(--c-dim);
  transition: background 0.18s, color 0.18s;
}
.hx-k-toggle:not(.hx-on) .hx-sw-off { background: rgba(159, 243, 255, 0.14); color: var(--white); }
.hx-k-toggle.hx-on .hx-sw-on { background: var(--c); color: #03121a; box-shadow: 0 0 12px rgba(111, 232, 255, 0.55); }
.hx-sld { display: flex; align-items: center; gap: calc(16px * var(--hx-m)); margin-right: calc(4px * var(--hx-m)); }
.hx-trk {
  position: relative; width: calc(200px * var(--hx-m)); height: calc(22px * var(--hx-m)); cursor: pointer;
  background: linear-gradient(rgba(159, 243, 255, 0.16), rgba(159, 243, 255, 0.16)) 0 50% / 100% 3px no-repeat;
  touch-action: none;
}
.hx-trk i { position: absolute; left: 0; right: 0; top: calc(50% - 1.5px); height: 3px; transform-origin: 0 50%; background: var(--c); box-shadow: 0 0 8px rgba(111, 232, 255, 0.7); }
.hx-trk b {
  position: absolute; top: 50%; width: calc(11px * var(--hx-m)); height: calc(11px * var(--hx-m));
  margin: calc(-5.5px * var(--hx-m)) 0 0 calc(-5.5px * var(--hx-m));
  background: #031018; border: 2px solid var(--c); transform: rotate(45deg);
  transition: box-shadow 0.15s;
}
.hx-focus .hx-trk b { box-shadow: 0 0 10px rgba(159, 243, 255, 0.9); background: var(--c); }
.hx-sldv { min-width: calc(62px * var(--hx-m)); text-align: right; font: 500 calc(13px * var(--hx-m)) / 1 var(--f-mono); color: var(--white); letter-spacing: 0.04em; }
.hx-pbody .hx-k-button { justify-content: flex-start; }

/* controls */
.hx-tabs { display: flex; gap: 4px; margin-left: auto; align-self: flex-end; }
.hx-tab {
  padding: calc(8px * var(--hx-m)) calc(16px * var(--hx-m));
  font: 600 calc(12px * var(--hx-m)) / 1 var(--f-cond); letter-spacing: 0.24em; color: var(--c-dim);
  border-bottom: 2px solid transparent; cursor: pointer; transition: color 0.18s, border-color 0.18s;
}
.hx-tab.hx-on { color: var(--white); border-bottom-color: var(--c); text-shadow: 0 0 10px rgba(111, 232, 255, 0.5); }
.hx-controls .hx-panel { width: calc(820px * var(--hx-m)); }
/* anchored to the top (not centred on content height): switching tabs never moves the header or the tabs */
.hx-controls.hx-panelscr { align-items: flex-start; padding-top: max(24px, min(9vh, calc(100vh - 48px - 700px * var(--hx-m)))); }
.hx-controls .hx-panel { max-height: calc(100vh - 24px - max(24px, min(9vh, calc(100vh - 48px - 700px * var(--hx-m))))); }
.hx-cpage { display: none; padding: calc(10px * var(--hx-m)) calc(18px * var(--hx-m)); }
.hx-cpage.hx-on { display: block; animation: hx-fadeUp 0.3s var(--ease); }
.hx-cgrid { display: grid; grid-template-columns: 1fr 1fr; column-gap: calc(34px * var(--hx-m)); }
.hx-crow {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: calc(48px * var(--hx-m)); border-bottom: 1px solid rgba(159, 243, 255, 0.08);
}
.hx-cact { font: 600 calc(15px * var(--hx-m)) / 1.1 var(--f-cond); letter-spacing: 0.16em; color: rgba(230, 248, 255, 0.85); text-transform: uppercase; }
.hx-cbind { display: flex; align-items: center; gap: calc(5px * var(--hx-m)); flex-wrap: wrap; justify-content: flex-end; }
.hx-cbind small { font: 500 max(var(--hx-min-s), calc(9.5px * var(--hx-m))) / 1.2 var(--f-mono); letter-spacing: 0.06em; color: var(--c-lbl); margin: 0 4px; text-transform: uppercase; }
.hx-or { font: 500 calc(11px * var(--hx-m)) var(--f-mono); color: var(--c-faint); margin: 0 2px; }
.hx-tglyph {
  display: inline-flex; align-items: center; justify-content: center; min-width: calc(44px * var(--hx-m)); height: calc(26px * var(--hx-m));
  padding: 0 8px; border: 1px solid var(--c-mid); border-radius: 13px;
  font: 700 max(var(--hx-min-s), calc(10px * var(--hx-m))) / 1 var(--f-cond); letter-spacing: 0.16em; color: var(--white);
}
.hx-ctips { margin: calc(8px * var(--hx-m)) calc(18px * var(--hx-m)) calc(4px * var(--hx-m)); display: grid; grid-template-columns: 1fr 1fr; gap: calc(8px * var(--hx-m)) calc(34px * var(--hx-m)); }
.hx-ctip {
  position: relative; padding-left: calc(16px * var(--hx-m));
  font: 400 calc(12.5px * var(--hx-m)) / 1.45 var(--f-sans); color: rgba(200, 236, 245, 0.7);
}
.hx-ctip::before { content: ''; position: absolute; left: 0; top: 0.55em; width: 6px; height: 6px; border: 1.5px solid var(--amber); transform: rotate(45deg); }
/* controller diagram (CONTROLLER tab) */
.hx-cdia-wrap { padding: calc(6px * var(--hx-m)) 0 calc(2px * var(--hx-m)); }
.hx-cdia { width: 100%; height: auto; max-height: 46vh; overflow: visible; }
.hx-cpage-pad .hx-cgrid { display: none; }
.hx-cd-body { fill: rgba(10, 26, 40, 0.72); stroke: rgba(159, 243, 255, 0.6); stroke-width: 1.5; }
.hx-cd-sh { fill: rgba(10, 26, 40, 0.8); stroke: rgba(159, 243, 255, 0.75); stroke-width: 1.3; }
.hx-cd-pad { fill: rgba(159, 243, 255, 0.05); stroke: rgba(159, 243, 255, 0.35); stroke-width: 1.1; }
.hx-cd-det { fill: none; stroke: rgba(159, 243, 255, 0.32); stroke-width: 1.1; }
.hx-cd-hot { fill: rgba(159, 243, 255, 0.2); stroke: #9ff3ff; stroke-width: 1.2; }
.hx-cd-dpad { fill: rgba(159, 243, 255, 0.08); stroke: rgba(159, 243, 255, 0.75); stroke-width: 1.2; stroke-linejoin: round; }
.hx-cd-stick { fill: rgba(4, 14, 22, 0.9); stroke: rgba(159, 243, 255, 0.8); stroke-width: 1.3; }
.hx-cd-btn { fill: rgba(4, 14, 22, 0.92); stroke: rgba(159, 243, 255, 0.5); stroke-width: 1.1; }
.hx-cd-in { font: 700 9px var(--f-mono); fill: #e6fdff; text-anchor: middle; }
.hx-cd-in-s { font-size: 7.5px; }
.hx-cd-lead { fill: none; stroke: rgba(159, 243, 255, 0.42); stroke-width: 1; }
.hx-cd-dot { fill: #9ff3ff; }
.hx-cd-t { font: 600 14.5px var(--f-cond); letter-spacing: 0.16em; fill: #eafcff; }
.hx-cd-k { font: 600 10px var(--f-mono); letter-spacing: 0.08em; fill: #ffb547; }
.hx-cd-s { font: 500 8.5px var(--f-mono); letter-spacing: 0.12em; fill: rgba(159, 243, 255, 0.55); }
.hx-controls .hx-pdesc { display: flex; justify-content: flex-start; padding: calc(8px * var(--hx-m)) calc(22px * var(--hx-m)); min-height: 0; }
.hx-controls .hx-pdesc .hx-item { height: calc(40px * var(--hx-m)); font-size: calc(15px * var(--hx-m)); }

/* ============================================================================================================
   pause · confirm · game over · victory · results
   ============================================================================================================ */
.hx-pause {
  background: linear-gradient(90deg, rgba(1, 4, 10, 0.78) 0%, rgba(1, 4, 10, 0.5) 45%, rgba(1, 4, 10, 0.35) 100%);
  -webkit-backdrop-filter: blur(10px) saturate(0.7) brightness(0.85);
  backdrop-filter: blur(10px) saturate(0.7) brightness(0.85);
}
.hx-pause-col { position: absolute; left: calc(8vw + env(safe-area-inset-left, 0px)); top: 17vh; width: calc(560px * var(--hx-m)); max-width: 84vw; }
.hx-h1 {
  font: 800 calc(78px * var(--hx-m)) / 0.95 var(--f-cond); letter-spacing: 0.14em; color: var(--white);
  text-shadow: 0 0 34px rgba(111, 232, 255, 0.3), 0 3px 4px rgba(0, 0, 0, 0.5);
  margin: calc(10px * var(--hx-m)) 0 calc(6px * var(--hx-m));
}
.hx-pobj { margin: calc(8px * var(--hx-m)) 0 calc(34px * var(--hx-m)); display: flex; flex-direction: column; gap: 6px; }
/* why the game paused itself (core auto-pause: background / controller lost) */
.hx-preason { display: none; margin: calc(4px * var(--hx-m)) 0 calc(10px * var(--hx-m)); font: 500 max(12px, calc(13px * var(--hx-m))) / 1.35 var(--f-sans); color: #ffd28a; }
.hx-preason.hx-on { display: block; }
.hx-preason.hx-pad { font: 600 max(var(--hx-min), calc(12px * var(--hx-m))) / 1.35 var(--f-mono); letter-spacing: 0.14em; color: var(--amber); }
.hx-pobj b { font: 500 max(var(--hx-min), calc(10px * var(--hx-m))) / 1 var(--f-mono); letter-spacing: 0.4em; color: var(--amber); }
.hx-pobj span { font: 500 calc(16px * var(--hx-m)) / 1.35 var(--f-sans); color: #dff7ff; }
.hx-pause .hx-list { margin-left: calc(-24px * var(--hx-m)); }
.hx-pstats {
  position: absolute; right: calc(8vw + env(safe-area-inset-right, 0px)); top: 24vh; width: calc(300px * var(--hx-m));
  border-top: 2px solid var(--c-mid);
  background: linear-gradient(180deg, rgba(3, 10, 18, 0.6), rgba(3, 10, 18, 0.2));
  padding: calc(8px * var(--hx-m)) calc(20px * var(--hx-m)) calc(12px * var(--hx-m));
}
.hx-pmis { padding: calc(10px * var(--hx-m)) 0 calc(16px * var(--hx-m)); border-bottom: 1px solid rgba(159, 243, 255, 0.09); }
.hx-pmis-h { display: flex; justify-content: space-between; align-items: baseline; }
.hx-pmis-h span { font: 500 max(var(--hx-min), calc(10.5px * var(--hx-m))) / 1 var(--f-mono); letter-spacing: 0.3em; color: var(--c-lbl); }
.hx-pmis-h b { font: 700 calc(24px * var(--hx-m)) / 1 var(--f-cond); color: var(--white); }
.hx-ptrack { position: relative; height: 4px; margin: calc(14px * var(--hx-m)) 0 calc(10px * var(--hx-m)); background: rgba(159, 243, 255, 0.12); }
.hx-ptrack i { position: absolute; inset: 0; transform-origin: 0 50%; background: linear-gradient(90deg, rgba(159, 243, 255, 0.45), var(--c)); box-shadow: 0 0 8px rgba(111, 232, 255, 0.6); }
.hx-ptrack b { position: absolute; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; background: #031018; border: 2px solid var(--white); transform: rotate(45deg); }
.hx-ptrack em { position: absolute; top: -4px; width: 1px; height: 12px; background: rgba(159, 243, 255, 0.35); }
.hx-ptrack em.hx-on { background: var(--c); }
.hx-pmis-s { font: 600 calc(12px * var(--hx-m)) / 1.2 var(--f-cond); letter-spacing: 0.22em; color: var(--c-hi); white-space: pre; }
.hx-pst { display: flex; justify-content: space-between; align-items: baseline; padding: calc(10px * var(--hx-m)) 0; border-bottom: 1px solid rgba(159, 243, 255, 0.09); }
.hx-pst span { font: 500 max(var(--hx-min), calc(10.5px * var(--hx-m))) / 1 var(--f-mono); letter-spacing: 0.3em; color: var(--c-lbl); }
.hx-pst b { font: 700 calc(24px * var(--hx-m)) / 1 var(--f-cond); color: var(--white); letter-spacing: 0.04em; }
.hx-pause.hx-under .hx-pause-col, .hx-pause.hx-under .hx-pstats { opacity: 0.12; transition: opacity 0.25s; }
.hx-pause.hx-under .hx-foot { opacity: 0; transition: opacity 0.2s; }   /* a dialog on top brings its own hints */

.hx-confirm { display: flex; align-items: center; justify-content: center; background: rgba(1, 3, 8, 0.6); }
.hx-cbox {
  width: calc(560px * var(--hx-m)); max-width: calc(100vw - 32px); text-align: center;
  padding: calc(30px * var(--hx-m)) calc(36px * var(--hx-m)) calc(32px * var(--hx-m));
  background: linear-gradient(180deg, rgba(10, 18, 28, 0.96), rgba(4, 9, 16, 0.96));
  border-top: 2px solid var(--amber); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.hx-cbox h2 { margin: calc(12px * var(--hx-m)) 0 calc(10px * var(--hx-m)); font: 800 calc(32px * var(--hx-m)) / 1 var(--f-cond); letter-spacing: 0.2em; color: var(--white); }
.hx-cbox p { margin-bottom: calc(24px * var(--hx-m)); font: 400 calc(14px * var(--hx-m)) / 1.5 var(--f-sans); color: rgba(210, 238, 246, 0.75); }
.hx-cbox .hx-list-h .hx-item { min-width: calc(180px * var(--hx-m)); font-size: calc(17px * var(--hx-m)); height: calc(44px * var(--hx-m)); }

.hx-center { position: absolute; left: 0; right: 0; top: 50%; transform: translate3d(0, -54%, 0); display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 16px; }
.hx-over { background: radial-gradient(ellipse at 50% 50%, rgba(50, 0, 8, 0.55), rgba(8, 0, 2, 0.85)); -webkit-backdrop-filter: blur(4px) saturate(0.5); backdrop-filter: blur(4px) saturate(0.5); }
.hx-h1-red { color: #ffe4e7; text-shadow: 0 0 40px rgba(255, 50, 70, 0.55), 0 3px 4px rgba(0, 0, 0, 0.6); letter-spacing: 0.18em; margin-right: -0.18em; }
.hx-over-info { display: flex; gap: calc(34px * var(--hx-m)); margin: calc(18px * var(--hx-m)) 0 calc(34px * var(--hx-m)); }
.hx-over-info span { display: flex; flex-direction: column; gap: 6px; font: 700 calc(22px * var(--hx-m)) / 1 var(--f-cond); letter-spacing: 0.08em; color: var(--white); }
.hx-over-info b { font: 500 max(var(--hx-min), calc(9.5px * var(--hx-m))) / 1 var(--f-mono); letter-spacing: 0.36em; color: rgba(255, 170, 178, 0.82); }
.hx-note { margin-top: calc(22px * var(--hx-m)); font: 400 calc(12.5px * var(--hx-m)) / 1.4 var(--f-sans); color: rgba(255, 210, 215, 0.55); }
.hx-over .hx-item::after { background: var(--red); box-shadow: 0 0 10px rgba(255, 77, 94, 0.9); }
.hx-over .hx-list-c .hx-item::before { background: linear-gradient(90deg, rgba(255, 77, 94, 0), rgba(255, 77, 94, 0.2) 30%, rgba(255, 77, 94, 0.2) 70%, rgba(255, 77, 94, 0)); }
.hx-over.hx-on .hx-h1 { animation: hx-slam 0.8s var(--ease) both; }

.hx-victory { background: radial-gradient(ellipse at 50% 34%, rgba(1, 6, 12, 0.1), rgba(1, 4, 9, 0.62)); }
/* lockup in the upper third: the ship flies through the lower middle of the victory shot */
.hx-victory .hx-vcenter { top: 30%; }
/* CONTINUE: a bottom-right prompt (the centre-bottom belongs to the commander's closing radio line) */
.hx-vfoot {
  position: absolute; right: calc(40px * var(--hx-m) + env(safe-area-inset-right, 0px));
  bottom: calc(30px * var(--hx-m) + 2.5vh + env(safe-area-inset-bottom, 0px));
  display: flex; justify-content: flex-end;
}
.hx-compact.hx-portrait .hx-vfoot { right: 0; left: 0; justify-content: center; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
.hx-compact:not(.hx-portrait) .hx-vfoot { right: calc(12px + env(safe-area-inset-right, 0px)); bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
.hx-vfoot .hx-list-h .hx-item {
  min-width: 0; height: calc(44px * var(--hx-m)); gap: calc(12px * var(--hx-m)); padding: 0 calc(22px * var(--hx-m));
  font-size: calc(17px * var(--hx-m)); border-color: rgba(255, 181, 71, 0.35); background: rgba(8, 5, 0, 0.45);
}
.hx-vfoot .hx-list-h .hx-item.hx-focus { border-color: rgba(255, 181, 71, 0.7); }
.hx-vtimer {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; transform-origin: 0 50%; transform: scaleX(0);
  background: var(--amber); box-shadow: 0 0 8px rgba(255, 181, 71, 0.8); pointer-events: none;
}
.hx-victory .hx-center::before { /* warm soft shade behind the lockup */
  content: ''; position: absolute; left: 10%; right: 10%; top: -30%; bottom: -30%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(10, 5, 0, 0.62), rgba(10, 5, 0, 0.3) 55%, rgba(10, 5, 0, 0));
}
.hx-victory .hx-center { isolation: isolate; }
.hx-victory .hx-kick { font-size: calc(12px * var(--hx-m)); color: #ffc56a; text-shadow: 0 0 10px rgba(255, 170, 60, 0.6), 0 1px 2px rgba(0, 0, 0, 0.9); }
.hx-victory .hx-vfoot .hx-item::after { display: none; }
.hx-h1-win { position: relative; letter-spacing: 0.2em; margin-right: -0.2em; font-size: calc(92px * var(--hx-m)); }
.hx-h1-win span {
  display: inline-block; position: relative; color: #fffaf0;
  text-shadow: 0 0 18px rgba(255, 200, 110, 0.85), 0 0 46px rgba(255, 170, 60, 0.55), 0 3px 4px rgba(0, 0, 0, 0.6);
}
.hx-victory.hx-on .hx-h1 { animation: hx-bannerIn 1.2s var(--ease) both; }
.hx-victory.hx-on .hx-kick { animation: hx-fadeUp 1s var(--ease) 0.4s both; }
.hx-victory.hx-on .hx-vscore { animation: hx-fadeUp 0.8s var(--ease) 0.8s both; }
.hx-vline { position: relative; width: calc(520px * var(--hx-m)); max-width: 70vw; height: 1px; margin: calc(22px * var(--hx-m)) 0 calc(22px * var(--hx-m)); background: rgba(255, 181, 71, 0.2); }
.hx-vline::before, .hx-vline::after { content: ''; position: absolute; top: -3px; width: 1px; height: 7px; background: rgba(255, 181, 71, 0.7); }
.hx-vline::before { left: 0; }
.hx-vline::after { right: 0; }
.hx-vline i { position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(0); background: var(--amber); box-shadow: 0 0 8px rgba(255, 181, 71, 0.8); }
.hx-vscore { display: flex; flex-direction: column; align-items: center; gap: calc(8px * var(--hx-m)); margin-bottom: calc(26px * var(--hx-m)); }
.hx-vscore span { font: 500 max(var(--hx-min), calc(10.5px * var(--hx-m))) / 1 var(--f-mono); letter-spacing: 0.46em; margin-right: -0.46em; color: rgba(255, 214, 160, 0.85); }
.hx-vscore b { font: 800 calc(44px * var(--hx-m)) / 1 var(--f-cond); letter-spacing: 0.06em; color: var(--white); text-shadow: 0 0 20px rgba(255, 190, 100, 0.5), 0 2px 3px rgba(0, 0, 0, 0.7); }
.hx-victory .hx-item::after { background: var(--amber); box-shadow: 0 0 10px rgba(255, 181, 71, 0.9); }

.hx-results { background: linear-gradient(180deg, rgba(1, 4, 10, 0.6), rgba(1, 4, 10, 0.86)); -webkit-backdrop-filter: blur(8px) saturate(0.8); backdrop-filter: blur(8px) saturate(0.8); }
.hx-res {
  position: absolute; left: 50%; top: 47%; transform: translate3d(-50%, -50%, 0);
  width: calc(1080px * var(--hx-m)); max-width: calc(100vw - 40px);
}
.hx-res-head { margin-bottom: calc(26px * var(--hx-m)); }
.hx-res-head .hx-h1 { font-size: calc(62px * var(--hx-m)); }
.hx-res-body { display: grid; grid-template-columns: 1fr calc(360px * var(--hx-m)); gap: calc(60px * var(--hx-m)); align-items: center; margin-bottom: calc(40px * var(--hx-m)); }
.hx-res-rows { border-top: 1px solid var(--c-faint); }
.hx-rrow {
  display: flex; align-items: baseline; gap: calc(14px * var(--hx-m));
  padding: calc(11px * var(--hx-m)) calc(6px * var(--hx-m));
  border-bottom: 1px solid rgba(159, 243, 255, 0.08);
  opacity: 0; transform: translate3d(-18px, 0, 0);
  transition: opacity 0.3s var(--ease), transform 0.35s var(--ease);
}
.hx-rrow.hx-on { opacity: 1; transform: none; }
.hx-rlbl { font: 500 max(var(--hx-min), calc(12px * var(--hx-m))) / 1 var(--f-mono); letter-spacing: 0.32em; color: var(--c-lbl); white-space: nowrap; }
.hx-rdots { flex: 1; height: 1px; align-self: center; background: repeating-linear-gradient(90deg, rgba(159, 243, 255, 0.25) 0 2px, transparent 2px 7px); }
.hx-rval { font: 700 calc(30px * var(--hx-m)) / 1 var(--f-cond); letter-spacing: 0.05em; color: var(--white); min-width: calc(120px * var(--hx-m)); text-align: right; }
.hx-rrow.hx-done .hx-rval { text-shadow: 0 0 14px rgba(111, 232, 255, 0.45); }
.hx-rrow:first-child .hx-rval { font-size: calc(40px * var(--hx-m)); color: #ffffff; }
.hx-res-rank { position: relative; text-align: center; opacity: 0.12; transition: opacity 0.3s; }
.hx-res-rank.hx-on { opacity: 1; }
.hx-res-rank:not(.hx-on) .hx-rank span, .hx-res-rank:not(.hx-on) .hx-rank-desc { visibility: hidden; }
.hx-rank-lbl { font: 500 max(var(--hx-min), calc(11px * var(--hx-m))) / 1 var(--f-mono); letter-spacing: 0.46em; margin-right: -0.46em; color: var(--c-lbl); margin-bottom: calc(34px * var(--hx-m)); }
.hx-newrec {
  display: inline-block; margin-top: calc(18px * var(--hx-m)); padding: calc(6px * var(--hx-m)) calc(18px * var(--hx-m));
  font: 700 calc(12px * var(--hx-m)) / 1 var(--f-cond); letter-spacing: 0.34em; margin-right: -0.34em; color: #1a0f00;
  background: linear-gradient(180deg, #ffe3a0, #ffb547); transform: skewX(-16deg);
  box-shadow: 0 0 18px rgba(255, 181, 71, 0.55);
  opacity: 0; visibility: hidden;
}
.hx-res-rank.hx-on .hx-newrec.hx-show { visibility: visible; animation: hx-recIn 0.6s var(--ease) 0.5s both, hx-breathe 2.2s ease-in-out 1.4s infinite; }
.hx-rank {
  --rk: #9ff3ff;
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: calc(250px * var(--hx-m)); height: calc(250px * var(--hx-m)); margin: calc(12px * var(--hx-m)) 0;
}
.hx-rank::before { /* rotated frame */
  content: ''; position: absolute; inset: 14%; border: 2px solid var(--rk); transform: rotate(45deg);
  box-shadow: 0 0 24px color-mix(in srgb, var(--rk) 50%, transparent), inset 0 0 24px color-mix(in srgb, var(--rk) 30%, transparent);
  opacity: 0.8;
}
.hx-rank::after { content: ''; position: absolute; inset: 8%; border: 1px solid color-mix(in srgb, var(--rk) 35%, transparent); transform: rotate(45deg); }
.hx-rank span {
  position: relative; font: 800 calc(150px * var(--hx-m)) / 1 var(--f-cond); color: var(--rk);
  text-shadow: 0 0 40px color-mix(in srgb, var(--rk) 70%, transparent), 0 4px 6px rgba(0, 0, 0, 0.6);
}
.hx-res-rank.hx-on .hx-rank span { animation: hx-rankIn 0.7s cubic-bezier(0.2, 1.4, 0.3, 1) both; }
.hx-res-rank.hx-on .hx-rank::before { animation: hx-rankFrame 0.8s var(--ease) both; }
.hx-rank-S { --rk: #ffd56a; }
.hx-rank-A { --rk: #9ff3ff; }
.hx-rank-B { --rk: #a9f5c8; }
.hx-rank-C { --rk: #ffb547; }
.hx-rank-D { --rk: #ff8c97; }
.hx-rank-desc { font: 700 calc(16px * var(--hx-m)) / 1 var(--f-cond); letter-spacing: 0.42em; margin-right: -0.42em; color: var(--white); }
.hx-res .hx-list-h { opacity: 0.35; transition: opacity 0.4s; }
.hx-results.hx-done .hx-list-h { opacity: 1; }

/* ============================================================================================================
   touch controls
   ============================================================================================================ */
.hx-touch { position: absolute; inset: 0; display: none; }
.hx-touch.hx-on { display: block; }
.hx-tzone { position: absolute; left: 0; bottom: 0; width: 50%; height: 72%; pointer-events: auto; touch-action: none; }
.hx-tstick {
  position: absolute; left: 0; top: 0; width: 128px; height: 128px; border-radius: 50%; pointer-events: none;
  border: 1.5px solid rgba(159, 243, 255, 0.45);
  background: radial-gradient(circle, rgba(159, 243, 255, 0.1), rgba(4, 12, 20, 0.35) 70%);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
  opacity: 0; transition: opacity 0.15s;
}
.hx-tstick.hx-on { opacity: 1; }
.hx-tstick i {
  position: absolute; left: 50%; top: 50%; width: 42%; height: 42%; border-radius: 50%;
  transform: translate3d(-50%, -50%, 0);
  background: radial-gradient(circle at 40% 35%, rgba(230, 253, 255, 0.9), rgba(159, 243, 255, 0.55) 60%, rgba(111, 232, 255, 0.35));
  box-shadow: 0 0 14px rgba(111, 232, 255, 0.6);
}
.hx-thint {
  position: absolute; left: calc(24px + env(safe-area-inset-left, 0px)); bottom: calc(30% + 0px); pointer-events: none;
  font: 500 11px / 1 var(--f-mono); letter-spacing: 0.3em; color: var(--c-mid);
  animation: hx-breathe 2.4s ease-in-out infinite; transition: opacity 0.4s;
}
.hx-thint.hx-off { opacity: 0; animation: none; }
.hx-tbtns {
  position: absolute; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: 236px; height: 236px; pointer-events: none;
}
.hx-tb {
  position: absolute; display: flex; align-items: center; justify-content: center; border-radius: 50%;
  pointer-events: auto; touch-action: none;
  border: 1.5px solid rgba(159, 243, 255, 0.5);
  background: radial-gradient(circle at 50% 40%, rgba(159, 243, 255, 0.14), rgba(4, 12, 20, 0.5));
  font: 700 11px / 1 var(--f-cond); letter-spacing: 0.2em; color: var(--white);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transition: transform 0.08s, background 0.08s, box-shadow 0.08s;
}
.hx-tb span { margin-right: -0.2em; }
.hx-tb.hx-down { transform: scale(0.93); background: radial-gradient(circle, rgba(159, 243, 255, 0.5), rgba(40, 120, 150, 0.45)); box-shadow: 0 0 22px rgba(111, 232, 255, 0.7); }
.hx-tb-fire { right: 0; bottom: 0; width: 96px; height: 96px; font-size: 14px; border-width: 2px; border-color: rgba(159, 243, 255, 0.8); }
.hx-tb-lock { right: 110px; bottom: 6px; width: 70px; height: 70px; border-color: rgba(255, 77, 94, 0.7); }
.hx-tb-lock.hx-down { background: radial-gradient(circle, rgba(255, 77, 94, 0.55), rgba(90, 10, 20, 0.5)); box-shadow: 0 0 22px rgba(255, 77, 94, 0.7); }
.hx-tb-boost { right: 12px; bottom: 112px; width: 70px; height: 70px; }
.hx-tb-roll { right: 100px; bottom: 96px; width: 58px; height: 58px; font-size: 10px; border-color: rgba(255, 181, 71, 0.65); }
.hx-tb-brake { right: 182px; bottom: 26px; width: 54px; height: 54px; font-size: 10px; }
.hx-rotate[hidden] { display: none; }
.hx-rotate { position: absolute; inset: 0; z-index: 100; display: grid; place-items: center; padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); background: rgba(4, 9, 17, .98); pointer-events: auto; text-align: center; overflow: auto; }
.hx-rotate > div { max-width: 360px; }
.hx-rotate-phone { display: block; color: var(--c-hi); font: 64px / 1 var(--f-cond); }
.hx-rotate h2 { font: 800 30px / 1.15 var(--f-cond); color: var(--white); }
.hx-rotate p, .hx-rotate small { font: 400 15px / 1.6 var(--f-sans); color: var(--c-mid); }
.hx-rotate small { display: block; margin-top: 22px; }
.hx-rotate button { min-height: 48px; padding: 10px 24px; border: 1px solid var(--c-hi); color: var(--white); background: rgba(159, 243, 255, .12); font: 600 15px var(--f-cond); border-radius: 6px; }
.hx-compact.hx-touching .hx-tbtns { width: 248px; height: 160px; }
.hx-compact.hx-touching .hx-tb-fire { width: 76px; height: 76px; }
.hx-compact.hx-touching .hx-tb-lock { right: 88px; width: 60px; height: 60px; }
.hx-compact.hx-touching .hx-tb-boost { right: 0; bottom: 88px; width: 58px; height: 58px; }
.hx-compact.hx-touching .hx-tb-roll { right: 76px; bottom: 84px; width: 52px; height: 52px; }
.hx-compact.hx-touching .hx-tb-brake { right: 154px; bottom: 6px; width: 52px; height: 52px; }
.hx-tpause {
  position: absolute; left: 50%; top: calc(10px + env(safe-area-inset-top, 0px)); transform: translateX(-50%);
  width: 40px; height: 40px; border-radius: 50%; pointer-events: auto; touch-action: none;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  border: 1.5px solid rgba(159, 243, 255, 0.45); background: rgba(4, 12, 20, 0.5);
}
.hx-tpause i { width: 4px; height: 14px; background: var(--c-hi); }
/* cinematic: pause button + a full-screen tap catcher (tap = reveal the skip hint, tap again = skip) */
.hx-tcine { position: absolute; inset: 0; display: none; pointer-events: auto; touch-action: none; }
.hx-tmode-cine .hx-tcine { display: block; }
.hx-tmode-cine .hx-tzone, .hx-tmode-cine .hx-tstick, .hx-tmode-cine .hx-thint, .hx-tmode-cine .hx-tbtns { display: none; }

/* ============================================================================================================
   compact (phones) — HUD moves to the top edge, touch owns the bottom
   ============================================================================================================ */
.hx-compact .hx-tl { left: calc(10px + env(safe-area-inset-left, 0px)); top: calc(8px + env(safe-area-inset-top, 0px)); width: auto; max-width: 56vw; padding: 5px 10px 6px 8px; }
.hx-compact .hx-sec-idx { display: none; }
.hx-compact .hx-sec-name { font-size: 12px; letter-spacing: 0.2em; }
.hx-compact .hx-prog { width: 110px; margin-top: 5px; }
.hx-compact .hx-obj { font-size: 12px; margin-top: 5px; }
.hx-compact .hx-tr { right: calc(10px + env(safe-area-inset-right, 0px)); top: calc(6px + env(safe-area-inset-top, 0px)); padding: 4px 8px 5px 22px; }
.hx-compact .hx-score-lbl { display: none; }
.hx-compact .hx-score { font-size: 26px; margin-top: 0; }
.hx-compact .hx-mult { font-size: 22px; }
.hx-compact .hx-chain b { font-size: 13px; }
.hx-compact .hx-ctimer { width: 60px; }
.hx-compact .hx-status {
  left: calc(10px + env(safe-area-inset-left, 0px)); bottom: auto; top: calc(78px + env(safe-area-inset-top, 0px));
  width: 176px; padding: 5px 12px 6px 8px;
}
.hx-compact .hx-status::before, .hx-compact .hx-weap::before { display: none; }
.hx-compact .hx-call { display: none; }
.hx-compact .hx-row { grid-template-columns: 30px 1fr 38px; column-gap: 6px; height: 15px; font-size: 10px; }
.hx-compact .hx-row > b { font-size: 10px; letter-spacing: 0.06em; }
.hx-compact .hx-val { font-size: 11px; }
.hx-compact .hx-bar { height: 6px; }
.hx-compact .hx-bar.hx-thin { height: 3px; }
.hx-compact .hx-bstate { font-size: 10px; letter-spacing: 0.02em; }
.hx-compact .hx-alert { font-size: 10px; letter-spacing: 0.18em; }
.hx-compact .hx-weap {
  right: calc(10px + env(safe-area-inset-right, 0px)); bottom: auto; top: calc(78px + env(safe-area-inset-top, 0px));
  width: auto; padding: 5px 8px 6px 18px; gap: 5px;
}
.hx-compact .hx-wmk, .hx-compact .hx-mcount { font-size: 13px; min-width: 0; }
.hx-compact .hx-wlbl { font-size: 10px; letter-spacing: 0.14em; }
.hx-compact .hx-wpips i { width: 5px; height: 10px; }
.hx-compact .hx-mpips i { width: 4px; height: 9px; }
.hx-compact .hx-feed { top: 42%; right: auto; left: calc(10px + env(safe-area-inset-left, 0px)); align-items: flex-start; }
.hx-compact .hx-fitem {
  padding: 5px 24px 5px 10px; border-right: 0; border-left: 2px solid var(--fc, var(--c));
  background: linear-gradient(90deg, rgba(2, 7, 13, 0.72), rgba(2, 7, 13, 0)); transform: translate3d(-24px, 0, 0);
}
.hx-compact .hx-fitem.hx-on { transform: none; }
.hx-compact .hx-fitem b { font-size: 12px; }
.hx-compact .hx-fitem span { font-size: 10px; letter-spacing: 0.16em; }
.hx-compact .hx-boss { top: calc(150px + env(safe-area-inset-top, 0px)); width: 92vw; max-width: 92vw; }
/* landscape phones: 150 px is the middle of a ~390 px screen, so the bar takes the sector / objective slot at the
   top-left instead (its phase label carries the objective; the slot ends clear of the centred pause button) */
.hx-compact:not(.hx-portrait) .hx-boss {
  left: calc(10px + env(safe-area-inset-left, 0px)); top: calc(6px + env(safe-area-inset-top, 0px));
  width: calc(50vw - 44px - env(safe-area-inset-left, 0px)); max-width: 420px;
  transform: translate3d(0, -8px, 0);
}
.hx-compact:not(.hx-portrait) .hx-boss.hx-on { transform: none; }
.hx-compact.hx-bossfight:not(.hx-portrait) .hx-tl { opacity: 0; visibility: hidden; }
.hx-compact .hx-boss-sub { display: none; }
.hx-compact .hx-boss-name { font-size: 14px; }
.hx-compact .hx-boss-phase { font-size: 10px; letter-spacing: 0.12em; }
.hx-compact .hx-bseg span { font-size: 10px; letter-spacing: 0; }
.hx-compact .hx-bseg span em { display: none; }
.hx-compact .hx-radio {
  top: calc(150px + env(safe-area-inset-top, 0px)); bottom: auto; max-width: 94vw; width: 94vw;
  padding: 7px 12px 8px 8px; gap: 10px;
}
.hx-compact.hx-bossfight .hx-radio { top: calc(206px + env(safe-area-inset-top, 0px)); }
.hx-compact .hx-port { width: 38px; height: 38px; }
.hx-compact .hx-port i { height: 20px; width: 2px; }
.hx-compact .hx-rtext { font-size: calc(14px * var(--hx-sub)); }
.hx-compact .hx-rhead b { font-size: 11px; }
.hx-compact .hx-rhead em { display: none; }
.hx-compact .hx-banner-name { font-size: 28px; padding: 4px 16px; }
.hx-compact .hx-banner-name::before, .hx-compact .hx-banner-name::after { width: 30px; }
.hx-compact .hx-banner { top: 34%; }
.hx-compact .hx-warn-t { font-size: 22px; }
.hx-compact .hx-warn { top: 33%; width: 92vw; }
.hx-compact .hx-warn-s { font-size: 10px; letter-spacing: 0.2em; }
.hx-compact .hx-foot-l { display: none; }
.hx-compact .hx-foot { justify-content: flex-end; }
.hx-compact .hx-kick { letter-spacing: 0.24em; font-size: 10px; }
.hx-compact .hx-card-t, .hx-compact .hx-card-enemy .hx-card-t { font-size: 24px; letter-spacing: 0.24em; margin-right: -0.24em; white-space: normal; }
.hx-compact .hx-card-s { font-size: 11px; letter-spacing: 0.3em; }
.hx-compact .hx-skip { right: calc(12px + env(safe-area-inset-right, 0px)); bottom: calc(14% + env(safe-area-inset-bottom, 0px)); }
.hx-compact .hx-victory .hx-vcenter { top: 32%; }
.hx-compact .hx-toast { top: 30%; font-size: 12px; }
.hx-compact .hx-mwarn { top: auto; bottom: calc(262px + env(safe-area-inset-bottom, 0px)); font-size: 12px; letter-spacing: 0.24em; padding: 5px 18px; white-space: nowrap; }
.hx-compact:not(.hx-touching) .hx-mwarn { bottom: 16%; }
/* landscape touch: 262 px from the bottom (above the portrait button cluster) would be behind the radio line */
.hx-compact.hx-touching:not(.hx-portrait) .hx-mwarn { bottom: 16%; }
.hx-compact .hx-mwarn b { font-size: 13px; }
.hx-compact .hx-tl { max-width: calc(50vw - 34px); }
.hx-compact .hx-res-head .hx-kick { font-size: 10px; letter-spacing: 0.14em; }
.hx-compact .hx-g-tx-sh { font-size: 10.5px; }
.hx-compact .hx-dead b { font-size: 26px; letter-spacing: 0.3em; }
/* landscape phones: keep status/weapons on the bottom corners only without touch controls */
.hx-compact:not(.hx-portrait) .hx-radio { top: auto; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); width: auto; max-width: 60vw; }
.hx-compact.hx-touching:not(.hx-portrait) .hx-radio { top: calc(58px + env(safe-area-inset-top, 0px)); bottom: auto; max-width: 44vw; }   /* below the pause button */

/* compact menus */
.hx-compact .hx-logo { top: 12vh; --lg: clamp(40px, 15.5vw, 120px); }
.hx-compact .hx-logo-top { font-size: 10px; letter-spacing: 0.2em; }
.hx-compact .hx-logo-top i { width: 18px; }
.hx-compact .hx-logo-sub { font-size: 10px; letter-spacing: 0.42em; margin-right: -0.42em; gap: 8px; }
.hx-compact .hx-logo-sub i { width: 22px; }
.hx-compact .hx-main { left: 50%; transform: translate3d(-50%, 0, 0); bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
.hx-compact .hx-mainmode .hx-main { transform: translate3d(-50%, 0, 0); }
.hx-compact .hx-main .hx-item { min-width: 250px; height: 46px; font-size: 18px; }
.hx-compact .hx-press { bottom: 22vh; }
.hx-compact .hx-press-t { font-size: 13px; letter-spacing: 0.34em; }
.hx-compact .hx-foot { height: 40px; padding: 0 14px env(safe-area-inset-bottom, 0px); font-size: 10px; letter-spacing: 0.12em; }
.hx-compact .hx-foot-r .hx-hint { margin-left: 12px; }
.hx-compact .hx-hint em { font-size: 10px; letter-spacing: 0.12em; }
.hx-compact .hx-h1 { font-size: 44px; }
.hx-compact .hx-pause-col { left: 20px; top: 9vh; width: calc(100vw - 40px); }
.hx-compact .hx-pause .hx-list { margin-left: -12px; }
.hx-compact .hx-pause .hx-item { height: 44px; font-size: 18px; }
.hx-compact .hx-pstats { display: none; }
.hx-compact .hx-panel { width: calc(100vw - 20px); max-height: calc(100vh - 20px); }
.hx-compact .hx-ph { padding: 16px 18px 10px; }
.hx-compact .hx-ph h2 { font-size: 24px; }
.hx-compact .hx-pbody { padding: 4px 6px; }
.hx-compact .hx-pbody .hx-item { padding: 0 10px; font-size: 13px; letter-spacing: 0.08em; height: 40px; }
.hx-compact .hx-selv { min-width: 84px; font-size: 13px; }
.hx-compact .hx-trk { width: 96px; }
.hx-compact .hx-sldv { min-width: 40px; font-size: 11px; }
.hx-compact .hx-pdesc { padding: 8px 18px; font-size: 12px; min-height: 0; }
.hx-compact .hx-pfoot { padding: 8px 18px 10px; }
.hx-compact .hx-cgrid, .hx-compact .hx-ctips { grid-template-columns: 1fr; }
.hx-compact .hx-cpage-pad .hx-cgrid { display: grid; }
.hx-compact .hx-cdia-wrap { display: none; }
.hx-compact .hx-h1-win { font-size: 30px; letter-spacing: 0.12em; margin-right: -0.12em; }
.hx-compact .hx-vscore b { font-size: 30px; }
.hx-compact .hx-main::before, .hx-compact .hx-main::after { left: -30px; right: -30px; clip-path: none; }
.hx-compact .hx-main { width: auto; padding: 12px 0 10px; }
.hx-compact .hx-main-kick { margin-left: 16px; font-size: 10px; letter-spacing: 0.24em; }
.hx-compact .hx-main-desc { display: none; }
.hx-compact .hx-record { display: none; }
.hx-compact .hx-tabs { margin-left: 0; width: 100%; margin-top: 8px; }
.hx-compact .hx-tab { padding: 6px 8px; font-size: 10px; letter-spacing: 0.12em; }
.hx-compact .hx-res { top: 46%; }
.hx-compact .hx-res-head .hx-h1 { font-size: 34px; }
.hx-compact .hx-res-body { grid-template-columns: 1fr; gap: 10px; margin-bottom: 18px; }
.hx-compact .hx-res-rank { order: -1; }
.hx-compact .hx-rank { width: 120px; height: 120px; margin: 4px 0; }
.hx-compact .hx-rank span { font-size: 72px; }
.hx-compact .hx-rrow { padding: 6px 4px; }
.hx-compact .hx-rlbl { font-size: 10px; letter-spacing: 0.16em; }
.hx-compact .hx-rval { font-size: 20px; min-width: 70px; }
.hx-compact .hx-rrow:first-child .hx-rval { font-size: 24px; }
.hx-compact .hx-list-h .hx-item { min-width: 0; flex: 1; font-size: 14px; letter-spacing: 0.14em; padding: 0 10px; }
.hx-compact .hx-over-info { gap: 18px; }
.hx-compact .hx-over-info span { font-size: 16px; }
.hx-compact .hx-list-c .hx-item { min-width: 240px; font-size: 18px; }

/* ============================================================================================================
   keyframes
   ============================================================================================================ */
@keyframes hx-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes hx-recIn { 0% { opacity: 0; transform: skewX(-16deg) scale(1.7); filter: blur(6px); } 100% { opacity: 1; transform: skewX(-16deg); filter: none; } }
@keyframes hx-strobe {
  0%, 100% { background-color: rgba(255, 50, 70, 0.28); border-color: rgba(255, 110, 124, 0.95); }
  50% { background-color: rgba(255, 50, 70, 0); border-color: rgba(255, 77, 94, 0.35); }
}
@keyframes hx-warnflash {
  0%, 100% { color: #fff3f4; text-shadow: 0 0 22px rgba(255, 70, 90, 1), 0 0 4px rgba(255, 200, 205, 0.9), 0 2px 3px rgba(0, 0, 0, 0.7); }
  50% { color: #ff4d5e; text-shadow: 0 0 14px rgba(255, 60, 80, 0.8), 0 2px 3px rgba(0, 0, 0, 0.7); }
}
@keyframes hx-pulse { from { opacity: 1; } to { opacity: 0.55; } }
@keyframes hx-bob { 0%, 100% { transform: translate3d(0, 0, 0) rotate(45deg); } 50% { transform: translate3d(0, 2px, 0) rotate(45deg); } }
@keyframes hx-alertPulse { from { opacity: 1; } to { opacity: 0.45; } }
@keyframes hx-breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@keyframes hx-breatheSoft { 0%, 100% { opacity: 1; } 50% { opacity: 0.66; } }   /* the title prompt: never fades into the ring plane */
@keyframes hx-eq { from { transform: scaleY(0.15); } to { transform: scaleY(1); } }
@keyframes hx-scan { from { top: 0; } to { top: 100%; } }
@keyframes hx-word { from { opacity: 0; transform: translate3d(0, 0.35em, 0); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes hx-haz { from { background-position: 0 0; } to { background-position: calc(28.28px * var(--hx-s)) 0; } }
@keyframes hx-lineIn { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }
@keyframes hx-fadeUp { from { opacity: 0; transform: translate3d(0, 8px, 0); } to { opacity: 1; transform: none; } }
@keyframes hx-letter {
  0% { opacity: 0; transform: translate3d(0, 0.18em, 0) scale(1.35); filter: blur(8px); }
  60% { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: none; filter: none; }
}
@keyframes hx-bannerIn {
  0% { opacity: 0; letter-spacing: 0.62em; filter: blur(10px); }
  100% { opacity: 1; filter: none; }
}
@keyframes hx-logoIn {
  0% { opacity: 0; letter-spacing: 0.3em; filter: blur(14px); }
  60% { opacity: 1; filter: blur(0); }
  100% { opacity: 1; letter-spacing: 0.07em; filter: none; }
}
@keyframes hx-shine { 0% { background-position: 120% 0, 0 0; } 24%, 100% { background-position: -20% 0, 0 0; } }
@keyframes hx-riftPulse { 0%, 100% { opacity: 0.92; } 45% { opacity: 1; } 50% { opacity: 0.7; } 55% { opacity: 1; } }
@keyframes hx-chromaA {
  0%, 61%, 64%, 88%, 90%, 100% { opacity: 0; transform: none; }
  62% { opacity: 1; transform: translate(-3px, 1px); }
  63% { opacity: 0.8; transform: translate(2px, 0); }
  89% { opacity: 0.7; transform: translate(-2px, -1px); }
}
@keyframes hx-chromaB {
  0%, 61%, 64%, 88%, 90%, 100% { opacity: 0; transform: none; }
  62% { opacity: 1; transform: translate(3px, -1px); }
  63% { opacity: 0.8; transform: translate(-2px, 1px); }
  89% { opacity: 0.7; transform: translate(2px, 1px); }
}
@keyframes hx-glitch { 0%, 100% { transform: none; filter: none; } 47% { transform: translate(2px, 0); filter: hue-rotate(40deg); } 48% { transform: translate(-2px, 1px); } 49% { transform: none; filter: none; } }
@keyframes hx-slam { 0% { opacity: 0; transform: scale(1.25); filter: blur(10px); } 100% { opacity: 1; transform: none; filter: none; } }
@keyframes hx-rankIn { 0% { opacity: 0; transform: scale(2.4); filter: blur(12px); } 100% { opacity: 1; transform: none; filter: none; } }
@keyframes hx-rankFrame { 0% { opacity: 0; transform: rotate(135deg) scale(1.6); } 100% { opacity: 0.8; transform: rotate(45deg); } }

/* ============================================================================================================
   reduced motion
   ============================================================================================================ */
@media (prefers-reduced-motion: reduce) {
  .hx-root *, .hx-root *::before, .hx-root *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: 0.12s !important; }
  .hx-port i { transform: scaleY(0.6); }
  .hx-lw::before, .hx-lw::after { display: none; }
  .hx-dstrip { transition: none !important; }
}

/* ============================================================================================================
   core boot overlay (.hr-boot, owned by src/main.js) — restyled into the title screen's logo lockup (same
   position, sizes, split HELION / rift / outlined RIFT, kicker and sub-line), so when the title opens under the
   fading loader (.hx-fromboot: no logo intro) the two overlap exactly. main.js markup is "Operation" +
   "HELION RIFT": the element texts are hidden and the lockup is drawn with pseudo-elements.
   --bm = 1px × the menu scale the UI computes (--hx-m0: clamp(0.72, min(w/1600, h/900) × 1.04, 1.25)).
   ============================================================================================================ */
body > .hr-boot {
  --bm: clamp(0.72px, min(0.065vw, 0.11556vh), 1.25px);
  --lg: clamp(52px, calc(128 * var(--bm)), 11.5vw);
  justify-content: flex-start;
  padding-top: 9.5vh;
  font-family: 'Saira Condensed', 'HX Condensed', 'Avenir Next Condensed', 'Arial Narrow', system-ui, sans-serif;
  background:
    radial-gradient(90% 60% at 50% 28%, rgba(40, 110, 150, 0.16), rgba(0, 0, 0, 0) 70%),
    radial-gradient(120% 90% at 50% 55%, #08121f 0%, #03060c 55%, #000 100%);
}
body > .hr-boot .hr-boot__kicker {
  display: flex; align-items: center; font-size: 0; letter-spacing: 0; text-transform: none; color: transparent;
  margin: 0 0 calc(18 * var(--bm));
}
body > .hr-boot .hr-boot__kicker::before, body > .hr-boot .hr-boot__kicker::after {
  font: 500 max(11px, calc(10.5 * var(--bm))) / 1 'JetBrains Mono', Menlo, ui-monospace, monospace;
  letter-spacing: 0.46em; color: rgba(170, 240, 252, 0.76);
}
body > .hr-boot .hr-boot__kicker::before { content: 'LANCE FLIGHT'; }
body > .hr-boot .hr-boot__kicker::after {
  content: 'CARRIER GROUP AURELIAN';
  padding-left: calc(2.4em + 46 * var(--bm));
  background: linear-gradient(rgba(159, 243, 255, 0.16), rgba(159, 243, 255, 0.16)) no-repeat 1.2em 50% / calc(46 * var(--bm)) 1px;
}
body > .hr-boot .hr-boot__title {
  display: flex; align-items: center; height: calc(var(--lg) * 1.02);   /* the title's rift is 1.02 em tall */
  font-size: 0; letter-spacing: 0; margin: 0; line-height: 0.86;
  color: transparent; text-shadow: none; background: none; filter: none;
}
body > .hr-boot .hr-boot__title::before, body > .hr-boot .hr-boot__title::after {
  font: 800 var(--lg) / 0.86 'Saira Condensed', 'HX Condensed', 'Avenir Next Condensed', 'Arial Narrow', system-ui, sans-serif;
  letter-spacing: 0.07em;
}
body > .hr-boot .hr-boot__title::before {
  content: 'HELION';
  background: linear-gradient(180deg, #ffffff 0%, #eafcff 38%, #a9e9f8 72%, #6fc7df 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 22px rgba(111, 232, 255, 0.35)) drop-shadow(0 3px 2px rgba(0, 0, 0, 0.55));
}
body > .hr-boot .hr-boot__title::after {
  /* the rift (a slanted tear of light, skewed like the title's) is painted in the left padding, then RIFT outlined */
  content: 'RIFT';
  padding-left: 0.46em; margin-right: -0.07em;
  color: rgba(159, 243, 255, 0.08);
  -webkit-text-fill-color: rgba(159, 243, 255, 0.08);
  -webkit-text-stroke: max(1.5px, calc(2.2 * var(--bm))) #9ff3ff;
  background: linear-gradient(111deg, rgba(111, 232, 255, 0) 43.5%, rgba(111, 232, 255, 0.95) 46.5%, #ffffff 48.6%, #ffffff 51.4%,
    rgba(255, 90, 168, 0.85) 53.5%, rgba(255, 90, 168, 0) 56.5%) no-repeat 0 0 / 0.46em 100%;
  filter: drop-shadow(0 0 14px rgba(111, 232, 255, 0.55));
}
body > .hr-boot::after {
  content: 'OPERATION \2014  HELION IV';
  margin-top: calc(22 * var(--bm));
  padding: 0 calc(88 * var(--bm));
  font: 500 calc(14 * var(--bm)) / 1 'JetBrains Mono', Menlo, ui-monospace, monospace;
  letter-spacing: 0.62em; margin-right: -0.62em; color: #dff8ff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  background:
    linear-gradient(90deg, rgba(159, 243, 255, 0), rgba(159, 243, 255, 0.72)) no-repeat 0 50% / calc(70 * var(--bm)) 1px,
    linear-gradient(270deg, rgba(159, 243, 255, 0), rgba(159, 243, 255, 0.72)) no-repeat calc(100% - 0.62em) 50% / calc(70 * var(--bm)) 1px;
}
@media (max-width: 759.98px), (max-height: 479.98px) {
  body > .hr-boot { --bm: clamp(0.7px, 0.1923vw, 0.9px); --lg: clamp(40px, 15.5vw, 120px); padding-top: 12vh; }
  body > .hr-boot .hr-boot__kicker::before, body > .hr-boot .hr-boot__kicker::after { font-size: 10px; letter-spacing: 0.2em; }
  body > .hr-boot .hr-boot__kicker::after { padding-left: calc(2.4em + 18px); background-size: 18px 1px; }
  body > .hr-boot::after { font-size: 10px; letter-spacing: 0.42em; margin-right: -0.42em; padding: 0 30px; background-size: 22px 1px, 22px 1px; }
}
body > .hr-boot .hr-boot__bar {
  position: absolute; left: 50%; bottom: 21vh; margin: 0; transform: translateX(-50%);
  width: min(360px, 64vw); height: 2px; background: rgba(159, 243, 255, 0.1);
}
body > .hr-boot .hr-boot__bar::before, body > .hr-boot .hr-boot__bar::after {
  content: ''; position: absolute; top: -3px; width: 1px; height: 8px; background: rgba(159, 243, 255, 0.4);
}
body > .hr-boot .hr-boot__bar::before { left: -6px; }
body > .hr-boot .hr-boot__bar::after { right: -6px; }
body > .hr-boot .hr-boot__label {
  position: absolute; left: 0; right: 0; bottom: calc(21vh - 30px); margin: 0; text-align: center;
  font: 500 10.5px / 1 'JetBrains Mono', ui-monospace, Menlo, monospace; letter-spacing: 0.34em; color: rgba(159, 243, 255, 0.55);
}
body > .hr-boot .hr-boot__err { position: absolute; left: 50%; bottom: 10vh; transform: translateX(-50%); }
