
@media (max-width:1023px){
 #game-layout{grid-template-columns:180px minmax(0,1fr) 170px}
 .brand{min-width:160px}.brand-sub{display:none}
 .stat{min-width:70px;padding:6px 8px}
}
@media (max-width:767px){
 #game-shell{padding:7px;padding-top:max(7px,env(safe-area-inset-top));padding-bottom:max(7px,env(safe-area-inset-bottom))}
 .top-hud{min-height:48px;padding:3px;gap:6px}
 .brand{min-width:0;flex:1}.brand-mark{width:38px;height:38px}.brand-title{font-size:16px}.brand-sub{display:none}
 .hud-stats{gap:4px;justify-content:flex-start}.stat{min-width:58px;padding:5px 6px}.stat b{font-size:12px}.stat span{font-size:7px}
 .hud-actions .icon-btn{width:40px;height:40px}.hud-actions .hide-mobile{display:none}
 #game-layout{grid-template-columns:1fr;grid-template-rows:auto minmax(0,1fr) auto;gap:7px}
 #container-panel{order:1;overflow:visible;padding:8px 10px}
 #container-panel .panel-title{margin-bottom:5px}
 .container-stack{grid-template-columns:repeat(3,1fr);gap:5px}
 .container-card{padding:6px 7px}.container-note{display:none}.pips{margin-top:5px}.pip{height:6px;width:18px}
 #puzzle-area{order:2;min-height:0}
 #puzzle-board{width:min(96vw,520px);height:auto;max-height:58dvh;aspect-ratio:1.12}
 #tool-panel{order:3;padding:8px 10px;overflow:visible}
 #tool-panel .panel-title{margin-bottom:6px}
 .tool-stack{grid-template-columns:repeat(4,1fr);gap:5px}.tool-btn{display:block;text-align:center;padding:6px}.tool-icon{margin:auto;width:30px;height:30px}.tool-btn b{display:block;font-size:9px}.tool-btn small{font-size:7px}.tool-cost{display:block;margin-top:1px}
 .tool-help{display:none} #mobile-controls{display:none}
 .screw{width:46px;height:46px}.screw.hit{width:60px;height:60px}
}
@media (max-width:480px){
 .hud-stats .stat:nth-child(3){display:none}
 #puzzle-board{max-height:54dvh}
 .menu-card{border-radius:22px;padding:20px}.how-grid{grid-template-columns:1fr}.menu-buttons{margin-top:18px}
}
@media (orientation:landscape) and (max-height:620px) and (max-width:900px){
 #game-shell{padding:5px}
 .top-hud{min-height:43px}.brand-mark{width:34px;height:34px}
 #game-layout{grid-template-columns:150px minmax(0,1fr) 145px;grid-template-rows:1fr;gap:6px}
 #container-panel,#tool-panel{padding:8px}
 #puzzle-board{height:min(82dvh,620px);width:auto}
 .container-stack{grid-template-columns:1fr}
 .tool-stack{grid-template-columns:1fr}
}
@media (min-width:768px){#puzzle-area{min-height:0}}
