body.imperial-world-mode #hud,body.imperial-world-mode #gtabs,body.imperial-world-mode #eventBanner{display:none!important}
body.imperial-world-mode #body{flex:1;min-height:0}
body.imperial-world-mode #sc-rogue{padding:0!important;overflow:hidden!important;background:#171819!important}
body.imperial-world-mode #rogueContent{width:100%;height:100%;max-width:none;margin:0;color:#f5f1e7;font:14px/1.4 system-ui,-apple-system,sans-serif}
#rogueContent *{box-sizing:border-box}
.iw-shell{height:100%;min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr) auto;background:#121518}
.iw-hud{z-index:3;display:flex;align-items:center;gap:18px;min-height:82px;padding:calc(10px + env(safe-area-inset-top)) 22px 12px;background:linear-gradient(180deg,#11191f,#19232a);border-bottom:1px solid #b9a77a55;box-shadow:0 6px 20px #0008}
.iw-title{display:grid;gap:1px;min-width:170px}.iw-title small{color:#d6b77e;font-size:10px;font-weight:800;letter-spacing:.18em}.iw-title strong{font:26px Georgia,serif;color:#f6ecdb}.iw-title>span{color:#a9bbc5;font-size:11px}
.iw-vitals{min-width:205px;display:flex;align-items:center;gap:15px;margin-left:auto}.iw-health{width:150px}.iw-health b{display:block;margin-bottom:5px;color:#f8d5c9;font-size:13px}.iw-health i{display:block;height:8px;background:#351f24;border:1px solid #ae7271;border-radius:20px;overflow:hidden}.iw-health i span{display:block;width:100%;height:100%;background:linear-gradient(90deg,#b84c60,#f69b8a);transition:width .2s}.iw-materials{display:flex;gap:9px;color:#e4d7b9;font-size:13px;white-space:nowrap}.iw-materials b{color:white}
.iw-nav{display:flex;gap:6px}.iw-nav button{width:42px;height:42px;border-radius:11px;background:#30404a;border:1px solid #8da5ae66;color:#f9e6bc;font-size:23px;transition:background .15s,transform .15s}.iw-nav button:hover{background:#4b6170}.iw-nav button:active{transform:scale(.94)}
.iw-view{position:relative;min-height:0;overflow:hidden;background:#2c2c2e}.iw-view canvas{display:block;width:100%;height:100%;touch-action:none;cursor:crosshair}.iw-context{position:absolute;top:13px;left:50%;transform:translateX(-50%);max-width:calc(100% - 24px);padding:6px 13px;border:1px solid #dde2dd66;border-radius:30px;background:#0b1117dc;color:#f1ece2;font-size:12px;font-weight:700;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:none;box-shadow:0 4px 15px #0007}.iw-interact{position:absolute;bottom:16px;left:50%;transform:translateX(-50%);max-width:calc(100% - 20px);min-height:43px;padding:8px 20px;border-radius:12px;border:1px solid #f2cc86;background:linear-gradient(135deg,#9b773e,#51452e);color:#fff2d3;font-weight:800;white-space:nowrap;box-shadow:0 8px 25px #0009}.iw-interact[hidden],.iw-panel[hidden]{display:none!important}
.iw-help{position:absolute;top:52px;left:14px;z-index:2;display:grid;gap:4px;max-width:min(270px,calc(100% - 28px));padding:10px 12px;border:1px solid #8bcfe188;border-radius:12px;background:#0d1b25d9;color:#e3f6fb;font-size:12px;line-height:1.28;pointer-events:none;box-shadow:0 6px 20px #0008}.iw-help b{color:#9cecff;font-size:11px;letter-spacing:.08em;text-transform:uppercase}
.iw-actions{z-index:3;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;min-height:85px;padding:9px 16px calc(10px + env(safe-area-inset-bottom));background:linear-gradient(180deg,#19252c,#0d151b);border-top:1px solid #b9a77a55;box-shadow:0 -8px 24px #0008}.iw-actions button{position:relative;min-width:0;border:1px solid #9eb2b366;border-radius:13px;background:linear-gradient(150deg,#36505b,#24343d);color:#f7ead6;display:flex;align-items:center;justify-content:center;gap:10px;font-weight:800;white-space:nowrap;transition:transform .12s,background .12s}.iw-actions button:first-child{background:linear-gradient(150deg,#87623f,#4e3c30);border-color:#dfb979}.iw-actions button:nth-child(2){background:linear-gradient(150deg,#315d69,#263a55);border-color:#87c8db}.iw-actions button:nth-child(4){background:linear-gradient(150deg,#37674f,#264a3c);border-color:#8ac9a5}.iw-actions button b{font:30px Georgia,serif;line-height:1}.iw-actions button span{font-size:13px;overflow:hidden;text-overflow:ellipsis}.iw-actions button:active{transform:scale(.96)}.iw-actions button:disabled{opacity:.55;filter:grayscale(.55)}.iw-actions button:disabled:after{content:attr(data-cool);position:absolute;right:7px;top:3px;font-size:10px;color:white}
.iw-panel{position:absolute;inset:0;z-index:5;display:grid;place-items:center;overflow:auto;padding:20px;background:#050a0ddc;backdrop-filter:blur(9px)}.iw-dialog{position:relative;width:min(100%,620px);max-height:100%;overflow:auto;padding:24px;border-radius:19px;border:1px solid #ceb47f88;background:radial-gradient(ellipse at top,#29404b,#17242d 60%,#101a23);box-shadow:0 25px 70px #000c}.iw-dialog>small{color:#ddb978;font-size:10px;letter-spacing:.17em;font-weight:800}.iw-dialog h2{margin:8px 0;font:32px Georgia,serif;color:#f8e9ca}.iw-dialog p{color:#d0dce0}.iw-close{position:absolute;top:12px;right:12px;width:40px;height:40px;border-radius:50%;background:#30444c;color:white;font-size:25px}.iw-skill-list{display:grid;gap:9px;margin-top:22px}.iw-skill-list button{display:flex;align-items:center;text-align:left;gap:13px;min-height:78px;padding:11px;border-radius:12px;background:#223540;border:1px solid #879c9c66;color:#f7edd9}.iw-skill-list button:hover:not(:disabled){background:#38535f}.iw-skill-list button:disabled{opacity:.55}.iw-skill-list button>span:nth-child(2){flex:1}.iw-skill-list b,.iw-skill-list small{display:block}.iw-skill-list b{font-size:16px}.iw-skill-list small{font-size:11px;color:#bccdd0}.iw-skill-list em{font-style:normal;color:#f4d39a;font-size:11px;font-weight:800}.iw-skill-glyph{width:48px;height:48px;flex:none;display:grid;place-items:center;border-radius:10px;background:#654e35;color:#ffe3ac;font-size:29px}.iw-skill-glyph.survival{background:#386351;color:#bfffd9}.iw-skill-glyph.focus{background:#315771;color:#b8e6ff}.iw-map-legend{display:flex;gap:15px;flex-wrap:wrap;color:#dbebef}
@media(max-width:680px){.iw-hud{min-height:96px;padding:calc(6px + env(safe-area-inset-top)) 9px 7px;gap:7px;flex-wrap:wrap}.iw-title{min-width:0;flex:1}.iw-title small{font-size:8px}.iw-title strong{font-size:17px}.iw-title>span{font-size:9px}.iw-vitals{order:3;width:100%;margin:0;justify-content:space-between;min-width:0}.iw-health{width:42%}.iw-health b{font-size:11px;margin-bottom:3px}.iw-materials{font-size:10px}.iw-nav{gap:3px}.iw-nav button{width:35px;height:35px;font-size:19px;border-radius:8px}.iw-context{font-size:10px;top:7px;max-width:calc(100% - 12px);padding:5px 8px}.iw-interact{font-size:11px;bottom:7px;min-height:36px}.iw-actions{gap:4px;min-height:80px;padding:5px 5px calc(7px + env(safe-area-inset-bottom))}.iw-actions button{display:flex;flex-direction:column;gap:0;padding:2px;border-radius:8px}.iw-actions button b{font-size:23px}.iw-actions button span{font-size:9px;line-height:1.15;max-width:100%}.iw-dialog{padding:19px}.iw-dialog h2{font-size:25px}.iw-skill-list button{min-height:72px;padding:7px;gap:8px}.iw-skill-glyph{width:39px;height:39px;font-size:22px}.iw-skill-list b{font-size:13px}.iw-skill-list small{font-size:10px}}
@media(prefers-reduced-motion:reduce){.iw-shell *{transition:none!important;animation:none!important}}
@media(max-width:680px){.iw-help{top:41px;left:7px;max-width:210px;padding:8px 9px;font-size:10px;gap:3px}.iw-help b{font-size:10px}}
.iw-zoom{position:absolute;right:12px;bottom:65px;z-index:3;display:flex;align-items:center;border:1px solid #b4c0ca88;border-radius:12px;overflow:hidden;background:#172630ee;box-shadow:0 4px 15px #0005}.iw-zoom button{min-width:42px;height:40px;padding:0 9px;background:transparent;border:0;color:#f6ecd7;font-size:22px;cursor:pointer}.iw-zoom button:nth-child(2){font-size:12px;font-weight:800;border-inline:1px solid #b4c0ca44;min-width:62px}.iw-zoom button:active{background:#456070}.iw-terrain{position:absolute;bottom:12px;left:12px;pointer-events:none;font-size:11px;font-weight:700;color:#f3eddc;text-shadow:0 1px 4px #000;background:#172630cc;border-radius:8px;padding:5px 9px}.iw-interact{bottom:65px}.iw-help{max-width:220px}
@media(max-width:680px){.iw-zoom{right:7px;bottom:52px}.iw-zoom button{min-width:35px;height:36px}.iw-zoom button:nth-child(2){min-width:54px}.iw-terrain{bottom:8px;left:7px;font-size:9px}.iw-interact{bottom:96px}}
.iw-binding-list{display:grid;gap:7px;margin:16px 0}.iw-binding-list>div{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 10px;border:1px solid #839aaa44;border-radius:10px;background:#1b303b}.iw-binding-list button,.iw-bind-reset{min-height:36px;padding:7px 15px;border:1px solid #adc6d077;border-radius:8px;background:#365462;color:#fff0cf;font-weight:700}.iw-binding-list button{min-width:110px}.iw-binding-list button.listening{background:#756039;border-color:#ffe0a0}.iw-bind-reset{width:100%}.iw-view canvas:focus{outline:none}.iw-view canvas:focus-visible{outline:2px solid #b2e4ee;outline-offset:-2px}

.iw-map-dialog{width:min(100%,860px)}#iwOverview{width:100%;height:auto!important;aspect-ratio:16/9;border:1px solid #b5c3d988;border-radius:12px;margin-top:16px;touch-action:manipulation;cursor:crosshair}.iw-elements{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:16px}.iw-elements button{padding:12px 9px;background:#182832;border:1px solid #9eb4c455;border-radius:12px;color:var(--element);text-align:left;min-height:86px}.iw-elements button[aria-pressed="true"]{border-color:var(--element);box-shadow:inset 0 0 18px #bfd4df18}.iw-elements b,.iw-elements small{display:block}.iw-elements small{margin-top:5px;font-size:11px;line-height:1.35;color:#c7d6df}@media(max-width:480px){.iw-elements{grid-template-columns:1fr}.iw-elements button{min-height:60px;padding:9px}.iw-map-legend{font-size:11px;gap:8px}}

.iw-bestiary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:16px}.iw-bestiary article{display:flex;gap:10px;padding:12px;border:1px solid #9bb7c355;border-radius:13px;background:#152933}.iw-bestiary img{width:78px;height:95px;object-fit:contain;align-self:center}.iw-bestiary b{display:block;color:#f3dfb6}.iw-bestiary small{display:block;font-size:11px;color:#9cd7e0;margin-top:5px}.iw-bestiary p{font-size:12px;line-height:1.4;margin:7px 0}.iw-nav button{width:38px}@media(max-width:680px){.iw-bestiary{grid-template-columns:1fr}.iw-nav button{width:31px}.iw-bestiary img{width:65px}}
/* Moon colony panels: illustrated header, warm trim, and compact item slots. */
.iw-rich{background:radial-gradient(ellipse at 20% 0,#40585c,#1b2d36 48%,#15232d);border:1px solid #d6bd8b;box-shadow:inset 0 0 0 5px #c6aa7130,0 25px 70px #000b}.iw-wide{width:min(100%,930px)}.iw-rich button:not(.iw-close){border:1px solid #bba16b80;border-radius:10px;padding:10px 13px;background:linear-gradient(135deg,#655b3f,#33433e);color:#fff0cb;font-weight:700;cursor:pointer}.iw-rich button:disabled{opacity:.43;cursor:default}.iw-rich h3{font:22px Georgia,serif;color:#e8d1a5;margin:17px 0 10px}.iw-currencies{display:flex;flex-wrap:wrap;gap:9px}.iw-currencies span{padding:8px 12px;background:#0e202a;border:1px solid #bda17455;border-radius:9px;color:#e6d2a2}.iw-equipment{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:18px 0}.iw-equipment>div{padding:12px 9px;border:1px solid #b8d5de44;border-radius:10px;background:#203b46}.iw-equipment small,.iw-equipment b{display:block}.iw-equipment small{color:#8dcbd1;font-size:10px;margin-bottom:4px}.iw-equipment b{font-size:12px;color:#f2dfb7}.iw-item-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.iw-item-grid article{display:grid;gap:6px;text-align:center;padding:12px 8px;min-height:170px;border:1px solid #d6b68466;border-radius:13px;background:radial-gradient(ellipse at top,#34515b,#192c35)}.iw-item-grid article.equipped{border-color:#a8dfb8;box-shadow:0 0 13px #8ad0ab30}.iw-item-icon{font:40px Georgia,serif;color:#f0d59a;text-shadow:0 2px 8px #0007}.iw-item-grid b{font-size:12px;color:#f7e2bc}.iw-item-grid small{font-size:10px;color:#b5ccd1}.iw-structure-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:18px 0}.iw-structure-grid article{display:flex;gap:13px;align-items:center;padding:13px;background:#1b323d;border:1px solid #c8b18666;border-radius:14px}.iw-structure-grid img{width:115px;height:115px;object-fit:contain}.iw-structure-grid b{display:block;font:19px Georgia,serif;color:#f4d9a3}.iw-structure-grid p{font-size:12px;margin:7px 0}.iw-structure-grid small{display:block;font-size:11px;color:#a5d4da;margin:8px 0}.iw-rich .short{color:#f4a899}.iw-building-hero{display:flex;align-items:center;gap:23px;min-height:220px;margin:15px -5px;padding:20px;border:1px solid #b7d1d355;border-radius:16px;background:radial-gradient(ellipse at left,#71839755,#203643)}.iw-building-hero>img{width:48%;height:200px;object-fit:contain;filter:drop-shadow(0 9px 10px #0005)}.iw-building-hero p{font:17px/1.5 Georgia,serif;color:#efe1c6}.iw-building-hero small{color:#acd0d3}.iw-seal{display:inline-grid;place-items:center;width:54px;height:54px;border:1px solid #d6bc87;border-radius:50%;background:#605640;color:#ffe0a3;font:31px Georgia,serif}.iw-building-actions{display:flex;gap:10px;flex-wrap:wrap}.iw-building-actions p{width:100%}.iw-craft-list{display:grid;gap:8px}.iw-craft-list>div{display:grid;grid-template-columns:1fr 1.3fr auto;align-items:center;gap:9px;padding:10px;border:1px solid #a1bac244;border-radius:10px;background:#213b44}.iw-craft-list b{font-size:12px;color:#ecdab5}.iw-craft-list small{font-size:10px;color:#aad0d0}.iw-tree-summary{padding:11px 14px;border:1px solid #b5c5ba55;border-radius:10px;background:#122b34;color:#d2e7dc;font-size:12px}.iw-tree-scroll{max-height:60vh;overflow:auto;margin:15px -7px;border:1px solid #a3c0c055;border-radius:14px;background:radial-gradient(ellipse at 50% 15%,#38606955,#10212ddf);touch-action:pan-x pan-y}.iw-tree{position:relative;width:780px;height:1020px;margin:auto}.iw-tree>svg{position:absolute;inset:0;width:780px;height:1020px;pointer-events:none}.iw-tree path{fill:none;stroke:#7c8d8880;stroke-width:4}.iw-tree path.lit{stroke:#c8d4a0;filter:drop-shadow(0 0 4px #a7d9b9)}.iw-tree h3{position:absolute;width:260px;text-align:center;top:0;font:19px Georgia,serif}.iw-rich .iw-node{position:absolute;width:220px;height:94px;display:grid;grid-template-columns:45px 1fr;align-items:center;gap:2px 8px;padding:10px;text-align:left;background:#1c303b;border:1px solid var(--node);box-shadow:inset 0 0 13px #aac9c510}.iw-node span{grid-row:1/3;display:grid;place-items:center;width:45px;height:45px;border:2px solid var(--node);border-radius:50%;font:27px Georgia,serif;color:var(--node);background:#3c4c4e}.iw-node b{font-size:12px;color:#f3e0bd}.iw-node small{font-size:10px;color:#bcd6d7}.iw-node.learned{box-shadow:0 0 17px #d3e6a838}.iw-node.locked{filter:grayscale(.7)}.iw-story{padding:17px;border:1px solid #dfc38c66;border-radius:12px;background:linear-gradient(120deg,#62564455,#1b303b)}.iw-story>small{color:#e5c98f;letter-spacing:.09em;font-size:10px}.iw-story p{font:18px/1.6 Georgia,serif}.iw-quest-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:16px 0}.iw-quest-list article{padding:14px;border:1px solid #b5c3b855;border-radius:12px;background:#1b3440}.iw-quest-list article.done{opacity:.62}.iw-quest-list small{display:block;color:#a6d5c4;font-size:10px;margin-bottom:5px}.iw-quest-list b{font:20px Georgia,serif;color:#e8d3a8}.iw-quest-list p{font-size:12px;line-height:1.45}.iw-tutorial{position:absolute;right:12px;top:55px;z-index:2;max-width:310px;padding:9px 13px;border:1px solid #d4bc8277;border-radius:12px;background:#172c35e8;color:#efd7a0;font-size:11px;text-align:left;box-shadow:0 4px 12px #0004}.iw-tutorial[hidden],.iw-build-cancel[hidden]{display:none!important}.iw-build-cancel{position:absolute;left:50%;bottom:18px;transform:translateX(-50%);z-index:3;border:1px solid #ecb99c;border-radius:10px;background:#533e36;color:#ffe4cf;padding:10px 18px}.iw-map-controls{display:flex;gap:7px;flex-wrap:wrap;margin:10px 0}.iw-map-controls button{padding:7px 12px;border:1px solid #b9c9c855;border-radius:8px;background:#2e4b57;color:#f7e5bc;cursor:pointer}
@media(max-width:680px){.iw-nav{display:grid;grid-template-columns:repeat(4,31px);gap:3px}.iw-title{max-width:calc(100% - 139px)}.iw-rich{padding:19px 14px}.iw-item-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.iw-equipment{grid-template-columns:repeat(2,minmax(0,1fr))}.iw-structure-grid{grid-template-columns:1fr}.iw-structure-grid img{width:95px;height:105px}.iw-structure-grid article{gap:10px}.iw-building-hero{gap:10px;padding:12px;min-height:175px}.iw-building-hero>img{height:150px}.iw-building-hero p{font-size:14px}.iw-craft-list>div{grid-template-columns:1fr auto}.iw-craft-list small{grid-column:1/-1}.iw-quest-list{grid-template-columns:1fr}.iw-story p{font-size:16px}.iw-tutorial{top:auto;bottom:52px;left:7px;right:auto;max-width:210px;font-size:10px;padding:7px 9px}.iw-help{max-width:180px}.iw-map-controls button{padding:6px 9px;font-size:11px}.iw-tree-scroll{max-height:55vh}}

.iw-tree{width:960px;height:760px}.iw-tree>svg{width:960px;height:760px}.iw-tree h3{width:320px}.iw-rich .iw-node{width:134px;height:101px;display:flex;flex-direction:column;justify-content:center;gap:5px;text-align:center;padding:8px 5px}.iw-node span{width:33px;height:33px;font-size:20px;flex-shrink:0}.iw-node b{font-size:11px;line-height:1.15}.iw-node small{font-size:9px;line-height:1.15}.iw-tree path{stroke-width:3}

.iw-dialog,.iw-tree-scroll{scrollbar-width:thin;scrollbar-color:#809790 #1a2d35}.iw-dialog::-webkit-scrollbar,.iw-tree-scroll::-webkit-scrollbar{width:7px;height:7px}.iw-dialog::-webkit-scrollbar-thumb,.iw-tree-scroll::-webkit-scrollbar-thumb{background:#809790;border-radius:8px}.iw-dialog::-webkit-scrollbar-track,.iw-tree-scroll::-webkit-scrollbar-track{background:#1a2d35}@media(min-width:1050px){.iw-wide:has(.iw-tree){width:min(100%,1030px)}}

.iw-nav{display:flex;flex-wrap:nowrap;max-width:100%;overflow-x:auto;flex-shrink:1;scrollbar-width:thin}.iw-nav button{flex-shrink:0}.iw-structure-grid article>div>button{display:block;margin-top:7px;width:100%}@media(max-width:680px){.iw-nav{width:100%;order:4}.iw-vitals{order:3}.iw-hud{min-height:135px}}

.iw-nav button{background:radial-gradient(ellipse at 30% 15%,#60777a55,transparent 65%),linear-gradient(150deg,#344952,#1b2a36);border:1px solid #b8ac7e88;box-shadow:inset 0 1px #fff2,0 3px 8px #0004;color:#eed5a2}.iw-nav svg{width:24px;height:24px;filter:drop-shadow(0 1px 2px #0008);vertical-align:middle}.iw-nav button:hover{color:#b1f3ee;border-color:#a2e7dd}.iw-dungeon-exit{position:absolute;left:12px;bottom:60px;z-index:3;border:1px solid #d0b879;border-radius:12px;background:#253744;color:#f7dfaf;padding:12px}.iw-resident-row{flex-wrap:wrap}.iw-resident-row>b{width:100%}.iw-resident-row button{font-size:12px}@media(max-width:680px){.iw-nav svg{width:21px;height:21px}.iw-dungeon-exit{font-size:11px;bottom:90px}}

#iwHelp[hidden],#iwDungeonExit[hidden]{display:none!important}

/* Keep scrolling inside overlays instead of chaining to browser navigation. */
.iw-panel{overflow:hidden;min-height:0;touch-action:pan-x pan-y;overscroll-behavior:none}.iw-dialog{min-height:0;max-height:100%;overscroll-behavior:contain;touch-action:pan-x pan-y;-webkit-overflow-scrolling:touch}.iw-tree-scroll,.iw-nav{overscroll-behavior:contain}#heroCreator,.hero-creator-panel,.hero-class-grid{overscroll-behavior:contain;touch-action:pan-x pan-y}

.iw-techniques-button{position:absolute;right:12px;bottom:115px;z-index:3;padding:10px 15px;border:1px solid #d9bd86;border-radius:12px;background:#263e48;color:#ffe9b8;font-weight:700}.iw-moves-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.iw-moves-grid button{text-align:left;display:grid;gap:6px}.iw-moves-grid kbd{color:#7ce2e9;font:700 17px system-ui}.iw-moves-grid small{font-size:11px;color:#bdd4d8}@media(max-width:480px){.iw-moves-grid{grid-template-columns:1fr}}

.iw-level-story{position:absolute;left:12px;top:57px;z-index:3;max-width:calc(100% - 24px);font-size:11px;padding:8px 12px;border:1px solid #c5b99177;border-radius:10px;background:#162e37dd;color:#f2dfb9}.iw-level-story[hidden]{display:none!important}

.iw-aim-button{position:absolute;right:12px;bottom:160px;z-index:5;padding:10px 14px;border:1px solid #6b92a1;border-radius:12px;background:#182b39e8;color:#efe4c6;cursor:pointer}.iw-aim-button[aria-pressed=true]{border-color:#8de8ee;box-shadow:0 0 15px #76d4df35}

.iw-dialog>.iw-close{position:sticky;top:0;float:right;margin:-8px -8px -32px 8px;z-index:12;box-shadow:0 3px 12px #0006}
.iw-debug label{display:grid;gap:6px;color:#e5d5b6;font-size:12px;font-weight:700}.iw-debug input,.iw-debug select{width:100%;min-height:42px;border:1px solid #b5c9c080;border-radius:9px;padding:8px 11px;background:#122630;color:#f7eddb;font:15px system-ui}.iw-debug-grant{display:grid;grid-template-columns:minmax(180px,1fr) minmax(110px,180px) auto;gap:10px;align-items:end;margin:17px 0}.iw-debug-help{display:flex;gap:7px;flex-wrap:wrap;margin:16px 0}.iw-debug-help code{padding:6px 9px;border:1px solid #a4cdc055;border-radius:7px;background:#122b33;color:#aee0d6}.iw-debug p{overflow-wrap:anywhere}@media(max-width:680px){.iw-debug-grant{grid-template-columns:1fr 1fr}.iw-debug-grant label:first-child{grid-column:1/-1}.iw-debug-grant button{grid-column:1/-1}}
.iw-inventory-tools{display:grid;gap:10px;margin:14px 0 18px}.iw-inventory-tabs,.iw-inventory-sort{display:flex;flex-wrap:wrap;gap:6px;align-items:center}.iw-inventory-sort span{color:#b2cbd0;font-size:11px;margin-right:5px}.iw-rich .iw-inventory-tools button{padding:7px 10px;border-radius:999px;background:#1b3841;border-color:#91b8ba66;color:#d5e8e3;font-size:11px}.iw-rich .iw-inventory-tools button.active{background:#c5a76f;color:#172a31;border-color:#efd6a5}.iw-item-grid .iw-inventory-card{min-height:190px;display:flex;flex-direction:column;align-items:center;gap:5px;padding:13px 9px;background:radial-gradient(ellipse at 50% 2%,#47666d,#1c313a 60%,#17252f);box-shadow:inset 0 1px #fff2,0 8px 19px #06131a44}.iw-inventory-card .iw-item-icon{display:grid;place-items:center;width:58px;height:58px;border:1px solid #b5c9bf88;border-radius:15px;background:linear-gradient(145deg,#53717b88,#20343f);box-shadow:inset 0 1px #fff5,0 5px 13px #07182188}.iw-inventory-card .iw-item-icon svg{width:38px;height:38px;filter:drop-shadow(0 0 6px currentColor)}.iw-inventory-card .iw-item-type{color:#9ed2d3;text-transform:uppercase;letter-spacing:.08em}.iw-inventory-card .iw-item-quantity{font:700 17px system-ui;color:#f3ddb0;font-variant-numeric:tabular-nums}.iw-rich .iw-inventory-card button{width:100%;padding:6px 7px;font-size:10px;margin-top:auto}.iw-rich .iw-inventory-card button+button{margin-top:3px}.iw-inventory-empty{grid-column:1/-1;text-align:center;padding:32px 12px;color:#b8cdd0;background:#1a303a;border:1px dashed #9bbab066;border-radius:13px}.iw-cost-help{cursor:help;text-decoration:underline dotted;text-underline-offset:3px}.iw-resource-detail{display:flex;align-items:center;gap:16px;padding:17px;border:1px solid #a5c9c566;border-radius:14px;background:radial-gradient(ellipse at 20% 0,#466a73,#1b303a)}.iw-resource-icon{display:grid;place-items:center;width:80px;height:80px;border-radius:17px;border:1px solid #e2c78b99;background:#213d48}.iw-resource-icon svg{width:58px;height:58px}.iw-resource-detail small,.iw-resource-detail strong{display:block}.iw-resource-detail small{color:#a4d3d5}.iw-resource-detail strong{font-size:21px;color:#f7e3b8}.iw-resource-detail+p{line-height:1.6}@media(max-width:680px){.iw-item-grid .iw-inventory-card{min-height:186px}.iw-inventory-card .iw-item-icon{width:48px;height:48px}.iw-inventory-card .iw-item-icon svg{width:33px;height:33px}}

.iw-inventory-card .iw-item-icon img{width:52px;height:52px;object-fit:contain;filter:drop-shadow(0 3px 4px #020b1288)}.iw-resource-icon img{width:74px;height:74px;object-fit:contain}.iw-item-icon img{display:block;max-width:100%;max-height:100%}

.iw-inventory-card{content-visibility:auto;contain-intrinsic-size:190px 145px}

.iw-upgrade{margin-top:18px;padding:14px 16px;border:1px solid #c9b38688;border-radius:15px;background:linear-gradient(135deg,#3c4a59,#26353e);box-shadow:inset 0 1px #fff2}.iw-upgrade h3{margin:0 0 8px;color:#f3d5a0}.iw-upgrade p{font-size:12px;line-height:1.5}.iw-upgrade button{margin-top:8px;padding:9px 14px;border-radius:10px;background:#d0a766;color:#192b31;font-weight:700}.iw-upgrade button:disabled{opacity:.5}
/* The HUD and canvas must not make the game grid wider than a narrow phone. */
.iw-shell{min-width:0;max-width:100%;grid-template-columns:minmax(0,1fr);overflow:hidden}
.iw-hud,.iw-view,.iw-actions{min-width:0;max-width:100%}
.iw-panel{width:100%;max-width:100%;min-width:0}
.iw-panel>.iw-dialog{max-width:100%;min-width:0}
@media(max-width:680px){.iw-nav{min-width:0}.iw-materials{min-width:0;overflow:hidden}.iw-dialog{overflow-x:hidden}.iw-craft-list>div{min-width:0}.iw-craft-list button{min-width:0;overflow-wrap:anywhere}}
.iw-craft-list b svg{width:28px;height:28px;vertical-align:middle;margin-right:6px}
/* Keep the world gesture-only while preserving scrolling in dialogs and navigation. */
.iw-view,.iw-actions,.iw-actions button,.iw-zoom button,.iw-interact{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.iw-room-build{position:absolute;z-index:4;left:50%;bottom:16px;transform:translateX(-50%);display:flex;align-items:center;gap:7px;max-width:calc(100% - 20px);padding:5px;border:1px solid #6e8994;border-radius:13px;background:#17232de8;box-shadow:0 7px 25px #0009;touch-action:manipulation}.iw-room-build[hidden],.iw-room-build [hidden]{display:none!important}.iw-room-build-main,.iw-room-build button{border:1px solid #6a9da9;border-radius:9px;background:#263b49;color:#ecfaff;font-weight:750;cursor:pointer}.iw-room-build-main{min-width:88px;min-height:42px}.iw-room-build #iwRoomTools{display:flex;gap:4px;align-items:center;overflow-x:auto;max-width:min(640px,calc(100vw - 115px))}.iw-room-build #iwRoomTools button{display:flex;flex-direction:column;justify-content:center;align-items:center;min-width:62px;height:52px;padding:2px 4px;font-size:10px;white-space:nowrap}.iw-room-build #iwRoomTools button:nth-last-child(-n+3){min-width:42px;font-size:24px}.iw-room-build #iwRoomTools img{width:32px;height:32px;object-fit:contain}.iw-room-build #iwRoomTools button.selected{outline:2px solid #85eaf2;background:#345668}.iw-machine-operation{display:flex;align-items:center;gap:16px}.iw-machine-operation img{width:110px;height:110px;object-fit:contain}.iw-machine-operation p{margin:5px 0}@media(max-width:680px){.iw-room-build{bottom:5px}.iw-room-build-main{min-width:66px;font-size:10px}.iw-room-build #iwRoomTools{max-width:calc(100vw - 91px)}.iw-room-build #iwRoomTools button{min-width:52px;height:48px;font-size:9px}.iw-room-build #iwRoomTools img{width:28px;height:28px}}
.iw-view canvas{touch-action:none}
.iw-panel,.iw-dialog,.iw-nav{touch-action:pan-x pan-y}
@media(max-height:500px) and (pointer:coarse){
  .iw-hud{min-height:0;height:58px;padding:3px max(7px,env(safe-area-inset-right)) 3px max(7px,env(safe-area-inset-left));gap:7px;flex-wrap:nowrap}
  .iw-title{min-width:105px;max-width:115px;gap:0}.iw-title small{font-size:7px;letter-spacing:.06em}.iw-title strong{font-size:15px}.iw-title>span{font-size:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .iw-vitals{order:0;min-width:110px;width:110px;display:block;margin:0;flex:none}.iw-health{width:100%}.iw-health b{font-size:9px;margin-bottom:1px}.iw-health i{height:5px}.iw-materials{display:none}
  .iw-nav{order:0;width:auto;min-width:0;max-width:none;flex:1;overflow-x:auto;gap:3px;scrollbar-width:none}.iw-nav button{width:34px;height:34px;min-width:34px;font-size:17px}
  .iw-actions{min-height:0;height:53px;padding:3px max(5px,env(safe-area-inset-right)) 3px max(5px,env(safe-area-inset-left));gap:4px}.iw-actions button{flex-direction:row;gap:5px}.iw-actions button b{font-size:21px}.iw-actions button span{font-size:10px}
  .iw-help{display:none}.iw-context{top:4px;font-size:9px;padding:3px 7px}.iw-zoom{bottom:31px;right:5px}.iw-zoom button{height:28px;min-width:30px;font-size:17px}.iw-interact{bottom:32px;min-height:29px;padding:4px 9px;font-size:10px}.iw-terrain{font-size:8px;bottom:3px}
  .iw-panel{padding:5px}.iw-dialog{padding:12px;max-height:100%}.iw-dialog h2{font-size:21px}.iw-tutorial{display:none}
}
.iw-life-meter{display:grid;grid-template-columns:1fr auto;gap:4px 10px;margin:10px 0;color:#e4ece9}.iw-life-meter b{font-variant-numeric:tabular-nums;color:#f0d5a7}.iw-life-meter i{grid-column:1/-1;display:block;height:11px;border-radius:10px;background:#0f232d;border:1px solid #8caeb788;overflow:hidden}.iw-life-meter em{display:block;height:100%;background:linear-gradient(90deg,#d27e70,#e9ca81,#86d9c9)}.iw-life-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:17px}.iw-life-actions button{min-height:42px}@media(max-width:560px){.iw-life-actions{grid-template-columns:1fr}}
@media (max-height:500px) and (orientation:landscape){
 .iw-hud{min-height:0;height:52px;padding:2px 7px;gap:6px;flex-wrap:nowrap}
 .iw-title{min-width:100px;max-width:110px;gap:0}.iw-title small{font-size:7px;letter-spacing:.05em}.iw-title strong{font-size:15px}.iw-title>span{font-size:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .iw-vitals{order:0;min-width:100px;width:100px;display:block;margin:0;flex:none}.iw-health{width:100%}.iw-health b{font-size:9px;margin-bottom:1px}.iw-health i{height:5px}.iw-materials{display:none}
 .iw-nav{order:0;min-width:0;max-width:none;flex:1;overflow-x:auto;gap:3px;scrollbar-width:none}.iw-nav button{width:31px;height:31px;min-width:31px;font-size:16px}
 .iw-actions{min-height:0;height:49px;padding:3px 5px;gap:4px}.iw-actions button{flex-direction:row;gap:5px}.iw-actions button b{font-size:20px}.iw-actions button span{font-size:10px}
 .iw-room-build{bottom:2px;padding:2px}.iw-room-build-main{min-height:32px}.iw-room-build #iwRoomTools button{height:36px}.iw-room-build #iwRoomTools img{width:23px;height:23px}
 .iw-interact{bottom:45px;min-height:28px;padding:3px 8px;font-size:10px}.iw-zoom{right:4px;bottom:42px}.iw-zoom button{height:28px;min-width:28px}.iw-help{display:none}
}
.iw-view:has(#iwRoomBuild:not([hidden])) .iw-interact{top:12px;right:12px;bottom:auto;left:auto;transform:none;z-index:4}
@media(max-height:500px) and (orientation:landscape){.iw-view:has(#iwRoomBuild:not([hidden])) .iw-interact{top:5px;right:5px}}
/* Machinery is operated in the room. Combat controls and camera buttons do not
   belong over its floor or cover its placement cells. */
.iw-shell:has(#iwRoomBuild:not([hidden])) .iw-actions{display:none}
.iw-view:has(#iwRoomBuild:not([hidden])) .iw-techniques-button,
.iw-view:has(#iwRoomBuild:not([hidden])) .iw-zoom,
.iw-view:has(#iwRoomBuild:not([hidden])) .iw-context,
.iw-view:has(#iwRoomBuild:not([hidden])) .iw-terrain{display:none}
.iw-view:has(#iwRoomBuild:not([hidden])) #iwRoomTools button{white-space:normal;overflow:hidden;line-height:1.1;text-align:center;word-break:normal}
.iw-room-sheet-icon{display:block;flex:none;width:30px;height:30px;background-repeat:no-repeat;background-size:140px 93px;background-position:-4px -4px}
.iw-room-build #iwRoomTools button[data-id="gasPipe"] .iw-room-sheet-icon{background-position:-4px -11px}
.iw-room-build #iwRoomTools button:has(.iw-room-sheet-icon){height:56px}
.iw-machine-sheet-preview{display:block;flex:none;width:110px;height:110px;background-repeat:no-repeat;background-size:440px 293px;background-position:-12px -10px}
@media (min-width:700px) and (min-aspect-ratio:7/5){
 .iw-view:has(#iwRoomBuild:not([hidden])) .iw-room-build{left:12px;top:82px;bottom:auto;transform:none;width:158px;display:flex;flex-direction:column;align-items:stretch}
 .iw-view:has(#iwRoomBuild:not([hidden])) .iw-room-build-main{width:100%}
 .iw-view:has(#iwRoomBuild:not([hidden])) #iwRoomTools{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));max-width:none;overflow:visible;width:100%;gap:4px}
 .iw-view:has(#iwRoomBuild:not([hidden])) #iwRoomTools button{min-width:0;width:100%;height:62px}
}
@media (min-width:700px) and (max-height:500px) and (orientation:landscape){
 .iw-view:has(#iwRoomBuild:not([hidden])) .iw-room-build{top:5px;left:5px;width:145px}
 .iw-view:has(#iwRoomBuild:not([hidden])) #iwRoomTools button{height:39px}
}
@media (max-width:680px) and (orientation:portrait){
 .iw-shell:has(#iwRoomBuild:not([hidden])) .iw-hud{height:65px;min-height:0;padding:4px 6px;display:flex;flex-wrap:nowrap;gap:6px}
 .iw-shell:has(#iwRoomBuild:not([hidden])) .iw-title{flex:none;min-width:70px;max-width:70px}
 .iw-shell:has(#iwRoomBuild:not([hidden])) .iw-title small,.iw-shell:has(#iwRoomBuild:not([hidden])) .iw-title>span{display:none}
 .iw-shell:has(#iwRoomBuild:not([hidden])) .iw-title strong{font-size:15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 .iw-shell:has(#iwRoomBuild:not([hidden])) .iw-vitals{order:0;flex:none;width:62px;min-width:62px;margin:0;display:block}
 .iw-shell:has(#iwRoomBuild:not([hidden])) .iw-health{width:100%}
 .iw-shell:has(#iwRoomBuild:not([hidden])) .iw-health b{font-size:9px}
 .iw-shell:has(#iwRoomBuild:not([hidden])) .iw-materials{display:none}
 .iw-shell:has(#iwRoomBuild:not([hidden])) .iw-nav{order:0;flex:1;min-width:0;overflow-x:auto;flex-wrap:nowrap;scrollbar-width:none}
 .iw-shell:has(#iwRoomBuild:not([hidden])) .iw-nav button{min-width:31px;width:31px;height:31px}
}
