/* Phones: full width flat boards, boards that fit the screen, steady scrolling. Loaded after styles.css, only below 1024px. */
@media (max-width:1023px){
/* the page never rubber bands or pulls to refresh on a touch screen, and a scroll that ends inside a panel stays inside it.
   Only for touch: in WebKit a mouse wheel over the page does nothing while html and body carry overscroll-behavior, so a narrowed desktop window must not have it. */
@media (pointer:coarse){html,body{overscroll-behavior-y:none}}
.page,.sheet,.fp,.story,.onb,.gwrap,.mcin,.arc{overscroll-behavior:contain}
.wheel .witem{scroll-snap-stop:always;will-change:transform,opacity}
/* while a page, sheet or game covers the screen, the screen behind it does not scroll (see core.js, scroll lock) */
html.lock,html.lock body{overflow:hidden}

/* flat pieces on a full width board with square corners, like Chess.com */
/* full width on a phone. The app column is 440px at most, so on a tablet or a narrowed desktop window the board is the column wide, never the window wide */
.labboard,#pzBoard,.gboard{width:min(100vw,440px);max-width:none;margin-left:calc(50% - min(100vw,440px) / 2);margin-right:0}
.labboard .bd,#pzBoard.bd,#pzBoard .bd,.gboard .bd,.rwrap .bd,.rwrap.bd,.pswrap .bd,#rushBoard.bd,#psBoard.bd{border-radius:0;box-shadow:none}
.gwrap{padding-left:0;padding-right:0}
.gwrap>.gplayer,.gwrap>.gtop,.gwrap>.status,.gwrap>.gcoach{margin-left:16px;margin-right:16px}
/* sized from the small viewport height (browser bar showing), so the board never resizes as the bar slides in or out */
.gboard{width:min(100vw,440px,calc(100vh - 290px));width:min(100vw,440px,calc(100svh - 290px));margin-left:auto;margin-right:auto;max-width:none}
/* on the game screen a finger on an empty square scrolls the screen (small phones need it to reach the buttons); a piece still drags */
.gboard .bd{touch-action:pan-y}
.gboard .bd .sq.occ{touch-action:none}
/* the puzzle run page and the path node fit the screen: the board takes what is left under the controls */
#rushPage,#pathStep{overflow:hidden}
#rushPage .pbody,#pathStep .pbody{display:flex;flex-direction:column;height:100%;padding-bottom:16px;box-sizing:border-box}
/* these pages pad 20px, so the board is 40px wider than its column and shifted back to center */
.rwrap,.pswrap{position:relative;left:50%;transform:translateX(-50%);margin-left:0;margin-right:0}
.rwrap{width:calc(100% + var(--gut) * 2)}
.pswrap{width:min(calc(100% + var(--gut) * 2),calc(100vh - 360px));width:min(calc(100% + var(--gut) * 2),calc(100svh - 360px))}
/* a board on a scrolling tab lets a finger scroll the page from an empty square; pieces still drag */
#pzBoard.bd,#pzBoard .bd,.labboard .bd{touch-action:pan-y}
#pzBoard.bd .sq.occ,#pzBoard .bd .sq.occ,.labboard .bd .sq.occ{touch-action:none}
}
/* flat pieces: no chrome shadow */
html:not(.p3d) .pz img{filter:none}

/* after a swipe back or the browser back, nothing animates: the page is already gone, so a second animation would flash it again */
html.popnav .page,html.popnav .sheet,html.popnav .fp,html.popnav .story,html.popnav .scrim,html.popnav .gpage,html.popnav .onb,html.popnav .promo,html.popnav .momentwrap{transition:none!important;animation:none!important}
