/* Persistent, accessible ambient-audio controls. */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.hud-right { gap: 12px; }

.audio-controls {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 5px;
  border: 1px solid #b7ffe052;
  border-radius: 24px;
  background: linear-gradient(135deg, #172a29ed, #111923ed);
  box-shadow: inset 0 1px 0 #ffffff14, 0 8px 28px #0004;
}

.sound-toggle {
  height: 32px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 18px;
  padding: 0 10px;
  background: #a6f2c81c;
  color: #e6fff1;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.sound-toggle:hover { background: #a6f2c833; }
.sound-toggle.muted { background: #ffffff0d; color: #b8c0c0; }
.sound-toggle:disabled { cursor: not-allowed; opacity: .55; }
.sound-icon { height: 16px; display: flex; align-items: center; gap: 2px; }

.sound-icon i {
  display: block;
  width: 2px;
  border-radius: 3px;
  background: var(--mint);
  animation: sound-meter .9s ease-in-out infinite alternate;
}

.sound-icon i:nth-child(1) { height: 7px; animation-delay: -.2s; }
.sound-icon i:nth-child(2) { height: 14px; animation-delay: -.45s; }
.sound-icon i:nth-child(3) { height: 10px; animation-delay: -.65s; }
.sound-toggle.muted .sound-icon i { height: 3px; animation: none; background: #8e9999; }
.volume-control { display: flex; align-items: center; gap: 6px; }
.volume-control input { width: 66px; height: 4px; accent-color: var(--mint); cursor: pointer; }
.volume-control output { min-width: 29px; color: #bed1ca; font-size: 9px; font-variant-numeric: tabular-nums; }
.audio-controls:focus-within { border-color: var(--mint); box-shadow: 0 0 0 2px #a6f2c822; }
.sound-toggle:focus-visible, .volume-control input:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }

@keyframes sound-meter {
  from { transform: scaleY(.55); }
  to { transform: scaleY(1); }
}

@media (max-width: 1100px) {
  .connection { display: none; }
  .audio-controls { margin-left: auto; }
}

@media (max-width: 680px) {
  .sound-toggle span:last-child, .volume-control output { display: none; }
  .sound-toggle { padding: 0 9px; }
  .volume-control input { width: 54px; }
  .audio-controls { gap: 3px; padding-right: 6px; }
  .hud-right { gap: 6px; }
  .quiet-btn { font-size: 10px; padding: 9px 10px; }
}

@media (max-width: 530px) {
  .identity-title { display: none; }
  .hud-right { gap: 5px; }
  .audio-controls { height: 38px; }
  .sound-toggle { height: 29px; }
  .volume-control input { width: 44px; height: 28px; }
  .quiet-btn { padding: 8px 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .sound-icon i { animation: none; height: 6px; }
}
