/* ===================================================================
   Shared room voice chat controls (Ludo, Chess) — only the user's own
   🎤 Mic and 🔊 Speaker buttons, bottom-left, above the page content.
   =================================================================== */
.voice-controls {
  position: fixed;
  left: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 900;
  display: flex;
  gap: 8px;
}
.voice-controls.hidden, .voice-perm-hint.hidden, .vc-count.hidden { display: none !important; }
.vc-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 58px; height: 52px; padding: 0;
  border-radius: 14px;
  background: rgba(20, 22, 30, .88);
  border: 2px solid #d4b04c;
  color: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  box-shadow: 0 4px 12px rgba(0,0,0,.35);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.vc-btn .vc-icon { font-size: 20px; line-height: 1; }
.vc-btn .vc-label { font-size: 9px; font-weight: 700; margin-top: 3px; white-space: nowrap; }
.vc-btn.off { border-color: rgba(255,255,255,.35); background: rgba(70,22,22,.9); }
.vc-btn.off .vc-label { color: #ffb3b3; }
.vc-btn:disabled { opacity: .6; }
.vc-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* "👥 3/5" — working voice connections / other people in the room (no mic status) */
.vc-count {
  position: absolute; top: -10px; right: -8px;
  font: 700 10px/1 system-ui, sans-serif; white-space: nowrap;
  padding: 3px 6px; border-radius: 10px;
  background: #1f6d3a; color: #fff; border: 1px solid rgba(255,255,255,.6);
  pointer-events: none;
}
.vc-count.warn { background: #8a5a00; }

@media (max-width: 640px) {
  .voice-controls { left: 6px; gap: 5px; }
  .vc-btn { width: 46px; height: 46px; border-radius: 12px; }
  .vc-btn .vc-icon { font-size: 18px; }
  .vc-btn .vc-label { display: none; }
}

/* one-time hint: allow the microphone so direct connections work between all phones */
.voice-perm-hint {
  position: fixed; left: 12px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 899;
  display: flex; align-items: center; gap: 8px;
  max-width: min(420px, calc(100vw - 24px));
  background: rgba(20, 22, 30, .95); border: 2px solid #d4b04c; border-radius: 12px;
  padding: 8px 10px; font: 13px/1.35 system-ui, sans-serif; color: #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,.45);
}
.voice-perm-hint button { border: 0; cursor: pointer; font: inherit; }
.voice-perm-hint .vp-ok { background: #d4b04c; color: #2a1b04; font-weight: 700; border-radius: 16px; padding: 7px 12px; min-height: 36px; white-space: nowrap; }
.voice-perm-hint .vp-x { background: none; color: #fff; font-size: 16px; min-width: 32px; min-height: 32px; }
@media (max-width: 640px) {
  .voice-perm-hint { left: 6px; right: 6px; bottom: calc(62px + env(safe-area-inset-bottom, 0px)); font-size: 12px; }
}

/* the voice module's own short messages */
#voiceToast {
  position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); z-index: 901;
  transform: translateX(-50%); max-width: min(440px, calc(100vw - 24px));
  background: rgba(20, 22, 30, .95); color: #fff; border-radius: 10px; padding: 10px 14px;
  font: 13px/1.4 system-ui, sans-serif; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
#voiceToast.show { opacity: 1; }
