:root{color:#e8e8f0;font-synthesis:none;background:#14141f;font-family:Segoe UI,system-ui,sans-serif}*{box-sizing:border-box}html,body,#hud{width:100%;height:100dvh;max-height:100dvh;margin:0;overflow:hidden}body{overscroll-behavior:none;touch-action:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;-webkit-text-size-adjust:100%;position:fixed;inset:0}button{font:inherit}#hud{pointer-events:none;z-index:20;--hud-bag-cell:clamp(24px, min(calc((100vw - 92px) / 6), calc((100dvh - 248px) / 4)), 42px);--hud-bottom-height:calc(130px + var(--hud-bag-cell) * 4);flex-direction:column;display:flex;position:fixed;inset:0}.hud-top{background:linear-gradient(#0a0a14d9,#0a0a1459);flex:0 0 44px;justify-content:space-between;align-items:center;height:44px;padding:0 8px;display:flex}.hud-stats{align-items:center;gap:2px;min-width:0;display:flex}.hud-btns{pointer-events:auto;align-items:center;gap:8px;display:flex}.hud-icon{color:#e8e8f0;cursor:pointer;background:#141423d9;border:1px solid #ffffff2e;border-radius:8px;place-items:center;width:32px;height:32px;font-size:15px;display:grid}.hud-icon:active{transform:scale(.94)}.stat{flex-direction:column;align-items:center;min-width:40px;display:flex}.stat .label{opacity:.6;letter-spacing:1px;font-size:9px}.stat .value{font-size:15px;font-weight:700}.stat.hp .value{color:#ff6b6b}.stat.armor .value{color:#f6c86b}.stat.gold .value{color:#ffd56b}.stat.floor .value{color:#8effc8}.stat.turn .value{color:#ccc}.hud-emotion{pointer-events:none;flex:0 0 26px;align-items:center;height:26px;padding:0 10px;display:flex}.emotion-text{color:#b6f5d0;white-space:nowrap;text-overflow:ellipsis;min-width:0;font-size:11px;font-weight:600;overflow:hidden}#app{z-index:0;isolation:isolate;pointer-events:auto;background:#111722;border-top:1px solid #91a7c14d;border-bottom:1px solid #91a7c14d;flex:1 1 0;width:100%;min-height:0;position:relative;overflow:hidden}#app canvas{z-index:0;touch-action:none;width:100%;height:100%;display:block;position:absolute;inset:0}.detail-panel{z-index:46;pointer-events:none;max-height:40dvh;display:none;position:absolute;left:10px;right:10px}.detail-panel.show{display:block}.detail-panel.top{top:52px}.detail-panel.bottom{bottom:calc(var(--hud-bottom-height) + 8px)}.detail-card{background:#0f1423ed;border:1px solid #dce6ff59;border-radius:10px;padding:10px 12px;box-shadow:0 8px 24px #0000006b}.detail-type{color:#a6b7d4;letter-spacing:.08em;font-size:10px;font-weight:700}.detail-title{color:#f1f4ff;margin-top:2px;font-size:16px;font-weight:700}.detail-lines{color:#eef2ffd1;gap:3px;margin-top:7px;font-size:12px;line-height:1.35;display:grid}.card-actions{pointer-events:none;flex-wrap:wrap;gap:4px;min-height:31px;display:none}.card-actions.show{display:flex}.card-actions>button,.relic-skills button{cursor:pointer;pointer-events:auto;border:0;border-radius:7px;flex:1 1 0;min-width:46px;min-height:31px;padding:5px 6px;font-size:11px;font-weight:700;box-shadow:0 1px 5px #0000005c}.card-actions .act-drop{color:#fff;background:#dc4646e6}.card-actions .act-wait{color:#171827;background:#bcbcd2eb;font-size:16px;line-height:1}.card-actions .act-use{color:#102018;background:#6bff9eeb}.card-actions button:disabled{cursor:default;opacity:.38;pointer-events:none}.card-actions button:active{transform:scale(.95)}.relic-skills{display:none}.relic-skills.show{display:contents}.relic-skills button{color:#ecdfff;background:#2d1e48eb;border:1px solid #d2aaff8c}.relic-skills button:disabled{cursor:default;opacity:.48}.hud-settings{z-index:100;pointer-events:auto;background:#0a0a14e0;border:1px solid #ffffff14;border-radius:8px;padding:10px;display:none;position:absolute;top:48px;right:8px}.hud-settings.show{display:block}.settings-row{color:#e8e8f0;cursor:pointer;align-items:center;gap:8px;font-size:13px;display:flex}.settings-row input{accent-color:#6b9eff;width:16px;height:16px}.hud-log{pointer-events:auto;z-index:100;background:#0a0a14e0;border:1px solid #ffffff14;border-radius:8px;max-height:32dvh;padding:10px;font-size:12px;line-height:1.6;display:none;position:absolute;top:48px;left:8px;right:8px;overflow:hidden}.hud-log.show{display:block}.hud-log .log-head{align-items:center;margin-bottom:6px;display:flex}.hud-log .log-title{opacity:.8;font-size:12px;font-weight:700}.hud-log .log-body{max-height:24dvh;overflow-y:auto}.hud-log .line{border-bottom:1px solid #ffffff0a;padding:2px 0}.hud-log .line:last-child{border:0}.hud-bottom{pointer-events:none;background:linear-gradient(#0a0a1459,#0a0a14e6);flex-direction:column;flex:none;gap:4px;padding:6px 10px 9px;display:flex}.equip-row{align-items:center;gap:6px;display:flex}.equip-slot{cursor:pointer;color:#e8e8f0;pointer-events:auto;background:#0000004d;border:2px dashed #fff3;border-radius:8px;flex-direction:column;flex:1;justify-content:center;align-items:center;min-width:0;height:44px;padding:3px 5px;display:flex;box-shadow:inset 0 0 0 1px #ffffff14}.equip-slot.filled{background:#28325099;border-style:solid;border-color:#ffffff59}.equip-slot.occupied{cursor:default;opacity:.72;background:#2a263d85;border-style:solid;border-color:#a091cd80}.equip-slot.armed{background:#503c1499;border-color:#ffd56b;box-shadow:0 0 14px #ffd56b80}.equip-slot.target{border-color:#6bff9e;box-shadow:0 0 14px #6bff9e66}.equip-slot .nm{font-size:12px;font-weight:600}.equip-slot .sub{opacity:.72;font-size:9px}.backpack-panel{--relic-cell:clamp(18px, calc((100vw - (var(--hud-bag-cell) * 6 + 40px)) / 2), calc((var(--hud-bag-cell) * 4 + 6px) / 6));grid-template-columns:var(--relic-cell) minmax(0, 1fr) var(--relic-cell);align-items:center;gap:4px;min-width:0;display:grid}.hud-relics{width:var(--relic-cell);height:calc(var(--hud-bag-cell) * 4 + 6px);pointer-events:auto;grid-template-rows:repeat(6,minmax(0,1fr));display:grid}.relic-book{color:#e5d5ff;cursor:pointer;background:#64469652;border:1px solid #d2aaff8c;border-radius:5px;width:100%;height:100%;padding:0;font-size:clamp(11px,4vw,18px);line-height:1}.relic-slots{display:contents}.relic-slot{color:#e5d5ff;cursor:pointer;pointer-events:auto;background:#d2aaff1a;border:1px solid #d2aaff59;border-radius:5px;place-items:center;width:100%;height:100%;font-size:clamp(9px,3.2vw,15px);font-weight:700;display:grid}.relic-slot.active{background:#ffd56b21;border-color:#ffd56bcc}.relic-slot.empty{opacity:.35;border-style:dashed}.bag-rotate{width:var(--relic-cell);height:var(--relic-cell);color:#c8ffe2;cursor:pointer;pointer-events:auto;background:#193728eb;border:1px solid #82bea58c;border-radius:6px;padding:0;font-size:clamp(13px,5vw,19px);line-height:1}.bag-rotate:active{transform:rotate(90deg)}.backpack-grid{--bag-cell:var(--hud-bag-cell);grid-template-columns:repeat(var(--bag-columns), minmax(0, var(--bag-cell)));grid-template-rows:repeat(var(--bag-rows), var(--bag-cell));width:100%;height:calc(var(--bag-cell) * 4 + 6px);pointer-events:auto;justify-content:center;gap:2px;display:grid;position:relative}.bag-cell{z-index:0;cursor:pointer;background:#00000047;border:1px solid #ffffff1f;border-radius:3px;min-width:0;min-height:0;padding:0}.bag-item{z-index:1;color:#e8fff1;text-align:center;cursor:pointer;background:linear-gradient(135deg,#204d38fa,#142e24fa);border:1px solid #82bea5b3;border-radius:4px;min-width:0;min-height:0;padding:2px;position:relative;overflow:hidden;box-shadow:0 1px 4px #00000073}.bag-item.weapon{background:linear-gradient(135deg,#243c68fa,#18264afa);border-color:#80b0ffc2}.bag-item.potion{background:linear-gradient(135deg,#682238fa,#461629fa);border-color:#ff738ec2}.bag-item.armor{background:linear-gradient(135deg,#604a1efa,#3e2e12fa);border-color:#f6c86bc2}.bag-item.buff{background:linear-gradient(135deg,#532667fa,#351846fa);border-color:#ed91ffc2}.bag-item.whetstone{background:linear-gradient(135deg,#444c58fa,#2a2f39fa);border-color:#bac2cfc2}.bag-item.selected{z-index:2;border-color:#ffd56b;box-shadow:0 0 12px #ffd56bbd}.bag-shape{pointer-events:none;gap:1px;display:grid;position:absolute;inset:1px}.bag-shape span{border-radius:2px;min-width:0;min-height:0}.bag-shape .occupied{background:#ffffff14;justify-content:center;align-items:flex-start;display:flex;overflow:hidden}.bag-shape .void{background:0 0}.bag-shape b{text-overflow:ellipsis;white-space:nowrap;max-width:100%;padding:1px;font-size:clamp(8px,2.4vw,11px);line-height:1.08;overflow:hidden}.bag-details{pointer-events:none;position:absolute;bottom:2px;left:3px;right:3px;overflow:hidden}.bag-details small{opacity:.84;text-overflow:ellipsis;white-space:nowrap;font-size:clamp(8px,2.1vw,10px);line-height:1.15;display:block;overflow:hidden}.relic-collection-modal{z-index:55;pointer-events:auto;justify-content:center;align-items:center;padding:18px;display:none;position:fixed;inset:0}.relic-collection-modal.show{display:flex}.relic-modal-backdrop{background:#05050ca8;position:absolute;inset:0}.relic-modal-panel{background:#1c162ef7;border:1px solid #d2aaff7a;border-radius:12px;flex-direction:column;gap:10px;width:min(92vw,440px);max-height:74dvh;padding:14px;display:flex;position:relative;box-shadow:0 16px 42px #0000008c}.relic-modal-head{color:#e5d5ff;align-items:center;gap:8px;font-size:15px;font-weight:700;display:flex}.relic-modal-count{opacity:.65;font-size:10px;font-weight:400}.relic-modal-close{color:#ccc;cursor:pointer;background:0 0;border:0;margin-left:auto;font-size:22px;line-height:1}.relic-collection{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;padding:2px;display:grid;overflow-y:auto}.relic-collection-item{color:#e5d5ff;text-align:left;background:#d2aaff0f;border:1px solid #d2aaff47;border-radius:7px;min-width:0;padding:8px;font-size:11px}.relic-collection-item.active{border-color:#ffd56ba6}.relic-collection-item.inactive{opacity:.55}.relic-collection-item small,.relic-item-name,.relic-item-desc{display:block}.relic-item-name{font-weight:700}.relic-item-desc{color:#ffffffad;margin-top:5px;font-size:10px;line-height:1.35}.relic-choice{z-index:50;pointer-events:auto;background:#1e1630f5;border:1px solid #d2aaff80;border-radius:12px;padding:14px;display:none;position:absolute;inset:18% 8% auto}.relic-choice.show{display:block}.relic-choice-title{color:#e5d5ff;text-align:center;margin-bottom:12px;font-size:15px;font-weight:700}.relic-choice-row{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;display:grid}.relic-choice-card{color:#e5d5ff;cursor:pointer;background:#d2aaff14;border:1px solid #d2aaff61;border-radius:8px;min-width:0;padding:10px 7px}.relic-choice-card:active{transform:scale(.97)}.relic-choice-card .relic-name,.relic-choice-card .relic-desc{display:block}.relic-choice-card .relic-name{font-size:13px;font-weight:700}.relic-choice-card .relic-desc{color:#ffffffb8;margin-top:6px;font-size:11px;line-height:1.35}.room-reward{z-index:55}.reward-skip{color:#ffffffad;cursor:pointer;background:0 0;border:1px solid #ffffff38;border-radius:7px;margin:10px auto 0;padding:5px 14px;display:block}.hud-rest{inset:70px 0 var(--hud-bottom-height);z-index:40;pointer-events:none;justify-content:center;align-items:center;padding:10px 14px;display:none;position:absolute}.hud-rest.show{display:flex}.merchant-panel{pointer-events:auto;background:#14182af0;border:1px solid #ffd56b6b;border-radius:12px;flex-direction:column;gap:10px;width:min(100%,420px);max-height:100%;padding:14px;display:flex;box-shadow:0 16px 42px #0000008c}.merchant-head{color:#ffd56b;align-items:center;gap:10px;font-size:16px;font-weight:700;display:flex}.merchant-head button{color:#e8e8f0;cursor:pointer;background:#ffffff14;border:1px solid #ffffff38;border-radius:7px;margin-left:auto;padding:6px 12px}.merchant-stock{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;display:grid}.merchant-stock:empty{display:none}.merchant-stock-item,.merchant-relic-item,.merchant-trade button{color:#e8e8f0;text-align:left;cursor:pointer;background:#2d3752b3;border:1px solid #ffffff3d;border-radius:7px;min-width:0;padding:8px}.merchant-stock-item b,.merchant-stock-item small,.merchant-relic-item b,.merchant-relic-item small{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.merchant-stock-item b,.merchant-relic-item b{font-size:12px}.merchant-stock-item small,.merchant-relic-item small{color:#ffd56b;margin-top:4px;font-size:10px}.merchant-trade{gap:7px;display:flex}.merchant-trade button{text-align:center;flex:1;padding:7px}.merchant-trade button:disabled,.relic-choice-card:disabled{cursor:default;opacity:.42}.merchant-relics:empty{display:none}.merchant-relic-title{color:#e5d5ff;margin:2px 0 6px;font-size:12px;font-weight:700}.merchant-relics{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;display:grid}.merchant-relic-title{grid-column:1/-1}.merchant-relic-item.active{border-color:#ffd56bb8}.merchant-relic-item.inactive{opacity:.58}.hud-over{z-index:80;pointer-events:auto;background:#000000b3;flex-direction:column;justify-content:center;align-items:center;gap:18px;display:none;position:absolute;inset:0}.hud-over.show{display:flex}.hud-over h1{font-size:30px}.hud-over.win h1{color:#8effc8}.hud-over.lose{background:#231119f5;border:1px solid #ff6b6b73;border-radius:12px;min-height:174px;padding:16px;inset:86px 18px auto;box-shadow:0 12px 32px #00000073}.hud-over.lose h1{color:#ff6b6b;margin:0;font-size:24px}.hud-over.lose p{margin:0}.hud-over p{text-align:center;opacity:.7;max-width:420px;padding:0 16px;font-size:13px}.hud-over button{color:#1a1a2e;cursor:pointer;background:#ffd56b;border:0;border-radius:8px;padding:9px 22px;font-size:14px;font-weight:700}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-thumb{background:#fff3;border-radius:3px}@media (width<=340px){.stat{min-width:34px}.stat .value{font-size:13px}.hud-btns{gap:4px}.hud-icon{width:29px;height:29px}.card-actions{gap:3px}.card-actions>button,.relic-skills button{min-width:42px;padding-inline:3px}}
