/* ---- Proximity voice chat ------------------------------------------------------------------- */

/* hold-to-talk button next to the bomb & emote buttons */
.hub-talk {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.hub-talk[hidden] { display: none; }
.hub-talk svg { width: 24px; height: 24px; }
.hub-talk.on {
  background: linear-gradient(180deg, #6ff59a, #2fbf62);
  color: #210d22;
  box-shadow: 0 4px 0 var(--ink), 0 0 0 4px rgba(61, 220, 114, .35), 0 0 22px rgba(61, 220, 114, .6);
  animation: voicePulse 1s ease-in-out infinite;
}

/* "Talking" pill while you're on the mic */
.voice-live {
  position: fixed;
  left: 50%;
  bottom: 118px;
  z-index: 55;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 6px;
  border: 3px solid #210d22;
  border-radius: 999px;
  background: linear-gradient(180deg, #4ce884, #24b158);
  color: #210d22;
  font-family: var(--font-display);
  font-size: 1rem;
  box-shadow: 0 4px 0 #210d22, 0 0 24px rgba(61, 220, 114, .55);
  transform: translateX(-50%);
  pointer-events: none;
  animation: voiceIn .2s ease-out;
}
.voice-live[hidden] { display: none; }
.vl-mic {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #210d22;
  color: #4ce884;
}
.vl-mic svg { width: 17px; height: 17px; }
.vl-bars { display: flex; align-items: center; gap: 3px; height: 18px; }
.vl-bars i {
  display: block;
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: #210d22;
  transform: scaleY(.15);
  transform-origin: center;
  transition: transform .1s linear;
}

/* Settings → Voice */
.voice-intro {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 2px solid rgba(61, 220, 114, .45);
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(61, 220, 114, .16), rgba(61, 220, 114, .04));
}
.voice-intro-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 3px solid #210d22;
  border-radius: 14px;
  background: #3ddc72;
  color: #210d22;
}
.voice-intro-icon svg { width: 26px; height: 26px; }
.voice-intro b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 1.1rem; }
.voice-intro span { display: block; opacity: .8; font-size: .85rem; line-height: 1.35; }
.voice-key { min-width: 120px; font-family: var(--font-display); font-size: 1.05rem; letter-spacing: .02em; }
.key-bind.listening { animation: voicePulse 1s ease-in-out infinite; }
.mic-check { display: flex; align-items: center; gap: 10px; }
.mic-meter {
  --level: 0;
  position: relative;
  flex: 1;
  min-width: 90px;
  height: 14px;
  overflow: hidden;
  border: 2px solid rgba(0, 0, 0, .45);
  border-radius: 999px;
  background: rgba(0, 0, 0, .3);
}
.mic-meter i {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #3ddc72 0 60%, #ffd23f 60% 85%, #ff5a6e 85%);
  clip-path: inset(0 calc((1 - var(--level)) * 100%) 0 0);
  transition: clip-path .05s linear;
}
.voice-note { margin: 12px 4px 0; opacity: .75; font-size: .82rem; line-height: 1.4; }

@keyframes voicePulse { 50% { filter: brightness(1.15); transform: scale(1.04); } }
@keyframes voiceIn { from { opacity: 0; transform: translate(-50%, 10px); } }

.reduced-motion .hub-talk.on,
.reduced-motion .key-bind.listening { animation: none; }
