/* Factory HUD chrome (adapted from Command & Context, MIT): chunky cartoon-RTS panels — navy glass, thick gold
   bevels, cyan accents. Everything is sized in em off #hud's font-size, which hud.js scales with the window (--k),
   so the HUD keeps its proportions from 1080p to 4K. Only panels take pointer events; the floor stays draggable
   everywhere else. State chips (.fst-*) come from factory.css. */

#hud {
  --k: 1;
  --edge: 0.8em;
  --gold: #ffc53d;
  --gold-hi: #ffe7a0;
  --gold-lo: #b7801a;
  --cyan: #39e5ff;
  --ink: #0b1026;
  --text: #eef3ff;
  --muted: #9fb0d8;
  --panel-top: rgba(33, 49, 102, 0.93);
  --panel-bot: rgba(14, 22, 48, 0.9);
  --mini-w: 27em;
  font-size: calc(14px * var(--k));
  line-height: 1.25;
  color: var(--text);
  font-family: var(--font-body);
}

#hud * { box-sizing: border-box; }
#hud [hidden] { display: none !important; }
#hud button { font: inherit; color: inherit; }
#hud svg { display: block; overflow: visible; }
#hud code { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; }

/* ---- panel frame -------------------------------------------------------------------------------------------- */

#hud .panel,
#hud .plate {
  pointer-events: auto;
  background:
    linear-gradient(180deg, var(--panel-top), var(--panel-bot)) padding-box,
    linear-gradient(180deg, var(--gold-hi) 0%, var(--gold) 34%, var(--gold-lo) 100%) border-box;
  border: 0.16em solid transparent;
  border-radius: 0.95em;
  box-shadow:
    0 0.26em 0 rgba(3, 6, 18, 0.6),
    0 0.7em 1.5em rgba(0, 0, 0, 0.36),
    inset 0 0.12em 0 rgba(255, 255, 255, 0.14),
    inset 0 0 0 0.08em rgba(57, 229, 255, 0.14),
    inset 0 -0.4em 0.9em rgba(0, 0, 0, 0.22);
}
#hud .panel { position: absolute; }
#hud .plate { position: relative; }

/* corner rivets */
#hud .panel::after,
#hud .plate::after {
  content: '';
  position: absolute;
  inset: 0.2em;
  pointer-events: none;
  --rv: radial-gradient(circle, #fff3c9 0 0.07em, #c99426 0.08em 0.14em, rgba(0, 0, 0, 0.35) 0.15em 0.17em, transparent 0.18em);
  background:
    var(--rv) left top / 0.4em 0.4em no-repeat,
    var(--rv) right top / 0.4em 0.4em no-repeat,
    var(--rv) left bottom / 0.4em 0.4em no-repeat,
    var(--rv) right bottom / 0.4em 0.4em no-repeat;
  opacity: 0.9;
}

#hud .panel-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.45em;
  min-height: 2.25em;
  padding: 0.3em 0.45em 0.3em 0.75em;
  border-bottom: 0.1em solid rgba(255, 197, 61, 0.32);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0) 90%);
  border-radius: 0.8em 0.8em 0 0;
}
#hud .ph-t {
  font: 400 1.05em/1 var(--font-title);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 0.09em 0 var(--ink);
}
#hud .ph-s { font: 700 0.62em/1 var(--font-body); letter-spacing: 0.24em; text-transform: uppercase; color: #8fdcff; margin-top: 0.15em; }
#hud .ph-sp { flex: 1; }
#hud .ph-icon svg { width: 1.35em; height: 1.35em; }

#hud .mini-btn {
  width: 1.75em;
  height: 1.75em;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0.1em solid var(--ink);
  border-radius: 0.45em;
  background: linear-gradient(180deg, #2c3f86, #172354);
  box-shadow: inset 0 0.08em 0 rgba(255, 255, 255, 0.18), 0 0.12em 0 #060a1c;
  cursor: pointer;
}
#hud .mini-btn svg { width: 1.05em; height: 1.05em; }
#hud .mini-btn:hover { background: linear-gradient(180deg, #3b56b2, #203272); }
#hud .mini-btn:active { transform: translateY(0.08em); box-shadow: inset 0 0.08em 0 rgba(255, 255, 255, 0.18), 0 0.04em 0 #060a1c; }

#hud .muted { color: var(--muted); }

/* state chips used by the HUD on top of factory.css */
#hud .fst { white-space: nowrap; }
.fst-orphan { background: #8a5a2c; color: #ffe6c9; }
.fst-degraded { background: #e0a020; color: #2a1a00; }
.fst-decom { background: repeating-linear-gradient(-45deg, #ff7a2f 0 0.4em, #c95a1a 0.4em 0.8em); color: #1b1b1b; }

/* lamp dot, belt swatch */
#hud .ldot { flex: none; display: inline-block; width: 0.66em; height: 0.66em; border-radius: 50%; background: var(--c); box-shadow: 0 0 0.45em var(--c), 0 0 0 0.1em rgba(0, 0, 0, 0.45); vertical-align: 0.02em; }
#hud .bsw { flex: none; display: inline-block; width: 1.1em; height: 0.42em; border-radius: 0.2em; background: repeating-linear-gradient(90deg, var(--c) 0 0.28em, color-mix(in srgb, var(--c) 55%, black) 0.28em 0.4em); box-shadow: 0 0 0 0.08em rgba(0, 0, 0, 0.5); }

/* ---- top bar ------------------------------------------------------------------------------------------------ */

#hud .topbar {
  position: absolute;
  left: var(--edge);
  right: var(--edge);
  top: 0.55em;
  height: 3.4em;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  z-index: 3;
}
#hud .topbar .plate { height: 3.4em; display: flex; align-items: center; }
#hud .tb-left { padding: 0 0.95em 0 0.4em; gap: 0.55em; }
#hud .tb-right { padding: 0 0.4em 0 0.9em; gap: 0.7em; }
#hud .tb-midwrap {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}
#hud .tb-mid { padding: 0 0.35em; gap: 0.2em; border-radius: 0.4em 0.4em 1.05em 1.05em; }

/* logo */
#hud .logo { display: flex; align-items: center; gap: 0.35em; padding: 0; border: 0; background: none; cursor: pointer; }
#hud .logo .emblem {
  width: 2.55em;
  height: 2.75em;
  filter: drop-shadow(0 0.14em 0 rgba(0, 0, 0, 0.45)) drop-shadow(0 0 0.5em rgba(57, 229, 255, 0.35));
  transition: transform 0.25s cubic-bezier(0.2, 1.8, 0.4, 1);
}
#hud .logo:hover .emblem { transform: rotate(-8deg) scale(1.08); }
#hud .logo .em-gear { transform-origin: 24px 25px; animation: hud-cog 16s linear infinite; }
@keyframes hud-cog { to { transform: rotate(360deg); } }
#hud .logo-t { display: flex; flex-direction: column; align-items: flex-start; }
#hud .logo-svg { height: 2.05em; width: 8.6em; }
#hud .logo-sub {
  margin-top: 0.2em;
  padding-left: 0.15em;
  font: 700 0.5em/1 var(--font-body);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #8fb6ff;
  white-space: nowrap;
}
#hud .lt { font-family: var(--font-title); letter-spacing: 1px; }
#hud .lt-ext { fill: #03050f; stroke: #03050f; stroke-width: 10px; stroke-linejoin: round; }
#hud .lt-out { fill: none; stroke: #0b1026; stroke-width: 7.5px; stroke-linejoin: round; }
#hud .lt-fill { fill: url(#fac-logo-gold); }
#hud .lt-shine { fill: none; stroke: rgba(120, 66, 0, 0.55); stroke-width: 0.8px; }
#hud .lt-clip { font-family: var(--font-title); letter-spacing: 1px; }
#hud .lt-glint { animation: hud-glint 7s ease-in-out 1.5s infinite; }
@keyframes hud-glint { 0%, 78% { transform: translateX(0); } 100% { transform: translateX(260px); } }
#hud.rm .lt-glint { animation: none; opacity: 0; }
#hud.rm .logo .em-gear { animation: none; }

#hud .demo-badge {
  padding: 0.38em 0.6em 0.32em;
  border: 0.12em solid var(--ink);
  border-radius: 0.45em;
  background: linear-gradient(180deg, #c3a0ff, #7a4dff);
  box-shadow: 0 0.16em 0 #2e1a70, inset 0 0.1em 0 rgba(255, 255, 255, 0.35);
  font: 400 0.92em/1 var(--font-title);
  letter-spacing: 0.08em;
  color: #fff;
  text-shadow: 0 0.08em 0 #2e1a70;
  transform: rotate(-4deg);
  cursor: pointer;
  white-space: nowrap;
}
#hud .demo-badge:hover { transform: rotate(-2deg) scale(1.05); }

/* resource counters */
#hud .res {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.32em;
  height: 2.6em;
  padding: 0 0.7em 0 0.3em;
  border-radius: 0.6em;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0.14));
  box-shadow: inset 0 0.1em 0.25em rgba(0, 0, 0, 0.5), inset 0 -0.06em 0 rgba(255, 255, 255, 0.08);
  cursor: default;
  transition: background 0.3s, box-shadow 0.3s;
}
#hud .res.clickable { cursor: pointer; }
#hud .res.clickable:hover { background: linear-gradient(180deg, rgba(57, 229, 255, 0.16), rgba(0, 0, 0, 0.14)); }
#hud .res .ri svg { width: 1.9em; height: 1.9em; filter: drop-shadow(0 0.1em 0 rgba(0, 0, 0, 0.35)); }
#hud .res .rv { display: flex; flex-direction: column; align-items: flex-start; }
#hud .rv-n {
  font: 400 1.38em/1 var(--font-title);
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 0.08em 0 var(--ink), 0 0 0.6em rgba(57, 229, 255, 0.22);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#hud .rv-n small.of { margin: 0 0 0 0.05em; font: 400 0.62em/1 var(--font-title); letter-spacing: 0.01em; text-transform: none; color: #b9c7ec; }
#hud .res small { margin-top: 0.2em; font: 700 0.54em/1 var(--font-body); letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
#hud .res.warn .rv-n { color: #ffc46b; }
#hud .res.hot { background: linear-gradient(180deg, rgba(224, 40, 40, 0.55), rgba(90, 10, 10, 0.4)); box-shadow: inset 0 0 0 0.1em rgba(255, 90, 77, 0.8), 0 0 0.9em rgba(255, 59, 48, 0.45); animation: hud-hotres 1.4s ease-in-out infinite; }
#hud .res.hot .rv-n { color: #fff; }
#hud .res.hot small { color: #ffc9c2; }
#hud .res.warn[data-k='alerts'] { background: linear-gradient(180deg, rgba(255, 159, 58, 0.35), rgba(0, 0, 0, 0.14)); box-shadow: inset 0 0 0 0.1em rgba(255, 159, 58, 0.7); }
@keyframes hud-hotres { 50% { box-shadow: inset 0 0 0 0.1em rgba(255, 90, 77, 1), 0 0 1.6em rgba(255, 59, 48, 0.8); } }
#hud.rm .res.hot { animation: none; }

/* matches/min: three numbers in one counter */
#hud .res.tri { padding-right: 0.55em; }
#hud .res.tri .tv { display: flex; align-items: center; gap: 0.35em; }
#hud .res.tri .tc { display: flex; flex-direction: column; align-items: center; }
#hud .res.tri .tc b { font: 400 1.18em/1 var(--font-title); color: #bff6ff; text-shadow: 0 0.08em 0 var(--ink); font-variant-numeric: tabular-nums; }
#hud .res.tri .tc small { margin-top: 0.22em; letter-spacing: 0.1em; }
#hud .res.tri .tsep { width: 0.07em; height: 1.6em; background: rgba(143, 182, 255, 0.25); }
#hud .rt-tag {
  position: absolute;
  right: 0.4em;
  bottom: -0.55em;
  padding: 0.12em 0.35em;
  border-radius: 0.3em;
  background: #1d4f9a;
  box-shadow: 0 0 0 0.08em var(--ink);
  font: 700 0.56em/1 var(--font-body);
  font-style: normal;
  letter-spacing: 0.06em;
  color: #cfe6ff;
  white-space: nowrap;
}

/* clock, connection light, buttons */
#hud .clock { display: flex; align-items: baseline; gap: 0.18em; cursor: default; white-space: nowrap; }
#hud .clock b { font: 400 1.5em/1 var(--font-title); color: #fff; text-shadow: 0 0.08em 0 var(--ink); letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
#hud .conn {
  display: flex;
  align-items: center;
  gap: 0.42em;
  padding: 0.38em 0.6em;
  border-radius: 0.5em;
  background: rgba(0, 0, 0, 0.32);
  box-shadow: inset 0 0.08em 0.2em rgba(0, 0, 0, 0.45);
  font: 700 0.7em/1 var(--font-body);
  letter-spacing: 0.2em;
  color: #c9d6f5;
  white-space: nowrap;
  cursor: default;
}
#hud .conn i { width: 0.8em; height: 0.8em; border-radius: 50%; background: #8a94a6; box-shadow: 0 0 0 0.14em rgba(0, 0, 0, 0.4); }
#hud .conn.c-live { color: #aaffcf; }
#hud .conn.c-live i { background: #3ddc84; box-shadow: 0 0 0 0.14em rgba(0, 0, 0, 0.4), 0 0 0.7em #3ddc84; animation: hud-live 1.8s ease-in-out infinite; }
#hud .conn.c-stale { color: #ffe08a; }
#hud .conn.c-stale i { background: #c9a63a; animation: hud-blink 1.6s steps(2, jump-none) infinite; }
#hud .conn.c-demo { color: #e2d4ff; }
#hud .conn.c-demo i { background: #b58cff; box-shadow: 0 0 0 0.14em rgba(0, 0, 0, 0.4), 0 0 0.7em #b58cff; }
#hud .conn.c-reconnecting { color: #ffd98a; }
#hud .conn.c-reconnecting i { background: #ffb020; animation: hud-blink 0.8s steps(2, jump-none) infinite; }
#hud .conn.c-connecting i { background: #7fa0ff; animation: hud-blink 1.1s steps(2, jump-none) infinite; }
@keyframes hud-live { 50% { opacity: 0.45; } }
@keyframes hud-blink { 0% { opacity: 1; } 100% { opacity: 0.15; } }

#hud .btns { display: flex; gap: 0.32em; }
#hud .btn {
  width: 2.35em;
  height: 2.35em;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0.12em solid var(--ink);
  border-radius: 0.6em;
  background: linear-gradient(180deg, #2f438e, #172354);
  box-shadow: inset 0 0.1em 0 rgba(255, 255, 255, 0.2), 0 0.18em 0 #060a1c;
  cursor: pointer;
  transition: filter 0.15s;
}
#hud .btn svg { width: 1.45em; height: 1.45em; }
#hud .btn:hover { filter: brightness(1.25); }
#hud .btn:active { transform: translateY(0.1em); box-shadow: inset 0 0.1em 0 rgba(255, 255, 255, 0.2), 0 0.06em 0 #060a1c; }
#hud .btn.on { background: linear-gradient(180deg, #1cb2da, #0e5c84); }
#hud .btn.on.blocked { background: linear-gradient(180deg, #e0a52a, #8a5a06); }
#hud.drawer-open .btn[data-act='settings'] { background: linear-gradient(180deg, #ffe08a, #d99a1f); }

/* director caption (under the top bar) */
#hud .dir-cap {
  position: absolute;
  left: 50%;
  top: 4.5em;
  translate: -50% 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.55em;
  max-width: min(46em, calc(100% - 2 * (24em + 2 * var(--edge))));
  padding: 0.34em 0.9em 0.3em 0.6em;
  border-radius: 2em;
  background: rgba(8, 12, 30, 0.82);
  box-shadow: 0 0 0 0.1em rgba(57, 229, 255, 0.55), 0 0.3em 0.9em rgba(0, 0, 0, 0.4);
  pointer-events: none;
  white-space: nowrap;
}
#hud .dir-cap .dc-dot { width: 0.6em; height: 0.6em; border-radius: 50%; background: #ff4d4d; box-shadow: 0 0 0.5em #ff4d4d; animation: hud-live 1.2s ease-in-out infinite; }
#hud .dir-cap .dc-t { font: 700 0.62em/1 var(--font-body); letter-spacing: 0.26em; color: #8fdcff; }
#hud .dir-cap .dc-x { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 700; font-size: 0.9em; color: #fff; }
#hud .dir-cap.in { animation: hud-capin 0.5s ease both; }
@keyframes hud-capin { 0% { opacity: 0; transform: translateY(-0.4em); } 100% { opacity: 1; transform: none; } }
#hud.rm .dir-cap.in, #hud.rm .dir-cap .dc-dot { animation: none; }

/* ---- minimap -------------------------------------------------------------------------------------------------- */

#hud .minimap { left: var(--edge); bottom: var(--edge); width: var(--mini-w); z-index: 2; }
#hud .mm-screen {
  position: relative;
  height: 11em;
  margin: 0.45em;
  border-radius: 0.6em;
  overflow: hidden;
  background: #0c1430;
  box-shadow: 0 0 0 0.12em rgba(0, 0, 0, 0.55), inset 0 0 1.5em rgba(0, 0, 0, 0.6);
}
#hud .mm-canvas { display: block; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
#hud .mm-glass {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    radial-gradient(ellipse at 30% -10%, rgba(255, 255, 255, 0.12), transparent 55%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 3px);
  box-shadow: inset 0 0 0 1px rgba(57, 229, 255, 0.3), inset 0 0 2em rgba(0, 20, 40, 0.5);
}
#hud .minimap.collapsed { width: auto; }
#hud .minimap.collapsed .mm-screen { display: none; }
#hud .minimap.collapsed .panel-head { border-bottom: 0; border-radius: 0.8em; }

/* ---- EVA log ---------------------------------------------------------------------------------------------------- */

#hud .eva {
  right: var(--edge);
  top: 4.75em;
  width: 24em;
  max-height: calc(100% - 4.75em - 2 * var(--edge));
  display: flex;
  flex-direction: column;
  z-index: 2;
  transition: opacity 0.2s;
}
#hud.drawer-open .eva { opacity: 0; pointer-events: none; }
#hud .eva.quiet:not(:hover) { opacity: 0.82; }
#hud .eva .rec { width: 0.62em; height: 0.62em; border-radius: 50%; background: #ff4d4d; box-shadow: 0 0 0.5em #ff4d4d, 0 0 0 0.12em rgba(0, 0, 0, 0.4); }
#hud .eva .rec.blip { animation: hud-rec 0.45s ease 4; }
@keyframes hud-rec { 50% { opacity: 0.2; } }
#hud .eva-list { list-style: none; margin: 0; padding: 0.4em 0.45em 0.5em; overflow: hidden; display: flex; flex-direction: column; gap: 0.3em; }
#hud .eva.collapsed .eva-list,
#hud .eva.collapsed .eva-empty { display: none; }
#hud .eva.collapsed { width: auto; }
#hud .eva.collapsed .panel-head { border-bottom: 0; border-radius: 0.8em; }
#hud .eva-line {
  position: relative;
  display: grid;
  grid-template-columns: 1.95em minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55em;
  padding: 0.4em 0.55em 0.4em 0.5em;
  border-radius: 0.55em;
  background: linear-gradient(90deg, color-mix(in srgb, var(--tone) 24%, rgba(0, 0, 0, 0.2)), rgba(255, 255, 255, 0.03) 75%);
  box-shadow: inset 0.24em 0 0 var(--tone), inset 0 0 0 0.07em rgba(255, 255, 255, 0.05);
  font-size: 0.93em;
  line-height: 1.28;
  cursor: pointer;
  transition: opacity 0.8s, filter 0.8s, transform 0.18s, background 0.2s;
}
#hud .eva-line:hover { transform: translateX(-0.25em); background: linear-gradient(90deg, color-mix(in srgb, var(--tone) 40%, rgba(0, 0, 0, 0.1)), rgba(255, 255, 255, 0.08) 80%); opacity: 1; filter: none; }
#hud .eva-line.picked { box-shadow: inset 0.24em 0 0 var(--tone), 0 0 0 0.12em var(--cyan); }
#hud .ev-ico svg { width: 1.95em; height: 1.95em; filter: drop-shadow(0 0.1em 0 rgba(0, 0, 0, 0.35)); }
#hud .ev-txt { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-shadow: 0 0.06em 0 rgba(0, 0, 0, 0.5); }
#hud .ev-age { align-self: start; margin-top: 0.2em; font: 700 0.72em/1 var(--font-body); color: var(--muted); white-space: nowrap; }
#hud .eva-line.dim { opacity: 0.62; filter: saturate(0.7); }
#hud .eva-line.hist { opacity: 0.5; filter: saturate(0.55); }
#hud .eva-line.pinned { opacity: 1; filter: none; box-shadow: inset 0.24em 0 0 var(--tone), 0 0 0 0.09em color-mix(in srgb, var(--tone) 60%, transparent); }
#hud .eva-line.in { animation: hud-evain 0.55s cubic-bezier(0.2, 1.5, 0.4, 1) both; }
#hud .eva-line.out { opacity: 0; transform: translateX(1.2em); }
@keyframes hud-evain {
  0% { opacity: 0; transform: translateX(2em) scale(0.96); filter: brightness(2.2); }
  60% { filter: brightness(1.5); }
  100% { opacity: 1; transform: none; filter: none; }
}
#hud .eva-sep {
  display: flex;
  align-items: center;
  gap: 0.7em;
  margin: 0.15em 0.4em 0;
  font: 700 0.6em/1 var(--font-body);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #7383b3;
}
#hud .eva-sep::before, #hud .eva-sep::after { content: ''; flex: 1; height: 1px; background: rgba(143, 182, 255, 0.25); }
#hud .eva-sep.away { color: #9aa9d8; letter-spacing: 0.2em; }
#hud .eva-empty { padding: 0.7em 1em 0.9em; color: var(--muted); font-style: italic; font-size: 0.88em; }

/* highlighted values inside EVA lines */
#hud .e-kind { color: #ffd98a; font-weight: 700; }
#hud .e-name { color: #fff; font-weight: 700; }
#hud .e-at { color: #9fb0d8; font-weight: 600; font-size: 0.92em; }
#hud .e-belt { color: #ffe38a; font-weight: 700; }
#hud .e-zone { color: #ffe38a; font: 400 1.05em/1 var(--font-title); letter-spacing: 0.02em; }
#hud .e-num { font: 400 1.08em/1 var(--font-title); letter-spacing: 0.02em; color: #fff; }
#hud .eva-line.t-ice .e-name { color: #cffaff; }

/* ---- selection card ------------------------------------------------------------------------------------------------ */

#hud .card {
  left: 50%;
  bottom: var(--edge);
  width: min(54em, calc(100% - 2 * (var(--mini-w) + 2 * var(--edge))));
  max-height: min(48vh, 31em);
  display: flex;
  flex-direction: column;
  translate: -50% 0;
  z-index: 4;
}
#hud .card.in { animation: hud-cardin 0.38s cubic-bezier(0.2, 1.35, 0.4, 1) both; }
@keyframes hud-cardin { 0% { opacity: 0; transform: translateY(1.5em) scale(0.97); } 100% { opacity: 1; transform: none; } }
#hud .card-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7em;
  padding: 0.5em 0.55em 0.5em 0.6em;
  border-bottom: 0.1em solid rgba(255, 197, 61, 0.32);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 65%);
  border-radius: 0.8em 0.8em 0 0;
}
#hud .crest-wrap { flex: none; width: 3.2em; height: 2.6em; position: relative; }
#hud .crest-wrap > svg { position: absolute; left: 0; bottom: -0.2em; width: 3.2em; height: 3.52em; filter: drop-shadow(0 0.2em 0 rgba(0, 0, 0, 0.45)) drop-shadow(0 0 0.6em rgba(0, 0, 0, 0.35)); }
#hud .card .ttl { flex: 1; min-width: 0; }
#hud .card .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 1.5em/1.08 var(--font-title); letter-spacing: 0.01em; color: #fff; text-shadow: 0 0.08em 0 var(--ink); }
#hud .card .sub { display: flex; align-items: center; gap: 0.35em; margin-top: 0.22em; overflow: hidden; white-space: nowrap; font-size: 0.82em; color: #b9c7ec; }
#hud .card .sub code { font-size: 0.92em; color: #cfe0ff; overflow: hidden; text-overflow: ellipsis; }
#hud .card .sub .xp { color: #8fc2ff; font-weight: 700; }
#hud .hchip { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 0.3em; }
#hud .hchip .fst { font-size: 1em; padding: 0.18em 0.55em 0.2em; }
#hud .hchip .since { font-size: 0.72em; color: var(--muted); white-space: nowrap; }
#hud .card .x {
  flex: none;
  align-self: flex-start;
  width: 1.8em;
  height: 1.8em;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0.1em solid var(--ink);
  border-radius: 0.5em;
  background: linear-gradient(180deg, #37488e, #1b2658);
  box-shadow: inset 0 0.08em 0 rgba(255, 255, 255, 0.18), 0 0.12em 0 #060a1c;
  cursor: pointer;
}
#hud .card .x svg { width: 1em; height: 1em; }
#hud .card .x:hover { background: linear-gradient(180deg, #d84a4a, #8e1f2c); }
#hud .card-body {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: 0.6em 1.1em;
  padding: 0.6em 0.8em 0.75em;
  overflow: auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 197, 61, 0.5) transparent;
}
#hud .card-body .col { min-width: 0; display: flex; flex-direction: column; gap: 0.55em; }
#hud .card-body .col.r { padding-left: 0.9em; border-left: 0.08em solid rgba(143, 182, 255, 0.16); }
#hud .card-body:has(> .col.r[hidden]) { grid-template-columns: 1fr; }
#hud .k-gone .card-body, #hud .k-unknown .card-body { grid-template-columns: 1fr; }
#hud .card-body.more { -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 2.2em), rgba(0, 0, 0, 0.25)); mask-image: linear-gradient(180deg, #000 calc(100% - 2.2em), rgba(0, 0, 0, 0.25)); }
#hud .sec p { margin: 0; }
#hud .sec-h {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin-bottom: 0.35em;
  font: 700 0.64em/1 var(--font-body);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #8fdcff;
}
#hud .sec-h::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(143, 220, 255, 0.3), transparent); order: 1; }
#hud .sec-h em { order: 2; font-style: normal; font-weight: 600; letter-spacing: 0.04em; text-transform: none; color: var(--muted); font-size: 1.15em; }
#hud .sec-h em .bad { color: #ff8a7a; }

#hud .doing {
  display: flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.45em 0.65em;
  border-radius: 0.55em;
  background: rgba(0, 0, 0, 0.28);
  box-shadow: inset 0 0 0 0.08em rgba(255, 255, 255, 0.06);
  font-weight: 600;
}
#hud .doing span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#hud .doing.ds-working { box-shadow: inset 0 0 0 0.08em rgba(47, 207, 120, 0.35); }
#hud .doing.ds-frozen { background: rgba(159, 243, 255, 0.14); box-shadow: inset 0 0 0 0.1em rgba(159, 243, 255, 0.7); color: #e0fdff; }
#hud .doing.ds-failed { background: rgba(255, 59, 48, 0.16); box-shadow: inset 0 0 0 0.1em rgba(255, 90, 77, 0.7); color: #ffd6d0; }
#hud .doing.ds-blocked { background: rgba(255, 159, 58, 0.14); box-shadow: inset 0 0 0 0.1em rgba(255, 159, 58, 0.6); color: #ffe6c9; }
#hud .doing.ds-orphan { background: rgba(168, 112, 60, 0.18); box-shadow: inset 0 0 0 0.1em rgba(168, 112, 60, 0.7); color: #ffe6c9; }
#hud .doing.ds-off, #hud .doing.ds-unknown { color: #b9c2d6; }
#hud .doing.ds-working .ldot, #hud .doing.ds-failed .ldot, #hud .doing.ds-frozen .ldot { animation: hud-live 1.2s ease-in-out infinite; }
#hud .hint, #hud .why { margin-top: 0.35em !important; font-size: 0.8em; line-height: 1.35; color: #c9d6f5; }
#hud .why b { margin-right: 0.35em; font: 700 0.8em/1 var(--font-body); letter-spacing: 0.18em; text-transform: uppercase; color: #8fdcff; }
#hud .blurb { font-style: italic; color: #cdd9f7; font-size: 0.88em; line-height: 1.35; }

/* bars */
#hud .fbar { position: relative; height: 0.9em; border-radius: 0.5em; background: rgba(255, 255, 255, 0.1); box-shadow: inset 0 0.08em 0.22em rgba(0, 0, 0, 0.55); overflow: hidden; }
#hud .fbar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--p);
  border-radius: inherit;
  background: linear-gradient(180deg, color-mix(in srgb, var(--cc) 55%, white), var(--cc) 55%, color-mix(in srgb, var(--cc) 75%, black));
  box-shadow: 0 0 0.7em var(--cc);
  transition: width 0.6s ease;
}
#hud .meters { display: flex; flex-direction: column; gap: 0.3em; }
#hud .mrow { display: grid; grid-template-columns: 5.2em minmax(3em, 1fr) auto; align-items: center; gap: 0.55em; font-size: 0.86em; }
#hud .mrow small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 0.72em/1 var(--font-body); letter-spacing: 0.12em; text-transform: uppercase; color: #8ea3d6; }
#hud .mrow.disk small { text-transform: none; letter-spacing: 0.02em; font-size: 0.8em; }
#hud .mrow .fbar { height: 0.7em; }
#hud .mrow span { font-weight: 700; color: #fff; white-space: nowrap; font-size: 0.92em; }

/* LEDs (drills) */
#hud .leds { display: flex; height: 0.9em; border-radius: 0.3em; overflow: hidden; background: #10131c; box-shadow: inset 0 0 0 0.08em rgba(255, 255, 255, 0.1); }
#hud .leds i { height: 100%; }
#hud .leds i.ok { background: repeating-linear-gradient(90deg, #3ddc84 0 0.5em, #1f8a52 0.5em 0.6em); box-shadow: 0 0 0.6em rgba(61, 220, 132, 0.6); }
#hud .leds i.fail { background: repeating-linear-gradient(90deg, #ff3b30 0 0.5em, #8e1f18 0.5em 0.6em); }
#hud .ledn { display: flex; gap: 0.9em; margin-top: 0.3em; font-size: 0.8em; font-weight: 700; }
#hud .ledn .ok { color: #9dffc6; }
#hud .ledn .fail { color: #ff9a8a; }

#hud .stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.3em; }
#hud .stats.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#hud .stat.w2 { grid-column: span 2; }
#hud .stat { min-width: 0; padding: 0.3em 0.45em 0.34em; border-radius: 0.45em; background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 0.07em rgba(255, 255, 255, 0.06); cursor: default; }
#hud .stat small { display: block; margin-bottom: 0.22em; font: 700 0.58em/1 var(--font-body); letter-spacing: 0.15em; text-transform: uppercase; color: #8ea3d6; }
#hud .stat b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: 0.9em; color: #fff; }
#hud .stat b small { display: inline; font-size: 0.8em; letter-spacing: 0; text-transform: none; color: var(--muted); }
#hud .stat.hot { background: rgba(255, 90, 77, 0.14); box-shadow: inset 0 0 0 0.08em rgba(255, 90, 77, 0.5); }
#hud .stat.hot b { color: #ff9a7a; }

#hud .list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.22em; }
#hud .row {
  width: 100%;
  display: grid;
  grid-template-columns: 1.1em minmax(0, auto) minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 0.45em;
  row-gap: 0.12em;
  align-items: center;
  padding: 0.3em 0.5em;
  border: 0;
  border-radius: 0.45em;
  background: rgba(255, 255, 255, 0.045);
  text-align: left;
  cursor: pointer;
}
#hud .row:hover { background: rgba(57, 229, 255, 0.14); box-shadow: inset 0 0 0 0.08em rgba(57, 229, 255, 0.5); }
#hud .row > .ldot, #hud .row > .bsw { grid-row: 1 / span 2; justify-self: center; }
#hud .rn { font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.92em; }
#hud .rd { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8em; color: #c9d6f5; }
#hud .rt { grid-column: 4; grid-row: 1; font-size: 0.7em; color: var(--muted); font-weight: 700; white-space: nowrap; }
#hud .rt.rs-frozen { color: #9ff3ff; }
#hud .rt.rs-failed, #hud .rt.rs-blocked { color: #ff8a7a; }
#hud .rt.rs-working { color: #7fe6ab; }
#hud .rt.rs-idle { color: #ffe38a; }
#hud .rw { grid-column: 2 / span 3; grid-row: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.72em; color: var(--muted); }

#hud .alerts .al { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.1em 0.5em; align-items: baseline; padding: 0.32em 0.5em; border-radius: 0.45em; font-size: 0.88em; background: rgba(255, 159, 58, 0.12); box-shadow: inset 0.2em 0 0 #ff9f3a; }
#hud .alerts .al-crit { background: rgba(255, 59, 48, 0.16); box-shadow: inset 0.2em 0 0 #ff3b30; }
#hud .alerts .al-info { background: rgba(57, 229, 255, 0.08); box-shadow: inset 0.2em 0 0 #39e5ff; }
#hud .alerts .al b { font: 700 0.66em/1 var(--font-body); letter-spacing: 0.14em; color: #ffd0a0; }
#hud .alerts .al-crit b { color: #ffb0a8; }
#hud .alerts .al-info b { color: #a6f3ff; }
#hud .alerts .al span { color: #fff; font-weight: 600; }
#hud .alerts .al small { grid-column: 2; color: var(--muted); font-size: 0.78em; }

#hud .chips { display: flex; flex-wrap: wrap; gap: 0.3em; }
#hud .lnk, #hud .chip-s {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  max-width: 100%;
  padding: 0.3em 0.55em;
  border: 0;
  border-radius: 0.45em;
  background: rgba(57, 229, 255, 0.1);
  box-shadow: inset 0 0 0 0.08em rgba(57, 229, 255, 0.35);
  color: #d4f7ff;
  font-size: 0.84em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#hud .chip-s { background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 0.08em rgba(255, 255, 255, 0.12); color: #dfe7ff; }
#hud .chip-s.hot { background: rgba(255, 90, 77, 0.14); box-shadow: inset 0 0 0 0.08em rgba(255, 90, 77, 0.55); color: #ffd6c9; font-weight: 700; }
#hud .lnk { cursor: pointer; }
#hud .lnk:hover { background: rgba(57, 229, 255, 0.24); box-shadow: inset 0 0 0 0.1em rgba(57, 229, 255, 0.8); color: #fff; }
#hud .lnk small { color: var(--muted); font-size: 0.85em; margin-left: -0.15em; }
#hud .lnk.sm { padding: 0.12em 0.45em; font-size: 0.95em; flex: none; }
#hud .flow { display: flex; align-items: center; flex-wrap: wrap; gap: 0.45em; }
#hud .flow .arrow { font: 400 1.5em/1 var(--font-title); color: var(--c); text-shadow: 0 0.06em 0 var(--ink); }
#hud .meta { display: flex; flex-wrap: wrap; gap: 0.3em 0.9em; margin-top: 0.1em; font-size: 0.76em; color: var(--muted); }
#hud .meta span + span::before { content: '·'; margin-right: 0.9em; color: rgba(159, 176, 216, 0.5); }
#hud .meta .warn { color: #ffb070; font-weight: 700; }
#hud .kv small { display: block; margin-bottom: 0.2em; font: 700 0.58em/1 var(--font-body); letter-spacing: 0.18em; text-transform: uppercase; color: #8ea3d6; }
#hud code.block {
  display: -webkit-box;
  padding: 0.35em 0.5em;
  border-radius: 0.4em;
  background: rgba(0, 0, 0, 0.32);
  color: #cfe0ff;
  font-size: 0.78em;
  line-height: 1.35;
  word-break: break-all;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  user-select: text;
}

#hud .pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.45em 0.95em 0.42em;
  border: 0.12em solid var(--ink);
  border-radius: 2em;
  background: linear-gradient(180deg, #37488e, #1b2658);
  box-shadow: inset 0 0.1em 0 rgba(255, 255, 255, 0.2), 0 0.16em 0 #060a1c;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
#hud .pill-btn:hover { filter: brightness(1.1); }
#hud .pill-btn:active { transform: translateY(0.1em); }

/* ---- settings drawer + field manual --------------------------------------------------------------------------------------- */

#hud .drawer { right: var(--edge); top: 4.75em; bottom: var(--edge); width: 28em; display: flex; flex-direction: column; z-index: 6; }
#hud .drawer.in { animation: hud-drawer 0.32s cubic-bezier(0.2, 1.2, 0.4, 1) both; }
@keyframes hud-drawer { 0% { opacity: 0; transform: translateX(2em); } 100% { opacity: 1; transform: none; } }
#hud .drawer .panel-head { padding-left: 0.45em; }
#hud .tabs { display: flex; gap: 0.3em; }
#hud .tab {
  display: flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.32em 0.7em 0.3em 0.45em;
  border: 0.1em solid transparent;
  border-radius: 0.5em;
  background: transparent;
  font: 400 1em/1 var(--font-title);
  letter-spacing: 0.05em;
  color: #9fb0d8;
  cursor: pointer;
}
#hud .tab svg { width: 1.3em; height: 1.3em; }
#hud .tab.on { background: linear-gradient(180deg, #2f438e, #172354); border-color: var(--ink); color: #fff; box-shadow: inset 0 0.08em 0 rgba(255, 255, 255, 0.18), 0 0.12em 0 #060a1c; }
#hud .tab:not(.on):hover { color: #fff; }
#hud .drawer-scroll { flex: 1; min-height: 0; overflow: auto; padding: 0.3em 0.9em 1em; scrollbar-width: thin; scrollbar-color: rgba(255, 197, 61, 0.5) transparent; }
#hud .set-row { display: flex; align-items: center; justify-content: space-between; gap: 0.9em; padding: 0.7em 0.1em; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
#hud .set-l { min-width: 0; }
#hud .set-l b { display: block; font-weight: 700; color: #fff; }
#hud .set-l small { display: block; margin-top: 0.18em; font-size: 0.78em; line-height: 1.3; color: var(--muted); }
#hud .set-r { display: flex; align-items: center; gap: 0.5em; }
#hud .seg { flex: none; display: flex; gap: 0.15em; padding: 0.15em; border-radius: 0.6em; background: rgba(0, 0, 0, 0.38); box-shadow: inset 0 0.08em 0.2em rgba(0, 0, 0, 0.55); }
#hud .seg button { padding: 0.36em 0.7em 0.32em; border: 0; border-radius: 0.45em; background: transparent; font-weight: 700; font-size: 0.84em; color: #b9c7ec; cursor: pointer; }
#hud .seg button:hover { color: #fff; }
#hud .seg button.on { background: linear-gradient(180deg, #ffe7a0, #ffc53d); color: #2a1d00; box-shadow: 0 0.1em 0 #8a5a00; }
#hud .tog {
  position: relative;
  flex: none;
  width: 2.8em;
  height: 1.55em;
  padding: 0;
  border: 0;
  border-radius: 1em;
  background: rgba(0, 0, 0, 0.45);
  box-shadow: inset 0 0.08em 0.22em rgba(0, 0, 0, 0.65), inset 0 0 0 0.08em rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: background 0.2s;
}
#hud .tog i { position: absolute; left: 0.18em; top: 0.18em; width: 1.19em; height: 1.19em; border-radius: 50%; background: #9fb0d8; box-shadow: 0 0.1em 0 rgba(0, 0, 0, 0.45); transition: transform 0.2s cubic-bezier(0.2, 1.6, 0.4, 1), background 0.2s; }
#hud .tog.on { background: linear-gradient(180deg, #25c3ea, #0e6d96); }
#hud .tog.on i { transform: translateX(1.25em); background: #fff; }
#hud .set-r .pill-btn { padding: 0.35em 0.8em 0.32em; font-size: 0.85em; }
#hud .set-foot { margin-top: 1em; font-size: 0.78em; line-height: 1.4; color: #c9d6f5; }

#hud .manual { font-size: 0.95em; }
#hud .manual h4 { margin: 1.1em 0 0.45em; font: 400 1.15em/1 var(--font-title); letter-spacing: 0.03em; color: var(--gold); text-shadow: 0 0.07em 0 var(--ink); }
#hud .fm-lead { margin: 0.7em 0 0.2em; color: #e6edff; line-height: 1.4; }
#hud .fm-row { display: grid; grid-template-columns: 2.5em minmax(0, 1fr); gap: 0.65em; align-items: start; margin: 0.55em 0; }
#hud .fm-i svg { width: 2.4em; height: 2.4em; filter: drop-shadow(0 0.12em 0 rgba(0, 0, 0, 0.4)); }
#hud .fm-row b { color: #fff; }
#hud .fm-row p { margin: 0.2em 0 0; font-size: 0.86em; line-height: 1.38; color: #c9d6f5; }
#hud .fm-lamps { display: flex; flex-direction: column; gap: 0.35em; }
#hud .fm-lamp { display: grid; grid-template-columns: 1.3em 7.2em minmax(0, 1fr); align-items: center; gap: 0.5em; font-size: 0.86em; color: #c9d6f5; }
#hud .fm-lamp > b:not(.fst) { color: #fff; font-weight: 700; }
#hud .fm-lamp .fst { justify-self: start; font-size: 0.9em; }
#hud .fm-foot { margin: 1.2em 0 0.2em; font-style: italic; color: var(--muted); }

#hud kbd {
  display: inline-block;
  min-width: 1.9em;
  padding: 0.34em 0.5em 0.3em;
  border-radius: 0.38em;
  background: linear-gradient(180deg, #f6f8ff, #c9d3ee);
  box-shadow: 0 0.16em 0 #6d7aa6, inset 0 -0.06em 0 rgba(0, 0, 0, 0.15);
  color: #141a38;
  font: 700 0.8em/1 var(--font-body);
  text-align: center;
  white-space: nowrap;
}

/* ---- help overlay ----------------------------------------------------------------------------------------------------- */

#hud .help-wrap { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; background: rgba(4, 7, 20, 0.5); pointer-events: auto; }
#hud .help-wrap.in .help { animation: hud-cardin 0.35s cubic-bezier(0.2, 1.3, 0.4, 1) both; }
#hud .help { position: relative; width: min(48em, calc(100% - 2em)); }
#hud .help-body { display: grid; grid-template-columns: 1fr 1fr; gap: 0.3em 2em; padding: 0.9em 1.3em 1.1em; }
#hud .k-col h5 { margin: 0.2em 0 0.55em; font: 400 1.2em/1 var(--font-title); letter-spacing: 0.04em; color: var(--gold); text-shadow: 0 0.07em 0 var(--ink); }
#hud .k-row { display: flex; align-items: center; gap: 0.8em; margin: 0.5em 0; font-size: 0.93em; }
#hud .k-row .keys { flex: none; display: flex; flex-wrap: wrap; gap: 0.25em; width: 8.2em; }
#hud .help-foot { grid-column: 1 / -1; margin: 0.6em 0 0; font-style: italic; color: var(--muted); text-align: center; }

/* ---- tooltip, toast, hint -------------------------------------------------------------------------------------------------- */

#hud .hud-tip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 20;
  max-width: 40em;
  padding: 0.4em 0.7em 0.44em;
  border-radius: 0.5em;
  background: rgba(8, 12, 30, 0.95);
  box-shadow: 0 0 0 0.1em rgba(57, 229, 255, 0.6), 0 0.3em 0.9em rgba(0, 0, 0, 0.5);
  color: #fff;
  font: 600 0.86em/1.3 var(--font-body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
#hud .hud-toast {
  position: absolute;
  left: 50%;
  top: 7.4em;
  z-index: 9;
  translate: -50% 0;
  max-width: calc(100% - 2em);
  padding: 0.55em 1.1em 0.5em;
  border-radius: 2em;
  background: rgba(8, 12, 30, 0.93);
  box-shadow: 0 0 0 0.12em rgba(255, 197, 61, 0.85), 0 0.3em 1em rgba(0, 0, 0, 0.45);
  font-weight: 700;
  letter-spacing: 0.04em;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#hud .hud-toast b { font: 400 1.1em/1 var(--font-title); letter-spacing: 0.04em; color: var(--gold); text-transform: uppercase; }
#hud .hud-toast.in { animation: hud-toast 1.8s ease both; }
@keyframes hud-toast {
  0% { opacity: 0; transform: translateY(-0.6em) scale(0.9); }
  12% { opacity: 1; transform: none; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}
#hud .hud-hint {
  position: absolute;
  left: 50%;
  bottom: 1em;
  translate: -50% 0;
  padding: 0.45em 0.9em;
  border-radius: 2em;
  background: rgba(8, 12, 30, 0.8);
  color: #c9d6f5;
  font-weight: 700;
  font-size: 0.85em;
  pointer-events: none;
  opacity: 0;
}
#hud .hud-hint.in { animation: hud-hint 3.2s ease both; }
@keyframes hud-hint { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }

/* ---- hide HUD (H) + reduce motion --------------------------------------------------------------------------------------------- */

#hud > * { transition: opacity 0.25s ease; }
#hud.hud-off > :not(.hud-hint):not(.hud-toast) { opacity: 0 !important; pointer-events: none !important; }
#hud.hud-instant > * { transition: none !important; }
#hud.hud-off .panel, #hud.hud-off .plate { pointer-events: none !important; }

#hud.rm .fbar i, #hud.rm .ldot, #hud.rm .conn i, #hud.rm .doing .ldot { animation: none !important; }
#hud.rm .eva-line.in, #hud.rm .card.in, #hud.rm .drawer.in { animation: none !important; }

/* very small windows: keep the emblem, drop the wordmark so the resource tray never collides with it */
@media (max-width: 960px) {
  #hud .logo-t { display: none; }
}
#hud.tb-tight .logo-t { display: none; }   /* same, for big HUD sizes (hud.js applyScale) */

/* narrow windows: stack the card, smaller map */
@media (max-aspect-ratio: 4/3) {
  #hud { --mini-w: 21em; }
  #hud .logo-sub, #hud .res small { display: none; }
  #hud .card-body { grid-template-columns: 1fr; }
  #hud .card-body .col.r { padding-left: 0; border-left: 0; }
}
