/* Owner-requested 40% reduction of the in-game mobile HUD. Minimap and readable window content keep their size. */
html[data-ui="mobile"]{--mobile-hud-scale:.6;--mobile-status-scale:.66;--mobile-menu-scale:1} /* owner 2026-11-10: status frame +10%, slide-up menu +20%; owner 2026-11-15: the slide-up menu full size (players missed the bag button) */
html[data-ui="mobile"] #hud-status{transform:scale(var(--mobile-status-scale));transform-origin:top left}
html[data-ui="mobile"] #hud-topright{column-gap:3.6px;row-gap:3.6px}
html[data-ui="mobile"] #hud-topright .top-row{gap:3.6px}
html[data-ui="mobile"][data-orient="portrait"] #hud-topright{grid-template-columns:26.4px 98.8px}
html[data-ui="mobile"] #hud-topright .top-row .sq-btn{width:26.4px;height:26.4px;min-width:26.4px;min-height:26.4px;padding:0;border-radius:8.4px}
html[data-ui="mobile"] #hud-topright .top-row .sq-btn>span{transform:scale(var(--mobile-hud-scale));transform-origin:center}
html[data-ui="mobile"] #hud-topright .world-summary{transform:scale(var(--mobile-hud-scale));transform-origin:top right;right:calc(245.4px + var(--safe-r));max-width:calc((100vw - 385.4px - var(--safe-l) - var(--safe-r)) / .6)}
/* owner 2026-11-10: portrait keeps gold / crystals in the top-right like landscape, just left of the top buttons; on a
   narrow phone it wraps (gold above the map name) inside the gap between the status frame and the buttons */
html[data-ui="mobile"][data-orient="portrait"] #hud-topright .world-summary{top:calc(8px + env(safe-area-inset-top,0px));left:auto;right:calc(144px + var(--safe-r));max-width:calc((100vw - 296px - var(--safe-l) - var(--safe-r)) / .6);flex-wrap:wrap;justify-content:flex-end;transform-origin:top right}
html[data-ui="mobile"][data-orient] #hud-topright #hud-trackers:not(:has(> :not(.is-folded):not(.hidden))){transform:scale(var(--mobile-hud-scale));transform-origin:top right}
html[data-ui="mobile"][data-orient="landscape"] #hud-topright #hud-trackers{top:30px;right:115.4px}
/* Owner 2026-11-09: the combat buttons (attack, skills, AUTO, target, skill page) were too small to hit on a phone;
   double them from the reduced .6 to 1.2. Placement for the bigger cluster is in the block at the end of this file. */
html[data-ui="mobile"]{--mobile-action-scale:1.2}
html[data-ui="mobile"] #hud-actions,
html[data-ui="mobile"] #hud-bar{transform:translate(calc(var(--safe-r) * -.4),calc(var(--safe-b) * -.4)) scale(var(--mobile-action-scale));transform-origin:bottom right}
html[data-ui="mobile"][data-orient] #joy-ghost{transform:scale(var(--mobile-hud-scale));transform-origin:center;left:calc(49.2px + var(--safe-l));bottom:calc(45.6px + var(--safe-b))}
html[data-ui="mobile"][data-orient="portrait"] #joy-ghost{left:calc(45.6px + var(--safe-l));bottom:calc(54px + var(--safe-b))}
html[data-ui="mobile"] #joy{transform:scale(var(--mobile-hud-scale));transform-origin:center}
/* owner 2026-11-11: the hidden-chat feed reads at the same text size as the open chat (no HUD shrink) */
html[data-ui="mobile"] #hud #hud-chat.chat-passive{transform:none;width:min(260px,40vw);bottom:calc(84px + var(--safe-b))}
html[data-ui="mobile"][data-orient="portrait"] #hud #hud-chat.chat-passive{bottom:calc(93px + var(--safe-b))}
html[data-ui="mobile"] #hud.menu-open #hud-menu{transform:scale(var(--mobile-menu-scale)) translateX(-50%);transform-origin:bottom left;animation:none}
html[data-ui="mobile"] #hud-exp .exp-chip{transform:scale(var(--mobile-hud-scale));transform-origin:bottom left}
@media(max-width:359px) and (orientation:portrait){
 html[data-ui="mobile"][data-orient="portrait"] #hud-topright .top-row{grid-row:1;margin-top:0}
 html[data-ui="mobile"][data-orient="portrait"] #hud-topright #hud-trackers{top:119.4px}
 html[data-ui="mobile"][data-orient="portrait"] #hud-topright #hud-trackers:has(> :not(.is-folded):not(.hidden)){margin-top:50px}
}
/* Bigger combat cluster on short landscape phones (iPhone SE / mini, or with the browser bar showing): step the scale
   down only as far as needed so the top skill stays clear of the minimap and its level chip. Still well above the old .6. */
@media (orientation:landscape) and (max-height:388px){html[data-ui="mobile"][data-orient="landscape"]{--mobile-action-scale:1.1}}
@media (orientation:landscape) and (max-height:368px){html[data-ui="mobile"][data-orient="landscape"]{--mobile-action-scale:1}}
@media (orientation:landscape) and (max-height:347px){html[data-ui="mobile"][data-orient="landscape"]{--mobile-action-scale:.9}}
@media (orientation:landscape) and (max-height:327px){html[data-ui="mobile"][data-orient="landscape"]{--mobile-action-scale:.8}}
/* Owner 2026-11-09: remove the target-lock button; players tap/click a monster to lock it (Tab still cycles on PC).
   The skill-page switch moves down into the freed slot, so the left column is just page / AUTO with no gap. */
#hud-actions #btn-target{display:none!important}
html[data-ui="mobile"][data-orient] #btn-skpage{bottom:calc(70px + var(--safe-b))}
/* portrait: passive chat lines sit above the bigger page / AUTO buttons instead of running behind them */
html[data-ui="mobile"][data-orient="portrait"] #hud #hud-chat.chat-passive{bottom:calc(158px + var(--safe-b))}
