/* V54 — chat lateral do dock + janelas proporcionais em notebook. */

/* Chat segue sendo uma janela livre: colapsável, arrastável e redimensionável. */
html body .hunter-chat{
  resize:both!important;
  overflow:hidden!important;
  min-width:220px!important;
  min-height:150px!important;
  max-width:min(520px,calc(100vw - 16px))!important;
  max-height:min(560px,calc(100dvh - 72px))!important;
  pointer-events:auto!important;
}
html body .hunter-chat.minimized{
  resize:none!important;
  min-width:180px!important;
  min-height:31px!important;
  max-height:31px!important;
  height:31px!important;
}
html body .hunter-chat .chat-head{
  cursor:grab!important;
  touch-action:none!important;
  user-select:none!important;
}
html body .hunter-chat.dragging .chat-head{cursor:grabbing!important}
.chat-resize-grip{
  position:absolute!important;
  right:4px!important;
  bottom:4px!important;
  width:13px!important;
  height:13px!important;
  z-index:8!important;
  pointer-events:none!important;
  opacity:.78!important;
  background:
    linear-gradient(135deg,transparent 0 45%,#d7a23b 46% 53%,transparent 54% 64%,#4dbaff 65% 72%,transparent 73%)!important;
}
.hunter-chat.minimized .chat-resize-grip{display:none!important}

/* O backdrop pode rolar em telas realmente pequenas, sem cortar o rodapé das janelas. */
.modal-backdrop,
.character-select-backdrop{
  overflow:auto!important;
  padding:10px!important;
}

/* Desktop normal mantém 100%. Notebook reduz TODA a janela como uma unidade,
   preservando proporções internas em vez de só esmagar colunas. */
@media (max-width:1600px) and (max-height:1000px){
  .modal-backdrop .modal,
  .character-select-backdrop .character-select-window{
    zoom:.90!important;
  }
}
@media (max-width:1440px) and (max-height:900px){
  .modal-backdrop .modal,
  .character-select-backdrop .character-select-window{
    zoom:.82!important;
  }
  .modal-backdrop .modal{
    max-height:86dvh!important;
  }
  #actionModal .action-modal{
    width:min(940px,94vw)!important;
    max-height:82dvh!important;
  }
  #shopModal .store-modal,
  #huntModal .hunt-browser-modal{
    max-height:84dvh!important;
  }
}
@media (max-width:1280px), (max-height:720px){
  .modal-backdrop .modal,
  .character-select-backdrop .character-select-window{
    zoom:.74!important;
  }
  .modal-backdrop .modal{
    max-height:88dvh!important;
  }
}

/* Em notebook os controles de modal não precisam manter dimensões de desktop. */
@media (max-width:1440px) and (max-height:900px){
  .modal-head{min-height:34px!important;height:34px!important;padding:6px 10px!important}
  .modal-head .x{width:24px!important;height:24px!important}
  .modal-body{padding:10px!important;max-height:calc(86dvh - 34px)!important}
  .modal-actions{gap:6px!important;margin-top:9px!important}
  .modal-actions button,.modal .primary,.modal .secondary,.modal .danger{min-height:30px!important;padding:6px 12px!important}
  #actionModal .action-picker{min-height:270px!important;height:min(330px,38vh)!important}
  #actionModal .action-list-item{min-height:52px!important;padding:6px 8px!important}
  #actionModal .action-list-item img{width:34px!important;height:34px!important}
  #actionModal .action-title-line img{width:44px!important;height:44px!important}
  #actionModal .condition-row{gap:5px!important}
}
@media (max-width:1400px) and (max-height:820px){
  .modal-backdrop .modal,
  .character-select-backdrop .character-select-window{
    zoom:.76!important;
  }
}
