/* NyxCMS 2.1 — Accent Runtime v2.1
   SOLO unifica color de identidad. No toca superficies, tamaños, bordes,
   tipografía, tooltips, rarezas ni colores semánticos. */

.wm-module-content[data-module],
.wm-module-content[data-submodule]{
  --wm-primary:var(--wm-module-accent,var(--wm-accent))!important;
  --theme-color:var(--wm-module-accent,var(--wm-accent))!important;
  --theme-primary:var(--wm-module-accent,var(--wm-accent))!important;
  --theme-primary-color:var(--wm-module-accent,var(--wm-accent))!important;
  --primary-color:var(--wm-module-accent,var(--wm-accent))!important;
  --accent-color:var(--wm-module-accent,var(--wm-accent))!important;
  --tg-theme-primary:var(--wm-module-accent,var(--wm-accent))!important;

  --wm-module-accent-hover:var(--wm-accent-hover,color-mix(in srgb,var(--wm-module-accent,var(--wm-accent)) 78%,#fff 22%))!important;
  --wm-module-accent-gradient:linear-gradient(135deg,color-mix(in srgb,var(--wm-module-accent,var(--wm-accent)) 78%,#000 22%) 0%,var(--wm-module-accent,var(--wm-accent)) 58%,var(--wm-module-accent-hover) 100%)!important;
}

/* Variables de marca históricas de los módulos. Se unifican únicamente
   en sus raíces; success/danger/warning/info permanecen independientes. */
:where(
  .mi-account-pro,.wm-mp-pro,.wm-cn-pro,.wm-profile-pro,
  .wm-register-pro,.wm-login-pro,.wm-recovery-pro,
  .wm-auth-page,.wm-account-page,.wm-jbank-page,.wm-castle-page,
  .wm-downloads-page,.wm-events-page,.wm-info-kb,.wm-items-diag,
  .wm-imarket-page,.wm-market-page,.wm-support-page,.wm-ref-page,
  .wm-puser-action-page,.wm-service-grid,.wm-service-box,
  .wm-ranking-module,.wm-ranking-shell,.wm-donate-only,.donaciones-checkout,
  .wm-news-page,.wm-webshop,.wm-discount-shop
){
  --mi-accent:var(--wm-module-accent,var(--wm-accent))!important;
  --mi-primary:var(--wm-module-accent,var(--wm-accent))!important;
  --mp-accent:var(--wm-module-accent,var(--wm-accent))!important;
  --mp-purple:var(--wm-module-accent,var(--wm-accent))!important;
  --wm-mp-accent:var(--wm-module-accent,var(--wm-accent))!important;
  --pf-accent:var(--wm-module-accent,var(--wm-accent))!important;
  --pf-accent-2:var(--wm-module-accent,var(--wm-accent))!important;
  --cn-accent:var(--wm-module-accent,var(--wm-accent))!important;
  --reg-accent:var(--wm-module-accent,var(--wm-accent))!important;
  --login-accent:var(--wm-module-accent,var(--wm-accent))!important;
  --recovery-accent:var(--wm-module-accent,var(--wm-accent))!important;
  --wm-auth-accent:var(--wm-module-accent,var(--wm-accent))!important;
  --wm-account-accent:var(--wm-module-accent,var(--wm-accent))!important;
  --wm-market-accent:var(--wm-module-accent,var(--wm-accent))!important;
  --wm-market-accent-2:var(--wm-module-accent,var(--wm-accent))!important;
  --wm-market-popup-accent:var(--wm-module-accent,var(--wm-accent))!important;
  --wm-imarket-accent:var(--wm-module-accent,var(--wm-accent))!important;
  --im-accent:var(--wm-module-accent,var(--wm-accent))!important;
  --mi23-accent:var(--wm-module-accent,var(--wm-accent))!important;
  --mi24-accent:var(--wm-module-accent,var(--wm-accent))!important;
  --imarket47-accent:var(--wm-module-accent,var(--wm-accent))!important;
  --ds-accent:var(--wm-module-accent,var(--wm-accent))!important;
  --ws-accent:var(--wm-module-accent,var(--wm-accent))!important;
  --wm-jbank-primary:var(--wm-module-accent,var(--wm-accent))!important;
  --wm-jbank-popup-accent:var(--wm-module-accent,var(--wm-accent))!important;
  --cs-accent:var(--wm-module-accent,var(--wm-accent))!important;
  --wm-downloads-accent:var(--wm-module-accent,var(--wm-accent))!important;
  --dl-accent:var(--wm-module-accent,var(--wm-accent))!important;
  --events-accent:var(--wm-module-accent,var(--wm-accent))!important;
  --wm-info-accent:var(--wm-module-accent,var(--wm-accent))!important;
  --wm-items-accent:var(--wm-module-accent,var(--wm-accent))!important;
  --wm-news-primary:var(--wm-module-accent,var(--wm-accent))!important;
  --wm-news-secondary:var(--wm-module-accent,var(--wm-accent))!important;
  --wm-ref-accent:var(--wm-module-accent,var(--wm-accent))!important;
  --wm-sup-accent:var(--wm-module-accent,var(--wm-accent))!important;
  --wm-service-accent:var(--wm-module-accent,var(--wm-accent))!important;
  --wm-don-accent:var(--wm-module-accent,var(--wm-accent))!important;
  --dn-accent:var(--wm-module-accent,var(--wm-accent))!important;
  --dck-accent:var(--wm-module-accent,var(--wm-accent))!important;
  --rk-primary:var(--wm-module-accent,var(--wm-accent))!important;
  --wm-ranking-accent:var(--wm-module-accent,var(--wm-accent))!important;
  --wm-us-blue:var(--wm-module-accent,var(--wm-accent))!important;
  --primary:var(--wm-module-accent,var(--wm-accent))!important;
  --mi-accent-gradient:var(--wm-module-accent-gradient)!important;
  --mp-accent-gradient:var(--wm-module-accent-gradient)!important;
  --cn-accent-gradient:var(--wm-module-accent-gradient)!important;
  --pf-accent-gradient:var(--wm-module-accent-gradient)!important;
  --wm-market-accent-gradient:var(--wm-module-accent-gradient)!important;
  --wm-jbank-accent-gradient:var(--wm-module-accent-gradient)!important;
  --wm-ranking-accent-gradient:var(--wm-module-accent-gradient)!important;
}


/* 2.2.0 — Identidad visual: el color llamativo siempre sale del theme,
   y los controles principales usan el mismo gradiente. */
.wm-module-content .wm-mp-tabs button.is-active,
.wm-module-content .wm-cn-tabs a.is-active,
.wm-module-content .wm-cn-btn.is-primary,
.wm-module-content .wm-profile-modal__tabs button.is-active,
.wm-module-content .wm-events-filters button.is-active{
  background:var(--wm-module-accent-gradient)!important;
  border-color:color-mix(in srgb,var(--wm-module-accent) 78%,var(--wm-border,transparent))!important;
  color:var(--wm-module-accent-text,var(--wm-accent-text,#fff))!important;
  box-shadow:0 7px 18px color-mix(in srgb,var(--wm-module-accent) 18%,transparent)!important;
}

/* ======================================================================
   NyxCMS 2.2 — ANCHO ÚNICO PARA PÁGINAS DE MÓDULOS
   ----------------------------------------------------------------------
   Decisión: 1240px en escritorio para TODOS los themes.
   - Evita que Dark Latius / Dark Forge / Emerald ensanchen algunos módulos
     a 1480, 1520, 1540 o 1660px.
   - Mantiene responsive: nunca supera el espacio disponible.
   - No cambia el ancho de Home, footer ni ventanas modales.
   ====================================================================== */
:root{
  --wm-public-module-width:1240px;
}

/* Contrato interno: cualquier módulo público queda centrado y nunca puede
   ensanchar el shell que lo contiene. */
.wm-module-content[data-module],
.wm-module-content[data-submodule]{
  width:100%!important;
  max-width:var(--wm-public-module-width)!important;
  min-width:0!important;
  margin-left:auto!important;
  margin-right:auto!important;
}
.wm-module-content[data-module] > *,
.wm-module-content[data-submodule] > *{
  max-width:100%!important;
  min-width:0!important;
}

/* Dark Latius. Sobrescribe explícitamente el hack v1.0.23 de 1520px. */
body[data-wm-theme="dark_latius"] .dl-module-shell,
body[data-wm-theme="dark_latius"] .dl-module-page--mis_personajes .dl-module-shell--gameco-clean{
  width:min(var(--wm-public-module-width),calc(100% - 40px))!important;
  max-width:var(--wm-public-module-width)!important;
  margin-left:auto!important;
  margin-right:auto!important;
}
body[data-wm-theme="dark_latius"] .dl-module-page--mis_personajes .dl-module-card--gameco-clean,
body[data-wm-theme="dark_latius"] .dl-module-card,
body[data-wm-theme="dark_latius"] .dl-module-full,
body[data-wm-theme="dark_latius"] .wm-page-content{
  max-width:100%!important;
  min-width:0!important;
}

/* Dark Forge. El theme tenía varias generaciones de 1380/1460/1520/1540
   y finalmente una variable que podía llegar a 1660px. Todas convergen aquí. */
body[data-wm-theme="dark_forge"]{
  --wm-gameco-content-width:min(var(--wm-public-module-width),calc(100% - 32px))!important;
}
body[data-wm-theme="dark_forge"] .gc-gameco-page--module .container,
body[data-wm-theme="dark_forge"] .gc-gameco-page--module-clean .container,
body[data-wm-theme="dark_forge"] .gc-module-section > .container,
body[data-wm-theme="dark_forge"] .gc-module-section .container,
body[data-wm-theme="dark_forge"] .gc-module-breadcrumb .container,
body[data-wm-theme="dark_forge"] .gc-module-breadcrumb > .section-pt{
  width:min(var(--wm-public-module-width),calc(100% - 32px))!important;
  max-width:var(--wm-public-module-width)!important;
  margin-left:auto!important;
  margin-right:auto!important;
}
body[data-wm-theme="dark_forge"] .gc-module-content-card,
body[data-wm-theme="dark_forge"] .wm-page-layout,
body[data-wm-theme="dark_forge"] .wm-page-content{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
}

/* Emerald Siege. Quita la excepción de Mis Personajes a 1480px y el PUser
   de 1420px; module y puser comparten el mismo ancho. */
body[data-wm-theme="emerald_siege"] .wm-page-shell,
body[data-wm-theme="emerald_siege"] .wm-page-shell-module,
body[data-wm-theme="emerald_siege"] .wm-page-shell-puser,
body[data-wm-theme="emerald_siege"] .wm-page-shell:has(.wm-mis-personajes),
body[data-wm-theme="emerald_siege"] .wm-page-shell-puser:has(.wm-mis-personajes),
body[data-wm-theme="emerald_siege"] .wm-account-page:has(.wm-mis-personajes){
  width:min(var(--wm-public-module-width),calc(100% - 32px))!important;
  max-width:var(--wm-public-module-width)!important;
  margin-left:auto!important;
  margin-right:auto!important;
}
body[data-wm-theme="emerald_siege"] .wm-mis-personajes,
body[data-wm-theme="emerald_siege"] .wm-account-page{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
}

/* Default: module y puser dejan de alternar entre 1280/1380/1420/1460. */
body[data-wm-theme="default"] .wm-default-shell,
body[data-wm-theme="default"] .wm-default-shell--module,
body[data-wm-theme="default"] .wm-default-shell--puser{
  width:min(var(--wm-public-module-width),calc(100% - 32px))!important;
  max-width:var(--wm-public-module-width)!important;
  margin-left:auto!important;
  margin-right:auto!important;
}

/* Base NyxCMS: misma regla, incluidas las antiguas fases PUser. */
body[data-wm-theme="nyxcms_base"] .wm-base-shell,
body[data-wm-theme="nyxcms_base"] .wm-base-shell--module,
body[data-wm-theme="nyxcms_base"] .wm-base-shell--puser{
  width:min(var(--wm-public-module-width),calc(100% - 32px))!important;
  max-width:var(--wm-public-module-width)!important;
  margin-left:auto!important;
  margin-right:auto!important;
}

/* Lineage. */
body[data-wm-theme="lineage"] .wm-lineage-module-shell{
  width:min(var(--wm-public-module-width),calc(100% - 36px))!important;
  max-width:var(--wm-public-module-width)!important;
  margin-left:auto!important;
  margin-right:auto!important;
}
body[data-wm-theme="lineage"] .wm-lineage-module-frame{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
}

/* MUMAD. Su grid original usa 1280px; sólo las páginas de módulos bajan al
   contrato común, sin alterar el Home. */
body[data-wm-theme="mumad"] .mumad-module-page{
  --content:var(--wm-public-module-width)!important;
}
body[data-wm-theme="mumad"] .mumad-module-page__shell{
  width:100%!important;
  max-width:var(--wm-public-module-width)!important;
  min-width:0!important;
  justify-self:center!important;
  margin-left:auto!important;
  margin-right:auto!important;
}

/* Protecciones específicas de la familia de cuenta/personajes. */
.wm-mp-pro,
.wm-cn-pro,
.mi-account-pro,
.wm-profile-pro{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
}

/* Responsive común: el ancho fijo desaparece limpiamente sin provocar
   scroll horizontal ni dobles márgenes. */
@media(max-width:1280px){
  .wm-module-content[data-module],
  .wm-module-content[data-submodule]{max-width:100%!important;}
}
@media(max-width:760px){
  body[data-wm-theme="dark_latius"] .dl-module-shell,
  body[data-wm-theme="dark_latius"] .dl-module-page--mis_personajes .dl-module-shell--gameco-clean{
    width:calc(100% - 24px)!important;
    max-width:none!important;
  }
  body[data-wm-theme="dark_forge"] .gc-gameco-page--module .container,
  body[data-wm-theme="dark_forge"] .gc-gameco-page--module-clean .container,
  body[data-wm-theme="dark_forge"] .gc-module-section > .container,
  body[data-wm-theme="dark_forge"] .gc-module-section .container,
  body[data-wm-theme="dark_forge"] .gc-module-breadcrumb .container,
  body[data-wm-theme="dark_forge"] .gc-module-breadcrumb > .section-pt,
  body[data-wm-theme="emerald_siege"] .wm-page-shell,
  body[data-wm-theme="emerald_siege"] .wm-page-shell-module,
  body[data-wm-theme="emerald_siege"] .wm-page-shell-puser,
  body[data-wm-theme="default"] .wm-default-shell,
  body[data-wm-theme="default"] .wm-default-shell--module,
  body[data-wm-theme="default"] .wm-default-shell--puser,
  body[data-wm-theme="nyxcms_base"] .wm-base-shell,
  body[data-wm-theme="nyxcms_base"] .wm-base-shell--module,
  body[data-wm-theme="nyxcms_base"] .wm-base-shell--puser,
  body[data-wm-theme="lineage"] .wm-lineage-module-shell{
    width:calc(100% - 24px)!important;
    max-width:none!important;
  }
}
