/* LAYOUT LOCK — autoridade final do shell Baiak.
   Neutraliza HUD/party legado, unifica tokens e evita flash/duplicação. */

:root{
  --bi-top:58px;
  --bi-left:218px;
  --bi-right:270px;
  --bi-gap:9px;
  --bi-stage:0px;
  --bi-bottom:158px;
  --bi-gold:#d8a62e;
  --bi-gold-soft:#f0d17d;
  --bi-line:#3c4145;
  --bi-panel:#24282bcc;
  --bi-deep:#15181bcc;
  --bi-ink:#0a0c0e;
  --bi-text:#e8e6df;
  --bi-muted:#9aa19c;
  --nrmt-theme-bg:#0d1115;
  --nrmt-theme-panel:#171c22;
  --nrmt-theme-line:#3a4148;
  --nrmt-theme-gold:#e3b33d;
  --nrmt-theme-text:#eef1f4;
  --nrmt-theme-muted:#929aa5;
  --nrmt-theme-radius:4px;
}

/* Trava shell Baiak assim que a classe existe (inclusive no preload) */
html.nrmt-baiak-preload,
body.nrmt-baiak-layout{
  background:var(--bi-ink)!important;
  overflow:hidden!important;
}

/* Party nativa + painel direito: mortos sob Baiak (evita flash do layout antigo) */
body.nrmt-baiak-layout [class*="_leftPanelArea_"]>[class*="_wrapper_iq0g4_"],
body.nrmt-baiak-layout [class*="_wrapper_iq0g4_"],
body.nrmt-baiak-layout [class*="_characterPanel_iq0g4_"],
body.nrmt-baiak-layout [class*="_partyList_iq0g4_"],
body.nrmt-baiak-layout [class*="_partyMemberCard_iq0g4_"],
body.nrmt-baiak-layout [class*="_rightPanelArea_"]{
  display:none!important;
  visibility:hidden!important;
  pointer-events:none!important;
  width:0!important;height:0!important;overflow:hidden!important;
  opacity:0!important;
}

/* HUD: Baiak manda, polish/ninja/reform não brigam */
body.nrmt-baiak-layout [class*="_topHud_"]{
  height:var(--bi-top)!important;
  grid-template-columns:var(--bi-left) minmax(0,1fr) var(--bi-right)!important;
  background:linear-gradient(180deg,#41413d,#272a29)!important;
  border:0!important;
  border-bottom:1px solid #151718!important;
  box-shadow:0 2px 8px #000a!important;
}
body.nrmt-baiak-layout [class*="_topHud_"]::after{display:none!important}
body.nrmt-baiak-layout [class*="_topHudMenuButton_"]{
  min-width:64px!important;
  max-width:82px!important;
  padding:2px 6px!important;
  border-right:1px solid #15171855!important;
  transform:none!important;
}
body.nrmt-baiak-layout [class*="_topHudMenuButton_"]::after{display:none!important}
body.nrmt-baiak-layout [class*="_topHudMenuLabel_"]{
  font-size:7px!important;
  color:#f1eee7!important;
  letter-spacing:.04em!important;
}
body.nrmt-baiak-layout [class*="_topHudMenuIcon_"]{
  width:22px!important;height:22px!important;
  transform:none!important;
}
body.nrmt-baiak-layout [class*="_topHudCurrency_"]{
  padding:0 10px!important;
  background:linear-gradient(90deg,#333632,#292b29)!important;
  border-right:1px solid #151718!important;
}

/* Stagebar morto — canvas sem espaço fantasma */
body.nrmt-baiak-layout .nrmt-bi-stagebar,
#nrmt-bi-stagebar{display:none!important}
body.nrmt-baiak-layout canvas{
  top:calc(var(--bi-top) + var(--bi-gap))!important;
  height:calc(100vh - var(--bi-top) - var(--bi-bottom) - var(--bi-gap)*2)!important;
  left:calc(var(--bi-left) + var(--bi-gap))!important;
  width:calc(100vw - var(--bi-left) - var(--bi-right) - var(--bi-gap)*2)!important;
  filter:none!important;
}

/* Menu bottom fantasma + FABs duplicados */
body.nrmt-menu-bottom [class*="_topHudNavigation_"]{position:static!important;transform:none!important;bottom:auto!important}
body.nrmt-baiak-layout #nrmt-vip-fab,
body.nrmt-baiak-layout .nrmt-pvp-launch,
body.nrmt-baiak-layout [data-nrmt-pvp-launch],
body.nrmt-baiak-layout .nrmt-menu-logout-source{display:none!important}

/* Originais do menu: nunca piscam */
.nrmt-menu-original-collapsed{display:none!important;visibility:hidden!important;pointer-events:none!important}

/* Tema padrão de janelas / overlays (todas as categorias) */
.xp-overlay,
.nrmt-shop-overlay,
.nrmt-inventory-overlay,
.nrmt-hunts-overlay,
.nrmt-forge-overlay,
.nrmt-craft-overlay,
.nrmt-ninja-collection,
.nrmt-mailbox,
.nrmt-pvp,
.nrmt-bi-helper,
.nrmt-bi-rotation,
.nrmt-team-select-overlay,
[class*="modal-overlay"],
.nrmt-game-overlay{
  --local-gold:var(--nrmt-theme-gold);
  --local-bg:var(--nrmt-theme-bg);
  --local-panel:var(--nrmt-theme-panel);
  --local-line:var(--nrmt-theme-line);
}

.xp-window,
.xp-saga-window,
.xp-sleep-window,
.xp-config-window,
.nrmt-shop-window,
.nrmt-inventory-window,
.nrmt-hunts-window,
.nrmt-forge-window,
.nrmt-craft-window,
.nrmt-bi-helper__window,
.nrmt-bi-rotation__window,
.nrmt-team-select,
.nrmt-game-window,
.nrmt-mailbox__window,
.nrmt-pvp-window{
  border-color:#6a5128!important;
  background:linear-gradient(155deg,#1a2024,var(--nrmt-theme-bg))!important;
  box-shadow:0 22px 70px #000c,inset 0 0 0 1px #ffffff08!important;
  border-radius:var(--nrmt-theme-radius)!important;
  color:var(--nrmt-theme-text)!important;
}

.xp-window>header,
.xp-saga-head,
.nrmt-shop-window>header,
.nrmt-inventory-window>header,
.nrmt-hunts-window>header,
.nrmt-forge-window>header,
.nrmt-craft-window>header,
.nrmt-bi-helper__window>header,
.nrmt-bi-rotation__window>header,
.nrmt-team-select__header,
.nrmt-game-window__header,
.nrmt-mailbox__window>header{
  background:linear-gradient(180deg,#2c3236,#1a1f23)!important;
  border-bottom:1px solid #5b4526!important;
  color:var(--nrmt-theme-gold)!important;
}

.xp-window header small,
.xp-saga-head small,
.nrmt-shop-window header small,
.nrmt-inventory-window header small,
.nrmt-hunts-window header small,
.nrmt-bi-rotation__window header small{
  color:var(--nrmt-theme-gold)!important;
  letter-spacing:.14em!important;
}

/* Painéis Baiak: uma linguagem só */
.nrmt-bi-panel{
  border-color:#34393d!important;
  background:linear-gradient(155deg,#343737e8,#202427f2)!important;
}
.nrmt-bi-panel>header{
  color:var(--bi-gold)!important;
  background:linear-gradient(180deg,#393c3d,#292d2f)!important;
  border-bottom-color:#1c2022!important;
}

/* Rails estáveis — sem “respiração” de largura */
@media(max-width:1500px){
  :root{--bi-left:195px;--bi-right:235px}
}
@media(max-width:1100px){
  :root{--bi-left:0px;--bi-right:0px}
  body.nrmt-baiak-layout .nrmt-bi-rail{display:none!important}
  body.nrmt-baiak-layout canvas{
    left:0!important;top:var(--bi-top)!important;
    width:100vw!important;height:calc(100vh - var(--bi-top))!important;
  }
}

/* Fluidez sem perder FX: só corta o que compete com shell */
body.nrmt-baiak-layout.nrmt-in-combat .nrmt-bi-rail{contain:strict}
body.nrmt-page-hidden .nrmt-bi-stagebar{display:none!important}
