@media (any-pointer:coarse),(max-width:1050px){
 html,body,#game-canvas{height:var(--game-height)!important;width:var(--game-width)!important}#controls,#camera-controls{display:none!important}#journey-panel,html[dir=rtl] #journey-panel{top:calc(56px + env(safe-area-inset-top));left:max(8px,env(safe-area-inset-left));right:auto;width:calc(50% - 16px);max-width:250px;padding:8px;gap:4px;font-size:12px;border-radius:12px}#journey-panel h2{font-size:16px;margin:0}#journey-panel p{margin:3px 0}#phone,html[dir=rtl] #phone{top:calc(56px + env(safe-area-inset-top));right:max(8px,env(safe-area-inset-right));left:auto;width:calc(50% - 16px);max-width:180px;border-width:4px;border-radius:15px}.phone-speaker{display:none}.phone-header{padding:6px;font-size:10px}#map-canvas{height:100px}#navigation-instruction{min-height:0;padding:7px;font-size:12px}#settings-button,html[dir=rtl] #settings-button{top:max(8px,env(safe-area-inset-top));right:max(8px,env(safe-area-inset-right));left:auto}#division-dialog[open],html[dir=rtl] #division-dialog[open]{inset:50% auto auto 50%;transform:translate(-50%,-50%);margin:0;width:min(410px,calc(100vw - 24px));max-height:calc(var(--game-height) - 24px);overflow:auto}#division-content{padding:14px;gap:10px}#division-content h2,#division-content p{margin:0}#division-equation{font-size:32px}#sharing-visual{max-height:120px;gap:4px}.guest-share{min-width:42px;min-height:42px}.food-piece{font-size:18px}#answer-form{flex-direction:row;align-items:end;gap:8px}#answer-form label{min-width:0}#answer-input{font-size:18px}#answer-feedback{font-size:15px}#message{top:45%;max-width:90%;font-size:16px;padding:10px 14px}#loading-screen h1{font-size:26px;text-align:center}#loading-screen{padding:16px;text-align:center}
}
@media (any-pointer:coarse) and (orientation:landscape),(max-width:1050px) and (orientation:landscape){#journey-panel,html[dir=rtl] #journey-panel{top:8px;max-width:230px}#phone,html[dir=rtl] #phone{top:54px;max-width:140px}#map-canvas{height:72px}.phone-header{display:none}#navigation-instruction{font-size:11px;padding:5px}#division-content{gap:6px;padding:10px}#sharing-visual{max-height:68px}#division-equation{font-size:26px}}
@media(max-width:700px),(any-pointer:coarse) and (max-height:500px){
 html body.im-native-game #division-dialog[open],html[dir=rtl] body.im-native-game #division-dialog[open]{box-sizing:border-box!important;position:fixed!important;inset:8px 8px auto!important;transform:none!important;width:calc(100% - 16px)!important;max-width:none!important;height:auto!important;max-height:calc(var(--game-height,100dvh) - 16px)!important;margin:0!important;padding:0!important;overflow:auto!important;z-index:2147483500!important}
 html body.im-native-game #division-content{box-sizing:border-box!important;padding:12px!important;gap:8px!important;min-width:0!important;overflow-wrap:anywhere}
 html body.im-native-game #division-content h2{font-size:20px!important;line-height:24px!important;margin:0!important}
 html body.im-native-game #division-story{font-size:14px!important;line-height:19px!important}
 html body.im-native-game #answer-form:not([hidden]){display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:6px!important;width:100%!important}
 html body.im-native-game #answer-input{box-sizing:border-box!important;width:100%!important;min-width:0!important;font-size:18px!important;height:42px!important}
 html body.im-native-game #answer-form button{min-height:42px!important;white-space:normal!important}
 html body.im-native-game #sharing-visual{max-height:100px!important;overflow:auto!important}
 html body.im-native-game #journey-panel{width:calc(47% - 12px)!important;font-size:11px!important}
 html body.im-native-game #phone{width:calc(40% - 12px)!important}
 html body.im-native-game #map-canvas{height:80px!important}
}

/* Landscape: use the visible height, with independently scrolling panels. */
@media (any-pointer:coarse) and (orientation:landscape),(max-width:1050px) and (orientation:landscape){
html body.im-native-game #journey-panel,html[dir=rtl] body.im-native-game #journey-panel{box-sizing:border-box!important;top:44px!important;left:max(6px,env(safe-area-inset-left))!important;right:auto!important;width:190px!important;max-width:28%!important;max-height:calc(var(--game-height) - 102px)!important;overflow:auto!important;padding:6px!important;font-size:11px!important}
html body.im-native-game #journey-panel h2{font-size:14px!important}
html body.im-native-game #phone,html[dir=rtl] body.im-native-game #phone{top:44px!important;right:max(6px,env(safe-area-inset-right))!important;left:auto!important;width:130px!important;max-width:22%!important;max-height:calc(var(--game-height) - 102px)!important;overflow:auto!important}
html body.im-native-game #map-canvas{height:64px!important}
html body.im-native-game #division-dialog[open],html[dir=rtl] body.im-native-game #division-dialog[open]{box-sizing:border-box!important;position:fixed!important;inset:8px!important;transform:none!important;margin:auto!important;width:min(720px,calc(100% - 16px))!important;max-height:calc(var(--game-height) - 16px)!important;overflow:auto!important;padding:0!important}
html body.im-native-game #division-content{padding:8px 12px!important;gap:5px!important}
html body.im-native-game #division-content h2{font-size:18px!important;line-height:21px!important;margin:0!important}
html body.im-native-game #division-story{font-size:13px!important;line-height:16px!important;margin:0!important}
html body.im-native-game #division-equation{font-size:24px!important;line-height:28px!important}
html body.im-native-game #sharing-visual{max-height:60px!important;overflow:auto!important}
html body.im-native-game #answer-form:not([hidden]){display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;align-items:end!important;gap:8px!important}
html body.im-native-game #answer-input{height:40px!important;font-size:18px!important}
html body.im-native-game #answer-form button{min-height:40px!important}
html body.im-native-game #answer-feedback{font-size:13px!important;margin:0!important}
}
