:root { color-scheme: dark; font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
* { box-sizing: border-box; }
body { background: radial-gradient(circle at 50% -10%, #23345a 0, #101827 42%); }
button { cursor: pointer; }
.app-header { height: 76px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #27354a; background: rgba(16,24,39,.82); backdrop-filter: blur(14px); }
.logo-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: #fff; background: linear-gradient(135deg,#8b5cf6,#22d3ee); box-shadow: 0 8px 22px #8b5cf650; }
.logo-mark img { width: 28px; height: 28px; object-fit: contain; image-rendering: pixelated; }
.workspace { min-height: calc(100vh - 76px); display: grid; grid-template-columns: 245px minmax(0,1fr) 245px; gap: 18px; padding: 18px; }
.tool-panel,.frames-panel { display: flex; flex-direction: column; min-width: 0; padding: 18px; border: 1px solid #27354a; border-radius: 18px; background: rgba(23,34,53,.78); box-shadow: 0 18px 50px #02061740; }
.panel-heading { display:flex; align-items:center; justify-content:space-between; font-weight: 700; }
.chip { font-size: 11px; font-weight: 600; color:#c4b5fd; background:#312e81; border-radius:999px; padding:5px 8px; }
.tool-grid { display:grid; grid-template-columns: 1fr 1fr; gap:8px; margin:16px 0; }
.tool-btn,.action-btn,.export-btn { display:flex; align-items:center; gap:8px; border:1px solid #30415a; border-radius:10px; color:#cbd5e1; background:#1b2a40; padding:9px 10px; font-size:12px; transition:.15s; }
.tool-btn { flex-direction:column; justify-content:center; gap:4px; height:66px; }
.tool-btn span { font-size:11px; }
.tool-btn:hover,.action-btn:hover,.export-btn:hover { border-color:#8b5cf6; color:#fff; transform:translateY(-1px); }
.tool-btn.active { background:#4c1d95; border-color:#a78bfa; color:#fff; }
.color-control { display:flex; align-items:center; justify-content:space-between; padding:10px 12px; background:#111c2e; border-radius:10px; color:#94a3b8; font-size:12px; }
.color-control input { width:32px; height:27px; border:0; padding:0; background:transparent; }
.swatches { display:flex; flex-wrap:wrap; gap:7px; padding:12px 2px 2px; }
.swatch { width:21px; height:21px; border-radius:6px; border:2px solid transparent; }
.swatch.active { border-color:#fff; outline:2px solid #8b5cf6; }
.divider { height:1px; background:#27354a; margin:16px 0; }
.tool-actions { display:grid; gap:7px; }
.action-btn { width:100%; justify-content:flex-start; }
.frame-delay-control { display:grid; grid-template-columns:1fr 64px auto; align-items:center; gap:7px; color:#94a3b8; font-size:11px; }
.frame-delay-control .text-input { padding:8px; font-size:12px; }
.action-btn:disabled { opacity:.4; cursor:not-allowed; transform:none; }
.panel-label { margin-bottom:8px; font-size:11px; color:#94a3b8; text-transform:uppercase; letter-spacing:.12em; }
.export-box { display:grid; gap:7px; }
.export-btn { justify-content:center; }
.accent-btn,.primary-btn { background:linear-gradient(135deg,#7c3aed,#0891b2); border:0; color:#fff; }
.stage-toolbar { width:min(76vh,76vw); max-width:760px; display:flex; justify-content:space-between; color:#94a3b8; font-size:12px; margin:0 auto 10px; }
.canvas-stage { display:flex; flex-direction:column; align-items:center; justify-content:center; min-width:0; }
.canvas-wrap { display:grid; place-items:center; position:relative; width:min(76vh,76vw); height:min(76vh,76vw); max-width:760px; max-height:760px; padding:16px; border:1px solid #33445e; border-radius:20px; background:repeating-conic-gradient(#1d2b41 0 25%, #172235 0 50%) 0/28px 28px; box-shadow:0 24px 70px #02061770; }
#pixelCanvas { width:100%; height:100%; image-rendering:pixelated; cursor:crosshair; touch-action:none; }
.empty-hint { position:absolute; pointer-events:none; color:#64748b; font-size:13px; opacity:0; }
.canvas-help { margin-top:12px; color:#64748b; font-size:11px; text-align:center; }
kbd { background:#26364e; border:1px solid #3d506c; padding:2px 5px; border-radius:4px; color:#cbd5e1; }
.frames-list { display:grid; gap:10px; margin-top:14px; overflow:auto; padding:2px; }
.frame-card { display:grid; grid-template-columns:52px 1fr 24px; align-items:center; gap:9px; padding:7px; border:1px solid #30415a; border-radius:10px; background:#142238; }
.frame-card.active { border-color:#a78bfa; background:#30205d; }
.frame-thumb { width:52px; height:52px; image-rendering:pixelated; border-radius:6px; background:repeating-conic-gradient(#293950 0 25%, #1b2a40 0 50%) 0/10px 10px; }
.frame-name { font-size:12px; color:#cbd5e1; }
.delete-frame { color:#64748b; font-size:18px; }
.delete-frame:hover { color:#fb7185; }
.icon-btn,.ghost-btn,.danger-btn,.primary-btn { border-radius:9px; padding:8px 11px; font-size:12px; }
.icon-btn { border:1px solid #30415a; color:#cbd5e1; background:#1b2a40; }
.ghost-btn { border:1px solid #30415a; color:#cbd5e1; background:transparent; }
.danger-btn { border:1px solid #7f1d1d; color:#fda4af; background:#450a0a40; }
.primary-btn { padding:10px 15px; }
.project-dialog { border:0; padding:0; background:transparent; color:#f8fafc; }
.project-dialog::backdrop { background:#020617b8; backdrop-filter:blur(5px); }
.dialog-card { width:min(420px,calc(100vw - 30px)); padding:24px; border:1px solid #33445e; border-radius:18px; background:#172235; box-shadow:0 25px 80px #020617b8; }
.field-label { display:grid; gap:7px; margin-top:17px; color:#cbd5e1; font-size:12px; }
.text-input { width:100%; border:1px solid #3a4b64; border-radius:9px; background:#111c2e; color:#fff; padding:10px 11px; outline:none; }
.text-input:focus { border-color:#8b5cf6; box-shadow:0 0 0 3px #8b5cf633; }
.toast { position:fixed; right:22px; bottom:22px; opacity:0; pointer-events:none; transform:translateY(10px); transition:.2s; padding:11px 15px; border:1px solid #3d506c; border-radius:10px; background:#172235; color:#e2e8f0; font-size:12px; box-shadow:0 15px 40px #02061780; }
.toast.visible { opacity:1; transform:none; }
@media (max-width: 960px) { .workspace { grid-template-columns: 210px minmax(0,1fr); } .frames-panel { grid-column:1/-1; } .frames-list { grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); } }
@media (max-width: 680px) { .app-header { padding:0 14px; } .workspace { grid-template-columns:1fr; padding:10px; } .tool-panel { order:2; } .frames-panel { order:3; } .canvas-stage { order:1; min-height:55vh; } .canvas-wrap,.stage-toolbar { width:min(92vw,70vh); height:min(92vw,70vh); } .stage-toolbar { height:auto; } .tool-grid { grid-template-columns:repeat(4,1fr); } .tool-btn { height:58px; } }
