/* Only presentation changes on touch screens. Positions and ranges remain server-owned. */
@media (max-width:959px) {
  .siege-world{inset:0;--stone-base:11%!important;--exit-x:50%!important;--exit-y:8%!important}
  .siege-world[data-side=defender]{--stone-base:98%!important;--exit-y:94%!important}
  /* Keep the HUD outside the scrolling battlefield; only rows move on scroll. */
  .siege-world .siege-hud{bottom:40px;display:grid;grid-template-columns:124px minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);align-items:start}
  .siege-world .siege-arena{bottom:40px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
  .siege-world .siege-scene{position:relative;inset:auto;height:calc(100% - 96px);min-height:420px;margin:52px 0 44px}
  .siege-world .siege-terrain{background-size:cover;filter:brightness(.68) saturate(.85)}
  .siege-world .battle-row{left:50%;top:var(--mobile-row-y);width:var(--mobile-row-span);height:46px;gap:3px}
  .siege-world .actor-card{grid-template-columns:1fr;gap:1px;padding:3px 2px;text-align:center}
  .siege-world .actor-card .guild-crest{width:18px;height:18px;margin:auto}
  .siege-world .actor-copy small{font:9px/1.2 Arial,sans-serif}
  .siege-world .actor-copy strong{font:bold 10px/1.25 Arial,sans-serif}
  .siege-world .resources{gap:1px;margin:0}
  .siege-world .resource{height:4px}
  .siege-world .is-self .actor-card:before{top:-10px;font-size:7px}
  .siege-world .position-tile{width:48px;max-width:100%;height:38px}
  .siege-world .siege-stone{height:44px;width:70px}
  .siege-world[data-side=defender] .siege-stone{height:56px}
  .siege-world .siege-objective{position:static;grid-column:2;grid-row:1;width:auto;min-height:50px;padding:5px 8px;border-radius:0;border-width:0 0 1px;background:#151c17f5}
  .siege-world .siege-stone-info{display:grid;grid-template-columns:1fr;gap:2px}
  .siege-world .stone-kind{font-size:8px;letter-spacing:0;margin:0}
  .siege-world .siege-owner strong{font-size:11px}
  .siege-world .siege-owner .guild-crest{width:16px;height:16px}
  .siege-world .stone-hp{height:4px;margin:0}
  .siege-world .stone-hold{font-size:9px}
  .siege-world .siege-stone-alert,.siege-world .siege-recovery{padding-top:3px;margin-top:3px;font-size:9px}
  .siege-world .siege-staging{display:contents}
  .siege-world .siege-staging header{position:relative;grid-column:1;grid-row:1;align-self:stretch;min-height:50px;padding:0 30px 0 8px;font:10px Arial,sans-serif;gap:4px;box-sizing:border-box;background:#151c17f5;border-right:1px solid #b7a27077}
  .siege-world .staging-toggle{display:block;position:absolute;inset:0 0 0 auto;width:100%;padding:0 8px;border:0;background:none;text-align:right;font:20px Arial,sans-serif}
  .siege-world .siege-staging .staging-content{display:none}
  .siege-world.staging-expanded .siege-staging .staging-content{display:flex;flex-direction:column;grid-column:1/-1;grid-row:2;min-height:0;max-height:calc(100% - 44px);width:min(270px,80%);box-sizing:border-box;background:#151c17f5;border:1px solid #b7a27077;border-top:0;box-shadow:6px 8px 24px #000b;pointer-events:auto}
  .siege-world .siege-staging p{flex:none}
  .siege-world .siege-staging .staging-players{padding:0 8px 8px}
  .siege-world .siege-staging .actor-card{grid-template-columns:auto minmax(0,1fr);text-align:left;min-height:44px;padding:5px 8px;gap:8px}
  .siege-world .siege-staging .actor-card .guild-crest{width:26px;height:26px}
  .siege-world .siege-staging .actor-copy small{font-size:10px}
  .siege-world .siege-staging .actor-copy strong{font-size:12px}
  .siege-world .siege-staging p{padding:6px 10px;margin:0;font-size:11px}
  .siege-world .siege-passages{position:sticky;inset:auto;bottom:0;display:flex;justify-content:center;gap:6px;height:44px;margin-top:-44px;background:#121a16ed;padding:2px 6px;box-sizing:border-box;z-index:7}
  .siege-world .passage-button{position:static!important;transform:none!important;min-height:40px;min-width:100px;flex:1;max-width:180px;justify-content:center;padding:3px 8px}
  .siege-world .passage-button>b{font-size:11px}
  .siege-world .siege-threat{position:sticky;top:52px;right:auto;max-width:none;margin:0 10px;padding:4px 8px;pointer-events:none}
  .siege-world .siege-footer{height:38px;gap:6px;padding:0 4px;box-sizing:border-box;background:#121a16e8}
  .siege-world .siege-position-status{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px}
  .siege-world .siege-footer button{min-width:52px;min-height:36px;flex-shrink:0;font-size:11px}
  .siege-world .siege-step{min-width:126px;flex-shrink:0}
  .siege-world .siege-footer:has(.siege-step:not([hidden])) .siege-position-status{display:none}
  .siege-world .siege-message{bottom:86px;left:8px;right:8px;background:#171b13d9;border-radius:4px}
  .siege-world .siege-message:empty{display:none}
  body.interface-shell.interface-controls.interface-liquid.interface-hud.interface-mobile.siege-active [data-interface-scene] #effectBar{top:54px!important;right:6px!important;height:32px;min-height:32px;max-height:32px;pointer-events:none}
  body.interface-shell.interface-controls.interface-liquid.interface-hud.interface-mobile.siege-active [data-interface-scene] #effectBar .effect{pointer-events:auto;flex-basis:32px;width:32px;height:32px;min-height:32px;grid-template-rows:22px 8px}
  body.interface-shell.interface-controls.interface-liquid.interface-hud.interface-mobile.siege-active [data-interface-scene] #effectBar .effect-ico{width:22px;height:22px}
  body.interface-shell.interface-controls.interface-liquid.interface-hud.interface-mobile.siege-active [data-interface-scene] #effectBar .effect-timer{font-size:8px;line-height:8px}
}
@media (max-width:599px) and (orientation:portrait) {
  body.interface-shell.interface-controls.interface-liquid.interface-hud.interface-mobile.siege-active{--interface-hotbar-height:202px}
  body.interface-shell.interface-controls.interface-liquid.interface-hud.interface-mobile.siege-active #hotbar.interface-hotbar-v2{grid-template-columns:minmax(0,1fr) 92px 92px!important;grid-template-rows:52px minmax(0,1fr)!important;gap:4px!important;padding:4px!important}
  /* XP is hidden here: two explicit tracks keep HP/MP inside the compact row. */
  body.interface-shell.interface-controls.interface-liquid.interface-hud.interface-mobile.siege-active #hotbar .combat-vitals{grid-template-columns:minmax(0,1fr);grid-template-rows:repeat(2,minmax(0,1fr));height:52px;min-height:0;box-sizing:border-box}
  body.interface-shell.interface-controls.interface-liquid.interface-hud.interface-mobile.siege-active #hotbar .combat-vitals .bar:has(#xpT){display:none}
  body.interface-shell.interface-controls.interface-liquid.interface-hud.interface-mobile.siege-active #hotbar .combat-vitals .bl{min-height:12px;line-height:12px;white-space:nowrap}
  body.interface-shell.interface-controls.interface-liquid.interface-hud.interface-mobile.siege-active #hotbar .combat-vitals .bl>span{font-size:9px!important;line-height:12px!important}
  body.interface-shell.interface-controls.interface-liquid.interface-hud.interface-mobile.siege-active #hotbar .combat-vitals .bt{height:7px}
  body.interface-shell.interface-controls.interface-liquid.interface-hud.interface-mobile.siege-active #hotbar .hot-actions{display:flex;flex-direction:row;width:92px;gap:4px}
  body.interface-shell.interface-controls.interface-liquid.interface-hud.interface-mobile.siege-active #hotbar .ab{width:44px;min-width:44px;font-size:8px!important}
  body.interface-shell.interface-controls.interface-liquid.interface-hud.interface-mobile.siege-active #hotbar #autoB img{display:none}
  body.interface-shell.interface-controls.interface-liquid.interface-hud.interface-mobile.siege-active #hotbar #autoSettingsButton img{display:block;width:22px;height:22px}
  body.interface-shell.interface-controls.interface-liquid.interface-hud.interface-mobile.siege-active #hotbar #autoSettingsButton span{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  body.interface-shell.interface-controls.interface-liquid.interface-hud.interface-mobile.siege-active #hotbar #quickItemSlots{grid-template-columns:repeat(2,44px);grid-template-rows:44px;width:92px;gap:4px}
}
@media (max-width:359px) and (orientation:portrait) {
  body.interface-shell.interface-controls.interface-liquid.interface-hud.interface-mobile.siege-active #hotbar.interface-hotbar-v2{column-gap:2px!important}
  body.interface-shell.interface-controls.interface-liquid.interface-hud.interface-mobile.siege-active #hotbar .combat-vitals{padding:2px 1px!important}
  body.interface-shell.interface-controls.interface-liquid.interface-hud.interface-mobile.siege-active #hotbar .combat-vitals .bl>span{font-size:8px!important}
}
@media (max-width:959px) and (orientation:landscape) {
  .siege-world .siege-hud{bottom:30px;grid-template-columns:136px minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr)}
  .siege-world .siege-arena{bottom:30px}
  .siege-world .siege-scene{height:100%;min-height:240px;margin:0 0 0 142px}
  .siege-world .battle-row{width:min(var(--mobile-row-span),480px);height:28px}
  .siege-world .actor-card{grid-template-columns:auto minmax(0,1fr);text-align:left;gap:4px;padding:2px}
  .siege-world .actor-card .guild-crest{width:18px;height:18px}
  .siege-world .actor-card .resources{display:none}
  .siege-world .siege-objective{grid-column:1}
  .siege-world .siege-staging header{grid-row:2;min-height:40px}
  .siege-world.staging-expanded .siege-staging .staging-content{grid-column:2;grid-row:1/-1;margin-left:6px;width:min(270px,calc(100% - 6px));max-height:100%;border-top:1px solid #b7a27077}
  .siege-world .siege-passages{position:sticky;bottom:0;width:136px;height:44px;margin:-44px 0 0;padding:2px;gap:2px}
  .siege-world .passage-button{min-width:0;padding:3px;gap:2px;grid-template-columns:8px auto}
  .siege-world .passage-button>b{font-size:9px}
  .siege-world .siege-footer{height:28px}
  .siege-world .siege-footer button{min-height:26px;padding:2px 10px}
  body.interface-shell.interface-controls.interface-liquid.interface-hud.interface-mobile.siege-active [data-interface-scene] #effectBar{left:148px!important;top:0!important}
}
