/* Portfolyo — oyun motoru editörü görünümü. Renkler iki tema için aşağıda tanımlı. */
:root {
  --win: #191919; --tabbar: #282828; --panel: #383838; --panel-2: #313131; --head: #3f3f3f;
  --field: #2a2a2a; --field-b: #1f1f1f; --gap: #111; --line: #2a2a2a; --line-soft: #474747;
  --text: #cfcfcf; --hi: #f3f3f3; --muted: #9c9c9c;
  --sel: #2c5d87; --sel-text: #fff; --hover: #454545;
  --btn: #585858; --btn-h: #676767; --btn-b: #2c2c2c; --btn-text: #f0f0f0;
  --pri: #3a79bb; --pri-h: #4a8bd0; --link: #8ab4ff;
  --prefab: #7db5f3; --select: #ff9126; --ok: #63c174; --warn: #f2c23c; --gold: #f5c542;
  --x: #e8604c; --y: #8fcf4a; --z: #4f8fe8;
  --code-bg: #1e1e1e; --tk-key: #6aa5ee; --tk-str: #d8a184; --tk-cls: #57c9b3; --tk-num: #b9d39a; --tk-fn: #e3dda2; --tk-pun: #a9a9a9; --tk-com: #6d9a5c;
  --shadow: 0 6px 24px rgba(0,0,0,.45);
  --ui: 'Inter', 'Segoe UI', system-ui, sans-serif; --mono: 'JetBrains Mono', Consolas, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --win: #b4b4b4; --tabbar: #a6a6a6; --panel: #c9c9c9; --panel-2: #bebebe; --head: #d3d3d3;
  --field: #f1f1f1; --field-b: #9b9b9b; --gap: #8a8a8a; --line: #9d9d9d; --line-soft: #b3b3b3;
  --text: #1b1b1b; --hi: #050505; --muted: #4c4c4c;
  --sel: #3a72b0; --sel-text: #fff; --hover: #b7b7b7;
  --btn: #e6e6e6; --btn-h: #f2f2f2; --btn-b: #8f8f8f; --btn-text: #111;
  --pri: #2f6fb4; --pri-h: #3b7fc8; --link: #0f4fa8;
  --prefab: #1f66c0; --select: #e06a00; --ok: #1f8a3a; --warn: #a87400; --gold: #c99400;
  --x: #c8402c; --y: #4f8f1a; --z: #2a66c4;
  --code-bg: #f6f6f6; --tk-key: #1750b8; --tk-str: #a24a1c; --tk-cls: #0f7a68; --tk-num: #4d7a12; --tk-fn: #6b5a00; --tk-pun: #555; --tk-com: #5c7f4e;
  --shadow: 0 6px 24px rgba(0,0,0,.25);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--win); color: var(--text); font: 13px/1.45 var(--ui); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, pre { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img, video, canvas { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 1px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 16px; height: 16px; flex: none; }
.ico.pf, .pf > .ico, .hi.pf { color: var(--prefab); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip { position: absolute; left: -999px; top: 0; background: var(--pri); color: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 55%, transparent) transparent; }

/* ---------- düğmeler */
.btn { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 3px 11px; border-radius: 3px; background: var(--btn); border: 1px solid var(--btn-b); color: var(--btn-text); font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--btn-h); text-decoration: none; }
.btn.pri { background: var(--pri); border-color: color-mix(in srgb, var(--pri) 60%, #000); color: #fff; }
.btn.pri:hover { background: var(--pri-h); }
.btn.sm { min-height: 22px; padding: 1px 9px; }
.btn .ico { width: 14px; height: 14px; }
.btn.pri .ico { color: #fff; }
.icon-btn { display: grid; place-items: center; width: 28px; height: 24px; border-radius: 3px; color: var(--text); }
.icon-btn:hover { background: var(--hover); }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tags span { padding: 1px 8px; border-radius: 9px; background: var(--field); border: 1px solid var(--field-b); font-size: 12px; color: var(--text); }

/* ---------- üst çubuklar */
.menubar { display: flex; align-items: center; gap: 4px; min-height: 30px; padding: 0 8px; background: var(--win); border-bottom: 1px solid var(--gap); }
.app-id { display: flex; align-items: center; gap: 7px; color: var(--hi); padding: 3px 8px 3px 2px; margin-right: 4px; }
.app-id:hover { text-decoration: none; }
.app-id svg { width: 17px; height: 17px; color: var(--hi); }
.app-id b { font-weight: 600; letter-spacing: .01em; }
.menus { display: flex; }
.menu { position: relative; }
.menu > button { padding: 4px 9px; border-radius: 3px; }
.menu > button:hover, .menu > button[aria-expanded="true"] { background: var(--hover); color: var(--hi); }
.menu-pop { position: absolute; top: 100%; left: 0; z-index: 50; min-width: 200px; padding: 4px; background: var(--panel); border: 1px solid var(--gap); border-radius: 4px; box-shadow: var(--shadow); }
.menu-pop > a, .menu-pop > button { display: block; width: 100%; text-align: left; padding: 5px 12px; border-radius: 3px; color: var(--text); }
.menu-pop > a:hover, .menu-pop > button:hover { background: var(--sel); color: var(--sel-text); text-decoration: none; }
.menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.win-title { flex: 1; min-width: 0; text-align: center; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 12px; }
#btnTheme .moon { display: none; }
:root[data-theme="light"] #btnTheme .sun { display: none; }
:root[data-theme="light"] #btnTheme .moon { display: block; }

.toolbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 5px 10px; background: var(--win); border-bottom: 2px solid var(--gap); }
.pill { display: inline-flex; align-items: center; gap: 8px; justify-self: start; color: var(--text); min-width: 0; }
.pill > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); flex: none; }
.playctl { display: flex; border-radius: 4px; overflow: hidden; border: 1px solid var(--btn-b); }
.playctl button { display: grid; place-items: center; width: 40px; height: 26px; background: var(--btn); color: var(--btn-text); border-right: 1px solid var(--btn-b); }
.playctl button:last-child { border-right: 0; }
.playctl button:hover:not(:disabled) { background: var(--btn-h); }
.playctl button:disabled { opacity: .45; cursor: default; }
.playctl button[aria-pressed="true"] { background: var(--pri); color: #fff; }
#btnPlay .i-s { display: none; }
#btnPlay[aria-pressed="true"] .i-p { display: none; }
#btnPlay[aria-pressed="true"] .i-s { display: block; }
.app:not(.playing) #btnPlay { animation: nudge 2.6s ease-in-out 1.2s 3; }
@keyframes nudge { 0%, 100% { box-shadow: inset 0 0 0 0 transparent; } 50% { box-shadow: inset 0 0 0 2px var(--link); } }
.tb-r { display: flex; gap: 6px; justify-self: end; }

/* ---------- çalışma alanı ve paneller */
.panel { background: var(--panel); min-width: 0; }
.tabbar { display: flex; align-items: stretch; background: var(--tabbar); min-height: 26px; }
.tab { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px 3px 9px; color: var(--muted); border-top: 2px solid transparent; font-weight: 500; }
.tab .ico { width: 14px; height: 14px; }
.tab.on { background: var(--panel); color: var(--hi); border-top-color: var(--pri); }
button.tab:hover:not(.on) { color: var(--hi); }
.tab .count { margin-left: 2px; padding: 0 6px; border-radius: 8px; background: var(--field); font-size: 11px; color: var(--text); }
.stage-tab { display: none; }

/* Hierarchy */
.tree { padding: 4px 0; }
.h-row { display: flex; align-items: center; }
.h-row > button, .h-row > a, .h-static { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; min-height: 24px; padding: 2px 8px 2px calc(8px + var(--d) * 16px); text-align: left; color: var(--text); }
.h-row > button > span, .h-row > a > span, .h-static > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-row > button:hover, .h-row > a:hover { background: var(--hover); text-decoration: none; }
.h-row.pf > button, .ptree .h-row > a { color: var(--prefab); }
.ptree .h-row[style*="--d:1"] > a { color: var(--text); }
.h-row.on > button, .h-row.on > a { background: var(--sel); color: var(--sel-text); }
.h-row.on .hi { color: #fff; }
.h-row .hi { width: 15px; height: 15px; color: var(--muted); }
.h-row .hi.pf { color: var(--prefab); }
.h-static { color: var(--hi); font-weight: 500; }
.ico.open { transform: rotate(90deg); width: 12px; height: 12px; margin-right: -3px; color: var(--muted); }
.h-open { display: grid; place-items: center; width: 24px; height: 24px; color: var(--muted); }
.h-open:hover { color: var(--hi); background: var(--hover); }
.h-row.on .h-open { background: var(--sel); color: #fff; }
.h-row.back > a { color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 4px; padding-top: 4px; padding-bottom: 4px; }

/* ---------- Inspector */
.insp { font-size: 13px; }
.obj-h { padding: 9px 10px 8px; border-bottom: 1px solid var(--line); display: grid; gap: 7px; }
.obj-top { display: flex; align-items: center; gap: 8px; }
.obj-ico { width: 26px; height: 26px; color: var(--muted); }
.obj-ico.pf { color: var(--prefab); }
.f { display: inline-block; min-height: 22px; padding: 1px 7px; background: var(--field); border: 1px solid var(--field-b); border-radius: 3px; color: var(--hi); max-width: 100%; overflow-wrap: anywhere; }
.f.name { flex: 1; font-size: 15px; font-weight: 600; padding: 3px 8px; }
.f.area { display: block; padding: 6px 8px; line-height: 1.55; }
.f.num { min-width: 44px; font-variant-numeric: tabular-nums; }
.f.sel { padding-right: 20px; position: relative; color: var(--text); }
.f.sel::after { content: ''; position: absolute; right: 7px; top: 9px; border: 4px solid transparent; border-top-color: var(--muted); }
.f.lnk { color: var(--link); }
.f.small { font-size: 12px; }
.f em { font-style: normal; color: var(--muted); white-space: nowrap; }
.f em::before { content: '· '; }
.obj-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; padding-left: 34px; }
.obj-meta div { display: flex; align-items: center; gap: 6px; }
.obj-meta dt { color: var(--muted); }
.pf-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding-left: 34px; color: var(--muted); }
.pf-badge { color: var(--text); font-size: 12px; }
.cb { display: inline-block; width: 14px; height: 14px; flex: none; background: var(--field); border: 1px solid var(--field-b); border-radius: 2px; position: relative; }
.cb.on::after { content: ''; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid var(--hi); border-width: 0 2px 2px 0; transform: rotate(40deg); }
.preview { display: block; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.preview canvas, .preview img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.preview:hover { filter: brightness(1.08); }

.comp { border-bottom: 1px solid var(--line); }
.comp > summary { display: flex; align-items: center; gap: 6px; padding: 5px 8px; background: var(--head); cursor: pointer; list-style: none; user-select: none; }
.comp > summary::-webkit-details-marker { display: none; }
.comp > summary h3 { flex: 1; font-size: 13px; font-weight: 600; color: var(--hi); }
.comp .chev { width: 12px; height: 12px; color: var(--muted); transition: transform .12s; }
.comp[open] .chev { transform: rotate(90deg); }
.comp .ci { color: var(--muted); }
.comp .more { color: var(--muted); width: 14px; height: 14px; }
.comp-b { padding: 8px 10px 10px; display: grid; gap: 8px; }
.rows { display: grid; gap: 5px; }
.row { display: grid; grid-template-columns: minmax(84px, 34%) minmax(0, 1fr); gap: 8px; align-items: start; }
.row > dt { padding-top: 3px; color: var(--text); }
.row > dd { min-width: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.row > dd > .f:only-child { flex: 1; }
.row.col { grid-template-columns: 1fr; gap: 3px; }
.row.col > dd { display: block; }
.row.xyz > dd { flex-wrap: nowrap; gap: 4px; }
.row.xyz .f { flex: 1; min-width: 0; padding: 1px 5px; }
.ax { font-size: 11px; font-weight: 700; width: 10px; text-align: center; }
.ax.x { color: var(--x); } .ax.y { color: var(--y); } .ax.z { color: var(--z); }
.row.sl > dd { flex-wrap: nowrap; }
.slider { flex: 1; height: 4px; border-radius: 2px; background: var(--field); border: 1px solid var(--field-b); position: relative; }
.slider i { position: absolute; inset: -1px; border-radius: 2px; background: var(--pri); }
.slider i::after { content: ''; position: absolute; right: -5px; top: -4px; width: 11px; height: 11px; border-radius: 50%; background: var(--hi); border: 1px solid var(--field-b); }
.swatch { width: 44px; height: 20px; border-radius: 3px; border: 1px solid var(--field-b); background: #314d79; flex: none; }
.list-h { display: flex; justify-content: space-between; align-items: center; padding: 3px 0 5px; font-weight: 600; color: var(--hi); }
.list-h .n { min-width: 34px; text-align: right; font-weight: 400; }
.list-b { display: grid; gap: 4px; padding: 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 3px; }
.list-b li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 6px; align-items: start; }
.list-b .el { padding-top: 4px; color: var(--muted); font-size: 11px; text-align: center; font-variant-numeric: tabular-nums; }
.list-b .f { display: block; }
.note { color: var(--hi); font-size: 14px; line-height: 1.5; }
.insp-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 10px 4px; }
.addc { display: flex; justify-content: center; padding: 14px 10px 18px; }
.addc span { padding: 4px 46px; border-radius: 3px; border: 1px solid var(--btn-b); background: var(--btn); color: var(--btn-text); opacity: .5; }

/* ---------- Scene / Game */
.scene-wrap { position: relative; overflow: hidden; background: #26303c; }
.stage { position: absolute; inset: 0; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: manipulation; cursor: default; }
.labels { position: absolute; inset: 0; pointer-events: none; }
.lbl { position: absolute; transform: translate(-50%, -100%); pointer-events: auto; display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px 2px 6px; border-radius: 3px; background: rgba(22, 24, 27, .84); border: 1px solid rgba(255, 255, 255, .14); color: #f2f2f2; font-size: 12px; font-weight: 500; white-space: nowrap; }
.lbl .ico { width: 12px; height: 12px; color: #b9b9b9; }
.lbl.pf .ico { color: #8cc0ff; }
.lbl.minor { font-size: 11px; padding: 1px 6px 1px 5px; background: rgba(22, 24, 27, .66); }
.lbl:hover { background: #2c5d87; border-color: #6aa5e0; }
.lbl.on { border-color: #ff9126; box-shadow: 0 0 0 1px #ff9126; background: rgba(22, 24, 27, .95); }
.lbl::after { content: ''; position: absolute; left: 50%; top: 100%; width: 1px; height: 7px; background: rgba(255, 255, 255, .45); }
.scene-bar { position: absolute; top: 8px; right: 8px; z-index: 2; display: flex; border-radius: 4px; overflow: hidden; border: 1px solid rgba(0, 0, 0, .5); background: rgba(40, 40, 40, .88); }
.scene-bar button { padding: 3px 10px; color: #d6d6d6; font-size: 12px; border-right: 1px solid rgba(0, 0, 0, .45); }
.scene-bar button:last-child { border-right: 0; }
.scene-bar button:hover { background: rgba(255, 255, 255, .1); }
.scene-bar button[aria-pressed="true"] { background: #2c5d87; color: #fff; }
.intro { position: absolute; z-index: 3; top: 10px; left: 10px; width: min(300px, calc(100% - 20px)); padding: 12px 14px 13px; background: color-mix(in srgb, var(--panel) 93%, transparent); border: 1px solid var(--gap); border-radius: 5px; box-shadow: var(--shadow); }
.intro h1 { font-size: 22px; line-height: 1.15; font-weight: 700; color: var(--hi); letter-spacing: -.01em; }
.intro .role { margin-top: 4px; color: var(--link); font-weight: 600; }
.intro .sub { margin-top: 6px; color: var(--text); }
.intro-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.hud { position: absolute; z-index: 2; top: 10px; left: 10px; display: flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 4px; background: rgba(15, 18, 24, .78); color: #fff; font: 600 14px var(--ui); }
.hud .coin { width: 12px; height: 12px; border-radius: 50%; background: #f5c542; box-shadow: inset 0 0 0 2px #c9940a; }
.stats { position: absolute; z-index: 2; top: 40px; right: 8px; padding: 7px 10px; border-radius: 3px; background: rgba(20, 20, 20, .78); color: #e6e6e6; font: 11.5px/1.5 var(--mono); }
.prompt { position: absolute; z-index: 3; left: 50%; bottom: 44px; transform: translateX(-50%); padding: 8px 16px; border-radius: 5px; background: #2c5d87; border: 1px solid #7fb6f5; color: #fff; font-weight: 600; font-size: 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, .4); max-width: calc(100% - 24px); }
.prompt kbd { display: inline-block; margin-right: 7px; padding: 0 6px; border-radius: 3px; background: rgba(255, 255, 255, .2); font: 600 12px var(--mono); }
.hint { position: absolute; z-index: 2; left: 10px; bottom: 9px; right: 10px; color: rgba(255, 255, 255, .78); font-size: 12px; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); pointer-events: none; }
:root[data-theme="light"] .hint { color: rgba(20, 28, 40, .82); text-shadow: none; }
[hidden] { display: none !important; }

/* ---------- proje belgesi */
.doc-wrap { container-type: inline-size; }
.stagebar { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: 6px; padding: 5px 10px; background: var(--head); border-bottom: 1px solid var(--line); color: var(--muted); }
.stagebar a { display: inline-flex; align-items: center; gap: 2px; padding: 2px 9px 2px 4px; margin-right: 6px; border-radius: 3px; background: var(--btn); border: 1px solid var(--btn-b); color: var(--btn-text); }
.stagebar a:hover { background: var(--btn-h); text-decoration: none; }
.stagebar .ico { width: 12px; height: 12px; }
.stagebar b { color: var(--prefab); font-weight: 600; }
.doc { max-width: 1000px; margin: 0 auto; padding: 22px 22px 56px; font-size: 15px; line-height: 1.6; }
.doc-head { display: grid; gap: 18px; }
.kicker { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.doc h2 { margin-top: 4px; font-size: 32px; line-height: 1.12; font-weight: 700; color: var(--hi); letter-spacing: -.015em; }
.pitch { margin-top: 8px; font-size: 16px; color: var(--text); max-width: 62ch; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-top: 14px; }
.facts div { padding: 6px 9px; background: var(--field); border: 1px solid var(--field-b); border-radius: 3px; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { color: var(--hi); font-size: 14px; }
.doc-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.doc-note { display: flex; gap: 9px; margin-top: 18px; padding: 10px 12px; border-radius: 3px; background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--pri); font-size: 14px; }
.doc-note .ico { margin-top: 3px; color: var(--pri); }
.doc-sub { margin: 26px 0 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.media { border-radius: 3px; overflow: hidden; background: var(--field); border: 1px solid var(--field-b); }
.media img, .media video, .media canvas { width: 100%; height: auto; }
.media img { cursor: zoom-in; }
.media.cover { aspect-ratio: 16 / 9; }
.media.cover img, .media.cover canvas, .media.cover video { height: 100%; object-fit: cover; }
.media.empty, .code-wrap.empty { display: grid; place-items: center; min-height: 120px; padding: 14px; border: 1px dashed var(--muted); background: transparent; color: var(--muted); text-align: center; font-size: 12px; }
.media.empty b { display: block; color: var(--text); }
.sys { margin-top: 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); scroll-margin-top: 44px; overflow: hidden; }
.sys.flash { animation: flash 1.4s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 2px var(--select); } 100% { box-shadow: 0 0 0 2px transparent; } }
.sys-h { display: flex; align-items: center; gap: 7px; padding: 7px 10px; background: var(--head); border-bottom: 1px solid var(--line); }
.sys-h .ci { color: var(--muted); }
.sys-n { font: 500 12px var(--mono); color: var(--muted); }
.sys-h h3 { font-size: 15px; font-weight: 600; color: var(--hi); }
.sys-b { display: grid; gap: 14px; padding: 14px; }
.sys-text .lead { color: var(--hi); font-weight: 500; }
.sys-text ul { margin: 8px 0 12px; display: grid; gap: 6px; }
.sys-text li { position: relative; padding-left: 16px; }
.sys-text li::before { content: ''; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; background: var(--muted); border-radius: 1px; }
.code-wrap { border: 1px solid var(--field-b); border-radius: 3px; background: var(--code-bg); overflow: hidden; min-width: 0; }
.code-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 6px 4px 10px; background: var(--tabbar); color: var(--text); font: 12px var(--mono); }
.code-head span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.code-head button { padding: 2px 9px; border-radius: 3px; background: var(--btn); border: 1px solid var(--btn-b); color: var(--btn-text); font: 12px var(--ui); white-space: nowrap; }
.code-wrap pre { max-height: 300px; overflow: auto; padding: 12px 14px; font: 12.5px/1.6 var(--mono); color: var(--hi); tab-size: 4; }
.code-wrap.open pre { max-height: none; }
.token.comment { color: var(--tk-com); } .token.keyword, .token.boolean { color: var(--tk-key); } .token.string, .token.char { color: var(--tk-str); }
.token.class-name, .token.namespace { color: var(--tk-cls); } .token.number { color: var(--tk-num); } .token.function { color: var(--tk-fn); } .token.punctuation, .token.operator { color: var(--tk-pun); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 26px; }
.pager a { padding: 10px 12px; border-radius: 4px; background: var(--panel); border: 1px solid var(--line); color: var(--text); }
.pager a:last-child { text-align: right; }
.pager a:hover { border-color: var(--pri); text-decoration: none; }
.pager span { display: block; font-size: 12px; color: var(--muted); }
.pager b { color: var(--prefab); font-size: 15px; }
@container (min-width: 760px) {
  .doc-head { grid-template-columns: minmax(0, 46%) minmax(0, 1fr); align-items: center; }
  .sys-b:has(> figure.media) { grid-template-columns: minmax(0, 1fr) minmax(0, 46%); align-items: start; }
  .sys-b > .code-wrap { grid-column: 1 / -1; }
}

/* ---------- Project ve Console */
.dock-body.project { display: grid; grid-template-columns: 170px minmax(0, 1fr); min-height: 0; }
.folders { padding: 4px 0; background: var(--panel-2); border-right: 1px solid var(--line); overflow: auto; }
.folders li { display: flex; align-items: center; gap: 5px; }
.f-root { padding: 3px 8px; color: var(--hi); font-weight: 500; }
.f-root .ico:first-child { width: 12px; height: 12px; transform: rotate(90deg); color: var(--muted); }
.folders button { display: flex; align-items: center; gap: 6px; flex: 1; padding: 3px 8px 3px 30px; text-align: left; }
.folders button:hover { background: var(--hover); }
.folders button.on { background: var(--sel); color: var(--sel-text); }
.ico.fo { color: #c9a858; }
:root[data-theme="light"] .ico.fo { color: #8a6a18; }
.assets { min-width: 0; overflow: auto; }
.path { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 3px; padding: 3px 10px; background: var(--panel); border-bottom: 1px solid var(--line); color: var(--muted); }
.path .ico { width: 11px; height: 11px; }
.path b { color: var(--hi); font-weight: 500; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 6px; padding: 10px; }
.asset { display: grid; justify-items: center; align-content: start; gap: 5px; padding: 7px 4px 6px; border-radius: 4px; color: var(--text); text-align: center; font-size: 12px; line-height: 1.3; overflow-wrap: anywhere; }
.asset:hover { background: var(--hover); text-decoration: none; color: var(--hi); }
.asset canvas, .asset img { width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 3px; background: var(--panel-2); object-fit: cover; box-shadow: inset 0 0 0 1px var(--line); }
.a-ico { display: grid; place-items: center; width: 52px; height: 63px; }
.a-ico .ico { width: 44px; height: 44px; }
.a-ico.cs { color: #7ec0a6; } .a-ico.pdf { color: #e06b5a; } .a-ico.link { color: var(--link); }
:root[data-theme="light"] .a-ico.cs { color: #1f7a5c; }
.nojs-h { display: none; }
.con-bar { display: flex; align-items: center; justify-content: space-between; padding: 3px 8px; border-bottom: 1px solid var(--line); background: var(--panel); }
.con-bar button { padding: 1px 10px; border-radius: 3px; background: var(--btn); border: 1px solid var(--btn-b); color: var(--btn-text); }
.con-r { display: flex; align-items: center; gap: 5px; color: var(--text); }
.c-info { color: var(--text); } .c-warn { color: var(--warn); }
.con-r .ico { width: 14px; height: 14px; }
.con-r span { margin-right: 6px; }
.log { font: 12px/1.5 var(--mono); }
.log li { display: flex; gap: 8px; padding: 4px 10px; align-items: flex-start; }
.log li:nth-child(odd) { background: var(--panel-2); }
.log .ico { width: 15px; height: 15px; margin-top: 1px; color: var(--text); }
.log .warn .ico { color: var(--warn); }
.log time { color: var(--muted); }
.statusbar { display: flex; justify-content: space-between; gap: 14px; padding: 3px 10px; background: var(--win); border-top: 1px solid var(--gap); color: var(--muted); font-size: 12px; min-height: 24px; }
.st-msg { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); }
.st-r { white-space: nowrap; }

/* ---------- pencereler */
dialog { color: var(--text); }
dialog::backdrop { background: rgba(0, 0, 0, .6); }
.about { max-width: 440px; padding: 18px 20px; border: 1px solid var(--gap); border-radius: 6px; background: var(--panel); box-shadow: var(--shadow); }
.about h2 { font-size: 16px; color: var(--hi); margin-bottom: 8px; }
.about p { margin-top: 8px; font-size: 14px; line-height: 1.55; }
.lb { padding: 0; border: 0; background: transparent; max-width: 96vw; max-height: 96vh; }
.lb img { max-width: 96vw; max-height: 88vh; border-radius: 3px; }
.lb button { display: block; margin: 8px auto 0; padding: 4px 14px; border-radius: 3px; background: var(--btn); border: 1px solid var(--btn-b); color: var(--btn-text); }

/* ---------- Play modu: editör hafifçe renk değiştirir */
.app.playing { --panel: #33373d; --panel-2: #2c3036; --head: #3a3f47; --tabbar: #23262b; }
:root[data-theme="light"] .app.playing { --panel: #c2c8d1; --panel-2: #b6bcc6; --head: #cdd3dc; --tabbar: #9da3ad; }

/* =====================================================================
   JavaScript açıkken: masaüstünde tam ekran editör düzeni
   ===================================================================== */
@media (min-width: 901px) {
  html.js, html.js body { height: 100%; overflow: hidden; }
  .js .app { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; height: 100dvh; }
  .js .workspace { display: grid; grid-template-columns: 232px minmax(0, 1fr) 348px; grid-template-rows: minmax(0, 1fr) 208px; grid-template-areas: "hier view insp" "dock dock insp"; gap: 2px; background: var(--gap); min-height: 0; }
  .js .panel { display: flex; flex-direction: column; min-height: 0; }
  .js .p-hier { grid-area: hier; } .js .p-view { grid-area: view; } .js .p-insp { grid-area: insp; } .js .p-dock { grid-area: dock; }
  .js .panel-body, .js .doc-wrap, .js .dock-body { flex: 1; min-height: 0; overflow: auto; }
  .js .scene-wrap { flex: 1; min-height: 0; }
  .js .dock-body.project { overflow: hidden; }
  .js .app.playing .intro { display: none; }
}
@media (min-width: 901px) and (max-width: 1180px) {
  .js .workspace { grid-template-columns: 200px minmax(0, 1fr) 310px; }
  .win-title { display: none; }
  .toolbar .pill { font-size: 12px; }
}
@media (min-width: 1500px) {
  .js .workspace { grid-template-columns: 260px minmax(0, 1fr) 390px; grid-template-rows: minmax(0, 1fr) 224px; }
}
.js .insp:not(.on) { display: none; }
.js .doc:not(.on) { display: none; }
.js .app[data-mode="scene"] .doc-wrap { display: none; }
.js .app[data-mode="prefab"] .scene-wrap { display: none; }
.js .app[data-mode="prefab"] .stage-tab { display: inline-flex; }
.js .app[data-mode="prefab"] .tab[data-view] { background: none; color: var(--muted); border-top-color: transparent; }
.js .app[data-mode="prefab"] #tree { display: none; }
.js .grid:not(.on) { display: none; }
.js .dock-body:not(.on) { display: none; }

/* =====================================================================
   Telefon ve dar ekran: paneller alt alta
   ===================================================================== */
@media (max-width: 900px) {
  body { font-size: 14px; }
  .menubar { position: sticky; top: 0; z-index: 20; min-height: 40px; }
  .menus { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .menu { position: static; }
  .menu-pop { left: 8px; right: 8px; top: 40px; }
  .menu > button { padding: 8px 9px; }
  .win-title { display: none; }
  .icon-btn { width: 36px; height: 32px; }
  .toolbar { grid-template-columns: auto 1fr; padding: 6px 8px; }
  .toolbar .pill { grid-column: 1 / -1; font-size: 13px; }
  .playctl { justify-self: start; }
  .playctl button { width: 46px; height: 34px; }
  .tb-r .btn { min-height: 34px; }
  .workspace { display: flex; flex-direction: column; gap: 2px; background: var(--gap); }
  .p-view { order: 1; } .p-hier { order: 2; } .p-insp { order: 3; } .p-dock { order: 4; }
  .js .scene-wrap { overflow: visible; background: var(--panel); }
  .js .stage { position: relative; inset: auto; height: min(66svh, 108vw); min-height: 320px; overflow: hidden; background: #26303c; }
  .intro { position: static; width: auto; border: 0; border-radius: 0; box-shadow: none; border-bottom: 1px solid var(--line); padding: 14px 14px 15px; background: var(--panel); }
  .intro h1 { font-size: 26px; }
  .intro .role { font-size: 14px; }
  .intro .sub { font-size: 14px; }
  .intro .btn, .insp-actions .btn, .doc-links .btn { min-height: 36px; padding: 5px 14px; }
  .lbl { font-size: 11px; padding: 2px 6px 2px 5px; }
  .lbl.minor { font-size: 10.5px; }
  .hint { font-size: 11.5px; }
  .js .p-hier .tree { display: flex; gap: 6px; padding: 8px 10px; overflow-x: auto; scrollbar-width: none; }
  .js .p-hier .h-row { flex: none; }
  .js .p-hier .h-group, .js .p-hier .minor, .js .p-hier .h-open { display: none; }
  .js .p-hier .h-row > button, .js .p-hier .h-row > a { min-height: 34px; padding: 4px 11px 4px 9px; border-radius: 17px; background: var(--field); border: 1px solid var(--field-b); }
  .js .p-hier .h-row.on > button, .js .p-hier .h-row.on > a { background: var(--sel); border-color: var(--sel); }
  .js .p-hier .h-row.back > a { margin: 0; }
  .insp { font-size: 14.5px; }
  .f.name { font-size: 17px; }
  .comp > summary { padding: 8px 10px; }
  .comp > summary h3 { font-size: 14px; }
  .row { grid-template-columns: minmax(92px, 32%) minmax(0, 1fr); }
  .dock-body.project { grid-template-columns: 1fr; }
  .folders { display: flex; gap: 6px; padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .f-root { display: none !important; }
  .folders button { padding: 6px 12px 6px 9px; border-radius: 17px; background: var(--field); border: 1px solid var(--field-b); white-space: nowrap; }
  .path { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .js .log { max-height: 220px; overflow: auto; }
  .statusbar { padding: 8px 10px; }
  .st-msg { display: none; }
  .doc { padding: 16px 14px 44px; }
  .doc h2 { font-size: 27px; }
  .stagebar { top: 40px; padding: 7px 10px; }
  .stagebar a { padding: 5px 12px 5px 6px; }
  .sys { scroll-margin-top: 92px; }
  .js .app[data-mode="prefab"] .p-insp, .js .app[data-mode="prefab"] .p-dock, .js .app[data-mode="prefab"] .toolbar, .js .app[data-mode="prefab"] .p-view > .tabbar { display: none; }
  .js .app[data-mode="prefab"] .p-hier { order: 0; position: sticky; top: 40px; z-index: 15; }
  .js .app[data-mode="prefab"] .p-hier .tabbar, .js .app[data-mode="prefab"] .stagebar { display: none; }
  .js .app[data-mode="prefab"] .sys { scroll-margin-top: 100px; }
}

/* =====================================================================
   JavaScript kapalıyken: her şey düz bir sayfa olarak okunur
   ===================================================================== */
.no-js .scene-wrap .stage, .no-js .menus, .no-js .playctl, .no-js .stagebar, .no-js #btnTheme, .no-js .ptree, .no-js .folders, .no-js .path, .no-js .console, .no-js .tab[data-view], .no-js .tab[data-dock="console"], .no-js .preview, .no-js [data-thumb] { display: none; }
.no-js .intro { position: static; width: auto; box-shadow: none; border: 0; }
.no-js .workspace { max-width: 900px; margin: 0 auto; display: grid; gap: 2px; }
.no-js .nojs-h { display: block; padding: 12px 10px 0; font-size: 14px; color: var(--hi); }
.no-js .ptree[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .menubar, .toolbar, .p-hier, .p-dock, .statusbar, .scene-wrap .stage { display: none !important; }
  html, body, .app, .workspace, .panel-body { height: auto !important; overflow: visible !important; display: block !important; }
  .js .insp:not(.on), .js .doc:not(.on) { display: block; }
}

/* ---------- düzeltmeler: Hierarchy oku, küçültülebilir tanıtım kartı */
.h-row > .h-open { flex: none; width: 24px; min-height: 24px; padding: 0; justify-content: center; }
.intro-min { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 3px; color: var(--muted); }
.intro-min:hover { background: var(--hover); color: var(--hi); }
.intro-min .ico { width: 12px; height: 12px; transform: rotate(90deg); transition: transform .12s; }
.intro.min .intro-min .ico { transform: rotate(0); }
.intro h1 { padding-right: 24px; }
.intro.min { width: auto; padding: 7px 40px 7px 12px; }
.intro.min h1 { font-size: 15px; padding-right: 0; }
.intro.min .role, .intro.min .sub, .intro.min .intro-btns { display: none; }
.intro.min .intro-min { top: 50%; transform: translateY(-50%); }
@media (max-width: 900px) { .intro-min { display: none; } .intro.min .role, .intro.min .sub, .intro.min .intro-btns { display: revert; } .intro.min h1 { font-size: 26px; } .intro.min { padding: 14px 14px 15px; } }
.lbl.lift::after { display: none; }
.app.playing .lbl[data-id="ben"] { display: none; }
.js .p-hier .tree { scroll-behavior: smooth; }

/* fragman */
.trailer { margin-top: 18px; }
.trailer .yt, .trailer iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--field-b); border-radius: 3px; overflow: hidden; background: #000; position: relative; }
.trailer .yt img { width: 100%; height: 100%; object-fit: cover; opacity: .85; transition: opacity .15s; }
.trailer .yt:hover img { opacity: 1; }
.yt-play { position: absolute; left: 50%; top: 50%; width: 68px; height: 48px; margin: -24px 0 0 -34px; border-radius: 12px; background: rgba(20,20,20,.82); }
.yt-play::after { content: ''; position: absolute; left: 27px; top: 14px; border: 10px solid transparent; border-left: 17px solid #fff; }
.trailer .yt:hover .yt-play { background: var(--pri); }
.trailer figcaption { margin-top: 5px; font-size: 12px; color: var(--muted); }
#doc-magnobot .media.cover img, .asset img[src*="magnobot"], .preview img[src*="magnobot"] { image-rendering: pixelated; }
.a-ico { width: 100%; aspect-ratio: 16 / 9; height: auto; } .a-ico .ico { width: 36px; height: 36px; }
