body.native:has(#game:not([hidden])) {margin:0;background:#080808;overflow:hidden}
body.native:has(#game:not([hidden]))>.mast {display:none}
body.native #game:not([hidden]) {display:block;position:fixed;inset:0;isolation:isolate;overflow:hidden;background:#080808;margin:0;padding:0;border:none;max-width:none;height:100dvh;width:100%}
body.native #game .field {position:absolute;inset:0;border:0;border-radius:0;overflow:hidden;background:#080808;width:100%;height:100%;max-height:none;aspect-ratio:auto;margin:0;padding:0;box-shadow:none}
body.native #game #world {display:block;position:absolute;inset:0;width:100%;height:100%;aspect-ratio:auto;max-height:none;border:0;touch-action:none}
#game {--hud-scale:1;--tool-scale:1;font-family:var(--mir-ui-font);color:#eee}
#game [hidden],#panel [hidden] {display:none!important}
#hud-dock {position:absolute;bottom:0;left:50%;width:1024px;height:68px;transform:translateX(-50%) scale(var(--hud-scale));transform-origin:center bottom;z-index:4;pointer-events:none}
#hud-dock>* {pointer-events:auto}
#mainhud,#hud-map,#chat,#messages,#actions,#belt-bar,#magic-bar,#hud-menu,#hud-chat {box-sizing:border-box}
#mainhud {width:1024px;height:68px;position:absolute;bottom:0;left:0;background:url(https://cdn.xxisxx.com/mir3/edge-art/zircon/ui/hud/g50.webp) no-repeat;user-select:none}
#mainhud button,#hud-more,#hud-map button,#magic-sets button {color:#eee;border:0;border-radius:0;padding:0;margin:0;min-width:0;min-height:0;box-shadow:none;font:inherit;text-transform:none}
#mainhud button:focus-visible,#game button:focus-visible,#game canvas:focus-visible {outline:1px solid #ffde8c;outline-offset:-2px}
.hud-experience {position:absolute;left:17px;top:3px;width:992px;height:10px;background:url(https://cdn.xxisxx.com/mir3/edge-art/zircon/ui/hud/g51.webp) center no-repeat;text-align:center;font:10px/10px Arial,sans-serif;color:#ffecaa;text-shadow:1px 1px black}
.hud-experience i {display:block;position:absolute;left:6px;top:2px;height:4px;width:calc(var(--fill,0)*98.79%);background:url(https://cdn.xxisxx.com/mir3/edge-art/zircon/ui/hud/g56.webp) left top no-repeat}
.hud-experience small {position:relative;display:inline-block;padding:0 2px;font:inherit;line-height:1;text-shadow:1px 1px #000,-1px -1px #000}
#mainhud .hud-vitals {position:absolute;left:0;top:0;width:270px;height:68px;pointer-events:none}
#mainhud .origin-meter {position:absolute;left:35px;top:22px;width:220px;height:8px;line-height:8px;color:#fff;text-align:center}
#mainhud .origin-meter.mana {top:36px}
.origin-meter i {height:8px;display:block;width:0;background:url(https://cdn.xxisxx.com/mir3/edge-art/zircon/ui/hud/g52.webp) left center no-repeat}
.origin-meter.mana i {background-image:url(https://cdn.xxisxx.com/mir3/edge-art/zircon/ui/hud/g54.webp)}
.origin-meter span {position:absolute;inset:0;font:11px/8px Arial,sans-serif;white-space:nowrap;text-shadow:1px 1px 1px black,-1px -1px 1px black}
#mainhud .hud-modes {position:absolute;left:35px;top:47px;width:220px;display:flex;justify-content:space-between;pointer-events:auto}
#mainhud .hud-modes button {font:12px/15px var(--mir-ui-font);color:cyan;background:transparent;text-shadow:1px 1px black;cursor:pointer}
#hud-stats {position:absolute;left:266px;top:20px;display:grid;grid-auto-flow:column;grid-template-columns:94px 85px 85px 97px;grid-template-rows:16px 16px;gap:4px 0;text-align:right;font:13px/15px var(--mir-ui-font);color:#e9dfc8}
#hud-stats>div {display:grid;grid-template-columns:minmax(0,1fr) 60px;align-items:center}
#hud-stats>div>span {font-size:12px;line-height:16px;white-space:nowrap}
#hud-stats output {color:#f0eee0;text-align:center;text-shadow:1px 1px black;line-height:16px}
#actions {position:absolute;left:642px;top:16px;width:382px;height:51px;display:block;gap:0;margin:0;padding:0}
#actions button.sprite-button {position:absolute;left:var(--slot-x);top:7px;width:36px;height:34px;background:var(--button) left top no-repeat;cursor:pointer}
#actions button.key-shop {width:48px;height:48px;top:0}
#actions button.sprite-button:hover {filter:brightness(1.35)}
#actions button.sprite-button:active {filter:brightness(.8);translate:0 1px}
#mainhud #hud-more {position:absolute;left:277px;bottom:0;max-width:340px;height:11px;font:10px/10px var(--mir-ui-font);color:#e7d6a1;background:#140f09;padding:0 3px;cursor:pointer}
#hud-menu {position:absolute;right:1px;bottom:68px;width:265px;display:grid;grid-template-columns:repeat(3,1fr);gap:3px;z-index:8;padding:8px!important;background-color:#1b1411}
#mainhud #hud-menu button {background:#211b12;color:#f3deaa;border:1px solid #635039;padding:4px 3px;font-size:14px;cursor:pointer}
#hud-map {position:absolute;top:0;right:0;width:200px;height:200px;padding:0!important;transform:scale(var(--map-scale,1));transform-origin:top right;z-index:3;overflow:hidden;background-color:#090808}
#hud-map .map-title {position:absolute;top:3px;left:8px;right:8px;height:21px;background:transparent;color:#ceb177;text-align:center;font: bold 14px var(--mir-ui-font);cursor:pointer;text-shadow:1px 1px black}
#hud-map #minimap {position:absolute;display:block;top:27px;left:6px;margin:0;width:188px;height:164px;touch-action:none;cursor:grab;image-rendering:pixelated}
#hud-map #minimap:active {cursor:grabbing}
#hud-map #hud-map-route {position:absolute;bottom:23px;left:6px;right:6px;padding:1px 4px;color:#ffdb69;background:#170f0bcf;text-align:center;font:12px/15px var(--mir-ui-font);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:none}
#hud-map #coords {position:absolute;left:6px;right:6px;bottom:6px;background:#170f0b8c;color:white;line-height:14px;text-align:center;font:12px var(--mir-ui-font);pointer-events:none}
#hud-chat {position:absolute;left:0;bottom:68px;width:480px;height:174px;background-color:rgba(20,13,14,.54);color:#fff;border:1px solid #6c594c;padding:0!important;display:flex;flex-direction:column;overflow:hidden}
body.native #hud-chat.translucent {background-color:rgba(5,4,5,.3)}
#hud-chat.collapsed {height:auto}
#hud-chat.collapsed #messages {display:none}
#hud-chat .hud-chat-tabs {display:flex;position:relative;height:20px;flex-shrink:0;border-bottom:1px solid #625246;background:#17120e8a;align-items:end}
#hud-chat .hud-chat-tabs button {border:1px solid #685743;border-bottom:0;background:#282015;color:#ecdaae;font:12px/16px var(--mir-ui-font);padding:0 12px;height:17px;cursor:pointer}
#hud-chat #messages {position:relative;display:block;padding:3px 6px;margin:0;flex:1;height:auto;min-height:0;max-height:none;overflow-y:auto;scrollbar-color:#766347 #1a1310;scrollbar-width:thin;font:14px/1.25 var(--mir-ui-font);text-shadow:1px 1px #000;overflow-wrap:anywhere;color:#fff;border:0;border-radius:0;background:none}
#messages .hud-line {display:table;white-space:pre-wrap}
#hud-chat #chat {position:relative;display:flex;align-items:center;gap:3px;margin:0;padding:2px 4px;min-height:25px;border-top:1px solid #645241;background:#171110}
#hud-chat #chat input {flex:1;min-width:0;height:20px;margin:0;padding:0 3px;font:14px var(--mir-ui-font);border:1px solid #594b37;background:#060606;color:#fff;border-radius:0}
#hud-chat #chat button {flex-shrink:0;height:19px;min-height:0;margin:0;padding:0 7px;line-height:17px;font-size:12px;cursor:pointer}
#belt-bar,#magic-bar {position:absolute;right:0;bottom:68px;display:flex;padding:5px!important;background-color:#110d09;gap:0}
#magic-bar {bottom:119px;max-width:100%;align-items:center}
#magic-cells {display:grid;grid-template-columns:repeat(12,36px);gap:1px}
#belt-bar .hud-slot,#magic-cells .hud-slot {position:relative;width:36px;height:36px;overflow:hidden;border:1px solid #635332;border-radius:0;margin:0;padding:0;min-height:0;background:#100808;color:#ece0c5;cursor:pointer}
.hud-slot span {position:absolute;inset:0;width:36px;height:36px;pointer-events:none}
.hud-slot small,.hud-slot b {position:absolute;font:italic 11px/12px Arial,sans-serif;top:1px;left:2px;color:#f5e8c9;text-shadow:1px 1px #000,-1px -1px #000}
.hud-slot b {left:auto;top:auto;bottom:0;right:1px;font-style:normal}
#magic-sets {display:grid;justify-items:center;padding:0 4px;color:#e9c88a}
#magic-sets button {background:none;color:#d7be9b;font-size:13px}
.native #game .hud-revive {appearance:none;border:0;border-radius:0;margin:0;padding:0;min-height:0;max-width:100%;font:inherit;line-height:inherit;letter-spacing:inherit;text-align:left;color:darkblue;background:rgba(255,255,255,.784);text-shadow:none;cursor:pointer}
#game .hud-revive:focus-visible {outline:1px dotted darkblue;outline-offset:-1px}
#hud-chat.collapsed:has(.hud-revive) #chat-tab {position:relative;padding-left:20px}
#hud-chat.collapsed:has(.hud-revive) #chat-tab::before {content:"";position:absolute;left:2px;top:1px;width:16px;height:14px;background:url(https://cdn.xxisxx.com/mir3/edge-art/zircon/ui/hud/g240.webp) no-repeat;pointer-events:none}
#panel[data-hud-window="settings"],#panel[data-hud-window="chat"] {width:min(300px,calc(100vw - 16px));min-height:min(305px,calc(100dvh - 12px));max-height:calc(100dvh - 12px);color:#eadfc8}
#panel[data-hud-window="map"] {width:fit-content;min-width:min(200px,95vw);max-width:calc(100vw - 12px);max-height:calc(100dvh - 12px)}
.hud-settings-tabs {display:flex;gap:2px;margin:2px 0 10px;border-bottom:1px solid #574a39}
.hud-settings-tabs button {flex:1;padding:3px!important}
.hud-settings-tabs [aria-selected="true"] {color:#ffdf8a!important;filter:brightness(1.25)}
.hud-setting-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px 8px;align-items:center;min-height:90px}
.hud-setting-grid label,.hud-setting-grid p {margin:0;display:flex;align-items:center;gap:6px;font-size:14px;color:#eee0cc}
.hud-setting-grid input[type="range"] {width:110px}
.hud-setting-grid .wide {grid-column:1 / -1;justify-content:space-between}
.hud-worldmap {display:block;max-width:100%;max-height:65dvh;object-fit:contain;margin:auto;touch-action:manipulation;background:#060605}
.hud-map-footer {display:flex;align-items:center;justify-content:space-between;gap:8px;color:#dfd1b9;margin-top:3px;font-size:12px}
@media(max-width:699px){
 #hud-dock {--mobile-dock-height:107px;width:100%;height:var(--mobile-dock-height);transform:translateX(-50%)}
 #mainhud {width:100%;height:100%;background:linear-gradient(#241c0a,#120e0b);border-top:1px solid #8c7547}
 #mainhud .hud-vitals {top:0;left:0;height:56px;width:266px;background:url(https://cdn.xxisxx.com/mir3/edge-art/zircon/ui/hud/g50.webp) 0 -12px no-repeat}
 #mainhud .origin-meter {top:10px}
 #mainhud .origin-meter.mana {top:24px}
 #mainhud .hud-modes {top:34px}
 #hud-stats {display:none}
 #mainhud .hud-experience {top:0;width:calc(100% - 268px);height:7px;left:268px}
 #mainhud #hud-more {left:auto;right:4px;top:15px;bottom:auto;max-width:calc(100% - 270px);height:26px;font-size:12px;line-height:13px}
 #mainhud #actions {left:50%;top:auto;bottom:0;transform:translateX(-50%) scale(var(--tool-scale));transform-origin:bottom center;background:url(https://cdn.xxisxx.com/mir3/edge-art/zircon/ui/hud/g50.webp) -642px -16px no-repeat}
 #hud-menu {bottom:var(--mobile-dock-height)}
 #hud-chat {bottom:var(--mobile-dock-height);width:min(100%,460px);height:95px}
 #belt-bar {bottom:calc(var(--mobile-dock-height) + 98px);max-width:100%;background-color:#150f0b;flex-wrap:nowrap}
 #belt-bar .hud-slot {width:clamp(27px,9vw,36px);height:30px}
 #magic-bar {bottom:calc(var(--mobile-dock-height) + 140px);right:0}
 #magic-cells {grid-template-columns:repeat(8,30px)}
 #magic-cells .hud-slot {width:30px;height:29px}
 #game {--map-scale:.73}
 #hud-chat #chat input {font-size:16px}
}
@media(max-height:440px) and (min-width:700px){#hud-chat {height:92px} #game{--map-scale:.64}}
.origin-debug{position:absolute;left:6px;top:4px;z-index:2;color:#ffe89e;background:#080706a8;font:12px/15px monospace;pointer-events:none}

#belt-bar .hud-slot + .hud-slot {margin-left:-1px}
#magic-cells .hud-cooldown {position:absolute;inset:0;display:grid;place-items:center;background:rgba(50,50,50,.49);color:gold;font:normal 13px/1 var(--mir-ui-font);text-shadow:1px 1px #000,-1px -1px #000;pointer-events:none}
#magic-cells .hud-cooldown.ending {color:red}
#magic-cells .hud-slot {border-color:#c6a663;background-color:rgba(20,20,20,.6)}
#actions .hud-available::before,#actions .hud-complete::after {content:"";position:absolute;left:2px;top:2px;width:16px;height:14px;background:url(https://cdn.xxisxx.com/mir3/edge-art/zircon/ui/hud/g240.webp) left top no-repeat;pointer-events:none}
#actions .hud-complete::after {background-image:url(https://cdn.xxisxx.com/mir3/edge-art/zircon/ui/hud/g241.webp)}
#actions .hud-available.hud-complete::after {top:auto;bottom:0}

#panel[data-hud-window="chat"] {width:min(375px,calc(100vw - 16px))}
.hud-chat-layout-actions {display:flex;gap:4px;align-items:center;margin-bottom:8px}
.hud-chat-layout-actions select {flex:1;min-width:0}
.hud-setting-grid label.wide input:not([type="range"]) {min-width:0;width:65%}
#hud-chat .hud-chat-tabs {overflow-x:auto;scrollbar-width:none}
#hud-chat .hud-chat-tabs button {white-space:nowrap;flex-shrink:0}
#hud-chat .hud-chat-tabs [aria-selected="true"] {background:#33271a;color:#ffe8a0}
#hud-chat .hud-chat-tabs .hud-chat-fold {margin-left:auto;padding:0 5px;color:#cfbe91}
.hud-chat-float {position:absolute;z-index:6;resize:both;min-width:140px;min-height:70px;max-width:100vw;max-height:100dvh;display:flex;flex-direction:column;overflow:hidden;padding:5px!important;box-sizing:border-box;background-color:#160e0c}
.native #game .hud-chat-float.translucent {background-color:rgba(10,8,9,.5)}
.hud-chat-float header {display:flex;align-items:center;justify-content:space-between;gap:4px;cursor:move;touch-action:none;color:#ecd7a2;font:12px var(--mir-ui-font)}
.hud-chat-float header button {padding:0 4px!important;height:18px!important;font-size:12px}
.hud-float-lines {overflow:auto;flex:1;min-height:0;overflow-wrap:anywhere;font:14px/1.25 var(--mir-ui-font);scrollbar-width:thin}
.hud-float-lines .hud-line {display:table;white-space:pre-wrap}

/* The shared utility has a legacy ID selector in game.css. Give it the original DXWindow close image. */
body.native #panel #close-panel {
  position:absolute;right:5px;top:5px;z-index:2;width:21px;height:21px;min-height:0;
  border:0;padding:0;font:16px/21px sans-serif;color:#e5cea8;background:#211810;
}
body.native #panel #close-panel::after {content:"";position:absolute;inset:0;pointer-events:none;background:url("https://cdn.xxisxx.com/mir3/edge-art/zircon/ui/panels/i15.png") center/21px 21px no-repeat}
body.native #panel #close-panel:hover::after {filter:brightness(1.22)}
body.native #panel #close-panel:active::after {filter:brightness(.8)}
body.native #panel #close-panel:focus-visible {outline:2px solid #f7d078}
body.native #panel[data-hud-window="settings"] .hud-settings-footer {display:flex;flex-wrap:wrap;justify-content:flex-end;gap:4px}
body.native #window-localCache {width:min(555px,calc(100vw - 12px))}
body.native #window-localCache .details {display:grid;gap:6px;max-height:min(74vh,calc(100dvh - 58px));user-select:text}
.cache-smart,.cache-fields,.cache-tools {display:flex;align-items:center;gap:6px}
.cache-tools {flex-wrap:wrap}
.cache-smart {color:#ead09a}
.cache-summary {color:#e3c682!important}
.cache-fields select,.cache-fields input {min-width:0}
.cache-fields input {flex:1}
.cache-rows {border:1px solid #675231;background:#0d0907}
.cache-rows label {display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:5px;padding:4px 6px;border-bottom:1px solid #382c1c;cursor:pointer}
.cache-rows label:last-child {border:0}
.cache-rows label span {overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.cache-rows small {font-variant-numeric:tabular-nums;color:#d0b593}
.cache-rows p {padding:4px}

#game .hud-cast-status {position:absolute;top:max(10px,env(safe-area-inset-top));left:50%;transform:translateX(-50%);z-index:5;pointer-events:none;padding:3px 10px;white-space:nowrap;border:1px solid #756341;background:#17120de0;color:#ffe3a2;font:13px/18px var(--mir-ui-font);text-shadow:1px 1px #000}
#game .hud-network {position:absolute;left:max(6px,env(safe-area-inset-left));top:max(4px,env(safe-area-inset-top));z-index:2;pointer-events:none;padding:1px 5px;white-space:nowrap;font:12px/17px var(--mir-ui-font);font-variant-numeric:tabular-nums;color:#eadfc8;background:#130e0cbd;text-shadow:0 1px #000}
#game .origin-debug:not([hidden]) + .hud-network {margin-top:18px}
#game .hud-network::before {content:"";display:inline-block;vertical-align:1px;width:6px;height:6px;margin-right:5px;border-radius:50%;background:#a7a59b}
#game .hud-network[data-quality="good"]::before {background:#83d890}
#game .hud-network[data-quality="moderate"]::before {background:#e9bf65}
#game .hud-network:is([data-quality="slow"],[data-quality="timeout"],[data-quality="offline"])::before {background:#e8826b}


#hud-dock>.hud-chat-stack {position:absolute;left:0;bottom:100%;width:100%;display:flex;flex-direction:column;align-items:flex-start;gap:4px;pointer-events:none}
#hud-dock .hud-chat-stack>#belt-bar {bottom:0;pointer-events:auto}
#hud-dock .hud-chat-stack>#magic-bar {bottom:51px;pointer-events:auto}
#hud-dock .hud-chat-stack>#hud-chat {position:relative;left:auto;bottom:auto;max-width:100%;pointer-events:auto}
#hud-afk {box-sizing:border-box;display:flex;align-items:center;gap:6px;max-width:min(100%,360px);min-width:0;padding:2px 7px 2px 2px;border:1px solid #766044;background:rgba(24,18,14,.94);color:#efdfba;font:13px/1.3 var(--mir-ui-font);text-shadow:1px 1px 1px #000}
#hud-afk[hidden] {display:none}
#hud-afk-toggle {flex:none;min-height:30px;margin:0;padding:3px 9px;border:1px solid #aa8b53;border-radius:2px;background:linear-gradient(#493e2b,#2a241c);color:#ffebbe;font:inherit;cursor:pointer;pointer-events:auto;touch-action:manipulation}
#hud-afk-toggle[aria-pressed="true"] {color:#fff2cb;border-color:#b38060;background:linear-gradient(#714b36,#422d22)}
#hud-afk-toggle:active {transform:translateY(1px)}
#hud-afk-toggle:focus-visible {outline:2px solid #ffe1a1;outline-offset:1px}
#hud-afk-toggle:disabled {color:#978a71;cursor:default}
#hud-afk-mode {flex:none;min-height:30px;margin:0;padding:2px 4px;border:1px solid #7e6941;border-radius:2px;background:#302619;color:#efdfba;font:inherit;cursor:pointer;pointer-events:auto;touch-action:manipulation}
#hud-afk-mode:focus-visible {outline:2px solid #ffe1a1;outline-offset:1px}
#hud-afk-mode {display:block;min-height:0;padding:0}
#hud-afk-mode summary {box-sizing:border-box;min-height:30px;display:flex;align-items:center;gap:5px;padding:3px 7px;border:0;background:transparent;list-style:none}
#hud-afk-mode summary::-webkit-details-marker {display:none}
#hud-afk-mode summary::after {content:"▾";font-size:.8em}
#hud-afk-settings {display:none}
#hud-afk-message {min-width:0;overflow-wrap:anywhere}
@media(max-width:699px){
 #hud-afk{max-width:min(100%,320px)}
 #hud-afk-toggle,#hud-afk-mode{min-height:36px}
 #hud-dock .hud-chat-stack>#belt-bar,#hud-dock .hud-chat-stack>#magic-bar {position:relative;bottom:auto;right:auto;align-self:flex-end}
}

#mainhud #hud-menu a{align-content:center;background:#211b12;color:#f3deaa;border:1px solid #635039;padding:4px 3px;text-align:center;text-decoration:none;font-size:14px}
