* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0b0c10;
  --panel: #1f2833;
  --accent: #00ff9d;
  --text: #c5c6c7;
  --muted: #66fcb1;
  --border: #45a29e;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

header {
  text-align: center;
  padding: 2rem 1rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #112233 0%, var(--bg) 100%);
}

header h1 {
  font-size: 2.5rem;
  letter-spacing: -0.5px;
  margin-bottom: 0.5rem;
  background: linear-gradient(to right, var(--accent), #00c851);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

header p {
  color: var(--muted);
  font-size: 1rem;
}

main {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

@media (max-width: 768px) {
  main { grid-template-columns: 1fr; }
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
}

.panel h2 {
  color: var(--accent);
  margin-bottom: 1rem;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.row {
  margin-bottom: 1rem;
}

.row:last-child {
  margin-bottom: 0;
}

.row label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.row label span {
  color: var(--accent);
  font-weight: bold;
}

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

select {
  width: 100%;
  padding: 0.5rem;
  background: #0b0c10;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
}

input[type="color"] {
  width: 100%;
  height: 48px;
  border: none;
  background: none;
  cursor: pointer;
}

button {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  font-size: 0.95rem;
}

button:hover {
  filter: brightness(1.1);
}

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

.actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.canvas-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1rem;
}

.canvas-label {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}

canvas {
  background: #0b0c10;
  border: 1px solid var(--border);
  border-radius: 4px;
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
}

.hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.4rem;
}

textarea {
  width: 100%;
  height: 200px;
  background: #0b0c10;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--accent);
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85rem;
  padding: 0.75rem;
  resize: vertical;
}

footer {
  margin-top: 3rem;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
  text-align: center;
}

footer strong {
  color: var(--accent);
}

.color-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.color-row label {
  margin-bottom: 0;
  width: 120px;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: #0b0c10;
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.25rem;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.1s ease;
}