:root{color-scheme:dark;--bg:#111116;--panel:#1b1b24;--line:#46434e;--text:#f7f3e7;--muted:#b9b5c1;--accent:#ef3148}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:14px/1.6 system-ui,"Microsoft YaHei",sans-serif}header{display:flex;gap:20px;align-items:center;padding:16px 24px;border-bottom:2px solid var(--accent);flex-wrap:wrap}h1{font-size:22px;margin:0}h2{font-size:14px;margin:18px 0 9px}a{color:inherit}input,select,button{font:inherit;color:inherit;background:var(--bg);border:1px solid var(--line);padding:8px;min-height:38px;max-width:100%}button{cursor:pointer}button:hover{border-color:var(--text)}button[aria-pressed=true]{background:var(--text);color:var(--bg);border-bottom:3px solid var(--accent)}button:disabled{opacity:.4;cursor:default}input[type=checkbox]{min-height:auto;accent-color:var(--accent)}#title{width:220px}#save-state{color:var(--muted);margin-left:auto}.filebar{display:flex;gap:7px;padding:12px 24px;flex-wrap:wrap}.filebar #export{background:var(--accent)}main{display:grid;grid-template-columns:174px minmax(300px,1fr) 224px;gap:1px;border-block:1px solid var(--line);background:var(--line)}aside,.workspace{background:var(--panel);padding:14px;min-width:0}.tool-list{display:grid;grid-template-columns:1fr 1fr;gap:5px}label{display:block;margin-block:7px}label input[type=number]{width:100%}aside select{width:100%}.small{font-size:12px;color:var(--muted)}.viewbar{display:flex;flex-wrap:wrap;gap:8px 16px;align-items:center}.viewbar label{display:flex;align-items:center;gap:6px}.viewbar select{max-width:150px}#viewport{position:relative;height:62vh;min-height:320px;overflow:hidden;border:1px solid var(--line);touch-action:none;background:#111116;cursor:crosshair}canvas{display:block;width:100%;height:100%}#message{min-height:44px;margin:10px 0 0}.row{display:flex;gap:5px;flex-wrap:wrap}.properties form{display:grid;grid-template-columns:1fr 1fr;gap:8px}.properties form button{grid-column:1/-1}.properties ul{padding-left:18px;font-size:12px;color:#ffd38b;max-height:180px;overflow:auto}#markers{font-size:12px;overflow-wrap:anywhere;max-height:250px;overflow:auto}#markers p{border-bottom:1px solid var(--line);padding-bottom:8px}dialog{background:var(--panel);color:var(--text);border:1px solid var(--line);max-width:min(600px,95vw);max-height:90vh;padding:24px}dialog::backdrop{background:#000b}dialog h2{font-size:20px}dialog .row{margin-top:20px}:focus-visible{outline:2px solid #ffbd54;outline-offset:2px}#selection-info{font-size:12px;overflow-wrap:anywhere}@media(max-width:1000px){main{grid-template-columns:150px minmax(280px,1fr)}.properties{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:10px 24px}.properties h2{grid-column:1/-1}}@media(max-width:600px){header{padding:12px;gap:10px}#title{width:150px}#save-state{margin:0;width:100%}.filebar{padding:10px}main{grid-template-columns:1fr}.palette{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.palette h2{margin:0}.palette .tool-list{display:flex;flex-wrap:wrap}.palette select{width:auto}.palette .small{display:none}.properties{display:block}#viewport{height:52vh;min-height:300px}button{min-height:44px}.viewbar{gap:5px}}

/* Preserve the site's dark/red visual family; give the map and common verbs priority. */
body{font-family:"Microsoft YaHei",system-ui,sans-serif}.filebar{position:sticky;top:0;z-index:5;background:var(--bg);align-items:center;border-bottom:1px solid var(--line)}.toolbar-spacer{flex:1}.toolbar-divider{height:26px;border-left:1px solid var(--line);margin:0 5px}#play{background:var(--accent);border-color:var(--accent);font-weight:700;padding-inline:22px}#play-download{border-color:#87818d}.project-menu{position:relative}.project-menu summary{padding:10px 14px;cursor:pointer;border:1px solid var(--line);list-style:none}.project-menu[open]>div{position:absolute;left:0;top:100%;min-width:180px;display:grid;gap:5px;padding:10px;background:var(--panel);box-shadow:0 10px 30px #0008;border:1px solid var(--line)}#materials button{display:flex;flex-direction:column-reverse;align-items:center;gap:7px;min-height:76px;font-size:12px}#materials canvas{width:32px;height:32px;image-rendering:pixelated}#materials button[aria-pressed=true]{box-shadow:inset 0 0 0 2px var(--accent);border-bottom-width:1px}.palette{max-height:calc(100vh - 160px);overflow:auto}.viewbar{padding-bottom:10px}#viewport{height:65vh;background:#090c15;box-shadow:inset 0 0 0 1px #fff1}body.focus-mode main{grid-template-columns:174px minmax(0,1fr)}body.focus-mode .properties{display:none}.properties{border-left:1px solid var(--line)}.properties>p{line-height:1.6}.small{line-height:1.65}button:active{transform:translateY(1px)}button:disabled{transform:none}@media(max-width:600px){.palette{max-height:none}.toolbar-spacer,.toolbar-divider{display:none}#materials{display:grid;grid-template-columns:repeat(4,minmax(55px,1fr));width:100%}#materials button{min-height:68px}.filebar{position:relative}body.focus-mode main{grid-template-columns:1fr}.viewbar button{font-size:12px}.properties{border-left:0}}

.mobile-palette-toggle{display:none}@media(max-width:600px){.mobile-palette-toggle{display:block;width:calc(100% - 20px);margin:5px 10px}.palette{display:none}body.palette-open .palette{display:flex}#viewport{height:52vh;min-height:300px}.viewbar{gap:6px}.filebar{gap:5px}.filebar button{font-size:12px;padding:7px}#play{padding-inline:12px}}

/* Keep template selection and download state beside the actions that need them. */
#template{border-color:var(--text);font-weight:650}.template-selectors{display:grid;grid-template-columns:1fr 2fr;gap:16px}.template-selectors select{display:block;width:100%;margin-top:6px}#template-info{min-height:40px}#download-dialog{width:520px}#download-progress{display:block;width:100%;height:12px;accent-color:var(--accent);margin:18px 0}.download-ready:not([hidden]){display:inline-block;padding:12px 20px;background:var(--accent);color:var(--text);font-weight:700;text-decoration:none;margin:8px 0}#download-status{overflow-wrap:anywhere}@media(max-width:600px){.template-selectors{grid-template-columns:1fr;gap:0}#template-dialog,#download-dialog{padding:20px}.download-ready:not([hidden]){display:block;text-align:center}}

/* Make playable character choice visible beside Play. */
.filebar .hero-picker{display:flex;align-items:center;gap:12px;margin:0;padding:8px 12px;border:1px solid #eab75b;background:#eab75b12;border-radius:6px}.hero-picker strong{display:block;color:#ffd38b;font-size:14px}.hero-picker small{display:block;color:var(--muted);font-size:11px;margin-top:3px}.hero-picker select{min-width:155px;border-color:#eab75b80;font-weight:650;background:var(--panel)}@media(max-width:600px){.filebar .hero-picker{width:100%;justify-content:space-between}.hero-picker select{flex:1;max-width:230px}}

.filebar #template{border-color:#eab75b;background:#eab75b12;border-radius:6px;padding:8px 16px;text-align:left}.filebar #template strong{display:block;color:#ffd38b;font-size:14px}.filebar #template small{display:block;margin-top:3px;color:var(--muted);font-size:11px;font-weight:400}.filebar #template:hover{background:#eab75b26;border-color:#ffd38b}

.editor-version{margin:0;color:#ffd38b;font-size:12px;white-space:nowrap}.editor-back{white-space:nowrap}.editor-title{display:inline-flex;align-items:center;gap:10px;margin:0}.editor-brand{display:inline-flex;align-items:center;gap:10px;color:inherit;text-decoration:none;line-height:1;white-space:nowrap}.editor-brand img{display:block;width:30px;height:30px;object-fit:contain;flex:none}.editor-brand span{display:block;line-height:1.2}.experience-star{display:inline-flex;align-items:center;gap:6px;min-height:34px;padding:6px 10px;border:1px solid #eab75b80;color:#ffd38b;text-decoration:none;font-size:12px;white-space:nowrap}.experience-star:hover{border-color:#ffd38b;background:#eab75b18}.experience-star svg{flex:none}.experience-star span{line-height:1}
