/* Smooth: windows fit inside the game area (js/smooth-fit.js sets --mg-fit, --mg-fit-x, --mg-fit-y on each window).
   transform-origin 0 0 = the point at left/top, which is the window centre after its translate(-50%,-50%).
   The scale uses the "scale" property, so the windows' own transforms and pop-in animations still work. */
.mg-fit{left:var(--mg-fit-x,50%)!important;top:var(--mg-fit-y,50%)!important;scale:var(--mg-fit,1);transform-origin:0 0}

/* phones and other small screens: the windows keep their PC size and layout and are scaled down as a whole
   (instead of squeezing into the small screen and scrolling) */
html.mg-small #settings-window{width:720px!important;max-width:none!important;max-height:660px!important}
html.mg-small #dailies-window,html.mg-small #events-window{width:640px!important;max-width:none!important;max-height:620px!important}
html.mg-small #inbox-window{width:720px!important;max-width:none!important;height:640px!important;max-height:none!important}
html.mg-small #pvp-window{width:720px!important;max-width:none!important;max-height:none!important;padding:28px 24px!important}
html.mg-small #friend-dialog{width:460px!important;max-width:none!important;max-height:580px!important}
/* Team presets / Rank (js/dex.js renderMogaDetailTools, a modal <dialog>): placed like the other windows, and on
   small screens kept at its PC size and three-column layout (map.css stacks it into one column below 620px) */
#moga-detail-tools.mg-fit{position:fixed;margin:0;right:auto;bottom:auto;transform:translate(-50%,-50%)}
html.mg-small #moga-detail-tools{width:720px!important;max-width:none!important;max-height:none!important;overflow:visible!important}
html.mg-small #moga-detail-tools.mg-tool--rank{width:460px!important}
html.mg-small #moga-detail-tools .mg-tool__presets{grid-template-columns:repeat(3,minmax(0,1fr))}
html.mg-small #moga-detail-tools .mg-tool__title{font-size:24px}
html.mg-small #moga-detail-tools .mg-tool__star{width:24px;height:24px}
html.mg-small #sq-window{width:620px!important;max-width:none!important;max-height:600px!important}
html.mg-small #sq-window.sq-listview{height:560px!important}
html.mg-small #sq-window.sq-doneview{width:500px!important}

/* the location card is drawn for a 760-wide map; on a smaller map it shrinks with it from its top-left corner */
#location{transform-origin:0 0;scale:var(--mg-card-k,1)}
