/* ChessTeachers 13.22.82 full requested polish */
html,body{max-width:100%;overflow-x:hidden}
#ctp-app-dashboard[hidden]{display:none!important}

/* fixed six items: always visible, one row, chess pieces restored */
#ctp-app-bottom-nav{
 position:fixed!important;left:50%!important;transform:translateX(-50%)!important;bottom:max(8px,env(safe-area-inset-bottom))!important;
 width:min(96vw,720px)!important;display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;
 gap:5px!important;padding:7px!important;z-index:999999!important;box-sizing:border-box!important;
}
#ctp-app-bottom-nav .ctp-app-nav-item{min-width:0!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:1px!important}
#ctp-app-bottom-nav .ctp-nav-piece{display:block!important;font-size:22px!important;line-height:1!important}
#ctp-app-bottom-nav .ctp-app-nav-item>span:last-child{font-size:10px!important;white-space:nowrap!important}

/* champion is scrollable on mobile */
#ctp-app-dashboard.show{overflow-y:auto!important;overflow-x:hidden!important;touch-action:pan-y!important;-webkit-overflow-scrolling:touch!important;padding-bottom:92px!important}

/* Hub first and horizontally responsive */
#ctp-profile-hub-v132235{margin-top:0!important}
.ctp-hub-tabs{display:flex!important;gap:6px!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch!important;scrollbar-width:none!important}
.ctp-hub-tabs::-webkit-scrollbar{display:none}
.ctp-hub-tabs button{flex:0 0 auto!important;min-width:84px!important}

/* Today's missions visually prominent; advanced missions remain lower */
.ctp-missions{position:relative!important;border-radius:18px!important;padding:14px!important}
.ctp-missions .ctp-done-282::after{content:"✓";display:inline-grid;place-items:center;width:22px;height:22px;border-radius:50%;font-weight:900;margin-inline-start:7px}
#ctp-v127-missions{margin-top:24px!important}

/* Cup board: same safe square geometry principle as working daily puzzle */
#cup-opening,#cup-opening .ctp-frame,#cup-opening .ctp-board-wrap,#cup-opening .board-wrap{
 box-sizing:border-box!important;width:min(100%,560px)!important;max-width:calc(100vw - 24px)!important;margin-inline:auto!important;overflow:hidden!important
}
#cup-opening #ctp-board,#cup-opening .ctp-board{
 display:grid!important;grid-template-columns:repeat(8,minmax(0,1fr))!important;grid-template-rows:repeat(8,minmax(0,1fr))!important;
 width:100%!important;max-width:100%!important;aspect-ratio:1/1!important;gap:0!important;direction:ltr!important;overflow:hidden!important
}
#cup-opening #ctp-board>.ctp-square,#cup-opening .ctp-board>.ctp-square{
 min-width:0!important;min-height:0!important;width:auto!important;height:auto!important;margin:0!important;padding:0!important;overflow:hidden!important
}
#cup-opening .ctp-piece{width:86%!important;height:86%!important;object-fit:contain!important;margin:auto!important}

/* ranking/cup leaderboard RTL + badges */
#cup-leaders,.cup-leaderboard{direction:rtl!important;text-align:right!important;max-width:100%!important;box-sizing:border-box!important}
.ctp-founder-badge{display:inline-flex!important;align-items:center!important;gap:4px!important;padding:3px 8px!important;border-radius:999px!important;font-size:10px!important;font-weight:900!important}

/* feature images: never crop */
img.wp-post-image,.post-thumbnail img,.featured-image img,.ctp-news-card img{object-fit:contain!important;object-position:center!important;width:100%!important;height:auto!important}

/* news cards responsive, no ugly crop */
.ctp-news-grid,.latest-posts-grid{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr))!important;gap:14px!important}

/* online club compact */
#ctp-v13-online-club{max-width:980px!important;margin-inline:auto!important;box-sizing:border-box!important}

/* opening-training visual treatment */
[id*="opening"],.opening-training{scroll-margin-top:20px}

/* popup permanently gone */
.ctp-news-popup,.ctp-fresh-news-popup,.ctp-latest-popup,.ctp-toast-news,[data-ctp-news-popup],[id*="fresh-news"],[class*="fresh-news"]{display:none!important}

@media(max-width:480px){
 #ctp-app-bottom-nav{width:calc(100vw - 10px)!important;gap:2px!important;padding:5px 3px!important}
 #ctp-app-bottom-nav .ctp-nav-piece{font-size:19px!important}
 #ctp-app-bottom-nav .ctp-app-nav-item>span:last-child{font-size:8.5px!important}
 #cup-opening,#cup-opening .ctp-frame,#cup-opening .ctp-board-wrap,#cup-opening .board-wrap{max-width:calc(100vw - 16px)!important}
}
