:root{color-scheme:light;--ink:#20242c;--muted:#626b78;--paper:#f4ecdd;--panel:#fffaf0;--line:#d8ccba;--blue:#1f7bbf;--shadow:0 18px 45px rgba(49, 40, 27, 0.16)}*{box-sizing:border-box}body{margin:0;min-width:320px;color:var(--ink);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:linear-gradient(rgba(39,125,161,.08) 1px,transparent 1px),linear-gradient(90deg,rgba(39,125,161,.08) 1px,transparent 1px),#efe6d5;background-size:28px 28px}button{min-height:40px;padding:0 16px;border:1px solid #bfae99;border-radius:7px;background:#fff8ea;color:var(--ink);box-shadow:0 2px 0 #cbbba7;cursor:pointer;font:inherit}button:hover{background:#fff3d8}button:active{transform:translateY(1px);box-shadow:0 1px 0 #cbbba7}button.primary{border-color:#125f93;background:var(--blue);color:#fff;box-shadow:0 2px 0 #0e5687}.shell{width:min(1080px,calc(100vw - 28px));margin:14px auto}.topbar{display:flex;align-items:center;flex-wrap:wrap;justify-content:space-between;gap:10px;min-height:28px;margin-bottom:7px}.brand{display:flex;align-items:baseline;min-width:0;gap:7px}.brand-mark{position:relative;flex:0 0 auto;align-self:center;width:24px;height:24px;border:1.5px solid #1f2a33;border-radius:50%;background:radial-gradient(circle at 35% 35%,#fff 0 8%,transparent 9%),radial-gradient(circle at 50% 52%,#98d8ff 0 34%,#2f92ce 35% 57%,#17618e 58%);box-shadow:inset -4px -5px 0 rgba(0,0,0,.14),0 2px 0 rgba(34,31,25,.14)}h1,h2,p{margin:0}h1{overflow:hidden;font-size:clamp(1.25rem, 2vw, 1.65rem);line-height:1;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.app-version{flex:0 0 auto;align-self:baseline;color:var(--muted);font-size:.68rem;font-weight:700;line-height:1}.controls{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px}.controls[hidden]{display:none}.stage-panel{overflow:hidden;border:1px solid var(--line);border-radius:8px;background:var(--panel);box-shadow:var(--shadow)}.world-bar{display:flex;align-items:center;justify-content:flex-end;gap:16px;padding:14px;border-bottom:1px solid var(--line)}.world-buttons{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px}.world-buttons button[aria-pressed=true]{border-color:#125f93;background:#eaf6ff;color:#125f93}.scene{--render-aspect:calc(1000 / 620);position:relative;width:100%;aspect-ratio:1000/620;background:var(--paper)}.scene.is-fallback-fullscreen,.scene:-webkit-full-screen,.scene:fullscreen{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;width:100vw;width:100dvw;height:100vh;height:100dvh;aspect-ratio:auto;background:linear-gradient(rgba(39,125,161,.08) 1px,transparent 1px),linear-gradient(90deg,rgba(39,125,161,.08) 1px,transparent 1px),var(--paper);background-size:28px 28px}.is-fallback-fullscreen body{overflow:hidden}.scene canvas{display:block;width:100%;height:auto}.scene.is-fallback-fullscreen canvas,.scene:-webkit-full-screen canvas,.scene:fullscreen canvas{width:min(100vw,calc(100vh * var(--render-aspect)))!important;width:min(100dvw,calc(100dvh * var(--render-aspect)))!important;height:min(100vh,calc(100vw / var(--render-aspect)))!important;height:min(100dvh,calc(100dvw / var(--render-aspect)))!important;max-width:100vw;max-width:100dvw;max-height:100vh;max-height:100dvh;box-shadow:0 18px 48px rgba(49,40,27,.18)}.canvas-toolbar{position:absolute;top:10px;right:10px;z-index:5;display:flex;gap:7px;padding:6px;border:1px solid rgba(98,74,48,.18);border-radius:8px;background:rgba(255,250,240,.72);box-shadow:0 10px 24px rgba(49,40,27,.16);backdrop-filter:blur(10px)}.canvas-palette-toolbar{position:absolute;top:10px;right:340px;z-index:5;display:flex;gap:7px;padding:6px;border:1px solid rgba(98,74,48,.18);border-radius:8px;background:rgba(255,250,240,.72);box-shadow:0 10px 24px rgba(49,40,27,.16);opacity:0;pointer-events:none;transform:translateY(-4px);transition:opacity 120ms ease,transform 120ms ease;backdrop-filter:blur(10px)}.scene.is-editor-mode .canvas-palette-toolbar{opacity:1;pointer-events:auto;transform:translateY(0)}.scene.is-fallback-fullscreen .canvas-toolbar,.scene:-webkit-full-screen .canvas-toolbar,.scene:fullscreen .canvas-toolbar{top:max(12px,env(safe-area-inset-top));right:max(12px,env(safe-area-inset-right))}.scene.is-fallback-fullscreen .canvas-palette-toolbar,.scene:-webkit-full-screen .canvas-palette-toolbar,.scene:fullscreen .canvas-palette-toolbar{top:max(12px,env(safe-area-inset-top));right:calc(max(12px,env(safe-area-inset-right)) + 330px)}.canvas-zoom-control{position:absolute;top:72px;right:10px;z-index:5;display:grid;justify-items:center;gap:7px;width:44px;padding:5px;border:1px solid rgba(76,61,46,.1);border-radius:8px;background:rgba(255,250,240,.34);box-shadow:0 8px 22px rgba(49,40,27,.1);backdrop-filter:blur(7px)}.scene.is-fallback-fullscreen .canvas-zoom-control,.scene:-webkit-full-screen .canvas-zoom-control,.scene:fullscreen .canvas-zoom-control{top:calc(max(12px,env(safe-area-inset-top)) + 60px);right:max(12px,env(safe-area-inset-right))}.canvas-share-button{position:absolute;right:10px;bottom:10px;z-index:5;display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:38px;max-width:min(320px,calc(100% - 20px));padding:0 12px;border-color:rgba(80,64,48,.22);border-radius:7px;background:rgba(255,250,240,.34);box-shadow:inset 0 1px 0 rgba(255,255,255,.68),0 8px 22px rgba(49,40,27,.1);color:var(--ink);font-size:.86rem;font-weight:700;line-height:1;touch-action:manipulation;backdrop-filter:blur(7px)}.canvas-share-button:hover{background:rgba(255,251,244,.62)}.scene.is-fallback-fullscreen .canvas-share-button,.scene:-webkit-full-screen .canvas-share-button,.scene:fullscreen .canvas-share-button{right:max(12px,env(safe-area-inset-right));bottom:max(12px,env(safe-area-inset-bottom))}.canvas-share-status{color:#5f7b4a;font-size:.72rem;font-weight:700;white-space:nowrap}.canvas-credit{position:absolute;left:10px;bottom:12px;z-index:5;max-width:min(320px,calc(100% - 20px));color:rgba(32,36,44,.58);font-size:.78rem;font-weight:600;line-height:1.2;text-shadow:0 1px 0 rgba(255,250,240,.6)}.canvas-credit a{color:rgba(32,36,44,.72);text-decoration:underline;text-underline-offset:2px}.canvas-credit a:hover{color:var(--ink)}.scene.is-fallback-fullscreen .canvas-credit,.scene:-webkit-full-screen .canvas-credit,.scene:fullscreen .canvas-credit{left:max(12px,env(safe-area-inset-left));bottom:max(12px,env(safe-area-inset-bottom))}.canvas-zoom-control .canvas-tool-button{width:34px;height:34px;min-height:34px;border-color:rgba(80,64,48,.22);border-radius:7px;background:rgba(255,251,244,.62);box-shadow:inset 0 1px 0 rgba(255,255,255,.68),0 2px 8px rgba(67,53,39,.12)}.canvas-tool-button{position:relative;display:grid;place-items:center;width:38px;height:38px;min-height:38px;padding:0;border-color:rgba(110,83,54,.42);border-radius:7px;background:linear-gradient(180deg,rgba(255,255,255,.84),rgba(255,239,210,.88));box-shadow:inset 0 1px 0 rgba(255,255,255,.8),0 2px 0 rgba(177,148,111,.65);touch-action:manipulation}.canvas-tool-button[hidden]{display:none}.canvas-tool-button:hover{background:linear-gradient(180deg,rgba(255,255,255,.94),rgba(255,231,190,.92))}.canvas-tool-button:disabled{cursor:default;opacity:.42;transform:none}.canvas-tool-button[aria-pressed=true]{border-color:rgba(18,95,147,.58);background:linear-gradient(180deg,rgba(235,249,255,.94),rgba(194,231,255,.92));color:#125f93}.tool-icon{position:relative;display:block;width:18px;height:18px;color:currentColor}.tool-svg{width:22px;height:22px;color:currentColor;fill:none;stroke:currentColor;stroke-width:2.8;stroke-linecap:square;stroke-linejoin:miter}.tool-svg-pencil{stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}.tool-svg-follow{stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}.tool-svg-drop{stroke-width:2.3;stroke-linecap:round;stroke-linejoin:round}.tool-svg-save-load{stroke-width:2.2;stroke-linecap:square;stroke-linejoin:miter}.tool-svg-share{flex:0 0 auto;width:19px;height:19px;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}.tool-svg-menu-toggle{stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}.tool-svg-close{stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}.tool-symbol{display:block;font-size:1.55rem;font-weight:700;line-height:1}.zoom-track{display:grid;justify-items:center;align-content:space-between;width:34px;height:92px;padding:4px 0;cursor:ns-resize;touch-action:none}.zoom-mark{position:relative;width:4px;height:4px;border-radius:999px;background:rgba(83,78,72,.42);box-shadow:none;transition:width 120ms ease,height 120ms ease,background-color 120ms ease,opacity 120ms ease}.zoom-mark.is-current{width:16px;height:5px;border-radius:999px;background:rgba(56,53,49,.62);box-shadow:0 1px 2px rgba(39,34,29,.16),inset 0 1px 0 rgba(255,255,255,.28)}.zoom-mark.is-current::before{content:"";position:absolute;left:50%;top:50%;width:34px;height:18px;transform:translate(-50%,-50%)}.zoom-track.is-dragging .zoom-mark.is-current{background:rgba(45,43,40,.72)}.tool-icon-play{width:0;height:0;margin-left:3px;border-top:9px solid transparent;border-bottom:9px solid transparent;border-left:14px solid currentColor}.tool-icon-pause::after,.tool-icon-pause::before{content:"";position:absolute;top:1px;width:5px;height:16px;border-radius:2px;background:currentColor}.tool-icon-pause::before{left:3px}.tool-icon-pause::after{right:3px}.readout{display:block;min-height:38px;padding:10px 14px;border-top:1px solid var(--line);color:var(--muted);font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:.9rem;white-space:pre-wrap}.readout[hidden]{display:none}.is-menu-hidden .canvas-palette-toolbar,.is-menu-hidden .canvas-share-button,.is-menu-hidden .canvas-zoom-control{display:none}.is-menu-hidden .canvas-toolbar .canvas-tool-button:not(.canvas-menu-toggle-button){display:none}.is-menu-hidden .canvas-toolbar{right:10px;gap:0}.is-menu-hidden .scene.is-fallback-fullscreen .canvas-toolbar,.is-menu-hidden .scene:-webkit-full-screen .canvas-toolbar,.is-menu-hidden .scene:fullscreen .canvas-toolbar{right:max(12px,env(safe-area-inset-right))}.debug-panel{flex:0 0 100%;order:3;width:100%;margin-top:2px;border:1px solid var(--line);border-radius:8px;background:var(--panel);box-shadow:var(--shadow);text-align:left}.debug-panel summary{min-height:42px;padding:10px 14px;cursor:pointer;color:var(--muted);font-weight:650}.debug-copy{margin-left:10px;color:#8c5a34;font-size:.78rem;font-weight:500;text-decoration:underline}.debug-copy:hover{color:#5e351e}.debug-copy-status{margin-left:6px;color:#5f7b4a;font-size:.78rem;font-weight:500}.debug-groups{display:grid;gap:14px;padding:0 14px 14px}.debug-group{display:grid;gap:8px}.debug-group h3{margin:0;color:var(--ink);font-size:.82rem;letter-spacing:0}.debug-controls{display:grid;grid-template-columns:repeat(3,minmax(130px,1fr));gap:10px}.debug-controls label{display:grid;gap:6px;min-width:0;color:var(--muted);font-size:.88rem}.debug-controls label>span{display:flex;align-items:baseline;gap:5px;min-width:0}.debug-controls output{color:var(--ink);font-variant-numeric:tabular-nums}.debug-reset{color:#8c5a34;font-size:.78rem;line-height:1;text-decoration:underline}.debug-reset:hover{color:#5e351e}.debug-controls input[type=range]{width:100%;accent-color:#b9682f}.debug-check{align-items:center;grid-template-columns:auto 1fr;grid-column:1/-1}.debug-check input{accent-color:#b9682f}.editor-group .debug-controls{grid-template-columns:minmax(180px,0.6fr) minmax(260px,1fr)}.editor-palette{display:flex;flex-wrap:wrap;gap:8px}.editor-palette-item{display:inline-flex;align-items:center;gap:8px;min-height:38px;padding:0 12px;border-color:#bfae99;background:#fff8ea;color:var(--ink);box-shadow:0 2px 0 #cbbba7;font-size:.84rem;touch-action:none;user-select:none}.editor-palette-item:active{transform:translateY(1px)}.editor-palette-item[aria-pressed=true]{border-color:#125f93;background:#eaf6ff;color:#125f93}.canvas-palette-item{justify-content:center;width:38px;height:38px;min-height:38px;padding:0;border-color:rgba(110,83,54,.42);background:linear-gradient(180deg,rgba(255,255,255,.84),rgba(255,239,210,.88));box-shadow:inset 0 1px 0 rgba(255,255,255,.8),0 2px 0 rgba(177,148,111,.65)}.canvas-palette-item:hover{background:linear-gradient(180deg,rgba(255,255,255,.94),rgba(255,231,190,.92))}.canvas-palette-item[aria-pressed=true]{border-color:rgba(18,95,147,.58);background:linear-gradient(180deg,rgba(235,249,255,.94),rgba(194,231,255,.92))}.save-load-dialog{position:absolute;inset:0;z-index:12;display:grid;place-items:center;padding:14px;background:rgba(41,31,20,.24);backdrop-filter:blur(5px)}.save-load-dialog[hidden]{display:none}.save-load-card{display:grid;gap:12px;width:min(520px,100%);max-height:calc(100% - 10px);padding:14px;border:1px solid rgba(110,83,54,.28);border-radius:8px;background:rgba(255,250,240,.96);box-shadow:0 18px 42px rgba(49,40,27,.24)}.save-load-header{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:10px}.save-load-header h3{margin:0;font-size:1rem}.save-load-status{color:var(--muted);font-size:.82rem}.save-load-close{width:32px;height:32px;min-height:32px}.save-load-dialog textarea{width:100%;min-height:170px;max-height:44vh;padding:10px;border:1px solid #d3c2ad;border-radius:7px;background:#fffdf7;color:var(--ink);font:0.78rem/1.42 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;resize:vertical}.save-load-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px}.editor-palette-bubble-lift-preview,.editor-palette-bumper-preview,.editor-palette-escalator-preview,.editor-palette-rail-preview{display:inline-block;box-shadow:inset 0 1px 0 rgba(255,255,255,.45)}.editor-palette-rail-preview{width:42px;height:10px;border:1px solid rgba(84,34,14,.72);border-radius:999px;background:linear-gradient(180deg,rgba(255,236,185,.78),rgba(186,91,43,.86) 52%,rgba(92,38,20,.92))}.editor-palette-escalator-preview{position:relative;width:42px;height:12px;border:1px solid rgba(65,52,45,.72);border-radius:999px;background:repeating-linear-gradient(90deg,rgba(92,70,58,.9) 0 5px,rgba(231,178,90,.96) 5px 10px),linear-gradient(180deg,rgba(255,238,186,.86),rgba(154,88,42,.94))}.editor-palette-escalator-preview::after{content:"";position:absolute;top:50%;right:5px;width:7px;height:7px;border-top:2px solid rgba(255,249,219,.9);border-right:2px solid rgba(255,249,219,.9);transform:translateY(-50%) rotate(45deg)}.editor-palette-bumper-preview{border:1px solid rgba(139,40,29,.8);border-radius:50%;background:radial-gradient(circle at 32% 26%,rgba(255,232,206,.78) 0 18%,rgba(236,115,88,.92) 34%,rgba(198,61,45,.98) 72%,rgba(126,33,27,.98) 100%)}.editor-palette-bumper-preview{width:22px;height:22px}.editor-palette-bubble-lift-preview{position:relative;width:18px;height:28px;border:2px solid rgba(45,136,152,.72);border-radius:999px;background:linear-gradient(180deg,rgba(255,255,255,.56) 0 20%,rgba(86,225,211,.5) 21%,rgba(28,148,191,.72) 100%);overflow:hidden}.editor-palette-bubble-lift-preview::after,.editor-palette-bubble-lift-preview::before{content:"";position:absolute;bottom:4px;width:4px;height:4px;border:1px solid rgba(238,255,255,.8);border-radius:50%;background:rgba(255,255,255,.2)}.editor-palette-bubble-lift-preview::before{left:4px}.editor-palette-bubble-lift-preview::after{right:4px;bottom:12px}.canvas-palette-item .editor-palette-rail-preview{width:30px}.canvas-palette-item .editor-palette-escalator-preview{width:30px;height:12px}.canvas-palette-item .editor-palette-bumper-preview{width:22px;height:22px}.canvas-palette-item .editor-palette-bubble-lift-preview{width:16px;height:28px}.editor-drag-ghost{position:fixed;z-index:20;display:grid;place-items:center;width:74px;height:44px;pointer-events:none;opacity:.82;filter:drop-shadow(0 10px 14px rgba(49, 40, 27, .24))}.editor-drag-ghost .editor-palette-rail-preview{width:68px;height:14px}.editor-drag-ghost .editor-palette-escalator-preview{width:68px;height:18px}.editor-drag-ghost .editor-palette-bumper-preview{width:42px;height:42px}.editor-drag-ghost .editor-palette-bubble-lift-preview{width:32px;height:62px}.editor-selection{display:flex;align-items:flex-start;flex-direction:column;min-height:34px;gap:5px;min-width:0;color:var(--muted);font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:.85rem}.editor-selection span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.editor-selection-actions{display:flex;flex-wrap:wrap;gap:10px}.editor-selection-actions a{flex:0 0 auto}.world-import-panel{display:grid;gap:8px;width:100%}.world-import-panel textarea{width:100%;min-height:132px;padding:10px;border:1px solid #cbbba7;border-radius:6px;background:#fffaf0;color:var(--ink);box-shadow:inset 0 1px 2px rgba(48,40,30,.08);font:0.78rem/1.35 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;resize:vertical}[hidden].world-import-panel{display:none}@media (max-width:760px){.topbar{align-items:center}.controls{justify-content:stretch;width:100%}.world-bar{align-items:stretch;flex-direction:column}.world-buttons{justify-content:stretch}.controls button{flex:1 1 130px}.world-buttons button{flex:1 1 140px}.scene{min-height:340px}.debug-controls{grid-template-columns:1fr}.editor-group .debug-controls{grid-template-columns:1fr}.editor-selection{gap:5px}.canvas-palette-toolbar{top:68px;right:10px}.canvas-zoom-control{top:128px;right:10px}.scene.is-fallback-fullscreen .canvas-palette-toolbar,.scene:-webkit-full-screen .canvas-palette-toolbar,.scene:fullscreen .canvas-palette-toolbar{top:calc(max(12px,env(safe-area-inset-top)) + 58px);right:max(12px,env(safe-area-inset-right))}.scene.is-fallback-fullscreen .canvas-zoom-control,.scene:-webkit-full-screen .canvas-zoom-control,.scene:fullscreen .canvas-zoom-control{top:calc(max(12px,env(safe-area-inset-top)) + 118px);right:max(12px,env(safe-area-inset-right))}}