/* Xcess Origins UX-HUD-01 — one visual command bar, with mobile-aware layout.
 * Loaded last by /functions/mu.js. Does not alter game logic.
 */
#game-ui #region-banner{display:none!important}
#game-ui #hud {
  z-index:140; box-sizing:border-box;
  position:absolute;top:auto;left:0;right:0;bottom:0;
  height:94px;padding:5px 14px 7px;
  display:grid;align-items:center;
  grid-template-columns:58px minmax(112px,1fr) minmax(295px,auto) minmax(202px,auto) 58px;
  gap:7px;
  border-top:1px solid rgba(223,185,111,.44);
  border-bottom:0;
  background:linear-gradient(180deg,rgba(11,17,23,.96),rgba(4,8,14,.99));
  box-shadow:0 -6px 26px rgba(0,0,0,.56);
}
#game-ui #hud #exp-track{top:0;bottom:auto;height:3px;grid-column:1/-1}
#game-ui #hud .orb {
  position:relative;left:auto;right:auto;bottom:auto;top:auto;
  width:56px;height:56px;min-width:56px;
  border:1px solid rgba(217,185,111,.68);border-radius:50%;
  background:conic-gradient(var(--vital-ring) 0 var(--vital-progress,100%), #1a2731 var(--vital-progress,100%) 100%);
  box-shadow:0 0 14px rgba(216,172,86,.12),inset 0 0 9px rgba(0,0,0,.8);
  isolation:isolate;
}
#game-ui #hud .orb.hp{--vital-ring:#d84253;grid-column:1;grid-row:1}
#game-ui #hud .orb.mp{--vital-ring:#4a86ed;grid-column:5;grid-row:1}
#game-ui #hud .orb::before{
  content:"";position:absolute;inset:5px;border-radius:50%;
  background:radial-gradient(circle at 38% 27%,#203342 0,#0d1823 48%,#070c13 92%);
  box-shadow:inset 0 1px 8px rgba(0,0,0,.8);
}
#game-ui #hud .orb-fill,#game-ui #hud .orb-glare{display:none}
#game-ui #hud .orb-label{
  z-index:1;position:absolute;inset:7px 0 0;
  display:grid;place-items:center;color:#f4f1ea;
  font:700 15px/1 Arial,sans-serif;font-variant-numeric:tabular-nums;
}
#game-ui #hud .orb-label::after{
  content:"HP";position:absolute;bottom:7px;left:0;right:0;
  font:700 8px/1 Arial,sans-serif;letter-spacing:.1em;text-align:center;color:#e2a9a9;
}
#game-ui #hud .orb.mp .orb-label::after{content:"MP";color:#a2c1f2}
#game-ui #hud #hud-center {
  position:relative;left:auto;right:auto;top:auto;bottom:auto;
  transform:none;min-width:0;width:auto;text-align:left;
  grid-column:2;grid-row:1;overflow:hidden;
}
#game-ui #hud #hud-name {
  font-size:clamp(12px,1.35vw,17px);letter-spacing:.055em;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
#game-ui #hud #hud-meta,#game-ui #hud #hud-gold{
  font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
#game-ui #hud #xcess-skills-bar {
  position:relative;z-index:1;left:auto;right:auto;bottom:auto;top:auto;
  transform:none;grid-column:3;grid-row:1;
  width:auto;max-width:none;min-width:0;padding:2px 6px 4px;
  background:transparent;border:0;box-shadow:none;border-radius:0;
  pointer-events:auto;
}
#game-ui #hud #xcess-skills-bar .skills-bar-head{
  display:flex;justify-content:center;align-items:center;margin:0 0 4px;
  min-height:18px;
}
#game-ui #hud #xcess-skills-bar .skills-bar-head>span{display:none}
#game-ui #hud #xcess-skills-bar #skills-open-btn {
  min-height:22px;border:1px solid rgba(218,181,102,.38);padding:3px 11px;
  border-radius:5px;letter-spacing:.03em;
}
#game-ui #hud #xcess-skills-bar .skills-bar-body {gap:7px;justify-content:center}
#game-ui #hud #xcess-skills-bar .skills-active-slots,
#game-ui #hud #xcess-skills-bar .skills-passive-slots {gap:4px}
#game-ui #hud #xcess-skills-bar .skill-slot,
#game-ui #hud #xcess-skills-bar #attack-btn{
  flex-basis:42px;width:42px;min-width:42px;height:42px;
}
#game-ui #hud #xcess-skills-bar .skill-basic-icon{font-size:19px}
#game-ui #hud #hud-actions{
  position:relative;left:auto;right:auto;top:auto;bottom:auto;
  transform:none;grid-column:4;grid-row:1;
  display:flex!important;gap:5px;align-items:center;justify-content:center;
  min-width:0;width:auto;max-width:none;margin:0;
}
#game-ui #hud #hud-actions .hud-group{display:contents!important}
#game-ui #hud #hud-actions .hud-btn[data-hud-icon]{
  display:flex;align-items:center;justify-content:center;
  flex:0 0 39px;width:39px;min-width:39px;max-width:42px;
  height:44px;min-height:44px;margin:0;padding:0;
  font-size:0!important;line-height:0;letter-spacing:0;
  border-radius:7px;color:#e6d8b6;
  border:1px solid rgba(210,183,121,.35);
  background:linear-gradient(170deg,#1f2b36,#0d141e);
  transition:border-color .15s,background .15s;
}
#game-ui #hud #hud-actions .hud-btn[data-hud-icon]::before{
  content:attr(data-hud-icon)!important;display:block!important;
  font:24px/1 Arial,sans-serif;min-height:0;color:inherit;
}
#game-ui #hud #hud-actions .hud-btn[data-hud-icon]::after{content:none!important;display:none!important}
#game-ui #hud #hud-actions .hud-btn[data-hud-icon]:hover,
#game-ui #hud #hud-actions .hud-btn[data-hud-icon]:focus-visible{
  border-color:#f6d78e;outline:2px solid rgba(244,216,153,.62);outline-offset:1px;
}
#game-ui #hud #hud-actions #auto-attack-btn.enabled{color:#a8eec2;border-color:#4eaf81}
#game-ui #hud #hud-actions #mobile-journal-btn{display:none!important}
#game-ui #system-log{
  bottom:106px;right:12px;left:auto;max-height:74px;width:min(260px,34vw);
  overflow:hidden;padding:8px 11px 9px;border-radius:7px;
  border:1px solid rgba(203,172,113,.3);border-left:2px solid #cba66b;
  background:rgba(6,15,22,.9);font:11px/1.35 Arial,sans-serif;
}
#game-ui #system-log::before{
  content:"SISTEMA · ALERTAS";display:block;margin-bottom:5px;
  color:#d6ba88;letter-spacing:.12em;font:700 9px Arial,sans-serif;
}
#game-ui #system-log .log-line{margin-top:3px}
#game-ui #system-log .log-line.location{color:#a9d7c1}
#game-ui #minimap-wrap{z-index:2}
#game-ui #world-presence-status {
  position:absolute;left:auto;right:0;top:auto;bottom:-23px;
  display:flex;align-items:center;gap:5px;max-width:none;min-width:77px;
  padding:4px 7px;border-radius:12px;
  border:1px solid rgba(135,162,180,.42);background:rgba(5,13,20,.87);
  font:700 10px/1 Arial,sans-serif;letter-spacing:.04em;
  text-align:center;white-space:nowrap;pointer-events:none;
}
#game-ui #world-presence-status::before {
  content:"";display:block;width:7px;height:7px;border-radius:50%;
  background:#8599a9;box-shadow:0 0 7px rgba(133,153,169,.2);
}
#game-ui #world-presence-status[data-status="online"]::before{background:#65d5a1;box-shadow:0 0 8px #409e75}
#game-ui #world-presence-status[data-status="connecting"]::before{background:#e1be6b}
#game-ui #world-presence-status[data-status="degraded"]::before{background:#e7a36d}
#game-ui #world-presence-status[data-status="offline"]::before{background:#e77777}
@media (min-width:761px) and (max-width:1080px) {
  #game-ui #hud {grid-template-columns:52px minmax(90px,1fr) minmax(196px,auto) minmax(175px,auto) 52px;gap:4px;padding:5px 7px}
  #game-ui #hud .orb{width:50px;height:50px;min-width:50px}
  #game-ui #hud #xcess-skills-bar .skills-passive-slots{display:none}
  #game-ui #hud #hud-actions{gap:3px}
  #game-ui #hud #hud-actions .hud-btn[data-hud-icon]{flex-basis:35px;width:35px;min-width:35px}
}
@media (max-width:760px) {
  #game-ui #hud {
    top:auto!important;bottom:0!important;left:0;right:0;
    height:calc(159px + env(safe-area-inset-bottom));
    padding:5px 7px calc(5px + env(safe-area-inset-bottom));
    grid-template-columns:minmax(90px,1fr) minmax(0,1.5fr);
    grid-template-rows:36px 62px 39px;gap:3px 6px;
    border-top:1px solid rgba(223,185,111,.5);border-bottom:0;
    overflow:visible;
  }
  #game-ui #hud .orb{display:none!important}
  #game-ui #hud #hud-center{
    grid-column:1;grid-row:1;align-self:center;
    max-width:none;min-width:0;width:auto;text-align:left;
  }
  #game-ui #hud #hud-name{font-size:11px}
  #game-ui #hud #hud-meta,#game-ui #hud #hud-gold{font-size:9px}
  #game-ui #hud #mobile-vitals{
    display:grid;grid-column:2;grid-row:1;align-self:center;gap:3px;
    min-width:0;
  }
  #game-ui #hud #xcess-skills-bar{
    grid-column:1/-1;grid-row:2;justify-self:center;
    width:min(100%,440px);padding:0 4px;min-height:0;
    position:relative;bottom:auto;transform:none;
  }
  #game-ui #hud #xcess-skills-bar .skills-bar-head{margin:0 0 2px;min-height:15px}
  #game-ui #hud #xcess-skills-bar #skills-open-btn{padding:1px 10px;font-size:9px;min-height:17px}
  #game-ui #hud #xcess-skills-bar .skills-bar-body{gap:6px;justify-content:space-between}
  #game-ui #hud #xcess-skills-bar .skills-active-slots,
  #game-ui #hud #xcess-skills-bar .skills-passive-slots{gap:3px}
  #game-ui #hud #xcess-skills-bar .skill-slot,
  #game-ui #hud #xcess-skills-bar #attack-btn{
    width:clamp(32px,10vw,44px);min-width:0;flex:0 0 clamp(32px,10vw,44px);
    height:39px;padding:1px;
  }
  #game-ui #hud #xcess-skills-bar .skill-basic-icon{font-size:17px}
  #game-ui #hud #hud-actions{
    grid-column:1/-1;grid-row:3;justify-content:space-evenly;
    display:flex!important;width:100%;height:39px;
    overflow-x:visible;white-space:normal;gap:3px;
  }
  #game-ui #hud #hud-actions .hud-btn[data-hud-icon]{
    flex:1 1 35px;min-width:35px;max-width:52px;
    height:38px;min-height:38px;padding:0;
  }
  #game-ui #hud #hud-actions .hud-btn[data-hud-icon]::before{font-size:21px}
  #game-ui #hud #hud-actions #mobile-journal-btn{display:flex!important}
  #game-ui #hud #hud-actions #field-journal-trigger{display:none!important}
  #game-ui #quest-tracker{top:calc(10px + env(safe-area-inset-top))!important}
  #game-ui #minimap-wrap{top:calc(10px + env(safe-area-inset-top))!important}
  #game-ui #target-panel{top:calc(110px + env(safe-area-inset-top))!important}
  #game-ui #system-log:not(.hidden){
    display:block!important;
    bottom:calc(166px + env(safe-area-inset-bottom));
    right:8px;left:auto;width:min(220px,58vw);max-height:74px;
    font-size:10px;
  }
  #game-ui #system-log.hidden{display:none!important}
  .side-panel{top:calc(10px + env(safe-area-inset-top))!important;
    max-height:calc(100dvh - 185px - env(safe-area-inset-bottom))!important}
  #skills-panel{top:calc(10px + env(safe-area-inset-top))!important;
    max-height:calc(100dvh - 185px - env(safe-area-inset-bottom))!important}
}
@media (pointer:coarse) and (orientation:landscape) and (max-height:480px) {
  #game-ui #hud{height:calc(106px + env(safe-area-inset-bottom));
    grid-template-rows:23px 39px 33px;padding:2px 5px calc(2px + env(safe-area-inset-bottom))}
  #game-ui #hud #xcess-skills-bar .skills-bar-head{display:none}
  #game-ui #hud #xcess-skills-bar .skills-passive-slots{display:none}
  #game-ui #hud #xcess-skills-bar .skill-slot,
  #game-ui #hud #xcess-skills-bar #attack-btn{height:35px}
  #game-ui #hud #hud-actions .hud-btn[data-hud-icon]{height:31px;min-height:31px}
  #game-ui #system-log:not(.hidden){bottom:calc(112px + env(safe-area-inset-bottom))}
}
@media (prefers-reduced-motion:reduce){
  #game-ui #hud .orb,#game-ui #hud #hud-actions .hud-btn{transition:none}
}


/* UX-HUD-02A · Owner laptop UAT 1753x864. Spatial hierarchy only.
 * The original buttons, combat handlers, hotkeys and mobile bar stay intact.
 * At <=760px the existing dedicated touch HUD remains authoritative.
 */
@media (min-width:1081px) {
  #game-ui #hud {
    height:96px;
    grid-template-columns:60px minmax(155px,220px) minmax(320px,1fr) minmax(270px,max-content) 60px;
    gap:clamp(6px,.65vw,14px);
    padding:7px clamp(12px,1.15vw,22px) 8px;
    background:linear-gradient(180deg,rgba(14,22,29,.95),rgba(5,10,16,.99));
    box-shadow:0 -7px 26px rgba(0,0,0,.58);
  }
  #game-ui #hud .orb {width:60px;height:60px;min-width:60px}
  #game-ui #hud #hud-center {padding-right:8px}
  #game-ui #hud #hud-name {font-size:clamp(15px,1.3vw,20px);letter-spacing:.06em}
  #game-ui #hud #hud-meta {font-size:10px;letter-spacing:.08em}
  #game-ui #hud #xcess-skills-bar {
    width:min(100%,535px);
    justify-self:center;
    padding:4px clamp(6px,.6vw,12px);
    border:1px solid rgba(207,171,105,.15);
    border-radius:9px;
    background:rgba(15,24,33,.45);
  }
  #game-ui #hud #hud-actions {justify-content:flex-end;gap:5px}
}
@media (min-width:761px) {
  /* Combat intent sits immediately after the skill bar, not mixed with
     inventory/settings. Keep the same one button and original click handler. */
  #game-ui #hud #hud-actions #auto-attack-btn {
    order:-1;
    flex:0 0 61px;
    width:61px;min-width:61px;max-width:61px;
    height:54px;min-height:54px;
    flex-direction:column;gap:2px;
    border-color:rgba(211,174,103,.69);
    background:linear-gradient(165deg,#29382f,#111e22);
    box-shadow:inset 0 0 0 1px rgba(247,209,138,.07);
  }
  #game-ui #hud #hud-actions #auto-attack-btn::before {
    font-size:23px;line-height:1;
  }
  #game-ui #hud #hud-actions #auto-attack-btn::after {
    content:"OFF"!important;display:block!important;
    color:#d3c09a;
    font:700 9px/1 Arial,sans-serif;
    letter-spacing:.12em;
  }
  #game-ui #hud #hud-actions #auto-attack-btn.enabled {
    color:#a7f1c2;border-color:#57c88a;
    background:linear-gradient(160deg,#1b4837,#0c2620);
  }
  #game-ui #hud #hud-actions #auto-attack-btn.enabled::after {
    content:"ON"!important;color:#a7f1c2;
  }
  #game-ui #hud #hud-actions #auto-attack-btn.paused {
    color:#f2d69c;border-color:#d7ae61;
    background:linear-gradient(160deg,#453521,#211c15);
  }
  #game-ui #hud #hud-actions #auto-attack-btn.paused::after {
    content:"PAUSED"!important;color:#f2d69c;font-size:8px;
  }
  #game-ui #quest-tracker {
    top:clamp(62px,8vh,80px);left:clamp(12px,1.25vw,22px);
    width:clamp(220px,19vw,290px);
    box-sizing:border-box;
    padding:12px 15px 13px;
    border:1px solid rgba(196,169,110,.25);
    border-left:3px solid #d9b771;
    border-radius:0 9px 9px 0;
    background:linear-gradient(90deg,rgba(7,13,21,.93),rgba(7,13,21,.74));
    box-shadow:0 10px 22px rgba(0,0,0,.22);
    pointer-events:none;
  }
  #game-ui #quest-tracker::before {
    content:"OBJETIVO ACTUAL";
    display:block;margin-bottom:7px;
    color:#a9bdc7;font:700 9px/1.1 Arial,sans-serif;letter-spacing:.14em;
  }
  #game-ui #quest-tracker .tracker-title {font-size:12px;line-height:1.35}
  #game-ui #quest-tracker .tracker-objective {line-height:1.5}
  #game-ui #target-panel {
    top:18px;width:min(260px,34vw);border-radius:8px;
    background:rgba(7,13,21,.93);
  }
  #game-ui #minimap-wrap {
    top:16px;right:clamp(12px,1.2vw,22px);
    border-radius:9px;
    background:linear-gradient(165deg,rgba(10,20,29,.95),rgba(5,10,16,.91));
    box-shadow:0 10px 24px rgba(0,0,0,.28);
  }
  #game-ui #minimap-title {letter-spacing:.1em}
  #game-ui #hud #hud-actions .hud-btn[data-hud-icon]:focus-visible,
  #game-ui #hud #xcess-skills-bar :is(button,[tabindex]):focus-visible {
    outline:2px solid #f6d78e;outline-offset:2px;
  }
}
@media (min-width:761px) and (max-width:1080px) {
  #game-ui #hud {
    grid-template-columns:50px minmax(92px,135px) minmax(185px,1fr) minmax(215px,max-content) 50px;
    gap:4px;padding:5px 7px;
  }
  #game-ui #hud #xcess-skills-bar {
    width:100%;max-width:360px;justify-self:center;
  }
  #game-ui #hud #hud-actions {gap:3px;justify-content:flex-end}
  #game-ui #hud #hud-actions #auto-attack-btn {
    flex-basis:49px;width:49px;min-width:49px;max-width:49px;
    height:49px;min-height:49px;
  }
  #game-ui #hud #hud-actions .hud-btn[data-hud-icon]:not(#auto-attack-btn) {
    flex-basis:34px;width:34px;min-width:34px;max-width:34px;
  }
  #game-ui #hud #hud-actions #auto-attack-btn::after {font-size:8px}
  #game-ui #quest-tracker {width:min(235px,29vw)}
}

/* UX-HUD-02B — state honesty: show ranges, never invent shared rewards.
 * Collapsible native details is usable without a new JS event handler.
 */
#game-ui #quest-tracker {pointer-events:auto}
#game-ui #quest-tracker::before {content:none!important;display:none!important}
#game-ui #quest-tracker > summary {
  display:flex;align-items:center;justify-content:space-between;gap:7px;
  cursor:pointer;list-style:none;min-height:24px;
  margin:0 0 6px;padding:1px 0 5px;
  color:#b8c7d0;font:700 10px/1.25 Arial,sans-serif;
  letter-spacing:.12em;
  border-bottom:1px solid rgba(218,184,119,.17);
}
#game-ui #quest-tracker > summary::-webkit-details-marker {display:none}
#game-ui #quest-tracker > summary::after {
  content:"−";display:block;
  color:#e3c187;font:700 15px/1 Arial,sans-serif;
}
#game-ui #quest-tracker:not([open]) > summary {
  margin-bottom:0;padding-bottom:2px;border-color:transparent;
}
#game-ui #quest-tracker:not([open]) > summary::after {content:"+"}
#game-ui #quest-tracker > summary:focus-visible {
  outline:2px solid #f6d78e;outline-offset:3px;border-radius:3px;
}
#game-ui #target-panel #target-name {letter-spacing:.065em}
#game-ui #target-panel #target-meta {font:700 9px/1.3 Arial,sans-serif;color:#bacbd2}
#game-ui #target-panel #target-hp {font-variant-numeric:tabular-nums}
@media (min-width:761px){
  #game-ui #hud .orb {overflow:visible}
  #game-ui #hud .orb::after {
    content:attr(data-vital-range);
    position:absolute;left:-30px;right:-30px;bottom:-18px;
    display:block;white-space:nowrap;pointer-events:none;
    text-align:center;
    color:#d3dce2;font:700 10px/1 Arial,sans-serif;
    font-variant-numeric:tabular-nums;
    text-shadow:0 1px 3px rgba(0,0,0,.9);
  }
  #game-ui #quest-tracker {min-height:0}
}
@media (max-width:760px){
  #game-ui #quest-tracker > summary {font-size:9px;min-height:27px}
}
@media (prefers-reduced-motion:reduce) {
  #game-ui #quest-tracker > summary {transition:none}
}

/* UX-HUD-02C1 · orientation and legend for real Outpost radar markers.
 * Display-only; no new world entities, quest tracking or party disclosure.
 */
#game-ui #minimap-wrap {overflow:visible}
#game-ui #minimap-legend {position:relative;pointer-events:auto}
#game-ui #minimap-legend > summary {
  display:block;margin:7px 0 0;padding:5px 6px 3px;
  list-style:none;cursor:pointer;text-align:center;
  border-top:1px solid rgba(206,174,104,.23);
  color:#d6bf8d;font:700 9px/1.25 Arial,sans-serif;
  letter-spacing:.11em;
}
#game-ui #minimap-legend > summary::-webkit-details-marker {display:none}
#game-ui #minimap-legend > summary::after {content:" ▾";color:#abc3d4}
#game-ui #minimap-legend[open] > summary::after {content:" ▴"}
#game-ui #minimap-legend > summary:focus-visible {
  outline:2px solid #f3cb7b;outline-offset:2px;border-radius:3px;
}
#game-ui #minimap-legend ul {
  position:absolute;top:100%;right:-6px;z-index:10;
  width:190px;box-sizing:border-box;
  margin:7px 0 0;padding:10px 12px;
  list-style:none;border:1px solid rgba(214,177,106,.4);
  border-radius:7px;background:rgba(8,17,24,.97);
  box-shadow:0 11px 24px rgba(0,0,0,.45);
  color:#d4dde3;font:11px/1.35 Arial,sans-serif;
}
#game-ui #minimap-legend li {
  display:flex;align-items:center;gap:9px;margin:5px 0;
  white-space:nowrap;
}
#game-ui #minimap-legend .radar-marker {
  display:inline-block;width:8px;height:8px;flex:0 0 8px;
  border-radius:50%;background:#e45259;
}
#game-ui #minimap-legend .radar-self {background:#8ed3ff;clip-path:polygon(50% 0,0 100%,100% 100%);border-radius:0}
#game-ui #minimap-legend .radar-master {background:#f3d97d;border-radius:1px}
#game-ui #minimap-legend .radar-merchant {background:#8fe1a3;border-radius:1px}
#game-ui #minimap-legend .radar-monster {background:#e45259}
#game-ui #minimap-legend .radar-peer {background:#87ceef}
@media (max-width:760px) {
  #game-ui #minimap-legend > summary {font-size:8px;padding:4px 1px}
  #game-ui #minimap-legend ul {width:176px;font-size:10px}
}
