/* Nối Từ Việt 3.9.9 — Mobile-first play priority.
 * Minimal reference principle: game modes and answer actions first; secondary
 * profile, achievements, conversation, and illustration afterwards.
 * ONLY affects .ntv-device-mobile; existing PC 3.9.8 workspace remains untouched.
 */
#ntv-game-root.ntv-device-mobile,
#ntv-game-root.ntv-device-mobile * { min-width:0; }
#ntv-game-root.ntv-device-mobile .ntv-home,
#ntv-game-root.ntv-device-mobile .ntv-play { max-width:100%; }
#ntv-game-root.ntv-device-mobile :is(button, input, textarea, select) { touch-action:manipulation; }
#ntv-game-root.ntv-device-mobile :is(button, [role="button"]) { -webkit-tap-highlight-color:transparent; }
#ntv-game-root.ntv-device-mobile :is(button, input, textarea, select):focus-visible { outline:3px solid #f8dd77;outline-offset:2px; }

/* Home — rank prominent game choices ahead of decoration and score details. */
#ntv-game-root.ntv-device-mobile .ntv-home[data-ntv-layout="mobile"] {
  display:flex!important; flex-direction:column!important;gap:8px!important;
  padding:10px 10px calc(18px + env(safe-area-inset-bottom,0px))!important;
  border-radius:18px!important;min-height:0!important;
}
#ntv-game-root.ntv-device-mobile .ntv-home[data-ntv-layout="mobile"]>.ntv-home-header {order:0;min-height:40px!important;gap:8px;margin:0!important;}
#ntv-game-root.ntv-device-mobile .ntv-home[data-ntv-layout="mobile"] .ntv-brand{font-size:clamp(17px,5vw,22px);}
#ntv-game-root.ntv-device-mobile .ntv-home[data-ntv-layout="mobile"]>.ntv-player-strip {
  order:1;display:grid!important;grid-template-columns:minmax(0,1fr) 88px!important;
  align-items:stretch;gap:7px!important;margin:0!important;
}
#ntv-game-root.ntv-device-mobile .ntv-home[data-ntv-layout="mobile"] .ntv-profile-card {
  flex:none!important;min-height:60px!important;padding:7px 9px!important;gap:8px;border-radius:14px;
}
#ntv-game-root.ntv-device-mobile .ntv-home[data-ntv-layout="mobile"] .ntv-profile-avatar{width:41px!important;height:41px!important;flex:0 0 41px!important;}
#ntv-game-root.ntv-device-mobile .ntv-home[data-ntv-layout="mobile"] .ntv-profile-name {font-size:14px;line-height:1.2;}
#ntv-game-root.ntv-device-mobile .ntv-home[data-ntv-layout="mobile"] .ntv-profile-text small:last-child {display:none!important;}
#ntv-game-root.ntv-device-mobile .ntv-home[data-ntv-layout="mobile"] .ntv-cup-card {
  width:auto!important;min-width:0!important;flex:none!important;min-height:60px!important;
  padding:4px!important;border-radius:14px;gap:0!important;
}
#ntv-game-root.ntv-device-mobile .ntv-home[data-ntv-layout="mobile"] .ntv-cup-card>span{font-size:16px!important;line-height:1;}
#ntv-game-root.ntv-device-mobile .ntv-home[data-ntv-layout="mobile"] .ntv-cup-value{font-size:19px!important;line-height:1.08;}
#ntv-game-root.ntv-device-mobile .ntv-home[data-ntv-layout="mobile"] .ntv-cup-card>small{font-size:9px!important;line-height:1;}
#ntv-game-root.ntv-device-mobile .ntv-home[data-ntv-layout="mobile"]>.ntv-home-grid {order:2;display:block!important;width:100%;margin:0!important;}
#ntv-game-root.ntv-device-mobile .ntv-home[data-ntv-layout="mobile"] .ntv-home-core {display:flex!important;flex-direction:column!important;gap:0!important;}
#ntv-game-root.ntv-device-mobile .ntv-home[data-ntv-layout="mobile"] .ntv-home-core>.ntv-section-heading {
  order:0!important;font-size:16px!important;margin:5px 0 9px!important;text-align:left!important;
}
#ntv-game-root.ntv-device-mobile .ntv-home[data-ntv-layout="mobile"] .ntv-home-core>.ntv-modes {
  order:1!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:8px!important;margin:0!important;width:100%;
}
#ntv-game-root.ntv-device-mobile .ntv-home[data-ntv-layout="mobile"] .ntv-mode {
  min-width:0!important;min-height:83px!important;padding:9px 6px!important;
  gap:3px!important;border-radius:16px!important;
}
#ntv-game-root.ntv-device-mobile .ntv-home[data-ntv-layout="mobile"] .ntv-mode-icon {font-size:27px!important;line-height:1.2!important;animation:none!important;}
#ntv-game-root.ntv-device-mobile .ntv-home[data-ntv-layout="mobile"] .ntv-mode strong {font-size:clamp(12px,3.6vw,15px)!important;line-height:1.2!important;}
#ntv-game-root.ntv-device-mobile .ntv-home[data-ntv-layout="mobile"] .ntv-mode-quiz {
  grid-column:1/-1!important;min-height:50px!important;display:flex!important;flex-direction:row!important;
  gap:12px!important;justify-content:center!important;align-items:center!important;
}
#ntv-game-root.ntv-device-mobile .ntv-home[data-ntv-layout="mobile"] .ntv-mode-quiz .ntv-mode-icon {font-size:24px!important;}
#ntv-game-root.ntv-device-mobile .ntv-home[data-ntv-layout="mobile"] .ntv-home-core>.ntv-hero{order:2!important;max-width:100%;margin:12px 0 0!important;min-height:0!important;border-radius:14px;}
#ntv-game-root.ntv-device-mobile .ntv-home[data-ntv-layout="mobile"] .ntv-hero-art{height:clamp(95px,30vw,150px)!important;animation:none!important;}
#ntv-game-root.ntv-device-mobile .ntv-home[data-ntv-layout="mobile"] .ntv-mobile-discover{order:3!important;margin-top:12px!important;gap:9px!important;}
#ntv-game-root.ntv-device-mobile .ntv-home[data-ntv-layout="mobile"] .ntv-retain-zone{padding:10px!important;margin:0!important;}
#ntv-game-root.ntv-device-mobile .ntv-home[data-ntv-layout="mobile"] .ntv-retain-card{min-height:53px!important;padding:8px 10px!important;}
#ntv-game-root.ntv-device-mobile .ntv-home[data-ntv-layout="mobile"]>.ntv-character-shortcut {order:3;min-height:43px!important;margin:4px 0 0!important;}
#ntv-game-root.ntv-device-mobile .ntv-home[data-ntv-layout="mobile"]>.ntv-honor-strip {
  order:4;min-height:37px!important;padding:6px 7px!important;gap:6px!important;
  flex-wrap:wrap!important;margin:0!important;justify-content:center!important;
}
#ntv-game-root.ntv-device-mobile .ntv-home[data-ntv-layout="mobile"] .ntv-honor-strip span{font-size:10px!important;}
#ntv-game-root.ntv-device-mobile .ntv-home[data-ntv-layout="mobile"]>.ntv-bottom-menu{order:5;margin:3px 0 0!important;gap:6px!important;}
#ntv-game-root.ntv-device-mobile .ntv-home[data-ntv-layout="mobile"] .ntv-bottom-menu button{min-width:0;min-height:48px!important;padding:5px 2px!important;}

/* Room — the current word, prompt and response form MUST precede spectator details. */
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"]{
 padding:8px 8px calc(18px + env(safe-area-inset-bottom,0px))!important;min-height:0!important;
 border-radius:16px!important;
}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"]>.ntv-topbar{min-height:36px!important;gap:8px!important;flex-wrap:nowrap!important;margin:0 0 7px!important;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-topbar .ntv-smallbtn{flex:1;min-height:36px!important;padding:5px 7px!important;font-size:12px!important;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-room-shell{margin:0!important;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-room-main{display:flex!important;flex-direction:column;gap:7px!important;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-mobile-room-header{
 order:0;display:flex!important;flex-direction:column!important;gap:3px!important;
 padding:8px 10px!important;border-width:1.5px!important;border-radius:13px!important;
}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-mobile-room-header .ntv-heading{display:none!important;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-room-name{
 font-size:clamp(16px,4.4vw,20px)!important;line-height:1.2!important;margin:0!important;
}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-room-identity{
 gap:4px!important;margin:0!important;align-items:center!important;flex-wrap:wrap!important;
}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-roomcode {font-size:11px!important;line-height:1.2!important;margin:0!important;text-align:left!important;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-room-visibility {font-size:10px!important;padding:2px 6px!important;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-cup-rule {
 min-height:0!important;padding:4px 6px!important;margin:1px 0 0!important;
 font-size:11px!important;line-height:1.35!important;border-radius:8px!important;
}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-room-main>.ntv-match-card{
 order:1;margin:0!important;padding:9px 8px!important;border-radius:16px!important;
 display:flex!important;flex-direction:column;gap:0;min-width:0;
}
/* Dynamic display:none from the game engine still takes precedence. */
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-match-card[style*="display: none"]{display:none!important;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-room-main>.ntv-quiz{order:1;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-room-main>[data-role="lobby"]{order:1;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-match-card>.ntv-boardplate{order:0;margin:1px 0 6px!important;padding:10px 8px!important;border-radius:14px!important;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-boardplate small{font-size:11px!important;line-height:1.2!important;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-boardplate .ntv-word{font-size:clamp(29px,8.2vw,39px)!important;line-height:1.13!important;margin:5px 0!important;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-next{font-size:12px!important;line-height:1.3!important;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-match-card>.ntv-turn-banner{order:1;margin:5px 0 4px!important;padding:7px 8px!important;border-radius:11px!important;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-match-card>.ntv-status{order:2;margin:2px 0!important;min-height:0!important;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-match-card>.ntv-input-label{order:3;margin:5px 0 6px!important;font-size:12px!important;line-height:1.3!important;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-match-card>.ntv-input-row{order:4;display:flex!important;gap:5px!important;width:100%!important;align-items:stretch!important;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-prefix{
 flex:0 0 auto!important;max-width:27%!important;min-width:38px!important;padding:5px 7px!important;
 font-size:14px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-continuation .ntv-field{
 flex:1 1 0!important;width:1%!important;min-width:0!important;max-width:100%!important;
 height:48px!important;font-size:16px!important;padding:7px 9px!important;border-radius:11px!important;
}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-continuation .ntv-send{
 flex:0 0 auto!important;min-width:59px!important;min-height:48px!important;padding:7px 9px!important;
 font-size:14px!important;border-radius:12px!important;white-space:nowrap;
}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-match-card>.ntv-preview{order:5;margin:3px 0!important;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-match-card>.ntv-tries{order:6;margin:3px 0!important;font-size:11px!important;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-match-card>.ntv-meaning-card{
 order:7;margin:8px 0 1px!important;padding:7px 9px!important;border-radius:12px!important;
}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-meaning-head{font-size:12px!important;margin:0 0 3px!important;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-meaning-text{font-size:12px!important;line-height:1.36!important;}
/* Three-player rooms should show all seats without a hidden horizontal carousel.
   For larger rooms, an additional row is clearer than cutting off active players. */
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-room-main>.ntv-member-list {
 order:2;display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;
 overflow:visible!important;max-height:none!important;
 padding:5px 2px 9px!important;margin:2px 0 0!important;gap:6px!important;
}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-member-list .ntv-person{
 flex:none!important;min-width:0!important;min-height:106px!important;padding:6px 2px!important;
 gap:1px!important;border-radius:13px!important;
}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-person-name {
 overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;max-width:100%!important;
}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-person-avatar-wrap {width:42px!important;height:42px!important;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-person-avatar{width:40px!important;height:40px!important;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-person-name{font-size:11px!important;line-height:1.2!important;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-person>small{font-size:9px!important;line-height:1.2!important;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-person>.ntv-player-title,
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-person>.ntv-person-wardrobe,
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-person>.ntv-player-badges{display:none!important;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-member-state{font-size:9px!important;line-height:1.25!important;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-room-main>.ntv-group-rule{order:3;margin:1px 0!important;padding:7px 8px!important;font-size:11px!important;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-room-main>.ntv-voice-panel{order:4;margin:3px 0!important;padding:8px!important;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-room-main>.ntv-voice-panel:empty{display:none!important;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-room-main>[data-role="result"]{order:5;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-room-main>.ntv-actionline-mobile{order:6;margin:3px 0!important;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-room-side{margin-top:9px!important;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-mobile-room-tabs{margin:0 0 7px!important;gap:6px!important;padding:5px!important;border-radius:13px!important;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-mobile-room-tabs button{min-height:43px!important;font-size:12px!important;border-radius:9px!important;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-chatbox{min-height:250px!important;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-chatbox-body{min-height:120px!important;max-height:min(38dvh,290px)!important;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-chat-input{font-size:16px!important;min-width:0!important;}
#ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-chat-compose button{min-height:42px!important;}

@media (max-width:359px){
 #ntv-game-root.ntv-device-mobile .ntv-home[data-ntv-layout="mobile"] .ntv-modes{gap:6px!important;}
 #ntv-game-root.ntv-device-mobile .ntv-home[data-ntv-layout="mobile"] .ntv-mode{min-height:77px!important;}
 #ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-input-label{font-size:11px!important;}
 #ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-prefix{max-width:25%!important;padding-inline:5px!important;}
 #ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-continuation .ntv-send{min-width:54px!important;padding-inline:5px!important;}
}
@media (min-width:600px) and (max-width:999px){
 /* Tablet: room still prioritizes input, but comfortable 2-column answers are preserved. */
 #ntv-game-root.ntv-device-mobile .ntv-home[data-ntv-layout="mobile"] .ntv-home-core>.ntv-modes{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
 #ntv-game-root.ntv-device-mobile .ntv-home[data-ntv-layout="mobile"] .ntv-mode-quiz{grid-column:auto!important;min-height:83px!important;flex-direction:column!important;}
 #ntv-game-root.ntv-device-mobile .ntv-play[data-ntv-layout="mobile"] .ntv-member-list .ntv-person{min-height:116px!important;}
}
@media (prefers-reduced-motion:reduce){
 #ntv-game-root.ntv-device-mobile .ntv-mode-icon,#ntv-game-root.ntv-device-mobile .ntv-hero-art {animation:none!important;}
}
