/* tablet.css — iPad and other tablets only. index.html loads it with media="(min-width:701px)", so nothing here reaches a phone. */

/* ================= iPad standing (portrait) ================= */
@media (orientation:portrait){
  /* ---- first screen: the title, the three doors and «Перед сном» stand together in the middle of the screen, the doors a little bigger,
     instead of all of it squeezed at the top above an empty meadow ---- */
  .hub{display:flex;flex-direction:column;justify-content:center;align-items:stretch;padding-bottom:env(safe-area-inset-bottom)}
  .htitle{margin:calc(max(18px,env(safe-area-inset-top)) + 60px) auto 0}
  .hcards{padding-top:clamp(28px,4vh,48px)}
  .hcard{width:min(29vw,320px)}
  .hname{font-size:clamp(28px,3.4vw,38px)}
  .hsub{font-size:clamp(15px,1.8vw,19px)}
  .hbed{margin-top:clamp(28px,4vh,48px);height:84px;font-size:26px}
  /* ---- theme screen: two big columns that fill the screen instead of four small ones at the top ---- */
  .tplate{width:clamp(300px,40vw,460px)}
  .tgrid2{grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-auto-rows:minmax(0,1fr)!important;gap:clamp(16px,2.2vw,24px)!important;
    width:min(92vw,900px)!important;max-width:none!important;margin-left:auto!important;margin-right:auto!important;
    height:calc(100dvh - max(14px,env(safe-area-inset-top)) - clamp(150px,13vh,190px) - env(safe-area-inset-bottom) - 28px)!important}
  .tc2{display:flex!important;flex-direction:column!important;height:100%!important;min-height:0}
  .tc2art{flex:1 1 auto!important;height:auto!important;min-height:0!important;aspect-ratio:auto!important}
  .tc2art:not(.cov)>img,.tc2art:not(.cov) .ph{height:86%!important;width:auto!important;max-width:88%!important;object-fit:contain}
  .tc2txt{flex:0 0 auto!important;padding:14px 76px 16px 22px!important}
  .tc2txt b{font-size:clamp(24px,2.8vw,32px)!important}
  .tc2txt small{font-size:clamp(15px,1.8vw,19px)!important}
  .tc2go{width:56px!important;height:56px!important}

  /* ---- «Раскрась»: pictures in a row on top, a square sheet in the middle, tools in a row at the bottom ---- */
  .cwrap{position:absolute!important;inset:calc(max(14px,env(safe-area-inset-top)) + 96px) 24px calc(env(safe-area-inset-bottom) + 20px) 24px!important;
    display:flex!important;flex-direction:column!important;align-items:center!important;gap:16px!important;
    width:auto!important;height:auto!important;max-width:none!important;max-height:none!important;transform:none!important;margin:0!important;
    grid-template-columns:none!important;grid-template-rows:none!important}
  .clist{order:1;display:flex!important;flex-direction:row!important;justify-content:center;gap:10px!important;
    width:100%!important;height:auto!important;max-height:none!important;overflow-x:auto!important;overflow-y:hidden!important;padding:10px!important;flex:0 0 auto!important}
  .cpick{width:clamp(70px,8.4vw,92px)!important;height:clamp(70px,8.4vw,92px)!important;flex:0 0 auto!important}
  /* the sheet always stays square, so the picture is never stretched */
  .cpaper{order:2;flex:1 1 auto!important;min-height:0!important;height:auto!important;width:auto!important;max-width:100%!important;aspect-ratio:1/1!important;align-self:center!important}
  .cpaper canvas,.cpaper .cline{width:100%!important;height:100%!important}
  .ctools{order:3;display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:center!important;gap:clamp(14px,2.2vw,26px)!important;
    width:100%!important;height:auto!important;max-height:none!important;padding:12px 16px!important;flex:0 0 auto!important}
  .ctl3,.cact{display:flex!important;flex-direction:row!important;gap:8px!important;margin:0!important}
  .cpal{display:flex!important;flex-direction:row!important;flex-wrap:nowrap!important;gap:10px!important;grid-template-columns:none!important;margin:0!important}
  .ctool{display:flex!important;align-items:center;justify-content:center;padding:0!important;
    width:clamp(48px,5.4vw,58px)!important;height:clamp(48px,5.4vw,58px)!important}
  /* the brush, pencil and bucket pictures inside the tool buttons */
  .ctool svg{display:block!important;width:72%!important;height:72%!important;flex:0 0 auto}
  .cdot{width:clamp(46px,5.2vw,56px)!important;height:clamp(46px,5.2vw,56px)!important}
}

/* ================= iPad lying (landscape) ================= */
@media (orientation:landscape){
  /* «Раскрась»: the tools sit in the middle of their panel and the three tool buttons fit in it */
  .ctools{justify-content:center!important}
  .ctl3{gap:6px!important}
  .ctool{width:clamp(44px,4.2vw,58px)!important;height:clamp(44px,4.2vw,58px)!important}
}
