/* Nối Từ Việt 3.9.10 – mobile floating chat using the existing room & community chat. */
#ntv-game-root .ntv-mobile-chat-fab,
#ntv-game-root .ntv-mobile-chat-backdrop,
#ntv-game-root .ntv-mobile-chat-close {display:none!important;}
#ntv-game-root.ntv-device-mobile .ntv-home .ntv-mobile-chat-fab,
#ntv-game-root.ntv-device-mobile .ntv-play .ntv-mobile-chat-fab {
 display:flex!important; flex-direction:column; align-items:center; justify-content:center;
 position:fixed; right:max(14px,env(safe-area-inset-right));
 bottom:calc(20px + env(safe-area-inset-bottom)); width:62px;height:69px;
 z-index:1200; border:0!important;padding:0!important; margin:0!important;
 border-radius:32px; color:#123b33; background:transparent!important;
 box-shadow:none!important; cursor:pointer; touch-action:manipulation; -webkit-tap-highlight-color:transparent;
}
#ntv-game-root.ntv-device-mobile .ntv-home .ntv-mobile-chat-fab {bottom:calc(82px + env(safe-area-inset-bottom));}
#ntv-game-root.ntv-device-mobile .ntv-mobile-chat-fab-circle {
 width:54px;height:54px;flex:0 0 54px;border:3px solid #133f36;border-radius:50%;
 background:#80f4c6;display:flex;align-items:center;justify-content:center;
 box-shadow:0 4px 0 #203a34,0 9px 18px rgba(0,0,0,.22);
}
#ntv-game-root.ntv-device-mobile .ntv-mobile-chat-fab-count {
 margin-top:-5px;min-width:40px; height:20px;display:flex;align-items:center;justify-content:center;
 gap:4px;background:#fffdf4;border:2px solid #25473e;border-radius:999px;
 box-shadow:0 2px 0 #23453e;z-index:2;padding:0 5px;
 font-size:11px;line-height:1;font-weight:900;letter-spacing:0;color:#23362f;
}
#ntv-game-root.ntv-device-mobile .ntv-mobile-chat-fab-dot {width:7px;height:7px;border-radius:50%;background:#21c48c;border:1px solid #174b3a;}
#ntv-game-root.ntv-device-mobile .ntv-mobile-chat-fab.ntv-mobile-chat-has-unread .ntv-mobile-chat-fab-count{background:#ffefb6;}
#ntv-game-root.ntv-device-mobile .ntv-mobile-chat-fab:focus-visible{outline:3px solid #ffd955!important;outline-offset:4px;}
#ntv-game-root.ntv-device-mobile.ntv-mobile-editing .ntv-mobile-chat-fab {display:none!important;}
#ntv-game-root.ntv-device-mobile .ntv-play.ntv-mobile-chat-open .ntv-mobile-chat-backdrop{
 display:block!important;position:fixed;inset:0;width:100vw;height:100dvh;
 background:rgba(0,34,31,.60);z-index:1300;border:0;border-radius:0;padding:0;
}
#ntv-game-root.ntv-device-mobile .ntv-play.ntv-mobile-chat-open .ntv-mobile-chat-fab{display:none!important;}
#ntv-game-root.ntv-device-mobile .ntv-play.ntv-mobile-chat-open .ntv-room-side .ntv-chatbox {
 display:flex!important;flex-direction:column!important;position:fixed!important;
 width:min(440px,calc(100vw - 20px))!important;max-width:440px!important;
 height:min(70dvh,560px)!important;max-height:min(70dvh,560px)!important;min-height:220px!important;
 inset:auto 10px calc(10px + env(safe-area-inset-bottom)) auto!important;
 margin:0!important;z-index:1301!important;border-radius:23px!important;
 box-shadow:0 18px 52px #0008!important;
}
#ntv-game-root.ntv-device-mobile .ntv-play.ntv-mobile-chat-open .ntv-chatbox-body{
 display:flex!important;flex:1 1 auto!important;min-height:60px!important;max-height:none!important;
 overflow-y:auto!important;overscroll-behavior:contain;
}
#ntv-game-root.ntv-device-mobile .ntv-play.ntv-mobile-chat-open .ntv-mobile-chat-close {
 display:inline-flex!important; align-items:center;justify-content:center;
 width:40px;height:40px;flex:0 0 40px; margin-left:6px;
 border:2px solid #1b3932;background:#fff5db;color:#134238;
 border-radius:12px;font-size:20px;font-weight:900;
}
#ntv-game-root.ntv-device-mobile .ntv-play.ntv-mobile-chat-open .ntv-chatbox-head{flex-wrap:nowrap;gap:4px;}
#ntv-game-root.ntv-device-mobile .ntv-play.ntv-mobile-chat-open .ntv-chat-compose{flex:0 0 auto;}
@media(max-width:359px){#ntv-game-root.ntv-device-mobile .ntv-play.ntv-mobile-chat-open .ntv-room-side .ntv-chatbox{height:min(72dvh,510px)!important;}}
@media(prefers-reduced-motion:no-preference){#ntv-game-root.ntv-device-mobile .ntv-mobile-chat-fab-circle{transition:transform .16s ease;}#ntv-game-root.ntv-device-mobile .ntv-mobile-chat-fab:active .ntv-mobile-chat-fab-circle{transform:scale(.94);}}
/* The existing moves-tab rule is intentionally strong: explicitly override only while the sheet is open. */
#ntv-game-root.ntv-device-mobile .ntv-play.ntv-mobile-chat-open[data-ntv-layout="mobile"][data-mobile-panel="moves"] .ntv-room-grid .ntv-chatbox{display:flex!important;}
/* Bot play has no room chat; do not advertise a non-working control. */
#ntv-game-root.ntv-device-mobile .ntv-play.ntv-bot-game .ntv-mobile-chat-fab,
#ntv-game-root.ntv-device-mobile .ntv-play.ntv-bot-game .ntv-mobile-chat-backdrop{display:none!important;}
