*{box-sizing:border-box}:root{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--bg:#1f2328;--text:#e6e8eb;--muted:#9aa3ad;--surface:#3a4048;--accent:#6b9bd1;--on-accent:#fff;--disabled:#6b7480;--overlay:#1f2328d9;--swatch-border:#777;--gain:#7ee2a0;--loss:#ff9d9d;--code-text:#d4d4d4;--code-comment:#6a9955;--code-string:#ce9178;--code-number:#b5cea8;--code-keyword:#569cd6;--code-control:#c586c0;--code-function:#dcdcaa;--code-class:#4ec9b0;--code-variable:#9cdcfe;--code-selection:#264f78;--code-active-line:#ffffff0d}:root[data-theme=light]{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--bg:#f4f5f7;--text:#1f2328;--muted:#5b6570;--surface:#d3d8de;--accent:#8db8e6;--on-accent:#1f2328;--disabled:#9aa3ad;--overlay:#f4f5f7e6;--swatch-border:#5b6570;--gain:#1a7f3c;--loss:#c0392b;--code-text:#000;--code-comment:green;--code-string:#a31515;--code-number:#098658;--code-keyword:#00f;--code-control:#af00db;--code-function:#795e26;--code-class:#267f99;--code-variable:#001080;--code-selection:#add6ff;--code-active-line:#0000000d}html,body{height:100%;margin:0}body{background:var(--bg);color:var(--text);font:14px/1.4 system-ui,sans-serif;display:flex}#stage{flex:1;min-width:0;padding:16px;position:relative}#track{cursor:grab;touch-action:none;width:100%;height:100%;display:block}#track.panning{cursor:grabbing}#track.over-robot{cursor:move}#readout{background:var(--overlay);font-variant-numeric:tabular-nums;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;border-radius:4px;max-width:calc(100% - 161px);height:28px;margin:0;padding:0 8px;line-height:28px;position:absolute;bottom:24px;left:24px;overflow:hidden}#view-controls,.view-controls{pointer-events:none;gap:4px;display:flex;position:absolute;bottom:24px;right:24px}#zoom-indicator,#reset-view,.zoom-indicator,.reset-view{background:var(--overlay);height:28px;color:inherit;border:0;border-radius:4px;align-items:center;display:flex}#zoom-indicator,.zoom-indicator{font-variant-numeric:tabular-nums;gap:6px;padding:0 8px}#reset-view,.reset-view{cursor:pointer;pointer-events:auto;justify-content:center;width:28px;padding:0}#reset-view:hover,#reset-view:focus-visible,.reset-view:hover,.reset-view:focus-visible{background:var(--accent);outline:none}.icon{fill:none;stroke:currentColor;stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round;width:16px;height:16px}#splitter{z-index:1;background:var(--surface);cursor:col-resize;touch-action:none;flex-shrink:0;width:8px;position:relative}#splitter:before,#splitter:after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}#splitter:before{background:var(--surface);border-radius:6px;width:16px;height:40px}#splitter:after{width:8px;height:10px;color:var(--muted);background:repeating-linear-gradient(currentColor 0 2px,#0000 2px 4px)}#splitter:hover,#splitter:focus-visible,#splitter.dragging,#splitter:hover:before,#splitter:focus-visible:before,#splitter.dragging:before{background:var(--accent);outline:none}#splitter:hover:after,#splitter:focus-visible:after,#splitter.dragging:after{color:var(--on-accent)}#panel{flex-direction:column;flex-shrink:0;width:clamp(280px,30vw,480px);display:flex}#panel-tabs{border-bottom:1px solid var(--surface);flex-wrap:wrap;padding:0 104px 0 16px;display:flex}#panel-tabs button{height:40px;color:var(--muted);font:inherit;cursor:pointer;background:0 0;border:0;border-bottom:2px solid #0000;padding:0 12px}#panel-tabs button:disabled{color:var(--disabled);cursor:not-allowed}#panel-tabs button:hover:not(:disabled),#panel-tabs button:focus-visible{color:inherit;outline:none}#panel-tabs button[aria-selected=true]{border-bottom-color:var(--accent);color:inherit;font-weight:600}#panel [role=tabpanel]{flex:1;min-height:0;padding:16px;overflow-y:auto}#panel-footer{border-top:1px solid var(--surface);color:var(--muted);text-align:center;padding:10px 16px;font-size:12px}#panel-footer a{color:inherit}#panel-footer a:hover,#panel-footer a:focus-visible{color:var(--text);outline:none}#panel [role=tabpanel]:focus-visible{outline:none}#create-scenario,#clear-scenario,#edit-robot,#test-drive,#remove-robot{background:var(--surface);width:100%;height:36px;color:inherit;font:inherit;cursor:pointer;border:0;border-radius:4px}#create-scenario:hover,#create-scenario:focus-visible,#clear-scenario:hover,#clear-scenario:focus-visible,#edit-robot:hover,#edit-robot:focus-visible,#test-drive:hover,#test-drive:focus-visible,#remove-robot:hover,#remove-robot:focus-visible{background:var(--accent);outline:none}#scenario-info{border-top:1px solid var(--surface);margin-top:16px;padding-top:16px}#color-counts{border-collapse:collapse;font-variant-numeric:tabular-nums;width:100%}#color-counts abbr{text-decoration:none}#color-counts th,#color-counts td{text-align:right;padding:0 0 0 4px}#color-counts th{padding-bottom:3px}#color-counts button{width:100%;color:inherit;font:inherit;text-align:inherit;cursor:pointer;background:0 0;border:0;border-radius:3px;padding:3px 4px}#color-counts button:hover:not(:disabled),#color-counts button:focus-visible{background:var(--surface);outline:none}#color-counts button[aria-pressed=true]{background:var(--accent)}#color-counts button:disabled{color:var(--disabled);cursor:default}#color-counts thead th{color:var(--muted);font-weight:400}#color-counts tfoot th,#color-counts tfoot td{border-top:1px solid var(--surface);color:inherit;font-weight:600}#color-counts th:first-child,#color-counts td:first-child{text-align:left;padding-left:0}.swatch{border:1px solid var(--swatch-border);vertical-align:-1px;border-radius:2px;width:12px;height:12px;margin-right:8px;display:inline-block}#panel-rules h2{margin:20px 0 6px;font-size:14px;font-weight:600}#panel-rules h2 small{color:var(--muted);margin-left:4px;font-size:12px;font-weight:400}#panel-rules p{margin:0}#panel-rules .rules-note{color:var(--muted);font-size:13px}#official-rules{background:var(--surface);height:36px;color:inherit;border-radius:4px;justify-content:center;align-items:center;gap:8px;margin-top:12px;text-decoration:none;display:flex}#official-rules:hover,#official-rules:focus-visible{background:var(--accent);outline:none}#panel-rules ul{margin:0;padding-left:18px}#panel-rules li+li{margin-top:4px}.score-table{border-collapse:collapse;font-variant-numeric:tabular-nums;width:100%}.score-table td{border-bottom:1px solid var(--surface);vertical-align:top;padding:4px 0}.score-table td:last-child{text-align:right;white-space:nowrap;padding-left:12px;font-weight:600}.score-table .gain{color:var(--gain)}.score-table .loss{color:var(--loss)}.preference{cursor:pointer;align-items:center;gap:8px;display:flex}.preference-group{border:0;margin:0 0 16px;padding:0}.preference-group legend{color:var(--muted);margin-bottom:6px;padding:0}.preference-group .preference+.preference{margin-top:6px}.robot-fields{grid-template-columns:1fr 1fr;align-items:end;gap:8px;display:grid}#panel-robot label{color:var(--muted);font-size:13px;display:block}#panel-robot input,#panel-robot select{border:1px solid var(--surface);background:var(--bg);width:100%;height:36px;color:var(--text);font:inherit;font-variant-numeric:tabular-nums;border-radius:4px;margin-top:4px;padding:0 8px;display:block}#panel-robot input:focus-visible,#panel-robot select:focus-visible{border-color:var(--accent);outline:none}#robot-size-notes{margin:12px 0 16px;padding:0;font-size:13px;list-style:none}#robot-size-notes:empty{display:none}#robot-size-notes li+li{margin-top:4px}#robot-size-notes .warning{color:var(--loss)}#robot-status,#sensor-readings{font-variant-numeric:tabular-nums;margin:0}#sensor-readings{border-top:1px solid var(--surface);margin-top:12px;padding-top:12px}#robot-status div,#sensor-readings div{justify-content:space-between;gap:16px;display:flex}#robot-status div+div,#sensor-readings div+div{margin-top:4px}#robot-status dt,#sensor-readings dt{color:var(--muted);flex-shrink:0}#robot-status dd,#sensor-readings dd{text-align:right;margin:0}#robot-status dd.has-collision{color:var(--loss)}#test-drive,#remove-robot{margin-top:8px}#robot-hint{color:var(--muted);margin:8px 0 0;font-size:13px}.panel-soon{color:var(--muted);margin:0}.robot-block+.robot-block{border-top:1px solid var(--surface);margin-top:16px;padding-top:16px}.robot-block h2{margin:0 0 12px;font-size:14px;font-weight:600}.robot-block-label{color:var(--text);margin:0 0 6px;font-size:13px;font-weight:500}.sensor-tools,.robot-designs{grid-template-columns:repeat(3,1fr);gap:6px;display:grid}.sensor-tools button,.robot-designs button,#editor-restore-default,#editor-remove{background:var(--surface);height:32px;color:inherit;font:inherit;cursor:pointer;border:0;border-radius:4px}.robot-designs button:hover,.robot-designs button:focus-visible,.robot-designs button[aria-pressed=true],.sensor-tools button:hover,.sensor-tools button:focus-visible,.sensor-tools button[aria-pressed=true],#editor-restore-default:hover,#editor-restore-default:focus-visible,#editor-remove:hover:not(:disabled),#editor-remove:focus-visible{background:var(--accent);outline:none}#editor-remove{width:100%}.sensor-tools+.robot-block-label{margin-top:12px}#editor-remove:disabled{color:var(--disabled);cursor:default}.robot-fields{grid-template-columns:1fr}#robot-preview-block{border-bottom:1px solid var(--surface);margin-bottom:16px;padding-bottom:12px}#robot-preview{background:#fff;border-radius:4px;width:100%;height:180px;display:block}#robot-preview-size{font-variant-numeric:tabular-nums;text-align:center;margin:8px 0 0}#robot-preview-legend{color:var(--muted);flex-wrap:wrap;justify-content:center;gap:4px 12px;margin:4px 0 0;padding:0;font-size:12px;list-style:none;display:flex}.sensor-dot{border-radius:50%;width:8px;height:8px;margin-right:4px;display:inline-block}#robot-editor{z-index:1;background:var(--bg);flex-direction:column;gap:8px;padding:16px;display:flex;position:absolute;inset:0}#robot-editor[hidden]{display:none}#robot-editor-toolbar{z-index:1;pointer-events:none;flex-wrap:wrap;align-items:center;gap:6px;display:flex;position:absolute;top:24px;left:24px;right:24px}#robot-editor-toolbar button{pointer-events:auto;background:var(--surface);height:32px;color:inherit;font:inherit;cursor:pointer;border:0;border-radius:4px;padding:0 10px}#robot-editor-toolbar button:hover:not(:disabled),#robot-editor-toolbar button:focus-visible,#robot-editor-toolbar button[aria-pressed=true]{background:var(--accent);outline:none}#robot-editor-toolbar button:disabled{color:var(--disabled);cursor:default}.toolbar-gap{flex:1}#robot-editor-area{flex:1;min-height:0;position:relative}#robot-editor-canvas{cursor:grab;touch-action:none;background:#fff;border-radius:4px;width:100%;height:100%;display:block}#robot-editor-canvas.panning{cursor:grabbing}#editor-view-controls{bottom:8px;right:8px}#robot-editor-canvas.placing{cursor:crosshair}#robot-editor-hint{height:2.8em;color:var(--muted);flex-shrink:0;margin:0;overflow-y:auto}#robot-test{border-top:1px solid var(--surface);margin-top:16px;padding-top:16px}#clear-scenario{margin-top:8px}#sensor-list-block .robot-block-label{margin-top:12px}#sensor-list{border-collapse:separate;border-spacing:0;font-variant-numeric:tabular-nums;table-layout:fixed;width:100%}#sensor-list th{color:var(--muted);text-align:left;padding:0 2px 4px;font-size:12px;font-weight:400}#sensor-list th:first-child{width:26px}#sensor-list th:nth-child(2){width:34%}#sensor-list td{border-top:1px solid var(--surface);padding:2px}#sensor-list td:first-child{padding-left:6px;font-weight:600}#sensor-list tbody tr{cursor:pointer}#sensor-list tbody tr:hover td{background:color-mix(in srgb, var(--surface) 45%, transparent)}#sensor-list tbody tr.is-selected td{background:color-mix(in srgb, var(--accent) 24%, transparent);border-top-color:#0000}#sensor-list tbody tr.is-selected+tr td{border-top-color:#0000}#sensor-list tbody tr td:first-child{border-radius:4px 0 0 4px}#sensor-list tbody tr td:last-child{border-radius:0 4px 4px 0}#panel-robot #sensor-list tr.is-selected input,#panel-robot #sensor-list tr.is-selected select{border-color:color-mix(in srgb, var(--accent) 55%, transparent)}#panel-robot #sensor-list input,#panel-robot #sensor-list select{height:26px;margin:0;padding:0 2px;font-size:12px}#panel-robot #sensor-list select{background-image:linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);cursor:pointer;appearance:none;background-position:right 7px center,right 3px center;background-repeat:no-repeat;background-size:4px 4px;padding-right:12px}#panel-robot #sensor-list input{text-align:right;appearance:textfield}#panel-robot #sensor-list input::-webkit-inner-spin-button{appearance:none;margin:0}#panel-robot #sensor-list input::-webkit-outer-spin-button{appearance:none;margin:0}#panel-robot input:disabled,#panel-robot select:disabled{color:var(--muted);opacity:1;cursor:default;background-color:#0000}#sensor-list input:disabled{pointer-events:none}#sensor-list-note{color:var(--muted);margin:8px 0 0;font-size:12px}#sensor-list-empty{color:var(--muted);margin:16px 0 0}#editor-save:not(:disabled){background:var(--accent)}.confirm-dialog{border:1px solid var(--surface);background:var(--bg);max-width:420px;color:var(--text);border-radius:8px;padding:20px}.confirm-dialog::backdrop{background:#00000080}.confirm-dialog h2{margin:0 0 8px;font-size:16px}.confirm-dialog p{color:var(--muted);margin:0 0 16px}#scenario-difficulty-list{color:var(--muted);margin:0 0 16px;padding:0;list-style:none}#scenario-difficulty-list li+li{margin-top:4px}#scenario-difficulty-list strong{color:var(--text);font-weight:600}.dialog-actions{flex-wrap:wrap;justify-content:flex-end;gap:8px;display:flex}.dialog-actions button{background:var(--surface);height:34px;color:inherit;font:inherit;cursor:pointer;border:0;border-radius:4px;padding:0 12px}.dialog-actions button:hover,.dialog-actions button:focus-visible,.dialog-actions .dialog-primary{background:var(--accent);outline:none}#editor-restore-default{width:100%}.robot-designs{grid-template-columns:repeat(2,1fr)}#program-actions{flex-wrap:wrap;gap:8px;margin-bottom:12px;display:flex}#program-hint{color:var(--muted);margin:0 0 12px;font-size:13px}#program-code{border:1px solid var(--surface);resize:vertical;border-radius:4px;height:300px;min-height:120px;overflow:hidden}#program-code .cm-editor{height:100%;color:var(--code-text);background:0 0}#program-code .cm-editor.cm-focused{outline:2px solid var(--accent);outline-offset:-2px}#program-code .cm-scroller{font:13px/20px ui-monospace,Menlo,Consolas,monospace;overflow:auto}#program-code .cm-gutters{color:var(--muted);background:0 0;border:0}#program-code .cm-activeLine,#program-code .cm-activeLineGutter{background:var(--code-active-line)}#program-code .cm-cursor{border-left-color:var(--text)}#program-code .cm-selectionBackground,#program-code .cm-focused>.cm-scroller>.cm-selectionLayer .cm-selectionBackground{background:var(--code-selection)}#program-code .cm-matchingBracket{outline:1px solid var(--muted);background:0 0}.tok-comment{color:var(--code-comment)}.tok-string{color:var(--code-string)}.tok-number{color:var(--code-number)}.tok-keyword,.tok-constant{color:var(--code-keyword)}.tok-control{color:var(--code-control)}.tok-function{color:var(--code-function)}.tok-class{color:var(--code-class)}.tok-variable{color:var(--code-variable)}.tok-operator{color:var(--code-text)}#program-output{border:1px solid var(--surface);white-space:pre-wrap;overflow-wrap:anywhere;border-radius:4px;height:120px;padding:8px;font:12px/1.5 ui-monospace,Menlo,Consolas,monospace;overflow:auto}#program-output .output-info{color:var(--muted)}#program-output .output-error{color:var(--loss)}#robot-class{color:var(--code-text);margin:0;font:12px/1.5 ui-monospace,Menlo,Consolas,monospace;overflow-x:auto}#layout-controls{z-index:2;background:var(--overlay);border-radius:4px;gap:2px;padding:2px;display:flex;position:fixed;top:6px;right:16px}#layout-controls[hidden]{display:none}#layout-controls button{width:24px;height:24px;color:var(--muted);cursor:pointer;background:0 0;border:0;border-radius:4px;justify-content:center;align-items:center;padding:0;display:flex}#layout-controls button:hover,#layout-controls button:focus-visible{color:var(--text)}#layout-controls button[aria-pressed=true]{background:var(--surface);color:var(--text)}#layout-controls .icon-fill{fill:currentColor;stroke:none;opacity:.45}body[data-layout=stage] #panel,body[data-layout=stage] #splitter,body[data-layout=panel] #stage,body[data-layout=panel] #splitter{display:none}body[data-layout=panel] #panel{flex:1;width:auto!important}.cm-tooltip.cm-tooltip-autocomplete,.cm-tooltip.cm-completionInfo{border:1px solid var(--surface);background:var(--bg);color:var(--code-text);border-radius:4px;font-family:ui-monospace,Menlo,Consolas,monospace;font-size:12px}.cm-tooltip.cm-completionInfo{color:var(--muted);font-family:inherit}.cm-tooltip-autocomplete>ul>li[aria-selected]{background:var(--code-selection)!important;color:var(--code-text)!important}.cm-completionLabel{color:var(--code-function)}.cm-completionMatchedText{font-weight:700;text-decoration:none}.cm-completionDetail{color:var(--muted);font-style:normal}#edit-robot-note{color:var(--muted);margin:8px 0 0;font-size:13px;display:none}#drive-pad{display:none}@media (pointer:coarse){#readout,#edit-robot{display:none}#edit-robot-note{margin-top:0;display:block}#drive-pad:not([hidden]){grid-template:".up."48px"left down right"48px/48px 48px 48px;gap:4px;display:grid;position:absolute;bottom:16px;left:16px}#drive-pad button{background:var(--overlay);color:var(--text);touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;border:0;border-radius:8px;font-size:18px}#drive-pad button:active{background:var(--accent)}#drive-pad [data-key=ArrowUp]{grid-area:up}#drive-pad [data-key=ArrowLeft]{grid-area:left}#drive-pad [data-key=ArrowDown]{grid-area:down}#drive-pad [data-key=ArrowRight]{grid-area:right}#panel-tabs button{height:44px}#layout-controls{top:4px;right:8px}#layout-controls button{width:36px;height:36px}#reset-view,#program-actions button,.dialog-actions button{min-width:44px;min-height:44px}#program-actions button{padding:0 14px}#create-scenario,#clear-scenario,#test-drive,#remove-robot{height:44px}#panel-robot input,#panel-robot select,#program-code .cm-scroller{font-size:16px}#program-code{resize:none;height:240px}}@media (width<=700px){html,body{overscroll-behavior:none;height:100dvh}body{flex-direction:column}#stage{flex:1;min-height:0;padding:8px}#splitter{display:none}#panel{border-top:1px solid var(--surface);flex:58%;min-height:0;width:auto!important}body[data-layout=both] #stage{flex:0 0 42%}#panel-tabs{scrollbar-width:none;flex-wrap:nowrap;padding:0 8px;overflow-x:auto}#panel-tabs button{flex-shrink:0}body[data-layout=panel] #panel-tabs{padding-right:136px}#layout-controls{background:var(--bg)}#panel-footer{display:none}.confirm-dialog{max-width:calc(100vw - 32px)}}@media (height<=500px){#panel-tabs{scrollbar-width:none;flex-wrap:nowrap;padding:0 136px 0 8px;overflow-x:auto}#panel-tabs button{flex-shrink:0}#layout-controls{background:var(--bg)}#panel-footer{display:none}}
