/* Nối Từ Việt 3.9: all game screens adapt to the shortcode's REAL width.
   Device tiers (measured by game.js): tiny <380, phone 380–599,
   tablet 600–999, laptop 1000–1199, desktop >=1200 CSS px.
   Loaded after the legacy/game/PC/mobile styles to prevent conflicting grids. */
.ntv-game-embed,
.ntv-game-embed #ntv-game-root{width:100%;min-width:0;max-width:100%;margin-inline:auto;box-sizing:border-box}
#ntv-game-root.ntv-device-mobile,
#ntv-game-root.ntv-device-pc,
.ntv-game-embed #ntv-game-root.ntv-device-mobile,
.ntv-game-embed #ntv-game-root.ntv-device-pc{width:100%;max-width:100%;min-width:0}
#ntv-game-root .ntv-home,#ntv-game-root .ntv-play,#ntv-game-root .ntv-room-shell,
#ntv-game-root .ntv-home-grid,#ntv-game-root .ntv-home-core,#ntv-game-root .ntv-home-sidebar,
#ntv-game-root .ntv-room-main,#ntv-game-root .ntv-room-side,
#ntv-game-root .ntv-room-grid,#ntv-game-root .ntv-chatbox,#ntv-game-root .ntv-quiz,
#ntv-game-root .ntv-home-panels,#ntv-game-root .ntv-retain-zone,
#ntv-game-root .ntv-account-shortcuts,#ntv-game-root .ntv-room-search-results{min-width:0;max-width:100%}
#ntv-game-root .ntv-room-identity,#ntv-game-root .ntv-person,
#ntv-game-root .ntv-room-result,#ntv-game-root .ntv-chat-item,
#ntv-game-root .ntv-chat-main,#ntv-game-root .ntv-quiz-choice,
#ntv-game-root .ntv-quiz-pair-column{min-width:0}
#ntv-game-root :is(.ntv-word,.ntv-room-name,.ntv-quiz-question,.ntv-chat-bubble,.ntv-person-name,.ntv-pair,.ntv-mode strong,.ntv-feed-line){overflow-wrap:anywhere}
#ntv-game-root :is(.ntv-quiz-tile,.ntv-quiz-choice,.ntv-quiz-pair-left,.ntv-quiz-pair-right,.ntv-quiz-wordtoken,.ntv-gold-btn,.ntv-smallbtn){touch-action:manipulation}
#ntv-game-root .ntv-topbar{flex-wrap:wrap}
#ntv-game-root .ntv-quiz-controls button{white-space:normal}
#ntv-game-root .ntv-quiz-score-title{line-height:1.25}
#ntv-game-root .ntv-room-search-results{overflow-x:hidden}
#ntv-game-root .ntv-room-result{word-break:normal}
#ntv-game-root .ntv-room-result-info{min-width:0}
#ntv-game-root .ntv-room-result-info strong{overflow-wrap:anywhere}
#ntv-game-root .ntv-voice-actions{max-width:100%}
#ntv-game-root .ntv-chatbox{max-width:100%}
#ntv-game-root .ntv-quiz-text-form>div{min-width:0}
#ntv-game-root .ntv-quiz-text-form .ntv-field{min-width:0;max-width:100%}
#ntv-game-root .ntv-modal{max-width:min(100%,940px);min-width:0}
#ntv-game-root .ntv-modal-head{min-width:0}
#ntv-game-root .ntv-modal-head h2{min-width:0;overflow-wrap:anywhere}
#ntv-game-root .ntv-auth-screen,#ntv-game-root .ntv-auth-card{max-width:100%;min-width:0}

/* Tiny phones (320–379): dense app, one column for everything except simple pairs. */
#ntv-game-root.ntv-size-tiny{padding:0 1px}
#ntv-game-root.ntv-size-tiny .ntv-home,#ntv-game-root.ntv-size-tiny .ntv-play{padding:9px 7px 16px;border-width:2px;border-radius:15px}
#ntv-game-root.ntv-size-tiny .ntv-home-header{gap:5px}
#ntv-game-root.ntv-size-tiny .ntv-brand{min-width:0;font-size:clamp(15px,5vw,19px)}
#ntv-game-root.ntv-size-tiny .ntv-player-strip{flex-wrap:wrap;gap:7px}
#ntv-game-root.ntv-size-tiny .ntv-profile-card{flex:1 1 100%}
#ntv-game-root.ntv-size-tiny .ntv-cup-card{flex:1 1 100%;justify-content:center;gap:12px}
#ntv-game-root.ntv-size-tiny .ntv-honor-strip{gap:5px;flex-wrap:wrap;padding:8px}
#ntv-game-root.ntv-size-tiny .ntv-honor-strip span{font-size:11px}
#ntv-game-root.ntv-size-tiny .ntv-home-core>.ntv-modes{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
#ntv-game-root.ntv-size-tiny .ntv-mode{min-height:92px;padding:8px 5px;border-radius:15px}
#ntv-game-root.ntv-size-tiny .ntv-mode strong{font-size:13px;line-height:1.2}
#ntv-game-root.ntv-size-tiny .ntv-mode-icon{font-size:28px}
#ntv-game-root.ntv-size-tiny .ntv-home-core>.ntv-hero{margin:9px 0}
#ntv-game-root.ntv-size-tiny .ntv-hero-art{height:140px}
#ntv-game-root.ntv-size-tiny .ntv-retain-zone{padding:10px}
#ntv-game-root.ntv-size-tiny .ntv-retain-card{grid-template-columns:34px minmax(0,1fr) 18px!important;padding:8px}
#ntv-game-root.ntv-size-tiny .ntv-bottom-menu button{font-size:10px;padding-inline:3px;min-width:0}
#ntv-game-root.ntv-size-tiny .ntv-mobile-room-header{padding:8px}
#ntv-game-root.ntv-size-tiny .ntv-room-name{font-size:18px}
#ntv-game-root.ntv-size-tiny .ntv-member-list .ntv-person{flex-basis:112px;min-width:112px}
#ntv-game-root.ntv-size-tiny .ntv-match-card{padding:9px 7px}
#ntv-game-root.ntv-size-tiny .ntv-boardplate{padding:12px 6px;margin:5px 0}
#ntv-game-root.ntv-size-tiny .ntv-word{font-size:clamp(24px,8vw,34px)}
#ntv-game-root.ntv-size-tiny .ntv-input-row{gap:3px}
#ntv-game-root.ntv-size-tiny .ntv-prefix{max-width:30%;min-width:38px;padding:6px}
#ntv-game-root.ntv-size-tiny .ntv-continuation .ntv-send{padding:8px 5px;font-size:13px}
#ntv-game-root.ntv-size-tiny .ntv-chat-icons{gap:3px}
#ntv-game-root.ntv-size-tiny .ntv-chat-tools{gap:3px}
#ntv-game-root.ntv-size-tiny .ntv-chatbox-head{padding:7px 6px}
#ntv-game-root.ntv-size-tiny .ntv-chat-input{padding-inline:7px}
#ntv-game-root.ntv-size-tiny .ntv-quiz{padding:10px 7px}
#ntv-game-root.ntv-size-tiny .ntv-quiz-head{gap:5px}
#ntv-game-root.ntv-size-tiny .ntv-quiz-head b{font-size:15px}
#ntv-game-root.ntv-size-tiny .ntv-quiz-timer{font-size:16px;padding:7px}
#ntv-game-root.ntv-size-tiny .ntv-quiz-question{font-size:19px;margin:12px 0}
#ntv-game-root.ntv-size-tiny .ntv-quiz-match-grid{gap:6px}
#ntv-game-root.ntv-size-tiny .ntv-quiz-choices{grid-template-columns:1fr}
#ntv-game-root.ntv-size-tiny .ntv-quiz-choice{min-height:52px;font-size:14px}
#ntv-game-root.ntv-size-tiny .ntv-room-search-results{grid-template-columns:1fr}
#ntv-game-root.ntv-size-tiny .ntv-search-row{flex-wrap:wrap}
#ntv-game-root.ntv-size-tiny .ntv-search-row>button{flex:1 1 100%}
#ntv-game-root.ntv-size-tiny .ntv-account-shortcuts{grid-template-columns:1fr}
#ntv-game-root.ntv-size-tiny .ntv-modal{padding:12px 9px;max-height:calc(100dvh - 14px)}

/* Standard phone (380–599): large tap targets, stacked game + chat tabs. */
#ntv-game-root.ntv-size-phone .ntv-home,#ntv-game-root.ntv-size-phone .ntv-play{padding:12px 11px 19px}
#ntv-game-root.ntv-size-phone .ntv-home-core>.ntv-modes{grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}
#ntv-game-root.ntv-size-phone .ntv-mode{min-height:105px}
#ntv-game-root.ntv-size-phone .ntv-hero-art{height:clamp(165px,38vw,230px)}
#ntv-game-root.ntv-size-phone .ntv-member-list .ntv-person{flex-basis:132px}
#ntv-game-root.ntv-size-phone .ntv-quiz-choices{grid-template-columns:1fr}
#ntv-game-root.ntv-size-phone .ntv-quiz-choice{min-height:58px}
#ntv-game-root.ntv-size-phone .ntv-room-search-results{grid-template-columns:1fr}
#ntv-game-root.ntv-size-phone .ntv-account-shortcuts{grid-template-columns:1fr}
#ntv-game-root.ntv-size-phone .ntv-modal{max-height:calc(100dvh - 20px)}

/* Tablet / embedded narrow desktop (600–999): a distinct workspace using available
   width. The home puts game modes beside the schoolyard, chat beneath, avatar grid. */
#ntv-game-root.ntv-device-mobile.ntv-size-tablet .ntv-home{padding:18px}
#ntv-game-root.ntv-device-mobile.ntv-size-tablet .ntv-home-core{display:grid!important;grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);column-gap:14px;row-gap:11px;align-items:start}
#ntv-game-root.ntv-device-mobile.ntv-size-tablet .ntv-home-core>.ntv-section-heading{grid-column:1/-1;order:0;margin-bottom:0}
#ntv-game-root.ntv-device-mobile.ntv-size-tablet .ntv-home-core>.ntv-modes{grid-column:1;order:1;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:0}
#ntv-game-root.ntv-device-mobile.ntv-size-tablet .ntv-home-core>.ntv-hero{grid-column:2;order:2;margin:0;min-height:0}
#ntv-game-root.ntv-device-mobile.ntv-size-tablet .ntv-hero-art{height:clamp(255px,34vw,345px)}
#ntv-game-root.ntv-device-mobile.ntv-size-tablet .ntv-home-core>.ntv-mobile-discover{grid-column:1/-1;order:3;margin-top:9px}
#ntv-game-root.ntv-device-mobile.ntv-size-tablet .ntv-mode{min-height:95px;padding:10px 7px}
#ntv-game-root.ntv-device-mobile.ntv-size-tablet .ntv-retain-cards{grid-template-columns:repeat(3,minmax(0,1fr))!important}
#ntv-game-root.ntv-device-mobile.ntv-size-tablet .ntv-retain-card{grid-template-columns:32px minmax(0,1fr)!important;gap:5px;min-height:74px;padding:9px}
#ntv-game-root.ntv-device-mobile.ntv-size-tablet .ntv-retain-emoji{font-size:22px}
#ntv-game-root.ntv-device-mobile.ntv-size-tablet .ntv-retain-link{display:none}
#ntv-game-root.ntv-device-mobile.ntv-size-tablet .ntv-home-panels{grid-template-columns:repeat(2,minmax(0,1fr))!important}
#ntv-game-root.ntv-device-mobile.ntv-size-tablet .ntv-member-list{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));overflow:visible;max-height:none}
#ntv-game-root.ntv-device-mobile.ntv-size-tablet .ntv-member-list .ntv-person{min-width:0;flex-basis:auto}
#ntv-game-root.ntv-device-mobile.ntv-size-tablet .ntv-quiz-choices{grid-template-columns:repeat(2,minmax(0,1fr))!important}
#ntv-game-root.ntv-device-mobile.ntv-size-tablet .ntv-quiz-choice{min-height:66px}
#ntv-game-root.ntv-device-mobile.ntv-size-tablet .ntv-quiz-text-form>div{flex-direction:row;align-items:stretch;gap:9px}
#ntv-game-root.ntv-device-mobile.ntv-size-tablet .ntv-quiz-text-form .ntv-gold-btn{width:auto;flex:0 0 auto}
#ntv-game-root.ntv-device-mobile.ntv-size-tablet .ntv-quiz-match-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}
#ntv-game-root.ntv-device-mobile.ntv-size-tablet .ntv-room-search-results{grid-template-columns:repeat(2,minmax(0,1fr))}
#ntv-game-root.ntv-device-mobile.ntv-size-tablet .ntv-modal{max-width:min(96vw,830px)}
#ntv-game-root.ntv-device-mobile.ntv-size-tablet .ntv-account-shortcuts{grid-template-columns:repeat(3,minmax(0,1fr))}
#ntv-game-root.ntv-device-mobile.ntv-size-tablet .ntv-chatbox-body{max-height:320px}

/* Laptop (1000–1199): game is side-by-side but with a compact chat sidebar. */
#ntv-game-root.ntv-device-pc.ntv-size-laptop .ntv-home{padding:17px 18px 24px}
#ntv-game-root.ntv-device-pc.ntv-size-laptop .ntv-home-grid{grid-template-columns:minmax(0,1.55fr) minmax(295px,.85fr)!important;gap:14px!important}
#ntv-game-root.ntv-device-pc.ntv-size-laptop .ntv-home-core>.ntv-modes{grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
#ntv-game-root.ntv-device-pc.ntv-size-laptop .ntv-hero-art{height:185px}
#ntv-game-root.ntv-device-pc.ntv-size-laptop .ntv-play{padding:15px}
#ntv-game-root.ntv-device-pc.ntv-size-laptop .ntv-room-shell{grid-template-columns:minmax(0,1.38fr) minmax(295px,.75fr);gap:13px}
#ntv-game-root.ntv-device-pc.ntv-size-laptop .ntv-member-list{grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
#ntv-game-root.ntv-device-pc.ntv-size-laptop .ntv-person{padding:9px 5px;min-width:0}
#ntv-game-root.ntv-device-pc.ntv-size-laptop .ntv-chatbox{min-height:390px;height:min(59dvh,590px)}
#ntv-game-root.ntv-device-pc.ntv-size-laptop .ntv-chat-icons{gap:5px}
#ntv-game-root.ntv-device-pc.ntv-size-laptop .ntv-chatbox-head{padding:9px 8px}
#ntv-game-root.ntv-device-pc.ntv-size-laptop .ntv-quiz-choices{grid-template-columns:repeat(2,minmax(0,1fr))}
#ntv-game-root.ntv-device-pc.ntv-size-laptop .ntv-quiz-choice{font-size:14px;min-height:60px}
#ntv-game-root.ntv-device-pc.ntv-size-laptop .ntv-quiz{padding:14px}
#ntv-game-root.ntv-device-pc.ntv-size-laptop .ntv-room-search-results{grid-template-columns:repeat(2,minmax(0,1fr))}

/* Wide desktop (>=1200): full console workspace; ample player panel & chat. */
#ntv-game-root.ntv-device-pc.ntv-size-desktop .ntv-home{padding:23px clamp(21px,3vw,34px) 30px}
#ntv-game-root.ntv-device-pc.ntv-size-desktop .ntv-home-grid{grid-template-columns:minmax(0,1.8fr) minmax(330px,.83fr)!important;gap:22px!important}
#ntv-game-root.ntv-device-pc.ntv-size-desktop .ntv-home-core>.ntv-modes{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
#ntv-game-root.ntv-device-pc.ntv-size-desktop .ntv-hero-art{height:220px}
#ntv-game-root.ntv-device-pc.ntv-size-desktop .ntv-room-shell{grid-template-columns:minmax(0,1.45fr) minmax(370px,.8fr);gap:22px}
#ntv-game-root.ntv-device-pc.ntv-size-desktop .ntv-member-list{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
#ntv-game-root.ntv-device-pc.ntv-size-desktop .ntv-quiz-choices{grid-template-columns:repeat(2,minmax(0,1fr))}
#ntv-game-root.ntv-device-pc.ntv-size-desktop .ntv-chatbox{min-height:510px;height:min(65dvh,720px)}
#ntv-game-root.ntv-device-pc.ntv-size-desktop .ntv-room-search-results{grid-template-columns:repeat(3,minmax(0,1fr))}

/* Modal, profiles, chat, forms use the SAME effective width tier as the game. */
#ntv-game-root.ntv-size-tiny .ntv-modal,#ntv-game-root.ntv-size-phone .ntv-modal{width:min(100%,560px);border-radius:16px}
#ntv-game-root.ntv-size-tablet .ntv-modal{width:min(100%,830px)}
#ntv-game-root.ntv-size-laptop .ntv-modal,#ntv-game-root.ntv-size-desktop .ntv-modal{width:min(100%,920px)}
#ntv-game-root.ntv-size-tiny .ntv-public-profile,#ntv-game-root.ntv-size-phone .ntv-public-profile{max-width:100%}
#ntv-game-root.ntv-size-phone .ntv-quiz-score-title,#ntv-game-root.ntv-size-tiny .ntv-quiz-score-title{font-size:15px}
#ntv-game-root.ntv-size-tiny .ntv-room-identity,#ntv-game-root.ntv-size-phone .ntv-room-identity{justify-content:flex-start;text-align:left}
#ntv-game-root.ntv-size-tiny .ntv-voice-actions,#ntv-game-root.ntv-size-phone .ntv-voice-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
#ntv-game-root.ntv-size-tiny .ntv-voice-btn,#ntv-game-root.ntv-size-phone .ntv-voice-btn{min-width:0;white-space:normal}
#ntv-game-root.ntv-size-tablet .ntv-voice-actions{display:flex;flex-wrap:wrap}
#ntv-game-root.ntv-size-tablet .ntv-voice-actions .ntv-voice-btn{flex:1 1 auto}
#ntv-game-root.ntv-size-tiny .ntv-quiz-controls,#ntv-game-root.ntv-size-phone .ntv-quiz-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
#ntv-game-root.ntv-size-tiny .ntv-quiz-controls>button,#ntv-game-root.ntv-size-phone .ntv-quiz-controls>button{min-width:0;font-size:13px;padding:8px 5px}
#ntv-game-root.ntv-size-tablet .ntv-quiz-controls>button{min-width:150px}
#ntv-game-root.ntv-size-phone .ntv-home .ntv-home-panels,#ntv-game-root.ntv-size-tiny .ntv-home .ntv-home-panels{grid-template-columns:1fr}

/* Prevent nonessential animations and heavy shadows on small screens. */
#ntv-game-root.ntv-size-tiny .ntv-hero-art,#ntv-game-root.ntv-size-phone .ntv-hero-art{animation:none}
@media (prefers-reduced-motion:reduce){#ntv-game-root *{scroll-behavior:auto}}
