* { box-sizing: border-box; }
body { margin:0; font-family: system-ui, sans-serif; background:#0d1b2a; color:#eee; }
body.auth { display:grid; place-items:center; height:100vh; }
.card { background:#12233f; padding:24px; border-radius:10px; width:300px; display:flex; flex-direction:column; gap:10px; }
.card input, .card button { padding:10px; border-radius:6px; border:1px solid #33415c; }
.err { color:#ff8a8a; }
.topbar { display:flex; justify-content:space-between; align-items:center; padding:12px 20px; background:#0a1526; }
.topbar a { color:#C9A24B; text-decoration:none; margin-left:12px; }
main { padding:20px; }
.btn, button { background:#C9A24B; color:#0a1526; border:0; padding:8px 14px; border-radius:6px; cursor:pointer; font-weight:700; }
.grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:16px; }
.card-item { background:#12233f; border-radius:10px; overflow:hidden; }
.card-item img { width:100%; display:block; }
.card-item .noimg { height:160px; display:grid; place-items:center; color:#889; }
.card-item .title { padding:8px; font-weight:700; }
.card-item .meta { padding:0 8px 8px; font-size:12px; color:#889; }
.card-item .actions { display:flex; gap:6px; padding:8px; }
.card-item .actions button { flex:1; font-size:12px; }

/* Editor */
.editor { display:grid; grid-template-columns:300px 1fr; gap:16px; }
.panel { background:#12233f; border-radius:10px; padding:12px; max-height:88vh; overflow:auto; }
.panel h4 { margin:12px 0 6px; color:#C9A24B; }
.panel label { display:block; font-size:12px; margin:6px 0 2px; }
.panel input, .panel select { width:100%; padding:6px; border-radius:5px; border:1px solid #33415c; background:#0d1b2a; color:#eee; }
.toolbar { display:flex; gap:8px; margin-bottom:10px; align-items:center; }
.toolbar #title { flex:1; padding:8px; border-radius:6px; border:1px solid #33415c; background:#0d1b2a; color:#eee; }
.stage-wrap { display:flex; flex-direction:column; align-items:center; }
/* 1080x1080 scaled to fit via transform in JS; base box is fixed. */
.stage { position:relative; width:1080px; height:1080px; background:#0A1A3A center/cover no-repeat; transform-origin:top left; }
.stage .layer { position:absolute; }
.stage .txt { cursor:text; white-space:pre-wrap; outline:none; line-height:1.05; }
.stage .txt.selected, .stage .photo.selected, .stage .badge.selected, .stage .flag.selected { outline:2px dashed #C9A24B; }
.stage .photo, .stage .badge, .stage .flag { cursor:move; }
.stage .photo { overflow:hidden; }
.stage .photo img { display:block; }
.stage .txt.editing { cursor:text; outline:2px solid #C9A24B; }

/* Panel: layers list */
.panel .layers { display:flex; flex-direction:column; gap:2px; margin-bottom:6px; }
.lrow { display:flex; align-items:center; gap:8px; padding:5px 6px; border-radius:5px; cursor:pointer; font-size:13px; }
.lrow:hover { background:#0d1b2a; }
.lrow.sel { background:#1c3562; }
.lrow .lname { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.eye { cursor:pointer; color:#C9A24B; width:14px; text-align:center; }
.eye.off { color:#556; }
.num-row { display:flex; gap:8px; }
.num-row span { flex:1; }
.panel .hint { font-size:12px; color:#8794ad; margin:6px 0; }
.panel textarea { width:100%; padding:6px; border-radius:5px; border:1px solid #33415c; background:#0d1b2a; color:#eee; font-family:inherit; resize:vertical; }
.panel button.primary { width:100%; margin-top:8px; background:#1c3562; color:#fff; }
.share-links { display:flex; flex-direction:column; gap:6px; margin-top:8px; }
.share-links button { width:100%; background:#0d1b2a; color:#C9A24B; border:1px solid #33415c; }
.share-links button:hover { background:#12233f; }
