/* Chamada: troca de dispositivos, sala vazia e o chat da sala de voz ao lado do palco. */

/* ---------- setinha de dispositivos no microfone e na câmera ---------- */
.sc-group { position: relative; display: flex; flex: 0 0 auto; }
.sc-caret {
  position: absolute; right: -4px; bottom: -4px; z-index: 1; display: grid; place-items: center;
  width: 22px; height: 22px; padding: 0; border: 2px solid var(--bg-floating); border-radius: 50%;
  background: var(--bg-panel); color: var(--text-strong); cursor: pointer; transition: background .15s, transform .15s;
}
.sc-caret:hover { background: color-mix(in srgb, var(--text) 18%, var(--bg-panel)); transform: translateY(-1px); }
.sc-caret:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
#main.dm-call .sc-caret { width: 20px; height: 20px; right: -5px; bottom: -5px; }

#context-menu.device-menu { padding: 6px; }
.device-item { gap: 10px; }
.device-item .device-name { flex: 1; min-width: 0; text-align: left; }
.device-item.current { color: var(--text-strong); }
.device-item .ico { flex-shrink: 0; color: var(--brand); }
.device-item:hover .ico { color: currentColor; }
.device-item.missing { color: var(--text-muted); font-style: italic; cursor: default; }
.device-item.missing:hover { background: transparent; color: var(--text-muted); }

/* Áudio: dispositivos compactos, volume acessível e efeitos sob demanda. */
#context-menu.audio-device-menu { padding: 14px; border: 1px solid var(--divider); border-radius: 14px; }
.device-head { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; color: var(--text-strong); font-size: 14px; }
.device-head > .ico { color: var(--brand); }
.device-fields { display: grid; gap: 12px; }
.device-field { display: grid; gap: 6px; min-width: 0; }
.device-field-label { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.device-select { width: 100%; min-width: 0; height: 38px; padding: 0 10px; border: 1px solid var(--divider); border-radius: 8px; background-color: var(--bg-panel); color: var(--text-strong); font: inherit; font-size: 13px; text-overflow: ellipsis; }
.device-select:hover:not(:disabled) { border-color: color-mix(in srgb, var(--brand) 60%, var(--divider)); }
.device-select:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.device-select:disabled { opacity: .55; cursor: wait; }
.audio-device-menu .menu-range { margin: 14px 0; padding: 12px 0; border-block: 1px solid var(--divider); font-size: 12px; }
.device-effects { border: 1px solid var(--divider); border-radius: 10px; background: var(--bg-panel); }
.device-effects-toggle { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px; border: 0; border-radius: 10px; background: transparent; color: var(--text-strong); font: inherit; font-size: 13px; }
.device-effects-toggle:hover { background: var(--hover); }
.device-effects-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.device-effects-label { display: flex; align-items: center; gap: 6px; flex: 1; white-space: nowrap; font-weight: 600; }
.device-effects-label > .ico { color: var(--brand); }
.device-effect-current { display: flex; align-items: center; gap: 4px; padding: 3px 6px; border-radius: 6px; color: var(--text-muted); font-size: 11px; }
.device-effect-current[data-active="true"] { background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--text-strong); }
.device-effect-emoji { display: inline-flex; align-items: center; justify-content: center; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; font-size: 14px; line-height: 1; }
.device-effects-toggle > .ico { color: var(--text-muted); transition: transform .15s; }
.device-effects-toggle[aria-expanded="true"] > .ico { transform: rotate(180deg); }
.device-effect-options { padding: 0 10px 10px; }
.audio-device-menu .vfx-chips { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 6px 0 0; }
.audio-device-menu .vfx-chip { min-height: 54px; font-size: 11px; }
.audio-device-menu .vfx-preview { width: 100%; margin: 10px 0 0; }
.audio-device-menu .vfx-preview-note { margin: 8px 2px 0; font-size: 11px; }
.device-footer { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--divider); }
.device-footer .menu-item { margin: 0; padding: 6px 2px; font-size: 12px; }

@media (max-width: 360px) {
  #context-menu.audio-device-menu { padding: 12px; }
  .device-effects-toggle { gap: 5px; padding: 8px; font-size: 12px; }
  .device-effects-label { gap: 4px; }
  .audio-device-menu .vfx-chips { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- sozinho na sala ---------- */
#main #voice-view #stage[data-alone] #stage-primary {
  flex: 0 1 auto; width: min(100%, 520px); min-height: 0; margin: auto auto 0; grid-template-columns: minmax(0, 1fr);
}
#stage-alone {
  display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 460px; margin: 4px auto auto;
  padding: 0 16px; text-align: center; animation: sa-in .35s var(--spring, ease) both;
}
.sa-icon {
  display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 4px; border-radius: 50%;
  background: color-mix(in srgb, var(--brand) 18%, transparent); color: var(--brand);
}
#stage-alone strong { font-size: 18px; color: var(--text-strong); }
#stage-alone p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--text-muted); text-wrap: balance; }
.sa-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.sa-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border: 1px solid var(--divider); border-radius: 8px;
  background: var(--bg-panel); color: var(--text-strong); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .15s, transform .15s;
}
.sa-btn:hover { background: var(--hover-strong); transform: translateY(-1px); }
.sa-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.sa-btn.primary { border-color: transparent; background: var(--brand); color: #fff; }
.sa-btn.primary:hover { background: color-mix(in srgb, var(--brand) 85%, #000); }
#main.voice-chat .sa-btn.chat { display: none; }
@keyframes sa-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { #stage-alone { animation: none; } }
:root[data-reduce-motion="true"] #stage-alone { animation: none; }

/* ---------- chat da sala de voz ---------- */
#btn-voice-chat { position: relative; }
#btn-voice-chat.active { background: var(--hover-strong); color: var(--text-strong); }
#btn-voice-chat.has-unread::after {
  content: ''; position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 0 2px var(--bg-main);
}

#main.voice-chat { display: grid; grid-template-columns: minmax(0, 1fr) 360px; grid-template-rows: auto minmax(0, 1fr); }
#main.voice-chat > #main-header { grid-column: 1 / -1; }
#main.voice-chat > #voice-view { grid-column: 1; grid-row: 2; }
#main.voice-chat > #chat-view { grid-column: 2; grid-row: 2; min-width: 0; border-left: 1px solid var(--divider); background: var(--bg-sidebar); }

.vc-head {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0; height: 48px; padding: 0 8px 0 16px;
  border-bottom: 1px solid var(--divider); color: var(--text-muted);
}
.vc-head-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.2; }
.vc-head-text strong { font-size: 14px; color: var(--text-strong); }
.vc-head-text span { overflow: hidden; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }

/* Chat estreito: mensagens mais compactas, como no Salão. */
#main.voice-chat .msg { grid-template-columns: 32px minmax(0, 1fr); column-gap: 10px; padding: 2px 12px; margin-top: 12px; }
#main.voice-chat .msg.continued { margin-top: 0; }
#main.voice-chat .msg .avatar { width: 32px; height: 32px; font-size: 13px; }
#main.voice-chat .welcome { padding: 20px 16px 8px; }
#main.voice-chat .welcome h2 { font-size: 20px; }
#main.voice-chat .welcome-icon { width: 56px; height: 56px; }
#main.voice-chat #composer { padding-inline: 12px; }
/* O painel do chat tem outro fundo: o rótulo do divisor de data acompanha, sem virar um retângulo de outra cor. */
#main.voice-chat > #chat-view .day-divider span, #main.salon-mode > #chat-view .day-divider span { background: var(--bg-sidebar); }

/* Botão de chat na linha da sala de voz (aparece ao passar o mouse, ou sempre que há mensagem nova). */
#channel-groups .grouped-channel.unread .voice-chat-open { visibility: visible; }

/* Janela estreita: o chat abre por cima do palco. */
@media (max-width: 1000px) {
  #main.voice-chat { grid-template-columns: minmax(0, 1fr); }
  #main.voice-chat > #chat-view {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 20; width: min(380px, 100vw); box-shadow: -10px 0 40px rgba(0, 0, 0, .45);
  }
}

/* ---------- modificador de voz ---------- */
/* Aviso de efeito no canto direito da chamada; o detalhe fica no tooltip. */
.tile-fx { position: absolute; top: 10px; right: 10px; z-index: 2; display: flex; }
.tile-fx:empty { display: none; }
.voice-fx-indicator {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; align-self: center;
  color: var(--text-muted); font-size: 9px; font-weight: 600; line-height: 1; letter-spacing: .04em;
}
.tile-fx .voice-fx-indicator {
  height: 16px; padding: 0 4px; border-radius: 3px; background: rgba(0, 0, 0, .35); color: #c1c3c8; pointer-events: auto;
}
#stage-strip > .tile .voice-fx-indicator { height: 14px; font-size: 8px; }
#stage-strip > .tile .tile-fx { top: 6px; right: 6px; }
#stage-strip > .tile.voice-fx-active .tile-controls { right: 32px; }

/* Botões de efeito no menu de dispositivos da chamada. */
.vfx-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 2px 4px 6px; }
.vfx-chip {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; padding: 7px 4px 6px; border: 1px solid transparent; border-radius: 8px;
  background: color-mix(in srgb, var(--text) 5%, transparent); color: var(--interactive); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.vfx-chip span:first-child { font-size: 18px; line-height: 1.1; }
.vfx-chip span:last-child { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.vfx-chip:hover { background: var(--hover-strong); color: var(--text-strong); }
.vfx-chip.selected { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--text-strong); }
.vfx-chip:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.vfx-preview {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: calc(100% - 8px); margin: 4px;
  padding: 9px 8px; border: 1px solid var(--divider); border-radius: 8px; background: var(--bg-panel);
  color: var(--text-strong); font: inherit; font-size: 13px; font-weight: 600;
}
.vfx-preview:hover:not(:disabled) { background: var(--hover-strong); border-color: var(--brand); }
.vfx-preview.active { background: color-mix(in srgb, var(--brand) 16%, transparent); border-color: var(--brand); }
.vfx-preview:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.vfx-preview:disabled, .vfx-chip:disabled { opacity: .55; }
.vfx-preview-note { margin: 6px 8px 8px; color: var(--text-muted); font-size: 12px; line-height: 1.4; }

/* Cartões dos efeitos nas configurações de voz. */
.vfx-intro { margin: -4px 0 0; }
.vfx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 8px; }
.vfx-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px; border: 1px solid var(--divider); border-radius: 10px;
  background: var(--bg-panel); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, background .15s, transform .15s;
}
.vfx-card:hover { border-color: color-mix(in srgb, var(--brand) 55%, var(--divider)); transform: translateY(-1px); }
.vfx-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.vfx-card.selected { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 14%, var(--bg-panel)); box-shadow: inset 0 0 0 1px var(--brand); }
.vfx-emoji { font-size: 24px; line-height: 1.2; margin-bottom: 4px; }
.vfx-card strong { font-size: 14px; color: var(--text-strong); }
.vfx-card small { font-size: 12px; color: var(--text-muted); line-height: 1.3; }
.vfx-test { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.vfx-test .hint { flex: 1 1 220px; margin: 0; }
/* Os botões do painel de configurações são roxos e baixos; os cartões de efeito não. */
#settings .settings-content button.vfx-card:not(.secondary) { min-height: 0; padding: 12px; border: 1px solid var(--divider); border-radius: 10px; background: var(--bg-panel); color: var(--text); box-shadow: none; }
#settings .settings-content button.vfx-card:not(.secondary):hover { background: color-mix(in srgb, var(--text) 4%, var(--bg-panel)); }
#settings .settings-content button.vfx-card:not(.secondary).selected { background: color-mix(in srgb, var(--brand) 14%, var(--bg-panel)); box-shadow: inset 0 0 0 1px var(--brand); }
