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

:root {
  --bg: #0f0f1a;
  --surface: #1a1a2e;
  --border: #2a2a4a;
  --text: #e0e0e0;
  --text-muted: #888;
  --accent: #4fc3f7;
  --accent-dim: #1a3a5c;
}

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

.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

header h1 {
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

/* Canvas */
.canvas-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

canvas {
  display: block;
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
}

/* Controls */
.controls {
  display: flex;
  gap: 1rem;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.control-group label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  cursor: pointer;
}

select:focus {
  outline: none;
  border-color: var(--accent);
}

.render-btn {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 4px;
  padding: 0.5rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.render-btn:hover {
  opacity: 0.85;
}

.render-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Progress */
.progress {
  margin-bottom: 2rem;
}

.progress-track {
  height: 4px;
  background: var(--surface);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

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

.progress-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: "SF Mono", "Fira Code", monospace;
}

/* Info */
.info {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  margin-bottom: 2rem;
}

.info h2 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.info h3 {
  font-size: 0.95rem;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.info p {
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.info ul {
  list-style: none;
  padding: 0;
}

.info li {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.info li:last-child {
  border-bottom: none;
}

.info li strong {
  color: var(--text);
}

.info a {
  color: var(--accent);
  text-decoration: none;
}

.info a:hover {
  text-decoration: underline;
}

.info code {
  background: var(--accent-dim);
  padding: 0.1em 0.3em;
  border-radius: 3px;
  font-size: 0.85em;
}

.info pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 0.75rem;
}

.info pre code {
  background: none;
  padding: 0;
  font-size: 0.8em;
  color: var(--text);
}

/* Footer */
footer {
  text-align: center;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
}

footer a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
}

footer a:hover {
  color: var(--accent);
}

/* Responsive */
@media (max-width: 640px) {
  .controls {
    flex-direction: column;
    align-items: stretch;
  }
  .render-btn {
    width: 100%;
    padding: 0.75rem;
  }
}
