#nx-chat-launch,#nx-bottom-chat{box-sizing:border-box;position:fixed;z-index:5000;font-family:Georgia,serif}
#nx-chat-launch{right:max(10px,env(safe-area-inset-right));bottom:max(9px,env(safe-area-inset-bottom));display:grid;justify-items:center;align-content:center;gap:2px;width:78px;min-height:80px;padding:5px 8px 6px;color:#f9dfad;background:linear-gradient(155deg,#453426,#221a16 54%,#121619);border:1px solid #b99555;border-radius:6px;box-shadow:inset 0 0 0 2px #211913,inset 0 0 15px #98673433,0 3px 10px #0009;font-weight:bold;font-size:15px;text-shadow:0 1px 3px #000;cursor:pointer}
#nx-chat-launch img{display:block;object-fit:contain;filter:drop-shadow(0 2px 3px #000a)}
#nx-chat-launch:is(:hover,:focus-visible){color:#fff1c7;border-color:#f2cd83;background:linear-gradient(155deg,#5c472c,#302419 54%,#17191a);box-shadow:inset 0 0 0 2px #261c13,0 0 13px #dca55857}
#nx-bottom-chat{inset:auto 0 0;width:100%;max-width:none;height:clamp(190px,33.8dvh,480px);padding:5px max(8px,env(safe-area-inset-right)) max(5px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));display:grid;grid-template-rows:auto minmax(0,1fr);gap:4px;background:#e9dfca;color:#2b2117;border-top:2px solid #9b7845;box-shadow:0 -3px 14px #100c0880;text-align:left;font:14px/1.32 Georgia,serif}
#nx-bottom-chat [hidden],#nx-chat-launch[hidden],#nx-bottom-chat[hidden]{display:none!important}
html.nx-dock-open :is(#gameChat,#arenaChatDesk,[data-map-chat],[data-expand-arena-chat],[data-collapse-arena-chat]){display:none!important}
#nx-bottom-chat header{position:static;display:flex;align-items:center;justify-content:space-between;gap:6px;min-width:0;margin:0;padding:0;background:transparent;border:0;box-shadow:none}
#nx-bottom-chat nav{display:flex;align-items:center;gap:3px;min-width:0;overflow-x:auto;white-space:nowrap;scrollbar-width:thin}
#nx-bottom-chat button,#nx-bottom-chat input{font:inherit;min-height:26px;margin:0;color:#302414}
#nx-bottom-chat button{padding:3px 7px;border:1px solid #b5a383;background:#f9f4e8;cursor:pointer;box-shadow:none}
#nx-bottom-chat button[aria-pressed=true]{background:#f0d7a5;border-color:#956b29;font-weight:bold}
#nx-bottom-chat .nx-pm-tab{display:inline-flex;align-items:stretch}
#nx-bottom-chat .nx-pm-tab button+button{border-left:0;padding:1px 6px}
#nx-bottom-chat .nx-chat-grid{display:grid;grid-template-columns:minmax(0,1fr) clamp(115px,18vw,290px);min-height:0;padding:0;margin:0;gap:6px;background:none;border:none}
#nx-bottom-chat .nx-conversation{display:grid;grid-template-rows:minmax(0,1fr) auto auto;min-height:0;min-width:0;padding:0}
#nx-bottom-chat .nx-messages,#nx-bottom-chat aside{margin:0;padding:4px 8px;overflow:auto;overscroll-behavior:contain;border:1px solid #c8b698;background:#f4efe3;color:#231b14;list-style:none;min-height:0}
#nx-bottom-chat li{display:flex;align-items:baseline;gap:.42em;padding:1px 0;border-bottom:1px solid #e5dcca;overflow-wrap:anywhere}
#nx-bottom-chat li time{font-size:.85em;color:#785d3a;flex:none}
#nx-bottom-chat .nx-chat-identity,#nx-bottom-chat .nx-chat-name{display:inline-flex;align-items:center;min-width:0;gap:3px}
#nx-bottom-chat .nx-chat-identity{flex-wrap:wrap;gap:2px 5px}
#nx-bottom-chat .nx-chat-identity .player-flags{margin:0}
#nx-bottom-chat .nx-person{min-height:0;min-width:0;margin:0;padding:0;border:0;background:none;color:#086895;font:inherit;font-weight:bold;text-align:left;text-decoration:underline;text-underline-offset:2px;overflow-wrap:anywhere;white-space:normal}
#nx-bottom-chat button.nx-person{cursor:pointer}
#nx-bottom-chat .fighter-info-link{display:inline-grid;place-items:center;width:1em;height:1em;flex:0 0 1em;margin:0;border-radius:1px;background:#175da4;color:#fff;font-size:.72em;font-weight:bold;line-height:1;text-decoration:none}
#nx-bottom-chat .nx-chat-message{display:grid;grid-template-columns:auto fit-content(31%) minmax(0,1fr);align-items:baseline}
#nx-bottom-chat .nx-chat-copy{color:#231b14;min-width:0}
#nx-bottom-chat .combat-mark--crit{color:#a51d18;font-weight:bold}
#nx-bottom-chat .combat-mark--damage{color:#542f1f;font-weight:bold}
#nx-bottom-chat aside{position:static;display:block;width:auto;box-shadow:none}
#nx-bottom-chat aside>strong{display:block;margin:0 0 3px}
#nx-bottom-chat aside .nx-chat-identity{display:flex;padding:3px 0;border-bottom:1px solid #e5dcca}
#nx-bottom-chat form{display:flex;gap:5px;margin:4px 0 0}
#nx-bottom-chat input{box-sizing:border-box;min-width:0;flex:1;background:#fffdf7;border:1px solid #c1aa85;padding:3px 6px}
#nx-bottom-chat output{font-size:.9em;color:#784a23}
@media(max-width:550px){#nx-bottom-chat{font-size:13px;gap:2px;padding-inline:3px}#nx-bottom-chat header>button{max-width:87px;line-height:1.1}#nx-bottom-chat .nx-chat-grid{grid-template-columns:minmax(0,1fr) minmax(85px,26%);gap:3px}#nx-bottom-chat li{gap:.25em}}

@media(max-width:550px){#nx-bottom-chat .nx-chat-message{grid-template-columns:auto minmax(0,1fr)}#nx-bottom-chat .nx-chat-copy{grid-column:2}}
#nx-bottom-chat .nx-messages,#gameChat .game-chat-log,#arenaChatDesk #battleLog{font-size:13px;line-height:1.24}
@media(max-width:550px){#nx-bottom-chat .nx-messages,#gameChat .game-chat-log,#arenaChatDesk #battleLog{font-size:12px}}
#gameChat #chatLog>li:not(.raid-chat-hit):not(.reward-line){gap:.4em;padding-block:2px}
#nx-bottom-chat .nx-chat-copy,#chatLog>li>span:last-child{word-spacing:-.025em}

html:not(.nx-chat-authorized) :is(#gameChat,#nx-chat-launch,#nx-bottom-chat,[data-expand-arena-chat],[data-collapse-arena-chat]){display:none!important}

#portalChatDock{display:none}
body:is([data-screen=worldPortal],[data-screen=raid]):has(#portalChatDock[data-full-chat]) .shell>footer{display:none}
body:is([data-screen=worldPortal],[data-screen=raid]) #portalChatDock[data-full-chat]:has(#gameChat:not([hidden])){
  display:block;width:100%;min-width:0;margin-block-start:8px
}
#portalChatDock #gameChat.map-chat{
  display:flex;width:100%;min-width:0;height:clamp(215px,34dvh,380px);
  min-height:180px;max-height:75dvh;resize:vertical;overflow:hidden;
  border:1px solid #9b7845;background:#f4efe3;padding-bottom:7px
}
#portalChatDock #gameChat .game-chat-body{
  display:flex;flex:1 1 0;min-height:0;height:auto;max-height:none;overflow:hidden
}
#portalChatDock #gameChat .game-chat-channels{flex:none;overflow-x:auto;white-space:nowrap;flex-wrap:nowrap}
#portalChatDock #gameChat .game-chat-channels button{flex:none}
#portalChatDock #gameChat #chatLog{flex:1 1 0;height:auto;min-height:0;max-height:none;overflow:auto;resize:none}
#portalChatDock #gameChat .game-chat-form{flex:none;margin-top:auto;padding:0 0 3px}
#portalChatDock #gameChat .game-chat-form input{width:0}
:is(#gameChat,#nx-bottom-chat) form select.chat-audience{
  flex:0 0 auto;min-width:5.8rem;max-width:32%;font:inherit;font-weight:bold;padding:.2em .35em;
  border:1px solid var(--audience-color,#6b4f22);border-left-width:3px;
  color:var(--audience-color,#6b4f22);background:var(--audience-paper,#fbf3df)
}
[data-audience="race"]{--audience-color:#25613b;--audience-paper:#e4f0df}
[data-audience="class"]{--audience-color:#623d85;--audience-paper:#efe6fa}
[data-audience="clan"]{--audience-color:#923f17;--audience-paper:#fae9d9}
[data-audience="alliance"]{--audience-color:#245987;--audience-paper:#e2eefb}
[data-audience="group"]{--audience-color:#176a6a;--audience-paper:#dff0ed}
[data-audience="family"]{--audience-color:#8f3e62;--audience-paper:#fae6ee}
:is(#gameChat,#nx-bottom-chat) .chat-audience option{
  color:var(--audience-color,#6b4f22);background:var(--audience-paper,#fbf3df)
}
@media(max-width:550px){
  :is(#gameChat,#nx-bottom-chat) form select.chat-audience{min-width:0}
  #portalChatDock #gameChat.map-chat{height:clamp(205px,36dvh,330px)}
}

#nx-chat-launch .nx-chat-unread{
  position:absolute;top:-6px;min-width:1.65em;padding:2px 4px;border-radius:1em;
  color:#fffdf3;border:1px solid #f0ce88;font:700 12px/1.1 system-ui,sans-serif;text-align:center
}
.nx-chat-unread-private{left:-4px;background:#972e45}
.nx-chat-unread-clan{right:-4px;background:#205c89}
html.nx-dock-open #nx-chat-launch{bottom:calc(clamp(190px,33.8dvh,480px) + 8px)}

#gameChat .game-chat-feed{
  display:grid;grid-template-columns:minmax(0,1fr) clamp(110px,19%,250px);
  align-items:stretch;gap:6px;min-width:0;min-height:0
}
#gameChat .game-chat-people{
  display:block;position:static;width:auto;min-height:0;min-width:0;margin:0;
  padding:5px 7px;overflow:auto;overscroll-behavior:contain;
  color:var(--ink,#392e25);background:var(--paper,#f6f1e5);border:1px solid var(--rule,#cab99a);
  box-shadow:none;font:13px/1.25 Georgia,serif
}
#gameChat .game-chat-people>strong{display:block;margin-bottom:4px;color:#634824}
#chatPeople>*{display:flex;flex-wrap:wrap;align-items:center;gap:3px;padding:3px 0;border-top:1px solid #e6ddcc;overflow-wrap:anywhere}
#portalChatDock #gameChat .game-chat-feed{flex:1 1 0;grid-template-rows:minmax(0,1fr)}
#portalChatDock #gameChat .game-chat-feed #chatLog{height:auto}
#panel:has(.raid-layout) #gameChat .game-chat-feed{flex:1 1 0;grid-template-rows:minmax(0,1fr)}
#panel:has(.raid-layout) #gameChat .game-chat-feed #chatLog{height:auto}
@media(max-width:550px){
  #gameChat .game-chat-feed{grid-template-columns:minmax(0,1fr) minmax(76px,26%);gap:3px}
  #gameChat .game-chat-people{padding:4px;font-size:12px}
}

:is(#gameChat,#nx-bottom-chat) .raid-chat-hit {display:flex;flex-wrap:wrap;align-items:baseline;gap:.38em}
:is(#gameChat,#nx-bottom-chat) .raid-chat-hit [data-hit]{color:var(--raid-hit-color,#302923)}
.raid-chat-hit [data-hit=critical]{--raid-hit-color:#982026}
.raid-chat-hit [data-hit=supercrit]{--raid-hit-color:#623685}
.raid-chat-hit [data-hit=crushing]{--raid-hit-color:#b2453a}
.raid-chat-hit [data-hit=double]{--raid-hit-color:#815300}
.raid-chat-hit [data-hit=effect]{--raid-hit-color:#21615b}
.raid-chat-hit [data-hit=stun]{--raid-hit-color:#586525}
.raid-chat-hit :is([data-hit=dodge],[data-hit=parry],[data-hit=block],[data-hit=avoided]){--raid-hit-color:#39556b}
.raid-chat-hit .raid-hit-label{
  padding:0 .35em;border:1px solid currentColor;border-radius:3px;
  font-size:.86em;font-weight:700;line-height:1.25
}

#gameChat[data-chat-kind=raid] .game-chat-feed,
#nx-bottom-chat[data-chat-kind=raid] .nx-chat-grid{grid-template-columns:minmax(0,1fr)}
#gameChat[data-chat-kind=raid] .game-chat-people,
#nx-bottom-chat[data-chat-kind=raid] aside{display:none}
#gameChat[data-chat-kind=raid] #chatLog li.reward-line,
#nx-bottom-chat[data-chat-kind=raid] li.reward-line{
  display:block;white-space:normal;overflow-wrap:anywhere;overflow-x:visible
}
#gameChat[data-chat-kind=raid] #chatLog .reward-line>.monster-reward{white-space:normal}
:is(#gameChat,#nx-bottom-chat)[data-chat-kind=raid] .reward-line time{margin-inline-end:.4em}
:is(#gameChat,#nx-bottom-chat) [data-notice=game]{color:#902819;font-weight:bold}
[data-audience="world"]{--audience-color:#565c92;--audience-paper:#e9e9f8}
:is(#chatPeople,#nx-bottom-chat aside) :is(.chat-fighter,.nx-chat-identity,.nx-chat-name){
  display:flex;min-width:0;flex-wrap:nowrap;align-items:center;gap:3px
}
:is(#chatPeople,#nx-bottom-chat aside) .player-flags{display:inline-flex;flex:none;gap:1px;margin:0}
:is(#chatPeople,#nx-bottom-chat aside) .player-flags>.player-flag{
  flex:none;width:18px;height:16px
}
:is(#chatPeople,#nx-bottom-chat aside) .player-flags>.player-flag:has(>:is(.country-standard,.neutral-standard)){
  display:block;width:24px;height:16px;padding:0;border:0;background:transparent
}
:is(#chatPeople,#nx-bottom-chat aside) .player-flag>:is(.country-standard,.neutral-standard){
  display:block;width:100%;height:100%;aspect-ratio:auto;object-fit:contain
}
:is(#chatPeople,#nx-bottom-chat aside) .player-flags>.player-flag:has(>:is(.race-standard,.group-standard)){
  display:block;width:16px;height:20px
}
:is(#chatPeople,#nx-bottom-chat aside) :is(.race-standard,.group-standard)>svg{
  display:block;width:100%;height:100%
}
@media(max-width:550px){
  :is(#chatPeople,#nx-bottom-chat aside) .player-flags>.player-flag{width:12px;height:12px}
  :is(#chatPeople,#nx-bottom-chat aside) .player-flags>.player-flag:has(>:is(.race-standard,.group-standard)){
    width:12px;height:15px
  }
  :is(#chatPeople,#nx-bottom-chat aside) .player-flags>.player-flag:has(>:is(.country-standard,.neutral-standard)){
    width:15px;height:10px
  }
}
:is(#chatPeople,#nx-bottom-chat aside) :is(.nx-person,.chat-fighter-name,.chat-fighter>strong){
  min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap
}
:is(#chatPeople,#nx-bottom-chat aside) .fighter-info-link{flex:none}
