/* Reference-inspired mobile layout; legacy controls remain available to JS. */
#mobile-menu-toggle, #mobile-menu-panel, #mobile-menu-shade { display:none; }
#mobile-menu-panel[hidden], #mobile-menu-shade[hidden] { display:none!important; }
@media (pointer:coarse) and (max-width:1400px), (max-width:760px) {
  html.hud-skin.mobile-menu-ready #nav-toggle,
  html.hud-skin.mobile-menu-ready #dock-toggle,
  html.hud-skin.mobile-menu-ready #skills-fab,
  html.hud-skin.mobile-menu-ready #res-toggle,
  html.hud-skin.mobile-menu-ready #bag-fab,
  html.hud-skin.mobile-menu-ready #gm-fab { display:none!important; }
  html.hud-skin.mobile-menu-ready #mobile-menu-toggle {
    display:flex; align-items:center; justify-content:center; position:absolute;
    top:calc(120px + var(--st)); right:calc(8px + var(--sr)); z-index:45;
    width:44px; height:44px; min-height:44px; padding:10px; border-radius:50%;
    border:1px solid #d2bc79; color:#fff4cf;
    background:radial-gradient(circle at 40% 30%,#625b39e6,#23251ce8);
    box-shadow:0 2px 5px #0006,inset 0 0 0 2px #191b1780;
    touch-action:manipulation;
  }
  html.hud-skin.mobile-menu-ready #mobile-menu-toggle svg { width:24px; height:24px; }
  html.hud-skin.mobile-menu-ready body.mobile-menu-open #mobile-menu-toggle { visibility:hidden; }
  html.hud-skin.mobile-menu-ready body.mobile-menu-open #mwheel { visibility:hidden; }
  html.hud-skin.mobile-menu-ready #mobile-menu-shade { display:block; position:fixed; inset:0; z-index:35; background:transparent; touch-action:none; }
  html.hud-skin.mobile-menu-ready #mobile-menu-panel {
    display:block; box-sizing:border-box; position:fixed; right:calc(8px + var(--sr)); bottom:calc(14px + var(--sb));
    z-index:40; width:220px; max-width:calc(100vw - 16px - var(--sl) - var(--sr));
    max-height:calc(100dvh - 28px - var(--st) - var(--sb)); overflow:auto; overscroll-behavior:contain;
    padding:8px; color:#fff0c5; border:1px solid #bcaa6b; border-radius:10px;
    background:linear-gradient(135deg,#272d22ed,#17170feb); box-shadow:0 5px 24px #0006;
    font-family:system-ui,sans-serif; touch-action:pan-y;
  }
  html.hud-skin.mobile-menu-ready .mobile-menu-head { display:flex; align-items:center; justify-content:space-between; gap:8px; padding-left:6px; font-size:12px; }
  html.hud-skin.mobile-menu-ready #mobile-menu-close { flex:none; width:44px; height:44px; min-height:44px; border:0; padding:0; border-radius:50%; font-size:26px; color:#fff0c5; background:transparent; }
  html.hud-skin.mobile-menu-ready .mobile-menu-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px; }
  html.hud-skin.mobile-menu-ready .mobile-menu-grid button {
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px;
    min-width:0; min-height:52px; padding:5px 2px; border:1px solid transparent; border-radius:7px;
    background:transparent; color:#fff0c5; font:500 11px/1.2 system-ui,sans-serif; touch-action:manipulation;
  }
  html.hud-skin.mobile-menu-ready .mobile-menu-grid svg { width:23px; height:23px; padding:5px; border-radius:50%; color:#ffe3a1; background:radial-gradient(circle,#77704980,#2a271955); box-shadow:inset 0 0 0 1px #d0bf7d66; box-sizing:content-box; }
  html.hud-skin.mobile-menu-ready .mobile-menu-grid button:active { background:#b39b4333; border-color:#a88c4b; }
  html.hud-skin.mobile-menu-ready #mobile-menu-camera { margin-top:7px; padding:8px 4px 2px; border-top:1px solid #bda76b55; }
  html.hud-skin.mobile-menu-ready #mobile-menu-camera>span { display:block; color:#d6caa6; text-align:center; font-size:10px; }
  html.hud-skin.mobile-menu-ready #mobile-menu-camera #mobile-zoom { gap:6px; margin-top:6px; }
  html.hud-skin.mobile-menu-ready #mobile-menu-camera #mobile-zoom button { min-height:44px; }
  html.hud-skin.mobile-menu-ready #mobile-menu-toggle:focus-visible,
  html.hud-skin.mobile-menu-ready #mobile-menu-panel button:focus-visible { outline:2px solid #fff5c7; outline-offset:-2px; }
  html.hud-skin.mobile-menu-ready #perf { display:none; }
}
@media (pointer:coarse) and (max-width:1400px) and (orientation:portrait), (max-width:760px) and (orientation:portrait) {
  html.hud-skin.mobile-menu-ready #questtrack { top:calc(106px + var(--st)); }
  html.hud-skin.mobile-menu-ready #stage:has(#targetf:not([hidden])) #questtrack { display:none; }
  html.hud-skin.mobile-menu-ready #dock { top:calc(82px + var(--st)); }
}
@media (pointer:coarse) and (max-width:1400px) and (max-height:500px) and (orientation:landscape), (max-width:760px) and (max-height:500px) and (orientation:landscape) {
  html.hud-skin.mobile-menu-ready #mobile-menu-toggle { top:calc(96px + var(--st)); }
}
@media (pointer:coarse) and (max-width:1400px) and (max-height:350px) and (orientation:landscape), (max-width:760px) and (max-height:350px) and (orientation:landscape) {
  html.hud-skin.mobile-menu-ready #mobile-menu-toggle { top:calc(70px + var(--st)); }
}
