/* ---------- tablets: bigger everything, and a two-column layout when the tablet lies sideways ----------
   index.html sets html.tab-p (portrait tablet) or html.tab-l (landscape tablet / big screen) and --z, the scale
   that fills the screen; phones get neither class and keep the phone layout exactly as it is. */
html.tab #app,html.tab .pp-in,html.tab .lu-stage,html.tab .toast{zoom:var(--z)}
html.tab body{min-height:100vh}
/* the PIN / player screens: a little wider on a tablet */
html.tab .pp-in{max-width:520px}
html.tab .pp-list{grid-template-columns:1fr 1fr 1fr}
html.tab-p .pp-list{grid-template-columns:1fr 1fr}

/* portrait tablet: the phone layout, scaled up to fill the width (see --z) */
html.tab-p #app{max-width:540px;padding-top:max(22px,env(safe-area-inset-top))}
html.tab-p #screen-home{padding-top:5vh}
html.tab-p .shop-grid{grid-template-columns:repeat(4,minmax(0,1fr))}

/* landscape tablet: side by side */
html.tab-l #app{max-width:920px;padding-left:20px;padding-right:20px;min-height:calc(100vh / var(--z));box-sizing:border-box;display:flex;flex-direction:column;justify-content:center}
html.tab-l #app > .screen.active{width:100%}
html.tab-l #screen-home.active{display:grid;align-content:center;grid-template-columns:minmax(0,1fr) minmax(0,1.05fr);grid-template-areas:"who play" "head play" "lvl row" "note opts";grid-template-rows:auto auto auto 1fr;column-gap:34px;row-gap:14px;align-items:start;padding-top:0}
html.tab-l #screen-home .who-btn{grid-area:who;margin:0 auto}
html.tab-l #screen-home .home-head{grid-area:head;flex-direction:column;gap:0}
html.tab-l #screen-home .home-head .mascot{font-size:84px}
html.tab-l #screen-home .home-head h1{font-size:50px}
html.tab-l #screen-home .home-lvl{grid-area:lvl;font-size:18px}
html.tab-l #screen-home .home-note{grid-area:note;align-self:start}
html.tab-l #screen-home .play-btn{grid-area:play;min-height:200px;align-self:stretch}
html.tab-l #screen-home .home-row{grid-area:row}
html.tab-l #screen-home .opts{grid-area:opts;grid-template-columns:1fr 1fr}

html.tab-l .topics{grid-template-columns:repeat(3,minmax(0,1fr))}
html.tab-l .topics .topic-btn:last-child:nth-child(odd){grid-column:auto}

html.tab-l #screen-game.active{display:grid;align-content:center;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-areas:"bar bar" "card stats" "card hints" "card answers" "card feedback" "card next";grid-template-rows:auto auto auto auto auto 1fr;column-gap:26px;row-gap:12px;align-items:start}
html.tab-l #screen-game > .bar{grid-area:bar}
html.tab-l #screen-game > .stats{grid-area:stats}
html.tab-l #screen-game > .card{grid-area:card;align-self:stretch;display:flex;flex-direction:column;justify-content:center;min-height:380px}
html.tab-l #screen-game > .hints{grid-area:hints;margin-top:0}
html.tab-l #screen-game > .answers{grid-area:answers}
html.tab-l #screen-game > .feedback{grid-area:feedback}
html.tab-l #screen-game > .auto-bar{grid-area:next;align-self:start}
html.tab-l #screen-game > .next-btn,html.tab-l #screen-game > .confirm-btn{grid-area:next}
html.tab-l .w-emoji{font-size:96px}
html.tab-l .word{font-size:58px}
html.tab-l .word.he{font-size:56px}
html.tab-l .ans{min-height:92px;font-size:27px}

html.tab-l #screen-end{max-width:620px;margin:0 auto;width:100%}

html.tab-l .shop-main{flex-direction:row;align-items:flex-start;gap:20px}
html.tab-l .shop-stage{flex:0 0 38%;position:sticky;top:12px}
html.tab-l .shop-side{flex:1;min-width:0}
html.tab-l .shop-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
html.tab-l .shop-preview{font-size:110px}

/* phone held sideways (fit.js: html.tab-ph, normal size, no zoom): home and game side by side so nothing needs scrolling */
html.tab-ph #app{max-width:820px;padding:max(8px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left))}
html.tab-ph #screen-home.active{display:grid;align-content:center;grid-template-columns:minmax(0,1fr) minmax(0,1.05fr);grid-template-areas:"who play" "head play" "lvl row" "note opts";grid-template-rows:auto auto auto 1fr;column-gap:24px;row-gap:8px;align-items:start;padding-top:0;min-height:calc(100vh - 16px)}
html.tab-ph #screen-home .who-btn{grid-area:who;margin:0 auto}
html.tab-ph #screen-home .home-head{grid-area:head}
html.tab-ph #screen-home .home-head .mascot{font-size:44px}
html.tab-ph #screen-home .home-head h1{font-size:32px}
html.tab-ph #screen-home .home-lvl{grid-area:lvl}
html.tab-ph #screen-home .home-note{grid-area:note;align-self:start}
html.tab-ph #screen-home .play-btn{grid-area:play;min-height:96px;align-self:stretch}
html.tab-ph #screen-home .big-btn{min-height:52px}
@media (max-height:380px){html.tab-ph #screen-home .play-btn{min-height:80px}html.tab-ph #screen-home .big-btn{min-height:46px}html.tab-ph #screen-home.active{row-gap:6px}}
html.tab-ph #screen-home .home-row{grid-area:row}
html.tab-ph #screen-home .opts{grid-area:opts;grid-template-columns:1fr 1fr}
html.tab-ph #screen-game.active{display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);grid-template-areas:"card bar" "card stats" "card hints" "card answers" "card feedback" "card next";grid-template-rows:auto auto auto auto auto 1fr;column-gap:14px;row-gap:6px;align-items:start}
html.tab-ph #screen-game > .bar{grid-area:bar}
html.tab-ph #screen-game > .stats{grid-area:stats}
html.tab-ph #screen-game > .card{grid-area:card;align-self:stretch;display:flex;flex-direction:column;justify-content:center;padding:10px 12px 12px}
html.tab-ph #screen-game > .hints{grid-area:hints;margin-top:0}
html.tab-ph #screen-game > .answers{grid-area:answers;gap:8px}
html.tab-ph #screen-game > .feedback{grid-area:feedback;min-height:26px;font-size:19px}
html.tab-ph #screen-game > .auto-bar{grid-area:next;align-self:start;margin-top:0}
html.tab-ph #screen-game > .next-btn,html.tab-ph #screen-game > .confirm-btn{grid-area:next;min-height:46px}
html.tab-ph #screen-game > .feedback:empty{min-height:0}
html.tab-ph #screen-game .ans{min-height:46px;font-size:19px;padding:6px 6px}
html.tab-ph #screen-game .w-emoji{font-size:56px}
html.tab-ph #screen-game .hint-btn{flex-direction:row;min-height:36px;gap:4px;padding:2px 4px}
html.tab-ph #screen-end{max-width:560px;margin:0 auto;width:100%}
