:root{--bg: #0e0f13;--panel: #151821;--text: #ffffff;--muted: #ffffff;--accent: #5bfa8e;--border: #232734;--hud-text-color: #fff;--screen-flash-color: #ff4040;--screen-flash-opacity: .85;--engine-font-size: 8px;--ui-font-family: monospace;--ls-xs: 0;--ls-tight: 0;--ls-normal: 0;--ls-wide: 0;--ls-px-sm: 0;--ls-px-md: 0;--ls-px-md2: 0;--ls-px-lg: 0;--ls-mono: 0;--fw-normal: 400;--fw-medium: 400;--fw-bold: 400;--lh-tight: 1;--lh-normal: 1.3;--lh-text: 1.4;--lh-relaxed: 1.45;--lh-loose: 1.5}*{box-sizing:border-box}html,body{height:100%}hr{border-top:4px solid var(--border)}html,body *{font-size:var(--engine-font-size)}body{margin:0;font-family:var(--ui-font-family);color:var(--text);background:var(--bg);font-kerning:none;font-synthesis:none;text-shadow:none;text-rendering:optimizeSpeed;-webkit-font-smoothing:none;-moz-osx-font-smoothing:auto}body *{border-radius:0!important}.app{min-height:100vh;display:flex;flex-direction:column}header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;padding:10px clamp(10px,2.5vw,20px);border-bottom:4px solid var(--border);background:var(--panel);position:sticky;top:0;z-index:10}header h1{margin:0;letter-spacing:var(--ls-px-md2)}header input{flex:1 1 220px;max-width:360px;padding:5px 8px;background:var(--panel);border:1px solid var(--border);border-radius:10px;color:var(--text)}main{flex:1;width:min(1100px,100%);margin:0 auto;padding:clamp(10px,2.5vw,20px);display:grid;gap:16px}.tabs{display:flex;flex-wrap:wrap;gap:5px;padding:clamp(3px,1.2vw,6px);border:4px solid var(--border);border-radius:14px;background:var(--panel);width:100%;max-width:720px;margin:clamp(3px,1.2vw,8px) auto;position:relative;z-index:20;pointer-events:auto}body.game-mode .tabs{margin-bottom:0}.tabs-title{flex:1 1 100%;margin:0;text-align:center;letter-spacing:var(--ls-wide);color:var(--muted)}.tabs-links{flex:1 1 auto;display:flex;gap:8px;flex-wrap:wrap;justify-content:center;align-items:center;width:100%}.tab-button{display:flex;align-items:center;justify-content:center;min-height:28px;padding:8px 12px;border:4px solid var(--border);background:#1a2030e6;color:#f2f5ff;cursor:pointer;font-weight:var(--fw-medium);white-space:nowrap}.tab-action-button{flex:0 0 auto;display:flex;align-items:center;justify-content:center;min-height:28px;padding:8px 12px;border:4px solid var(--border);background:#1e2337e0;color:#fff;font-weight:var(--fw-medium);cursor:pointer;white-space:nowrap}.tab-button.active{background:#64b5f633;border-color:#64b5f673;color:#fff}@media(hover:hover){.tab-button:hover,.tab-action-button:hover{background:#64b5f633;border-color:#64b5f673;color:#fff}}@media(max-width:640px){.tabs{gap:3px;padding:3px;border-radius:9px;margin:3px auto 6px}.tabs-links{gap:3px;justify-content:center}.tab-button{min-height:26px;padding:4px 7px}.tab-action-button{padding:4px 7px}.project-save-controls{gap:3px}.btn-manual-save,.btn-history-dropdown{padding:4px 7px;min-height:26px}body.game-mode #game-container{justify-content:flex-start;padding-top:4px;padding-bottom:10px;gap:8px;margin-top:0}body.game-mode .game-screen{margin-top:8px}}.tab-button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.project-save-controls{display:flex;gap:8px;justify-content:center;width:100%;max-width:720px;margin:0 auto clamp(3px,1.2vw,8px)}.history-dropdown-wrapper{position:relative}.btn-manual-save,.btn-history-dropdown{padding:8px 12px;background:#1a2030e6;border:4px solid var(--border);color:#fff;cursor:pointer;font-weight:var(--fw-medium);min-height:28px;font-family:var(--ui-font-family);transition:all .2s}@media(hover:hover){.btn-manual-save:hover,.btn-history-dropdown:hover{background:#64b5f633;border-color:#64b5f673}}.btn-manual-save:focus-visible,.btn-history-dropdown:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.btn-manual-save:disabled{opacity:.6;cursor:not-allowed}.history-dropdown-menu{position:absolute;top:100%;left:0;margin-top:5px;background:var(--panel);border:4px solid var(--border);border-radius:8px;box-shadow:0 4px 12px #0000004d;min-width:200px;max-width:300px;z-index:1000}.history-dropdown-menu[hidden]{display:none}.history-items-container{max-height:300px;overflow-y:auto}.history-item{display:flex;flex-direction:column;gap:3px;width:100%;padding:10px 12px;cursor:pointer;border:none;border-bottom:1px solid var(--border);transition:background .15s;background:transparent;color:var(--text);text-align:left;font-family:var(--ui-font-family)}.history-item-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.history-item-timestamp{opacity:.6}@media(hover:hover){.history-item:hover{background:#64b5f61a}}.history-item:last-child{border-bottom:none}.history-item:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}.tab-content{display:none;padding:clamp(10px,2vw,18px);border:4px solid var(--border);border-radius:14px;background:var(--panel)}.tab-content.active{display:block}body.editor-mode main{width:100%;max-width:none;margin:0;padding:0;gap:0;display:flex;flex-direction:column}body.editor-mode #tab-editor.tab-content{border:none;border-radius:0;box-shadow:none;background:var(--panel);padding:0}body.editor-mode #tab-editor.tab-content.active{display:flex;flex:1;flex-direction:column;min-height:0}body.editor-mode #tab-editor .editor-layout{flex:1;min-height:0;padding:clamp(10px,2.5vw,20px);overflow:auto}body.game-mode{overflow:hidden}body.game-mode .app{height:100vh}body.game-mode header{display:flex;background:#0b0d12;border-bottom:2px solid #2a2f3a;-webkit-backdrop-filter:none;backdrop-filter:none;color:#fff;font-family:var(--ui-font-family)}body.game-mode header h1{letter-spacing:var(--ls-mono)}body.game-mode header input{border-radius:0;box-shadow:none;background-image:none;border:2px solid #2a2f3a;background:#0f131b;color:#fff}body.game-mode main{flex:1;width:100%;max-width:none;margin:0;padding:0;gap:0;display:flex;flex-direction:column;min-height:0}body.game-mode .tab-action-button{display:inline-flex;justify-content:center;align-items:center}body.game-mode #tab-game.tab-content{flex:1;padding:0;border:none;border-radius:0;box-shadow:none;background:#000;min-height:0;position:relative;z-index:1}body.game-mode #tab-game.tab-content.active{display:flex}body.game-mode #game-container{flex:1;width:100%;height:100%;min-height:0;padding:0 clamp(12px,3vw,32px) clamp(12px,3vw,32px);display:flex;flex-direction:column;justify-content:flex-start;align-items:center;gap:8px}body.game-mode #tab-game .game-controls{position:absolute;bottom:clamp(12px,4vw,28px);right:clamp(12px,4vw,32px);padding:6px 8px;background:var(--panel);border:4px solid var(--border);border-radius:8px;z-index:3}body.game-mode #tab-game .game-controls button{padding:6px 10px}body.editor-mode{--bg: #0b0d12;--panel: #11151d;--text: #ffffff;--muted: #ffffff;--accent: #5bfa8e;--border: #2a2f3a;background:var(--bg);font-family:var(--ui-font-family)}body.editor-mode header{background:#0b0d12;border-bottom:2px solid var(--border);-webkit-backdrop-filter:none;backdrop-filter:none}body.editor-mode header h1{letter-spacing:var(--ls-mono)}body.editor-mode .tabs,body.editor-mode .tab-content,body.editor-mode .tab-button,body.editor-mode .tab-action-button,body.editor-mode header input,body.editor-mode button,body.editor-mode input,body.editor-mode select,body.editor-mode textarea,body.editor-mode .map-nav-button,body.editor-mode .editor-mobile-nav-button,body.editor-mode [class*=card],body.editor-mode [class*=badge],body.editor-mode [class*=toggle],body.editor-mode [class*=button]{border-radius:0;box-shadow:none;background-image:none}body.editor-mode .tabs,body.editor-mode .tab-content,body.editor-mode [class*=card],body.editor-mode [class*=badge]{border:2px solid var(--border);background:var(--panel)}body.editor-mode .tile-card.selected,body.editor-mode .npc-card.selected,body.editor-mode .enemy-card.selected,body.editor-mode .object-type-card.selected{border-color:var(--accent);background:#64b5f61a;box-shadow:0 0 0 2px #64b5f626}body.editor-mode .tab-button,body.editor-mode .tab-action-button,body.editor-mode button,body.editor-mode .map-nav-button,body.editor-mode .editor-mobile-nav-button{border:2px solid var(--border);background:#141a24;color:var(--text);letter-spacing:var(--ls-normal)}body.editor-mode .tab-button.active{background:#1f2735;border-color:var(--accent);color:#fff}@media(hover:hover){body.editor-mode .tab-button:hover,body.editor-mode .tab-action-button:hover,body.editor-mode button:hover,body.editor-mode .map-nav-button:hover:not(:disabled),body.editor-mode .editor-mobile-nav-button:hover{background:#1f2735;border-color:var(--accent);color:#fff}}body.editor-mode input,body.editor-mode select,body.editor-mode textarea,body.editor-mode header input{border:2px solid var(--border);background:#141a24;color:var(--text)}body.editor-mode input[type=checkbox]{appearance:none;-webkit-appearance:none;width:18px;height:18px;margin:0;border:2px solid var(--border);background:#141a24;display:inline-grid;place-content:center;vertical-align:middle;cursor:pointer;box-shadow:none}body.editor-mode input[type=checkbox]:before{content:"";width:8px;height:8px;transform:scale(0);transition:transform .08s ease-out;box-shadow:inset 1em 1em var(--accent)}body.editor-mode input[type=checkbox]:hover{border-color:#64b5f6a6;background:#1f2735}body.editor-mode input[type=checkbox]:checked{border-color:var(--accent);background:#1f2735}body.editor-mode input[type=checkbox]:checked:before{transform:scale(1)}body.editor-mode input[type=checkbox]:focus-visible{outline:2px solid var(--accent);outline-offset:2px}body.editor-mode .editor-section details,body.editor-mode .world-cell,body.editor-mode .enemy-item,body.editor-mode .enemy-variable-select,body.editor-mode .enemy-remove,body.editor-mode .npc-card .npc-preview,body.editor-mode .object-preview,body.editor-mode .game-minimap,body.editor-mode .history-dropdown-menu,body.editor-mode .history-item,body.editor-mode .project-panel__section,body.editor-mode .project-panel__group,body.editor-mode .editor-section summary+*,body.editor-mode [class*=list],body.editor-mode [class*=grid]>[class*=card]{background:var(--panel)}body.editor-mode .enemy-card.boss,body.editor-mode .enemy-item,body.editor-mode .enemy-variable-select,body.editor-mode .enemy-remove,body.editor-mode .object-preview{border-color:var(--border)}body.editor-mode .tab-button:focus-visible,body.editor-mode button:focus-visible,body.editor-mode .map-nav-button:focus-visible,body.editor-mode .editor-mobile-nav-button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.game-container{position:relative;display:flex;flex-direction:column;gap:16px;align-items:center;text-align:center}.game-screen{position:relative;display:inline-block;line-height:0}.game-screen canvas{display:block}.combat-indicator{position:absolute;top:45%;left:50%;transform:translate(-50%,-50%);padding:4px 10px;border-radius:6px;font-family:var(--ui-font-family);color:#fff;background:var(--panel);opacity:0;pointer-events:none;z-index:4}.combat-indicator.visible{opacity:1}.screen-flash{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;background:var(--screen-flash-color);mix-blend-mode:screen;opacity:0;transition:opacity .15s ease-out;z-index:3}.screen-flash.visible{opacity:var(--screen-flash-opacity)}#game-canvas{width:clamp(128px,45vw,384px);max-width:100%;height:auto;margin-top:1em}#editor-canvas{width:clamp(220px,90vw,820px);max-width:100%;height:auto;flex:0 1 auto}.editor-map-wrapper{position:relative;display:flex;justify-content:center;padding:24px;margin:0 auto;width:100%;max-width:900px}.editor-map-title{display:flex;align-items:baseline;gap:8px;color:var(--text)}.editor-map-position{color:var(--muted)}.editor-map-wrapper canvas{display:block;width:100%}.map-nav-button{--map-nav-arrow-color: rgba(255, 255, 255, .85);position:absolute;width:28px;height:28px;border-radius:999px;border:1px solid rgba(255,255,255,.25);background:#0a0f19d9;padding:0;display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:3}.map-nav-button:hover:not(:disabled),.map-nav-button:focus-visible:not(:disabled){border-color:#60a5fae6;background:#60a5fa59;outline:none}.map-nav-button:disabled{opacity:.35;cursor:default;--map-nav-arrow-color: rgba(255, 255, 255, .35)}.map-nav-button:after{content:"";display:block;width:0;height:0;border-style:solid}.map-nav-button--up{top:6px;left:50%;transform:translate(-50%)}.map-nav-button--up:after{border-width:0 6px 8px 6px;border-color:transparent transparent var(--map-nav-arrow-color) transparent}.map-nav-button--down{bottom:6px;left:50%;transform:translate(-50%)}.map-nav-button--down:after{border-width:8px 6px 0 6px;border-color:var(--map-nav-arrow-color) transparent transparent transparent}.map-nav-button--left{left:6px;top:50%;transform:translateY(-50%)}.map-nav-button--left:after{border-width:6px 8px 6px 0;border-color:transparent var(--map-nav-arrow-color) transparent transparent}.map-nav-button--right{right:6px;top:50%;transform:translateY(-50%)}.map-nav-button--right:after{border-width:6px 0 6px 8px;border-color:transparent transparent transparent var(--map-nav-arrow-color)}.editor-mobile-nav{display:none;gap:8px;justify-content:center;margin-top:16px;flex-wrap:wrap}.editor-mobile-nav-button{width:40px;height:40px;border-radius:50%;border:1px solid rgba(255,255,255,.2);background:#0f172acc;color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer}.editor-mobile-nav-button .nav-icon{image-rendering:pixelated;image-rendering:crisp-edges}.editor-mobile-nav-button.active{border-color:#60a5fae6;background:#60a5fa40}.editor-mobile-nav-button:focus-visible{outline:2px solid rgba(147,197,253,.8);outline-offset:2px}#tile-canvas{width:clamp(128px,45vw,384px);max-width:100%;height:auto}#selected-tile-preview{width:clamp(64px,24vw,128px);max-width:100%;height:auto}.game-controls{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;align-items:center;color:var(--muted)}.game-controls button{flex:0 0 auto}.touch-controls-toggle{display:none;margin-top:8px;padding:6px 14px;border-radius:999px;border:1px solid rgba(255,255,255,.3);background:#ffffff05;color:#fff;letter-spacing:var(--ls-normal);font-weight:var(--fw-medium);cursor:pointer}.game-fullscreen-button{position:absolute;right:clamp(12px,4vw,24px);bottom:clamp(12px,4vw,24px);width:36px;height:36px;min-height:36px;padding:0;display:inline-flex;align-items:center;justify-content:center;z-index:3;border:4px solid var(--border);background:#0c101873;color:#fff;opacity:.55;transition:opacity .15s ease,background-color .15s ease,border-color .15s ease}.game-fullscreen-button.is-active{background:#12182299;border-color:#64b5f673}.game-fullscreen-button:before,.game-fullscreen-button:after{content:"";position:absolute;width:10px;height:10px;border-color:currentColor;border-style:solid}.game-fullscreen-button:before{top:7px;left:7px;border-width:2px 0 0 2px}.game-fullscreen-button:after{right:7px;bottom:7px;border-width:0 2px 2px 0}.game-fullscreen-button[data-state=exit]:before{top:10px;left:10px;border-width:0 2px 2px 0}.game-fullscreen-button[data-state=exit]:after{right:10px;bottom:10px;border-width:2px 0 0 2px}@media(hover:hover){.game-fullscreen-button:hover{opacity:.85;background:#121822b3;border-color:#64b5f673}}.touch-controls-toggle[aria-expanded=true]{border-color:#64b5f6}.game-touch-pad{display:none;z-index:2;gap:6px;align-items:center}.game-touch-pad .pad-button{width:36px;height:36px;border-radius:10px;border:1px solid rgba(255,255,255,.2);background:#ffffff14;color:#fff;display:flex;align-items:center;justify-content:center;padding:0;touch-action:manipulation}.game-touch-pad .pad-button:active{transform:translateY(1px)}.game-touch-pad .pad-middle-row{display:flex;gap:6px}.game-touch-pad .pad-center{opacity:0}.game-touch-pad .pad-up:before{content:"▲"}.game-touch-pad .pad-down:before{content:"▼"}.game-touch-pad .pad-left:before{content:"◀"}.game-touch-pad .pad-right:before{content:"▶"}.game-touch-pad .touch-controls-hide{display:none}@media(max-width:720px){.touch-controls-toggle{display:inline-flex;align-items:center;gap:6px}body.touch-controls-visible .touch-controls-toggle{display:none}body.touch-controls-visible .game-touch-pad{display:grid;position:absolute;bottom:clamp(72px,18vw,128px);left:50%;transform:translate(-50%);justify-items:center}body.touch-controls-visible .game-touch-pad .touch-controls-hide{display:inline-flex;align-items:center;justify-content:center;padding:4px 10px;border-radius:999px;border:1px solid rgba(255,255,255,.3);background:#ffffff0d;letter-spacing:var(--ls-normal);margin-bottom:4px;color:#fff}body.game-mode.touch-controls-visible #game-container{padding-bottom:clamp(110px,24vw,160px)}}.editor-layout{display:grid;gap:24px;grid-template-columns:minmax(0,360px) minmax(0,1fr) minmax(0,360px);grid-template-areas:"left center right";align-items:start}.editor-left,.editor-right,.editor-center{display:grid;gap:24px;align-content:start;width:100%;min-width:0}.editor-left{grid-area:left;max-width:360px;justify-self:start}.editor-center{grid-area:center;align-content:start;justify-items:center;justify-self:center}.editor-right{grid-area:right;max-width:360px;justify-self:end}.editor-section--map{width:100%;max-width:768px;justify-items:center}.editor-section--map canvas{margin:0 auto}.editor-section{display:grid;gap:16px;padding:16px;border:4px solid var(--border);border-radius:12px;background:var(--panel)}.editor-section h3{margin:0;letter-spacing:var(--ls-px-md)}.editor-section canvas{justify-self:center}.editor-section details{display:grid;gap:16px;background:var(--bg)}.editor-section details+details{margin-top:12px}.editor-section summary{position:relative;display:flex;align-items:center;gap:10px;cursor:pointer;font-weight:var(--fw-medium);padding:6px 0;list-style:none;-webkit-user-select:none;user-select:none}.editor-section summary::-webkit-details-marker{display:none}.editor-section summary:before{content:"";width:0;height:0;border-style:solid;border-width:4px 0 4px 6px;border-color:transparent transparent transparent #f4f7fb;opacity:.9;transition:transform .12s ease-out,opacity .12s ease-out;transform-origin:35% 50%;flex:0 0 auto}.editor-section summary:hover:before,.editor-section summary:focus-visible:before{opacity:1;border-left-color:var(--accent)}.editor-section details[open] summary{margin-bottom:8px}.editor-section details[open] summary:before{transform:rotate(90deg)}.tile-editor{display:grid;gap:16px}.tile-editor-top{display:grid;justify-items:center}.tile-editor-info{display:grid;gap:12px}.tile-name-line{display:flex;justify-content:space-between;align-items:center}.tile-name-line .label{color:var(--muted)}.tile-editor-info .checkbox{display:flex;align-items:center;gap:6px}.control-group{display:grid;gap:6px}.control-group label{color:var(--muted)}.control-group input[type=text],.control-group input[type=color],.control-group select,.control-group textarea{width:100%}canvas{image-rendering:pixelated;image-rendering:crisp-edges;max-width:100%;height:auto}input,select,textarea,button{font:inherit;padding:10px 12px;border:4px solid var(--border);background:#0f1422;color:var(--text);outline:none}input:focus,select:focus,textarea:focus,button:focus-visible{border-color:var(--accent)}button{cursor:pointer}button:hover{border-color:#2d3242}textarea{width:100%;min-height:160px;resize:vertical}.tile-preset-summary{margin:0;color:var(--muted)}.objects-panel{display:grid;gap:12px}.object-types{display:grid;gap:8px;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));max-height:min(40vh,260px);overflow-y:auto;padding-right:4px}.object-type-card{display:grid;grid-template-columns:48px 1fr;align-items:center;gap:10px;padding:8px 10px;background:var(--panel);border:4px solid var(--border);border-radius:8px;cursor:pointer;position:relative}.object-type-card:hover{border-color:#64b5f699}.object-types::-webkit-scrollbar{width:6px}.object-types::-webkit-scrollbar-thumb{background:#232734;border-radius:999px}.object-type-card.selected{border-color:var(--accent);box-shadow:0 0 0 2px #64b5f626}.object-type-card.placed .object-type-info{color:#8be9a5}.object-type-meta{display:flex;flex-direction:column;gap:4px;align-items:flex-start}.object-type-name{font-weight:var(--fw-medium);color:var(--text)}.object-type-info{color:var(--muted)}.object-type-stats{margin-top:4px;color:var(--muted);line-height:var(--lh-normal)}.objects-list{display:grid;gap:8px}.object-card{display:grid;grid-template-columns:auto 1fr;align-items:flex-start;gap:12px;padding:8px 12px;border:1px dashed var(--border);border-radius:8px;background:var(--panel)}.object-preview,.object-type-preview{width:48px;height:48px;min-width:48px;min-height:48px;max-width:48px;max-height:48px;border:none;border-radius:4px;background:#0f1320a6;image-rendering:pixelated;flex-shrink:0;justify-self:center}.object-body{min-width:0;display:flex;flex-direction:column;gap:6px}.object-card .object-header{display:flex;align-items:center;justify-content:space-between;gap:8px}.object-name{margin:0;font-weight:var(--fw-medium)}.object-card .object-remove{align-self:flex-end;margin-top:4px}.object-position{color:var(--muted)}.object-card .object-config{display:flex;flex-direction:column;gap:4px;padding:6px 8px;border-radius:6px;background:#212f4466}.object-config-label{display:flex;flex-direction:column;gap:4px;color:#cfd8dc}.object-config-select{width:100%;padding:4px 6px;border-radius:4px;border:1px solid #334155;background:#172030;color:#e8f1ff}.object-config-textarea{width:100%;min-height:84px;padding:6px;border-radius:4px;border:1px solid #334155;background:#0f172a;color:#e8f1ff;font-family:var(--ui-font-family);resize:vertical}.object-config-hint{color:var(--muted);text-align:right}.object-status{color:#eceff1}.object-status.is-on{color:#8be9a5}.npc-conditional-group{display:grid;gap:6px;margin:8px 0}.npc-conditional-section{display:grid;gap:8px}.npc-conditional-section[hidden]{display:none}.npc-conditional-toggle{margin:8px 0}.npc-conditional-toggle button{width:100%;padding:8px 10px;border:1px dashed var(--border);border-radius:6px;background:#0f121d80;color:var(--muted);cursor:pointer;transition:border-color .2s ease,color .2s ease,background .2s ease}.npc-conditional-toggle button[aria-expanded=true]{border-style:solid;border-color:var(--accent);color:var(--accent);background:#64b5f614}.npc-conditional-toggle button:hover,.npc-conditional-toggle button:focus-visible{border-color:var(--accent);color:var(--accent);background:#64b5f614;outline:2px solid var(--accent);outline-offset:2px}.npc-reward-group{display:grid;gap:6px;margin:8px 0}.npc-reward-group select,.npc-conditional-group select,.npc-conditional-group textarea{width:100%}.npc-extra{color:var(--muted)}.project-actions{display:grid;gap:0}.project-tabs{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(120px,100%),1fr));gap:4px;padding:8px 8px 0;border-bottom:2px solid var(--border);background:linear-gradient(180deg,#141a24f5,#11151df5)}.project-tab-button{min-width:0;min-height:0;padding:8px 12px 7px;margin:0;border:2px solid var(--border);border-bottom:none;background:#141a24;color:var(--text);cursor:pointer;text-align:center;line-height:var(--lh-text);position:relative;top:2px;white-space:normal;overflow-wrap:anywhere;text-wrap:balance}.project-tab-button.active{background:var(--panel);border-color:var(--accent);color:#fff;z-index:1}@media(hover:hover){.project-tab-button:hover{background:#1b2230;border-color:var(--accent);color:#fff}}.project-tab-button:focus-visible{outline:2px solid var(--accent);outline-offset:2px;z-index:2}.project-tab-panel{display:none;margin-top:-2px;padding:10px 0 0;border-top:2px solid var(--border);background:var(--panel)}.project-tab-panel.active{display:block}@media(max-width:1280px){.project-tabs{grid-template-columns:repeat(auto-fit,minmax(min(108px,100%),1fr))}}.project-field{display:flex;flex-direction:column;gap:4px;flex:1 1 220px;min-width:200px}.project-field--share-url{flex-basis:100%}.project-field span{color:var(--muted)}.project-field input,.project-field select{width:100%;padding:8px 10px;border-radius:8px;border:1px solid var(--border);background:var(--panel);color:var(--text);box-sizing:border-box}.project-field--share-url input{cursor:text;-webkit-user-select:text;user-select:text}.project-tab-panel>.project-group>button{width:100%}.project-group{flex:1 1 100%;display:flex;flex-direction:column;gap:8px}.project-group .project-field{flex:0 0 auto;min-width:0;width:100%}.project-group__title{margin:0;padding:8px 12px;color:var(--accent);letter-spacing:var(--ls-px-lg);border-left:3px solid var(--accent);background:#5bfa8e0d}.project-share-hint{flex:1 1 100%;color:var(--muted);margin:4px 0}.project-variables{flex:1 1 100%;background:linear-gradient(135deg,#212635cc,#181c28e6);border:1px solid var(--border);border-radius:12px;padding:12px;display:flex;flex-direction:column;gap:10px}.project-variables__header{display:flex;align-items:center;justify-content:space-between;gap:8px}body.game-mode .tabs{border:2px solid #2a2f3a;border-radius:0;box-shadow:none;background:var(--panel);background-image:none;font-family:var(--ui-font-family)}body.game-mode .tabs-title{color:#fff;letter-spacing:var(--ls-wide)}body.game-mode .tab-button,body.game-mode .tab-action-button{border:2px solid #2a2f3a;border-radius:0;box-shadow:none;background:#141a24;background-image:none;color:#fff;letter-spacing:var(--ls-normal);font-family:var(--ui-font-family)}body.game-mode .tab-button.active{background:#1f2735;border-color:#5bfa8e;color:#fff}@media(hover:hover){body.game-mode .tab-button:hover,body.game-mode .tab-action-button:hover{background:#1f2735;border-color:#5bfa8e;color:#fff}}.project-variables__title{font-weight:var(--fw-bold);letter-spacing:var(--ls-px-sm)}.project-variables__toggle{align-self:stretch;padding:10px 12px;border-radius:10px;border:1px solid var(--border);background:#ffffff0f;color:var(--text);cursor:pointer;transition:background .12s ease,border-color .12s ease;display:flex;align-items:center;justify-content:space-between;gap:10px;text-align:left;font-weight:var(--fw-bold)}.project-variables__toggle:hover{background:#ffffff1a;border-color:#ffffff29}.project-variables__summary{color:var(--muted)}.project-variables__list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:8px}.project-variable-item{display:flex;align-items:center;gap:10px;padding:10px;border-radius:10px;border:1px solid rgba(255,255,255,.06);background:var(--panel)}.project-variable-color{width:16px;height:16px;border-radius:999px;border:1px solid rgba(255,255,255,.25);background:var(--muted);box-shadow:0 0 0 2px #ffffff08}.project-variable-name{flex:1;font-weight:var(--fw-medium);letter-spacing:var(--ls-px-sm)}.project-variable-badge{padding:6px 10px;border-radius:999px;font-weight:var(--fw-bold);letter-spacing:var(--ls-px-sm);border:1px solid rgba(255,255,255,.08)}.project-variable-badge.in-use{color:#a1f5c2;background:#47c48624;border-color:#47c48666}.project-variable-badge.unused{color:#f7c97c;background:#f7c97c24;border-color:#f7c97c59}.project-variables.is-collapsed .project-variables__list{display:none}.project-skills__list{gap:10px}.project-skills-reset-btn{align-self:stretch;padding:7px 12px;border-radius:8px;border:1px solid rgba(255,255,255,.08);background:transparent;color:var(--muted);cursor:pointer;text-align:center;opacity:.8;transition:background .12s ease,border-color .12s ease,opacity .12s ease}@media(hover:hover){.project-skills-reset-btn:hover{background:#ffffff0d;border-color:#ffffff26;opacity:1}}.project-skill-group{display:flex;flex-direction:column;gap:8px}.project-skill-group-title{font-weight:var(--fw-bold);letter-spacing:var(--ls-px-sm);color:var(--text)}.project-skill-item{display:grid;grid-template-columns:auto auto minmax(0,1fr) auto auto;grid-template-rows:auto auto;gap:5px 8px;padding:12px 14px;border-radius:10px;border:1px solid rgba(255,255,255,.08);background:var(--panel);transition:opacity .15s,background .12s ease,border-color .12s ease;-webkit-user-select:none;user-select:none;touch-action:none}@media(hover:hover){.project-skill-item:not(.is-dragging):hover{background:#ffffff08;border-color:#ffffff21}}.project-skill-drag-handle{grid-column:1;grid-row:1 / span 2;align-self:center;color:var(--muted);cursor:grab;padding:0 4px;opacity:.35;line-height:var(--lh-tight);transition:opacity .1s ease}@media(hover:hover){.project-skill-drag-handle:hover{opacity:.75}}.project-skill-drag-handle:active{cursor:grabbing;opacity:1}.project-skill-icon{grid-column:2;grid-row:1 / span 2;align-self:center;line-height:var(--lh-tight)}.project-skill-name{grid-column:3;grid-row:1;display:flex;align-items:center;font-weight:var(--fw-bold);letter-spacing:var(--ls-px-sm);align-self:end;min-width:0}.project-skill-level-badge{grid-column:4;grid-row:1;align-self:end;white-space:nowrap;font-weight:var(--fw-bold);letter-spacing:var(--ls-px-md);padding:2px 8px;border-radius:999px;background:#5bfa8e1a;color:var(--accent);border:1px solid rgba(91,250,142,.22)}.project-skill-desc{grid-column:3 / span 2;grid-row:2;display:flex;align-items:flex-start;color:var(--muted);line-height:var(--lh-relaxed);margin:0;align-self:start;opacity:.7;min-width:0}.project-skill-field-text{min-width:0;overflow-wrap:anywhere}.project-skill-name .project-skill-field-text{overflow:hidden;overflow-wrap:normal;text-overflow:ellipsis;white-space:nowrap}.project-skill-field-controls{display:inline-flex;grid-column:5;align-items:center;justify-content:flex-end;gap:6px;min-width:32px}.project-skill-field-controls--name{grid-row:1;align-self:center}.project-skill-field-controls--description{grid-row:2;align-self:start}.project-skill-edit-btn{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:28px;height:28px;padding:0;border:1px solid rgba(255,255,255,.14);border-radius:6px;background:#ffffff0e;color:#ffffffc7;cursor:pointer;line-height:var(--lh-tight);opacity:1;transition:color .15s,background .15s,border-color .15s,transform .15s}.project-skill-action-icon{display:block;width:15px;height:15px;pointer-events:none}@media(hover:hover){.project-skill-edit-btn:hover,.project-skill-reset-field-btn:hover{color:var(--accent);border-color:#5bfa8e52;background:#5bfa8e1a;transform:translateY(-1px)}}@media(pointer:coarse){.project-skill-edit-btn{display:inline-flex;min-width:44px;min-height:44px;padding:0}}@media(pointer:coarse){.project-skill-drag-handle,.project-skill-icon{grid-row:1 / span 3}.project-skill-name{grid-column:3 / span 2;grid-row:1;align-self:end}.project-skill-name .project-skill-field-text{white-space:normal;overflow:visible;overflow-wrap:break-word;text-overflow:clip}.project-skill-level-badge{grid-column:3;grid-row:2;align-self:center;justify-self:start}.project-skill-desc{grid-column:3 / span 2;grid-row:3}.project-skill-edit-controls{grid-row:1 / span 3}}.project-skill-custom-dot{flex-shrink:0;margin-right:5px;color:var(--accent);line-height:var(--lh-tight)}.project-skill-reset-field-btn{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:28px;height:28px;padding:0;border:1px solid rgba(255,255,255,.14);border-radius:6px;background:#ffffff0e;color:#ffffffc7;cursor:pointer;line-height:var(--lh-tight);opacity:1;transition:color .15s,background .15s,border-color .15s,transform .15s}@media(pointer:coarse){.project-skill-reset-field-btn{min-width:44px;min-height:44px;padding:0}}.project-skill-edit-btn:focus-visible,.project-skill-reset-field-btn:focus-visible,.project-skill-confirm-btn:focus-visible,.project-skill-cancel-btn:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.project-skill-item--editing{border-left:2px solid var(--accent);touch-action:auto}.project-skill-item--editing .project-skill-drag-handle{pointer-events:none;opacity:.3}.project-skill-item--editing .project-skill-field-controls{visibility:hidden}.project-skill-field-editor{display:flex;flex-direction:column;gap:4px;width:100%;min-width:0;margin:0;padding:0}.project-skill-field-editor--name{grid-column:3 / span 2;grid-row:1;align-self:end}.project-skill-field-editor--description{grid-column:3 / span 2;grid-row:2;align-self:start}.project-skill-field-input{width:100%;padding:0 0 3px;border:0;border-bottom:1.5px solid var(--accent);border-radius:0;outline:none;background:transparent;color:inherit;font:inherit;font-weight:inherit;caret-color:var(--accent);-webkit-appearance:none}.project-skill-field-input::placeholder{color:var(--muted);opacity:.55}.project-skill-field-footer{display:flex;align-items:center;justify-content:flex-end;gap:6px}.project-skill-char-counter{color:var(--muted);font-variant-numeric:tabular-nums;-webkit-user-select:none;user-select:none}.project-skill-char-counter--near-limit{color:var(--accent)}.project-skill-confirm-btn,.project-skill-cancel-btn{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;padding:2px 7px;border:0;border-radius:3px;background:none;cursor:pointer}.project-skill-confirm-btn{color:var(--accent)}.project-skill-cancel-btn{color:var(--muted)}@media(hover:hover){.project-skill-confirm-btn:hover{background:#5bfa8e1f}.project-skill-cancel-btn:hover{background:#ffffff0f;color:var(--fg)}}@media(pointer:coarse){.project-skill-confirm-btn,.project-skill-cancel-btn{min-width:44px;min-height:44px;padding:0 12px;border-radius:6px}.project-skill-confirm-btn{border:1px solid rgba(91,250,142,.3);background:#5bfa8e1f}.project-skill-cancel-btn{border:1px solid rgba(255,255,255,.1);background:#ffffff0a;color:var(--fg)}}.project-skill-item.is-dragging{opacity:.25;border-style:dashed;border-color:#ffffff1a;background:transparent}.project-skill-item.is-drag-ghost{position:fixed;pointer-events:none;z-index:9999;opacity:.95;box-shadow:0 12px 32px #00000080,0 4px 12px #00000040;transform:scale(1.03) rotate(.75deg);cursor:grabbing}.project-skill-item.is-drag-over-above{border-top:2px solid var(--accent, #29adff)}.project-skill-item.is-drag-over-below{border-bottom:2px solid var(--accent, #29adff)}.project-test{gap:8px}.project-test__panel{display:flex;flex-direction:column;gap:10px}.project-test__hint{margin:0;color:var(--muted)}.project-test__field{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:10px;border:1px solid rgba(255,255,255,.08);background:var(--panel)}.project-test__field select{flex:1;max-width:160px}.project-test__checkbox,.project-variables__checkbox{cursor:pointer;-webkit-user-select:none;user-select:none}.project-test__checkbox input,.project-variables__checkbox input{width:18px;height:18px}.project-variables__field{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:10px;border:1px solid rgba(255,255,255,.08);background:var(--panel)}.project-appearance__checkbox{margin-top:10px}.project-test__skills{display:flex;flex-direction:column;gap:8px}.project-test__skills-title{font-weight:var(--fw-bold);letter-spacing:var(--ls-px-sm)}.project-test__skill-list{list-style:none;padding:0;margin:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:8px}.project-test__skill{display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:10px;border:1px solid rgba(255,255,255,.08);background:var(--panel)}.project-test__skill input{width:16px;height:16px}.project-test__skill-label{display:flex;align-items:center;gap:6px;font-weight:var(--fw-medium)}.project-test.is-collapsed .project-test__panel{display:none}.enemies-panel{display:grid;gap:12px}.enemy-types{display:grid;gap:8px;max-height:min(40vh,260px);overflow-y:auto;padding-right:4px;grid-template-columns:1fr}.enemy-xp-block{display:flex;flex-direction:column;gap:6px;padding:10px 12px;border:1px solid var(--border);border-radius:8px;background:linear-gradient(135deg,#111827bf,#182134a6);grid-column:1 / -1;margin-bottom:6px}.enemy-xp-header{display:flex;align-items:center;justify-content:space-between;gap:8px;color:var(--text)}.enemy-xp-label{font-weight:var(--fw-medium);letter-spacing:var(--ls-px-md)}.enemy-xp-value{color:var(--muted)}.enemy-xp-track{position:relative;width:100%;height:12px;border-radius:999px;background:#ffffff14;overflow:hidden;box-shadow:inset 0 1px 2px #00000059}.enemy-xp-fill{position:absolute;inset:0;width:0%;background:linear-gradient(90deg,#5eead4,#22d3ee);box-shadow:0 0 8px #22d3ee73;transition:width .25s ease}.enemy-overlay{position:absolute;pointer-events:none}.enemy-overlay-remove{position:absolute;transform:translate(-90%,-40%);width:22px;height:22px;border-radius:50%;border:1px solid rgba(255,255,255,.5);background:#000000b3;color:#fff;line-height:20px;padding:0;cursor:pointer;pointer-events:auto}.enemy-overlay-remove:hover{background:#dc3545e6;border-color:#dc3545e6}.enemy-types::-webkit-scrollbar{width:6px}.enemy-types::-webkit-scrollbar-thumb{background:#232734;border-radius:999px}.enemy-card{display:flex;align-items:center;gap:10px;padding:10px 12px;background:var(--panel);border:4px solid var(--border);border-radius:8px;cursor:pointer;min-width:0;position:relative}.enemy-card.boss{background:#121923}.enemy-card:hover{border-color:#64b5f699}.enemy-card.selected{border-color:var(--accent);box-shadow:0 0 0 2px #64b5f626}.enemy-preview{width:56px;height:56px;border:none;border-radius:6px;background:#0f121d99;flex-shrink:0}.enemy-meta{display:grid;gap:8px;flex:1;min-width:0;overflow:hidden}.enemy-boss-badge{display:inline-flex;align-items:center;justify-content:center;padding:2px 6px;font-weight:var(--fw-bold);letter-spacing:var(--ls-px-lg);color:#fff;background:#1f7f4e;border-radius:0;width:fit-content}.enemy-name{font-weight:var(--fw-medium);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.enemy-damage{color:var(--accent)}.enemy-stats{margin-top:4px;color:var(--muted);line-height:var(--lh-normal)}.enemies-list{display:grid;gap:6px}.enemy-item{display:flex;flex-direction:column;gap:8px;padding:6px 8px;border:1px solid var(--border);border-radius:6px;background:#12162299}.enemy-item>span{flex:1 1 auto;text-align:left;line-height:var(--lh-normal)}.enemy-variable-wrapper{display:flex;align-items:center;gap:6px;color:var(--muted)}.enemy-variable-select{min-width:120px;padding:3px 6px;border-radius:4px;border:1px solid var(--border);background:#0f121dd9;color:var(--text)}.enemy-controls{display:flex;align-items:center;gap:10px;justify-content:space-between}.enemy-controls .enemy-variable-wrapper{flex:1}.enemy-remove{padding:4px 8px;border-radius:4px;border:1px solid var(--border);background:#0f121de6;color:var(--text);cursor:pointer}.tile-list,.npcs-list{display:grid;gap:8px;max-height:min(40vh,260px);overflow-y:auto;padding-right:4px}.npcs-list{grid-template-columns:repeat(2,minmax(0,1fr))}.tile-group{display:grid;gap:6px}.tile-group+.tile-group{margin-top:12px}.tile-group-title{margin:4px 0 0;font-weight:var(--fw-medium);letter-spacing:var(--ls-tight);color:var(--muted)}.tile-group:first-child .tile-group-title{margin-top:0}.tile-list::-webkit-scrollbar,.npcs-list::-webkit-scrollbar{width:6px}.tile-list::-webkit-scrollbar-thumb,.npcs-list::-webkit-scrollbar-thumb{background:#232734;border-radius:999px}.tile-card{display:flex;align-items:center;justify-content:center;padding:8px;width:92px;height:92px;appearance:none;-webkit-appearance:none;background:var(--panel);border:4px solid var(--border);border-radius:0;cursor:pointer;position:relative}.tile-card:hover{border-color:#64b5f699}.tile-card:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.npc-card{display:flex;align-items:center;gap:10px;padding:8px 10px;background:var(--panel);border:4px solid var(--border);border-radius:8px;cursor:pointer;position:relative}.tile-card.selected{border-color:var(--accent);background:#64b5f614;box-shadow:0 0 0 2px #64b5f626}.tile-card-select{display:flex;align-items:center;justify-content:center;width:100%;height:100%;padding:0;border:0!important;background:transparent;color:inherit}.tile-card-select:hover,.tile-card-select:focus,.tile-card-select:focus-visible{border:0!important;background:transparent!important;outline:none;box-shadow:none!important}.tile-card canvas{width:64px;height:64px;flex-shrink:0}.npc-card .meta{flex:1;display:grid;gap:8px}.tile-name{font-weight:var(--fw-medium);color:var(--text)}.npc-card .row{display:flex;flex-wrap:wrap;align-items:center;gap:6px;color:var(--muted)}.npc-card label{display:flex;align-items:center;gap:4px;cursor:pointer}.npc-card.selected{border-color:var(--accent);background:#64b5f61a;box-shadow:0 0 0 2px #64b5f626}.npc-card.npc-card-placed{border-color:#47c486b3!important;box-shadow:0 0 0 1px #47c4862e}.npc-card.npc-card-placed.selected{border-color:#47c486d1!important;box-shadow:0 0 0 1px #47c4863d,0 0 0 3px #47c48614}.npc-card .npc-preview{width:48px;height:48px;border:none;border-radius:4px;background:var(--panel);display:block;image-rendering:pixelated;flex-shrink:0}.world-panel{padding:4px 0}.world-grid{--world-cols: 3;display:grid;grid-template-columns:repeat(var(--world-cols),minmax(0,1fr));gap:6px}.world-cell{outline:none;border:1px solid var(--border);border-radius:6px;background:var(--panel);color:var(--muted);font-weight:var(--fw-medium);padding:10px 0;display:flex;flex-direction:column;align-items:center;gap:6px;cursor:pointer;transition:border-color .2s ease,background .2s ease}.world-cell:hover{border-color:var(--accent)}.world-cell.active{border-color:var(--accent);background:#64b5f61f;color:var(--text);box-shadow:0 0 0 2px #64b5f62e}.world-cell-label{letter-spacing:var(--ls-px-lg)}.world-cell-badges{display:flex;flex-wrap:wrap;gap:4px;justify-content:center}.world-cell-badge{padding:2px 6px;border-radius:999px;background:#64b5f62e;color:var(--text)}.world-cell .badge-start{background:#ffc10740;color:#ffecb3}.npc-card .npc-name{font-weight:var(--fw-medium);color:var(--text)}.npc-card .npc-position,.npc-card .npc-dialog{color:var(--muted)}.npc-card .npc-dialog{font-style:italic;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:150px}.npc-variant-selector{display:flex;align-items:center;gap:8px;justify-content:flex-start;margin-bottom:8px}.npc-variant-buttons{display:inline-flex;gap:6px}.npc-variant-button{padding:6px 10px;border:1px solid var(--border);border-radius:6px;background:var(--panel);color:var(--text);cursor:pointer;transition:border-color .2s ease,background .2s ease}.npc-variant-button:hover,.npc-variant-button:focus-visible{border-color:var(--accent);outline:none}.npc-variant-button.active{border-color:var(--accent);background:#64b5f61f;box-shadow:0 0 0 2px #64b5f62e}.object-category-selector{display:flex;align-items:center;gap:8px;justify-content:flex-start;margin-bottom:8px}.object-category-buttons{display:inline-flex;gap:6px}.object-category-button{padding:6px 10px;border:1px solid var(--border);border-radius:6px;background:var(--panel);color:var(--text);cursor:pointer;transition:border-color .2s ease,background .2s ease}.object-category-button:hover,.object-category-button:focus-visible{border-color:var(--accent);outline:none}.object-category-button.active{border-color:var(--accent);background:#64b5f61f;box-shadow:0 0 0 2px #64b5f62e}.npc-editor{display:grid;gap:8px}.npc-editor[hidden]{display:none!important}.npc-editor label{color:var(--muted)}.npc-editor textarea{min-height:140px}.npc-editor button{justify-self:flex-start}.json-editor{display:grid;gap:8px}.json-editor textarea{min-height:160px;font-family:var(--ui-font-family)}.app-footer{border-top:1px solid var(--border);color:var(--muted);padding:12px 16px;text-align:center}@media(min-width:1800px){.editor-layout{zoom:1.3}}@media(min-width:2000px){.editor-layout{zoom:1.4}}@media(min-width:2500px){.editor-layout{zoom:1.6}}@media(max-width:1200px){.editor-layout{grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-areas:"center center" "left right"}.editor-left,.editor-right{justify-self:stretch;max-width:none}.editor-center{justify-self:stretch}}@media(max-width:960px){main{padding:clamp(16px,5vw,24px)}.editor-layout{grid-template-columns:1fr;grid-template-areas:"center" "left" "right"}.editor-left,.editor-right{max-width:none}.editor-left,.editor-right,.editor-center{justify-self:stretch}}@media(max-width:920px){.editor-mobile-nav{display:flex}.editor-section[data-mobile-panel]{display:none}.editor-section[data-mobile-panel].is-mobile-active{display:block}.editor-left,.editor-right{width:100%}}@media(max-width:700px){header{justify-content:flex-start}header input{max-width:100%}.tab-button{flex:0 0 auto}.game-controls{flex-direction:column}.object-card{grid-template-columns:1fr;text-align:center}.object-preview{justify-self:center}.object-card .object-header{flex-direction:column;align-items:center;gap:4px}}@media(max-width:560px){header{padding:14px 16px}main{padding:16px 14px 28px}.tabs{gap:6px}.tab-button{flex:0 0 auto;min-width:auto}.npc-card{flex-direction:column;align-items:flex-start}.npc-card .npc-preview{margin-bottom:4px}.project-actions button{flex:1 1 100%}.tile-editor-controls{grid-template-columns:1fr}.tile-editor-controls .control-group:last-child{flex-direction:column}}.game-minimap{top:clamp(12px,3vw,28px);right:clamp(12px,4vw,32px);width:72px;height:72px;display:grid;grid-template-columns:repeat(3,1fr);gap:2px;padding:6px;border-radius:10px;background:#0a0d16b3;border:1px solid rgba(255,255,255,.08);pointer-events:none;z-index:3}.game-minimap-cell{width:16px;height:16px;border-radius:4px;background:#ffffff14;border:1px solid rgba(255,255,255,.12);box-shadow:inset 0 0 4px #00000059}.game-minimap-cell-active{background:#64b5f6e6;border-color:#64b5f6e6;box-shadow:0 0 6px #64b5f6a6,inset 0 0 4px #fff6}.world-cell:focus-visible{outline:2px solid var(--accent);outline-offset:2px}@media(max-width:960px){#editor-canvas{width:clamp(200px,80vw,320px)}}.tile-group-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(96px,max-content));gap:8px;justify-content:flex-start}.tile-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(92px,max-content));gap:8px;justify-content:flex-start}.project-palette{margin-bottom:16px}.project-palette__panel{padding:12px;background:var(--panel);border-radius:4px;margin-top:8px}.palette-header{display:flex;flex-direction:column;align-items:flex-start;margin-bottom:12px;gap:12px}.palette-description{color:var(--muted);margin:0;opacity:.7}.palette-reset-btn{display:inline-flex;align-self:flex-start;padding:6px 12px;background:#444;color:#fff;border:1px solid #666;border-radius:3px;cursor:pointer;transition:background .2s;white-space:nowrap}.palette-reset-btn:hover{background:#555}.palette-reset-btn:active{background:#333}.palette-grid{display:grid;grid-template-columns:repeat(6,24px);column-gap:8px;row-gap:18px}.palette-color-button{width:24px;height:24px;border:2px solid #444;border-radius:4px;cursor:pointer;position:relative;transition:transform .1s,border-color .2s}.palette-color-button:hover{transform:scale(1.1);border-color:#fff}.palette-color-button:active{transform:scale(.95)}.palette-color-button:after{content:attr(data-color-index);position:absolute;bottom:-16px;left:50%;transform:translate(-50%);color:#666}#skill-edit-modal{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;padding:16px;margin:0;background:#000c;z-index:1000}#skill-edit-modal[hidden]{display:none}#skill-edit-modal .skill-edit-modal__content{background:#0a0d16f2;border:1px solid var(--border);border-radius:10px;padding:10px;width:100%;max-width:420px;display:block}.skill-edit-modal__panel{border:2px solid var(--accent);border-radius:8px;background:var(--panel);padding:14px;margin:0;width:100%;box-sizing:border-box;display:flex;flex-direction:column;gap:12px}.skill-edit-modal__header{display:flex;justify-content:space-between;align-items:center;gap:12px;padding-bottom:8px;border-bottom:1px solid var(--border)}.skill-edit-modal__header h3{margin:0;color:var(--text)}.skill-edit-modal__fields{display:flex;flex-direction:column;gap:10px}.skill-edit-modal__field{display:flex;flex-direction:column;gap:5px}.skill-edit-modal__field label{display:block;font-weight:var(--fw-bold);letter-spacing:var(--ls-tight);color:var(--muted)}.skill-edit-modal__input{width:100%;padding:7px 10px;background:#0c0e18bf;border:1px solid var(--border);border-radius:6px;color:var(--text);font:inherit;box-sizing:border-box;outline:none;transition:border-color .15s;-webkit-appearance:none}.skill-edit-modal__input:focus{border-color:var(--accent);background:#0f121de6}.skill-edit-modal__input::placeholder{color:var(--muted);opacity:.5}.skill-edit-modal__icon-row{display:flex;align-items:center;gap:10px}.skill-edit-modal__icon-preview{line-height:var(--lh-tight);min-width:2.2rem;text-align:center;flex-shrink:0}.skill-edit-modal__input--icon{width:100px;text-align:center;flex:none}.skill-edit-modal__input--desc{resize:none;line-height:var(--lh-loose);min-height:4.5em;overflow-y:auto}.skill-edit-modal__counter{color:var(--muted);text-align:right;font-variant-numeric:tabular-nums;-webkit-user-select:none;user-select:none;line-height:var(--lh-tight)}.skill-edit-modal__counter--near-limit{color:var(--accent)}.skill-edit-modal__actions{display:flex;flex-direction:column;gap:8px;border-top:1px solid var(--border);padding-top:10px}.skill-edit-modal__actions-right{display:flex;gap:8px}.skill-edit-modal__actions-right button{flex:1}#skill-edit-restore{width:100%}.skill-edit-modal__actions button{min-height:40px;padding:10px 12px;font-weight:var(--fw-bold);border-radius:4px;cursor:pointer;transition:background .2s}@media(max-width:768px){#skill-edit-modal .skill-edit-modal__content{width:100%;max-width:none}}@media(pointer:coarse){.skill-edit-modal__actions button{min-height:44px}}.project-skill-edit-controls{grid-column:5;grid-row:1 / span 2;display:flex;align-items:center;justify-content:center}#color-picker-modal{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;padding:16px;margin:0;background:#000c;z-index:1000}#color-picker-modal[hidden]{display:none}#color-picker-modal .color-picker-content{background:#0a0d16f2;border:1px solid var(--border);border-radius:10px;padding:10px;width:100%;max-width:460px;display:block}.color-picker-panel{border:2px solid var(--accent);border-radius:8px;background:var(--panel);padding:14px;margin:0;width:100%;box-sizing:border-box;display:flex;flex-direction:column;gap:12px}.color-picker-header{display:flex;justify-content:space-between;align-items:center;gap:12px;padding-bottom:8px;border-bottom:1px solid var(--border)}.color-picker-header h3{margin:0;color:var(--text)}.color-index-label{color:var(--text);background:#0f121dd9;padding:4px 8px;border-radius:3px;border:1px solid var(--border)}.color-picker-preview{margin:0}.color-preview-box{display:grid;gap:12px;border:1px solid var(--border);border-radius:8px;background:#0c0e18bf;padding:10px;margin:0}.color-preview-row{display:flex;align-items:center;justify-content:space-between;gap:12px;background:#0f121dbf;border:1px solid var(--border);border-radius:6px;padding:10px}.color-preview-meta{display:grid;gap:6px}.color-preview-label{display:block;font-weight:var(--fw-bold);letter-spacing:var(--ls-xs);color:#f2f2f2;min-width:68px}.color-preview-value{display:block;font-family:var(--ui-font-family);color:var(--text)}.color-preview-swatch{width:72px;height:42px;border:1px solid var(--border);border-radius:4px;box-shadow:inset 0 0 0 1px #00000073}.color-picker-input{width:100%;height:50px;padding:0;border:1px solid var(--border);border-radius:4px;cursor:pointer;margin:0;box-sizing:border-box;background:#0f121de6;appearance:none;-webkit-appearance:none}.color-picker-input::-webkit-color-swatch-wrapper{padding:0}.color-picker-input::-webkit-color-swatch{border:none}.color-picker-input::-moz-color-swatch{border:none}.color-picker-actions{display:flex;gap:12px;border-top:1px solid var(--border);padding-top:10px}.color-picker-actions button{flex:1;min-height:40px;padding:10px 12px;font-weight:var(--fw-bold);border-radius:4px;cursor:pointer;transition:background .2s}.btn-secondary{background:#0f121de6;color:var(--text);border:1px solid var(--border)}.btn-secondary:hover{background:#64b5f629;border-color:#64b5f673}.btn-primary{background:#64b5f633;color:#fff;border:1px solid rgba(100,181,246,.45)}.btn-primary:hover{background:#64b5f64d}@media(max-width:768px){.palette-grid{grid-template-columns:repeat(6,20px);column-gap:8px;row-gap:16px}.palette-color-button{width:20px;height:20px}#color-picker-modal .color-picker-content{width:100%;max-width:none}}.tile-card,.npc-card,.enemy-card,.object-type-card{position:relative}.sprite-edit-btn{position:absolute;top:4px;right:4px;width:20px;height:20px;padding:0;display:flex;align-items:center;justify-content:center;border:1px solid rgba(255,255,255,.4);background:#0000008c;color:#fff;cursor:pointer;opacity:0;z-index:10;line-height:var(--lh-tight);text-align:center;box-shadow:0 0 0 1px #00000040;transition:opacity .1s,background .1s,border-color .1s}.tile-card.selected .sprite-edit-btn,.npc-card.selected .sprite-edit-btn,.enemy-card.selected .sprite-edit-btn,.object-type-card.selected .sprite-edit-btn{opacity:1}.pixel-art-editor-modal{position:fixed;inset:0;background:#000000bf;display:flex;align-items:center;justify-content:center;z-index:1000}.pixel-art-editor-modal[hidden]{display:none}.pixel-art-editor{background:var(--panel, #1a1c2c);border:2px solid var(--border, #333);padding:16px;display:flex;flex-direction:column;gap:8px;min-width:320px}.pae-header{display:flex;justify-content:space-between;align-items:center}.pae-title{font-weight:var(--fw-bold);letter-spacing:var(--ls-mono)}.pae-close{cursor:pointer;background:none;border:none;color:inherit;padding:2px 6px}.pae-editor-area{display:flex;align-items:center;justify-content:center;width:100%}#pae-canvas{display:block;cursor:crosshair;image-rendering:pixelated}.pae-palette{display:flex;flex-wrap:wrap;gap:2px}.pae-frame-bar{display:flex;gap:4px;flex-wrap:wrap}.pae-frame-bar[hidden]{display:none}.pae-frame-btn{cursor:pointer;padding:4px 8px;border:2px solid var(--border, #333);background:var(--panel, #1a1c2c);color:inherit}.pae-frame-btn.active{background:var(--accent, #29adff);color:#000}.pae-palette-swatch{width:16px;height:16px;cursor:pointer;border:2px solid transparent}.pae-palette-swatch.active{border-color:#fff}.pae-tools{display:flex;gap:4px}.pae-tool{cursor:pointer;padding:4px 8px;border:2px solid var(--border, #333);background:var(--panel, #1a1c2c);color:inherit}.pae-tool.active{background:var(--accent, #29adff);color:#000}.pae-actions{display:flex;gap:4px;justify-content:flex-end}.pae-save-btn{background:var(--accent, #29adff);color:#000;border:none;padding:4px 12px;cursor:pointer;font-weight:var(--fw-bold)}.project-save-toast{position:fixed;bottom:24px;right:24px;padding:10px 18px;border-radius:4px;font-weight:var(--fw-medium);color:#fff;z-index:9999;pointer-events:none;animation:toast-in .2s ease,toast-out .3s ease 2.7s forwards}.project-save-toast--success{background:#1a6b3c}.project-save-toast--error{background:#8b1a1a}.project-save-toast--info{background:#1a3a6b}@keyframes toast-in{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes toast-out{0%{opacity:1}to{opacity:0}}.explore-modal{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:#000000e0;z-index:1000;padding:16px}.explore-modal[hidden]{display:none}.explore-modal__panel{display:flex;flex-direction:column;width:100%;max-width:900px;max-height:85vh;background:var(--panel);border:2px solid var(--accent);overflow:hidden}.explore-modal__header{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:2px solid var(--border);flex-shrink:0;gap:12px}.explore-modal__title-group{display:flex;flex-direction:column;gap:2px;min-width:0}.explore-modal__title{color:var(--accent);margin:0}.explore-modal__subtitle{margin:0;color:var(--muted);opacity:.55;font-size:.85em;line-height:var(--lh-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.explore-modal__close{background:none;border:none;color:var(--text);cursor:pointer;font-family:var(--ui-font-family);line-height:var(--lh-tight);padding:4px 8px;opacity:.7;flex-shrink:0}.explore-modal__close:hover,.explore-modal__close:focus{opacity:1;color:var(--accent);outline:none}.explore-modal__body{overflow-y:auto;padding:16px;flex:1;min-height:0}.explore-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.explore-card{display:flex;flex-direction:column;background:var(--bg);border:2px solid var(--border);cursor:pointer;text-align:left;font-family:var(--ui-font-family);color:var(--text);padding:0;transition:border-color .1s}.explore-card:hover,.explore-card:focus{border-color:var(--accent);outline:none}.explore-card__cover{width:100%;aspect-ratio:1 / 1;background:var(--border);display:flex;align-items:center;justify-content:center;overflow:hidden;flex-shrink:0}.explore-card__img{width:100%;height:100%;object-fit:cover;display:block}.explore-card__no-cover{opacity:.2;color:var(--text);pointer-events:none}.explore-card__preview-placeholder{display:block;width:100%;height:100%;background:var(--border);position:relative;overflow:hidden}.explore-card__preview-placeholder:after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,.06) 50%,transparent 100%);animation:preview-shimmer 1.4s infinite}@keyframes preview-shimmer{0%{transform:translate(-100%)}to{transform:translate(100%)}}.explore-card__img--hidden{display:none}.explore-card__img{animation:preview-fade-in .2s ease}@keyframes preview-fade-in{0%{opacity:0}to{opacity:1}}.explore-card__info{padding:10px;display:flex;flex-direction:column;gap:6px}.explore-card__title{color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:var(--lh-text)}.explore-card__author{color:var(--accent);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:var(--lh-text)}.explore-card__desc{color:var(--muted);opacity:.6;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.explore-card__itch-link{display:inline-block;margin-top:2px;color:var(--muted);opacity:.55;font-size:.85em;text-decoration:none;line-height:var(--lh-text);transition:opacity .15s}.explore-card__itch-link:hover,.explore-card__itch-link:focus{opacity:1;color:var(--accent);outline:none}.explore-loading{display:flex;align-items:center;justify-content:center;padding:40px}.explore-loading[hidden]{display:none}.explore-spinner{display:block;width:24px;height:24px;border:3px solid var(--border);border-top-color:var(--accent);border-radius:50%;animation:explore-spin .8s linear infinite}@keyframes explore-spin{to{transform:rotate(360deg)}}.explore-empty{text-align:center;padding:40px 16px;opacity:.5}.explore-footer{margin-top:16px;display:flex;justify-content:center}.explore-load-more{background:none;border:2px solid var(--accent);color:var(--accent);font-family:var(--ui-font-family);padding:8px 20px;cursor:pointer;transition:background .1s,color .1s}.explore-load-more:hover,.explore-load-more:focus{background:var(--accent);color:var(--bg);outline:none}.tab-action-button--explore{color:var(--accent)}.explore-back-banner{display:flex;justify-content:center;padding:8px 12px;border-bottom:1px solid var(--border)}.explore-back-banner[hidden]{display:none}.explore-back-btn{font-family:var(--ui-font-family);font-weight:var(--fw-medium);cursor:pointer;padding:6px 16px;min-height:32px;border-radius:4px;transition:background .2s}.explore-back-btn:focus-visible{outline:2px solid var(--accent);outline-offset:2px}@media(max-width:640px){.explore-grid{grid-template-columns:repeat(2,1fr)}.explore-modal__panel{max-height:90vh}}@media(max-width:380px){.explore-grid{grid-template-columns:1fr}}
