:root{--bg: #0b0d10;--panel: rgba(18, 21, 26, .86);--panel-solid: #14171c;--line: rgba(255, 255, 255, .12);--text: #eef1f5;--muted: #9aa3ae;--accent: #4d8dff;--ok: #4cc38a;--bad: #ff6b5b;--warn: #f2b84b;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Inter,sans-serif;color:var(--text)}*{box-sizing:border-box}html,body{margin:0;height:100%;overflow:hidden;background:var(--bg)}#stage,#stage canvas{position:fixed;top:0;right:0;bottom:0;left:0;width:100%;height:100%;display:block;touch-action:none}button{font:inherit;color:inherit}#loader{position:fixed;top:0;right:0;bottom:0;left:0;display:grid;place-content:center;justify-items:center;gap:6px;background:var(--bg);z-index:20;transition:opacity .6s ease;text-align:center;padding:24px}#loader.done{opacity:0;pointer-events:none}#loader p{margin:0;color:var(--muted);font-size:14px;max-width:520px;line-height:1.45}#loader-text{color:var(--text)!important;font-size:15px!important}.spinner{width:38px;height:38px;border-radius:50%;margin-bottom:10px;border:3px solid rgba(255,255,255,.15);border-top-color:#fff;animation:spin .9s linear infinite}#loader.error .spinner{display:none}@keyframes spin{to{transform:rotate(360deg)}}#topbar{position:fixed;top:max(14px,env(safe-area-inset-top));left:max(16px,env(safe-area-inset-left));z-index:5;pointer-events:none}#title{margin:0;font-size:15px;font-weight:600;letter-spacing:.01em;padding:8px 12px;border-radius:10px;background:var(--panel);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);border:1px solid var(--line)}#title:empty{display:none}#toolbar{position:fixed;right:max(16px,env(safe-area-inset-right));bottom:max(16px,env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:8px;z-index:5}#toolbar button{width:44px;height:44px;border-radius:12px;display:grid;place-items:center;cursor:pointer;background:var(--panel);border:1px solid var(--line);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}#toolbar button:hover{background:#282d36eb}#toolbar svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}#hint{position:fixed;left:50%;bottom:max(18px,env(safe-area-inset-bottom));transform:translate(-50%);display:flex;gap:14px;flex-wrap:wrap;justify-content:center;z-index:4;padding:8px 14px;border-radius:999px;background:var(--panel);border:1px solid var(--line);font-size:12.5px;color:var(--muted);transition:opacity .8s ease;pointer-events:none;max-width:calc(100vw - 32px)}#hint.fade{opacity:0}#hint span[hidden]{display:none}@media (max-width: 560px){#hint{bottom:max(76px,env(safe-area-inset-bottom));border-radius:14px}}#editor{position:fixed;top:12px;right:12px;bottom:12px;width:330px;z-index:10;background:var(--panel);border:1px solid var(--line);border-radius:14px;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);display:flex;flex-direction:column;font-size:13px;overflow:hidden}#editor.collapsed{bottom:auto}#editor.collapsed .ed-body{display:none}#editor header{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;border-bottom:1px solid var(--line)}#editor header strong{font-size:14px}#ed-dirty{color:var(--warn)}.ed-body{overflow-y:auto;padding:10px 12px 14px}#editor section{border-top:1px solid var(--line);padding-top:10px;margin-top:10px}#editor h3{margin:0 0 6px;font-size:12px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}#editor .help{margin:4px 0 8px;color:var(--muted);line-height:1.4}#editor .warn{margin:6px 0 0;color:var(--warn)}#editor .status{margin:8px 0 0;min-height:1.3em;color:var(--muted);line-height:1.4}#editor .status[data-kind=ok]{color:var(--ok)}#editor .status[data-kind=warn]{color:var(--warn)}#editor .row{display:flex;gap:6px;flex-wrap:wrap;margin:6px 0}#editor .grid{display:grid;grid-template-columns:1fr 1fr;gap:6px 8px;margin:6px 0;align-items:end}#editor label{color:var(--muted);display:flex;flex-direction:column;gap:3px}#editor label.toggle{flex-direction:row;align-items:center;gap:7px;color:var(--text);margin:4px 0;cursor:pointer}#editor label.toggle small{color:var(--muted)}#editor input[type=number]{width:100%;padding:6px 8px;border-radius:7px;border:1px solid var(--line);background:#00000059;color:var(--text);font:inherit}#editor input:disabled{opacity:.45}#editor button{padding:7px 10px;border-radius:8px;border:1px solid var(--line);cursor:pointer;background:#ffffff14}#editor button:hover{background:#ffffff24}#editor button.small{font-size:12px;padding:6px 8px}#editor button.primary{background:var(--accent);border-color:transparent;color:#fff;font-weight:600}#editor button.ghost{background:transparent}#editor button:disabled{opacity:.4;cursor:default}.dials{display:grid;grid-template-columns:1.45fr 1fr;gap:6px;align-items:center;margin-top:6px}.dials svg{width:100%;height:auto;overflow:visible}.dials .ring{fill:none;stroke:#ffffff2e;stroke-width:1}.dials .ground{stroke:#ffffff40;stroke-width:1}.dials .allowed{fill:#4d8dff38;stroke:#4d8dff99;stroke-width:1}.dials .edge{stroke:#4d8dffe6;stroke-width:1.5}.dials .centre{fill:#fff}.dials .home{stroke:var(--warn);stroke-width:3;stroke-linecap:round}.dials .home-dot{fill:var(--warn)}.dials .ray{stroke:#ffffff80;stroke-dasharray:3 3}.dials .cam{fill:var(--ok);stroke:#0b0d10;stroke-width:2}.dials .cam.out{fill:var(--bad)}.dials .lbl{fill:var(--muted);font-size:10px;text-anchor:middle;dominant-baseline:middle}.readout{display:grid;grid-template-columns:auto 1fr;gap:3px 10px;margin:8px 0 2px;font-size:12.5px}.readout span{color:var(--muted)}.readout b{font-weight:500;font-variant-numeric:tabular-nums}.readout b.ok{color:var(--ok)}.readout b.bad{color:var(--bad)}body.editing #toolbar{right:356px}body.editing #hint{display:none}@media (max-width: 720px){#editor{left:8px;right:8px;top:auto;bottom:8px;width:auto;max-height:58vh}body.editing #toolbar{right:16px;bottom:calc(58vh + 20px)}}
