/* Tablet scenes use the viewport, rather than the old 840px desktop card. */
@media(min-width:700px) and (min-height:600px){
 html body.ui2{--tablet-top:80px;--tablet-bottom:100px;--tablet-gap:16px}
 html body.ui2[data-mode=hunt][data-place] .ui2-bar{max-width:none!important}
 html body.ui2[data-mode=hunt][data-place] .bottom-nav{width:min(88vw,1100px)!important;max-width:none!important;height:78px!important;bottom:calc(10px + var(--sab,0px))!important}
 html body.ui2[data-mode=hunt][data-place] .bottom-nav button{height:66px!important;font-size:18px!important}
 html body.ui2[data-mode=hunt][data-place] .bottom-nav button img{width:44px!important;height:44px!important}
 html body.ui2[data-mode][data-place=shop] #main{position:fixed!important;inset:calc(var(--tablet-top) + var(--sat,0px)) 0 calc(var(--tablet-bottom) + var(--sab,0px))!important;display:grid!important;grid-template-rows:56px minmax(0,1fr) 60px!important;gap:0!important;width:auto!important;max-width:none!important;height:auto!important;min-height:0!important;margin:0!important;padding:0!important;overflow:visible!important;isolation:isolate}
 html body.ui2[data-place=shop] .shop-scene{position:absolute!important;inset:0!important;z-index:-1;width:100%!important;max-width:none!important;height:100%!important;min-height:0!important;max-height:none!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;background-size:100% 100%!important;overflow:visible!important}
 html body.ui2[data-place=shop] .shop-scene::before{content:''!important;display:block!important;position:fixed!important;inset:0!important;z-index:-1!important;background:inherit!important;pointer-events:none}
 html body.ui2[data-place=shop] .shop-header{grid-row:1;position:relative;z-index:3;height:56px!important;min-height:0!important;margin:0 16px!important;padding:4px 14px!important;background:#fff9eef2!important}
 html body.ui2[data-place=shop] .shop-header h1{font-size:clamp(23px,2.4vw,34px)!important}
 html body.ui2[data-place=shop] .shop-footer{grid-row:3;position:relative;z-index:3;height:60px!important;min-height:0!important;margin:0 16px!important;padding:4px 8px!important}
 html body.ui2[data-place=shop] .shop-footer .btn{min-height:48px!important;font-size:18px!important}
 html body.ui2[data-place=shop] .shop-scene .shelves{position:absolute!important;inset:13% 8% 24%!important;display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;grid-template-rows:repeat(3,minmax(0,1fr))!important;gap:8px 5%!important;padding:0!important}
 html body.ui2[data-place=shop] .shop-scene .toy-card{display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:minmax(0,1fr) 32px!important;gap:3px!important;padding:0!important;min-height:0!important;container-type:size}
 html body.ui2[data-place=shop] .shop-scene .toy-card:nth-child(n){display:grid!important}
 html body.ui2[data-place=shop] .shop-scene .toy-card>.toy,
 html body.ui2[data-place=shop] .shop-scene .toy-card>.world-art,
 html body.ui2[data-place=shop] .shop-scene .toy-card>.dumpling-box-art{position:relative!important;inset:auto!important;transform:none!important;width:min(90cqw,calc(100cqh - 35px))!important;height:min(90cqw,calc(100cqh - 35px))!important;max-width:none!important;max-height:none!important;min-height:0!important;object-fit:contain!important}
 html body.ui2[data-place=shop] .shop-scene .toy-card .toy-name{position:relative!important;inset:auto!important;transform:none!important;width:90%!important;max-width:280px!important;height:32px!important;min-height:32px!important;font-size:clamp(14px,1.6vw,23px)!important;padding:2px 6px!important;line-height:1.05!important}
 html body.ui2[data-place=shop] .shop-scene .toy-card>.price-tag{top:5%!important;right:6%!important;left:auto!important;font-size:16px!important;min-height:28px!important}
 html body.ui2[data-place=shop] .shop-try-sign{top:9%!important;font-size:15px!important}
 html body.ui2[data-place=shop] .tr-case{bottom:calc(60px + 1%)!important;height:14%!important;min-height:0!important;max-height:none!important;width:42%!important;max-width:560px!important;padding:14px 5% 14px!important;box-sizing:border-box!important}
 html body.ui2[data-place=shop] .tr-label{font-size:16px!important}
 html body.ui2 dialog#modal[open]:has(.store-dumpling-box){width:min(82vw,900px)!important;max-height:calc(100dvh - var(--sat,0px) - var(--sab,0px) - 40px)!important;padding:24px!important;border-radius:32px!important}
 html body.ui2 #modal:has(.store-dumpling-box) .store-dumpling-box{width:min(65vw,calc((100dvh - 285px)*1.059),680px)!important}
 html body.ui2 #modal:has(.store-dumpling-box) .modal-top h2{font-size:30px!important}
 html body.ui2 #modal:has(.store-dumpling-box) .wide{min-height:56px!important;font-size:22px!important}
 html body.ui2 dialog#modal.squish-fullscreen:has(.viewer){width:min(94vw,1200px)!important;height:calc(100dvh - var(--sat,0px) - var(--sab,0px) - 32px)!important;border-radius:32px!important}
 html body.ui2 dialog#modal .viewer #modal-title{font-size:42px!important}
 html body.ui2 dialog#modal .viewer .squish-feel-line strong{font-size:26px!important}
 html body.ui2 dialog#modal .viewer .squish-feel-line span{font-size:18px!important}
 html body.ui2 dialog#modal .viewer .icon-button{width:56px!important;height:56px!important;min-width:56px!important}
 html body.ui2.gm-open[data-mode][data-place] .gm-screen{max-width:none!important;left:24px!important;right:24px!important;bottom:calc(104px + var(--sab,0px))!important}
}
@media(min-width:700px) and (min-height:950px){
 html body.ui2[data-place=shop] .shop-scene .toy-card{grid-template-rows:minmax(0,1fr) 42px!important}
 html body.ui2[data-place=shop] .shop-scene .toy-card .toy-name{height:42px!important;min-height:42px!important}
 html body.ui2[data-place=shop] .shop-scene .toy-card>.toy,html body.ui2[data-place=shop] .shop-scene .toy-card>.world-art,html body.ui2[data-place=shop] .shop-scene .toy-card>.dumpling-box-art{width:min(90cqw,calc(100cqh - 45px))!important;height:min(90cqw,calc(100cqh - 45px))!important}
}
@media(min-width:700px) and (min-height:600px){
 html body.ui2[data-mode][data-place=shop] #main{height:calc(100dvh - var(--tablet-top) - var(--tablet-bottom) - var(--sat,0px) - var(--sab,0px))!important;align-self:stretch!important}
 html body.ui2[data-place=shop] .shop-scene::before{width:auto!important;height:auto!important;max-height:none!important;max-width:none!important;transform:none!important;opacity:1!important;margin:0!important;border:0!important;border-radius:0!important;box-shadow:none!important}
}
@media(min-width:700px) and (min-height:600px) and (max-height:850px) and (orientation:landscape){
 html body.ui2[data-place=shop] .shop-scene .toy-card{grid-template-columns:minmax(0,1.1fr) minmax(0,1fr)!important;grid-template-rows:minmax(0,1fr)!important;gap:6px!important}
 html body.ui2[data-place=shop] .shop-scene .toy-card>.toy,html body.ui2[data-place=shop] .shop-scene .toy-card>.world-art,html body.ui2[data-place=shop] .shop-scene .toy-card>.dumpling-box-art{width:min(49cqw,95cqh)!important;height:min(49cqw,95cqh)!important}
 html body.ui2[data-place=shop] .shop-scene .toy-card .toy-name{height:auto!important;min-height:44px!important;font-size:16px!important;width:100%!important}
 html body.ui2[data-place=shop] .shop-scene .toy-card>.price-tag{top:0!important;right:0!important;font-size:13px!important;min-height:22px!important}
 html body.ui2[data-place=shop] .tr-case{height:12%!important;padding-top:20px!important}
 html body.ui2[data-place=shop] .tr-label{top:0!important;font-size:13px!important}
 html body.ui2[data-place=shop] .shop-try-sign{display:none!important}
}
@media(min-width:700px) and (min-height:600px){
 html body.ui2[data-mode=hunt][data-place=trade] #main{position:fixed!important;inset:calc(80px + var(--sat,0px)) 20px calc(104px + var(--sab,0px))!important;width:auto!important;max-width:none!important;height:auto!important;margin:0!important;padding:0!important}
 html body.ui2[data-mode=hunt][data-place=trade] .hunter-trade{width:100%!important;max-width:none!important;height:100%!important;margin:0!important}
 html body.ui2 dialog#modal:has(#sleepy-offer){width:min(86vw,1000px)!important;padding:24px!important;box-sizing:border-box;max-height:calc(100dvh - var(--sat,0px) - var(--sab,0px) - 32px)!important}
 html body.ui2 #sleepy-offer .sleepy-wrapper{height:min(62dvh,700px)!important}
 html body.ui2 #sleepy-offer .sleepy-unwrap{font-size:22px!important;min-height:56px!important}
 html body.ui2[data-place=home] .page-heading{max-width:38%!important}
 html body.ui2[data-place=home] .page-heading h1{font-size:clamp(18px,2vw,28px)!important;line-height:1.1!important}
 html body.ui2.gm-open .gm-screen .gm-name{font-size:clamp(14px,1.6vw,22px)!important}
}
@media(min-width:700px) and (min-height:950px){
 html body.ui2[data-place=town] .town-collection{width:min(90vw,1050px)!important;max-width:none!important}
 html body.ui2[data-place=town] .town-owned{flex-basis:calc((100% - 50px)/6)!important}
 html body.ui2[data-place=home] .room-collection{height:190px!important;max-height:190px!important}
 html body.ui2[data-place=home] .room-collection .tray-toy{height:140px!important;flex-basis:140px!important}
 html body.ui2[data-place=home] .room-collection .tray-toy .toy{width:100px!important;height:100px!important}
 html body.ui2[data-place=home] .room-collection .tray-toy>span:last-child{font-size:16px!important;line-height:18px!important;max-height:36px!important}
}
@media(min-width:700px) and (orientation:portrait){
 html body.ui2[data-place=home] .page-heading{max-width:none!important}
}
@media(min-width:700px) and (min-height:950px) and (orientation:portrait){
 html body.ui2[data-mode][data-place=home]:not(.gm-open) #main{grid-template-rows:48px 72px minmax(0,1fr) 190px!important}
}
@media(min-width:700px) and (min-height:600px){
 html body.ui2[data-mode=hunt][data-place=trade] #main{height:calc(100dvh - 184px - var(--sat,0px) - var(--sab,0px))!important;align-self:stretch!important}
}
@media(min-width:700px) and (min-height:950px){
 html body.ui2[data-mode=hunt][data-place] .topbar,html body.ui2[data-mode=hunt][data-place] .ui2-bar{height:64px!important}
 html body.ui2[data-mode=hunt][data-place] .ui2-btn{width:60px!important;height:60px!important;flex-basis:60px!important}
 html body.ui2[data-mode=hunt][data-place] .ui2-coins{font-size:24px!important}
}

@media(min-width:700px) and (min-height:600px) and (max-height:850px) and (orientation:landscape){
 html body.ui2[data-place=shop] .tr-case{padding:4px 5% 12px!important}
 html body.ui2[data-place=shop] .tr-label{left:8px!important;top:5px!important;transform:none!important;font-size:11px!important;max-width:95px;white-space:normal!important}
 html body.ui2[data-place=shop] .tr-toy{width:50px!important;height:50px!important}
}
@media(min-width:700px) and (min-height:600px) and (orientation:landscape){
 html body.ui2[data-place=home]:not(.gm-open) .page-heading{width:43%!important;max-width:43%!important;box-sizing:border-box}
 html body.ui2[data-place=home]:not(.gm-open) .page-heading h1{white-space:normal!important;overflow-wrap:anywhere;font-size:clamp(18px,1.8vw,25px)!important}
 html body.ui2[data-place=home]:not(.gm-open) .room-tools{left:auto!important;right:18px!important;width:50%!important;justify-content:flex-end!important;gap:18px!important}
}
@media(min-width:700px) and (min-height:950px){
 html body.ui2[data-place=home]:not(.gm-open) .room-collection{height:190px!important;max-height:190px!important;width:56%!important}
}
@media(min-width:700px) and (min-height:950px) and (orientation:portrait){
 html body.ui2[data-place=home]:not(.gm-open) .room-collection{width:100%!important}
}
@media(min-width:700px) and (min-height:600px) and (orientation:portrait){
 html body.ui2[data-mode][data-place=home]:not(.gm-open) .page-heading{grid-row:1!important;inset:auto!important;width:100%!important;margin:0!important}
 html body.ui2[data-mode][data-place=home]:not(.gm-open) .room-tools{display:flex!important;grid-row:2!important;position:relative!important;inset:auto!important;width:100%!important}
 html body.ui2[data-mode][data-place=home]:not(.gm-open) .bedroom-scene{grid-row:3!important;position:relative!important;inset:auto!important;height:100%!important}
 html body.ui2[data-mode][data-place=home]:not(.gm-open) .room-collection{grid-row:4!important;position:relative!important;inset:auto!important;margin:0!important;width:100%!important}
 html body.ui2[data-mode][data-place=home]:not(.gm-open) .room-edit-button,html body.ui2[data-mode][data-place=home]:not(.gm-open) .room-instruction{display:none!important}
}
@media(min-width:700px) and (min-height:950px){
 html body.ui2[data-mode=hunt][data-place=trade] .trade-mat{grid-template-rows:minmax(0,1fr) 180px 64px!important}
 html body.ui2[data-mode=hunt][data-place=trade] .offer-toys{align-self:end!important;margin-bottom:24px!important}
 html body.ui2[data-mode=hunt][data-place=trade] .offer-toys>button{width:min(30vw,34dvh)!important;height:min(30vw,34dvh)!important;flex-basis:min(30vw,34dvh)!important}
 html body.ui2[data-mode=hunt][data-place=trade] .offer-toys>button>.toy{width:100%!important;height:100%!important;max-width:none!important;max-height:none!important}
 html body.ui2[data-mode=hunt][data-place=trade] .tray-toy{flex-basis:140px!important;width:140px!important;height:140px!important}
 html body.ui2[data-mode=hunt][data-place=trade] .tray-toy .toy{width:100px!important;height:100px!important}
 html body.ui2[data-mode=hunt][data-place=trade] .tray-toy span:last-child{font-size:15px!important;white-space:normal!important}
 html body.ui2[data-mode=hunt][data-place=trade] .tray-grid{justify-content:safe center!important}
}

/* Give the welcome dumpling the same tablet presence as later basket reveals. */
@media(min-width:700px) and (min-height:600px){
 /* Welcome-flow owns the shared intro frame dimensions. */
 html body.ui2 #modal .first-reveal{gap:16px}
 html body.ui2 #modal .first-box>img.first-hand{bottom:-16px}
 html body.ui2 #modal .first-meet-stage{overflow:hidden!important}
 html body.ui2 #modal .first-reveal h2{font-size:30px!important}
 html body.ui2 #modal .first-reveal>p{font-size:21px;line-height:1.3}
 html body.ui2 #modal .first-box{width:min(65vw,calc((100dvh - var(--sat,0px) - var(--sab,0px) - 285px)*1.059),680px)!important;height:auto!important;aspect-ratio:380/359;flex:none}
 html body.ui2 #modal .first-reveal-action,html body.ui2 #modal .first-next{width:100%;min-height:56px;font-size:22px}
 /* Keep both stage axes equal; height:auto was clamped by the grid row. */
}

/* Keep tablet play anchored; menus own their scrolling, never the document. */
@media (min-width:700px) {
 html:has(body.ui2){height:100%;overflow:hidden!important;overscroll-behavior:none}
 html body.ui2{position:fixed!important;inset:0!important;width:100%!important;height:100dvh!important;min-height:0!important;max-height:100dvh!important;overflow:hidden!important;overscroll-behavior:none;margin:0!important;box-sizing:border-box}
 body.ui2 dialog,body.ui2 .tray-grid,body.ui2 .room-tray,body.ui2 .trade-tray{overscroll-behavior:contain}
}
