:root {
  color-scheme: dark;
  --bg-tertiary: #1e1f22;   /* server rail */
  --bg-secondary: #2b2d31;  /* channel sidebar */
  --bg-secondary-alt: #2b2d31;
  --bg-primary: #313338;    /* main stage */
  --bg-floating: #313338;   /* modals */
  --bg-hover: #35373c;
  --bg-active: #404249;
  --border: #1e1f22;
  --text-normal: #f2f3f5;
  --text-muted: #949ba4;
  --accent: #5865f2;
  --accent-hover: #4752c4;
  --green: #23a55a;
  --red: #f23f43;
  --red-hover: #da373c;
  --gold: #f0b132;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  height: 100vh;
  background: var(--bg-primary);
  color: var(--text-normal);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  overflow: hidden;
}
.hidden { display: none !important; }
.muted { color: var(--text-muted); }
button { font: inherit; cursor: pointer; border: none; }

/* ---- tela de login/cadastro ---- */
.auth-screen {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
}
.auth-box {
  background: var(--bg-primary);
  border-radius: 8px;
  padding: 28px;
  width: 100%;
  max-width: 360px;
  text-align: center;
}
.auth-box h1 { font-size: 1.3rem; margin: 0 0 18px; }
.auth-tabs { display: flex; margin-bottom: 16px; border-radius: 6px; overflow: hidden; background: var(--bg-tertiary); }
.auth-tab { flex: 1; padding: 8px; background: transparent; color: var(--text-muted); font-weight: 600; }
.auth-tab.active { background: var(--accent); color: #fff; }
.auth-box input {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: 4px;
  border: none;
  background: var(--bg-tertiary);
  color: var(--text-normal);
  font: inherit;
  text-align: left;
}
.auth-submit { width: 100%; }

.app { display: flex; height: 100vh; }

/* ---- server rail ---- */
.server-rail {
  width: 72px;
  flex: 0 0 auto;
  background: var(--bg-tertiary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 12px;
  overflow: visible;
}
#server-icons { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
.server-icon {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  flex: 0 0 auto;
  transition: border-radius .15s ease, background .15s ease;
}
.server-icon:hover, .server-icon.active { border-radius: 16px; cursor: pointer; }
.server-icon.active::before, .server-icon:hover::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  background: #fff;
  border-radius: 0 4px 4px 0;
}
.server-icon.active::before { height: 36px; }
.add-server-icon { background: var(--bg-secondary); color: var(--green); font-size: 1.5rem; font-weight: 400; }
.add-server-icon:hover { background: var(--green); color: #fff; }

/* ---- channel sidebar ---- */
.channel-sidebar {
  width: 260px;
  flex: 0 0 auto;
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  position: relative;
  min-width: 220px;
  max-width: 420px;
}
/* Alça de redimensionar a lateral — pedido explícito de poder "auto ajustar" a área pra caber
   nick/elo/selos sem cortar, em vez de uma largura fixa pra sempre. */
.sidebar-resize-handle {
  position: absolute;
  top: 0; right: -3px;
  width: 6px; height: 100%;
  cursor: col-resize;
  z-index: 5;
}
.sidebar-resize-handle:hover, .sidebar-resize-handle.dragging { background: rgba(88, 101, 242, 0.5); }

/* ---- menu mobile: hambúrguer + fundo escurecido, só existem/aparecem abaixo do breakpoint ---- */
.mobile-nav-toggle { display: none; }
.mobile-nav-backdrop { display: none; }
.server-header {
  padding: 16px;
  font-weight: 700;
  box-shadow: 0 1px 0 rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.invite-btn { background: transparent; color: var(--text-muted); font-size: 1rem; padding: 2px 6px; border-radius: 4px; }
.invite-btn:hover { background: var(--bg-hover); color: var(--text-normal); }
.channel-list { flex: 1; overflow-y: auto; padding: 12px 8px; }
.no-server-msg { flex: 1; padding: 20px; font-size: 0.85rem; text-align: center; }
.channel-category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.channel-category button {
  background: transparent;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
}
.channel-category button:hover { background: var(--bg-hover); color: var(--text-normal); }

.channel-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  margin-top: 2px;
}
.channel-row:hover { background: var(--bg-hover); color: var(--text-normal); }
.channel-row.connected { background: var(--bg-active); color: var(--text-normal); }
.channel-icon { opacity: 0.8; }
.channel-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.92rem; }
.channel-count { font-size: 0.72rem; background: var(--bg-tertiary); padding: 1px 6px; border-radius: 8px; }

.channel-members { padding: 2px 4px 6px 22px; display: flex; flex-direction: column; gap: 2px; }
.channel-member {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.avatar-sm {
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; color: #fff; flex: 0 0 auto;
}
.channel-member.speaking .avatar-sm { box-shadow: 0 0 0 2px var(--green); }
.mic-off-badge { color: var(--red); font-size: 0.8rem; }
.member-name-sm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-tag { color: var(--red); font-size: 0.72rem; font-weight: 700; margin-left: 4px; }

/* Volume individual por pessoa fica integrado ao próprio nome — clicar nele (com a pessoa no
   canal de voz) abre o mesmo menu do clique direito, em vez de uma barra fixa embaixo do nick. */

/* ---- user bar ---- */
.user-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: var(--bg-tertiary);
}
.user-avatar {
  position: relative;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem; color: #fff; flex: 0 0 auto;
}
.user-avatar::after {
  content: '';
  position: absolute;
  right: -2px; bottom: -2px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  border: 2px solid var(--bg-tertiary);
}
.user-avatar.online::after { background: var(--green); }
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 0.85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta { display: flex; gap: 8px; min-width: 0; }
.user-status { font-size: 0.72rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Nomes de elo agora são bem mais compridos (Guardião, Grão-Mestre...) — sem isso, o texto era
   cortado no meio sem "..." (ficava tipo "Guard") porque só o container tinha overflow:hidden,
   não cada item. Com ellipsis + min-width:0 em cada um, os dois sempre aparecem, truncados de
   forma limpa quando não cabe tudo. */
.user-diamonds, .user-elo {
  font-size: 0.72rem; font-weight: 700; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1 1 auto;
}
.user-diamonds { color: #4dd2ff; }
.user-elo { color: var(--gold); }
.user-btn {
  width: 30px; height: 30px; border-radius: 6px;
  background: transparent; color: var(--text-normal);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.user-btn:hover:not(:disabled) { background: var(--bg-hover); }
.user-btn:disabled { opacity: 0.35; cursor: default; }
.user-btn.active-off { background: var(--red); }
.user-btn.active-off:hover { background: var(--red-hover); }
.user-btn-danger { color: var(--red); }
.user-btn-danger:hover { background: var(--red); color: #fff; }

/* ---- main stage ---- */
.main-stage { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.3);
  flex: 0 0 auto;
}
.stage-title { font-weight: 700; }
.btn-pill {
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
}
.btn-pill:hover { background: var(--accent-hover); }
.btn-pill.active-off { background: var(--red); }
.btn-pill.active-off:hover { background: var(--red-hover); }

.stage-grid {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  align-content: start;
}
#stage-empty { grid-column: 1 / -1; text-align: center; margin-top: 60px; }

/* ---- chat geral ---- */
.chat-panel { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { display: flex; gap: 10px; align-items: flex-start; }
.chat-msg .avatar-sm { width: 34px; height: 34px; font-size: 0.9rem; flex-shrink: 0; margin-top: 2px; }
.chat-msg-body { min-width: 0; }
.chat-msg-name { font-weight: 700; font-size: 0.9rem; }
.chat-msg-text { font-size: 0.92rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.chat-form { display: flex; gap: 8px; padding: 12px 16px 16px; }
.chat-form input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 8px;
  border: none;
  background: var(--bg-secondary);
  color: var(--text-normal);
  font: inherit;
}
.chat-channel-row { cursor: pointer; }

/* ---- lista de online (dono ganha destaque dourado) ---- */
.member-list-panel {
  width: 240px;
  flex: 0 0 auto;
  background: var(--bg-secondary);
  padding: 16px 12px;
  overflow-y: auto;
}
.member-list-header { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); letter-spacing: 0.02em; margin-bottom: 10px; }
#online-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.online-item { display: flex; align-items: center; gap: 8px; }
.online-group-header {
  font-size: 0.68rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em;
  margin-top: 4px;
}
.online-group-header:first-child { margin-top: 0; }
.owner-name { color: var(--gold); font-weight: 700; }
.owner-crown { margin-left: 2px; }
.owner-ring { box-shadow: 0 0 0 2px var(--gold), 0 0 10px var(--gold); }
.avatar-tile.owner-ring { box-shadow: 0 0 0 3px var(--gold) inset, 0 0 14px var(--gold); }

.avatar-tile, .screen-tile {
  background: var(--bg-secondary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  position: relative;
  overflow: hidden;
}
.avatar-tile .avatar-big {
  width: 72px; height: 72px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 700; color: #fff;
}
.avatar-tile.speaking { box-shadow: 0 0 0 3px var(--green) inset; }
.tile-label {
  position: absolute;
  left: 8px; bottom: 8px;
  background: rgba(0,0,0,0.55);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 4px;
}
.tile-label .mic-off-badge { font-size: 0.75rem; }

/* ---- controles rápidos de volume no card do participante — aparecem ao passar o mouse (o
   menu de clique direito com slider fino continua existindo pra ajuste mais preciso) ---- */
.tile-volume-controls {
  position: absolute;
  top: 8px; right: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity .15s;
}
@media (hover: hover) {
  .avatar-tile:hover .tile-volume-controls { opacity: 1; }
}
@media (hover: none) {
  .tile-volume-controls { opacity: 1; } /* sem hover (touch): fica sempre visível */
}
.tile-vol-btn {
  width: 26px; height: 26px; border-radius: 6px;
  background: rgba(0,0,0,0.55); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
}
.tile-vol-btn:hover { background: rgba(0,0,0,0.8); }

/* Tela compartilhada: largura toda do grid (centralizada, em destaque), bem maior que os
   avatares, com botão de tela cheia nativa do navegador. */
.screen-tile {
  grid-column: 1 / -1;
  min-height: 420px;
  background: #000;
}
.screen-tile video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.screen-expand-btn {
  position: absolute;
  right: 8px; bottom: 8px;
  width: 32px; height: 32px;
  border-radius: 6px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
}
.screen-expand-btn:hover { background: rgba(0,0,0,0.8); }

@media (max-width: 700px) {
  .screen-tile { min-height: 220px; }
}

/* ---- modals ---- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10;
}
.modal-box {
  background: var(--bg-floating);
  border-radius: 8px;
  padding: 20px;
  width: 100%;
  max-width: 380px;
}
.modal-box h2 { margin-top: 0; font-size: 1.15rem; }
.modal-box label { display: block; font-size: 0.72rem; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; }
.modal-box input, .modal-box select {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 14px;
  border-radius: 4px;
  border: none;
  background: var(--bg-tertiary);
  color: var(--text-normal);
  font: inherit;
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.modal-actions-col { flex-direction: column; margin-bottom: 4px; }
.modal-actions-col button { width: 100%; }
.error { color: var(--red); font-size: 0.85rem; margin: -6px 0 12px; }

/* ---- painel admin ---- */
.modal-box-lg { max-width: 560px; }
.admin-tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.admin-tab { background: var(--bg-tertiary); color: var(--text-muted); padding: 8px 14px; border-radius: 6px; font-weight: 600; font-size: 0.85rem; }
.admin-tab.active { background: var(--accent); color: #fff; }
.admin-list { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.admin-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-tertiary);
  border-radius: 6px;
  font-size: 0.88rem;
}
.admin-row-main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-row-sub { color: var(--text-muted); font-size: 0.78rem; }
.role-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; }

.perm-checks { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.perm-check { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; color: var(--text-normal); }

.friends-add { display: flex; gap: 8px; margin-bottom: 12px; }
.friends-add input { margin-bottom: 0; }

/* ---- apagar mensagem (aparece ao passar o mouse) ---- */
.chat-msg { position: relative; }
.chat-msg-delete {
  position: absolute; top: 4px; right: 4px; background: transparent; color: var(--text-muted);
  padding: 4px 6px; border-radius: 4px; opacity: 0; transition: opacity .1s;
}
.chat-msg:hover .chat-msg-delete { opacity: 1; }
.chat-msg-delete:hover { background: var(--red); color: #fff; }

/* ---- mensagem do bot de boas-vindas ---- */
.chat-msg.is-bot .chat-msg-name { color: var(--green); }
.chat-msg.is-bot .chat-msg-text { font-style: italic; color: var(--text-muted); }

/* ---- nick premium: animações reais (as "nick-*" são customizadas, as "animate__*" vêm do
   Animate.css via CDN — biblioteca open source, sem precisar hospedar GIF/vídeo nenhum) ---- */
@keyframes nick-rainbow-cycle {
  0%   { color: #ff5c5c; }
  16%  { color: #ffb84d; }
  33%  { color: #ffe14d; }
  50%  { color: #4dff88; }
  66%  { color: #4dd2ff; }
  83%  { color: #b84dff; }
  100% { color: #ff5c5c; }
}
.nick-rainbow { animation: nick-rainbow-cycle 3s linear infinite; font-weight: 700; }
@keyframes nick-glow-pulse {
  0%, 100% { text-shadow: 0 0 4px currentColor, 0 0 8px currentColor; }
  50%      { text-shadow: 0 0 12px currentColor, 0 0 22px currentColor; }
}
.nick-glow { animation: nick-glow-pulse 1.8s ease-in-out infinite; color: var(--accent); font-weight: 700; }

.nick-preview { font-size: 1.3rem; padding: 16px; text-align: center; background: var(--bg-tertiary); border-radius: 8px; margin-bottom: 14px; }

.admin-badge { background: var(--red); color: #fff; border-radius: 10px; padding: 1px 7px; font-size: 0.72rem; margin-left: 4px; }
.admin-row-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.admin-row-actions button { padding: 6px 10px; font-size: 0.8rem; }
.admin-premium-check { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; font-size: 0.78rem; color: var(--text-muted); }

.btn-primary, .btn-secondary {
  padding: 10px 16px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.9rem;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: transparent; color: var(--text-normal); }
.btn-secondary:hover { text-decoration: underline; }

/* ---- avatar com foto ---- */
.has-photo { background: none !important; }
.has-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }

/* ---- menu de configurações (⚙️ na barra de baixo) ---- */
.settings-menu-wrap { position: relative; flex: 0 0 auto; }
.settings-menu {
  position: absolute;
  bottom: 42px;
  right: 0;
  background: var(--bg-floating);
  border: 1px solid var(--bg-tertiary);
  border-radius: 8px;
  padding: 6px;
  width: 220px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  z-index: 20;
}
.settings-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--text-normal);
  padding: 9px 10px;
  border-radius: 6px;
  font-size: 0.88rem;
}
.settings-menu-item:hover { background: var(--bg-hover); }
.settings-menu-item.danger { color: var(--red); }
.settings-menu-item.danger:hover { background: var(--red); color: #fff; }
.settings-menu-sep { height: 1px; background: var(--bg-tertiary); margin: 6px 4px; }

/* ---- menu de clique direito num participante ---- */
.context-menu {
  position: fixed;
  background: var(--bg-floating);
  border: 1px solid var(--bg-tertiary);
  border-radius: 8px;
  padding: 10px;
  width: 220px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  z-index: 30;
}
.context-menu-title { font-weight: 700; font-size: 0.85rem; margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.context-menu-volume { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.context-menu-volume input { flex: 1; }
.context-menu-volume-label { font-size: 0.75rem; color: var(--text-muted); min-width: 36px; text-align: right; }
.context-menu-item {
  display: block; width: 100%; text-align: left; background: transparent; color: var(--text-normal);
  padding: 8px 10px; border-radius: 6px; font-size: 0.85rem; margin-top: 2px;
}
.context-menu-item:hover { background: var(--bg-hover); }
.context-menu-item.danger { color: var(--red); }
.context-menu-item.danger:hover { background: var(--red); color: #fff; }

/* ---- cartão "assistir tela" (não mostra a transmissão sem clicar) ---- */
.screen-placeholder { background: var(--bg-secondary); }
.screen-placeholder-body { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 30px; text-align: center; }
.screen-stop-watch-btn {
  position: absolute; right: 8px; bottom: 8px; width: 32px; height: 32px; border-radius: 6px;
  background: rgba(0,0,0,0.55); color: #fff; font-size: 1rem; display: flex; align-items: center; justify-content: center;
}
.screen-stop-watch-btn:hover { background: rgba(0,0,0,0.8); }

/* ---- botão flutuante da loja — canto inferior direito, discreto (só ícone) mas sempre visível;
   fica fora do fluxo do chat/participantes em vez de flutuar no meio-embaixo da tela ---- */
.shop-fab {
  position: fixed;
  bottom: 22px;
  right: 22px;
  left: auto;
  transform: none;
  width: 52px;
  height: 52px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), #9b5de5);
  color: #fff;
  border-radius: 50%;
  font-size: 1.4rem;
  box-shadow: 0 4px 18px rgba(88, 101, 242, 0.5);
  z-index: 15;
  transition: transform .15s, box-shadow .15s;
}
.shop-fab:hover { transform: scale(1.08); box-shadow: 0 6px 22px rgba(88, 101, 242, 0.65); }
.shop-fab-label { display: none; }

/* ---- nomes clicáveis (abrem o perfil) ---- */
.clickable-name { cursor: pointer; }
.clickable-name:hover { text-decoration: underline; }

/* ---- painel de capa personalizada (upload próprio, dentro da aba "Capas" da loja) ---- */
.custom-cape-panel {
  background: var(--bg-tertiary);
  border: 1px dashed var(--accent);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.custom-cape-preview {
  width: 90px;
  height: 56px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-secondary);
  flex-shrink: 0;
}
.custom-cape-info { flex: 1; min-width: 180px; font-size: 0.8rem; color: var(--text-muted); }
.custom-cape-info strong { color: var(--text-normal); }
.custom-cape-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- grade de itens da loja ---- */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  max-height: 380px;
  overflow-y: auto;
  padding: 4px;
}
.shop-card {
  background: var(--bg-tertiary);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  transition: transform .15s, box-shadow .15s;
}
.shop-card:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,0.35); }
.shop-card-preview {
  width: 100%;
  height: 64px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  background: var(--bg-secondary);
  overflow: hidden;
  position: relative;
}
.shop-card-name { font-weight: 700; font-size: 0.85rem; }
.shop-card-desc { font-size: 0.72rem; color: var(--text-muted); min-height: 28px; }
.shop-card-price { font-size: 0.8rem; color: #4dd2ff; font-weight: 700; }
.shop-card button { width: 100%; font-size: 0.8rem; padding: 7px; }
.shop-card.owned { outline: 2px solid var(--green); }
.shop-card.equipped { outline: 2px solid var(--gold); }
.shop-card-tag { position: absolute; top: 4px; right: 4px; font-size: 0.65rem; background: rgba(0,0,0,0.6); padding: 1px 6px; border-radius: 6px; }

/* ---- modal de perfil ---- */
.profile-box { max-width: 420px; padding: 0; overflow: hidden; position: relative; }
.btn-close-x { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,0.4); color: #fff; border-radius: 50%; width: 28px; height: 28px; z-index: 2; }
.profile-cover {
  height: 120px;
  background: linear-gradient(135deg, var(--accent), #2b2d31);
  position: relative;
}
/* Capa personalizada (imagem própria) no lugar da moldura + do fundo — vira o próprio banner do
   card em vez de mostrar os dois separados mais uma terceira caixinha de "capa". */
.profile-cover.has-custom-cape, .hmp-cover.has-custom-cape { background-size: cover; background-position: center; }
.profile-avatar-wrap {
  position: absolute;
  left: 20px;
  bottom: -36px;
  border-radius: 50%;
}
.profile-avatar { width: 84px; height: 84px; font-size: 2rem; border: 4px solid var(--bg-floating); }
.profile-body { padding: 46px 20px 20px; }
.profile-name { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }
.profile-stats { display: flex; gap: 14px; margin-bottom: 10px; }
.profile-stat { font-weight: 700; font-size: 0.9rem; }
.profile-badges { display: flex; gap: 8px; flex-wrap: wrap; }
/* Capa (imagem própria ou efeito CSS) — banner largo e proporcional em vez do card pequeno de
   64px da loja, que cortava/espremia a imagem de forma estranha ("capa bugada"). */
.profile-cape-preview { width: 100%; height: 90px; border-radius: 8px; margin-bottom: 8px; background-size: cover; background-position: center; overflow: hidden; position: relative; }
/* Selos (badge) agora podem ser vários ao mesmo tempo (até 5) — ícones soltos (sem fundo/clip de
   card), pra não cortar o brilho/animação de cada um quando ficam lado a lado, alinhados. */
.profile-badges-row { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; }
.profile-badge-icon, .hmp-badge-icon {
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; overflow: visible; flex: 0 0 auto;
}
.profile-badge-icon { width: 32px; height: 32px; font-size: 1.3rem; }
.hmp-badge-icon { width: 22px; height: 22px; font-size: 1rem; }
.profile-achievements { display: flex; flex-direction: column; gap: 8px; max-height: 200px; overflow-y: auto; }
.achievement-row {
  display: flex; align-items: center; gap: 10px; background: var(--bg-tertiary); border-radius: 8px; padding: 8px 10px; font-size: 0.85rem;
}
.achievement-row.rare { box-shadow: 0 0 10px var(--gold) inset; }
.achievement-row .ach-icon { font-size: 1.3rem; }
.achievement-row .ach-name { font-weight: 700; }
.achievement-row .ach-desc { color: var(--text-muted); font-size: 0.75rem; }

/* ---- toast de conquista desbloqueada ---- */
.achievement-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--bg-floating);
  border: 1px solid var(--gold);
  box-shadow: 0 0 20px var(--gold);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 50;
  animation: nick-glow-pulse 1.8s ease-in-out infinite;
}
.achievement-toast-title { font-size: 0.72rem; color: var(--gold); font-weight: 700; text-transform: uppercase; }

/* ---- efeitos visuais originais da loja (molduras/capas/fundos/badges) — CSS puro, sem
   biblioteca externa nem imagem, pra não pesar e não depender de licença de terceiros ---- */
.frame-gold-glow { box-shadow: 0 0 0 3px var(--gold), 0 0 16px var(--gold); }
@keyframes frame-rgb-spin { to { --ang: 360deg; } }
.frame-rgb-split {
  box-shadow: 0 0 0 3px transparent;
  position: relative;
}
.frame-rgb-split::after {
  content: '';
  position: absolute; inset: -4px;
  /* "inherit" (não 50% fixo) — assim o anel acompanha o formato de onde a moldura está: círculo
     no avatar, cantos arredondados no card de preview da loja. Fixo em 50% desenhava um círculo
     por cima de um card retangular, cortado de forma errada pelo overflow:hidden do card. */
  border-radius: inherit;
  padding: 3px;
  background: conic-gradient(from 0deg, #ff5c5c, #ffe14d, #4dff88, #4dd2ff, #b84dff, #ff5c5c);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: nick-rainbow-spin 2.5s linear infinite;
}
@keyframes nick-rainbow-spin { to { transform: rotate(360deg); } }
.frame-ice { box-shadow: 0 0 0 3px #9be7ff, 0 0 14px #4dd2ff; }

.cape-neon-grid {
  background-image: linear-gradient(rgba(77,210,255,0.35) 1px, transparent 1px), linear-gradient(90deg, rgba(77,210,255,0.35) 1px, transparent 1px);
  background-size: 14px 14px;
  background-color: #0c1b2a;
}
.cape-holo {
  background: linear-gradient(120deg, #ff5c5c, #ffe14d, #4dff88, #4dd2ff, #b84dff);
  background-size: 300% 300%;
  animation: nick-rainbow-cycle-bg 4s ease infinite;
}
@keyframes nick-rainbow-cycle-bg { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.cape-aurora {
  background: linear-gradient(120deg, #0f2027, #2c5364, #00c9a7);
  background-size: 200% 200%;
  animation: nick-rainbow-cycle-bg 6s ease infinite;
}

.bg-aurora { background: linear-gradient(-45deg, #0f2027, #2c5364, #00c9a7, #6a3093); background-size: 300% 300%; animation: nick-rainbow-cycle-bg 8s ease infinite; }
.bg-cyberpunk {
  background: repeating-linear-gradient(0deg, rgba(255,0,200,0.08) 0 2px, transparent 2px 4px), linear-gradient(135deg, #1a0033, #001c33);
}
.bg-particles-lite {
  background-color: #0d0d1a;
  background-image: radial-gradient(#4dd2ff 1px, transparent 1px), radial-gradient(#b84dff 1px, transparent 1px);
  background-size: 22px 22px, 30px 30px;
  background-position: 0 0, 11px 15px;
}

.badge-star::before { content: '⭐'; }
.badge-flame::before { content: '🔥'; animation: nick-glow-pulse 1.2s ease-in-out infinite; }
.badge-crown-mini::before { content: '👑'; }

/* ---- efeitos visuais novos (rodada de melhorias) — mesmo critério: CSS 100% original ---- */
.cape-fire {
  background: linear-gradient(0deg, #ff4d00, #ff9d00 40%, #ffe14d 70%, #fff7c2);
  background-size: 100% 220%;
  animation: cape-fire-flicker 1.4s ease-in-out infinite;
}
@keyframes cape-fire-flicker { 0%, 100% { background-position: 0 0%; } 50% { background-position: 0 40%; } }

.cape-lightning { background: linear-gradient(160deg, #0a0f2b, #1a2456); position: relative; overflow: hidden; }
.cape-lightning::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(180,220,255,0.9), transparent 40%),
              radial-gradient(circle at 70% 60%, rgba(180,220,255,0.6), transparent 35%);
  animation: cape-lightning-flash 2.2s steps(1) infinite;
}
@keyframes cape-lightning-flash { 0%, 92%, 100% { opacity: 0; } 93%, 96% { opacity: 1; } }

.cape-smoke {
  background: linear-gradient(180deg, #2b2b33, #55555f);
  background-image: radial-gradient(rgba(255,255,255,0.12) 0%, transparent 60%), radial-gradient(rgba(255,255,255,0.08) 0%, transparent 55%);
  background-size: 60% 60%, 80% 80%;
  animation: cape-smoke-drift 6s ease-in-out infinite;
}
@keyframes cape-smoke-drift { 0%, 100% { background-position: 0% 100%, 100% 0%; } 50% { background-position: 30% 60%, 70% 40%; } }

.cape-matrix {
  background: #020a02;
  background-image: repeating-linear-gradient(0deg, rgba(0,255,110,0.5) 0 2px, transparent 2px 16px);
  background-size: 100% 32px;
  animation: cape-matrix-fall 1.1s linear infinite;
}
@keyframes cape-matrix-fall { from { background-position-y: 0; } to { background-position-y: 32px; } }

.bg-fire { background: linear-gradient(-45deg, #3a0a00, #ff4d00, #ffb700, #3a0a00); background-size: 300% 300%; animation: nick-rainbow-cycle-bg 3s ease infinite; }
.bg-energy { background: radial-gradient(circle at 50% 50%, #4dd2ff, #0a0f2b 70%); animation: bg-energy-pulse 2.4s ease-in-out infinite; }
@keyframes bg-energy-pulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.4); } }
.bg-frost { background: linear-gradient(135deg, #0a2536, #1c4f66, #9be7ff); background-size: 200% 200%; animation: nick-rainbow-cycle-bg 7s ease infinite; }

.frame-fire { box-shadow: 0 0 0 3px #ff7a00, 0 0 18px #ff4d00; animation: nick-glow-pulse 1s ease-in-out infinite; }
.frame-lightning { box-shadow: 0 0 0 3px #cfe8ff, 0 0 16px #4dd2ff; animation: frame-lightning-flash 2.2s steps(1) infinite; }
@keyframes frame-lightning-flash { 0%, 92%, 100% { box-shadow: 0 0 0 3px #cfe8ff, 0 0 16px #4dd2ff; } 93%, 96% { box-shadow: 0 0 0 4px #fff, 0 0 28px #a8dcff; } }

.badge-lightning::before { content: '⚡'; animation: nick-glow-pulse 1s ease-in-out infinite; }
.badge-diamond::before { content: '💎'; }

/* ---- leva de selos novos — ícones gamer/raros, sempre emoji (sem imagem/gif externo, mesmo
   critério de licença dos outros efeitos) + animações CSS variadas pra cada um ter uma
   "personalidade" diferente em vez de repetir sempre o mesmo pulse. ---- */
@keyframes badge-wiggle { 0%, 100% { transform: rotate(0deg); } 25% { transform: rotate(-10deg); } 75% { transform: rotate(10deg); } }
@keyframes badge-flicker { 0%, 100% { opacity: 1; } 46% { opacity: 1; } 50% { opacity: 0.2; } 54% { opacity: 1; } }
@keyframes badge-shake { 0%, 100% { transform: translateX(0) rotate(0deg); } 20% { transform: translateX(-2px) rotate(-4deg); } 40% { transform: translateX(2px) rotate(4deg); } 60% { transform: translateX(-2px) rotate(-2deg); } 80% { transform: translateX(2px); } }
@keyframes badge-launch { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-4px) rotate(-10deg); } }
@keyframes badge-hit { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.3); } }
@keyframes badge-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes badge-hue-cycle { to { filter: hue-rotate(360deg); } }
@keyframes badge-glitch { 0%, 100% { transform: translate(0, 0); } 20% { transform: translate(-1px, 1px); } 40% { transform: translate(1px, -1px); } 60% { transform: translate(-1px, -1px); } 80% { transform: translate(1px, 1px); } }

.badge-gamer::before { content: '🎮'; display: inline-block; animation: badge-wiggle 1.6s ease-in-out infinite; }
.badge-target::before { content: '🎯'; display: inline-block; animation: badge-hit 1.5s ease-in-out infinite; }
.badge-rocket::before { content: '🚀'; display: inline-block; animation: badge-launch 1.2s ease-in-out infinite; }
.badge-shield::before { content: '🛡️'; display: inline-block; filter: drop-shadow(0 0 4px #4dd2ff); animation: nick-glow-pulse 1.6s ease-in-out infinite; }
.badge-skull::before { content: '💀'; display: inline-block; animation: badge-shake 2.6s ease-in-out infinite; }
.badge-ninja::before { content: '🥷'; display: inline-block; animation: badge-flicker 2.4s ease-in-out infinite; }
.badge-alien::before { content: '👽'; display: inline-block; filter: drop-shadow(0 0 4px #4dff88); animation: badge-float 2.2s ease-in-out infinite; }
.badge-cyber::before { content: '🤖'; display: inline-block; animation: badge-glitch 2.4s steps(2) infinite; }
.badge-comet::before { content: '🌠'; display: inline-block; filter: drop-shadow(0 0 5px #cfe8ff); animation: nick-glow-pulse 1.3s ease-in-out infinite; }
.badge-dragon::before { content: '🐉'; display: inline-block; filter: drop-shadow(0 0 5px #ff5c1a); animation: nick-glow-pulse 1.4s ease-in-out infinite; }
.badge-joker::before { content: '🃏'; display: inline-block; animation: badge-hue-cycle 3s linear infinite; }
.badge-medal::before { content: '🏅'; display: inline-block; filter: drop-shadow(0 0 6px var(--gold)); animation: nick-glow-pulse 1.1s ease-in-out infinite; }

/* ---- mensagens privadas (PV) — duas colunas: conversas | conversa aberta. Em telas estreitas
   vira uma coluna só, alternando entre lista e conversa com o botão "←". ---- */
.dm-box { max-width: 780px; padding: 0; overflow: hidden; }
.dm-layout { display: flex; height: 480px; max-height: 70vh; }
.dm-conversations-pane { width: 260px; flex-shrink: 0; border-right: 1px solid var(--border); display: flex; flex-direction: column; background: var(--bg-tertiary); }
.dm-pane-header { padding: 14px 16px; font-weight: 700; }
.dm-conversations-list { flex: 1; overflow-y: auto; }
.dm-conversation-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; }
.dm-conversation-item .avatar-sm { width: 36px; height: 36px; font-size: 0.95rem; }
.dm-conversation-item:hover, .dm-conversation-item.active { background: var(--bg-hover); }
.dm-conv-name { font-weight: 600; font-size: 0.88rem; }
.dm-conv-preview { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.dm-conv-unread { margin-left: auto; background: var(--red); color: #fff; font-size: 0.7rem; border-radius: 999px; padding: 1px 7px; }
.dm-thread-pane { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.dm-thread-header { padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.dm-back-btn { display: none; padding: 4px 10px; }
.dm-thread-messages { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.dm-msg { max-width: 75%; padding: 8px 12px; border-radius: 12px; font-size: 0.88rem; background: var(--bg-secondary); align-self: flex-start; }
.dm-msg.mine { background: var(--accent); align-self: flex-end; }
.dm-msg-time { display: block; font-size: 0.65rem; color: rgba(255,255,255,0.6); margin-top: 3px; }
.dm-thread-form { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.dm-thread-form input { flex: 1; }
.admin-dm-messages { height: 320px; border: 1px solid var(--border); border-radius: 8px; padding: 10px; }

/* ---- tela de detalhe do usuário (admin) ---- */
.ud-summary { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
#ud-avatar { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; font-weight: 700; color: #fff; flex-shrink: 0; }
.ud-section { margin-bottom: 18px; }
.ud-section h3 { font-size: 0.85rem; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.ud-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.ud-row label { min-width: 200px; }

/* ---- mini-perfil ao passar o mouse (estilo Discord) ---- */
/* Sem overflow:hidden no container: isso já cortou nome comprido e o avatar (que sobe por cima
   da capa com margem negativa) em telas menores. O arredondado dos cantos fica só na capa
   (topo) — o corpo não tem fundo próprio, então não precisa de clipping pra ficar arredondado. */
.hover-mini-profile {
  position: fixed;
  width: 260px;
  max-width: calc(100vw - 16px);
  background: var(--bg-floating);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 60;
  pointer-events: none;
}
.hmp-cover { height: 54px; border-radius: 10px 10px 0 0; background: linear-gradient(135deg, var(--accent), #2b2d31); }
.hmp-avatar-wrap { position: relative; left: 14px; top: -26px; width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0; }
.hmp-avatar { width: 52px; height: 52px; font-size: 1.3rem; border: 3px solid var(--bg-floating); }
.hmp-body { padding: 0 14px 12px; margin-top: -18px; }
.hmp-name { font-weight: 700; margin-bottom: 6px; overflow-wrap: anywhere; word-break: break-word; }
.hmp-stats { display: flex; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.hmp-achievements { display: flex; gap: 6px; flex-wrap: wrap; font-size: 1.1rem; }

@media (max-width: 900px) {
  .member-list-panel { display: none; }
}
@media (max-width: 700px) {
  /* Servidor + canais viram uma gaveta que desliza por cima do conteúdo (igual Discord mobile)
     em vez de espremer numa coluna fixa de 200px — era isso que cortava nick/elo/selo, porque
     avatar + 4 botões não cabiam de jeito nenhum num espaço tão estreito. O conteúdo principal
     (chat/sala de voz) agora ocupa a tela toda por padrão; abre a gaveta pelo ☰. Nada disso muda
     o comportamento em telas largas — só existe dentro deste media query. */
  .server-rail, .channel-sidebar {
    position: fixed;
    top: 0;
    height: 100vh;
    z-index: 40;
    transition: transform .2s ease;
  }
  .server-rail { left: 0; width: 60px; transform: translateX(-100%); }
  .channel-sidebar { left: 60px; width: calc(100vw - 60px) !important; max-width: 300px; transform: translateX(-120%); }
  .app.mobile-nav-open .server-rail, .app.mobile-nav-open .channel-sidebar { transform: translateX(0); }
  .sidebar-resize-handle { display: none; } /* redimensionar não faz sentido numa gaveta que já ocupa a largura disponível */
  .mobile-nav-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 6px; background: transparent; color: var(--text-normal); font-size: 1.2rem; flex-shrink: 0;
  }
  .mobile-nav-toggle:hover { background: var(--bg-hover); }
  .mobile-nav-backdrop {
    display: none;
    position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 39;
  }
  .app.mobile-nav-open .mobile-nav-backdrop { display: block; }

  .stage-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .settings-menu { width: 190px; }
  .shop-fab { bottom: 14px; right: 14px; width: 46px; height: 46px; font-size: 1.2rem; }
  .profile-box { max-width: 100%; }
  .dm-box { max-width: 100%; }
  .dm-layout { height: 78vh; max-height: none; }
  .dm-conversations-pane { width: 100%; border-right: none; }
  .dm-thread-pane { display: none; }
  .dm-layout.dm-mobile-thread-open .dm-conversations-pane { display: none; }
  .dm-layout.dm-mobile-thread-open .dm-thread-pane { display: flex; }
  .dm-back-btn { display: inline-block; }
  .hover-mini-profile { display: none; }
  .ud-row label { min-width: 100%; }
}
