/* Nối Từ Việt Online v3.9.24 — responsive, server-backed Top 1–20 leaderboard */
#ntv-game-root .ntv-modal:has(.ntv-leaderboard-v3924){
  box-sizing:border-box; width:min(1050px,calc(100vw - 24px));max-width:1050px;
  max-height:calc(100dvh - 26px);overflow:auto;background:#f2fff5;color:#143e37;
  border:3px solid #f7c75b;border-radius:24px;box-shadow:0 22px 65px #002b2baf;padding:15px;
}
#ntv-game-root .ntv-modal:has(.ntv-leaderboard-v3924) .ntv-modal-head{padding:3px 6px 12px;border-bottom:1px solid #b6ddca}
#ntv-game-root .ntv-modal:has(.ntv-leaderboard-v3924) .ntv-modal-head h2{font-size:clamp(20px,2.6vw,28px);color:#076353;text-shadow:none}
#ntv-game-root .ntv-modal:has(.ntv-leaderboard-v3924) .ntv-modal-head button{min-width:42px;min-height:42px;background:#0b7568;color:white;border-radius:11px}
#ntv-game-root .ntv-leaderboard-v3924{font-family:inherit;color:#14473e;min-width:0;line-height:1.35}
#ntv-game-root .ntv-leaderboard-v3924 *{box-sizing:border-box}
#ntv-game-root .ntv-lb-heading{margin:14px 0 12px;padding:16px 17px;display:flex;gap:14px;align-items:center;border-radius:18px;background:linear-gradient(110deg,#006b60,#0ca893 60%,#67dbc0);color:#fff;box-shadow:0 4px 0 #0b6558}
#ntv-game-root .ntv-lb-heading-icon{font-size:35px;filter:drop-shadow(0 3px 2px #104c37)}
#ntv-game-root .ntv-lb-heading h3{font-size:clamp(19px,2.5vw,26px);margin:0;color:#fff6c7;line-height:1.1}
#ntv-game-root .ntv-lb-heading p{margin:4px 0 0;color:#e5fff8;font-size:12px}
#ntv-game-root .ntv-lb-total{margin-left:auto;white-space:nowrap;font-size:12px;font-weight:700;background:#ffffff30;border:1px solid #ffffff55;border-radius:999px;padding:7px 10px}
#ntv-game-root .ntv-lb-tabs{display:flex;gap:7px;max-width:100%;overflow-x:auto;scrollbar-width:thin;padding:4px 0 10px;overscroll-behavior-inline:contain}
#ntv-game-root .ntv-lb-tabs button{border:1.5px solid #8bbfb0;border-radius:999px;flex:0 0 auto;background:#fffdf1;color:#175349;font-size:13px;font-weight:800;padding:10px 15px;min-height:42px;cursor:pointer;box-shadow:0 3px 0 #b3ccbe}
#ntv-game-root .ntv-lb-tabs button.active{border-color:#126b5a;color:#fff;background:linear-gradient(#17bb95,#078767);box-shadow:0 3px 0 #075a49}
#ntv-game-root .ntv-lb-tabs button:focus-visible,#ntv-game-root .ntv-leaderboard-v3924 button:focus-visible{outline:3px solid #f6c344;outline-offset:2px}
#ntv-game-root .ntv-lb-tab-description{display:flex;justify-content:space-between;gap:10px;align-items:center;color:#32685d;font-size:13px;margin:0 2px 10px}
#ntv-game-root .ntv-lb-tab-description button{border:0;background:#d9f5e6;border-radius:9px;color:#0e6750;font-weight:800;cursor:pointer;padding:7px 10px}
#ntv-game-root .ntv-lb-podium{display:flex;align-items:flex-end;justify-content:center;gap:12px;padding:28px 6px 13px;margin:4px 0 8px;background:radial-gradient(ellipse at 50% 65%,#fff3c5 0,#f4fff1 66%,transparent 90%);border-radius:19px;min-height:260px}
#ntv-game-root .ntv-lb-podium-card{position:relative;isolation:isolate;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-width:0;flex:1 1 0;max-width:260px;min-height:216px;padding:31px 8px 16px;cursor:pointer;border-radius:22px 22px 15px 15px;color:#3c391c;border:2px solid #d9c892;box-shadow:0 8px 0 #b2a36d80,0 18px 27px #1d493524;overflow:visible}
#ntv-game-root .ntv-lb-podium-card.ntv-lb-gold{order:2;z-index:3;min-height:257px;border:3px solid #ffcd48;background:linear-gradient(158deg,#fffce0 0,#ffe4a0 56%,#f7bd53 100%);box-shadow:0 9px 0 #b88932,0 15px 30px #9b6a2470}
#ntv-game-root .ntv-lb-podium-card.ntv-lb-silver{order:1;background:linear-gradient(150deg,#fff 2%,#e4f1f9 63%,#bfd3dd);border-color:#a4b9c5;box-shadow:0 8px 0 #9daeb8,0 14px 25px #28485433}
#ntv-game-root .ntv-lb-podium-card.ntv-lb-bronze{order:3;background:linear-gradient(150deg,#ffefdb,#f6cda6 70%,#dda67a);border-color:#c99468;box-shadow:0 8px 0 #ac7855,0 14px 25px #6d402833}
#ntv-game-root .ntv-lb-halo{position:absolute;inset:5px 15% auto;height:120px;z-index:-1;border-radius:50%;background:radial-gradient(ellipse,#fffdeeb3,transparent 72%);pointer-events:none}
#ntv-game-root .ntv-lb-podium-medal{position:absolute;top:-25px;left:50%;transform:translateX(-50%);width:48px;height:48px;display:flex;justify-content:center;align-items:center;border-radius:50%;font-size:29px;background:#fff9d8;border:2px solid #f6d76c;box-shadow:0 3px 0 #b4a367}
#ntv-game-root .ntv-lb-gold .ntv-lb-podium-medal{width:59px;height:59px;top:-35px;font-size:38px;background:linear-gradient(#fffac4,#ffc945);border:3px solid #b98220}
#ntv-game-root .ntv-lb-portrait{display:inline-flex;align-items:center;justify-content:center;position:relative;flex-shrink:0;width:56px;height:56px;border-radius:50%;background:linear-gradient(#fff,#def1fc);box-shadow:inset 0 0 0 2px #d7eedf,0 2px 8px #154c2830;overflow:hidden;font-size:28px}
#ntv-game-root .ntv-lb-portrait img,#ntv-game-root .ntv-lb-portrait .ntv-sprite-stack,#ntv-game-root .ntv-lb-portrait .ntv-sprite-character{width:100%!important;height:100%!important;max-width:100%;object-fit:cover;display:block}
#ntv-game-root .ntv-lb-podium .ntv-lb-portrait{width:80px;height:80px;border:4px solid #fff;box-shadow:0 4px 12px #80582655}
#ntv-game-root .ntv-lb-gold .ntv-lb-portrait{width:99px;height:99px;border:5px solid #fffce4;box-shadow:0 0 0 4px #f3c546,0 4px 18px #b68d3b8f}
#ntv-game-root .ntv-lb-name{font-size:clamp(13px,1.6vw,17px);font-weight:900;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#ntv-game-root .ntv-lb-title{font-size:11px;color:#536655;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#ntv-game-root .ntv-lb-score{font-size:clamp(12px,1.5vw,16px);font-weight:900;color:#77500c;background:#ffffffe0;border-radius:20px;padding:5px 10px;white-space:nowrap;max-width:100%;text-overflow:ellipsis;overflow:hidden}
#ntv-game-root .ntv-lb-base{font-weight:900;font-size:12px;letter-spacing:1px;opacity:.78;margin-top:3px}
#ntv-game-root .ntv-lb-sparkle{position:absolute;top:-24px;right:4px;color:#ffa300;text-shadow:0 0 8px #fff;pointer-events:none}
#ntv-game-root .ntv-lb-section-title{color:#0f6959;font-size:17px;margin:16px 0 9px;padding:0 5px}
#ntv-game-root .ntv-lb-list{display:grid;grid-template-columns:1fr 1fr;gap:9px}
#ntv-game-root .ntv-lb-list.ntv-lb-compact{gap:6px}
#ntv-game-root .ntv-lb-entry{display:flex;align-items:center;gap:9px;width:100%;min-width:0;text-align:left;cursor:pointer;border:1.6px solid #d4e9da;background:#fffefa;border-radius:14px;padding:9px 10px;color:#184337;box-shadow:0 3px 0 #badcc7}
#ntv-game-root .ntv-lb-entry.ntv-lb-elite{border-color:#5ecfb6;background:linear-gradient(115deg,#e3fff5,#fffdf1)}
#ntv-game-root .ntv-lb-entry.ntv-lb-pro{border-color:#9dd6ef;background:#f4fbff}
#ntv-game-root .ntv-lb-entry.ntv-lb-rising{border-color:#d4bbec;background:#fbf7ff}
#ntv-game-root .ntv-lb-entry.ntv-lb-challenger{border-color:#d8e1e2}
#ntv-game-root .ntv-lb-position{display:flex;align-items:center;justify-content:center;min-width:36px;height:36px;border-radius:11px;background:linear-gradient(#d1f5e8,#a6dfcd);color:#08715d;font-size:14px;font-weight:900}
#ntv-game-root .ntv-lb-pro .ntv-lb-position{background:#d1ebfc;color:#15608a}
#ntv-game-root .ntv-lb-rising .ntv-lb-position{background:#eadffd;color:#70469b}
#ntv-game-root .ntv-lb-challenger .ntv-lb-position{background:#e6ebed;color:#4e6b73}
#ntv-game-root .ntv-lb-person{display:flex;flex-direction:column;min-width:0;flex:1}
#ntv-game-root .ntv-lb-person strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:13px}
#ntv-game-root .ntv-lb-person small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#688179;font-size:10px}
#ntv-game-root .ntv-lb-entry-score{font-weight:800;text-align:right;white-space:nowrap;font-size:12px;color:#17644f;min-width:80px}
#ntv-game-root .ntv-lb-progress{display:block;height:5px;background:linear-gradient(90deg,#18b98d var(--ntv-lb-fill),#dbece6 var(--ntv-lb-fill));border-radius:8px;margin-top:6px}
#ntv-game-root .ntv-lb-arrow{font-size:23px;color:#77ad95}
#ntv-game-root .ntv-lb-compact .ntv-lb-portrait{width:40px;height:40px}
#ntv-game-root .ntv-lb-compact .ntv-lb-entry{padding:5px 8px}
#ntv-game-root .ntv-lb-current{margin-top:18px;padding:12px;border-radius:16px;background:#dcfaea;border:2px solid #39b697}
#ntv-game-root .ntv-lb-current h4{margin:0 0 9px;color:#12644c}
#ntv-game-root .ntv-lb-me{outline:2px dashed #19a77c;outline-offset:2px}
#ntv-game-root .ntv-lb-footnote{color:#687e73;font-size:11px;line-height:1.5;margin:18px 3px 4px}
#ntv-game-root .ntv-lb-loading,#ntv-game-root .ntv-lb-empty{padding:40px 22px;text-align:center;background:#e9faf1;border-radius:14px;font-weight:700;color:#35755e;min-height:130px}
@media (hover:hover) and (prefers-reduced-motion:no-preference){
  #ntv-game-root .ntv-lb-motion .ntv-lb-podium-card,#ntv-game-root .ntv-lb-motion .ntv-lb-entry{transition:transform .2s ease,filter .2s ease}
  #ntv-game-root .ntv-lb-motion .ntv-lb-podium-card:hover,#ntv-game-root .ntv-lb-motion .ntv-lb-entry:hover{transform:translateY(-3px);filter:brightness(1.025)}
}
@media (prefers-reduced-motion:no-preference){
  #ntv-game-root .ntv-lb-motion .ntv-lb-gold .ntv-lb-sparkle{animation:ntv-lb-glint 3.6s ease-in-out infinite}
  @keyframes ntv-lb-glint{0%,100%{opacity:.45;transform:scale(.95)}50%{opacity:1;transform:scale(1.12)}}
}
@media(max-width:720px){
  #ntv-game-root .ntv-modal:has(.ntv-leaderboard-v3924){max-width:100%;padding:10px 9px;border-radius:17px;max-height:calc(100dvh - 12px)}
  #ntv-game-root .ntv-lb-heading{padding:13px 12px;gap:10px}
  #ntv-game-root .ntv-lb-heading-icon{font-size:26px}
  #ntv-game-root .ntv-lb-heading h3{font-size:19px}
  #ntv-game-root .ntv-lb-heading p{font-size:10px}
  #ntv-game-root .ntv-lb-total{display:none}
  #ntv-game-root .ntv-lb-tabs button{font-size:12px;padding:9px 12px}
  #ntv-game-root .ntv-lb-podium{gap:6px;padding:27px 0 12px;min-height:210px}
  #ntv-game-root .ntv-lb-podium-card{padding:28px 4px 10px;min-height:172px;border-radius:17px 17px 12px 12px}
  #ntv-game-root .ntv-lb-podium-card.ntv-lb-gold{min-height:214px}
  #ntv-game-root .ntv-lb-podium .ntv-lb-portrait{width:52px;height:52px;border-width:2px}
  #ntv-game-root .ntv-lb-gold .ntv-lb-portrait{width:68px;height:68px;border-width:3px}
  #ntv-game-root .ntv-lb-podium-medal{height:37px;width:37px;font-size:23px;top:-19px}
  #ntv-game-root .ntv-lb-gold .ntv-lb-podium-medal{width:45px;height:45px;font-size:28px;top:-26px}
  #ntv-game-root .ntv-lb-name{font-size:12px}
  #ntv-game-root .ntv-lb-title{font-size:9px}
  #ntv-game-root .ntv-lb-score{font-size:10px;padding:5px 4px}
  #ntv-game-root .ntv-lb-base{font-size:10px}
  #ntv-game-root .ntv-lb-section-title{font-size:14px}
  #ntv-game-root .ntv-lb-list{grid-template-columns:1fr;gap:7px}
  #ntv-game-root .ntv-lb-portrait{width:46px;height:46px}
  #ntv-game-root .ntv-lb-entry-score{font-size:11px;min-width:70px}
}
@media(max-width:360px){
  #ntv-game-root .ntv-lb-podium{gap:4px}
  #ntv-game-root .ntv-lb-podium .ntv-lb-portrait{width:44px;height:44px}
  #ntv-game-root .ntv-lb-gold .ntv-lb-portrait{width:55px;height:55px}
  #ntv-game-root .ntv-lb-name{font-size:11px}
  #ntv-game-root .ntv-lb-podium-card{min-height:163px}
  #ntv-game-root .ntv-lb-podium-card.ntv-lb-gold{min-height:199px}
  #ntv-game-root .ntv-lb-entry{gap:5px;padding:8px 6px}
  #ntv-game-root .ntv-lb-position{min-width:30px;height:31px;font-size:12px}
  #ntv-game-root .ntv-lb-entry-score{font-size:10px;min-width:65px}
}

/* A compact Top-3 preview on the game's existing homepage. */
#ntv-game-root .ntv-home-feed:has(.ntv-lb-home-row){max-height:none;min-height:0;overflow:visible}
#ntv-game-root .ntv-lb-home-row{display:flex;align-items:center;gap:7px;width:100%;border:1px solid #e5ce81;border-radius:9px;padding:5px 7px;margin:3px 0;min-height:30px;background:#fff4cd;color:#374c30;cursor:pointer;font-size:11px;text-align:left}
#ntv-game-root .ntv-lb-home-rank-1{background:linear-gradient(105deg,#fff3a6,#ffe1a7);border-color:#e9b845}
#ntv-game-root .ntv-lb-home-rank-2{background:#e5f3f8;border-color:#b8d8e3}
#ntv-game-root .ntv-lb-home-rank-3{background:#ffe7d2;border-color:#e4b68d}
#ntv-game-root .ntv-lb-home-medal{font-size:17px}
#ntv-game-root .ntv-lb-home-row b{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#ntv-game-root .ntv-lb-home-cups{white-space:nowrap;font-weight:800;color:#906011}

#ntv-game-root .ntv-lb-portrait>.ntv-sprite-391{width:100%;height:100%;border-radius:50%}

/* v3.9.29: leaderboard's generic !important sizing must not defeat VIP safe area. */
#ntv-game-root .ntv-lb-portrait[class*="ntv-frame-vip_"]:not(:has(>.ntv-sprite-391))>img{
  width:70%!important;height:70%!important;object-fit:cover!important;max-width:none!important;
  margin:auto!important;border-radius:50%!important;
}
#ntv-game-root .ntv-lb-portrait[class*="ntv-frame-vip_"]{overflow:visible!important;border:0!important;box-shadow:none!important}

/* v3.9.31: priority of sprite media and frame overlay at every podium size */
#ntv-game-root .ntv-lb-portrait{flex-shrink:0;aspect-ratio:1 / 1}
#ntv-game-root .ntv-lb-portrait:has(>.ntv-sprite-391){overflow:visible!important;border:0!important;background:transparent!important;box-shadow:none!important}
#ntv-game-root .ntv-lb-portrait:has(>.ntv-sprite-391)>.ntv-sprite-391{max-width:100%;max-height:100%;display:block}
#ntv-game-root .ntv-lb-portrait:not(:has(>.ntv-sprite-391))[class*="ntv-frame-vip_"]>img,
#ntv-game-root .ntv-lb-portrait:not(:has(>.ntv-sprite-391)).ntv-frame-custom>img{width:82%!important;height:82%!important;max-width:none!important}
/* Native flat avatar art contains transparent canvas margins. Crop/zoom the head inside the safe circle. */
#ntv-game-root .ntv-lb-portrait:not(:has(>.ntv-sprite-391)):is([class*="ntv-frame-vip_"],.ntv-frame-custom)>img{
  transform:scale(1.48);transform-origin:50% 38%;clip-path:circle(38% at 50% 40%);
}

/* v3.9.40 — Period competition navigation. */
#ntv-game-root .ntv-lb-tabs{flex-wrap:wrap;gap:5px}
#ntv-game-root .ntv-lb-tabs button{white-space:normal;line-height:1.25;min-height:35px}


/* v3.9.42 — leaderboard safe layout for VIP frames and titles. */
#ntv-game-root .ntv-lb-podium{align-items:stretch;padding-top:34px}
#ntv-game-root .ntv-lb-podium-card{padding:39px 10px 18px;gap:6px}
#ntv-game-root .ntv-lb-podium-card.ntv-lb-gold{padding-top:46px}
#ntv-game-root .ntv-lb-podium .ntv-lb-portrait{width:74px;height:74px}
#ntv-game-root .ntv-lb-gold .ntv-lb-portrait{width:88px;height:88px}
#ntv-game-root .ntv-lb-podium-card>.ntv-vip-title{width:min(100%,132px);max-width:132px;min-height:18px;margin:3px 0 4px}
#ntv-game-root .ntv-lb-podium-card>.ntv-vip-title img{max-height:26px}
#ntv-game-root .ntv-lb-portrait>.ntv-sprite-391--leaderboard .ntv-sprite-art{inset:8%!important;border-radius:50%;overflow:hidden}
#ntv-game-root .ntv-lb-portrait>.ntv-sprite-391--leaderboard .ntv-sprite-art>img{transform:scale(1.58)!important;transform-origin:50% 39%!important}
#ntv-game-root .ntv-lb-portrait>.ntv-sprite-391--leaderboard>img[data-ntv-part="frame"]{inset:-16%!important;width:132%!important;height:132%!important;transform:translate(var(--ntv-frame-x,0%),var(--ntv-frame-y,0%))!important}
@media(max-width:600px){
  #ntv-game-root .ntv-lb-podium{padding-top:28px}
  #ntv-game-root .ntv-lb-podium-card{padding:32px 6px 12px}
  #ntv-game-root .ntv-lb-podium-card.ntv-lb-gold{padding-top:38px}
  #ntv-game-root .ntv-lb-podium .ntv-lb-portrait{width:50px;height:50px}
  #ntv-game-root .ntv-lb-gold .ntv-lb-portrait{width:62px;height:62px}
  #ntv-game-root .ntv-lb-podium-card>.ntv-vip-title{width:min(100%,108px)}
  #ntv-game-root .ntv-lb-podium-card>.ntv-vip-title img{max-height:22px}
}
