/* The HUD bar (spec r3 3.6): fixed over every beat. Telemetry top right under
   the nav (live city clock, city list, currency group, then the beat counter
   and the pause toggle), a right rail with one tick per beat and the page
   percentage (desktop). Recorded deviation: the counter and the toggle sit in
   the telemetry column, not bottom left, where section disclaimers and the
   footer collided with them. Phone portrait: one chip under the nav opens a
   bottom sheet with all three groups. Controls stay hidden until sh-money.js and
   sh-clock.js have started (no dead buttons without JS). */
.sh-hudbar { position: fixed; inset: 0; z-index: var(--sh-z-hud); pointer-events: none; color: var(--sh-fg); font: 500 11px/1 var(--sh-font-mono); letter-spacing: .16em; text-transform: uppercase; }
.sh-hudbar button { pointer-events: auto; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; cursor: pointer; }
.sh-hudbar__tele { position: absolute; top: calc(var(--sh-nav-h) + 10px); right: var(--sh-gutter); display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.sh-hudbar__city {
  display: inline-flex; align-items: center; gap: 8px; min-height: 28px; padding: 0 2px; border: 0; background: none;
  color: var(--sh-fg-2); font-variant-numeric: tabular-nums; white-space: nowrap; transition: color var(--sh-dur-1);
}
.sh-hudbar__city:hover, .sh-hudbar__city[aria-expanded="true"] { color: var(--sh-fg); }
.sh-hudbar__caret { width: 6px; height: 6px; border: solid currentColor; border-width: 0 1px 1px 0; transform: translateY(-2px) rotate(45deg); opacity: .7; }
.sh-hudbar__city[aria-expanded="true"] .sh-hudbar__caret { transform: translateY(1px) rotate(225deg); }
.sh-hudbar__cities {
  position: absolute; top: 34px; right: 0; display: grid; gap: 2px; min-width: 220px; padding: 6px; pointer-events: auto;
  border: 1px solid var(--sh-glass-line); border-radius: 12px; background: rgb(12 14 18 / 94%); box-shadow: 0 18px 40px -16px rgb(0 0 0 / 90%);
}
.sh-hudbar__cities button, .sh-menu__cities button {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 40px; padding: 0 12px; border: 0; border-radius: 8px;
  background: none; color: var(--sh-fg-2); font: 500 11px/1 var(--sh-font-mono); letter-spacing: .16em; text-transform: uppercase; cursor: pointer;
}
.sh-hudbar__cities button:hover, .sh-menu__cities button:hover { background: var(--sh-glass); color: var(--sh-fg); }
.sh-hudbar__cities button[aria-pressed="true"], .sh-menu__cities button[aria-pressed="true"] { color: var(--sh-gold-hi); }
.sh-city__time { color: var(--sh-fg-3); font-variant-numeric: tabular-nums; }
.sh-hudbar__fx { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--sh-line-2); border-radius: 999px; background: rgb(7 8 10 / 55%); pointer-events: auto; }
.sh-hudbar__fx button {
  min-width: 44px; min-height: 26px; padding: 0 9px; border: 0; border-radius: 999px; background: none; color: var(--sh-fg-3);
  font-size: 10.5px; letter-spacing: .12em; transition: background-color var(--sh-dur-1), color var(--sh-dur-1);
}
.sh-hudbar__fx button:hover { color: var(--sh-fg); }
.sh-hudbar__fx button[aria-pressed="true"] { background: linear-gradient(180deg, var(--sh-gold-hi), var(--sh-gold)); color: var(--sh-ink-0); }
.sh-hudbar__econ { max-width: 260px; color: var(--sh-gold-hi); font-size: 10px; line-height: 1.5; text-align: right; }
.sh-hudbar__chip { display: none; }

/* Right rail (desktop): a hairline with one tick per beat and the page percentage. */
.sh-hudbar__rail { position: absolute; right: 14px; top: 50%; width: 1px; height: min(46vh, 420px); transform: translateY(-50%); background: rgb(255 255 255 / 12%); }
.sh-hudbar__rail i { position: absolute; left: -3px; width: 7px; height: 1px; background: rgb(255 255 255 / 30%); transition: background-color var(--sh-dur-2), width var(--sh-dur-2), left var(--sh-dur-2); }
.sh-hudbar__rail i.is-past { background: rgb(229 198 92 / 45%); }
.sh-hudbar__rail i.is-on { left: -6px; width: 13px; background: var(--sh-gold-hi); }
.sh-hudbar__thumb {
  position: absolute; left: -2px; top: -2px; width: 5px; height: 5px; border-radius: 50%; background: var(--sh-gold-hi);
  box-shadow: 0 0 10px 2px rgb(229 198 92 / 55%); transform: translateY(calc(var(--p, 0) * min(46vh, 420px)));
}
.sh-hudbar__pct { position: absolute; right: 10px; bottom: -22px; color: var(--sh-fg-3); font-size: 10px; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.sh-hudbar__foot { display: flex; align-items: center; gap: 12px; }
.sh-hudbar__foot::before { content: ""; order: 1; width: 1px; height: 10px; background: var(--sh-line-2); }
.sh-hudbar__toggle { order: 2; min-height: 28px; padding: 0; border: 0; background: none; color: var(--sh-fg-3) !important; }
.sh-hudbar__toggle:hover { color: var(--sh-fg) !important; }
.sh-hudbar__toggle:disabled { cursor: default; }
.sh-hudbar__count { color: var(--sh-fg-3); letter-spacing: .14em; font-variant-numeric: tabular-nums; }
.sh-hudbar :focus-visible { outline: 2px solid var(--sh-fg); outline-offset: 2px; }

/* Menu sheet copies of both groups (phone and keyboard users). */
.sh-menu__hud { display: grid; gap: 12px; }
.sh-menu__cities { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 4px; }
.sh-menu__hud .sh-hudbar__fx { justify-self: start; }
.sh-menu__hud .sh-hudbar__fx button { min-height: 40px; color: var(--sh-fg-2); font: 600 11px/1 var(--sh-font-mono); letter-spacing: .12em; }
.sh-menu__hud .sh-hudbar__fx button[aria-pressed="true"] { color: var(--sh-ink-0); }

@media (max-width: 1023px) { .sh-hudbar__rail { display: none; } }
@media (max-width: 767px) and (orientation: portrait) {
  .sh-hudbar__chip {
    position: absolute; top: calc(var(--sh-nav-h) + 6px); right: 12px; display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px;
    border: 1px solid var(--sh-glass-line); border-radius: 999px; background: rgb(7 8 10 / 62%); color: var(--sh-fg-2); font-size: 10px; letter-spacing: .12em;
  }
  .sh-hudbar__chip[hidden] { display: none; }
  .sh-hudbar__tele {
    position: fixed; inset: auto 0 0; align-items: stretch; gap: 14px; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--sh-glass-line); border-radius: 18px 18px 0 0; background: rgb(10 12 15 / 96%); pointer-events: auto;
    transform: translateY(105%); transition: transform var(--sh-dur-2) var(--sh-ease-out); visibility: hidden;
  }
  .sh-hudbar__tele.is-open { transform: none; visibility: visible; }
  .sh-hudbar__tele .sh-hudbar__city { display: none; }
  .sh-hudbar__tele .sh-hudbar__cities { position: static; display: grid !important; grid-template-columns: 1fr 1fr; min-width: 0; border: 0; padding: 0; background: none; box-shadow: none; }
  .sh-hudbar__tele .sh-hudbar__fx { justify-content: space-between; }
  .sh-hudbar__tele .sh-hudbar__fx button { flex: 1; min-height: 44px; }
  .sh-hudbar__tele .sh-hudbar__foot { justify-content: space-between; }
  .sh-hudbar__tele .sh-hudbar__toggle { min-height: 44px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .sh-hudbar__tele { top: calc(var(--sh-nav-h) + 6px); flex-direction: row; align-items: center; gap: 12px; }
  .sh-hudbar__cities { top: 34px; }
}
@media (prefers-reduced-motion: reduce) { .sh-hudbar__tele, .sh-hudbar__rail i { transition: none; } }
