/* ===== v57 wide layout outside battle (presentation only). body.wide = landscape below the desk breakpoint, from about
   600x300 (phones on their side, portal boxes like 800x450, short windows); set by battle.js. wide.js adds .wsplit/.wcol.
   Upright phones (phone.css) and desktop (desk.css) are untouched. ===== */
html body.wide #app:not(.bt){max-width:none!important;width:100%!important;margin:0!important;box-sizing:border-box;height:100vh;height:100dvh;
 padding:4px max(10px,env(safe-area-inset-right)) max(4px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left))!important}
/* one-line HUD, as in the wide battle view */
html body.wide #app:not(.bt)>.hud{display:flex!important;align-items:center;gap:8px;height:auto!important;min-height:44px;margin:0!important;padding:2px 52px 2px 4px!important;box-sizing:border-box}
html body.wide #app:not(.bt)>.hud .medal{width:36px!important;height:36px!important;flex:none}
html body.wide #app:not(.bt)>.hud .medal img{width:34px!important;height:34px!important}
html body.wide #app:not(.bt)>.hud .gauges{flex:1 1 auto;min-width:0;margin:0!important}
html body.wide #app:not(.bt)>.hud .strip{flex:none;margin:0!important;width:auto!important}
html body.wide #app:not(.bt)>#menu{width:44px!important;height:44px!important;min-height:0!important;padding:0!important;top:4px!important;right:max(10px,env(safe-area-inset-right))!important;left:auto!important}
html body.wide #app:not(.bt)>#menu svg{max-width:30px;max-height:30px}
html body.wide #app:not(.bt)>.scr{padding:4px 2px!important;min-height:0}
html body.wide #app:not(.bt)>.scr>h1,html body.wide #app:not(.bt)>.scr>h2,html body.wide #app:not(.bt) .wcol>h1,html body.wide #app:not(.bt) .wcol>h2{margin:0 0 4px!important;font-size:24px;line-height:1.15}
/* footer: one 44px row; a single button sits at the right instead of spanning the screen */
html body.wide #app:not(.bt)>.actions{padding:4px 0 0!important;min-height:0;gap:8px;justify-content:flex-end}
html body.wide #app:not(.bt)>.actions>button{min-height:44px!important;height:auto!important;padding-top:6px!important;padding-bottom:6px!important;flex:0 1 auto;min-width:min(220px,40vw)}
html body.wide #app:not(.bt)>.actions.maprow>.plate{flex:1 1 auto;min-width:0;height:auto!important;min-height:44px}
html body.wide #app:not(.bt)>.actions.maprow>button{min-width:110px}

/* --- picture left, everything else in a scrolling right-hand column --- */
html body.wide #app:not(.bt)>.scr.wsplit{display:grid!important;grid-template-columns:minmax(0,40%) minmax(0,1fr);grid-template-rows:minmax(0,1fr);column-gap:14px;overflow:hidden!important}
html body.wide #app:not(.bt)>.scr.wsplit>img.banner{grid-column:1;grid-row:1;width:100%!important;height:100%!important;max-height:none!important;min-height:0;object-fit:cover;margin:0!important;align-self:stretch;aspect-ratio:auto!important}
html body.wide #app:not(.bt) .wcol{min-width:0;min-height:0;overflow-y:auto;overscroll-behavior:contain;display:flex;flex-direction:column;gap:6px;padding:0 4px 6px 0}
html body.wide #app:not(.bt) .wcol>*{margin-top:0!important;margin-bottom:0!important;flex:none}
html body.wide #app:not(.bt)>.scr.wsplit>.wcol{grid-column:2;grid-row:1}
/* the right column keeps the parchment look the upright layout gives direct-child paragraphs and lists */
html body.wide #app:not(.bt) .wcol>p:not(.msg):not(.small):not(.sm):not(.center){background:var(--paper) center/170px,#e8d3a0;color:var(--ink);padding:6px 10px;border-radius:5px;border:1px solid #2a180a;box-shadow:0 0 0 2px rgba(201,162,74,.55),0 4px 8px rgba(0,0,0,.5)}
html body.wide #app:not(.bt) .wcol>ul{list-style:none;padding:8px 12px;background:var(--paper) center/170px,#e8d3a0;color:var(--ink);border-radius:5px;border:1px solid #2a180a}
html body.wide #app:not(.bt) .wcol .cards,html body.wide #app:not(.bt) .wcol .choices{justify-content:flex-start}
/* two columns (shipwright: your ship and upgrades | ships for sale) */
html body.wide #app:not(.bt)>.scr.wsplit2{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);column-gap:14px;overflow:hidden!important}
html body.wide #app:not(.bt)>.scr.wsplit2>h1,html body.wide #app:not(.bt)>.scr.wsplit2>h2{grid-column:1/-1;grid-row:1}
html body.wide #app:not(.bt)>.scr.wsplit2>.wl{grid-column:1;grid-row:2}html body.wide #app:not(.bt)>.scr.wsplit2>.wr{grid-column:2;grid-row:2}

/* --- card rows: more cards per row, a little smaller, never squeezed below a readable width --- */
html body.wide #app:not(.bt) .scr .cards:not(#hand){flex-wrap:wrap;gap:8px;padding-top:10px}
html body.wide #app:not(.bt) .scr .cards:not(#hand)>.card,html body.wide #app:not(.bt) .scr .cards:not(#hand)>.cardwrap{flex:0 0 auto;width:118px;max-width:none}
html body.wide #app:not(.bt) .scr .cards:not(#hand)>.cardwrap>.card{width:100%}
html body.wide #app:not(.bt) .scr .cards:not(#hand) .card{min-height:170px;height:auto}
/* screens without a picture (spoils, upgrade, settings...): use the width */
html body.wide #app:not(.bt)>.scr:not(.wsplit):not(.wsplit2):not(.titlescr):not(.capscr):not(.mapscr){width:100%;max-width:980px;margin:0 auto;align-self:center}
html body.wide #app:not(.bt) .scr .choices>button{flex:0 0 auto;height:auto;min-height:44px}
html body.wide #app:not(.bt) .scr .choices.three{display:flex!important;flex-direction:row!important;flex-wrap:wrap;gap:6px}
html body.wide #app:not(.bt) .scr .choices.three>button{flex:1 1 130px;width:auto!important}
html body.wide #app:not(.bt) .choices.opts>button{min-height:44px}

/* --- title: engraving left, name and menu right --- */
html body.wide #app:not(.bt)>.titlescr{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(300px,1fr);grid-template-rows:auto auto auto auto auto minmax(0,1fr);column-gap:22px;row-gap:4px;align-content:center;overflow-y:auto;height:100%}
html body.wide .titlescr>h1{grid-column:2;grid-row:1;margin:0!important;font-size:clamp(34px,9vh,52px)!important;line-height:1;text-align:center}
html body.wide .titlescr>h3{grid-column:2;grid-row:2;margin:0!important}
html body.wide .titlescr>img.banner{grid-column:1;grid-row:1/6;width:100%!important;max-width:none!important;height:auto!important;max-height:calc(100dvh - 44px)!important;object-fit:contain;align-self:center;margin:0!important}
html body.wide .titlescr>.platecap{grid-column:1;grid-row:6;margin:0!important;align-self:start}
html body.wide .titlescr>.tagl{grid-column:2;grid-row:3;margin:2px 0!important;font-size:14px}
html body.wide .titlescr>.choices{grid-column:2;grid-row:4;display:grid!important;grid-template-columns:1fr 1fr;gap:6px}
html body.wide .titlescr>.choices>button{min-height:44px!important;height:auto!important;margin:0!important;padding:6px 8px!important;font-size:17px}
html body.wide .titlescr>.choices>button:first-child{grid-column:1/-1}
html body.wide .titlescr>p.small{grid-column:2;grid-row:5;margin:0!important}
html body.wide .titlescr>#pdlink{grid-column:2;grid-row:6;margin:0!important;padding:0!important;align-self:start}

/* --- captain select: medallions across, dossier left, doctrine and notoriety right --- */
html body.wide #app:not(.bt)>.capscr{display:grid!important;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);grid-auto-rows:auto;column-gap:14px;row-gap:6px;align-content:start;overflow-y:auto}
html body.wide .capscr>h2{grid-column:1/-1;margin:0!important}
html body.wide .capscr>.caps{grid-column:1/-1;display:flex;justify-content:center;flex-wrap:nowrap;padding:4px!important;margin:0!important}
html body.wide .capscr>.caps .med{flex:0 1 120px}
html body.wide .capscr>.dossier{grid-column:1;grid-row:3/span 3;align-self:start;margin:0!important}
html body.wide .capscr>.docts{grid-column:2;grid-row:3;margin:0!important}
html body.wide .capscr>.notp{grid-column:2;grid-row:4;margin:0!important}
html body.wide .capscr>:not(h2):not(.caps):not(.dossier):not(.docts):not(.notp){grid-column:2}

/* --- map: the chart runs left to right and fills the space --- */
html body.wide #app:not(.bt)>.mapscr{overflow:hidden!important}
html body.wide #app:not(.bt)>.mapscr .maphead{margin:0 0 2px!important;padding:0 4px!important}
html body.wide #app:not(.bt)>.mapscr .maphead h2{font-size:20px;margin:0!important}
html body.wide #app:not(.bt)>.mapscr .chart{flex:1 1 auto!important;width:100%;height:auto!important;min-height:0!important;margin:0!important;aspect-ratio:auto!important}

/* --- settings: two columns --- */
html body.wide #app:not(.bt) .setl{display:grid!important;grid-template-columns:1fr 1fr;gap:6px 12px;align-items:start}
html body.wide #app:not(.bt) .setl>*{margin:0!important}
html body.wide #app:not(.bt) .setl>h3,html body.wide #app:not(.bt) .setl>p{grid-column:1/-1}
/* --- Nassau buildings and end-of-voyage panels: two per row --- */
html body.wide #app:not(.bt) .wcol{--wgap:6px}
html body.wide #app:not(.bt) .nassauscr .wcol{display:grid;grid-template-columns:1fr 1fr;align-content:start}
html body.wide #app:not(.bt) .nassauscr .wcol>:not(.bld){grid-column:1/-1}
/* --- the menu book and modals: wider page --- */
html body.wide #modal .book{width:min(760px,calc(100vw - 24px))!important;max-width:none!important;max-height:calc(100dvh - 12px)}
/* --- deck grids (dismiss / improve a card): full width, no picture --- */
html body.wide #app:not(.bt)>.scr.wdeck>img.banner{display:none!important}
html body.wide #app:not(.bt)>.scr.wdeck .cards:not(#hand){justify-content:center}
/* port market in two columns: the picture is dropped, supplies and services left, cards right */
html body.wide #app:not(.bt)>.scr.wsplit2>img.banner{display:none!important}
html body.wide #app:not(.bt)>.scr.wsplit2 .choices.svc>button{flex:1 1 40%}
html body.wide #app:not(.bt)>.scr.wsplit2>.wr .cards{justify-content:center}
html body.wide #app:not(.bt)>.scr.wsplit2>.wr>.choices.rwc{flex-direction:column}
html body.wide #app:not(.bt)>.scr.wsplit2>.wl>.cards{justify-content:center}
/* very short boxes (around 600x300): smaller heading and cards so a row of cards fits */
@media (max-height:360px){html body.wide #app:not(.bt)>.scr>h2,html body.wide #app:not(.bt)>.scr .wcol>h2{font-size:18px;line-height:1.2;margin:0 0 4px;min-height:0}
html body.wide #app:not(.bt)>.scr .cards>.card{zoom:.8}}
@media (max-height:360px){html body.wide #app:not(.bt) .chart .node,html body.wide #app:not(.bt) .chart .mapship{zoom:.78}}
