/* Styling for strips built by shared/site_audio.js `mount()`.
 *
 * These are the SECOND (and third) strips a game gets — the lobby one and the
 * HUD one — so they are deliberately flow-positioned, not fixed. A game that
 * wants one pinned to a corner positions its own container.
 *
 * The slider class is `.mps-audio-slider`, NOT `.volume-slider`: web/style.css
 * pins `.volume-slider { position: fixed; top: 12px }`, which teleports any
 * unreset slider to the corner of the screen. That trap has bitten this repo
 * more than once — do not rename these to match.
 */

.mps-audio {
  display: flex;
  align-items: center;
  gap: 8px;
  /* One line, always: a wrapped strip drops the music slider onto its own row
     and reads as two broken controls. The sliders shrink instead. */
  flex-wrap: nowrap;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-family: inherit;
  /* Never inherit a fixed/absolute position from a host stylesheet. */
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  bottom: auto;
}

.mps-audio-btn {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #e8f0ff;
  font-size: 13px;
  line-height: 1;
  padding: 7px 10px;
  white-space: nowrap;
  /* A comfortable touch target on a phone. */
  min-height: 34px;
}

.mps-audio-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.mps-audio-btn:focus-visible {
  outline: 2px solid #6cf;
  outline-offset: 2px;
}

.mps-audio-btn.muted {
  color: #ff9c9c;
  border-color: rgba(255, 120, 120, 0.4);
}

.mps-audio-skip {
  padding: 7px 9px;
}

.mps-audio-slider {
  position: static;
  /* Shrink to fit rather than wrap — see flex-wrap above. */
  flex: 1 1 72px;
  width: 72px;
  min-width: 38px;
  height: 22px;
  accent-color: #6cf;
  cursor: pointer;
  margin: 0;
}

/* Phones: keep the strip on one line where possible and grow the touch
 * targets. The sliders are the first thing to give up width. */
@media (max-width: 640px) {
  .mps-audio {
    gap: 6px;
    padding: 5px 8px;
  }

  .mps-audio-slider {
    flex: 1 1 52px;
    width: 52px;
    min-width: 32px;
    height: 26px;
  }

  .mps-audio-btn {
    font-size: 12px;
    padding: 8px 9px;
    min-height: 36px;
  }
}

/* ── default placement for the two standard mount points ─────────────────
 * `#lobbyAudio` in the lobby card, `#hudAudio` in the in-game HUD. Games load
 * their own stylesheet AFTER this one, so a game that wants different
 * placement just restates these ids and wins on order at equal specificity.
 *
 * `#hudAudio` is FIXED to the viewport, not absolute: a HUD is typically a
 * fit-content fixed box, and an absolute `bottom` inside one lands the strip
 * somewhere in the middle of the screen. `pointer-events: auto` is required
 * because HUD roots are routinely `pointer-events: none` so the game is
 * clickable through them — without it the strip renders and no button works.
 */
#lobbyAudio {
  display: flex;
  justify-content: center;
  margin: 0 0 14px;
}

#hudAudio {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  pointer-events: auto;
}
