:root {
  --bg-tertiary: #14161d;
  --bg-secondary: #1c1f28;
  --bg-primary: #222631;
  --bg-floating: #0f1117;
  --bg-modifier-hover: rgba(99, 102, 241, 0.14);
  --bg-modifier-active: rgba(99, 102, 241, 0.25);
  --bg-modifier-selected: rgba(99, 102, 241, 0.22);
  --text-normal: #e2e8f0;
  --text-muted: #94a3b8;
  --text-bright: #f8fafc;
  --brand: #6366f1;
  --brand-hover: #4f46e5;
  --accent-cyan: #06b6d4;
  --green: #10b981;
  --yellow: #f59e0b;
  --red: #f43f5e;
  --live-red: #e11d48;
  --border-subtle: rgba(255, 255, 255, 0.07);
  --font-main: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.vox-ico {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body, html {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  font-family: var(--font-main);
  background-color: var(--bg-tertiary);
  color: var(--text-normal);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.hidden {
  display: none !important;
}

/* Scrollbars customizadas estilo Discord */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #2b2d31;
}
::-webkit-scrollbar-thumb {
  background: #1a1b1e;
  border-radius: 4px;
}

/* ================= TELA DE LOGIN / REGISTRO ================= */
.auth-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 20%, #4752c4 0%, #1e1f22 55%, #111214 100%);
  z-index: 1000;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--bg-primary);
  border-radius: 8px;
  padding: 32px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
  animation: popIn 0.22s ease-out;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.auth-header {
  text-align: center;
  margin-bottom: 22px;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-bright);
  font-weight: 800;
  font-size: 22px;
  margin-bottom: 12px;
}

.auth-logo svg {
  color: var(--brand);
}

.auth-header h1 {
  color: var(--text-bright);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
}

.auth-header p {
  color: var(--text-muted);
  font-size: 14px;
}

.auth-error {
  background: rgba(242, 63, 67, 0.15);
  border: 1px solid var(--red);
  color: #ff9b9d;
  padding: 10px 12px;
  border-radius: 5px;
  font-size: 13px;
  margin-bottom: 14px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #b5bac1;
  letter-spacing: 0.02em;
  margin-bottom: 7px;
  text-transform: uppercase;
}

.req {
  color: var(--red);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.3);
  background: var(--bg-tertiary);
  color: var(--text-bright);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--brand);
}

.color-picker-row {
  display: flex;
  gap: 10px;
}

.color-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.12s;
}

.color-swatch.selected {
  border-color: #ffffff;
  transform: scale(1.15);
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 11px 18px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover {
  background: var(--brand-hover);
}

.btn-secondary {
  background: #4e5058;
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-secondary:hover {
  background: #6d6f78;
}

.btn-danger {
  background: var(--red);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
}

.btn-block {
  width: 100%;
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 14px 0;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 700;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.auth-divider span {
  padding: 0 10px;
}

.auth-switch {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-switch a {
  color: #00a8fc;
  text-decoration: none;
  font-weight: 600;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* ================= LAYOUT PRINCIPAL DISCORD ================= */
.app-layout {
  display: flex;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  position: relative;
  overflow: hidden;
}

/* 1. BARRA DE SERVIDORES (SERVER RAIL) */
.server-rail {
  width: 72px;
  background: var(--bg-tertiary);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  gap: 8px;
  overflow-y: auto;
  flex-shrink: 0;
  user-select: none;
}

.server-rail::-webkit-scrollbar {
  display: none;
}

.server-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  align-items: center;
}

.server-icon-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.server-pill {
  position: absolute;
  left: 0;
  width: 4px;
  height: 0;
  background: #fff;
  border-radius: 0 4px 4px 0;
  transition: height 0.18s ease;
}

.server-icon-wrapper:hover .server-pill {
  height: 20px;
}

.server-icon-wrapper.active .server-pill {
  height: 40px;
}

.server-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-primary);
  color: var(--text-bright);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: border-radius 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.server-icon:hover,
.server-icon-wrapper.active .server-icon {
  border-radius: 16px;
}

.home-icon:hover,
.server-icon-wrapper.active .home-icon {
  background: var(--brand);
  color: #fff;
}

.action-icon {
  color: var(--green);
}

.action-icon:hover {
  background: var(--green);
  color: #fff;
}

.rail-separator {
  width: 32px;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 1px;
  margin: 2px 0;
}

/* 2. SIDEBAR DE CANAIS E GRUPOS */
.channels-sidebar {
  width: 256px;
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  user-select: none;
}

.sidebar-header {
  height: 48px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0, 0, 0, 0.25);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.server-header-title {
  font-weight: 700;
  color: var(--text-bright);
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.server-header-actions {
  display: flex;
  gap: 4px;
}

.dm-search-btn {
  width: 100%;
  background: var(--bg-tertiary);
  color: var(--text-normal);
  border: none;
  padding: 7px 10px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.dm-search-btn:hover {
  background: #35373c;
  color: #fff;
}

.channels-tree {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
}

.category-block {
  margin-bottom: 14px;
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.channel-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  margin: 2px 0;
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}

.channel-item:hover {
  background: var(--bg-modifier-hover);
  color: var(--text-normal);
}

.channel-item.active {
  background: var(--bg-modifier-selected);
  color: var(--text-bright);
}

/* Sub-grupo dentro de um canal (indentado com linha guia estilo Discord Thread/Group) */
.channel-item.is-subgroup {
  margin-left: 18px;
  padding: 5px 8px;
  font-size: 13.5px;
  border-left: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 0 4px 4px 0;
}

.channel-item.is-subgroup.active {
  border-left-color: var(--brand);
}

.channel-item-left {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  flex: 1;
}

.channel-prefix {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.channel-item.active .channel-prefix {
  color: #a5b4fc;
}

.sub-branch-ico {
  opacity: 0.65;
}

.channel-name-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.channel-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 1;
}

.btn-add-subgroup {
  background: rgba(99, 102, 241, 0.25);
  color: #c7d2fe;
  border: 1px solid rgba(99, 102, 241, 0.45);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 7px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: background 0.15s, color 0.15s;
}

.btn-add-subgroup:hover {
  background: var(--brand);
  color: #fff;
}

.btn-del-channel {
  background: transparent;
  color: var(--text-muted);
  border: none;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
}

.btn-del-channel:hover {
  color: var(--red);
}

/* Participantes dentro do canal de voz na barra lateral */
.voice-sidebar-members {
  margin-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 4px;
}

.voice-sidebar-members.is-subgroup-members {
  margin-left: 36px;
}

.voice-sidebar-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-normal);
  cursor: pointer;
}

.voice-sidebar-user:hover {
  background: var(--bg-modifier-hover);
}

.voice-sidebar-user-left {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.avatar-xs {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  transition: box-shadow 0.1s;
}

.avatar-xs.speaking,
.avatar.speaking,
.stage-avatar.speaking {
  box-shadow: 0 0 0 2.5px var(--green), 0 0 10px rgba(35, 165, 90, 0.75);
}

.voice-badges-right {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}

.live-pill {
  background: var(--live-red);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.btn-sidebar-mute-action {
  background: transparent;
  border: none;
  color: var(--text-muted);
  border-radius: 4px;
  padding: 2px 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.15s;
}

.btn-sidebar-mute-action:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-normal);
}

.btn-sidebar-mute-action.active {
  color: #10b981;
}

.btn-sidebar-mute-action.muted {
  color: #f43f5e;
}

.btn-sidebar-mute-action.muted:hover {
  background: rgba(244, 63, 94, 0.18);
  color: #fb7185;
}

.voice-badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #10b981;
}

.voice-badge-icon.muted {
  color: #f43f5e;
}

/* PAINEL DE VOZ CONECTADA (BARRA INFERIOR ESQUERDA) */
.voice-status-bar {
  background: #232428;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(0, 0, 0, 0.3);
  padding: 8px 10px;
}

.voice-status-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.signal-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
  font-weight: 700;
  font-size: 13px;
}

.signal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

.ping-badge {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
}

.signal-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.voice-bar-quick-btns {
  display: flex;
  gap: 4px;
}

.voice-status-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.voice-mini-btn {
  background: #313338;
  color: var(--text-bright);
  border: none;
  border-radius: 4px;
  padding: 6px 4px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background 0.15s;
}

.voice-mini-btn:hover {
  background: #404249;
}

.voice-mini-btn.active {
  background: var(--green);
  color: #fff;
}

/* PAINEL DO PERFIL DO USUÁRIO (RODAPÉ ESQUERDO) */
.user-panel {
  height: 54px;
  background: #232428;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.user-panel-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  flex: 1;
  overflow: hidden;
}

.user-panel-profile:hover {
  background: var(--bg-modifier-hover);
}

.avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.status-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2.5px solid #232428;
  display: inline-block;
}

.status-dot.online {
  background: var(--green);
}
.status-dot.idle {
  background: var(--yellow);
}
.status-dot.dnd {
  background: var(--red);
}
.status-dot.offline {
  background: #80848e;
}

.user-panel-names {
  overflow: hidden;
}

.user-panel-display {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-panel-sub {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-panel-controls {
  display: flex;
  align-items: center;
  gap: 2px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: transparent;
  color: #b5bac1;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.icon-btn:hover {
  background: var(--bg-modifier-hover);
  color: var(--text-bright);
}

.icon-btn.muted-active {
  color: var(--red);
  background: rgba(242, 63, 67, 0.15);
}

.danger-hover:hover {
  color: var(--red) !important;
  background: rgba(242, 63, 67, 0.16) !important;
}

/* Status Popover */
.status-popover {
  position: absolute;
  bottom: 60px;
  left: 10px;
  width: 190px;
  background: var(--bg-floating);
  border-radius: 6px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 100;
}

.status-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 13.5px;
  cursor: pointer;
}

.status-option .status-dot {
  position: static;
  border: none;
  width: 10px;
  height: 10px;
}

.status-option:hover {
  background: var(--brand);
  color: #fff;
}

/* ================= 3. ÁREA PRINCIPAL CENTRAL ================= */
.main-area {
  flex: 1;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.channel-topbar {
  height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0, 0, 0, 0.25);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.channel-topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.topbar-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #a5b4fc;
}

#topbar-channel-name {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-bright);
  white-space: nowrap;
}

.subgroup-pill {
  background: rgba(88, 101, 242, 0.25);
  color: #c9cdfb;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

.topbar-topic {
  font-size: 13px;
  color: var(--text-muted);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  padding-left: 10px;
  margin-left: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-top-action {
  background: rgba(99, 102, 241, 0.18);
  color: #d5d9ff;
  border: 1px solid rgba(99, 102, 241, 0.45);
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn-top-action:hover {
  background: var(--brand);
  color: #fff;
}

.btn-top-panel-toggle {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-top-panel-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-bright);
}

.btn-top-panel-toggle.active {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.45);
}

.panel-close-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.22);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.members-panel-top {
  margin: -14px -10px 8px -10px;
  padding: 10px 12px;
}

.btn-close-panel {
  background: rgba(244, 63, 94, 0.15);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.35);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.btn-close-panel:hover {
  background: var(--red);
  color: #fff;
}

.search-box input {
  background: var(--bg-tertiary);
  border: none;
  border-radius: 4px;
  padding: 5px 10px;
  color: var(--text-bright);
  font-size: 13px;
  width: 170px;
  outline: none;
  transition: width 0.2s;
}

.search-box input:focus {
  width: 220px;
}

.active-call-banner {
  background: #1a6334;
  color: #fff;
  padding: 7px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
}

.btn-xs-success {
  background: #23a55a;
  color: #fff;
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

.content-workspace {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

/* ================= PALCO DE VOZ, VÍDEO, TELA E WATCH PARTY ================= */
.voice-stage-view {
  flex: 1.4;
  background: #111214;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px;
  min-width: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.stage-main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  min-height: 0;
}

/* Spotlight (Transmissão de Tela / Câmera em Foco / Watch Party) */
.stage-spotlight {
  flex: 1;
  min-height: 300px;
  background: #000;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.spotlight-header {
  background: rgba(17, 18, 20, 0.9);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
}

.live-badge {
  background: var(--live-red);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.spotlight-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.btn-stage-sm {
  background: #2b2d31;
  color: #fff;
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}

.btn-stage-sm:hover {
  background: #404249;
}

.btn-danger-sm {
  background: #dc2626 !important;
  color: #fff !important;
  font-weight: 600;
}

.btn-danger-sm:hover {
  background: #b91c1c !important;
}

.spotlight-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: #000;
  min-height: 250px;
}

.spotlight-body video,
.spotlight-body iframe {
  width: 100%;
  height: 100%;
  max-height: 62vh;
  object-fit: contain;
  border: none;
}

/* Barra Elegante Abaixo da Transmissão */
.spotlight-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: linear-gradient(180deg, rgba(20, 21, 26, 0.95) 0%, rgba(13, 14, 18, 0.98) 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  gap: 12px;
}

.spotlight-footer-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-normal);
}

.live-pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f43f5e;
  box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.7);
  animation: pulseLiveDot 1.6s infinite;
  display: inline-block;
  flex-shrink: 0;
}

@keyframes pulseLiveDot {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(244, 63, 94, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(244, 63, 94, 0);
  }
}

.btn-stop-share-elegant {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #dc2626;
  color: #fff;
  border: none;
  padding: 7px 16px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35);
}

.btn-stop-share-elegant:hover {
  background: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.5);
}

.btn-stop-share-elegant:active {
  transform: translateY(0);
}

.stage-ctrl-btn.sharing-active {
  background: rgba(239, 68, 68, 0.22) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.45) !important;
}

/* Grade de Participantes de Voz e Vídeo */
.voice-participants-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  align-content: center;
  gap: 16px;
  flex: 1;
  min-height: 0;
  padding: 14px;
  overflow-y: auto;
}

/* Quando o destaque/spotlight principal está aberto, a grade vira uma barra horizontal de miniaturas */
.voice-stage-view.has-spotlight .voice-participants-grid {
  flex: 0 0 135px;
  min-height: 135px;
  max-height: 135px;
  display: flex;
  flex-wrap: nowrap;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 12px;
  overflow-x: auto;
  overflow-y: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.voice-stage-view.has-spotlight .participant-tile {
  flex: 0 0 180px;
  width: 180px;
  height: 110px;
  max-width: 180px;
  max-height: 110px;
  aspect-ratio: 16 / 9;
  min-height: unset;
}

/* Quando em modo grade (sem destaque), os cards ocupam a tela proporcionalmente em 16:9 sem distorção */
.voice-stage-view:not(.has-spotlight) .participant-tile {
  flex: 1 1 360px;
  max-width: 840px;
  max-height: calc(100vh - 230px);
  aspect-ratio: 16 / 9;
  min-height: 180px;
  width: auto;
}

/* Quando há apenas 1 participante ou transmissão em modo grade, centraliza em tamanho ideal de tela */
.voice-stage-view:not(.has-spotlight) .voice-participants-grid.single-tile .participant-tile,
.voice-stage-view:not(.has-spotlight) .voice-participants-grid:has(> .participant-tile:only-child) .participant-tile {
  flex: 0 1 960px;
  width: 100%;
  max-width: 960px;
  max-height: calc(100vh - 210px);
  aspect-ratio: 16 / 9;
}

.participant-tile {
  position: relative;
  background: #18191c;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.participant-tile:hover {
  background: #232428;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}

.participant-tile.speaking-tile {
  border-color: var(--green);
  box-shadow: 0 0 14px rgba(35, 165, 90, 0.35);
}

.participant-tile video {
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  position: absolute;
  inset: 0;
  background: #000;
}

.participant-tile img.tile-relay-img {
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  position: absolute;
  inset: 0;
  background: #000;
}

.stage-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  z-index: 2;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.12s, box-shadow 0.12s;
}

.participant-tile.speaking-tile .stage-avatar {
  transform: scale(1.06);
}

.peer-connection-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  z-index: 4;
  backdrop-filter: blur(4px);
  pointer-events: auto;
  transition: opacity 0.2s, transform 0.2s;
}

.peer-connection-badge.connected {
  background: rgba(35, 165, 90, 0.88);
  color: #fff;
}

.peer-connection-badge.connecting {
  background: rgba(234, 179, 8, 0.9);
  color: #111;
  animation: pulse-soft 1.4s infinite;
}

.peer-connection-badge.failed {
  background: rgba(237, 66, 69, 0.92);
  color: #fff;
}

.tile-overlay-bottom {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 3;
  pointer-events: none;
}

.tile-name-tag {
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tile-top-badges {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  z-index: 3;
}

/* Barra de Controles da Sala de Voz */
.stage-controls-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-top: 12px;
  flex-wrap: wrap;
}

.stage-ctrl-btn {
  background: #2b2d31;
  color: var(--text-bright);
  border: none;
  border-radius: 28px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.stage-ctrl-btn:hover {
  background: #383a40;
}

.stage-ctrl-btn.active {
  background: var(--green);
  color: #fff;
}

.stage-ctrl-btn.muted {
  background: rgba(242, 63, 67, 0.22);
  color: #ff9b9d;
  border: 1px solid var(--red);
}

.stage-ctrl-btn.danger {
  background: var(--red);
  color: #fff;
}

.stage-ctrl-btn.danger:hover {
  background: #c93034;
}

/* ================= ÁREA DE CHAT DE TEXTO ================= */
.chat-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 300px;
  background: var(--bg-primary);
}

/* Barra de sub-grupos rápidos no topo do canal */
.channel-subgroups-bar {
  background: #2b2d31;
  padding: 7px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.subgroup-chip {
  background: #383a40;
  color: var(--text-normal);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
}

.subgroup-chip:hover,
.subgroup-chip.active {
  background: var(--brand);
  color: #fff;
}

.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.channel-welcome-hero {
  position: relative;
  padding: 20px 18px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 10px;
}

.welcome-close-btn {
  position: absolute;
  top: 12px;
  right: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.welcome-close-btn:hover {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

.welcome-icon-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #404249;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 10px;
}

.channel-welcome-hero h3 {
  font-size: 24px;
  color: var(--text-bright);
  margin-bottom: 4px;
}

.channel-welcome-hero p {
  color: var(--text-muted);
  font-size: 14px;
}

.message-item {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 6px 18px;
  transition: background 0.08s;
}

.message-item:hover {
  background: rgba(4, 4, 5, 0.07);
}

.message-body {
  flex: 1;
  min-width: 0;
}

.message-reply-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.message-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}

.message-author {
  font-weight: 600;
  color: var(--text-bright);
  font-size: 15px;
  cursor: pointer;
}

.message-author:hover {
  text-decoration: underline;
}

.message-time {
  font-size: 11px;
  color: var(--text-muted);
}

.message-text {
  color: var(--text-normal);
  line-height: 1.42;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.message-text a {
  color: #00a8fc;
  text-decoration: none;
}

.message-text a:hover {
  text-decoration: underline;
}

/* Mídia anexada na mensagem (Vídeos, Imagens, YouTube) */
.message-media {
  margin-top: 8px;
  max-width: 520px;
  border-radius: 8px;
  overflow: hidden;
  background: #1e1f22;
}

.message-media video {
  width: 100%;
  max-height: 340px;
  display: block;
  background: #000;
}

.message-media img {
  max-width: 100%;
  max-height: 340px;
  display: block;
  cursor: zoom-in;
  border-radius: 6px;
}

.message-media iframe {
  width: 100%;
  height: 290px;
  border: none;
  display: block;
}

/* Reações abaixo da mensagem */
.message-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.reaction-pill {
  background: #2b2d31;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 13px;
  color: var(--text-normal);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.reaction-pill.reacted {
  background: rgba(88, 101, 242, 0.22);
  border-color: var(--brand);
  color: #fff;
}

/* Barra de Ações ao passar o mouse na mensagem */
.message-hover-toolbar {
  position: absolute;
  top: -12px;
  right: 18px;
  background: #313338;
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 6px;
  display: none;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 5;
}

.message-item:hover .message-hover-toolbar {
  display: flex;
}

.msg-action-btn {
  background: transparent;
  border: none;
  padding: 5px 7px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-normal);
}

.msg-action-btn:hover {
  background: var(--bg-modifier-hover);
}

/* Caixa de envio de mensagem */
.chat-preview-bar {
  margin: 0 16px;
  padding: 8px 12px;
  background: #2b2d31;
  border-radius: 8px 8px 0 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-normal);
}

.typing-indicator {
  height: 18px;
  padding: 0 20px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.chat-input-wrapper {
  margin: 0 16px 18px;
  background: #383a40;
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-attach-btn {
  background: transparent;
  border: none;
  color: #b5bac1;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.chat-attach-btn:hover {
  color: #fff;
}

#chat-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-bright);
  font-size: 15px;
  outline: none;
}

.chat-quick-emojis {
  display: flex;
  gap: 4px;
}

.emoji-insert-btn {
  background: transparent;
  border: none;
  font-size: 17px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}

.emoji-insert-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-send-msg {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #fff;
  border: none;
  padding: 7px 14px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.1s, opacity 0.15s;
}

.btn-send-msg:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

/* ================= 4. LISTA DE MEMBROS À DIREITA ================= */
.members-sidebar {
  width: 240px;
  background: var(--bg-secondary);
  overflow-y: auto;
  padding: 14px 10px;
  flex-shrink: 0;
  user-select: none;
}

.members-role-header {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  padding: 10px 8px 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.member-row:hover {
  background: var(--bg-modifier-hover);
}

.member-row.offline-member {
  opacity: 0.55;
}

.member-info {
  overflow: hidden;
  flex: 1;
}

.member-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 5px;
}

.badge-role {
  background: var(--brand);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.badge-role.admin-badge {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
}

.badge-role.member-badge {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.role-topbar-pill {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.role-topbar-pill.admin {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.role-topbar-pill.member {
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.btn-promote-inline {
  background: rgba(99, 102, 241, 0.2);
  color: #c7d2fe;
  border: 1px solid rgba(99, 102, 241, 0.45);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 6px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}

.btn-promote-inline:hover {
  background: var(--brand);
  color: #fff;
}

.btn-promote-inline.demote {
  background: rgba(244, 63, 94, 0.15);
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.35);
}

.btn-promote-inline.demote:hover {
  background: var(--red);
  color: #fff;
}

.roles-members-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.role-member-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.role-member-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.role-member-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.member-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ================= PAINEL DE AMIGOS & DMS ================= */
.friends-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  padding: 18px 24px;
  overflow-y: auto;
}

.friends-header-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 18px;
}

.friends-title {
  font-weight: 800;
  color: #fff;
  font-size: 16px;
  margin-right: 8px;
}

.friend-tab-btn {
  background: transparent;
  color: var(--text-normal);
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
}

.friend-tab-btn.active {
  background: #404249;
  color: #fff;
}

.friend-tab-btn.add-friend-tab {
  background: var(--green);
  color: #fff;
}

.friends-add-box {
  background: #2b2d31;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.friends-add-box h3 {
  font-size: 14px;
  color: #fff;
  margin-bottom: 4px;
}

.friends-add-box p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.add-friend-form {
  display: flex;
  gap: 10px;
}

.add-friend-form input {
  flex: 1;
  background: var(--bg-tertiary);
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  padding: 10px 12px;
  color: #fff;
  outline: none;
}

.friend-feedback {
  margin-top: 8px;
  font-size: 13px;
}

.friends-list-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.friend-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #2b2d31;
  border-radius: 8px;
}

.friend-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.friend-card-actions {
  display: flex;
  gap: 8px;
}

/* ================= MODAIS ================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 16px;
}

.modal-card {
  width: 100%;
  max-width: 460px;
  background: var(--bg-primary);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
  animation: popIn 0.16s ease-out;
}

.modal-card.modal-lg {
  max-width: 640px;
}

.modal-header {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-header h3 {
  font-size: 18px;
  color: var(--text-bright);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
}

.modal-close:hover {
  color: #fff;
}

.modal-body {
  padding: 20px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-body h4 {
  color: var(--text-bright);
  margin-bottom: 12px;
}

.modal-text {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 14px;
  line-height: 1.4;
}

.parent-channel-banner {
  background: rgba(88, 101, 242, 0.16);
  border: 1px solid var(--brand);
  color: #dbe0ff;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 14px;
}

.channel-type-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.type-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #2b2d31;
  padding: 12px;
  border-radius: 6px;
  cursor: pointer;
  border: 1.5px solid transparent;
}

.type-card.selected {
  border-color: var(--brand);
  background: rgba(88, 101, 242, 0.12);
}

.type-card input {
  display: none;
}

.type-icon {
  font-size: 22px;
  width: 28px;
  text-align: center;
}

.type-card strong {
  display: block;
  color: var(--text-bright);
  font-size: 14px;
}

.type-card small {
  color: var(--text-muted);
  font-size: 12px;
}

.invite-copy-box {
  display: flex;
  gap: 8px;
}

.invite-copy-box input {
  flex: 1;
  background: var(--bg-tertiary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 10px 12px;
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.08em;
}

.discover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.discover-card {
  background: #2b2d31;
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.discover-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wp-preset-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.btn-xs-preset {
  background: #2b2d31;
  color: var(--text-normal);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 7px 10px;
  border-radius: 4px;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}

.btn-xs-preset:hover {
  background: #383a40;
  color: #fff;
}

.settings-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox-content img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 8px;
}

.lightbox-close {
  position: absolute;
  top: -34px;
  right: 0;
  color: #fff;
  font-size: 24px;
}

/* ============================================================================
   RESPONSIVIDADE COMPLETA PARA CELULAR & TABLET (@media max-width: 860px)
   ============================================================================ */
.mobile-menu-btn {
  display: none;
}

.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(2px);
  z-index: 190;
  opacity: 1;
  transition: opacity 0.2s ease;
}

@media (max-width: 860px) {
  /* Prevenir zoom no iOS e inputs legíveis */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  textarea,
  select {
    font-size: 16px !important;
  }

  /* 1. Barra de servidores (server-rail) no celular */
  .server-rail {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 64px;
    height: 100dvh;
    z-index: 220;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.4);
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  }

  /* 2. Barra lateral de canais (channels-sidebar) no celular */
  .channels-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 64px;
    width: min(300px, calc(100vw - 64px));
    height: 100dvh;
    z-index: 210;
    box-shadow: 6px 0 20px rgba(0, 0, 0, 0.45);
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  }

  /* Estado recolhido: quando channelsSidebarVisible for false no celular */
  .app-layout.mobile-drawer-closed .server-rail,
  .app-layout.mobile-drawer-closed .channels-sidebar {
    transform: translateX(-120%);
    pointer-events: none;
  }

  /* Estado aberto: drawer desliza para a tela */
  .app-layout.mobile-drawer-open .server-rail {
    transform: translateX(0);
  }
  .app-layout.mobile-drawer-open .channels-sidebar {
    transform: translateX(0);
  }

  /* 3. Coluna de membros da comunidade (members-sidebar) como gaveta à direita */
  .members-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    width: min(290px, 85vw);
    height: 100dvh;
    z-index: 230;
    box-shadow: -6px 0 20px rgba(0, 0, 0, 0.45);
    background: var(--bg-secondary);
  }

  /* 4. Área Principal Central no Celular */
  .main-area {
    width: 100vw;
    height: 100dvh;
    max-width: 100vw;
    flex: 1;
  }

  .channel-topbar {
    height: 48px;
    padding: 0 8px;
    gap: 6px;
  }

  .channel-topbar-left {
    gap: 6px;
    flex: 1;
    min-width: 0;
  }

  #topbar-channel-name {
    font-size: 14px;
    max-width: 120px;
  }

  .role-topbar-pill {
    padding: 1px 5px;
    font-size: 9.5px;
  }

  .topbar-topic,
  .search-box {
    display: none !important;
  }

  .channel-topbar-right {
    gap: 4px;
    flex-shrink: 0;
  }

  .btn-top-action {
    padding: 4px 7px;
    font-size: 11px;
  }

  .btn-top-panel-toggle {
    padding: 4px 8px;
    font-size: 11px;
  }

  .mobile-menu-btn {
    display: inline-flex !important;
  }

  /* 5. Palco de Voz / Vídeo / Transmissão de Tela no Celular */
  .voice-stage-view {
    padding: 8px;
    height: 100%;
    overflow-y: auto;
  }

  .stage-main-area {
    gap: 8px;
  }

  .stage-spotlight {
    min-height: 220px;
    max-height: 45vh;
  }

  .spotlight-body {
    min-height: 180px;
  }

  .spotlight-body video,
  .spotlight-body iframe,
  .spotlight-body img {
    max-height: 42vh;
  }

  .voice-participants-grid {
    gap: 8px;
    padding: 6px;
  }

  .voice-stage-view.has-spotlight .voice-participants-grid {
    flex: 0 0 110px;
    min-height: 110px;
    max-height: 110px;
    gap: 8px;
    padding: 4px;
  }

  .voice-stage-view.has-spotlight .participant-tile {
    flex: 0 0 140px;
    width: 140px;
    height: 90px;
    max-width: 140px;
    max-height: 90px;
    aspect-ratio: 16 / 9;
  }

  .voice-stage-view:not(.has-spotlight) .participant-tile {
    flex: 1 1 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    min-height: unset;
  }

  .stage-avatar {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }

  .tile-name-tag {
    font-size: 11px;
    padding: 2px 5px;
  }

  /* Barra flutuante de controles de voz no Celular */
  .stage-controls-bar {
    padding: 8px 4px;
    gap: 6px;
  }

  .stage-ctrl-btn {
    padding: 8px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    gap: 5px;
  }

  .stage-ctrl-btn svg {
    width: 16px;
    height: 16px;
  }

  .stage-ctrl-btn .ctrl-label {
    display: none;
  }

  /* 6. Chat de Texto no Celular */
  .chat-view {
    min-width: 0;
    width: 100%;
  }

  .chat-input-wrapper {
    padding: 6px 8px;
    margin: 4px 8px 8px;
    border-radius: 8px;
    gap: 6px;
  }

  .chat-input-wrapper input[type="text"] {
    font-size: 15px;
    padding: 6px 4px;
  }

  .btn-send-msg {
    padding: 6px 10px;
    font-size: 13px;
  }

  .btn-send-msg span {
    display: none;
  }

  .chat-attach-btn {
    padding: 4px;
  }

  /* 7. Tela de Amigos no Celular */
  .friends-header-bar {
    padding: 8px 10px;
    gap: 8px;
    flex-wrap: wrap;
  }

  .friends-add-box {
    padding: 14px 12px;
  }

  /* 8. Modais em telas móveis */
  .modal-card {
    width: 95vw;
    max-width: 95vw;
    margin: 10px auto;
    border-radius: 10px;
  }

  .modal-body {
    padding: 14px;
    max-height: 75dvh;
  }

  /* Ajustes no User Panel (rodapé da barra de canais) */
  .user-panel {
    padding: 0 4px;
  }

  .user-panel-profile {
    gap: 6px;
    padding: 2px 4px;
  }

  .user-panel-display {
    max-width: 100px;
  }
}

/* ============================================================
   SISTEMA MODERNO DE NOTIFICAÇÕES (TOASTS) & DIÁLOGOS
   ============================================================ */
#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: 400px;
  width: calc(100vw - 48px);
}

.toast-item {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 18px;
  border-radius: 12px;
  background: rgba(22, 24, 31, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55), 0 3px 10px rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 13.5px;
  line-height: 1.45;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  overflow: hidden;
  position: relative;
}

.toast-item.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-item.hide {
  transform: translateX(120%);
  opacity: 0;
}

.toast-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-item.success .toast-icon {
  background: rgba(34, 197, 94, 0.16);
  color: #4ade80;
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.35);
}
.toast-item.success {
  border-left: 4px solid #22c55e;
}

.toast-item.error .toast-icon {
  background: rgba(239, 68, 68, 0.16);
  color: #f87171;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.35);
}
.toast-item.error {
  border-left: 4px solid #ef4444;
}

.toast-item.info .toast-icon {
  background: rgba(99, 102, 241, 0.16);
  color: #818cf8;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.35);
}
.toast-item.info {
  border-left: 4px solid #6366f1;
}

.toast-content {
  flex: 1;
  font-weight: 500;
  word-break: break-word;
}

.toast-close {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 4px 6px;
  font-size: 17px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.toast-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

/* Modal de Diálogo Customizado (Confirmação / Prompt) */
.dialog-card {
  max-width: 440px;
  width: 90vw;
  animation: dialogPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dialogPop {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* ============================================================
   MINI-PLAYER FLUTUANTE (TAMANHO IDEAL) AO MINIMIZAR
   ============================================================ */
.floating-stream-pip {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 340px;
  max-width: calc(100vw - 32px);
  aspect-ratio: 16 / 9;
  background: #0d0e12;
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.75), 0 0 0 1.5px rgba(255, 255, 255, 0.12);
  z-index: 99990;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease;
}

.floating-stream-pip:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.9), 0 0 0 2px rgba(99, 102, 241, 0.7);
}

.pip-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 8px 10px;
  background: linear-gradient(180deg, rgba(10, 11, 14, 0.9) 0%, rgba(10, 11, 14, 0) 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.floating-stream-pip:hover .pip-header {
  opacity: 1;
}

.pip-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.pip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f43f5e;
  box-shadow: 0 0 8px #f43f5e;
  animation: pulseLiveDot 1.6s infinite;
}

.pip-actions {
  display: flex;
  gap: 6px;
  pointer-events: auto;
}

.pip-btn {
  background: rgba(22, 24, 30, 0.85);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.15s, color 0.15s;
}

.pip-btn:hover {
  background: #4f46e5;
  color: #fff;
}

.pip-body {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.pip-body video,
.pip-body img,
.pip-body iframe {
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  background: #000;
  border: none;
}

.audio-blocked-pill {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: #f59e0b;
  color: #111827;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 18px;
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s, opacity 0.15s;
}

.audio-blocked-pill:hover {
  transform: translateX(-50%) scale(1.03);
}

/* Soundboard */
.soundboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.soundboard-card-btn {
  background: #2b2d31;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
  color: #fff;
  user-select: none;
}

.soundboard-card-btn:hover {
  background: #35373c;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.soundboard-card-btn:active {
  transform: scale(0.96);
  background: var(--primary);
}

.soundboard-card-btn .sb-emoji {
  font-size: 26px;
}

.soundboard-card-btn .sb-title {
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Notificação flutuante de som do Soundboard */
.soundboard-floating-pill {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30, 31, 34, 0.94);
  border: 1px solid var(--primary);
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  z-index: 10;
  animation: bounce-in 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

/* Drag and Drop em Canais de Voz */
.channel-item.drag-over {
  background: rgba(99, 102, 241, 0.25) !important;
  border: 1px dashed var(--primary) !important;
}

.channel-voice-user[draggable="true"],
.voice-sidebar-user[draggable="true"] {
  cursor: grab;
}

.channel-voice-user[draggable="true"]:active,
.voice-sidebar-user[draggable="true"]:active {
  cursor: grabbing;
  opacity: 0.5;
}

/* Indicador de Cadeado para Canais Restritos */
.channel-lock-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 5px;
  color: #eab308;
  vertical-align: middle;
}




