/* Voronoi Lab Styles */
.voronoi-lab {
  background: #1a1a1a;
  border-radius: 12px;
  padding: 1.5rem;
  margin: 2rem 0;
  color: #e5e7eb;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ============================================
   Header
   ============================================ */
.vl-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid #374151;
}

@media (min-width: 768px) {
  .vl-header { flex-direction: row; }
}

.vl-title {
  font-size: 1.4rem;
  font-weight: 900;
  background: linear-gradient(to right, #22d3ee, #6366f1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-style: italic;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  flex-shrink: 0;
  margin: 0;
}

.vl-title svg { color: #06b6d4; }

#step-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.step-nav-btn {
  padding: 0.3rem 0.625rem;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
  transition: background 150ms, color 150ms;
  color: #64748b;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.step-nav-btn:hover { background: #1e293b; }
.step-nav-btn.active { background: #0891b2; color: #fff; }

/* ============================================
   Body layout
   ============================================ */
.vl-body {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  align-items: stretch;
}

@media (max-width: 800px) {
  .vl-body { grid-template-columns: 1fr; }
}

/* ============================================
   Aside
   ============================================ */
.vl-aside {
  background: #111827;
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid #374151;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
}

.vl-aside-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.vl-aside-header h2 {
  font-size: 0.7rem;
  font-weight: 900;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0;
}

#btn-random-seed {
  color: #06b6d4;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 0;
  transition: color 150ms;
}
#btn-random-seed:hover { color: #22d3ee; }

.vl-controls-wrap { display: flex; flex-direction: column; gap: 0.5rem; }
.vl-controls-inner { display: flex; flex-direction: column; gap: 0.75rem; }

/* Section panels */
.vl-section-panel {
  padding-top: 0.75rem;
  border-top: 1px solid #374151;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: opacity 200ms;
}
.vl-section-panel.disabled { opacity: 0.2; pointer-events: none; }

.vl-section-label label {
  font-size: 0.7rem;
  font-weight: 900;
  color: #94a3b8;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.5rem;
}

/* Stepper control */
.stepper-group {
  border-bottom: 1px solid #374151;
  padding-bottom: 0.75rem;
}

.stepper-group > label {
  font-size: 0.7rem;
  font-weight: 900;
  color: #94a3b8;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  display: block;
  transition: color 150ms;
}
.stepper-group:focus-within > label { color: #22d3ee; }

.stepper-row {
  display: flex;
  align-items: center;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 150ms;
}
.stepper-row:focus-within { border-color: #06b6d4; }

.stepper-btn {
  padding: 0.5rem;
  color: #64748b;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 0;
  flex-shrink: 0;
  transition: color 150ms, background 150ms;
}
.stepper-btn:hover { color: #22d3ee; background: #1e293b; }
.stepper-btn:active { transform: scale(0.9); }

.stepper-input-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}
.stepper-input-wrap svg {
  position: absolute;
  left: 0.5rem;
  color: #475569;
  pointer-events: none;
}
.stepper-input-wrap input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  padding: 0.4rem 0.4rem 0.4rem 1.6rem;
  color: #fff;
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
}
.stepper-input-wrap input::-webkit-inner-spin-button,
.stepper-input-wrap input::-webkit-outer-spin-button { -webkit-appearance: none; }
.stepper-input-wrap input { -moz-appearance: textfield; }

/* Bottom panel */
.vl-bottom-panel {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding-top: 1rem;
  border-top: 1px solid #374151;
}

#btn-full-play {
  width: 100%;
  padding: 0.6rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 900;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: #4f46e5;
  border: none;
  cursor: pointer;
  transition: background 150ms;
  font-family: inherit;
}
#btn-full-play:hover { background: #6366f1; }
#btn-full-play svg { color: #fde047; }

#btn-animate {
  width: 100%;
  padding: 0.6rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.8rem;
  color: #22d3ee;
  background: rgba(6,182,212,.1);
  border: 1px solid rgba(6,182,212,.3);
  cursor: pointer;
  transition: background 150ms;
  font-family: inherit;
}
#btn-animate:hover { background: rgba(6,182,212,.2); }

.vl-insight-box {
  background: #0f172a;
  border: 1px solid #374151;
  padding: 0.75rem;
  border-radius: 8px;
}
.vl-insight-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
  font-style: italic;
}
#desc-text {
  font-size: 10px;
  color: #94a3b8;
  line-height: 1.6;
  font-style: italic;
  margin: 0;
}

/* ============================================
   Main / canvas
   ============================================ */
#vl-main {
  background: #111827;
  border-radius: 12px;
  border: 1px solid #374151;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  gap: 1rem;
}

#canvas-wrapper {
  position: relative;
  width: 100%;
  background: #020617;
  border: 1px solid #374151;
  border-radius: 12px;
  overflow: hidden;
  cursor: grab;
  aspect-ratio: 4 / 3;
}
#canvas-wrapper:active { cursor: grabbing; }

#main-canvas { display: block; width: 100%; height: 100%; }

#anim-progress {
  position: absolute;
  bottom: 0; left: 0;
  height: 4px;
  background: #06b6d4;
  transition: width 300ms;
  box-shadow: 0 0 8px rgba(34,211,238,.5);
}
#anim-progress.hidden { display: none; }

#step-badge {
  position: absolute;
  top: 0.75rem; left: 0.75rem;
  padding: 0.3rem 0.7rem;
  background: rgba(2,6,23,.85);
  border: 1px solid #334155;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #22d3ee;
  text-transform: uppercase;
}
#step-badge.hidden { display: none; }

.vl-reset-wrap { position: absolute; top: 0.75rem; right: 0.75rem; }
#btn-reset-view {
  padding: 0.45rem;
  background: rgba(2,6,23,.9);
  border: 1px solid #334155;
  border-radius: 8px;
  color: #94a3b8;
  cursor: pointer;
  line-height: 0;
  transition: color 150ms;
}
#btn-reset-view:hover { color: #22d3ee; }

.vl-nav-btns { display: flex; gap: 0.75rem; }

#btn-prev {
  padding: 0.6rem 2rem;
  background: #1e293b;
  border: 1px solid #374151;
  border-radius: 8px;
  font-weight: 900;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #cbd5e1;
  cursor: pointer;
  transition: background 150ms;
  font-family: inherit;
}
#btn-prev:hover:not(:disabled) { background: #374151; }
#btn-prev:disabled { opacity: 0.25; cursor: not-allowed; }

#btn-next {
  padding: 0.6rem 2rem;
  background: #0891b2;
  border: none;
  border-radius: 8px;
  font-weight: 900;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  cursor: pointer;
  transition: background 150ms;
  font-family: inherit;
}
#btn-next:hover:not(:disabled) { background: #06b6d4; }
#btn-next:disabled { opacity: 0.25; cursor: not-allowed; }

/* ============================================
   Pulse animation
   ============================================ */
@keyframes vl-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}
.animate-pulse { animation: vl-pulse 2s ease-in-out infinite; }

/* Scrollbar (aside) */
.vl-aside::-webkit-scrollbar { width: 4px; }
.vl-aside::-webkit-scrollbar-track { background: #111827; }
.vl-aside::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }