/* v1263: Luận Đạo loot UI isolated module */
#chatWidgetDialog .chat-loot-message{
  display:flex!important;
  justify-content:center!important;
  align-items:center!important;
  width:100%!important;
  min-height:0!important;
  padding:2px 8px!important;
  margin:1px 0!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}
#chatWidgetDialog .chat-loot-line{
  width:100%!important;
  text-align:center!important;
  color:rgba(255,255,255,.52)!important;
  font-size:9px!important;
  line-height:1.35!important;
  font-weight:500!important;
  white-space:normal!important;
}
#chatWidgetDialog .chat-loot-name{
  color:#35e889!important;
  font:inherit!important;
  font-weight:800!important;
  line-height:inherit!important;
}
#chatWidgetDialog .chat-loot-item{
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  font:inherit!important;
  font-weight:800!important;
  line-height:inherit!important;
}
#chatWidgetDialog .chat-loot-item{
  display:inline!important;
  padding:0!important;
  margin:0!important;
  border:0!important;
  outline:0!important;
  background:transparent!important;
  box-shadow:none!important;
  cursor:pointer!important;
  text-decoration:none!important;
}
#chatWidgetDialog .chat-loot-popover{
  position:absolute!important;
  z-index:2147483647!important;
  box-sizing:border-box!important;
  padding:8px 10px!important;
  border:0!important;
  outline:0!important;
  border-radius:8px!important;
  background:rgba(3,6,10,.88)!important;
  box-shadow:0 8px 22px rgba(0,0,0,.30)!important;
  color:#fff!important;
  opacity:0!important;
  transform:translateY(3px)!important;
  transition:opacity .10s ease,transform .10s ease!important;
  pointer-events:auto!important;
  backdrop-filter:blur(5px)!important;
  -webkit-backdrop-filter:blur(5px)!important;
}
#chatWidgetDialog .chat-loot-popover.is-open{opacity:1!important;transform:translateY(0)!important}
#chatWidgetDialog .chat-loot-popover .chat-loot-popover-title{display:block!important;margin:0 0 4px!important;color:#fff!important;-webkit-text-fill-color:#fff!important;font-size:10.5px!important;line-height:1.3!important;font-weight:900!important}
#chatWidgetDialog .chat-loot-popover .chat-loot-popover-rarity{display:block!important;margin:0 0 5px!important;color:rgba(242,247,252,.58)!important;font-size:8.8px!important;line-height:1.35!important;font-weight:600!important}
#chatWidgetDialog .chat-loot-popover .chat-loot-popover-rarity b{font-size:inherit!important;line-height:inherit!important;font-weight:850!important;color:#fff!important;-webkit-text-fill-color:#fff!important}
#chatWidgetDialog .chat-loot-popover .chat-loot-popover-desc{display:block!important;color:rgba(242,247,252,.72)!important;font-size:9px!important;line-height:1.45!important;font-weight:500!important}
@media(max-width:700px){
  #chatWidgetDialog .chat-loot-line{font-size:8.5px!important}
  #chatWidgetDialog .chat-loot-popover{padding:8px 9px!important;border-radius:8px!important}
  #chatWidgetDialog .chat-loot-popover .chat-loot-popover-title{font-size:10px!important}
  #chatWidgetDialog .chat-loot-popover .chat-loot-popover-rarity{font-size:8.5px!important}
  #chatWidgetDialog .chat-loot-popover .chat-loot-popover-desc{font-size:8.8px!important}
}

/* v1264: phẩm cấp vật phẩm – áp dụng cả tên trong câu nhặt quà và popover */
#chatWidgetDialog .chat-loot-item.item-rarity-ha,
#chatWidgetDialog .chat-loot-popover .chat-loot-popover-title.item-rarity-ha{color:#aeb5bd!important;-webkit-text-fill-color:#aeb5bd!important}
#chatWidgetDialog .chat-loot-item.item-rarity-trung,
#chatWidgetDialog .chat-loot-popover .chat-loot-popover-title.item-rarity-trung{color:#45d46f!important;-webkit-text-fill-color:#45d46f!important}
#chatWidgetDialog .chat-loot-item.item-rarity-thuong,
#chatWidgetDialog .chat-loot-popover .chat-loot-popover-title.item-rarity-thuong{color:#5aa9ff!important;-webkit-text-fill-color:#5aa9ff!important}
#chatWidgetDialog .chat-loot-item.item-rarity-cuc,
#chatWidgetDialog .chat-loot-popover .chat-loot-popover-title.item-rarity-cuc{color:#b66cff!important;-webkit-text-fill-color:#b66cff!important}
#chatWidgetDialog .chat-loot-item.item-rarity-tien,
#chatWidgetDialog .chat-loot-popover .chat-loot-popover-title.item-rarity-tien{color:#ff9a3d!important;-webkit-text-fill-color:#ff9a3d!important}
#chatWidgetDialog .chat-loot-item.item-rarity-than,
#chatWidgetDialog .chat-loot-popover .chat-loot-popover-title.item-rarity-than{
  color:#ff3b30!important;
  -webkit-text-fill-color:#ff3b30!important;
  background:none!important;
}

/* v1265: mặc định tên vật phẩm trắng; Phẩm cấp chỉ tô màu khi tên có đúng từ khóa phẩm cấp */
#chatWidgetDialog .chat-loot-item:not(.item-rarity-ha):not(.item-rarity-trung):not(.item-rarity-thuong):not(.item-rarity-cuc):not(.item-rarity-tien):not(.item-rarity-than),
#chatWidgetDialog .chat-loot-popover-title:not(.item-rarity-ha):not(.item-rarity-trung):not(.item-rarity-thuong):not(.item-rarity-cuc):not(.item-rarity-tien):not(.item-rarity-than){color:#fff!important;-webkit-text-fill-color:#fff!important}
#chatWidgetDialog .chat-loot-popover-rarity b.item-rarity-ha{color:#aeb5bd!important;-webkit-text-fill-color:#aeb5bd!important}
#chatWidgetDialog .chat-loot-popover-rarity b.item-rarity-trung{color:#45d46f!important;-webkit-text-fill-color:#45d46f!important}
#chatWidgetDialog .chat-loot-popover-rarity b.item-rarity-thuong{color:#5aa9ff!important;-webkit-text-fill-color:#5aa9ff!important}
#chatWidgetDialog .chat-loot-popover-rarity b.item-rarity-cuc{color:#b66cff!important;-webkit-text-fill-color:#b66cff!important}
#chatWidgetDialog .chat-loot-popover-rarity b.item-rarity-tien{color:#ff9a3d!important;-webkit-text-fill-color:#ff9a3d!important}
#chatWidgetDialog .chat-loot-popover-rarity b.item-rarity-than{color:#ff3b30!important;-webkit-text-fill-color:#ff3b30!important;background:none!important}

/* v1270: nút X nhỏ cho popover thông tin vật phẩm trong Luận Đạo */
#chatWidgetDialog .chat-loot-popover{padding-right:28px!important}
#chatWidgetDialog .chat-loot-popover-close{position:absolute!important;right:5px!important;top:4px!important;width:19px!important;height:19px!important;padding:0!important;border:0!important;border-radius:6px!important;background:rgba(255,255,255,.06)!important;color:rgba(255,255,255,.7)!important;font-size:14px!important;line-height:19px!important;text-align:center!important;cursor:pointer!important}
#chatWidgetDialog .chat-loot-popover-close:hover{background:rgba(255,255,255,.12)!important;color:#fff!important}

/* v1275: màu phẩm cấp phải đúng ngay khi dòng loot vừa render, không chờ hover/click JS. */
#chatWidgetDialog [data-chat-loot-item="spirit_bag_low"],
#chatWidgetDialog [data-chat-loot-item="spirit_chest_low"],
#chatWidgetDialog [data-chat-loot-item="mystery_chest_low"],
#chatWidgetDialog [data-chat-loot-item="chest_key_low"]{color:#aeb5bd!important;-webkit-text-fill-color:#aeb5bd!important}
#chatWidgetDialog [data-chat-loot-item="spirit_bag_mid"],
#chatWidgetDialog [data-chat-loot-item="spirit_chest_mid"],
#chatWidgetDialog [data-chat-loot-item="chest_key_mid"]{color:#45d46f!important;-webkit-text-fill-color:#45d46f!important}
#chatWidgetDialog [data-chat-loot-item="spirit_bag_extreme"],
#chatWidgetDialog [data-chat-loot-item="spirit_chest_extreme"],
#chatWidgetDialog [data-chat-loot-item="chest_key_extreme"],
#chatWidgetDialog [data-chat-loot-item="speaker_extreme"],
#chatWidgetDialog [data-chat-loot-item="rename_card"],
#chatWidgetDialog [data-chat-loot-item="lucky_card_extreme"],
#chatWidgetDialog [data-chat-loot-item="protection_charm_new"]{color:#b66cff!important;-webkit-text-fill-color:#b66cff!important}


/* ===== v1315 FIX: dòng quà Luận Đạo không đè lên tin nhắn =====
   Nguyên nhân: dòng loot có thể wrap 2 dòng nhưng row cũ bị nén theo layout chat,
   khiến chữ tràn lên / xuống các tin kế bên. */
#chatWidgetDialog .chat-widget-messages > article.chat-loot-message{
  display:block!important;
  position:relative!important;
  flex:0 0 auto!important;
  width:100%!important;
  height:auto!important;
  min-height:24px!important;
  max-height:none!important;
  box-sizing:border-box!important;
  margin:3px 0!important;
  padding:4px 8px!important;
  overflow:visible!important;
  line-height:1.45!important;
  transform:none!important;
  contain:none!important;
}
#chatWidgetDialog .chat-widget-messages > article.chat-loot-message .chat-loot-line{
  display:block!important;
  position:relative!important;
  width:100%!important;
  height:auto!important;
  min-height:0!important;
  margin:0!important;
  padding:0!important;
  box-sizing:border-box!important;
  text-align:center!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
  line-height:1.45!important;
  font-size:9.5px!important;
  transform:none!important;
}
#chatWidgetDialog .chat-widget-messages > article.chat-loot-message .chat-loot-name,
#chatWidgetDialog .chat-widget-messages > article.chat-loot-message .chat-loot-item{
  display:inline!important;
  position:static!important;
  vertical-align:baseline!important;
  line-height:inherit!important;
  white-space:normal!important;
}
#chatWidgetDialog .chat-widget-messages > article.chat-loot-message .chat-loot-item{
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  padding:0!important;
}
#chatWidgetDialog .chat-widget-messages > article.chat-loot-message + article.chat-widget-message{
  margin-top:1px!important;
}
@media(max-width:700px){
  #chatWidgetDialog .chat-widget-messages > article.chat-loot-message{
    min-height:22px!important;
    margin:3px 0!important;
    padding:4px 5px!important;
  }
  #chatWidgetDialog .chat-widget-messages > article.chat-loot-message .chat-loot-line{
    font-size:9px!important;
    line-height:1.5!important;
  }
}
