html,body{background:#000}
#gameViewport{position:fixed;inset:0;overflow:hidden;background:#000}
#gameViewport #world{position:absolute;inset:0;width:100%;height:100%;transform-origin:50% 50%;image-rendering:auto}
.mobileViewport #gameViewport{inset:auto;left:50%;top:50%;width:min(100vw,177.777778dvh);height:min(56.25vw,100dvh);transform:translate(-50%,-50%)}
#modeSwitch{position:fixed;left:12px;top:65px;display:flex;gap:6px;z-index:30;pointer-events:auto}
#modeSwitch #labShortcut{position:static;display:block;width:auto;height:auto;padding:7px 12px}
#editMode{padding:7px 12px;background:#23343a;border:1px solid #8b9e9a}#editMode[aria-pressed=true]{background:#aabf9e;color:#101a18}
body:not(.editing) #viewModes,body:not(.editing) #groundControls,body:not(.editing) #spritePalette,body:not(.editing) #blockoutSelection,body:not(.editing) #cameraEditor,body:not(.editing) #animationInspector{display:none!important}
#editorDock{display:none;position:fixed;right:0;top:0;bottom:0;width:var(--editor-width,370px);background:#202329;color:#cbd0d8;border-left:1px solid #080a0d;z-index:40;font:12px system-ui;pointer-events:auto;grid-template-rows:var(--outliner-height,35vh) 6px minmax(0,1fr)}
.editing #editorDock{display:grid}.editing #hud{right:var(--editor-width,370px)}.editing #gameViewport{right:var(--editor-width,370px)}
.editing.mobileViewport #gameViewport{right:auto;width:min(calc(100vw - var(--editor-width,370px)),177.777778dvh);height:min(calc((100vw - var(--editor-width,370px)) * .5625),100dvh);left:calc((100vw - var(--editor-width,370px))/2)}
#dockWidthSplitter{position:absolute;top:0;bottom:0;left:-5px;width:8px;cursor:ew-resize;z-index:5;touch-action:none}
#dockHeightSplitter{cursor:ns-resize;background:#11151a;border-block:1px solid #40454e;touch-action:none}
#dockWidthSplitter:hover,#dockWidthSplitter:focus-visible,#dockHeightSplitter:hover,#dockHeightSplitter:focus-visible{background:#5082a4;outline:none}
.resizingEditor{cursor:col-resize}
#editorDock header{display:flex;align-items:center;justify-content:space-between;padding:8px 10px;border-bottom:1px solid #101216;background:#282c33}
#outliner{display:flex;flex-direction:column;min-height:0}#outlinerSearch{margin:6px 8px;background:#15181d;border:1px solid #424956;color:#e1e5e9;padding:6px;width:calc(100% - 16px)}
.outlinerDeleted{margin:0 8px 5px;font-size:10px;color:#9ba7b6}#outlinerList{overflow:auto;flex:1;min-height:0}
#outlinerList h4{margin:0;padding:5px 10px;background:#292d35;border-top:1px solid #353b44;font-size:10px;text-transform:uppercase;color:#a4b2c2}
#outlinerList button{display:flex;align-items:center;gap:6px;width:100%;border:0;background:transparent;text-align:left;padding:5px 9px;color:#d1d7df;font:11px system-ui}
#outlinerList button:hover{background:#343e49}#outlinerList button[aria-selected=true]{background:#345876;color:#fff}
#outlinerList button>span:nth-child(2){flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#outlinerList small{font:9px monospace;color:#9eacba}.outlinerIcon{color:#80b6dd}.deletedAsset{text-decoration:line-through;opacity:.6}
#outliner footer{display:flex;gap:4px;padding:5px;border-top:1px solid #3b4149}#editorDock button{border-radius:2px}
#outliner footer button,#editorDock #sceneEntityControls button{background:#363c45;border:1px solid #535d6b;color:#e0e4e9;padding:5px 7px;font:11px system-ui}
#dockDetails{display:flex;flex-direction:column;min-height:0;overflow:hidden}#detailsTabs{display:flex;flex-shrink:0;background:#15191e;border-bottom:1px solid #46515e}
#detailsTabs button{flex:1;background:#272c33;color:#b4bfcb;border:0;border-right:1px solid #14181e;border-bottom:2px solid transparent;font:12px system-ui;padding:9px 4px}
#detailsTabs button[aria-selected=true]{background:#353c46;color:#fff;border-bottom-color:#68adcf}#detailsBody{overflow:auto;min-height:0;flex:1;padding:8px}
#detailsBody h3{font-size:12px;margin:0 0 8px}#detailsBody h4{font-size:11px;margin:12px 0 6px;color:#aebdcd}#detailsBody details{margin:9px 0;border:1px solid #414955;background:#242a32;padding:8px}#detailsBody summary{cursor:pointer;font-weight:600}
#detailsBody input,#detailsBody select{background:#151a20;color:#e4e8ed;border:1px solid #4c5663;padding:5px;min-width:0;accent-color:#60b2d5}#detailsBody input[type=range]{padding:0;width:100%}#detailsBody input[type=checkbox]{width:15px;height:15px;padding:0}
#assetNumericProperties>label{display:grid;grid-template-columns:minmax(0,1fr) minmax(80px,45%);align-items:center;gap:8px;padding:4px 0;border-bottom:1px solid #343b44;font-size:11px}#assetNumericProperties input{width:100%}
#editorDock #sceneEntityControls{gap:7px;flex-wrap:wrap}#editorDock #sceneEntityControls label{font:11px system-ui}
#editorDock #blockoutSelection,#editorDock #animationInspector,#editorDock #spritePalette,#editorDock #cameraEditor,#editorDock #groundControls,#editorDock #viewModes,#editorDock #labPanel{position:static!important;inset:auto!important;transform:none!important;width:100%!important;max-width:none!important;min-width:0!important;max-height:none!important;margin:0 0 8px!important;background:transparent!important;border:0!important;box-shadow:none!important;overflow:visible!important;font:12px system-ui}
#editorDock #blockoutSelection{padding:0;display:grid;gap:8px;pointer-events:auto}#editorDock #sceneEntityLabel{overflow-wrap:anywhere}#editorDock #cameraEditor{padding:0}#editorDock #cameraEditor label{display:block;margin:9px 0}#editorDock #cameraEditor output{float:right}
#editorDock #viewModes{display:flex;flex-wrap:wrap;padding:5px 0}#editorDock #groundControls{display:flex;flex-wrap:wrap;gap:8px}
#editorDock #spritePalette{display:flex}#editorDock #spritePaletteBody{padding:6px 0}#editorDock #spriteList{max-height:none;overflow:visible;grid-template-columns:repeat(auto-fill,minmax(75px,1fr))}
#editorDock #labButtons{overflow:visible;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));padding:5px 0}#editorDock #labPanel{display:flex}
#editorDock #animationInspector{padding:0}#editorDock #animationInspector header{padding:0 0 6px;background:transparent}#editorDock #animationInspector button{padding:6px;background:#35404d;border:1px solid #596e84;color:#e7edf4;margin:3px}
#editorDock #animationPreview{float:none;width:100%;height:170px;background:#151b22;object-fit:contain}
.animationFrames{display:flex;overflow:auto;gap:3px;clear:both;padding-top:5px}#editorDock .animationRow{padding:8px 0;border-bottom:1px solid #424a56}
#editorDock .animationFrames canvas{flex:none;width:55px;height:72px;cursor:pointer;outline:none;background:#273239;border:1px solid #46535b}#editorDock .animationFrames canvas.active{border:2px solid #f2d99b}
#editorDock .animationFrames canvas.hasFrameEvent{box-shadow:inset 0 -6px #39ce72}#editorDock .animationRow.hasAnimationEvent>[data-animation]::before{content:'\25a0';color:#39ce72;margin-right:5px}
.animationFrameCell{position:relative;flex:none}.animationFrameCell.hasFrameEvent::after{content:'';position:absolute;right:4px;top:4px;width:9px;height:9px;background:#39ce72;border:1px solid #092f19;pointer-events:none}
.frameEventHelp{font:10px system-ui;color:#9aafc2;line-height:1.5}.frameEventMenu{position:fixed;z-index:100;background:#252e39;border:1px solid #65778d;padding:4px;box-shadow:0 5px 18px #0009}.frameEventMenu button{display:block;background:#35465a;border:0;padding:8px;color:#f1f6fc;font:12px system-ui}
.editing #selection{max-width:calc(100vw - var(--editor-width,370px) - 30px)}
#modal{z-index:90}

.frameEditToolbar{display:flex;flex-wrap:wrap;gap:5px;position:sticky;top:0;background:#182024;padding:7px 0;z-index:2}.animationFrameCell.selectedFrame{outline:2px solid #eac878;background:#806b343d}.animationFrameCell.selectedFrame canvas{box-shadow:inset 0 0 0 2px #eac878}.frameEditToolbar small{width:100%;color:#dbc794}

#labPanel[hidden],#developerDetails[hidden]{display:none!important}

.assetDepthControl>span{display:grid;grid-template-columns:minmax(0,1fr) 70px;gap:6px;align-items:center}.assetDepthControl small{grid-column:1/-1;color:#aebdcd;font-size:10px}

/* HUD coordinates follow the unzoomed, letterboxed game viewport. */
#hud{position:fixed;inset:auto;overflow:hidden}
#hud #topbar{position:absolute;inset:8px 8px auto;height:36px;padding:0;display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
#hud #resources{height:36px;gap:6px;padding:2px 6px;flex:none;justify-content:flex-start}
#hud .resource{min-width:38px;gap:3px}#hud .resource canvas{width:25px;height:27px}#hud .resource strong{font:12px Georgia,serif}
#hud .topActions{display:grid;grid-template-columns:repeat(3,32px);gap:4px;position:relative;margin:0}
#hud .topActions .iconButton{width:32px;height:32px}#hud .topActions .iconButton canvas{width:22px;height:22px}
#hud #objectivesShortcut{grid-column:2/4;width:68px;height:56px;min-height:0;padding:3px;display:flex;flex-direction:column;align-items:center;justify-content:center;position:relative;pointer-events:auto}
#hud #objectivesShortcut canvas{width:27px;height:27px}#hud #objectivesShortcut span{font:10px Georgia,serif}#hud #objectivesShortcut .badge{position:absolute;right:3px;top:2px}
#hud #dock{position:absolute;left:8px;top:102px;bottom:auto;right:auto;transform:none;display:flex;flex-direction:column;gap:4px;padding:0;max-width:none;max-height:calc(100% - 180px);overflow:auto;pointer-events:auto}
#hud #dock .dockButton{width:62px;height:64px;min-height:64px;flex:none;display:flex;flex-direction:column;align-items:center;justify-content:center}
#hud #dock .dockButton canvas{width:33px;height:36px}#hud #dock .dockButton span{font:11px Georgia,serif}
#hud #modeSwitch{position:absolute;left:8px;top:54px;gap:6px}#hud #modeSwitch button{font:11px system-ui;padding:7px 10px}
#hud #minimapHud{position:absolute;top:8px;right:124px;left:auto;width:180px;height:42px;max-width:none}#hud #minimapHud canvas{height:34px}
#hud #heroPortraits{left:80px;bottom:8px;max-width:calc(100% - 160px);overflow-x:auto}
#hud #drawer{left:80px;right:auto;bottom:84px;width:min(610px,calc(100% - 92px));max-width:calc(100% - 92px);max-height:calc(100% - 150px)}
#hud #selection,#hud #placementTip{left:80px;right:12px;bottom:84px;max-width:calc(100% - 92px)}
#hud #nextStep{left:auto;right:8px;bottom:8px;max-width:32%;font-size:11px}
#hud #warning,#hud #toast{top:112px;max-width:calc(100% - 180px)}
#hud>#labPanel{left:80px;top:100px;bottom:84px;max-height:calc(100% - 184px)}

#hud .portraitButton{width:42px;height:56px;padding:3px;flex:none}
.mobileViewport #hud .cardGrid{grid-template-columns:repeat(2,minmax(0,1fr))}
.mobileViewport #hud .actionCard{min-height:66px;grid-template-columns:38px minmax(0,1fr);padding:5px}
.mobileViewport #hud .actionCard canvas{width:36px;height:42px}
.mobileViewport #hud .actionCard strong{font-size:11px}.mobileViewport #hud .actionCard .cost{font-size:9px}

/* One active animation strip and a preview independent of the details tabs. */
#animationMonitor{position:fixed;right:calc(var(--editor-width,370px) + 12px);bottom:12px;width:min(520px,calc(100vw - var(--editor-width,370px) - 24px));max-height:calc(100dvh - 90px);overflow:auto;z-index:39;pointer-events:auto;background:#151b22f5;border:1px solid #596e84;box-shadow:0 4px 18px #0008;color:#e7edf4;padding:8px;font:11px system-ui;box-sizing:border-box}
#animationMonitor[hidden],body:not(.editing) #animationMonitor{display:none!important}
#animationPreviewName{display:block;overflow-wrap:anywhere;padding:2px 0 6px;color:#f2d99b}
#animationMonitor #animationPreview{display:block;float:none;width:100%;height:auto;aspect-ratio:16/11;background:#10151a;border:0;margin:0}
.animationTimelineLabel{display:block;margin-top:6px}.animationTimelineLabel output{display:block;color:#acbcc9;font:10px monospace;margin:3px 0}
#animationMonitor input[type=range]{display:block;width:100%;margin:4px 0;accent-color:#e1c882;touch-action:none}
#animationMonitor button{background:#35404d;border:1px solid #596e84;color:#e7edf4;padding:5px;font:11px system-ui;width:100%}
#editorDock #animationList{display:flex;flex-wrap:wrap;gap:4px;margin:8px 0}
#editorDock #animationList .animationRow{display:flex;align-items:center;gap:2px;border:1px solid #414e5a;padding:2px;min-width:0}
#editorDock #animationList label{display:flex;align-items:center;gap:2px;font-size:10px;padding-right:5px}
#editorDock [data-animation][aria-pressed=true]{background:#526247;color:#fff3c9;border-color:#bca66c}
#activeAnimationFrames{position:relative;scroll-behavior:auto;overflow-x:auto;overflow-y:hidden;padding:7px 3px 10px;scrollbar-color:#788c9b #172029;scrollbar-width:auto}
#editorDock #activeAnimationFrames canvas{display:block;box-sizing:border-box;width:55px;height:72px;border:1px solid #46535b}
#editorDock #activeAnimationFrames canvas.active{border:1px solid #f2d99b;outline:2px solid #f2d99b;outline-offset:-2px}
#activeAnimationFrames .animationFrameCell small{display:block;text-align:center;font:9px monospace;color:#a4b8c7;padding-top:3px}
#editorDock .frameEditToolbar{position:static}.disabledFrameTools{display:flex;align-items:center;flex-wrap:wrap;gap:4px;margin:5px 0}.disabledFrameTools label{display:flex;align-items:center;gap:5px}.disabledFrameTools select{max-width:150px}

#animationAlignment{border-top:1px solid #536475;margin-top:12px;padding-top:8px}#animationAlignment h4{margin:4px 0}#animationAlignment p,#alignmentStatus{font:10px system-ui;color:#a8bac9;line-height:1.5}#animationAlignment>label{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:7px 0}#animationAlignment input[type=number]{width:85px}#animationAlignment fieldset{display:grid;grid-template-columns:1fr 1fr;gap:7px;border:1px solid #4c5c6e;margin:8px 0}#animationAlignment fieldset label{display:flex;align-items:center;justify-content:space-between;gap:4px}#animationAlignment fieldset input{width:64px}#animationAlignment legend{color:#bccddd;font-size:11px}.animationFrameCell.hasAlignmentKey::before{content:'';position:absolute;left:5px;top:5px;width:8px;height:8px;transform:rotate(45deg);background:#68bfff;border:1px solid #12344c;pointer-events:none}

#editorDock #activeAnimationFrames .disabledFrame canvas{filter:grayscale(1);opacity:.32;background:#646970}#activeAnimationFrames .disabledFrame small{color:#7d858d;text-decoration:line-through}.animationFrameCell.disabledFrame::after{content:'off';position:absolute;right:3px;bottom:18px;font:8px system-ui;background:#111c;padding:1px 3px;color:#a9afb5;pointer-events:none}.animationFrameCell.disabledFrame.selectedFrame{outline-color:#eac878}#editorDock #animationList .animationRow{flex-wrap:wrap}#editorDock #animationList select{max-width:110px;padding:4px;font:10px system-ui}

#animationAlignment #alignmentBezier[hidden]{display:none!important}#alignmentInterpolation{max-width:155px}
