/* The Mod Studio: a dark workspace like GameMaker's (the asset browser at the left, editors in tabs, the
   inspector at the right, the output under them, all resizable). The mods site's red and fonts. */
:root {
  --bg: #17181c; --panel: #202227; --panel2: #292c33; --panel3: #33373f; --line: #34373f; --line2: #454a55;
  --text: #e7e7eb; --muted: #a2a5ae; --faint: #6c707c; --red: #e04a40; --red-ink: #ff7a70; --red-soft: #3c2020;
  --green: #4cbf7c; --amber: #e0a94a; --blue: #6ea8ff; --sel: #2f3d5c; --hover: #2a2d35; --purple: #b78cff;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 13px/1.4 var(--sans); overflow: hidden; }
#app { display: flex; flex-direction: column; height: 100%; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }
.grow { flex: 1; }
svg.i { flex: none; display: block; }
.k-map { color: #7fc8a0; } .k-code { color: #e0c070; } .k-sprite { color: #f08a7a; } .k-picture { color: #7ab0f0; }
.k-sound { color: #c79cf0; } .k-character { color: #f0b070; } .k-lobby { color: #8fd0d8; } .k-options { color: var(--muted); }

/* the bar */
.bar { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px; background: var(--panel);
  border-bottom: 1px solid var(--line); flex: none; min-width: 0; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 14px; height: 14px; border-radius: 3px; background: var(--red); display: inline-block; }
.bar-proj { display: flex; align-items: baseline; gap: 8px; color: var(--muted); white-space: nowrap; overflow: hidden; min-width: 0; max-width: 26vw; }
.bar-proj b { color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.bar-proj .ver { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.bar-tools { display: flex; gap: 6px; align-items: center; margin-left: 6px; flex: 1; min-width: 0; }
.bar-right { display: flex; gap: 14px; align-items: center; color: var(--muted); white-space: nowrap; flex: none; }
.save-state { font-size: 12px; color: var(--faint); }
.save-state.ok::before { content: "● "; color: var(--green); }
.save-state.err { color: var(--red-ink); }
.bsep { width: 1px; height: 22px; background: var(--line2); margin: 0 2px; }
.tb { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 6px; white-space: nowrap;
  border: 1px solid var(--line2); background: var(--panel2); color: var(--text); }
.tb:hover { background: var(--panel3); text-decoration: none; }
.tb:disabled { opacity: .45; cursor: default; }
.tb.run { background: #23603c; border-color: #2f7d50; }
.tb.run:hover { background: #2b734a; }
.tb.primary { background: var(--red); border-color: var(--red); color: #fff; }
.tb.primary:hover { background: #ea5a50; }
.iconbtn { display: inline-grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 5px; background: none; color: var(--muted); padding: 0; flex: none; }
.iconbtn:hover { background: var(--panel3); color: var(--text); }

#main { flex: 1; min-height: 0; display: flex; }

/* the home screen */
.home { width: 100%; overflow: auto; padding: 26px max(20px, calc((100% - 1040px) / 2)) 40px; }
.hero { display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 8px; }
.hero-text { flex: 1 1 420px; min-width: 0; }
.home h1 { font-size: 24px; margin: 0 0 6px; }
.home .lead { color: var(--muted); margin: 0; max-width: 640px; }
.home-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.home h2.sec { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 26px 0 10px; font-weight: 600; }
.templates { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.tpl { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); min-width: 0; }
.tpl:hover { border-color: var(--red); background: var(--panel2); }
.tpl-art { width: 46px; height: 46px; border-radius: 8px; background: var(--panel3); display: grid; place-items: center; flex: none; color: var(--red-ink); }
.tpl-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tpl-text span { color: var(--muted); font-size: 12px; }
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.proj { display: flex; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; cursor: pointer; min-width: 0; }
.proj:hover { border-color: var(--line2); background: var(--panel2); }
.proj-art { width: 72px; height: 72px; flex: none; border-radius: 6px; display: grid; place-items: center; color: var(--faint);
  background: repeating-conic-gradient(#2a2c33 0 25%, #22242a 0 50%) 0 0 / 12px 12px; overflow: hidden; }
.proj-art canvas { image-rendering: pixelated; }
.proj-body { min-width: 0; flex: 1; }
.proj h3 { margin: 0 0 3px; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj .meta { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj .row { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.empty { color: var(--muted); padding: 30px; text-align: center; border: 1px dashed var(--line2); border-radius: 8px; grid-column: 1 / -1; }

/* the workspace: browser | split | center | split | inspector */
.ws { flex: 1; display: grid; grid-template-columns: var(--left, 250px) 4px minmax(0, 1fr) 4px var(--right, 300px); min-width: 0; min-height: 0; }
.browser { background: var(--panel); display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.center { display: grid; grid-template-rows: auto minmax(0, 1fr) 4px var(--out, 150px); min-width: 0; min-height: 0; }
.inspector { background: var(--panel); overflow: auto; min-width: 0; }
.split { background: var(--line); }
.split.v { cursor: col-resize; }
.split.h { cursor: row-resize; }
.split:hover, body.resizing .split:hover { background: var(--blue); }
body.resizing { user-select: none; }
.ws.out-closed .split.h { pointer-events: none; }

.browser-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 4px 12px; color: var(--muted);
  font-size: 11px; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.browser-search { display: flex; align-items: center; gap: 6px; margin: 2px 8px 6px; padding: 0 8px; border: 1px solid var(--line2);
  border-radius: 6px; background: var(--bg); color: var(--faint); }
.browser-search input { border: 0 !important; background: none !important; padding: 5px 0 !important; min-width: 0; }
.tree-items { flex: 1; overflow: auto; padding-bottom: 10px; }
.tree-items .group { display: flex; align-items: center; gap: 6px; padding: 5px 8px 5px 8px; margin-top: 2px; color: var(--muted);
  font-size: 12px; font-weight: 600; user-select: none; cursor: pointer; }
.tree-items .group:hover { color: var(--text); }
.tree-items .group .chev { color: var(--faint); }
.tree-items .group .gname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-items .group .count { font-size: 11px; color: var(--faint); font-weight: 400; }
.tree-items .group .add { margin-left: auto; border: 0; background: none; color: var(--muted); display: grid; place-items: center;
  width: 22px; height: 22px; border-radius: 4px; padding: 0; flex: none; }
.tree-items .group .add:hover { color: var(--text); background: var(--panel3); }
.tree-items .item { display: flex; align-items: center; gap: 8px; padding: 3px 10px 3px 30px; cursor: pointer; white-space: nowrap; user-select: none; min-width: 0; }
.tree-items .item:hover { background: var(--hover); }
.tree-items .item.on { background: var(--sel); box-shadow: inset 2px 0 0 var(--blue); }
.tree-items .item .label { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tree-items .item .tag { margin-left: auto; color: var(--faint); font-size: 11px; flex: none; padding-left: 6px; }
.tree-items .item.err .label { color: var(--red-ink); }
.tree-items .item.err::after { content: "!"; color: #fff; background: var(--red); border-radius: 50%; width: 14px; height: 14px; font-size: 10px;
  display: grid; place-items: center; flex: none; margin-left: 4px; }
canvas.thumb { width: 18px; height: 18px; flex: none; image-rendering: pixelated; border-radius: 3px;
  background: repeating-conic-gradient(#33363e 0 25%, #2a2c33 0 50%) 0 0 / 6px 6px; }
body.dropping .browser { outline: 2px dashed var(--blue); outline-offset: -4px; }
body.dropping .tree-items .group { background: rgba(110, 168, 255, .06); }

/* tabs: they shrink (like a code editor's) and scroll with the wheel, never a scroll bar */
.tabs { display: flex; background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden;
  min-width: 0; height: 34px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: flex; align-items: center; gap: 6px; padding: 0 4px 0 10px; height: 34px; border-right: 1px solid var(--line);
  color: var(--muted); cursor: pointer; white-space: nowrap; flex: 0 1 auto; min-width: 92px; max-width: 200px; }
.tab .name { overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.tab:hover { background: var(--hover); }
.tab.on { background: var(--bg); color: var(--text); box-shadow: inset 0 2px 0 var(--red); }
.tab .x { border: 0; background: none; color: var(--faint); width: 20px; height: 20px; border-radius: 4px; display: grid; place-items: center; padding: 0; flex: none; }
.tab .x:hover { background: var(--panel3); color: var(--text); }
.tab.dirty .x { color: var(--amber); }
.pane { min-height: 0; min-width: 0; position: relative; overflow: hidden; background: var(--bg); }
.pane > .ed, .pane > .welcome { position: absolute; inset: 0; }
.ed { display: flex; flex-direction: column; min-width: 0; }

.welcome { padding: 34px 40px; overflow: auto; }
.welcome h2 { margin: 0 0 4px; font-size: 20px; }
.wcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin: 16px 0; max-width: 900px; }
.wcard { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; padding: 14px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text); min-width: 0; }
.wcard svg { color: var(--red-ink); }
.wcard span { color: var(--muted); font-size: 12px; }
.wcard:hover { border-color: var(--line2); background: var(--panel2); }

.out { background: var(--panel); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.out-tabs { display: flex; align-items: center; gap: 2px; padding: 0 6px; height: 30px; border-bottom: 1px solid var(--line); flex: none; }
.out-tabs button[data-out] { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--muted); padding: 4px 9px; border-radius: 5px; }
.out-tabs button[data-out]:hover { color: var(--text); }
.out-tabs button.on { color: var(--text); background: var(--panel3); }
.out-tabs .count:not(:empty) { background: var(--red); color: #fff; border-radius: 9px; padding: 0 6px; font-size: 11px; }
.out-body { flex: 1; overflow: auto; font-family: var(--mono); font-size: 12px; padding: 6px 10px; background: var(--bg); min-height: 0; }
.ws.out-closed .out-body { display: none; }
.out-body .p { padding: 2px 0; display: flex; gap: 6px; align-items: baseline; }
.out-body .p svg { position: relative; top: 2px; }
.out-body .p.err { color: #ff8f86; cursor: pointer; }
.out-body .p.err:hover { color: #fff; }
.out-body .p.ok { color: var(--green); }
.out-body .p.info { color: var(--muted); }

/* the inspector and forms */
.insp { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.insp:last-child { border-bottom: 0; }
.insp h3 { margin: 2px 0 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600;
  display: flex; align-items: center; gap: 6px; }
.empty-insp { border: 0; padding-top: 16px; }
.field { margin-bottom: 10px; min-width: 0; }
.field > label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 3px; }
.field .hint { color: var(--faint); font-size: 11px; margin-top: 3px; }
input[type=text], input[type=number], input[type=search], select, textarea { width: 100%; background: var(--bg); border: 1px solid var(--line2);
  border-radius: 5px; padding: 5px 7px; outline: none; min-width: 0; }
select { text-overflow: ellipsis; }
input[type=color] { width: 100%; height: 30px; padding: 2px; border: 1px solid var(--line2); border-radius: 5px; background: var(--bg); }
input:focus, select:focus, textarea:focus { border-color: var(--blue); }
input.bad { border-color: var(--red); }
textarea { resize: vertical; min-height: 60px; }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.check { display: flex; gap: 8px; align-items: center; margin: 6px 0; cursor: pointer; }
.form { padding: 20px 26px 40px; max-width: 820px; }
.form h2 { margin: 0 0 4px; font-size: 19px; }
.form .sub { color: var(--muted); margin: 0 0 16px; }
.form section { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 18px; }
.form section h3 { margin: 0 0 6px; font-size: 14px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; min-width: 640px; }
.table th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 4px; white-space: nowrap; }
.table td { padding: 3px 4px; vertical-align: top; }
.table input, .table select { padding: 3px 5px; }
.btn { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 5px; border: 1px solid var(--line2);
  background: var(--panel2); white-space: nowrap; }
.btn:hover { background: var(--panel3); }
.btn.small { height: 24px; padding: 0 8px; font-size: 12px; }
.btn.danger:hover { background: var(--red-soft); border-color: var(--red); }
.btn.on { border-color: var(--blue); background: var(--sel); }
.btns-row { display: flex; gap: 6px; flex-wrap: wrap; }

/* modals, toasts, the context menu */
#modal-root .back { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); display: grid; place-items: center; z-index: 50; }
.modal { background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; width: min(460px, 92vw); padding: 18px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, .5); max-height: 90vh; overflow: auto; }
.modal h3 { margin: 0 0 12px; font-size: 16px; }
.modal .btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.modal .err { color: var(--red-ink); margin-top: 6px; min-height: 1.2em; }
#toasts { position: fixed; right: 14px; bottom: 14px; display: flex; flex-direction: column; gap: 6px; z-index: 60; }
.toast { background: var(--panel3); border: 1px solid var(--line2); border-left: 3px solid var(--green); padding: 8px 12px;
  border-radius: 6px; max-width: 420px; box-shadow: 0 6px 20px rgba(0, 0, 0, .4); overflow-wrap: anywhere; }
.toast.err { border-left-color: var(--red); }
.ctx { position: fixed; background: var(--panel2); border: 1px solid var(--line2); border-radius: 8px; padding: 4px; z-index: 70;
  min-width: 190px; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
.ctx button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 6px 12px; border-radius: 5px; white-space: nowrap; }
.ctx button:hover { background: var(--sel); }
.ctx hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

/* an editor's bar */
.ed-bar { display: flex; gap: 4px; align-items: center; padding: 5px 8px; background: var(--panel); border-bottom: 1px solid var(--line);
  flex: none; min-width: 0; min-height: 38px; flex-wrap: wrap; }
.ed-bar > b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.ed-bar .sep { width: 1px; height: 20px; background: var(--line2); margin: 0 4px; flex: none; }
.ed-bar .tool { display: inline-flex; align-items: center; gap: 5px; height: 28px; min-width: 28px; padding: 0 8px; border-radius: 5px;
  border: 1px solid transparent; background: none; color: var(--text); white-space: nowrap; }
.ed-bar .tool:hover { background: var(--panel3); }
.ed-bar .tool.on { background: var(--sel); border-color: var(--blue); }
.ed-bar .tool.run { color: #8fe0ad; }
.ed-bar .stat { margin-left: auto; color: var(--muted); font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.ed-bar input[type=text], .ed-bar input[type=search] { width: 220px; }

/* the code editor */
.code-wrap { flex: 1; min-height: 0; display: flex; }
.code-wrap > div { overflow: hidden; }
.code-wrap .cm-editor { flex: 1; height: 100%; font-size: 13px; min-width: 0; max-width: 100%; }
.code-wrap .cm-scroller { font-family: var(--mono); }
.api { padding: 8px 12px 20px; font-size: 12px; }
.api h4 { margin: 12px 0 4px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.api .fn { font-family: var(--mono); color: var(--blue); cursor: pointer; display: block; padding: 1px 0; overflow-wrap: anywhere; }
.api .fn:hover { color: #fff; }
.api .doc { color: var(--muted); margin: 0 0 5px 8px; }

/* the room (map) editor: a toolbox at the left of the canvas, the status under it */
.room { flex: 1; min-height: 0; display: flex; }
.toolbox { width: 44px; flex: none; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column;
  align-items: center; gap: 3px; padding: 6px 0; overflow-y: auto; scrollbar-width: none; }
.toolbox .tool { width: 34px; height: 34px; border-radius: 6px; border: 1px solid transparent; background: none; color: var(--text);
  display: grid; place-items: center; padding: 0; position: relative; }
.toolbox .tool:hover { background: var(--panel3); }
.toolbox .tool.on { background: var(--sel); border-color: var(--blue); }
.toolbox .tool kbd { position: absolute; right: 2px; bottom: 0; font: 9px var(--mono); color: var(--faint); }
.toolbox hr { width: 26px; border: 0; border-top: 1px solid var(--line2); margin: 4px 0; }
.canvas-wrap { flex: 1; min-height: 0; min-width: 0; position: relative; overflow: hidden; background: #111216; }
.canvas-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; outline: none; }
.statusbar { display: flex; gap: 16px; align-items: center; padding: 0 10px; height: 24px; background: var(--panel); border-top: 1px solid var(--line);
  color: var(--muted); font: 11px var(--mono); flex: none; white-space: nowrap; overflow: hidden; }
.statusbar .hint { margin-left: auto; font-family: var(--sans); color: var(--faint); overflow: hidden; text-overflow: ellipsis; }
.palette { display: grid; grid-template-columns: repeat(auto-fill, 32px); gap: 2px; max-height: 260px; overflow: auto; padding: 2px; }
.palette canvas { width: 32px; height: 32px; image-rendering: pixelated; border: 1px solid transparent; cursor: pointer; background: #000; border-radius: 2px; }
.palette .on { border-color: var(--blue); outline: 1px solid var(--blue); }
.objlist { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px; }
.objlist button { display: flex; align-items: center; gap: 6px; text-align: left; border: 1px solid var(--line); background: var(--bg);
  padding: 4px 6px; border-radius: 6px; min-width: 0; color: var(--text); }
.objlist button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.objlist button:hover { background: var(--hover); }
.objlist button.on { border-color: var(--blue); background: var(--sel); }
.objlist canvas { width: 24px; height: 24px; flex: none; image-rendering: pixelated; }
.objlist .dot { width: 12px; height: 12px; border-radius: 2px; flex: none; }
.layers { display: flex; flex-direction: column; gap: 2px; }
.layers .ly { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 5px; cursor: pointer; user-select: none; }
.layers .ly:hover { background: var(--hover); }
.layers .ly .eye { color: var(--text); }
.layers .ly.off { color: var(--faint); }
.layers .ly.off .eye { color: var(--faint); }

/* sprites, skins */
.strip { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 0; }
.strip .fr { border: 1px solid var(--line); background: repeating-conic-gradient(#2a2c33 0 25%, #22242a 0 50%) 0 0 / 12px 12px; image-rendering: pixelated; }
.strip .fr.on { border-color: var(--blue); }
.preview-box { display: grid; place-items: center; background: repeating-conic-gradient(#2a2c33 0 25%, #22242a 0 50%) 0 0 / 16px 16px;
  border: 1px solid var(--line); border-radius: 6px; min-height: 140px; position: relative; overflow: hidden; }
.preview-box canvas { image-rendering: pixelated; max-width: 100%; }
.actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; padding: 12px; }
.act { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px; min-width: 0; }
.act.mod { border-color: #2f7a4e; }
.act h4 { margin: 0 0 6px; font-size: 13px; display: flex; gap: 6px; align-items: center; min-width: 0; }
.act h4 .an { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act h4 .tag { margin-left: auto; font-size: 11px; color: var(--green); font-weight: 400; flex: none; }
.act .pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
.act .pair .preview-box { min-height: 96px; }
.act .pair small { display: block; color: var(--faint); text-align: center; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act .row { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; align-items: center; }
.act .row label { display: inline-flex; gap: 4px; align-items: center; }
.slider { display: grid; grid-template-columns: minmax(0, 1fr) 70px; gap: 8px; align-items: center; }

/* the object editor */
.obj-body { flex: 1; min-height: 0; display: flex; }
.obj-side { width: 260px; flex: none; border-right: 1px solid var(--line); background: var(--panel); overflow: auto; padding: 8px; }
.obj-body .code-wrap, .obj-body > .ed { flex: 1; min-width: 0; }
.obj-pv { min-height: 0; padding: 6px; }
.obj-pv canvas { width: 100%; height: auto; cursor: crosshair; }
.ev-head { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; margin: 4px 2px 6px; }
.ev-list { display: flex; flex-direction: column; gap: 3px; margin-bottom: 12px; }
.ev { display: flex; align-items: center; gap: 8px; text-align: left; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); }
.ev:hover { border-color: var(--line2); background: var(--hover); }
.ev .dot { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--faint); flex: none; }
.ev.has .dot { background: var(--green); border-color: var(--green); }
.var-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 6px; align-items: center; margin-bottom: 4px; }
.var-row .mono { overflow: hidden; text-overflow: ellipsis; }

/* the pixel editor */
.draw-ed { flex: 1; min-height: 0; }
.draw { flex: 1; min-height: 0; display: flex; }
.draw-side { width: 200px; flex: none; border-left: 1px solid var(--line); background: var(--panel); overflow: auto; padding: 10px; }
.swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; margin: 6px 0; }
.swatches button { aspect-ratio: 1; border: 1px solid var(--line2); border-radius: 3px; padding: 0; min-width: 0; }
.swatches button.on { outline: 2px solid #fff; outline-offset: 0; }
.frames-bar { display: flex; gap: 6px; align-items: center; padding: 6px 8px; background: var(--panel); border-top: 1px solid var(--line);
  overflow-x: auto; flex: none; min-height: 74px; }
.frames-bar .fr { position: relative; flex: none; border: 2px solid var(--line); border-radius: 5px; cursor: pointer;
  background: repeating-conic-gradient(#2a2c33 0 25%, #22242a 0 50%) 0 0 / 8px 8px; display: grid; place-items: center; width: 60px; height: 60px; }
.frames-bar .fr canvas { image-rendering: pixelated; max-width: 56px; max-height: 56px; }
.frames-bar .fr.on { border-color: var(--blue); }
.frames-bar .fr .n { position: absolute; left: 3px; top: 1px; font: 10px var(--mono); color: var(--muted); }
.cur-color { display: flex; gap: 8px; align-items: center; }
.cur-color input[type=color] { width: 48px; height: 32px; }
