body {
  background: var(--bg); color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; padding: 20px 16px; overflow-x: hidden;
}

h1 {
  font-size: 22px; font-weight: 700; letter-spacing: -0.5px;
  margin-bottom: 4px; text-align: center;
  background: linear-gradient(135deg, #e6edf3 0%, #8b949e 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 13px; color: var(--text2); text-align: center;
  margin-bottom: 16px; font-family: 'JetBrains Mono', monospace;
}

.stage-banner {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 10px; padding: 8px 20px; margin-bottom: 12px;
  text-align: center; min-height: 42px; display: flex;
  flex-direction: column; align-items: center; justify-content: center;
  width: 100%; max-width: 1080px;
}

.stage-title { font-size: 14px; font-weight: 600; color: var(--accent); letter-spacing: 0.3px; }
.stage-desc  { font-size: 12px; color: var(--text2); margin-top: 2px; font-family: 'JetBrains Mono', monospace; }

.canvas-row {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 1080px;
  align-items: flex-start;
}

.scene-wrapper {
  flex: 1;
  min-width: 0;
  width: 100%; max-width: 1080px;
  aspect-ratio: var(--scene-ratio, 4/3);
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 16px; position: relative; overflow: hidden;
}

.scene-wrapper::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(31,111,235,0.04) 0%, transparent 70%);
  pointer-events: none; z-index: 1;
}
.scene-wrapper::after {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 28px 28px; pointer-events: none; z-index: 1;
}

#line-canvas, #anim-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
}
#line-canvas { z-index: 3; }
#anim-canvas { z-index: 4; }

#scene { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; }

.legend {
  display: flex; gap: 14px; margin-top: 10px; flex-wrap: wrap;
  justify-content: center; font-size: 11px; color: var(--text2);
  font-family: 'JetBrains Mono', monospace;
}
.legend-item { display: flex; align-items: center; gap: 5px; }
.legend-dot  { width: 8px; height: 8px; border-radius: 50%; }

.speed-wrap {
  display: flex; align-items: center; gap: 8px; font-size: 11px;
  color: var(--text2); font-family: 'JetBrains Mono', monospace; margin-top: 8px;
}
input[type=range] { accent-color: var(--accent); cursor: pointer; }
