/* =========================================================================
   RESPONSIVIDADE — VoidMu
   Carregado por ÚLTIMO via <link> no layout (depois de root.css/bootstrap),
   então vence empates de especificidade naturalmente.
   Estratégia: o CSS base é desktop-first; aqui ficam os overrides mobile/tablet.
   Breakpoints: 1024 (tablet paisagem) · 820 (tablet retrato/mobile) · 520 · 420.
   ========================================================================= */

/* ============================ MENU MOBILE (hambúrguer + drawer) ============================ */
/* Botão hambúrguer mora no TopBar; oculto no desktop, aparece <= 820px. */
.voidmu-mobile-nav-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-right: 2px;
  border: 1px solid var(--border-soft, rgba(255, 255, 255, 0.14));
  border-radius: 9px;
  background: transparent;
  color: var(--text-primary, #e4e4e7);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}
.voidmu-mobile-nav-btn:hover {
  color: var(--voidmu-accent);
  border-color: rgba(10, 194, 151, 0.45);
  background: rgba(10, 194, 151, 0.1);
}

/* Botão "Minha Conta" no TopBar (direita) — abre o drawer de conta pela direita */
.voidmu-mobile-acc-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(183, 154, 102, 0.3);
  border-radius: 9px;
  background: transparent;
  color: var(--text-primary, #e4e4e7);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}
.voidmu-mobile-acc-btn:hover {
  color: var(--voidmu-accent);
  border-color: rgba(10, 194, 151, 0.45);
  background: rgba(10, 194, 151, 0.1);
}

.voidmu-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
  z-index: 4000;
}
.voidmu-drawer-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.voidmu-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(86vw, 330px);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #13161e 0%, #0e0e0e 100%);
  border-right: 1px solid var(--border-soft, rgba(255, 255, 255, 0.08));
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
  transform: translateX(-100%);
  transition: transform 260ms cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 4001;
  overflow-y: auto;
}
.voidmu-drawer.is-open {
  transform: translateX(0);
}
html:not(.dark) .voidmu-drawer {
  background: #ffffff;
}

/* Variante DIREITA — drawer de conta/login, separado da navegação */
.voidmu-drawer--right {
  left: auto;
  right: 0;
  border-right: none;
  border-left: 1px solid var(--border-soft, rgba(255, 255, 255, 0.08));
  transform: translateX(100%);
}
.voidmu-drawer--right.is-open {
  transform: translateX(0);
}
.voidmu-drawer--right .voidmu-drawer-account {
  margin-top: 0;
  border-top: none;
}

.voidmu-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border-soft, rgba(255, 255, 255, 0.08));
  position: sticky;
  top: 0;
  background: inherit;
  z-index: 1;
}
.voidmu-drawer-brand {
  font-family: var(--voidmu-font-heading, "Montserrat", sans-serif);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.12em;
  color: var(--text-primary);
}
.voidmu-drawer-brand span {
  color: var(--voidmu-accent);
}
.voidmu-drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--border-soft, rgba(255, 255, 255, 0.1));
  color: var(--text-secondary);
  cursor: pointer;
}
.voidmu-drawer-close:hover {
  color: var(--voidmu-accent);
  border-color: rgba(10, 194, 151, 0.45);
}

.voidmu-drawer-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px;
  flex: 1;
}
.voidmu-drawer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  color: var(--text-secondary);
  font-family: var(--voidmu-font-body, "Montserrat", sans-serif);
  font-size: 15px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}
.voidmu-drawer-item-label {
  flex: 1;
}
.voidmu-drawer-item-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(10, 194, 151, 0.16), rgba(10, 194, 151, 0.04));
  border: 1px solid rgba(10, 194, 151, 0.28);
  color: var(--voidmu-accent);
}
.voidmu-drawer-item-ico svg {
  width: 18px;
  height: 18px;
}
html:not(.dark) .voidmu-drawer-item-ico {
  color: var(--voidmu-primary);
}
.voidmu-drawer-item-chev {
  color: var(--text-secondary);
  opacity: 0.4;
  flex-shrink: 0;
}
.voidmu-drawer-item:hover,
.voidmu-drawer-item:active {
  background: rgba(10, 194, 151, 0.1);
  color: var(--text-primary);
  border-color: rgba(10, 194, 151, 0.3);
}
.voidmu-drawer-item.is-active {
  background: linear-gradient(135deg, rgba(10, 194, 151, 0.22), rgba(10, 194, 151, 0.08));
  color: var(--text-primary);
  border-color: rgba(10, 194, 151, 0.45);
}
.voidmu-drawer-item.is-active .voidmu-drawer-item-chev {
  opacity: 1;
  color: var(--voidmu-accent);
}

/* Painel de conta/login dentro do drawer */
.voidmu-drawer-account {
  padding: 10px;
  margin-top: auto;
  border-top: 1px solid var(--border-soft, rgba(255, 255, 255, 0.08));
}
.voidmu-drawer-account .voidmu-account-card {
  margin: 0;
  width: 100%;
}

/* Seções "Informações" e "Equipe" no menu (accordion = botão que expande) */
.voidmu-drawer-extras {
  padding: 0 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.voidmu-drawer-acc {
  border: 1px solid var(--border-soft, rgba(255, 255, 255, 0.08));
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}
.voidmu-drawer-acc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  cursor: pointer;
  list-style: none;
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 600;
  user-select: none;
}
.voidmu-drawer-acc-head::-webkit-details-marker { display: none; }
.voidmu-drawer-acc-ico { color: var(--voidmu-accent); flex-shrink: 0; }
html:not(.dark) .voidmu-drawer-acc-ico { color: var(--voidmu-primary); }
.voidmu-drawer-acc-label { flex: 1; }
.voidmu-drawer-acc-count {
  font-size: 11px;
  font-weight: 700;
  background: rgba(10, 194, 151, 0.16);
  border: 1px solid rgba(10, 194, 151, 0.3);
  color: var(--voidmu-accent);
  border-radius: 999px;
  padding: 1px 8px;
}
.voidmu-drawer-acc-chev { color: var(--text-secondary); transition: transform 200ms ease; flex-shrink: 0; }
.voidmu-drawer-acc[open] .voidmu-drawer-acc-chev { transform: rotate(180deg); }
.voidmu-drawer-acc-body {
  padding: 2px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.voidmu-drawer-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  font-size: 12.5px;
  border-bottom: 1px solid var(--border-soft, rgba(255, 255, 255, 0.05));
}
.voidmu-drawer-stat:last-child { border-bottom: none; }
.voidmu-drawer-stat span { color: var(--text-secondary); }
.voidmu-drawer-stat strong { color: var(--text-primary); font-weight: 700; }
.voidmu-drawer-staff {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 12.5px;
}
.voidmu-drawer-staff-dot { width: 7px; height: 7px; border-radius: 50%; background: #6b7280; flex-shrink: 0; }
.voidmu-drawer-staff-dot.is-online { background: #22c55e; box-shadow: 0 0 7px #22c55e; }
.voidmu-drawer-staff-name { flex: 1; color: var(--text-primary); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voidmu-drawer-staff-role { color: var(--text-secondary); font-size: 11px; white-space: nowrap; }

/* Wrapper dos Eventos na sidebar — transparente no layout (não vira item flex extra). */
.voidmu-sidebar-events { display: contents; }

/* ============================ TABLET PAISAGEM (<= 1024px) ============================ */
@media (max-width: 1024px) {
  .voidmu-nav-pill {
    margin-left: 12px;
    margin-right: 12px;
  }
}

/* ============================ TABLET RETRATO + MOBILE (<= 820px) ============================ */
@media (max-width: 820px) {
  /* Navegação: troca a pill pelo menu hambúrguer */
  .voidmu-mobile-nav-btn,
  .voidmu-mobile-acc-btn {
    display: inline-flex;
  }
  .voidmu-nav-pill {
    display: none;
  }

  /* Abas Notícias/Patch Notes: no mobile o header quebra e as abas ocupam a
     linha inteira (horizontais lado a lado), com "Ver mais" embaixo à direita. */
  .voidmu-card-header:has(.voidmu-news-tabs) {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .voidmu-card-header:has(.voidmu-news-tabs) .voidmu-card-title {
    flex: 1 1 100%;
  }
  .voidmu-card-header:has(.voidmu-news-tabs) .voidmu-card-actions {
    margin-left: auto;
  }
  .voidmu-news-tabs {
    flex-wrap: nowrap;
    width: 100%;
  }
  .voidmu-news-tab {
    flex: 1 1 0;
    text-align: center;
    font-size: 12px;
    padding: 7px 8px;
    letter-spacing: 0.06em;
  }

  /* Layout de 2 colunas vira 1 coluna. As classes .flex-row/.content são do
     Bootstrap (com !important), por isso mantemos !important aqui também.
     Conteúdo primeiro (order:1), sidebar embaixo (order:2). */
  .content .flex.flex-row {
    flex-direction: column !important;
  }
  .voidmu-sidebar {
    width: 100% !important;
    order: 2;
  }
  /* Login, Informações e Equipe migram pro menu hambúrguer — somem da coluna lateral */
  .voidmu-sidebar > .voidmu-account-card,
  .voidmu-sidebar > .voidmu-info-card-stats,
  .voidmu-sidebar > .voidmu-sidebar-card:has(.voidmu-sidebar-staff-list) {
    display: none;
  }
  /* Eventos: no mobile aparecem SÓ na home (no desktop ficam em todas as páginas) */
  .voidmu-sidebar-events:not(.is-home) {
    display: none;
  }
  .content .flex.flex-row > .ajax-container,
  .content .ajax-container {
    order: 1;
    width: 100% !important;
  }

  /* Respiro lateral consistente */
  .wrap {
    padding-left: 14px;
    padding-right: 14px;
  }
  .content.p-3 {
    padding: 10px !important;
  }

  /* Hero compacto — sem a altura mínima gigante que empurra o conteúdo */
  .voidmu-hero,
  .voidmu-hero-inner {
    min-height: 0;
  }
  .voidmu-hero-inner {
    padding-top: 16px;
    padding-bottom: 26px;
  }
  .voidmu-logo {
    max-width: 66vw;
    height: auto;
  }

  /* TopBar: prioriza o menu (hambúrguer) e o idioma; esconde o secundário
     (a marca "VOIDMU" já está implícita, e as redes ficam no rodapé). */
  .voidmu-topbar-version {
    display: none;
  }
  .voidmu-topbar-socials {
    display: none;
  }
  .voidmu-topbar-inner {
    gap: 8px;
    padding-left: 10px;
    padding-right: 10px;
  }
  .voidmu-topbar-left,
  .voidmu-topbar-right {
    gap: 10px;
  }

  /* Tabelas largas rolam em vez de estourar/espremer */
  .voidmu-profile-table-wrap,
  .table-responsive,
  .voidmu-guides-content-html {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Alvos de toque confortáveis (>= 40px) nos controles principais */
  .voidmu-pill-btn,
  .voidmu-plan-buy,
  .voidmu-admin-btn,
  .voidmu-account-menu-item {
    min-height: 40px;
  }
}

/* ============================ NOTÍCIAS — master-detail (<= 920px) ============================ */
/* Em vez de empilhar lista + post (uma coisa embaixo da outra), mostra UMA view
   por vez: na lista (/post) só a lista; abrindo um post, só o post (com "Voltar"). */
@media (max-width: 920px) {
  .voidmu-news-center.has-post .voidmu-news-center-side {
    display: none;
  }
  .voidmu-news-center.no-post .voidmu-news-center-main {
    display: none;
  }
  /* a lista deixa de ser sticky/limitada à tela — rola junto com a página */
  .voidmu-news-center-side {
    position: static;
    max-height: none;
  }
}

/* ============================ ABAS DO RANKING — rolar na horizontal (<= 700px) ============================ */
/* Em vez de quebrar em várias linhas (RESETS, GUILD, MASTER RESET, ...), vira
   uma faixa rolável na horizontal. */
@media (max-width: 700px) {
  .voidmu-rank-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }
  .voidmu-rank-tabs::-webkit-scrollbar { display: none; }
  .voidmu-rank-tab {
    flex-shrink: 0;
    white-space: nowrap;
  }
}

/* ============================ FOOTER — horizontal (2 colunas) no mobile (<= 600px) ============================ */
@media (max-width: 600px) {
  .voidmu-footer .voidmu-footer-grid,
  .voidmu-footer-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 18px 14px;
    padding: 18px 16px 24px;
  }
  .voidmu-footer-col { text-align: left; }
}

/* ============================ NOTÍCIAS (home) — não cortar os títulos (<= 600px) ============================ */
/* Desktop: [badge 110px | título | meta] numa linha, título com ellipsis.
   Mobile: badge à esquerda; título ganha a largura toda (até 2 linhas);
   autor/data descem pra uma segunda linha. */
@media (max-width: 600px) {
  .voidmu-news-row {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 11px;
    row-gap: 4px;
    padding: 12px 14px;
  }
  .voidmu-news-badge {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: center;
  }
  .voidmu-news-row-text {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }
  .voidmu-news-row-title {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.25;
  }
  .voidmu-news-row-meta {
    grid-column: 2;
    grid-row: 2;
    justify-content: flex-start;
    gap: 12px;
    flex-wrap: wrap;
  }
}

/* ============================ RANKINGS (/rankings) — formato de LISTA no mobile (<= 600px) ============================ */
/* Em vez de cards grandes empilhados (1 por linha com imagem enorme), vira uma
   lista compacta: [posição] [avatar pequeno] [nome .......] [pontos]. */
@media (max-width: 600px) {
  .voidmu-rank-grid-lg {
    grid-template-columns: 1fr !important;
    gap: 8px;
    padding: 12px;
  }
  .voidmu-rank-card-lg {
    flex-direction: row;
    align-items: center;
    gap: 11px;
    padding: 8px 12px;
    text-align: left;
  }
  .voidmu-rank-card-lg:hover {
    transform: none;
  }
  .voidmu-rank-card-tag {
    flex-shrink: 0;
  }
  .voidmu-rank-card-portrait-lg {
    width: 44px;
    height: 44px;
    aspect-ratio: 1;
    flex-shrink: 0;
    border-radius: 8px;
  }
  .voidmu-rank-card-name-lg {
    flex: 1;
    min-width: 0;
    text-align: left;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .voidmu-rank-card-score-lg {
    flex-shrink: 0;
    font-size: 16px;
  }
  /* detalhes/hover não fazem sentido na lista do mobile */
  .voidmu-rank-card-sub,
  .voidmu-rank-card-tooltip {
    display: none;
  }
}

/* ============================ DOWNLOADS — tabela vira cards no mobile (<= 600px) ============================ */
/* A tabela [Nome | Descrição | Tamanho | Baixar] não cabe no celular (estourava
   e cortava colunas). Vira um card empilhado por arquivo. */
@media (max-width: 600px) {
  .voidmu-dl-table-wrap {
    margin: 0 12px 18px;
  }
  .voidmu-dl-table thead {
    display: none;
  }
  .voidmu-dl-table,
  .voidmu-dl-table tbody {
    display: block;
    width: 100%;
  }
  .voidmu-dl-table tbody tr {
    display: block;
    padding: 12px 14px;
  }
  .voidmu-dl-table td {
    display: block;
    padding: 2px 0;
    border: none;
  }
  .voidmu-dl-table td.col-name {
    font-size: 14.5px;
  }
  .voidmu-dl-table td.col-desc {
    font-size: 13px;
    line-height: 1.4;
  }
  .voidmu-dl-table td.col-size {
    font-size: 13px;
    margin-top: 3px;
  }
  .voidmu-dl-table td.col-size::before {
    content: "Tamanho: ";
    color: var(--text-secondary);
    font-weight: 600;
  }
  .voidmu-dl-table td:last-child {
    margin-top: 10px;
  }
  .voidmu-dl-table td:last-child .voidmu-dl-action {
    display: flex;
    width: 100%;
    justify-content: center;
    padding: 10px;
  }
}

/* ============================ GUIAS (/guides) — header e árvore no mobile (<= 600px) ============================ */
@media (max-width: 600px) {
  /* O header tem muitos controles (Voltar, Guias, Categorias, contador, Gerenciar)
     e estourava. Empilha título e ações, e deixa as ações quebrarem. */
  .voidmu-guides-card .voidmu-card-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
  }
  .voidmu-guides-card .voidmu-card-actions {
    flex-wrap: wrap;
    gap: 6px;
  }
  /* árvore de categorias um pouco mais compacta */
  .voidmu-guides-tree {
    padding: 10px 8px 14px;
  }
  .voidmu-guides-content {
    padding: 16px 14px 20px;
  }
}

/* ============================ MEUS PERSONAGENS (/characters) — lista no mobile (<= 600px) ============================ */
/* O badge de classe (ex: "Magic Gladiator") é largo e espremia o nome. Vira um
   grid: [avatar] [nome em cima + classe pequena embaixo] [nível]. */
@media (max-width: 600px) {
  .voidmu-char-grid {
    grid-template-columns: 1fr !important;
    gap: 8px;
    padding: 12px;
  }
  .voidmu-char-card.voidmu-rank-card-lg {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "avatar name score"
      "avatar class score";
    align-items: center;
    column-gap: 11px;
    row-gap: 0;
    padding: 8px 12px;
    text-align: left;
  }
  .voidmu-char-card .voidmu-rank-card-portrait-lg {
    grid-area: avatar;
    align-self: center;
    width: 46px;
    height: 46px;
    aspect-ratio: 1;
  }
  .voidmu-char-card .voidmu-rank-card-name-lg {
    grid-area: name;
    align-self: end;
    text-align: left;
    font-size: 13.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }
  .voidmu-char-card .voidmu-rank-card-tag {
    grid-area: class;
    justify-self: start;
    align-self: start;
    margin-top: 2px;
    max-width: 100%;
    font-size: 8px;
    padding: 2px 7px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .voidmu-char-card .voidmu-rank-card-score-lg {
    grid-area: score;
    align-self: center;
    font-size: 15px;
    white-space: nowrap;
  }
}

/* ============================ ABAS NO CARD-HEADER (VIP, Pagamento...) — empilhar no mobile (<= 600px) ============================ */
/* Cabeçalhos com abas (.voidmu-tabs: Resumo/Pagamento/Comprar) quebravam feio.
   Empilha título + abas, e as abas viram uma faixa rolável. */
@media (max-width: 600px) {
  .voidmu-card-header:has(.voidmu-tabs) {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .voidmu-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .voidmu-tabs::-webkit-scrollbar {
    display: none;
  }
  .voidmu-tab {
    flex-shrink: 0;
    white-space: nowrap;
  }
}

/* ============================ "Voltar ao topo" x carrossel de vídeos ============================ */
/* O carrossel de vídeos (.voidmu-video-dock) ocupa o canto inferior DIREITO no
   desktop (some em <= 860px). O botão "voltar ao topo" continua na DIREITA, mas
   sobe pra ficar ACIMA do carrossel — empilhados, sem um cobrir o outro. */
@media (min-width: 861px) {
  .voidmu-app:has(.voidmu-video-dock) .voidmu-back-to-top {
    bottom: 168px;
  }
}

/* ============================ MOBILE PEQUENO (<= 520px) ============================ */
@media (max-width: 520px) {
  .wrap {
    padding-left: 11px;
    padding-right: 11px;
  }
  .voidmu-drawer {
    width: min(92vw, 320px);
  }
}

/* Telas bem estreitas: status do servidor compacto pra não competir com o idioma */
@media (max-width: 420px) {
  .voidmu-topbar-status {
    font-size: 11px;
  }
}
