/* v22-alpha.7.16 — desktop scaling. The canvas, pointer coordinates and
   absolute reserve/hand anchor remain in unzoomed CSS pixels. Only UI islands zoom. */
:root{--ui-scale:1}
@media(min-width:1100px) and (min-height:650px){
 .wrap,.wrap:not(.shared-reserve){--sidebar:clamp(184px,calc(235px * var(--ui-scale)),17vw);--intel-width:clamp(175px,calc(235px * var(--ui-scale)),17vw);--footer-height:calc(34px * var(--ui-scale));--hand-height:calc(205px * var(--ui-scale));max-width:none;width:100%;grid-template-columns:var(--sidebar) minmax(0,1fr) var(--intel-width);grid-template-rows:auto minmax(0,1fr) var(--footer-height);gap:calc(4px * var(--ui-scale));padding:calc(4px * var(--ui-scale))}
 .wrap:not(.shared-reserve){grid-template-rows:auto minmax(0,1fr) var(--hand-height) var(--footer-height)}
 .wrap>.hud-top,.wrap>.cabinet,.wrap>.command-intel,.wrap>header{zoom:var(--ui-scale);min-width:0}
 .wrap>.hud-top{max-height:none;height:auto;overflow:visible;grid-template-columns:auto minmax(0,1fr) minmax(0,auto);align-items:center}
 .wrap .hud-top .chips{flex-wrap:wrap;max-width:490px}
 .wrap .hud-top #magicHud .magic-spells{flex-wrap:wrap;overflow:visible}
 .wrap .hud-top #magicHud .magic-spell{min-height:28px}
 .wrap>.cabinet,.wrap>.command-intel{max-height:100%;overflow:auto;min-height:0;align-content:start}
 .wrap>.cabinet .summon-machine{max-width:none;width:100%}
 .wrap>.lane{min-height:0;grid-template-rows:auto minmax(0,1fr) calc(96px * var(--ui-scale))}
 .wrap:not(.shared-reserve)>.lane{grid-template-rows:auto minmax(0,1fr)}
 .wrap:not(.shared-reserve)>.lane>.battle-viewport{align-items:center}
 .wrap>.command-dock>.table{min-width:0;min-height:0;overflow:hidden}
 .wrap.shared-reserve>.command-dock>.table,.wrap.shared-reserve .reserve-outline{height:min(calc(225px * var(--ui-scale)),var(--hand-max-height,210px))}
 .wrap .command-dock .hand-col{zoom:var(--ui-scale);width:100%;height:100%;flex:1 1 0;min-height:0}
 .wrap .command-dock .hand .card[data-cardi]{flex-basis:clamp(105px,8vw,138px);max-height:none}
 .wrap .command-dock .hand .card .art{min-height:0}
 .wrap .command-dock .hand .card .cn{overflow-wrap:anywhere;white-space:normal}
 .wrap .command-dock .hand .card.buy{max-height:132px}
 .wrap>header{height:34px;min-height:34px;max-height:34px;align-self:stretch}
 .wrap>header .command-tools{max-width:none;max-height:none;flex-wrap:wrap}
 .wrap>.save-line{font-size:calc(10px * var(--ui-scale));bottom:calc(10px * var(--ui-scale));left:calc(12px * var(--ui-scale));max-width:40%;line-height:1.1}
 .wrap.shared-reserve .reserve-outline span{font-size:calc(11px * var(--ui-scale));bottom:calc(12px * var(--ui-scale))}
}
@media(min-width:1100px) and (max-width:1500px) and (min-height:650px){
 .wrap>.hud-top{grid-template-columns:112px minmax(0,1fr) minmax(0,32%)}
 .wrap .hud-top .chips{max-width:none}
 .wrap .command-dock .hand .card[data-cardi]{flex-basis:106px}
 .wrap,.wrap:not(.shared-reserve){--hand-height:155px;--sidebar:clamp(184px,12.2vw,235px);--intel-width:clamp(175px,12.2vw,235px)}
}
/* Larger dialogs, not their full-screen backdrops. Keep all panel content reachable. */
@media(min-width:1600px) and (min-height:850px){
 #ov>.panel,#ov2>.panel,#front>.front-view:not(.dark-gate),#tutorialDemo,#runePractice,#unitBestiary{zoom:var(--ui-scale);max-height:calc((100dvh - 32px) / var(--ui-scale));overflow:auto}
 #ov .journey-panel,#ov2 .hades-shop.panel{max-height:calc((100dvh - 24px) / var(--ui-scale))}
 .j-map svg{max-height:calc(34vh / var(--ui-scale))}
 #tutorialGuide{font-size:calc(12px * var(--ui-scale));padding:calc(12px * var(--ui-scale));gap:calc(7px * var(--ui-scale))}
 #tutorialGuide h2{font-size:calc(19px * var(--ui-scale))}
 #tutorialGuide .tutorial-kicker{font-size:calc(10px * var(--ui-scale))}
 #tutorialGuide button{font-size:calc(12px * var(--ui-scale))}
}

/* Keep ultra-wide layouts within a usable aspect ratio instead of separating controls by meters. */
@media(min-width:1600px) and (min-height:850px) and (min-aspect-ratio:21/9){.wrap,.wrap:not(.shared-reserve){max-width:calc(100dvh * 2.1);margin-inline:auto}}
.wrap .hud-brand-group .game-brand>span:not([hidden]){display:grid;place-items:center;height:100%;font:700 17px/1.05 Georgia,serif;text-align:center;overflow-wrap:anywhere}
/* Fill the available command dock without stretching card artwork or moving the real reserve slots. */
@media(min-width:1600px) and (min-height:850px){
 .wrap.shared-reserve>.command-dock>.table,.wrap.shared-reserve .reserve-outline{height:var(--hand-max-height,225px)}
 .wrap.shared-reserve .command-dock .hand{align-items:center}
 .wrap.shared-reserve .command-dock .hand .card[data-cardi]{height:calc(100% - 3px);max-height:252px;flex-basis:148px}
 .wrap.shared-reserve .command-dock .hand .card.buy{max-height:155px;flex-basis:76px}
}

@media(min-width:1600px) and (min-height:850px){#unitBestiary .bestiary-form{max-height:calc((100dvh - 80px) / var(--ui-scale))}}
