/* Chess Home – WebRTC voice UI.
 *
 * Layered AFTER zine.css so we can inherit the wood-cut / cream palette
 * without having to redeclare it. All rules are namespaced under
 * `.voice-*` so nothing else in the app can accidentally collide.
 */

/* ---------- Room voice: header controls + participant strip -------- */
.voice-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0 12px;
}

#voice-join-btn {
  border-radius: 999px;
  padding: 6px 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

#voice-join-btn.in-call {
  background: #2f6b3a;
  color: #fff;
  border-color: #244f2c;
}

#voice-mute-btn,
#voice-leave-btn {
  border-radius: 999px;
  padding: 6px 14px;
}

.voice-participants {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 40px;
}

.voice-chip {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}

.voice-avatar {
  position: relative;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f7efdd;
  color: #3a2b18;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #3a2b18;
  box-shadow: 1px 1px 0 #3a2b18;
}

.voice-halo {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  z-index: 1;
  background: radial-gradient(
    closest-side,
    rgba(94, 156, 108, 0.85),
    rgba(94, 156, 108, 0)
  );
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 120ms ease-out, transform 200ms ease-out;
}

.voice-chip.is-speaking .voice-halo {
  opacity: 1;
  transform: scale(1.15);
}

.voice-chip-self .voice-avatar {
  background: #fff6df;
}

.voice-mic-off {
  position: absolute;
  z-index: 3;
  bottom: -4px;
  right: -6px;
  font-size: 12px;
  background: #fdfaf1;
  border: 1px solid #3a2b18;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ---------- DM call: incoming banner + in-call bar ---------------- */
#voice-call-btn {
  border-radius: 999px;
  padding: 4px 12px;
}

#voice-call-ui {
  display: contents;
}

.voice-incoming,
.voice-inbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: #fdfaf1;
  border: 1.5px solid #3a2b18;
  border-top: 4px double #3a2b18;
  padding: 10px 14px;
  margin: 8px 12px 0;
  border-radius: 4px;
  box-shadow: 2px 2px 0 #3a2b18;
  font-family: "Inter", system-ui, sans-serif;
}

.voice-inbar-active {
  background: #f5efe0;
  border-color: #244f2c;
  border-top-color: #244f2c;
}

.voice-incoming-text,
.voice-inbar-text {
  flex: 1;
  min-width: 200px;
  color: #3a2b18;
}

.voice-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #244f2c;
}

.voice-incoming .btn,
.voice-inbar .btn {
  border-radius: 999px;
}

/* Responsive: on narrow screens keep controls readable */
@media (max-width: 640px) {
  .voice-controls {
    gap: 6px;
  }
  .voice-participants {
    min-height: 32px;
  }
  .voice-chip {
    width: 30px;
    height: 30px;
  }
  .voice-avatar {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }
}
