/*
 * Integração v332.
 * Os quatro arquivos v329-*-reference.css são cópias mecânicas dos CSS
 * oficiais de /opt/pokedash/novosmapas/new-interface_pokeidle. Este arquivo
 * limita-se a posicionar os modelos no jogo e neutralizar regras legadas.
 */

/* MAIN BAR — 999 x 61, como main-bar_pokeidle/index.html. */
#stage .unified-client-actions.mainbar {
  position: absolute !important;
  z-index: 1180 !important;
  left: 50% !important;
  right: auto !important;
  top: 5px !important;
  width: 999px !important;
  min-width: 999px !important;
  max-width: none !important;
  height: 61px !important;
  min-height: 61px !important;
  padding: 0 !important;
  margin: 0 !important;
  display: block !important;
  overflow: visible !important;
  transform: translateX(-50%) !important;
  background: url("assets/new-interface/hub/background.png") no-repeat left top !important;
  background-size: auto !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
#stage .unified-client-actions.mainbar .mainbar-buttons {
  position: absolute !important;
  inset: 0 !important;
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  padding: 0 12px !important;
  overflow: visible !important;
}
#stage .unified-client-actions.mainbar .mainbar-button {
  position: relative !important;
  width: 40px !important;
  min-width: 40px !important;
  height: 42px !important;
  min-height: 42px !important;
  flex: 0 0 40px !important;
  display: grid !important;
  place-items: center !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 4px !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}
#stage .unified-client-actions.mainbar .mainbar-button > img {
  position: relative !important;
  z-index: 1 !important;
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: 34px !important;
  max-height: 34px !important;
  margin: 0 !important;
  object-fit: contain !important;
  filter: none;
}
#stage .unified-client-actions.mainbar .mainbar-tooltip { position: fixed !important; }

/* TEAM BAR — estrutura, proporções e assets literais do teambar-pokeidle. */
#stage #pokemon-team-bar.team-bar {
  position: absolute !important;
  z-index: 1120 !important;
  left: 8px !important;
  right: auto !important;
  top: 76px !important;
  bottom: auto !important;
  width: 281px !important;
  max-width: none !important;
  height: var(--team-height) !important;
  padding: 0 !important;
  margin: 0 !important;
  display: block !important;
  overflow: hidden !important;
  transform: none !important;
  background: url("assets/new-interface/teambar/background-teambar.png") no-repeat left top !important;
  background-size: 281px 454px !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
#stage #pokemon-team-bar.team-bar.is-minimized,
#stage #pokemon-team-bar.team-bar.collapsed {
  width: 281px !important;
  height: 54px !important;
  padding: 0 !important;
  transform: none !important;
  background: url("assets/new-interface/teambar/background-teambar_minimizado.png") no-repeat left top !important;
  background-size: auto !important;
  border: 0 !important;
}
#stage #pokemon-team-bar.team-bar .pokemon-sprite {
  position: absolute;
  inset: 0;
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
}

/* SKILLS — uma instância do modelo, alimentada pelos golpes do Pokémon ativo. */
#stage #pokemon-skills-window.skills-window {
  position: absolute !important;
  z-index: 1130 !important;
  left: calc(50% - 326px) !important;
  right: auto !important;
  top: auto;
  bottom: 7px !important;
  width: 652px !important;
  max-width: none !important;
  height: 106px !important;
  margin: 0 !important;
  transform: none !important;
  overflow: visible !important;
}
#stage #pokemon-skills-window.skills-window > .skills-bar {
  position: relative !important;
  inset: auto !important;
  width: 652px !important;
  max-width: none !important;
  height: 106px !important;
  padding: 16px 12px 16px 15px !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  overflow: visible !important;
  transform: none !important;
  background: url("assets/new-interface/skills/painel.png") no-repeat center !important;
  background-size: 100% 100% !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
#stage #pokemon-skills-window #pokemon-moves.pokemon-moves {
  position: static !important;
  inset: auto !important;
  width: auto !important;
  max-width: none !important;
  height: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  overflow: visible !important;
  transform: none !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
#stage #pokemon-skills-window .config-button {
  position: relative !important;
  inset: auto !important;
  order: initial !important;
  width: 30px !important;
  height: 30px !important;
  flex: 0 0 30px !important;
  padding: 0 !important;
  margin: 0 8px 0 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* O CSS-base do jogo estiliza todo span dentro de .move-slot. Estes quatro
   seletores recolocam literalmente os elementos do modelo acima dessa regra. */
#stage #pokemon-skills-window .move-slot > .move-name {
  position: absolute;
  margin-top: 0;
  font-size: 10px;
  line-height: 12px;
  text-transform: none;
}
#stage #pokemon-skills-window .move-slot > .move-type {
  position: absolute;
  margin-top: 0;
  font-size: 7px;
  line-height: 9px;
  text-transform: uppercase;
}
#stage #pokemon-skills-window .move-slot > .cooldown-overlay {
  position: absolute;
  z-index: 5;
  display: block;
  margin-top: 0;
  text-transform: none;
}
#stage #pokemon-skills-window .move-slot > .cooldown-number {
  position: absolute;
  z-index: 6;
  display: none;
  margin-top: 0;
  font-size: 18px;
  line-height: 1;
  text-transform: none;
}
#stage #pokemon-skills-window .move-slot.is-cooldown > .cooldown-number { display: flex; }

/* Estado compacto copiado do próprio skills-bar_pokeidle. */
#stage #pokemon-skills-window.skills-window.is-minimized {
  width: 281px !important;
  height: 54px !important;
  overflow: hidden !important;
  background: url("assets/new-interface/skills/background-teambar_minimizado.png") no-repeat left top !important;
  background-size: auto !important;
}
#stage #pokemon-skills-window.skills-window.is-minimized > .skills-bar {
  width: 281px !important;
  height: 54px !important;
  justify-content: flex-start !important;
  padding: 0 42px 0 12px !important;
  background: transparent !important;
}
#stage #pokemon-skills-window.skills-window.is-minimized #pokemon-moves { display: none !important; }
#stage #pokemon-skills-window.skills-window.is-minimized .config-button {
  position: absolute !important;
  left: 12px !important;
  top: 50% !important;
  width: 30px !important;
  height: 30px !important;
  margin: 0 !important;
  transform: translateY(-50%) !important;
}
#stage #pokemon-skills-window .move-disabled { opacity: .38; filter: grayscale(.35); }
#stage #pokemon-skills-window .move-disabled::after { content: none !important; }
#stage #pokemon-skills-window .skills-config-modal.hidden { display: none !important; }
#stage #pokemon-skills-window .skills-config-modal.is-open { display: flex !important; }

/* CHAT — 439 x 345 e 133 x 44 minimizado, conforme chat-projeto. */
#game-chat.chat-shell {
  position: fixed !important;
  z-index: 1300 !important;
  right: auto !important;
  bottom: auto !important;
  width: 439px !important;
  min-width: 439px !important;
  max-width: none !important;
  height: 345px !important;
  min-height: 345px !important;
  max-height: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: block !important;
  overflow: visible !important;
  transform: scale(var(--chat-effective-scale, 1)) !important;
  transform-origin: top left !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
#game-chat.chat-shell.minimized,
#game-chat.chat-shell.is-minimized {
  width: 133px !important;
  min-width: 133px !important;
  height: 44px !important;
  min-height: 44px !important;
  background: url("assets/new-interface/chat/header-minimized.png") no-repeat left top !important;
  background-size: auto !important;
}
#game-chat.chat-shell.minimized > .chat-topbar,
#game-chat.chat-shell.is-minimized > .chat-topbar,
#game-chat.chat-shell.minimized > .chat-panel,
#game-chat.chat-shell.is-minimized > .chat-panel { display: none !important; }
#game-chat.chat-shell.minimized > .chat-minimized-title,
#game-chat.chat-shell.is-minimized > .chat-minimized-title { display: block !important; }
#game-chat.chat-shell.minimized > .chat-restore,
#game-chat.chat-shell.is-minimized > .chat-restore { display: flex !important; }
#game-chat.chat-shell .chat-cooldown,
#game-chat.chat-shell .chat-scale-controls { display: none !important; }
#game-chat.chat-shell .chat-input { font-size: 13px !important; }
#game-chat.chat-shell .chat-party-access {
  position: absolute;
  z-index: 5;
  left: 18px;
  right: 16px;
  top: 60px;
  height: 26px;
  display: flex;
  gap: 4px;
}
#game-chat.chat-shell .chat-party-access.hidden { display: none; }
#game-chat.chat-shell .chat-party-access input { min-width: 0; flex: 1; background: #0c151d; border: 1px solid #334856; color: #dbe5ec; }
#game-chat.chat-shell .chat-party-access button { border: 1px solid #967537; background: #17232c; color: #f2e6c3; font-size: 10px; }
#game-chat.chat-shell[data-channel="party"] .chat-messages { top: 92px; }

/* Controles externos que continuam existindo no jogo, sem alterar os modelos. */
.game-zoom { bottom: 78px !important; }
.skill-opacity-control { right: 10px; bottom: 42px; }

@media (max-width: 1020px) {
  #stage .unified-client-actions.mainbar {
    left: 8px !important;
    transform: none !important;
  }
}

@media (max-width: 700px), (max-height: 700px) {
  #stage #pokemon-team-bar.team-bar {
    top: 66px !important;
    transform: scale(.78) !important;
    transform-origin: top left !important;
  }
  #stage #pokemon-team-bar.team-bar.is-minimized,
  #stage #pokemon-team-bar.team-bar.collapsed { transform: none !important; }
  #stage #pokemon-skills-window.skills-window {
    left: 50% !important;
    bottom: 4px !important;
    transform: translateX(-50%) scale(.72) !important;
    transform-origin: bottom center !important;
  }
}
