:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1f2330;
  --text: #e8ecf4;
  --muted: #9aa3b2;
  --accent: #5eead4;
  --accent-2: #60a5fa;
  --danger: #ef4444;
  --border: #2a2f3d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(1200px 700px at 20% -10%, #1a2030 0%, var(--bg) 60%) fixed;
  color: var(--text);
  min-height: 100vh;
}

header {
  padding: 28px 24px 8px;
  max-width: 1200px;
  margin: 0 auto;
}

h1 { margin: 0; font-size: 28px; letter-spacing: -0.02em; }
.subtitle { margin: 4px 0 0; color: var(--muted); }

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px 60px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 36px;
  text-align: center;
  background: var(--panel);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--accent);
  background: var(--panel-2);
}
.dropzone .hint { color: var(--muted); font-size: 13px; margin-top: 6px; }

.controls {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px 18px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field small { color: var(--muted); font-size: 12px; }
.field.toggle { justify-content: flex-end; }
.field label { font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; }
.val { color: var(--accent); font-variant-numeric: tabular-nums; }

input[type="range"] { width: 100%; accent-color: var(--accent); }
select {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
}

.actions { grid-column: 1 / -1; display: flex; gap: 10px; justify-content: flex-end; }

button {
  background: var(--accent);
  color: #08221c;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .05s ease, filter .15s ease;
}
button:hover { filter: brightness(1.06); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .55; cursor: not-allowed; }
button.secondary { background: var(--accent-2); color: #0b1a33; }

.previews {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 760px) { .previews { grid-template-columns: 1fr; } }

.preview h2 { margin: 0 0 8px; font-size: 14px; color: var(--muted); font-weight: 500; }
.canvas {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.canvas img { max-width: 100%; max-height: 560px; display: block; }
.placeholder { color: var(--muted); font-size: 14px; }

.checker {
  background-image:
    linear-gradient(45deg, #222835 25%, transparent 25%),
    linear-gradient(-45deg, #222835 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #222835 75%),
    linear-gradient(-45deg, transparent 75%, #222835 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-color: #11141b;
}

.status {
  min-height: 22px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}
.status.err { color: var(--danger); }

.file-list {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}
.file-list .item { color: var(--text); }
.file-list .item .sz { color: var(--muted); margin-left: 6px; }
