/* v0.14.4 — dedicated compact gameplay HUD for landscape phones.
   Reserve distinct rows for stats, mission/map and touch controls.
   Preserve title/selection visual layouts and desktop HUD. */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 1100px) {
  #hud {--safe-l:env(safe-area-inset-left,0px);--safe-r:env(safe-area-inset-right,0px);--safe-b:env(safe-area-inset-bottom,0px);--h-top:42px;--h-gap:5px;--right-width:120px;}
  #hud .hud-top {
    top: max(2px, env(safe-area-inset-top, 0px)) !important;
    left:max(4px, var(--safe-l)) !important;right:max(4px, var(--safe-r)) !important;
    height: var(--h-top) !important;min-height:0;max-height:var(--h-top);display:flex!important;
    flex-wrap:nowrap!important;gap:clamp(3px, .9vw, 9px)!important;
    padding:3px 6px!important;border-radius:9px;overflow:visible;
  }
  #hud .hud-brand {flex:0 1 111px;min-width:0!important;width:auto;gap:4px;overflow:hidden;}
  #hud .brand-icon {width:22px;height:22px;font-size:15px;border-radius:6px;flex:0 0 22px;}
  #hud .hud-brand strong {font-size:9px!important;line-height:1.14;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  #hud .hud-brand small {display:none;}
  #hud .stat-block {width:auto!important;min-width:0!important;max-width:none;flex:1 1 85px;}
  #hud .stat-block span,#hud .stat-block strong {font-size:8px!important;margin:0;white-space:nowrap;line-height:1.08;}
  #hud .stat-block strong{display:inline-block;margin-left:4px;}
  #hud .meter{height:5px;margin-top:1px;}
  #hud .status-counters {flex:0 1 125px;min-width:0;gap:1px;display:flex;flex-direction:column;align-items:flex-end;justify-content:center;line-height:1.1;font-size:9px!important;white-space:nowrap;}
  #hud .status-counters span{font-size:9px!important;line-height:1.12;}
  #hud .icon-button{width:32px;height:31px;flex:0 0 32px;padding:2px!important;font-size:14px!important;border-radius:8px;touch-action:manipulation;}
  #hud .hud-left {position:absolute;top:calc(var(--h-top) + var(--h-gap) + max(2px, env(safe-area-inset-top,0px)))!important;left:max(5px, var(--safe-l))!important;width:clamp(112px,20vw,155px)!important;gap:0;}
  #hud .mission-card {padding:5px 6px!important;border-radius:8px;}
  #hud .mission-tag{font-size:7px!important;margin:0 0 1px;letter-spacing:.06em;}
  #hud .mission-card>strong{font-size:10px!important;line-height:1.12;display:block;}
  #hud .mission-card p{font-size:8px!important;line-height:1.2;margin:3px 0!important;}
  #hud .objective{font-size:8px!important;padding:2px 0;gap:3px;line-height:1.15;}
  #hud .objective b{flex-shrink:0;}
  #hud .hud-right {position:absolute;top:calc(var(--h-top) + var(--h-gap) + max(2px, env(safe-area-inset-top,0px)))!important;right:max(5px, var(--safe-r))!important;width:var(--right-width)!important;gap:3px!important;}
  #hud .minimap-box{padding:4px!important;border-radius:8px;}
  #hud .minimap-title{font-size:7px!important;margin:0 0 2px!important;line-height:1.05;}
  #hud #minimap{width:min(78px,100%)!important;height:78px!important;aspect-ratio:1!important;margin:0 auto!important;}
  #hud .minimap-legend{display:none;}
  #hud .pickup-map-legend{font-size:6.5px!important;line-height:1.15;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:1px 2px!important;margin-top:3px!important;}
  #hud .pickup-map-legend span{min-width:0;gap:2px!important;white-space:nowrap;}
  #hud .pickup-map-legend i{width:5px;height:5px;flex-basis:5px;}
  #hud .camera-label{padding:3px 4px!important;border-radius:8px;gap:2px!important;display:flex;flex-direction:column;align-items:stretch;}
  #hud .camera-row{gap:2px!important;min-height:23px;}
  #hud .camera-row span{font-size:7.5px!important;}
  #hud .camera-row button{padding:2px 4px!important;min-height:24px!important;min-width:43px;font-size:8.5px!important;}
  #hud .camera-control-hint{font-size:7px!important;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  #hud .vehicle-label{padding:3px 5px!important;border-radius:8px;gap:3px;font-size:8px!important;overflow:hidden;}
  #hud .vehicle-label span,#hud .vehicle-label small{font-size:8px!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
  #hud .pilot-talk{display:none!important;}
  #hud .hud-bottom{position:absolute;bottom:calc(max(4px, var(--safe-b)) + 2px)!important;
    left:calc(max(7px,var(--safe-l)) + clamp(76px,19vh,102px) + 8px)!important;
    right:calc(max(7px,var(--safe-r)) + 3 * clamp(48px,13vh,58px) + 18px)!important;
    justify-content:center;max-width:none;width:auto;pointer-events:none;}
  #hud .key-help{display:none!important;}
  #hud .distance-target{padding:3px 7px!important;gap:5px;font-size:8px!important;white-space:nowrap;border-radius:6px;}
  #hud .distance-target span,#hud .distance-target strong{font-size:8px!important;}
  #hud .touch-ui{display:flex!important;bottom:calc(max(6px, var(--safe-b)) + 3px)!important;left:max(7px,var(--safe-l))!important;right:max(7px,var(--safe-r))!important;align-items:flex-end;pointer-events:none;}
  #hud .joystick{width:clamp(76px,19vh,102px)!important;height:clamp(76px,19vh,102px)!important;}
  #hud .joystick .stick{width:42px;height:42px;}
  #hud .touch-buttons{gap:4px!important;align-items:flex-end;}
  #hud .touch-buttons button,#hud .touch-buttons #touchBomb,#hud .touch-buttons #touchMagic{width:clamp(48px,13vh,58px)!important;height:clamp(48px,13vh,58px)!important;min-width:44px;min-height:44px;font-size:10px!important;padding:2px;border-width:2px;}
  #hud .game-message {top:19%!important;max-width:39vw;min-width:125px;padding:5px 8px!important;font-size:11px!important;}
}
/* Particularly short and/or narrow landscape devices. The right stack stays above action buttons. */
@media (orientation:landscape) and (max-height:385px) and (max-width:1100px) {
  #hud{--h-top:38px;--h-gap:3px;--right-width:109px;}
  #hud .hud-top{padding:2px 4px!important;}
  #hud .hud-brand{flex-basis:92px;}
  #hud .hud-brand strong{font-size:8px!important;}
  #hud .brand-icon{display:none;}
  #hud .stat-block span,#hud .stat-block strong{font-size:7px!important;}
  #hud .status-counters{flex-basis:95px;}
  #hud .status-counters span{font-size:8px!important;}
  #hud .icon-button{width:29px;height:29px;flex-basis:29px;}
  #hud .hud-left{width:clamp(104px,19vw,142px)!important;}
  #hud .mission-card{padding:4px 5px!important;}
  #hud .mission-card p{font-size:7.5px!important;margin:2px 0!important;}
  #hud .objective{font-size:7.5px!important;padding:1px 0;}
  #hud #minimap{height:64px!important;width:64px!important;}
  #hud .minimap-title{font-size:6.5px!important;}
  #hud .pickup-map-legend{font-size:6px!important;}
  #hud .camera-row{min-height:20px;}
  #hud .camera-row button{min-height:22px!important;min-width:40px;font-size:8px!important;}
  #hud .camera-control-hint{font-size:6.5px!important;}
  #hud .vehicle-label{padding:2px 3px!important;}
  #hud .vehicle-label span,#hud .vehicle-label small{font-size:7px!important;}
  #hud .hud-bottom{left:calc(max(7px,var(--safe-l)) + clamp(72px,22vh,88px) + 8px)!important;
    right:calc(max(7px,var(--safe-r)) + 3 * clamp(44px,14vh,54px) + 18px)!important;}
  #hud .touch-ui{bottom:calc(max(4px,var(--safe-b)) + 2px)!important;}
  #hud .joystick{width:clamp(72px,22vh,88px)!important;height:clamp(72px,22vh,88px)!important;}
  #hud .touch-buttons button,#hud .touch-buttons #touchBomb,#hud .touch-buttons #touchMagic{width:clamp(44px,14vh,54px)!important;height:clamp(44px,14vh,54px)!important;}
}
