/* r1438.1 — Qadha board viewport contract.
   Loaded AFTER the public entry design, which erroneously resets #qApp
   to width 1220px + margin 14px while the game is active.
   Scope to modern active host only; leave portrait scroll and rotated
   landscape intact. No other game/app styles are affected. */
:root[data-ui-mode="modern"] body.fbrkh-next-shell[data-game-brand="qadha"].q-game-active:not(.q-force-landscape):not(.q-phone-portrait) #qApp {
 position:fixed!important;
 inset:0!important;
 left:0!important;right:auto!important;top:0!important;bottom:auto!important;
 width:var(--q-viewport-width,100vw)!important;
 height:var(--q-viewport-height,100dvh)!important;
 max-width:none!important;max-height:none!important;min-height:0!important;
 margin:0!important;padding:0!important;
 box-sizing:border-box!important;transform:none!important;overflow:hidden!important;
}
/* Respect rotated-phone calculations, without old landing-page margins. */
:root[data-ui-mode="modern"] body.fbrkh-next-shell[data-game-brand="qadha"].q-game-active.q-force-landscape #qApp {
 margin:0!important;
}
/* Portrait boards intentionally scroll, but never inherit the 14px
   landing-page margin or 1220px welcome-page max width. */
@media(max-width:760px) and (orientation:portrait){
 :root[data-ui-mode="modern"] body.fbrkh-next-shell[data-game-brand="qadha"].q-game-active.q-phone-portrait #qApp {
   margin:0!important;
   width:100%!important;max-width:100%!important;
   height:auto!important;min-height:100dvh!important;
 }
}

/* r1438.3: WebKit can retain a stale visualViewport width when Playwright/user
   changes orientation. CSS media queries are the ground truth here. Keep
   portrait host screens within the actual CSS viewport independently of JS
   custom properties and q-phone-portrait class timing. */
@media(max-width:760px) and (orientation:portrait){
 :root[data-ui-mode="modern"] body.fbrkh-next-shell[data-game-brand="qadha"].q-game-active {
   position:relative!important;
   inset:auto!important;
   width:100%!important;max-width:100%!important;min-width:0!important;
   height:auto!important;min-height:100dvh!important;
   overflow-x:hidden!important;overflow-y:auto!important;
 }
 :root[data-ui-mode="modern"] body.fbrkh-next-shell[data-game-brand="qadha"].q-game-active #qApp {
   position:relative!important;inset:auto!important;left:auto!important;top:auto!important;
   right:auto!important;bottom:auto!important;
   width:100%!important;max-width:100%!important;min-width:0!important;
   height:auto!important;min-height:100dvh!important;max-height:none!important;
   margin:0!important;padding:0!important;
   overflow-x:clip!important;overflow-y:visible!important;transform:none!important;
   box-sizing:border-box!important;
 }
 :root[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active .qadha-reference-board {
   width:100%!important;max-width:100%!important;min-width:0!important;
   height:auto!important;min-height:100dvh!important;
   grid-template-columns:minmax(0,1fr)!important;overflow-x:clip!important;
 }
 :root[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active
   .premium-board-grid.qadha-reference-grid {
   width:100%!important;max-width:100%!important;min-width:0!important;
   grid-template-columns:minmax(0,1fr)!important;overflow-x:clip!important;
 }
 :root[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active
   .qadha-reference-footer {
   width:100%!important;max-width:100%!important;min-width:0!important;
   left:auto!important;right:auto!important;
   grid-template-columns:repeat(2,minmax(0,1fr))!important;
   box-sizing:border-box!important;
 }
 :root[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active
   .qadha-reference-footer .premium-team-box {
   min-width:0!important;max-width:100%!important;
 }
}
