/* Keep all game controls within reach on landscape tablets. */
html{min-height:100%;-webkit-text-size-adjust:100%}body{min-height:100svh}button,a,input{touch-action:manipulation}header,main,footer{max-width:none}header,main{padding-left:max(20px,env(safe-area-inset-left));padding-right:max(20px,env(safe-area-inset-right))}header{height:82px}footer{margin:0 24px}.icon-btn{min-width:48px;min-height:48px}.fullscreen-btn{font-size:24px}.screen-message{position:fixed;bottom:max(24px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);z-index:100;background:#294f40;color:white;border-radius:18px;padding:14px 22px;max-width:90vw;width:max-content;font-size:14px;box-shadow:0 4px 20px #0003}.build-area{max-width:none;width:100%}.build-area svg{max-height:none}.game-bottom{max-width:none}.studio-layout{grid-template-columns:280px minmax(0,1fr)}.studio-layout>div{min-width:0}.studio-tabs .soft{font-size:13px;min-height:48px}.swatches button{width:48px;height:48px}.studio-tools label{font-size:14px}.studio-tools input{height:48px}.studio-palette .piece{height:104px}.studio-palette .piece span{font-size:11px}.studio-actions .soft{font-size:13px;min-height:48px}.studio-note{font-size:13px}.close{width:48px;height:48px}body:has(#game:not([hidden])) footer,body:has(#studio:not([hidden])) footer{display:none}.soft{font-size:14px}.piece span{font-size:11px;max-width:100%}.game-title p{font-size:16px}.game-title h1{font-size:30px}.game-top{gap:12px}.game-top>span{text-align:center}.tray{max-width:none}.world-picture{height:clamp(155px,17vw,260px)}
@media(min-width:700px){.hero{min-height:400px}.hero-art{max-width:690px;justify-self:center}.world-info p,.world-meta{font-size:13px}.level-choice{min-height:104px}.level-choice small{font-size:13px}.build-count{font-size:14px}}
@media(min-width:700px) and (orientation:portrait){
 #game{padding-bottom:max(20px,env(safe-area-inset-bottom))}.game-title{margin:18px 0}.build-area svg{height:auto;max-height:62dvh;min-height:400px}.tray{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:14px;margin:20px 0;padding:8px;max-height:290px;overflow-y:auto;overscroll-behavior:contain}.tray .piece{width:100%;height:120px}.game-bottom{margin:12px 0}.studio-layout{grid-template-columns:1fr;gap:16px}.studio-tools{order:2}.studio-palette{grid-template-columns:repeat(6,minmax(0,1fr));max-height:240px}.studio-tools .swatches{margin:14px 0}.studio-tools input{max-width:420px}.studio-tools label{display:inline-block;margin-right:24px}#studio-board{max-height:58dvh;min-height:380px}
}
@media(min-width:900px) and (min-height:600px) and (orientation:landscape){
 body:has(#game:not([hidden])) header,body:has(#studio:not([hidden])) header{height:70px}
 #game{height:calc(100dvh - 70px);min-height:530px;display:grid;grid-template-columns:minmax(0,1fr) 250px;grid-template-rows:54px 76px minmax(0,1fr) 58px;grid-template-areas:'top top' 'title tray' 'board tray' 'bottom tray';gap:10px 18px;padding-bottom:max(12px,env(safe-area-inset-bottom))}
 #game .game-top{grid-area:top;margin:0}#game .game-title{grid-area:title;align-self:center}#game .game-title h1{margin:0;font-size:27px}#game .game-title p{margin:3px 0;font-size:14px}#game .game-title .eyebrow{display:none}#game .build-area{grid-area:board;height:100%;min-height:0;margin:0}#game .build-area svg{height:100%;width:100%}
 #game .tray{grid-area:tray;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:112px;align-content:start;gap:12px;width:100%;margin:0;padding:10px;overflow-y:auto;overscroll-behavior:contain;background:#eeefe2;border-radius:22px}#game .tray .piece{width:100%;height:108px}#game .tray .piece svg{height:57px}#game .game-bottom{grid-area:bottom;width:100%;margin:0;gap:10px}#game .game-bottom span{font-size:11px}
 #studio{height:calc(100dvh - 70px);min-height:530px;display:grid;grid-template-rows:54px 72px minmax(0,1fr);gap:8px;padding-bottom:12px}#studio .game-top{margin:0}#studio .game-title h1{font-size:26px;margin:0}#studio .game-title .eyebrow{display:none}#studio-status{font-size:14px;min-height:22px;margin:4px 0}.studio-layout{min-height:0;margin:0;gap:18px;grid-template-columns:270px minmax(0,1fr)}.studio-tools{height:100%;overflow:auto;overscroll-behavior:contain;align-self:stretch}.studio-layout>div{display:flex;flex-direction:column;min-height:0}.studio-layout>div>#studio-board{flex:1;min-height:0;height:100%;width:100%}.studio-actions{flex-shrink:0;margin-bottom:8px;gap:8px}.studio-actions:last-child{margin:0}.studio-note{margin:5px 0;font-size:11px}.studio-palette{max-height:none;grid-template-columns:repeat(3,minmax(0,1fr))}.studio-palette .piece{height:90px}.studio-tools .swatches{gap:8px}.studio-tools .swatches button{width:46px;height:46px}
}
@media(max-width:699px){header{padding:0 14px;height:76px}.brand{font-size:16px;gap:8px}.brand small{font-size:7px;letter-spacing:1px}.brand-icon{width:34px;height:38px}nav{gap:5px}.icon-btn{width:44px;min-width:44px;min-height:44px;height:44px}.age{display:none}main{padding:0 14px}.studio-layout{grid-template-columns:1fr}.studio-tools{order:2}.studio-palette{grid-template-columns:repeat(4,minmax(0,1fr))}.game-title p{font-size:13px}.game-top .soft{font-size:12px}.game-top>span{font-size:11px}.build-area{border-width:4px}.game-bottom span{display:none}.game-bottom{margin:14px 0 24px}.piece span{font-size:10px}.studio-banner{padding:20px}.studio-banner h2{font-size:21px}.studio-actions .soft{font-size:12px}.studio-note{font-size:12px}}
@media(hover:none){button:hover{transform:none}}
