/* The approved mobile controls share the skill dock's center and safe areas. */
html.mobile-hud #world-hud #mobile-skill-dock {
  --mobile-consumable-rise:calc(max(var(--mobile-skill-height,0px),var(--mobile-skill-expanded-height)) + 6px);
  --mobile-consumable-ink:#fcfdf9;
  --mobile-consumable-quiet:#d3cabb;
  --mobile-consumable-gold:#ead8b1;
  --mobile-consumable-line:rgb(234 216 177 / .24);
}
html.mobile-hud #world-hud.show-bar:has(#mobile-skill-dock:not([hidden])) {
  --mobile-skill-bottom:var(--hud-bottom);
  --mobile-skill-side-bottom:calc(var(--hud-bottom) + max(var(--mobile-skill-height,0px),var(--mobile-skill-expanded-height)) + 8px);
}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-launcher {
  position:relative;
  isolation:isolate;
  display:grid;
  place-items:center;
  width:var(--mobile-skill-rail);
  min-width:var(--mobile-skill-rail);
  height:var(--mobile-skill-rail);
  min-height:var(--mobile-skill-rail);
  margin:0;
  padding:0;
  border:0;
  border-radius:4px;
  background:none;
  box-shadow:none;
  pointer-events:auto;
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-launcher[data-consumable="potions"] {
  position:absolute;
  left:0;
  bottom:var(--mobile-skill-step);
}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-launcher::before {
  position:absolute;
  z-index:-1;
  inset:3px;
  border:1px solid var(--mobile-consumable-line);
  border-radius:4px;
  background:rgb(0 0 0 / .62);
  content:"";
  pointer-events:none;
  transition:border-color 170ms ease-out;
}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-launcher img {
  display:block;
  width:21px;
  height:21px;
  border-radius:3px;
  transition:filter 170ms ease-out,opacity 170ms ease-out;
  pointer-events:none;
}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-launcher[data-use-state="off"] img {filter:grayscale(.9) brightness(.68)}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-launcher[data-use-state="empty"]::before {border-color:rgb(234 216 177 / .17)}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-launcher[data-use-state="empty"] img {opacity:.28;filter:grayscale(1)}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-launcher[data-use-state="on"]::before {border-color:#91f3ab}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-launcher[data-use-state="on"]::after {
  position:absolute;inset:3px;border:1px solid #baf7c9;border-radius:4px;opacity:0;
  pointer-events:none;content:"";animation:mobile-consumable-pulse 560ms ease-out;
}
@keyframes mobile-consumable-pulse {
  from {transform:scale(.93);opacity:.95}
  to {transform:scale(1.12);opacity:0}
}

html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-panel {
  position:absolute;
  z-index:9;
  bottom:var(--mobile-consumable-rise);
  left:50%;
  width:min(326px,calc(100vw - max(12px,env(safe-area-inset-left)) - max(12px,env(safe-area-inset-right))));
  max-height:max(64px,calc(100dvh - var(--mobile-skill-bottom,8px) - var(--mobile-consumable-rise) - var(--hud-top,8px)));
  margin:0;
  padding:0;
  overflow:auto;
  overscroll-behavior:contain;
  transform:translateX(-50%);
  border:1px solid var(--mobile-consumable-line);
  border-radius:6px;
  background:rgb(17 16 14 / .96);
  color:var(--mobile-consumable-ink);
  font:500 12px/1.25 "Segoe UI",Arial,sans-serif;
  pointer-events:auto;
  color-scheme:dark;
}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-panel * {box-sizing:border-box}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-panel button {
  box-sizing:border-box;
  margin:0;
  border:0;
  background:none;
  box-shadow:none;
  color:inherit;
  font:inherit;
  text-shadow:none;
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-panel button:disabled {opacity:.46}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-panel button:active:enabled {background:rgb(255 255 255 / .08)}
html.mobile-hud #world-hud #mobile-skill-dock :is(.mobile-consumable-panel button,.mobile-consumable-launcher):focus-visible {outline:2px solid var(--mobile-consumable-gold);outline-offset:-2px}
html.mobile-hud[data-hud-input="touch"] #world-hud #action-bar #mobile-skill-dock button:focus-visible {outline:0}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-head {
  position:sticky;top:0;z-index:1;display:flex;align-items:center;min-height:44px;
  padding:0 44px 0 9px;border-bottom:1px solid var(--mobile-consumable-line);background:#1a1916;
}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-head:has(.mobile-consumable-back:not([hidden])) {padding-left:44px}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-title {font-weight:600}
html.mobile-hud #world-hud #mobile-skill-dock :is(.mobile-consumable-close,.mobile-consumable-back) {
  display:grid;place-items:center;position:absolute;top:0;width:44px;height:44px;padding:0;font-size:20px;
}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-close {right:0}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-back {left:0}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-shot-categories {display:flex;align-self:stretch;min-width:0;gap:2px}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-shot-categories button {
  position:relative;min-width:44px;min-height:44px;padding:3px 7px;color:var(--mobile-consumable-quiet);text-align:center;
}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-shot-categories button[aria-pressed="true"] {color:var(--mobile-consumable-ink)}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-shot-categories button[aria-pressed="true"]::after {
  position:absolute;left:6px;right:6px;bottom:4px;height:2px;background:var(--mobile-consumable-gold);content:"";
}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-body {padding:0 5px 4px}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-note {grid-column:1/-1;margin:0;padding:8px 5px;color:var(--mobile-consumable-quiet)}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-status {margin:0;padding:4px 10px 7px;color:#ffd1a8}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-status:empty {display:none}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-slot {display:grid;grid-template-columns:minmax(0,1fr) 58px;align-items:stretch}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-slot + .mobile-consumable-slot {border-top:1px solid var(--mobile-consumable-line)}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-item {
  display:grid;grid-template-columns:24px minmax(0,1fr) auto;align-items:center;gap:6px;
  min-height:44px;min-width:0;width:100%;padding:3px 5px;text-align:left;
}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-item img {width:24px;height:24px;border-radius:3px}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-placeholder {
  display:grid;place-items:center;width:24px;height:24px;border:1px dashed var(--mobile-consumable-line);border-radius:3px;font-size:16px;
}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-copy {display:grid;grid-template-columns:minmax(0,1fr);overflow-wrap:anywhere;gap:1px}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-count {font:inherit;color:var(--mobile-consumable-quiet);font-variant-numeric:tabular-nums}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-verb {
  padding:4px 5px;border:1px solid var(--mobile-consumable-line);border-radius:4px;color:var(--mobile-consumable-gold);font-size:11px;
}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-auto {
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
  width:58px;min-height:44px;padding:0;border-left:1px solid var(--mobile-consumable-line);font-size:11px;
}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-switch {
  position:relative;width:26px;height:14px;border:1px solid var(--mobile-consumable-line);border-radius:9px;background:#37362f;
}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-switch::before {
  position:absolute;left:2px;top:2px;width:8px;height:8px;border-radius:50%;background:#d3ccbe;content:"";transition:transform 140ms ease;
}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-auto[aria-checked="true"] {color:#a8f0b9}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-auto[aria-checked="true"] .mobile-consumable-switch {border-color:#91f3ab99;background:#25472e}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-auto[aria-checked="true"] .mobile-consumable-switch::before {transform:translateX(12px);background:#a8f0b9}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-choices {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1px 4px}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-choice-state {
  width:12px;height:12px;display:grid;place-items:center;border:1px solid var(--mobile-consumable-line);border-radius:50%;font-size:9px;
}
html.mobile-hud #world-hud #mobile-skill-dock [aria-pressed="true"] .mobile-consumable-choice-state {color:#102418;background:#91f3ab;border-color:#91f3ab}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-clear {grid-column:1/-1;min-height:44px;padding:0 5px;text-align:left;border-top:1px solid var(--mobile-consumable-line)}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-threshold {
  display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:8px;min-height:44px;padding:0 5px;border-top:1px solid var(--mobile-consumable-line);
}
html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-threshold input {width:100%;height:44px;min-width:0;margin:0;padding:0;accent-color:#91f3ab}

/* The message buttons stay above the centered bar. System text can pass over the stick. */
html.mobile-hud #world-hud:not([data-bar-side="left"]) #mobile-chat .mobile-chat-preview:has(.mobile-chat-preview-open[hidden]) .mobile-chat-preview-icon {
  grid-column:1;
  justify-self:start;
}
html.mobile-hud #world-hud.show-bar:has(#mobile-skill-dock:not([hidden])) #mobile-chat:is([data-state="preview"],[data-state="minimized"]) {
  bottom:var(--mobile-skill-side-bottom);
}
html.mobile-hud #world-hud.show-bar.show-joystick:has(#mobile-skill-dock:not([hidden])) #movement-stick {
  bottom:calc(var(--mobile-skill-side-bottom) + 49px);
}
html.mobile-hud #world-hud.show-bar[data-bar-side="left"]:has(#mobile-skill-dock:not([hidden])) #mobile-chat:is([data-state="preview"],[data-state="minimized"]) {left:auto;right:var(--hud-right)}
html.mobile-hud #world-hud.show-bar:has(#mobile-skill-dock:not([hidden])):not(:has(#mobile-chat[data-state="expanded"])) .mobile-fullscreen {left:var(--hud-left);right:auto;bottom:var(--hud-bottom)}
html.mobile-hud #world-hud.show-bar[data-bar-side="left"]:has(#mobile-skill-dock:not([hidden])):not(:has(#mobile-chat[data-state="expanded"])) .mobile-fullscreen {left:auto;right:var(--hud-right)}
html.mobile-hud #world-hud:has(#mobile-chat:not([hidden])[data-state="expanded"]) #mobile-skill-dock {display:none!important}
html.mobile-hud #world-hud.show-bar:has(#mobile-skill-dock:not([hidden])) #action-bar .hunt-shortcut {
  position:fixed;
  inset:auto var(--hud-right) calc(var(--hud-bottom) + max(120px,2.7 * var(--touch-slot))) auto;
  width:44px;height:44px;min-width:44px;min-height:44px;
}
html.mobile-hud #world-hud.show-bar[data-bar-side="left"]:has(#mobile-skill-dock:not([hidden])) #action-bar .hunt-shortcut {left:var(--hud-left);right:auto}
html.mobile-hud #world-hud.show-bar[data-bar-side="left"]:has(#mobile-skill-dock:not([hidden])) {
  --mobile-left-combat-base:var(--hud-bottom);
  --mobile-left-combat-width:clamp(44px,calc((100vw - var(--mobile-skill-dock-width)) / 2 - var(--hud-left) - 8px),70px);
}
html.mobile-hud #world-hud.show-bar[data-bar-side="left"] #action-bar:has(#mobile-skill-dock:not([hidden])) [data-basic-action="attack"] {
  position:fixed;inset:auto auto calc(var(--mobile-left-combat-base) + 48px) var(--hud-left);
  width:var(--mobile-left-combat-width);height:var(--mobile-left-combat-width);
}
html.mobile-hud #world-hud.show-bar[data-bar-side="left"] #action-bar:has(#mobile-skill-dock:not([hidden])) [data-basic-action="target"] {
  position:fixed;inset:auto auto var(--mobile-left-combat-base) var(--hud-left);
  width:var(--mobile-left-combat-width);height:44px;min-height:44px;
}
html.mobile-hud #world-hud.show-bar[data-bar-side="left"] #action-bar:has(#mobile-skill-dock:not([hidden])) [data-modifier] {
  --mobile-left-modifier-x:calc(var(--hud-left) + var(--mobile-left-combat-width) + 5px);
  position:fixed;inset:auto auto var(--mobile-left-combat-base) var(--mobile-left-modifier-x);
  width:39px;height:44px;
}
html.mobile-hud #world-hud.show-bar[data-bar-side="left"] #action-bar:has(#mobile-skill-dock:not([hidden])) [data-modifier="shift"] {left:calc(var(--mobile-left-modifier-x) + 43px)}
@media (max-width:649px) {
  html.mobile-hud #world-hud.show-bar[data-bar-side="left"] #action-bar:has(#mobile-skill-dock:not([hidden])) [data-modifier] {
    --mobile-left-modifier-x:var(--hud-left);
    bottom:calc(var(--mobile-left-combat-base) + 122px);
  }
}
@media (orientation:landscape) and (max-width:649px) and (min-height:375px) {
  html.mobile-hud #world-hud.show-bar[data-bar-side="left"] #action-bar:has(#mobile-skill-dock:not([hidden])):has([data-modifier="shift"]:not([hidden])) .hunt-shortcut {
    bottom:calc(var(--mobile-left-combat-base) + 171px);
  }
}
@media (max-width:419px) {
  html.mobile-hud #world-hud.show-bar[data-bar-side="left"]:has(#mobile-skill-dock:not([hidden])) {
    --mobile-left-combat-base:var(--mobile-skill-side-bottom);
  }
}
html.mobile-hud #world-hud.show-bar.has-nearby-loot:has(#mobile-skill-dock:not([hidden])) #touch-pickup {
  left:calc(var(--hud-left) + 39px);right:auto;bottom:var(--hud-bottom);
}
html.mobile-hud #world-hud.show-bar.has-nearby-loot[data-bar-side="left"]:has(#mobile-skill-dock:not([hidden])) #touch-pickup {left:auto;right:calc(var(--hud-right) + 39px)}
@media (orientation:landscape) and (min-width:520px) and (max-height:350px) {
  html.mobile-hud #world-hud.show-bar:has(#mobile-skill-dock:not([hidden])) {
    --mobile-side-stick:clamp(44px,calc((100vw - var(--mobile-skill-dock-width)) / 2 - max(var(--hud-left),var(--hud-right)) - 49px),68px);
  }
  html.mobile-hud #world-hud.show-bar.show-joystick:has(#mobile-skill-dock:not([hidden])) #movement-stick {
    width:var(--mobile-side-stick);
    bottom:var(--hud-bottom);
  }
  html.mobile-hud #world-hud.show-bar.show-joystick:has(#mobile-skill-dock:not([hidden])):not(:has(#mobile-chat[data-state="expanded"])) .mobile-fullscreen {
    left:calc(var(--hud-left) + var(--mobile-side-stick) + 7px);
  }
  html.mobile-hud #world-hud.show-bar.show-joystick[data-bar-side="left"]:has(#mobile-skill-dock:not([hidden])):not(:has(#mobile-chat[data-state="expanded"])) .mobile-fullscreen {
    left:auto;right:calc(var(--hud-right) + var(--mobile-side-stick) + 7px);
  }
  html.mobile-hud #world-hud.show-bar.has-nearby-loot:has(#mobile-skill-dock:not([hidden])) #touch-pickup {
    left:var(--hud-left);bottom:calc(var(--mobile-skill-side-bottom) + 48px);
  }
  html.mobile-hud #world-hud.show-bar.has-nearby-loot[data-bar-side="left"]:has(#mobile-skill-dock:not([hidden])) #touch-pickup {left:auto;right:var(--hud-right)}
}
@media (max-width:419px) {
  html.mobile-hud #world-hud #mobile-skill-dock {
    --mobile-consumable-rise:calc(var(--mobile-skill-height,var(--mobile-skill-expanded-height)) + 2 * var(--mobile-skill-step) + 6px);
  }
  html.mobile-hud #world-hud.show-bar:has(#mobile-skill-dock:not([hidden])) {
    --mobile-skill-side-bottom:calc(var(--hud-bottom) + var(--mobile-skill-height,var(--mobile-skill-expanded-height)) + 2 * var(--mobile-skill-step) + 8px);
  }
  html.mobile-hud #world-hud.show-bar:has(#mobile-skill-dock:not([hidden])):not(:has(#mobile-chat[data-state="expanded"])) .mobile-fullscreen {left:auto;right:var(--hud-right);bottom:var(--mobile-skill-side-bottom)}
}
@media (prefers-reduced-motion:reduce) {
  html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-launcher[data-use-state="on"]::after {animation:none}
  html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-launcher::before,
  html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-launcher img,
  html.mobile-hud #world-hud #mobile-skill-dock .mobile-consumable-switch::before {transition:none}
}
