:root {
  --bg: #0e1410;
  --panel: #152018;
  --line: #2a3b30;
  --text: #e6f0e8;
  --muted: #8aa192;
  --accent: #7dce6a;
  --accent-dim: #3d6a38;
  --sel: rgba(125, 206, 106, 0.28);
  --font: "Sora", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(ellipse 80% 50% at 10% 0%, #1a2e20 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 100%, #1a2418 0%, transparent 50%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
}

.app {
  display: grid;
  grid-template-columns: minmax(280px, 340px) 1fr;
  min-height: 100vh;
}

.panel {
  padding: 1.25rem 1.15rem 1.75rem;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: auto;
}

.brand-mark {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand-sub {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 1.25rem 0.75rem;
  border: 1px dashed var(--accent-dim);
  border-radius: 10px;
  background: #0f1a13;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.drop:hover,
.drop.drag {
  border-color: var(--accent);
  background: #132218;
}

.drop-title { font-weight: 600; font-size: 0.95rem; }
.drop-hint { color: var(--muted); font-size: 0.72rem; }

.meta {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  word-break: break-all;
}

.controls { display: grid; gap: 0.75rem; }

.controls label,
.palette-block {
  display: grid;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.controls label.check {
  grid-template-columns: auto 1fr;
  align-items: center;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.85rem;
  color: var(--text);
  gap: 0.5rem;
}

.row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.35rem;
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0c120e;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.85rem;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

button {
  appearance: none;
  border: 0;
  border-radius: 6px;
  padding: 0.55rem 0.75rem;
  background: var(--accent);
  color: #0a120c;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

button:disabled { opacity: 0.4; cursor: not-allowed; }

button.ghost,
.row button {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.row button {
  min-width: 2.25rem;
  padding: 0.45rem 0.5rem;
  font-family: var(--mono);
}

.actions { display: grid; gap: 0.45rem; }
.section-label { margin: 0; }

.palette {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}

.palette input[type="color"] {
  width: 100%;
  height: 1.6rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

.tip {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.45;
}

.stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stage-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.canvas-wrap {
  flex: 1;
  overflow: auto;
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}

#view {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background:
    repeating-conic-gradient(#1a241c 0% 25%, #121a14 0% 50%) 0 0 / 16px 16px;
  border: 1px solid var(--line);
  cursor: crosshair;
  max-width: none;
}

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}
