/* Landscape phone layout; desktop debug controls remain unchanged. */
#rotate-hint{display:none}
@media (hover:none) and (pointer:coarse) and (orientation:portrait){
  #rotate-hint{display:grid;place-content:center;position:fixed;inset:0;z-index:30;pointer-events:none;text-align:center;background:#101713e8;color:#f2ead2;font:700 22px/1.7 system-ui,"Microsoft YaHei",sans-serif}
  #rotate-hint small{font-size:14px;font-weight:400}
}
@media (hover:none) and (pointer:coarse) and (orientation:landscape){
  html,body{width:100%;height:100%;min-height:0;overflow:hidden;overscroll-behavior:none;-webkit-text-size-adjust:100%}
  body{display:block;position:fixed;inset:0}
  #game-shell{width:100vw;height:100vh;height:100dvh;max-width:none;max-height:none;aspect-ratio:auto;box-shadow:none}

  #stats{left:max(6px,env(safe-area-inset-left));top:max(6px,env(safe-area-inset-top));width:clamp(150px,24vw,200px);min-width:0;padding:6px 8px;border-radius:8px}
  #stats .stat{grid-template-columns:42px minmax(54px,1fr) 25px;gap:5px;margin:2px 0;font-size:clamp(9px,1.9vh,11px);line-height:1.35}
  #stats .stat em{font-size:9px}
  #stats .meter{height:4px}

  #hotbar{top:max(4px,env(safe-area-inset-top));bottom:auto;padding:3px;gap:3px;border-radius:8px}
  #hotbar .slot{width:clamp(34px,8.5vh,43px);height:clamp(31px,8vh,39px);padding:3px;font-size:9px}
  #hotbar .slot b{font-size:9px;line-height:1.1}

  #quest-hud{left:50%!important;top:max(45px,calc(env(safe-area-inset-top) + 43px))!important;transform:translateX(-50%);width:clamp(170px,31vw,250px)!important;max-width:none!important;max-height:40px;padding:5px 8px!important;overflow:hidden;font-size:9px!important;border-radius:7px}
  #quest-hud b{font-size:9px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  #quest-hud small{font-size:8px!important;white-space:nowrap}

  #day-info{right:max(7px,env(safe-area-inset-right));top:max(6px,env(safe-area-inset-top));padding:6px 8px;font-size:9px;line-height:1.35;border-radius:8px}
  #minimap{right:max(8px,env(safe-area-inset-right));top:max(61px,calc(env(safe-area-inset-top) + 58px));width:clamp(72px,18vh,94px);height:clamp(72px,18vh,94px);border-width:1px}
  #pause-button{right:max(8px,env(safe-area-inset-right));top:max(42px,calc(env(safe-area-inset-top) + 39px));width:28px;height:28px;font-size:12px}

  #talent-banner{left:max(6px,env(safe-area-inset-left))!important;top:max(111px,calc(env(safe-area-inset-top) + 108px))!important;bottom:auto!important;max-width:clamp(135px,21vw,175px);padding:5px 7px;font-size:9px;border-radius:7px}
  #talent-banner .talent-name{font-size:10px}
  #status-effects{left:calc(max(6px,env(safe-area-inset-left)) + clamp(150px,24vw,200px) + 7px);top:max(7px,env(safe-area-inset-top));max-width:clamp(100px,18vw,160px);gap:3px}
  #status-effects span{padding:2px 4px;font-size:8px}

  #joystick-zone{left:max(7px,env(safe-area-inset-left));bottom:max(6px,env(safe-area-inset-bottom));width:clamp(132px,32vh,156px);height:clamp(132px,32vh,156px);transform:none}
  #joystick-base{width:clamp(112px,28vh,132px);height:clamp(112px,28vh,132px)}
  #joystick-knob{width:clamp(44px,11vh,54px);height:clamp(44px,11vh,54px);margin:clamp(-27px,-5.5vh,-22px)}
  #touch-bag{left:calc(max(7px,env(safe-area-inset-left)) + clamp(132px,32vh,156px));right:auto;top:auto;bottom:max(10px,calc(env(safe-area-inset-bottom) + 7px));width:40px;height:40px;font-size:13px;transform:none}

  #action-buttons{right:max(8px,env(safe-area-inset-right));bottom:max(7px,env(safe-area-inset-bottom));display:grid;grid-template-columns:repeat(3,clamp(48px,12.5vh,62px));gap:clamp(6px,1.2vw,11px);align-items:end}
  #action-buttons .touch-action,#action-buttons .touch-action:nth-child(3){width:clamp(48px,12.5vh,62px);height:clamp(48px,12.5vh,62px);margin:0;font-size:clamp(11px,2.2vh,14px)}
  #context-interact{left:auto;right:calc(max(8px,env(safe-area-inset-right)) + clamp(54px,13.7vh,68px));bottom:calc(max(7px,env(safe-area-inset-bottom)) + clamp(56px,14vh,70px));transform:none;min-width:94px;max-width:150px;padding:7px 10px;font-size:10px;white-space:nowrap}

  #menu{inset:3% 2%;overscroll-behavior:contain}
  .dialog{max-height:calc(100% - 12px);overflow:auto;padding:14px 18px}
  #prompt{display:none}
  #notice{max-width:46vw;padding:6px 12px;font-size:10px;text-align:center}
}
