/* Minimal Diffusion */

:root {
  --bg: #0a0a0a;
  --fg: #e8e8e8;
  --muted: #888;
  --accent: #4a9eff;
  --surface: #1a1a1a;
  --border: #333;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
  background: var(--bg);
  color: var(--fg);
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
  line-height: 1.6;
}

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

h1 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

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

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

h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.desc {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

/* Scrubber */

#scrubber-display {
  position: relative;
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

#scrubber-canvas {
  background: #000;
  border-radius: 4px;
  image-rendering: pixelated;
}

#loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--accent);
  font-size: 0.9rem;
}

#loading-spinner.hidden {
  display: none;
}

#scrubber-controls {
  text-align: center;
  margin-bottom: 1rem;
}

#timestep-slider {
  width: 100%;
  max-width: 400px;
  accent-color: var(--accent);
}

#timestep-label {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

/* Buttons */

button {
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: border-color 0.2s;
}

button:hover:not(:disabled) {
  border-color: var(--accent);
}

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

button.active {
  border-color: var(--accent);
  color: var(--accent);
}

#generate-grid-btn {
  display: block;
  margin: 0 auto 1rem;
}

/* Grid */

#grid-display {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

#grid-canvas {
  background: #000;
  border-radius: 4px;
  image-rendering: pixelated;
}

/* Draw Section */

#draw-controls {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

#draw-area {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#draw-canvas {
  background: #000;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: crosshair;
  touch-action: none;
}

.draw-buttons {
  display: flex;
  gap: 0.5rem;
}

#draw-noise-control {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

#draw-noise-control label {
  font-size: 0.8rem;
  color: var(--muted);
}

#noise-level-slider {
  accent-color: var(--accent);
}

#noise-level-label {
  font-size: 0.8rem;
  color: var(--muted);
}

/* Draw Results */

#draw-results {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.result-panel {
  text-align: center;
}

.result-panel canvas {
  background: #000;
  border-radius: 4px;
  image-rendering: pixelated;
  display: block;
  margin-bottom: 0.25rem;
}

.result-panel span {
  font-size: 0.75rem;
  color: var(--muted);
}

/* Direction Section */

#direction-controls {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

#direction-canvas {
  background: #000;
  border-radius: 4px;
  image-rendering: pixelated;
  display: block;
  margin: 0 auto 1rem;
}

#btn-animate {
  display: block;
  margin: 0 auto;
}

/* Footer */

footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 2rem;
}

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

/* Fallback */

#fallback {
  text-align: center;
  padding: 2rem;
}

#fallback img {
  max-width: 224px;
  image-rendering: pixelated;
  margin-top: 1rem;
}
