:root { --primary: #ff4500; --bg: #0a0a0a; --card: #111; --border: #222; }
body { background: var(--bg); color: white; font-family: -apple-system, sans-serif; margin: 0; display: flex; flex-direction: column; align-items: center; }
.app-wrapper { padding: 20px; }

.main-layout { display: flex; gap: 30px; max-width: 1300px; width: 100%; margin-top: 20px; }

/* Preview Area */
.preview-area { flex: 2; background: var(--card); padding: 25px; border-radius: 12px; border: 1px solid var(--border); text-align: center; }
.canvas-container { background: #000; border: 1px dashed #444; border-radius: 8px; padding: 10px; min-height: 300px; display: flex; align-items: center; justify-content: center; position: relative; }
canvas { max-width: 100%; height: auto; image-rendering: pixelated; box-shadow: 0 10px 30px rgba(0,0,0,0.5); cursor: crosshair; }

/* Panel Area */
.color-panel { flex: 1; background: var(--card); padding: 25px; border-radius: 12px; border: 1px solid var(--border); position: sticky; top: 20px; }

.tool-box { margin-bottom: 20px; background: #000; padding: 15px; border-radius: 8px; border: 1px solid #333; }
.tool-box label { display: block; margin-bottom: 10px; font-weight: bold; color: var(--primary); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; }

input[type="range"] { width: 100%; accent-color: var(--primary); cursor: pointer; }
select { width: 100%; padding: 10px; background: #1a1a1a; color: white; border: 1px solid #444; border-radius: 5px; margin-bottom: 10px; }

.color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(32px, 1fr)); gap: 4px; margin: 15px 0; max-height: 200px; overflow-y: auto; padding: 10px; background: #050505; border-radius: 6px; }
.color-swatch { aspect-ratio: 1/1; border-radius: 2px; border: 1px solid transparent; cursor: pointer; transition: transform 0.1s; }
.color-swatch:hover { transform: scale(1.1); border-color: white; z-index: 5; }
.color-swatch.active { border: 2px solid white; box-shadow: 0 0 10px var(--primary); }

.btn { background: var(--primary); color: white; border: none; width: 100%; padding: 12px; border-radius: 6px; font-weight: bold; cursor: pointer; transition: 0.2s; font-size: 0.9rem; }
.btn:hover { filter: brightness(1.2); transform: translateY(-1px); }
.btn-secondary { background: #333; margin-top: 8px; }

.badge { background: var(--primary); padding: 2px 6px; border-radius: 4px; font-size: 10px; float: right; color: white; }
input[type="file"] { margin-bottom: 20px; color: #888; }
input[type="color"] { width: 100%; height: 40px; border: none; background: none; cursor: pointer; margin-bottom: 10px; }