/* The HUD's control bar: Sound (js/audio/ui.js), Autopilot (js/autopilot.js) and Share (js/share.js) as one segmented
   bar of three equal cells. Wide screens centre it at the top between the brand and the telemetry; narrower ones give
   it a centred row of its own under both. The cells never change size: labels swap inside them, and Share keeps its
   place, dimmed, until a chamber is in view. */
.hud-bar{position:relative;pointer-events:auto;display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);width:432px;
  background:rgba(4,7,10,.6);border:1px solid var(--line-hi);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}
.hb{position:relative;display:flex;align-items:center;justify-content:center;gap:8px;min-width:0;height:32px;margin:0;padding:0 10px;
  font:inherit;font-size:9px;letter-spacing:.2em;text-transform:uppercase;white-space:nowrap;color:var(--dim);
  background:transparent;border:0;border-radius:0;cursor:pointer;transition:color .2s,background .2s}
.hb+.hb{border-left:1px solid var(--line)}
.hb[hidden]{display:none}                                       /* Sound, where the browser has no Web Audio: the other two share the bar */
.no-gl .hud-bar{display:none}                                   /* nothing in it works without WebGL */
.hb .lbl{overflow:hidden;text-overflow:ellipsis}
.hb:hover,.hb:focus-visible{color:var(--bone);background:rgba(158,240,255,.07);outline:0}
.hb:focus-visible{box-shadow:inset 0 0 0 1px var(--lumen)}
.hb.on{color:var(--lumen)}
.hb.on::after{content:"";position:absolute;left:-1px;right:0;bottom:-1px;height:2px;background:var(--lumen)}   /* lit edge under an active cell */
.hb.waiting{color:var(--lumen);animation:hbwait 2.4s ease-in-out infinite}                                     /* wants a click to start */
@keyframes hbwait{50%{background:rgba(158,240,255,.12)}}
.hb:disabled{color:var(--dim);background:transparent;opacity:.4;cursor:default}
.hb.done,.hb.done:hover{color:var(--abyss);background:var(--lumen)}                                              /* Share: copied */

/* icons */
/* speaker: waves while the sound plays (they pulse with the mix, js/audio/ui.js), faint waves while it waits for a
   first click, and an X while it's off or the browser can't play it */
.hb .spk{display:block;flex:none;width:16px;height:14px;overflow:visible}
.spk-body{fill:currentColor}
.spk-w,.spk-x{fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;transition:opacity .2s}
.spk-w{display:none}
#soundBtn.on .spk-w{display:inline;opacity:.9}
#soundBtn.waiting .spk-w{display:inline;opacity:.4}
#soundBtn.on .spk-x,#soundBtn.waiting .spk-x{display:none}
.hb .pi{display:block;flex:none;width:0;height:0;border-left:7px solid currentColor;border-top:4.5px solid transparent;border-bottom:4.5px solid transparent}
.hb.on .pi{width:7px;height:9px;border:0;border-left:2px solid currentColor;border-right:2px solid currentColor}
.hb .sh{flex:none;font-size:11px;letter-spacing:0;line-height:1}

/* Share's fallback when the clipboard is blocked: the link, selected, laid over the whole bar until it loses focus */
.hb-field{position:absolute;inset:-1px;z-index:1;width:calc(100% + 2px);min-width:0;margin:0;padding:0 12px;font:inherit;font-size:10px;
  letter-spacing:.04em;color:var(--lumen);background:rgba(4,7,10,.94);border:1px solid var(--lumen);border-radius:0;outline:0;cursor:text}
.hb-field[hidden]{display:none}

@media (min-width:1161px){
  .hud-bar{position:absolute;left:50%;top:calc(env(safe-area-inset-top,0px) + 14px);transform:translateX(-50%)}
}
@media (max-width:1160px){
  .hud-top{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px 16px;align-items:start}
  .telem{grid-area:1/2}
  .hud-bar{grid-area:2/1/3/-1;justify-self:center;width:min(100%,432px)}
}
@media (max-width:760px){
  .hb{gap:6px;padding:0 6px;letter-spacing:.12em}
}
@media (max-width:400px){
  .hb{gap:5px;padding:0 4px;letter-spacing:.08em}              /* "Start sound" fits a cell on a 360 px phone */
}
@media (max-width:340px){
  .hb .spk,.hb .pi,.hb .sh{display:none}                          /* the smallest phones: labels only; the lit edge still shows what's on */
}
@media (prefers-reduced-motion:reduce){.hb.waiting{animation:none}}
