/* Compact Mir HUD: original stone textures, live HTML labels and controls. */
:root{--rim:#81745b;--ink:#dfd6bb;--stone:#181917;--gold:#c2a66b}
.stone,.floating-bar,.compact-panel{background-color:var(--stone);background-image:repeating-linear-gradient(135deg,#ffffff03 0px,#ffffff03 1px,transparent 1px,transparent 4px),linear-gradient(#272821,#121410);border:2px ridge var(--rim);box-shadow:0 2px 5px #0009,inset 0 0 0 1px #090a08;color:var(--ink)}
#classic-hud{background:none;pointer-events:none;height:0}#classic-hud>*{display:none!important}#classic-hud #event-log{display:none!important}.chat-open #classic-hud #event-log{display:block!important;top:auto;bottom:80px;left:12px;width:260px;height:110px;background:#080a08ed;border:1px solid var(--rim);padding:8px;pointer-events:auto}
.tiny-status,.map-name,.utility,.hint{display:none}
#compact-hud{position:absolute;inset:0;z-index:9;pointer-events:none}#compact-hud button,#compact-hud nav{pointer-events:auto}
#player-status{position:absolute;left:12px;top:12px;display:flex;width:205px;height:88px;padding:7px;gap:7px;text-shadow:1px 1px #000;pointer-events:none}
.portrait{width:33px;height:52px;border:1px solid #736447;display:flex;align-items:center;justify-content:center;background:#141512;font-size:23px;color:#c2b18a}
.player-data{flex:1;min-width:0}.player-data strong{display:block;font:11px SimSun;white-space:nowrap;margin-bottom:5px}.player-data strong small{font:9px Arial;float:right;color:#bbb59e}.player-data>small{display:block;font:9px Arial;color:#d0b875;margin-top:4px}
.status-meter{height:15px;position:relative;border:1px solid #6d6753;background:#080908;margin:3px 0;overflow:hidden}.status-meter i{display:block;height:100%;background:linear-gradient(#bd2925,#790e0f)}.status-meter.mana i{background:linear-gradient(#2679c6,#0d2e74)}.status-meter span{position:absolute;inset:0;text-align:center;font:9px/13px Arial;color:#eee;font-variant-numeric:tabular-nums}.status-meter.experience{height:4px;border:0}.experience i{background:#718d56}
#minimap-button{position:absolute;right:12px;top:12px;width:120px;height:117px;padding:3px;text-align:center}#minimap{width:108px;height:82px;display:block;margin:auto;image-rendering:pixelated}#minimap-title{display:block;font-size:10px;height:13px;overflow:hidden;white-space:nowrap}#minimap-coords{font:9px Arial;color:#d6c9a4}
.quest-track{top:138px;right:12px;padding:7px 9px;background:#11150eea;border:1px solid #786d52;font-size:11px;max-width:190px;z-index:10}
.floating-bar{position:absolute;display:flex;gap:3px;padding:4px;pointer-events:auto;width:280px;height:68px}.floating-bar .drag-handle{width:15px;min-width:15px;padding:0;background:#131310;border:1px solid #615b46;cursor:grab;touch-action:none;color:#aa9b7b;font-size:16px}.drag-handle:active{cursor:grabbing}.bar-content{min-width:0;flex:1}.bar-content>small{display:block;height:12px;font:10px/10px SimSun;color:#c2b18b}
#item-bar{left:190px;bottom:12px}#skill-bar{left:290px;bottom:86px}.bar-slots{display:grid;grid-template-columns:repeat(6,1fr);gap:3px}.bar-slots button{position:relative;width:38px;height:40px;padding:3px;background:#080a08;border:1px solid #69624d;box-shadow:inset 0 0 5px #000}.bar-slots img{width:29px;height:28px;object-fit:contain;image-rendering:pixelated;pointer-events:none}.bar-slots kbd{position:absolute;left:1px;top:0;font:9px Arial;color:#bbb;text-shadow:1px 1px black;pointer-events:none}.bar-slots b{position:absolute;right:2px;bottom:1px;font:10px Arial;color:#f7e9aa}.bar-slots .empty-slot{opacity:.55}.skill-button>small{position:absolute;left:0;right:0;bottom:-1px;font:8px SimSun;text-align:center;text-shadow:1px 1px black;pointer-events:none}button.skill-active{border-color:#d9c47b!important;box-shadow:inset 0 0 7px #c8aa4b55!important}button.no-mana{filter:grayscale(.75)}[data-skill] em{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font:12px Arial;color:#fff0b0;text-shadow:1px 1px black;pointer-events:none}[data-skill] em:not(:empty){background:#08080799}
#fixed-shortcuts{position:absolute;right:12px;bottom:12px;display:flex;gap:3px}#fixed-shortcuts button{width:36px;height:40px;padding:3px;font:11px SimSun}#chat-toggle{position:absolute;bottom:12px;left:12px;width:34px;height:34px;padding:0}
#target-bar{top:25px;left:50%;transform:translateX(-50%)}#toast{top:120px}
#character-window{left:20px;top:115px;width:320px;height:370px;background:linear-gradient(135deg,#20231e,#111410);border:2px ridge #8c7b59;box-shadow:0 3px 12px #0009}#character-window h2{left:70px;top:12px;font-size:14px;width:180px}#character-close{left:auto;right:6px;top:5px;width:28px;height:28px;color:#dfc78f;font-size:22px;background:#211a13;border:1px solid #7b6546}#character-window .character-tab{left:auto;top:36px;width:70px;height:26px;background:#181b15!important;border:1px solid #635a44;font-size:11px;color:#d4c3a0}#equipment-page{left:77px!important}#stats-page{left:150px!important}#equipment-page:after{content:'装备'}#stats-page:after{content:'属性'}#character-window .character-tab[aria-pressed=true]{border-color:#c2a66b;background:#3c3422!important}
#equipment-preview{left:77px;top:73px;width:168px;height:199px}#equipment-slots{left:8px;top:50px;width:300px;height:296px;pointer-events:none}.equipped-slot{width:48px;height:48px;background:#080b08;border:1px solid #796c50;z-index:2;position:absolute}.equipped-slot small{position:absolute;left:-4px;right:-4px;bottom:-15px;font:10px SimSun;color:#c8baa0;text-align:center;white-space:nowrap;pointer-events:none}.equipped-slot img{width:34px;height:34px}#char-stats{left:20px;top:348px;width:278px;height:16px;font:9px SimSun;text-align:center;color:#93856c}#equipment{left:45px;top:72px;width:250px;gap:1px}#equipment>div{height:24px;text-align:left;border-bottom:1px solid #5d5437;font:12px/22px SimSun;padding-left:8px}#equipment .stat-row{display:flex;align-items:center;justify-content:space-between;gap:6px}#equipment .stat-row span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#equipment .stat-row button{width:22px;height:18px;padding:0;line-height:16px;flex:none}
#equip-destination{position:absolute;top:204px;left:66px;width:150px;z-index:2;font:10px SimSun;color:#ded3ab;background:#11140f;border:1px solid #716242;padding:2px}#item-detail{top:214px;height:46px;font:10px/14px SimSun}#item-detail span{display:block;white-space:normal}.bag-slot.broken .item-icon{filter:grayscale(1) brightness(.65)}#equip-button{color:#dfcba3;background:#201d14;border:1px solid #776846}#bag-close{color:#dfcba3;background:#201d14;border:1px solid #776846;font-size:15px}
.compact-panel{min-height:270px!important;max-height:480px;overflow-y:auto}.compact-panel>.close-simple,.dialog>.close-simple{width:28px;height:28px;right:4px;top:4px;color:#dfc78f;font-size:20px;background:#211a13;border:1px solid #7b6546;z-index:2}.skill-note{color:#a99e7f;font-size:11px}.skill-row{display:flex;gap:10px;padding:12px 0;border-top:1px solid #514b36;align-items:center}.skill-row>img{width:36px;height:36px;image-rendering:pixelated}.skill-row>div{flex:1;min-width:0}.skill-row strong{font-size:13px;color:#dfc78f}.skill-row p{margin:3px 0;font:11px/1.6 SimSun}.skill-row small{font-size:10px}.skill-row span{display:block;font-size:10px;color:#e0c783}.skill-row>button{padding:6px;min-width:44px}#settings-actions{display:flex;gap:8px;flex-wrap:wrap}#settings-actions button{margin:5px 0}
/* Touch: shared status/minimap, dedicated item strip and independent skill actions. */
.touch-ui #compact-hud .floating-bar,.touch-ui #fixed-shortcuts,.touch-ui #chat-toggle{display:none}.touch-ui #mobile-status{display:none}.touch-ui #player-status{left:max(8px,env(safe-area-inset-left));top:max(8px,env(safe-area-inset-top));width:178px;height:78px;padding:5px;gap:5px}.touch-ui .portrait{width:27px;height:47px;font-size:19px}.touch-ui .player-data strong{font-size:10px}.touch-ui .player-data strong small{font-size:8px}.touch-ui .status-meter{height:14px}.touch-ui .status-meter span{line-height:12px}.touch-ui .status-meter.experience{height:3px}.touch-ui .player-data>small{font-size:9px;margin-top:2px}
.touch-ui #minimap-button{right:max(8px,env(safe-area-inset-right));top:max(8px,env(safe-area-inset-top));width:98px;height:100px;padding:2px}.touch-ui #minimap{width:88px;height:65px}.touch-ui #minimap-title{height:14px}.touch-ui .quest-track{display:block;top:92px;left:8px;right:auto;max-width:180px;padding:5px;font-size:10px}.touch-ui #quest-reward{display:none}
.touch-ui #mobile-nav{top:116px;right:max(8px,env(safe-area-inset-right));grid-template-columns:repeat(2,44px);gap:4px}.touch-ui #mobile-nav button{font-size:11px;background:#141711e8;border:1px solid #81745b}
#mobile-item-bar{display:flex;gap:4px;position:absolute;pointer-events:auto;left:50%;transform:translateX(-50%);bottom:190px;padding:4px}#mobile-item-bar button{width:48px;height:48px;position:relative}#mobile-item-bar img{width:30px;height:30px;object-fit:contain;image-rendering:pixelated;pointer-events:none}#mobile-item-bar span{position:absolute;bottom:2px;right:2px;color:#f1d88e;font:11px Arial;pointer-events:none}
.touch-ui #mobile-actions{display:block;width:168px;height:164px;bottom:max(18px,env(safe-area-inset-bottom));right:max(12px,env(safe-area-inset-right))}.touch-ui #mobile-actions button{position:absolute;min-width:44px;min-height:44px;width:44px;height:44px;margin:0}.touch-ui #mobile-actions #mobile-attack{right:0;bottom:0;width:72px;height:72px}.touch-ui #mobile-fireball{left:0;bottom:0;border-radius:50%}.touch-ui #mobile-heal{left:34px;bottom:64px;border-radius:50%}.touch-ui #mobile-slaying{left:84px;bottom:86px;border-radius:50%}.touch-ui #mobile-mode{left:0;top:0}.touch-ui #mobile-pickup{right:0;top:0}.touch-ui #touch-joystick{bottom:max(22px,env(safe-area-inset-bottom));left:12px;width:112px;height:112px}.touch-ui #touch-hint{display:none}
.touch-ui #character-window{width:320px;height:370px}.touch-ui #character-close{left:auto;top:4px;right:4px;width:44px;height:44px}.touch-ui #character-window .character-tab{height:36px;top:36px}.touch-ui #equipment-slots{top:56px}.touch-ui #equipment-preview{top:79px}.touch-ui .equipped-slot{width:48px;height:48px;margin:0}.touch-ui #equipment{top:90px}.touch-ui #char-stats{top:350px}.touch-ui #equip-destination{top:auto;bottom:118px;left:18px;width:150px;height:30px;font-size:12px}.touch-ui #capacity,.touch-ui #gold-bag{bottom:154px}.touch-ui #bag-grid{max-height:calc(100% - 225px)}.touch-ui #item-detail{top:auto;bottom:66px;height:46px;font:12px/20px SimSun}.touch-ui .compact-panel{max-height:calc(100% - 24px)}.touch-ui .skill-row{gap:8px}.touch-ui .skill-row>img{width:30px;height:30px}.touch-ui .skill-row>button{padding:5px}.touch-ui .dialog>.close-simple{position:sticky;top:0;margin:-16px -16px 0 0;width:44px;height:44px}
.mobile-panel-open #item-bar,.mobile-panel-open #skill-bar,.mobile-panel-open #mobile-item-bar,.mobile-panel-open #mobile-actions,.mobile-panel-open #touch-joystick{pointer-events:none!important;opacity:.18}.touch-ui #mobile-hud.inactive #mobile-item-bar{visibility:hidden}
@media(orientation:landscape){.touch-ui #mobile-nav{top:8px;right:116px;grid-template-columns:repeat(6,44px)}.touch-ui .quest-track{left:auto;right:8px;top:116px;max-width:170px}.touch-ui #mobile-item-bar{bottom:max(16px,env(safe-area-inset-bottom))}.touch-ui #mobile-actions{height:150px}.touch-ui #player-status{width:178px}.touch-ui #target-bar{top:65px}.touch-ui #toast{top:92px}}
@media(max-width:350px) and (orientation:portrait){.touch-ui #player-status{width:166px}.touch-ui #minimap-button{width:92px}.touch-ui #minimap{width:82px}.touch-ui #touch-joystick{width:100px;height:100px;left:8px}.touch-ui #mobile-actions{right:8px;width:164px}.touch-ui #mobile-nav{top:116px}.touch-ui .quest-track{max-width:176px;font-size:9px}.touch-ui #mobile-item-bar{bottom:190px}.touch-ui .dialog{padding:20px}.touch-ui .skill-row strong{font-size:12px}.touch-ui .skill-row p{font-size:11px}}

.portrait canvas{width:100%;height:100%;image-rendering:pixelated}.touch-ui #mobile-item-bar #mobile-recall span{font:9px SimSun}

.screen-overlay{z-index:40}

.touch-ui #mobile-pause{position:absolute;pointer-events:auto;right:max(8px,env(safe-area-inset-right));bottom:max(188px,calc(env(safe-area-inset-bottom) + 188px));width:44px;height:44px}.touch-ui #mobile-nav{grid-auto-flow:row}@media(orientation:landscape){.touch-ui #mobile-pause{top:154px;bottom:auto}}
#char-stats{display:none}

.hud-visibility-settings{border:1px solid #655a43;margin:14px 0;padding:8px 10px}.hud-visibility-settings legend{color:#cbb17b}.hud-visibility-settings label{display:flex;align-items:center;gap:8px;min-height:32px;cursor:pointer}.hud-visibility-settings input{accent-color:#b59450;width:17px;height:17px;margin:0}.hud-visibility-settings small{display:block;color:#a99d82;font:10px/1.6 SimSun}.touch-ui .hud-visibility-settings label{min-height:44px}.touch-ui .hud-visibility-settings input{width:22px;height:22px}

/* Long Night: progression and story stay readable on the original stone skin. */
#world-conditions{position:absolute;top:105px;left:12px;padding:5px 8px;max-width:215px;font:10px/1.7 SimSun;color:#d1c39f}#world-conditions span{display:block}#light-status{color:#aaa58f}#light-status.light-low{color:#e9aa68}.quest-track{cursor:pointer}.quest-track>strong{display:block;font-size:11px;color:#e3c98e;margin-bottom:4px}
#skills-window,#quests-window{top:50%;width:530px;max-width:calc(100% - 24px);max-height:calc(100% - 32px);padding:22px}#skills-window h2,#quests-window h2{font-size:17px;margin:0 30px 15px 0}.skill-summary{display:flex;justify-content:space-between;align-items:center;gap:10px;color:#e7cb89}.skill-summary button{padding:7px 10px;font-size:11px}.school-heading{font-size:13px;color:#c3ad79;margin:20px 0 0;border-bottom:1px solid #736348;padding-bottom:8px}.skill-row{gap:9px;padding:12px 0;align-items:flex-start}.skill-row .skill-controls{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:5px;flex:0 0 112px}.skill-controls button,.skill-controls select{font:10px/1.4 SimSun;min-height:29px;padding:5px 7px}.skill-controls select{width:100%;background:#171a13;border:1px solid #776c4e;color:#e0d5b7}.skill-row strong>small{color:#baac89;margin-left:5px}.skill-row .skill-description{flex:1}.skill-row.skill-unlearned>img{opacity:.55}.skill-row [data-learn]:disabled{opacity:.45;cursor:default}.skill-controls button:disabled,.skill-controls select:disabled{opacity:.45}.skill-row span{min-height:15px;margin-top:4px}
#quest-chapter{font-size:11px;color:#c9af77;margin:0}#quest-title{font-size:18px;color:#eed7a1;margin:10px 0}#quest-story,#quest-panel-next{font:12px/1.8 SimSun;color:#b7ad91}#quest-dialogue{margin:14px 0;padding:12px;border-left:2px solid #a18b55;background:#0003;font:12px/1.9 SimSun;color:#e4d7b4;white-space:pre-line}.quest-objective{padding:9px 0;border-bottom:1px solid #504831;font:12px/1.6 SimSun;overflow-wrap:anywhere}.quest-objective>b{float:right;color:#e7c884}.quest-objective>small{display:block;color:#9e967f;padding-left:16px}.quest-objective.complete{color:#9ab786}#quest-rewards{font:11px/1.8 SimSun;color:#d9c087}.quest-actions{display:flex;flex-wrap:wrap;gap:7px}.quest-actions button{padding:8px 10px;min-height:34px;font:11px SimSun}.quest-actions button:disabled{opacity:.45}#chapter-journal{border-top:1px solid #655638;margin-top:18px;padding-top:12px;font:12px/1.8 SimSun}#chapter-journal summary{cursor:pointer;color:#d6bf86}#chapter-list{list-style:none;padding:0;margin-top:12px}.journal-chapter{margin:12px 0}.journal-chapter>strong{font-size:12px;color:#c9b98f}.journal-chapter>ol{list-style:none;padding-left:10px;font-size:11px}.journal-chapter .locked{color:#817d6c}.journal-chapter .current{color:#efcf85}.journal-chapter .complete{color:#9aaf83}
.touch-ui #world-conditions{top:91px;left:8px;font-size:9px;padding:4px 6px;max-width:176px}.touch-ui .quest-track{top:148px;max-width:180px}.touch-ui #skills-window,.touch-ui #quests-window{padding:18px;width:calc(100% - 24px);max-height:calc(100% - 24px)}.touch-ui .skill-row .skill-controls{flex-basis:104px}.touch-ui .skill-controls button,.touch-ui .skill-controls select{min-height:36px}.touch-ui .skill-row>img{width:25px;height:25px}.touch-ui .skill-row{gap:6px}.touch-ui .skill-row p{font-size:11px}.touch-ui .skill-row strong{font-size:12px}.touch-ui .quest-actions button{min-height:44px}.touch-ui .skill-summary{padding-top:4px}.touch-ui #quests-window h2,.touch-ui #skills-window h2{margin-right:30px}.touch-ui #skills-window>.close-simple,.touch-ui #quests-window>.close-simple{float:right;right:0;margin:0 0 0 5px}
@media(orientation:landscape){.touch-ui #world-conditions{top:91px;left:8px}.touch-ui .quest-track{top:116px;left:auto;right:8px;max-width:170px}.touch-ui #skills-window,.touch-ui #quests-window{width:540px;max-width:calc(100% - 24px)}}

.skill-redemption{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;font-size:11px;margin:10px 0;color:#c4b18a}.skill-redemption button{padding:6px 8px;font-size:10px}.skill-redemption button:disabled{opacity:.45}.skill-redemption small{flex-basis:100%}.touch-ui .skill-redemption button{min-height:36px}

#unequip-light{position:absolute;left:245px;top:310px;width:60px;height:30px;padding:3px;font-size:10px}.touch-ui #unequip-light{height:44px;top:305px;width:60px}.quest-track{pointer-events:auto}

.touch-ui .skill-controls button,.touch-ui .skill-controls select{min-height:44px}@media(orientation:landscape){.touch-ui #mobile-pause{left:192px;right:auto;top:8px}}@media(orientation:landscape) and (max-width:700px){.touch-ui #player-status{width:166px}.touch-ui #mobile-nav{left:184px;right:auto;grid-template-columns:repeat(3,44px)}.touch-ui #mobile-pause{left:336px;top:8px}.touch-ui #minimap-button{width:90px}.touch-ui #minimap{width:80px}}

body:not(.touch-ui) #mobile-pause{display:none}.touch-ui #mobile-pause{z-index:32;touch-action:manipulation;min-width:44px;min-height:44px}

.profile-settings{margin:12px 0;padding:10px;border:1px solid #756144}.profile-settings legend{color:#e2cf9a}.profile-row{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.profile-settings input{box-sizing:border-box;min-width:0;flex:1;width:150px;min-height:34px;background:#11100d;color:#eee3c2;border:1px solid #786644;padding:6px 8px;font:inherit}.profile-settings p{font-size:12px;line-height:1.6}.profile-settings #profile-message{min-height:1.6em;color:#e2cf9a;margin:4px 0}.profile-settings #confirm-reset-profile{color:#ffb6a5}.profile-settings [hidden]{display:none!important}#hud-name{display:inline-block;max-width:145px;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom;white-space:nowrap}
:root{--story-ink:#eee2c6;--story-edge:#806442;}
#character-creation{display:grid;gap:6px;text-align:left;margin:10px auto;width:min(300px,100%);color:var(--story-ink);font-size:13px}
#character-creation input,#character-creation select{width:100%;min-width:0;padding:7px 10px;color:#f0e3c3;background:#151916;border:1px solid var(--story-edge);font:inherit;box-sizing:border-box}
.creation-selects{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.creation-selects label{display:grid;gap:5px}
#character-creation p{font-size:12px;line-height:1.5;margin:2px 0}
#creation-error{color:#ffb58c;min-height:0}
#creation-error:empty{display:none}
.welcome:has(#character-creation:not([hidden])){max-height:calc(100% - 16px);overflow:auto;padding:18px 24px}
.welcome:has(#character-creation:not([hidden])) h2{margin:0 0 6px}
.welcome:has(#character-creation:not([hidden]))>p{margin:8px 0;font-size:13px;line-height:1.5}
#story-dialogue-window{width:460px;max-width:calc(100% - 24px);height:auto;max-height:calc(100% - 36px);overflow:auto;left:50%;top:50%;transform:translate(-50%,-50%);padding:24px 28px 20px;box-sizing:border-box;z-index:130;color:var(--story-ink);background:linear-gradient(135deg,#232722,#111712);border:2px solid var(--story-edge);box-shadow:0 12px 60px #000d}
#story-dialogue-window h2{font-size:19px;color:#e7cb83;margin:12px 0 16px;text-align:left}
#story-line{font-size:15px;line-height:1.9;white-space:pre-line;min-height:90px;margin:12px 0 20px}
#story-location,#story-page{display:block;font-size:11px;color:#b5ad95}
#story-page{text-align:right;margin-top:12px}
#story-choices{display:grid;gap:8px;margin:12px 0}
#story-dialogue-window button{min-height:36px;padding:6px 12px}
#story-close{position:absolute;right:10px;top:8px}
#story-choices button{text-align:left;width:100%;color:#f0db9e}
#story-choices:empty{display:none}
#merchant .equipment-shop{max-height:260px;overflow-y:auto;overscroll-behavior:contain}
#merchant .equipment-shop>div{display:flex;align-items:center;gap:8px;min-height:38px}
#merchant .equipment-shop>div[hidden]{display:none}
.touch-ui #story-dialogue-window{max-height:calc(100% - 24px);padding:20px;}
@media(max-height:480px){.touch-ui .welcome:has(#character-creation:not([hidden])){width:440px;padding:12px 22px}.touch-ui #character-creation{width:100%;grid-template-columns:1fr 1fr;align-items:center;column-gap:12px}.touch-ui #character-creation>label{grid-column:1}.touch-ui #start-nickname{grid-column:1}.touch-ui .creation-selects{grid-column:2;grid-row:1 / 3}.touch-ui #creation-class-note,.touch-ui #creation-error{grid-column:1 / -1}.touch-ui .welcome>p{display:none}.touch-ui #story-line{min-height:40px;margin:8px 0;font-size:14px}.touch-ui #story-dialogue-window h2{margin:5px 0}.touch-ui #story-dialogue-window{max-width:520px}.touch-ui #story-page{margin-top:5px}}
