/* ── Key HUD ───────────────────────────────────────── */

#key-hud {
  position: absolute;
  bottom: 38px;   /* just above status bar */
  right: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 100;
}

#key-hud.hidden {
  opacity: 0;
}

.key-hud-row {
  display: flex;
  gap: 4px;
}

.hud-key {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.30);
  background: rgba(0, 0, 0, 0.52);
  color: rgba(255, 255, 255, 0.55);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  user-select: none;
  transition: background 0.06s, color 0.06s, border-color 0.06s;
}

.hud-key--wide {
  width: 52px;  /* 2 × 24px + 4px gap */
}

.hud-key--small {
  font-size: 8px;
  letter-spacing: 0.5px;
}

.hud-spacer {
  width: 52px;  /* matches hud-key--wide so Q sits above A */
  flex-shrink: 0;
}

.hud-key.active {
  background: rgba(0, 0, 0, 0.70);
  border-color: rgba(255, 255, 255, 0.55);
  color: rgba(255, 255, 255, 0.90);
}

/* Light mode */
body.light-mode .hud-key {
  border-color: rgba(0, 0, 0, 0.18);
  background: rgba(0, 0, 0, 0.04);
  color: rgba(0, 0, 0, 0.28);
}

body.light-mode .hud-key.active {
  background: rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.38);
  color: rgba(0, 0, 0, 0.7);
}
