/* Shared by every language. Safe areas and short landscapes retain scrollable menus. */
.screen:not(#game){min-height:0;overflow-y:auto;justify-content:flex-start;padding-top:max(28px,env(safe-area-inset-top));padding-bottom:max(28px,env(safe-area-inset-bottom))}
.screen:not(#game)>*{flex-shrink:0}#title>.pict,#login>.brand{margin-top:auto}#title>.who,#login>.foot{margin-bottom:auto}
#card,#pm{overflow-y:auto;overscroll-behavior:contain;padding:max(20px,env(safe-area-inset-top)) max(18px,env(safe-area-inset-right)) max(20px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left))}
#card>div,#pm>.in{margin:auto;max-height:none;flex-shrink:0}#pm>.in{width:min(640px,94vw)}#pm .help{max-height:32dvh;overflow:auto}
#look,#stick,.tbtn{touch-action:none}#prompt,#toast{white-space:normal;overflow-wrap:anywhere;max-width:70vw}#bigmap .t{max-width:92vw;letter-spacing:.02em;line-height:1.5;text-wrap:balance}
@media(orientation:landscape) and (max-height:1000px){
 body.touch #urgeBox{top:max(56px,calc(env(safe-area-inset-top) + 48px));left:max(14px,env(safe-area-inset-left));width:140px;padding:8px 10px}
 body.touch #objBox{top:max(14px,env(safe-area-inset-top));left:174px;right:174px;transform:none;max-width:620px;margin-inline:auto;padding:8px 12px;font-size:13px}
 body.touch #minimap{top:max(14px,env(safe-area-inset-top));right:max(14px,env(safe-area-inset-right));width:118px;height:118px}
 body.touch #tMenu{top:max(12px,env(safe-area-inset-top));left:max(14px,env(safe-area-inset-left));height:36px;min-width:110px}
 body.touch #tMap{top:140px;right:max(14px,env(safe-area-inset-right));width:118px;height:36px}
 body.touch #timer{top:182px;right:max(14px,env(safe-area-inset-right));width:118px;font-size:20px}
 body.touch #stick{left:max(28px,env(safe-area-inset-left));bottom:max(26px,env(safe-area-inset-bottom));width:118px;height:118px}
 body.touch #tAct{right:max(22px,env(safe-area-inset-right));bottom:max(68px,calc(env(safe-area-inset-bottom) + 38px));width:86px;height:86px}
 body.touch #tRun{right:max(124px,calc(env(safe-area-inset-right) + 108px));bottom:max(24px,env(safe-area-inset-bottom));width:70px;height:70px}
 body.touch #tGaman{right:max(124px,calc(env(safe-area-inset-right) + 108px));bottom:max(112px,calc(env(safe-area-inset-bottom) + 88px));width:70px;height:70px}
 body.touch #perspectiveToggle{bottom:212px!important;right:max(14px,env(safe-area-inset-right))!important;min-height:40px;font-size:12px;max-width:158px}
 body.touch #items{top:74px;left:50%;max-width:calc(100vw - 380px);font-size:12px}
 body.touch #sub{bottom:26px;width:calc(100vw - 390px);max-width:720px;font-size:14px;line-height:1.65}
 body.touch #prompt{bottom:110px;max-width:calc(100vw - 380px);font-size:14px}
 #dlg{width:min(720px,calc(100vw - 410px));bottom:18px;max-height:calc(100dvh - 130px);padding:12px 16px}#dlgOpts button{min-height:44px;flex-wrap:wrap}#dlgOpts button small{white-space:normal}
 .live-speech{max-width:calc(100vw - 380px)}
}
@media(orientation:landscape) and (max-height:540px){
 body.touch #urgeBox{width:124px;top:50px;font-size:11px}body.touch #urgeBox .mini{margin-top:5px}body.touch #urgeState{font-size:13px}body.touch #minimap{width:92px;height:92px}body.touch #tMap{width:92px;top:112px;height:32px}body.touch #timer{top:150px;width:92px;font-size:16px}body.touch #perspectiveToggle{bottom:auto!important;top:194px;font-size:11px;max-width:130px}body.touch #objBox{left:150px;right:144px;font-size:11px}body.touch #objBox small{display:none}body.touch #items{top:56px;max-width:calc(100vw - 300px)}body.touch #tAct{width:72px;height:72px;bottom:42px}body.touch #tRun{width:60px;height:60px;right:108px;bottom:18px}body.touch #tGaman{width:60px;height:60px;right:108px;bottom:94px}body.touch #stick{width:100px;height:100px;bottom:22px}body.touch #knob{left:27px;top:27px;width:46px;height:46px}#dlg{width:calc(100vw - 300px);max-height:calc(100dvh - 90px);font-size:13px}#dlgText{font-size:14px;line-height:1.5}#card .in{font-size:14px;line-height:1.65}
}
.ranking-dialog{margin:auto;width:min(840px,94vw);max-height:90dvh;overflow:auto;overscroll-behavior:contain;border:1px solid #6c8da4;border-radius:18px;background:#112336;color:#f5f2e9;padding:20px;font:16px/1.6 system-ui;overflow-wrap:anywhere}.ranking-dialog::backdrop{background:#000b}.ranking-dialog button{min-height:44px;padding:8px 14px;border:1px solid #7293ae;border-radius:10px;background:#203d56;color:#fff;font:inherit}.ranking-top{display:flex;justify-content:space-between;gap:14px;align-items:center}.ranking-tabs{display:flex;gap:8px;flex-wrap:wrap;margin-block:14px}.ranking-tabs button[aria-pressed=true]{background:#dfbb66;color:#14202c}.ranking-note{font-size:13px;color:#b6cada;margin-block:10px}.ranking-own{padding:12px;border-radius:10px;background:#203247;color:#ffe2a0}.ranking-list{padding:0;list-style:none;margin-block:14px}.ranking-list li{display:grid;grid-template-columns:40px minmax(0,1fr) auto;gap:12px;padding:12px 8px;border-bottom:1px solid #39536b;align-items:center}.ranking-list li span{overflow-wrap:anywhere}.ranking-self{background:#34516a;border-radius:8px}.ranking-list strong{color:#dfbb66}.ranking-list b{font-variant-numeric:tabular-nums}@media(max-height:600px){.ranking-dialog{max-height:94dvh;padding:14px}.ranking-tabs{gap:6px;margin-block:8px}}

@media(orientation:landscape){body.touch #prompt{max-width:calc(100vw - 410px)}}
@media(orientation:landscape) and (max-height:540px){#dlg{width:calc(100vw - 350px)}}
@media(orientation:landscape) and (max-height:430px){body.touch #perspectiveToggle{top:auto!important;bottom:8px!important;right:50%!important;transform:translateX(50%)}body.touch #sub{bottom:66px}body.touch #urgeBox .mini{display:none}}
