*{box-sizing:border-box}body{margin:0;font-family:Inter,"Segoe UI","Noto Sans JP",sans-serif;color:#262739;background:#f7f8fc;font-size:14px}button,input,textarea,select{font:inherit}button{cursor:pointer;background:white;color:inherit;border:1px solid #e3e5ee;border-radius:7px;padding:9px 12px;transition:background .15s}button:hover{background:#f0edff;border-color:#c6bbff}button:disabled{opacity:.35;cursor:default}button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid #7960ef;outline-offset:2px}.primary{background:#654ce8;color:white;border-color:#654ce8;font-weight:600}.primary:hover{background:#5338d6}.brand{display:flex;align-items:center;gap:5px;white-space:nowrap;font-size:19px;letter-spacing:-.7px}.logo{display:grid;place-items:center;width:34px;height:34px;background:#654ce8;color:white;border-radius:10px;font-size:25px;margin-right:6px;font-weight:800}.beta{font-size:10px;letter-spacing:1px;color:#776b9e;background:#f0edfa;padding:4px;margin-left:5px;border-radius:4px}header{height:76px;display:flex;align-items:center;justify-content:space-between;padding:0 24px;border-bottom:1px solid #e4e6ef;background:white;gap:20px}#projectName{border:0;background:transparent;text-align:center;width:240px;padding:8px;color:#565869}.header-actions{display:flex;align-items:center;gap:8px}.header-actions>#undo,.header-actions>#redo{border:0;font-size:23px;padding:4px 10px}.divider{height:24px;border-left:1px solid #ddd;margin:0 10px}main{display:grid;grid-template-columns:252px minmax(0,1fr) 256px;height:calc(100dvh - 76px)}aside{background:white;padding:20px;overflow:auto}.library{border-right:1px solid #e4e6ef;display:flex;flex-direction:column}.tabs{display:flex;border-bottom:1px solid #e9eaf0;margin:-8px -20px 22px;padding:0 20px;gap:25px}.tabs button{border:0;border-radius:0;padding:15px 2px;color:#888}.tabs button.active{color:#654ce8;border-bottom:2px solid #654ce8;font-weight:700}h2{font-size:16px;margin:0 0 8px}h3{font-size:14px;margin:22px 0 12px}.muted{color:#818391;font-size:13px;line-height:1.7}.parts-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:22px}.parts-grid button{height:96px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:10px;font-size:13px;background:#fcfcfe}.parts-grid strong{height:32px;display:grid;place-items:center;font-size:30px;font-weight:500}.parts-grid .pill-icon{font-size:11px;background:#e9e4ff;border-radius:6px;color:#654ce8;height:25px;padding:5px 9px;margin:3px 0 4px}.tip{margin-top:26px;background:#f5f3ff;padding:16px;border-radius:10px;color:#70629e;font-size:13px;line-height:1.8}.tip>span{display:block;font-size:23px;color:#7058dd;margin-bottom:7px}.tip p{margin:7px 0 0}.wide{width:100%;margin-bottom:8px;font-size:13px}.small{font-size:12px}.library-footer{margin-top:auto;padding-top:35px;font-size:9px;letter-spacing:1.8px;color:#a1a2b0}.workspace{display:flex;min-width:0;flex-direction:column}.toolbar{min-height:60px;display:flex;align-items:center;justify-content:space-between;padding:10px 22px;gap:10px;border-bottom:1px solid #e5e6ee;background:#fbfbfd;font-size:12px}.page-dot{display:inline-block;background:#9587e3;width:7px;height:7px;border-radius:50%;margin-right:7px}.viewport-controls{display:flex;gap:4px;align-items:center}.viewport-controls button{font-size:12px;border:0;background:transparent;padding:7px}.viewport-controls button.active{background:#ebe6ff;color:#6044d4}.viewport-controls select{font-size:12px;width:130px;margin-left:10px}#stage{flex:1;overflow:auto;padding:42px 32px;background-image:radial-gradient(#dce0ea .8px,transparent .8px);background-size:16px 16px}#canvasWrap{margin:0 auto;position:relative}#canvas{position:absolute;left:0;top:0;transform-origin:top left;box-shadow:0 8px 35px #303b5c12;background:white;overflow:hidden}.element{position:absolute;white-space:pre-wrap;overflow:hidden;user-select:none;touch-action:none;cursor:move;line-height:1.35}.element.selected{outline:2px solid #7a54ed;outline-offset:2px;overflow:visible}.element .inner{height:100%;width:100%;overflow:hidden;white-space:pre-wrap;pointer-events:none}.element img{width:100%;height:100%;object-fit:cover;display:block}.resize{position:absolute;right:-7px;bottom:-7px;width:13px;height:13px;border:2px solid #7a54ed;background:white;cursor:nwse-resize;border-radius:3px}.element-tag{position:absolute;top:-26px;left:-2px;background:#7955e7;color:white;padding:3px 7px;font-size:11px;white-space:nowrap;border-radius:4px;font-weight:400}.workspace footer{display:flex;justify-content:space-between;padding:12px 20px;color:#9495a4;font-size:11px;background:#fbfbfd;border-top:1px solid #e8e9f0;gap:12px}.inspector{border-left:1px solid #e4e6ef}.panel-title{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #eee;padding-bottom:20px;margin-bottom:20px}#kindBadge{font-size:10px;letter-spacing:1px;color:#999}label{display:block;font-size:12px;color:#767988;margin:14px 0}input:not([type=checkbox]),textarea,select{width:100%;border:1px solid #e1e4ed;border-radius:6px;padding:9px;background:white;color:#313447;margin-top:7px}textarea{resize:vertical}input[type=color]{height:37px;padding:4px;cursor:pointer}.field-row{display:flex;gap:12px}.field-row>*{flex:1;min-width:0}.field-row label{margin:8px 0}.field-row button{font-size:12px;margin-top:8px}.check{display:flex;align-items:center;gap:8px}hr{border:0;border-top:1px solid #ededf4;margin:22px 0}.danger{color:#d64d68}#layerList button{width:100%;text-align:left;margin-bottom:7px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#layerList .active{background:#ece7ff;border-color:#aa99ee}dialog{width:90vw;max-width:1200px;height:90dvh;border:1px solid #ddd;border-radius:14px;padding:0;box-shadow:0 20px 100px #0003}dialog::backdrop{background:#20203377;backdrop-filter:blur(5px)}.dialog-bar{display:flex;align-items:center;gap:20px;padding:14px 20px;border-bottom:1px solid #ddd}.dialog-bar button{margin-left:auto}iframe{width:100%;height:calc(100% - 68px);border:0;background:white}#toast{position:fixed;bottom:28px;left:50%;transform:translateX(-50%) translateY(100px);transition:transform .2s;background:#2c2940;color:white;padding:12px 22px;border-radius:9px;z-index:5;font-size:14px}#toast.show{transform:translateX(-50%) translateY(0)}[hidden]{display:none!important}@media(max-width:1100px){main{grid-template-columns:210px minmax(0,1fr) 220px}header{padding:0 16px}#projectName{width:170px}.toolbar{flex-wrap:wrap;padding:10px 14px}.workspace footer span:last-child{display:none}#stage{padding:30px 20px}}@media(max-width:760px){header{height:auto;min-height:110px;flex-wrap:wrap;padding:12px;gap:8px}.brand{font-size:16px}#projectName{width:155px;font-size:12px}.header-actions{width:100%;justify-content:flex-end}.header-actions button{font-size:12px}.divider{margin:0 3px}main{height:calc(100dvh - 110px);grid-template-columns:84px minmax(0,1fr);grid-template-rows:minmax(320px,1fr) 245px}.library{grid-row:1 / 3;padding:9px}.tabs{margin:0 0 14px;padding:0;gap:5px}.tabs button{font-size:11px;padding:10px 0}.library h2,.library .muted,.library .tip,.library h3,.library-footer{display:none}.parts-grid{grid-template-columns:1fr;margin:0;gap:6px}.parts-grid button{height:75px;padding:5px;font-size:11px}.wide{font-size:10px;margin-top:8px;padding:7px 3px}.inspector{grid-column:2;padding:12px;overflow:auto;border-top:1px solid #ddd}.panel-title{padding-bottom:8px;margin-bottom:10px}.inspector label{margin:6px 0}.inspector h3,.inspector hr{margin:10px 0}.toolbar{font-size:11px}.viewport-controls{flex-wrap:wrap}.viewport-controls button{font-size:10px}.viewport-controls select{margin:0;width:120px}#stage{padding:20px 12px}.workspace footer{font-size:10px;padding:8px}.dialog-bar .muted{display:none}}

.workspace{min-height:0}#stage{min-height:0}body{overflow:hidden}.game-placeholder{display:flex;align-items:center;justify-content:center;white-space:pre-line!important;text-align:center;line-height:2!important;padding:20px;font-size:18px;font-weight:600;border:2px dashed #ffffff55;box-sizing:border-box}#pageSettings{font-size:12px;padding:5px 8px}.element.selected{outline-offset:-2px}.resize{right:0;bottom:0}.element-tag{top:0;left:0;pointer-events:none}

#codeDialog{width:96vw;max-width:1800px;height:94dvh}#codeDialog .dialog-bar{flex-wrap:wrap;padding:10px;gap:8px}#codeDialog .dialog-bar select{width:130px;margin:0}#codeDialog .dialog-bar button{margin-left:0}#codeDialog .check{margin:0} .code-workspace{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:minmax(320px,1fr) 200px;height:calc(100% - 70px);gap:1px;background:#ddd}.code-writing,.code-preview{background:#fff;display:flex;flex-direction:column;min-width:0;min-height:0}.code-caption{padding:10px;display:flex;justify-content:space-between;align-items:center;font-size:12px;gap:6px}.code-caption button{font-size:11px;padding:6px}.code-input-wrap{display:flex;flex:1;min-height:0;background:#151a2c;color:#dce5ff;overflow:hidden}.code-source-area{position:relative;flex:1;min-width:0;overflow:hidden}#codeSource{position:relative;z-index:1;width:100%;height:100%;resize:none;border:0;border-radius:0;background:transparent;color:#e4ebff;margin:0;padding:0 8px;font:14px/22px Consolas,monospace;white-space:pre;tab-size:4}#codeSource:focus{outline:none}#codeNumbers{width:50px;flex-shrink:0;text-align:right;overflow:hidden;font:14px/22px Consolas,monospace;color:#8593b2;padding-right:10px}.line-error{background:#9b2437;color:#fff}#codeOverlay{position:absolute;inset:0;pointer-events:none}#codeErrorLine{position:absolute;left:0;right:0;height:22px;background:#972f4966;border-bottom:1px solid #f55775}#codeIssue{border-radius:0;background:#fff0f2;color:#a51b39;text-align:left;max-height:110px;overflow:auto;white-space:pre-wrap;font-size:13px}#codeLive{flex:1;min-height:0;height:auto}#codeLog{margin:0;padding:8px;max-height:120px;min-height:30px;overflow:auto;font-size:12px;white-space:pre-wrap;background:#f4f5fa}.code-reference{grid-column:1/3;background:#f8f9fd;overflow:auto;padding:12px;font-size:13px}.code-reference summary{cursor:pointer;font-weight:bold}.code-reference p{margin:8px 0;color:#606477}.api-row{padding:10px 0;border-bottom:1px solid #e0e3ec}.api-row b{display:inline-block;width:90px}.api-row code{color:#6244cf}.api-row p{margin-left:90px} @media(max-width:760px){#codeDialog .dialog-bar{font-size:12px}#codeDialog .dialog-bar button{padding:6px;font-size:11px}.code-workspace{display:flex;flex-direction:column;overflow:auto;height:calc(100% - 110px)}.code-writing{min-height:350px}.code-preview{min-height:350px}.code-reference{flex-shrink:0;max-height:300px}.api-row code{display:block;overflow-wrap:anywhere}.api-row p{margin-left:0}}
#codeErrorLine{color:#ffd6dd;font:12px/22px system-ui;text-align:right;padding-right:8px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
#codeSuggestions{position:absolute;z-index:4;left:8px;right:8px;max-height:210px;overflow:auto;border:1px solid #8d7fea;border-radius:7px;background:#222942;box-shadow:0 8px 22px #0007}#codeSuggestions button{display:block;width:100%;text-align:left;background:transparent;color:#e7ebff;border:0;border-radius:0;padding:8px 10px}#codeSuggestions button.active{background:#4b3ca3}#codeSuggestions strong{font:13px Consolas,monospace;display:block}#codeSuggestions span{font-size:12px;color:#c8cde7}

#selectionMarquee{position:absolute;z-index:2;pointer-events:none;background:#7955e72b;border:2px solid #7955e7}#canvas{touch-action:none;user-select:none}

#codeArguments{flex:0 1 auto;max-height:260px;overflow:auto;padding:12px;border-top:1px solid #dce1ef;background:#f7f8ff;color:#30354d;font-size:12px}.argument-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.argument-field{min-width:0}.argument-field label{display:block;margin:0 0 4px;color:#4f5570;font-weight:600}.argument-field input,.argument-field textarea,.argument-field select{margin:3px 0 0;padding:6px;font-size:12px}.argument-field>select{width:auto;font-size:10px;border:0;background:#e9eafa;padding:3px}.argument-note{margin:6px 0 10px;color:#636a83;font-size:11px}#argumentStatus:empty{display:none}#codeArguments>button{margin-top:10px;font-size:12px}.code-input-wrap{min-height:140px}@media(max-width:760px){.argument-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.code-writing:has(#codeArguments:not([hidden])){min-height:590px}}

.argument-help{margin:5px 0;color:#4e566d;font-size:11px;line-height:1.65;overflow-wrap:anywhere}.argument-example{display:block;color:#6450a4;font-size:11px;line-height:1.6;margin:4px 0 7px;overflow-wrap:anywhere}.argument-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.argument-field{padding:8px;border:1px solid #e0e3ee;border-radius:7px;background:#fff}#codeSuggestions span{display:block;line-height:1.6;white-space:normal;overflow-wrap:anywhere}@media(max-width:480px){.argument-grid{grid-template-columns:1fr}}

#codeHighlight{position:absolute;inset:0;margin:0;padding:0 8px;border:0;font:14px/22px Consolas,monospace;white-space:pre;tab-size:4;overflow:hidden;pointer-events:none;color:#e4ebff}#codeSource.syntax-input{color:transparent;caret-color:#fff;-webkit-text-fill-color:transparent}#codeSource.syntax-input::selection{background:#8b78ed66}#codeOverlay{z-index:2}.syntax-keyword{color:#d8a6ff}.syntax-api{color:#78dcff}.syntax-function{color:#ffdf91}.syntax-variable{color:#e4ebff}.syntax-property{color:#ffb995}.syntax-number{color:#91e6bd}.syntax-string{color:#f5b3d9}.syntax-boolean{color:#b6bbff}.syntax-comment{color:#a0adc3}.syntax-operator{color:#79d8e8}.code-color-legend{display:flex;flex-wrap:wrap;gap:6px 14px;background:#20273d;padding:7px 10px;font-size:11px}.argument-field[data-value-type=number]{border-left:4px solid #168453;background:#f1fff7}.argument-field[data-value-type=text]{border-left:4px solid #b23c82;background:#fff4fb}.argument-field[data-value-type=boolean]{border-left:4px solid #6554c0;background:#f5f3ff}.argument-field[data-value-type=expression]{border-left:4px solid #9a6d0c;background:#fffbec}.argument-field label{color:#30354d}
#codeSuggestions strong span{display:inline;font:inherit;line-height:inherit;white-space:pre}#codeSuggestions strong .syntax-function{color:#ffdf91}#codeSuggestions strong .syntax-variable{color:#ffb995}

/* Text Studio: monochrome source and output, with the existing project controls. */
#studioMode{padding:8px;max-width:170px;border:1px solid #ddd;border-radius:6px;background:white}
body>main[hidden],#textWorkspace[hidden]{display:none!important}
#textWorkspace{height:calc(100dvh - 76px);display:flex;flex-direction:column;background:#000;color:#fff;overflow:auto}
.text-toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:14px 22px;border-bottom:1px solid #444}
.text-toolbar>span{flex:1;color:#ccc;font-size:12px}
#textWorkspace button{background:#000;color:#fff;border:1px solid #777}
#textWorkspace button:hover{background:#fff;color:#000}
.text-columns{display:grid;grid-template-columns:1fr 1fr;flex:1;min-height:300px}
.text-writing,.text-preview{min-width:0;display:flex;flex-direction:column;padding:18px;gap:12px}
.text-writing{border-right:1px solid #444}
.text-writing>label,.text-preview>b{font-size:12px;color:#ccc}
#textSource{flex:1;min-height:220px;resize:none;width:100%;background:#000;color:#fff;caret-color:#fff;border:1px solid #666;padding:16px;font:16px/1.8 Consolas,monospace;tab-size:2;border-radius:0}
#textLive{flex:1;width:100%;min-height:220px;background:#000;border:1px solid #444}
#textIssue{margin:0;min-height:20px;white-space:pre-wrap;font-size:13px}
#textHelp{padding:14px 22px;border-top:1px solid #444;flex-shrink:0;font-size:13px;line-height:1.7}
#textHelp p{margin:8px 0}#textHelp summary{cursor:pointer}#textHelp code{color:#fff;background:#222;padding:2px 4px}
@media(max-width:1000px){body.text-mode>header{height:auto;min-height:76px;flex-wrap:wrap;padding:12px;gap:8px}body.text-mode #projectName{width:150px}body.text-mode .header-actions{flex-wrap:wrap}body.text-mode #textWorkspace{height:auto;min-height:calc(100dvh - 130px)}}
@media(max-width:700px){.text-columns{grid-template-columns:1fr}.text-writing{border-right:0;border-bottom:1px solid #444}.text-toolbar{gap:8px;padding:12px}.text-toolbar>span{flex-basis:100%}.text-preview{min-height:320px}#textSource{min-height:240px}#textHelp{padding:14px}}
#textCommands{padding:14px 22px;border-top:1px solid #444;flex-shrink:0;font-size:13px;line-height:1.7}#textCommands summary{cursor:pointer}#textCommands p{margin:8px 0;color:#ddd}#textCommandSearch{width:100%;max-width:480px;padding:8px;background:#000;color:#fff;border:1px solid #777}#textCommandList{max-height:260px;overflow:auto;margin-top:10px}.text-command-row{display:grid;grid-template-columns:65px minmax(0,1fr) auto;gap:4px 12px;padding:10px 0;border-bottom:1px solid #333}.text-command-row code{overflow-wrap:anywhere}.text-command-row p{grid-column:2/4}.text-command-row small{color:#bbb}.text-command-row button{font-size:12px;padding:4px 8px}#textLog{white-space:pre-wrap;overflow-wrap:anywhere;overflow:auto;max-height:100px;margin:0;font:13px/1.5 monospace;border-top:1px solid #444;padding:8px}@media(max-width:700px){#textCommands{padding:12px}.text-command-row{grid-template-columns:1fr auto}.text-command-row small{grid-column:1/3}.text-command-row p{grid-column:1/3}}
.text-columns{min-height:420px;flex-shrink:0}
#textSourceWrap{position:relative;flex:1;min-height:240px;min-width:0;display:flex}#textSourceWrap #textSource{width:100%;height:100%;min-height:240px;padding-right:16px;overflow:auto;white-space:pre;line-height:28px}#textInlineErrors{position:absolute;inset:1px;overflow:hidden;pointer-events:none}.text-line-error{position:absolute;display:block;max-width:280px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#ffb5b5;background:#3a1717;border-radius:3px;padding:0 7px;font:12px/28px system-ui;pointer-events:auto}#textCaretMirror{position:fixed;left:-100000px;top:0;visibility:hidden;white-space:pre;width:max-content;pointer-events:none}#textPredictions{position:absolute;z-index:20;max-height:190px;overflow:auto;background:#151515;border:1px solid #aaa;border-radius:6px;box-shadow:0 8px 24px #0009}#textPredictions button{display:block;width:100%;text-align:left;border:0;border-radius:0;padding:7px 10px;background:#151515;color:#fff}#textPredictions button[aria-selected="true"],#textPredictions button:hover{background:#333;color:#fff}#textPredictions strong{display:block;font:13px/1.4 Consolas,monospace}#textPredictions span{display:block;font:12px/1.4 system-ui;color:#ccc}.text-assist-hint{margin-left:12px;font-size:11px;color:#bbb}@media(max-width:700px){.text-assist-hint{display:block;margin:5px 0 0}}
