/* Landscape "fit" layout: a fixed 1600x900 stage scaled by fit.js. Nothing scrolls; every screen is composed to fit. */
html.fit,html.fit body{margin:0;height:100%;overflow:hidden;background:var(--chk)}
html.fit #fit{position:fixed;left:0;top:0;width:1600px;height:900px;transform-origin:0 0;overflow:hidden;background:var(--chk)}

/* ---------- game: board on the right (61.8%), info + traps on the left (38.2%) ---------- */
html.fit #wrap{position:absolute;inset:0;max-width:none;margin:0;padding:18px 22px 16px;display:grid;grid-template-columns:38.2fr 61.8fr;grid-template-rows:auto auto 1fr auto auto;column-gap:24px;row-gap:12px;
  grid-template-areas:"top stage" "coach stage" "pal stage" "msg bar" "help bar";align-content:start}
html.fit #top{grid-area:top;padding-right:0;margin:0;min-height:0}
html.fit #coach{grid-area:coach;margin:0 0 6px;min-height:0;font-size:13px;padding:8px 12px} html.fit #coach::before{display:none}
html.fit #stage{grid-area:stage;align-self:start;margin-top:56px}
html.fit #c{width:100%;height:auto}
html.fit #bar{grid-area:bar;margin:0;align-self:start;justify-content:flex-start;gap:8px}
html.fit #bar .lever{flex:1 1 280px;font-size:17px;padding:10px 14px} html.fit #bar .btn{margin-bottom:6px}
html.fit #pal{grid-area:pal;margin:0;grid-template-columns:repeat(2,1fr);gap:12px 10px;align-content:start;padding-top:8px}
html.fit .tcard{padding:7px 9px} html.fit .tcard small{font-size:11px;line-height:1.35}
html.fit #msg{grid-area:msg;margin:0;min-height:20px;font-size:13px;align-self:end}
html.fit details#help{grid-area:help;margin:0;position:relative}
html.fit details#help #helpBody{max-height:300px;overflow:auto}
html.fit details#help[open]{position:absolute;left:22px;bottom:16px;width:calc((1600px - 44px - 24px) * .382);z-index:20;box-shadow:0 8px 0 #000a}
html.fit #pausebtn{position:absolute;right:22px;top:14px;z-index:60}

/* ---------- screens ---------- */
html.fit #screens{position:absolute;inset:0;z-index:50}
html.fit #screens .screen{position:absolute;inset:0;padding:24px 24px 24px;overflow:hidden;gap:18px}
html.fit #screens .screen::before{position:absolute}
html.fit .logo{font-size:96px;max-width:1500px}
html.fit .btncol{width:360px}
html.fit .pcard{width:300px}
html.fit .cards{max-width:1100px}
html.fit .counter{position:absolute}
html.fit .menubox{width:380px} html.fit .resbox{width:420px}
html.fit .setrow{width:100%}

/* maps */
html.fit .mapgrid{grid-template-columns:270px minmax(0,1fr);width:1300px;gap:32px}
html.fit .mapprev,html.fit .mapinfo{max-width:760px}
html.fit .mapdetail{padding:34px 24px 20px}

/* settings: general options left (35%), language + hotkeys right (65%) */
html.fit .setcols{display:grid;grid-template-columns:35fr 65fr;gap:28px;width:1440px;align-items:start}
html.fit .setL,html.fit .setR{display:flex;flex-direction:column;gap:14px}
html.fit .keygrid{grid-template-columns:repeat(3,1fr)}
html.fit .langgrid button{padding:5px 12px}

/* cookbook: 3 x 2 recipes */
html.fit .cookgrid{grid-template-columns:repeat(3,1fr);width:1440px;margin:6px auto 0;gap:18px}
html.fit .recipe{min-height:150px;flex-direction:column;align-items:flex-start;gap:10px}

/* ranking: two columns of ten */
html.fit .rkwrap{width:1440px;margin-bottom:0}
html.fit .rk2{display:grid;grid-template-columns:1fr 1fr;gap:18px;align-items:start}
html.fit table.rk{font-size:13px} html.fit table.rk td{padding:5px 8px}

/* profile */
html.fit .prof{width:640px;padding:18px 22px;gap:8px}
html.fit .avgrid{grid-template-columns:repeat(8,1fr)} html.fit .avb img{width:52px}

/* privacy policy: two text columns */
html.fit .privbox{width:1440px;margin-bottom:0;padding:18px 26px;columns:2;column-gap:36px} html.fit .privbox h3{break-after:avoid;margin:12px 0 3px} html.fit .privbox p{font-size:13px;line-height:1.55;break-inside:avoid-column}
html.fit .privbox p:first-child{margin-top:0}
html.fit table.rk .btn{padding:1px 8px;font-size:11px;margin:0;box-shadow:0 2px 0 var(--ink)} html.fit table.rk td{padding:4px 8px}
html.fit .privbox p{font-size:14px;line-height:1.55} html.fit .privbox h3{font-size:17px}

/* the screens container must not swallow clicks meant for the game underneath; only a visible screen takes input */
html.fit #screens{pointer-events:none} html.fit #screens .screen.on{pointer-events:auto}

html.fit #screens .screen>.counter{position:absolute}
html.fit .btncol{width:440px;gap:10px} html.fit .btncol .btn.lg{font-size:26px;padding:18px 22px}
/* mode cards: bigger, they are the main choice on this screen */
html.fit .cards{gap:30px;max-width:1500px} html.fit .pcard{width:440px;padding:26px 24px 22px;gap:12px} html.fit .pcard h3{font-size:30px} html.fit .pcard p{font-size:16px} html.fit .pcard .picon{width:74px;height:74px}
html.fit #screens #scr-modes{justify-content:center}
/* ranking: one table uses the whole panel */
html.fit .rk2.one{grid-template-columns:1fr}
/* profile: avatar buttons must fit inside the card */
html.fit .avgrid{gap:6px} html.fit .avb{padding:4px;min-width:0} html.fit .avb img{width:100%;max-width:46px}
/* settings: left column grows to hold the save row */
html.fit #saveRow{margin-top:6px}
/* ranking: pin to the top so the tab buttons never jump when the table loads */
html.fit #screens #scr-ranking{justify-content:flex-start;padding-top:70px}

html.fit #bg{position:absolute;left:0;top:0;width:1600px;height:900px;object-fit:fill}
