/* NCA Multiplication Demo */

#nca-demo {
  margin: 1.5rem 0 2.5rem;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.demo-status {
  font-size: 0.65rem;
  color: rgba(0,0,0,0.3);
  padding: 0.3rem 0;
}

/* ── Number inputs ───────────────────────────────────────── */
.demo-inputs {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
  flex-wrap: wrap;
}
.demo-num-input {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.demo-num-input label {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(0,0,0,0.5);
}
.demo-num-input input[type="number"] {
  width: 70px;
  padding: 0.3rem 0.5rem;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 4px;
  font-family: Menlo, Monaco, monospace;
  font-size: 0.85rem;
  text-align: center;
}
.demo-num-input input[type="number"]:focus {
  outline: none;
  border-color: #2a6e6e;
}
.demo-binary {
  font-family: Menlo, Monaco, monospace;
  font-size: 0.7rem;
  color: rgba(0,0,0,0.35);
}
.demo-times, .demo-eq {
  font-size: 1.1rem;
  color: rgba(0,0,0,0.3);
  font-weight: 300;
}
.demo-result {
  font-family: Menlo, Monaco, monospace;
  font-size: 1.1rem;
  font-weight: 600;
  color: rgba(0,0,0,0.7);
  min-width: 60px;
}
.demo-result.correct { color: #1e8449; }
.demo-result.wrong { color: #922b21; }

/* ── Presets ──────────────────────────────────────────────── */
.demo-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.3rem 0;
}
.demo-preset {
  padding: 0.12rem 0.5rem;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  background: #fff;
  color: rgba(0,0,0,0.5);
  font-family: Menlo, Monaco, monospace;
  font-size: 0.6rem;
  cursor: pointer;
  transition: all 0.12s;
}
.demo-preset:hover { background: #f5f5f5; color: rgba(0,0,0,0.7); }

/* ── Main: canvas left, controls right ───────────────────── */
.demo-body {
  display: flex;
  gap: 0;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 6px;
  background: #fafafa;
}

.demo-canvas-wrap {
  flex: 1;
  min-width: 0;
  padding: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

#demo-canvas { border-radius: 3px; }

.demo-controls {
  width: 160px;
  flex-shrink: 0;
  padding: 1.5rem 1rem;
  border-left: 1px solid rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

@media (max-width: 640px) {
  .demo-body { flex-direction: column; }
  .demo-controls {
    width: 100%;
    border-left: none;
    border-top: 1px solid rgba(0,0,0,0.06);
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0.8rem;
  }
}

.demo-playback { display: flex; gap: 0.6rem; align-items: center; }

.demo-play-btn {
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: #2a6e6e; color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, transform 0.1s;
  box-shadow: 0 2px 8px rgba(42,110,110,0.25);
}
.demo-play-btn:hover { background: #1e5555; transform: scale(1.05); }
.demo-play-btn:active { transform: scale(0.95); }

.demo-reset-btn {
  width: 38px; height: 38px;
  background: #f0f0f0; color: rgba(0,0,0,0.5);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.demo-reset-btn:hover { background: #e4e4e4; color: rgba(0,0,0,0.7); }

.demo-step-btn {
  padding: 0.35rem 0.8rem;
  border: 1px solid rgba(0,0,0,0.1); border-radius: 4px;
  background: #fff; color: rgba(0,0,0,0.5);
  font-size: 0.75rem; cursor: pointer;
  transition: all 0.12s; width: 100%; text-align: center;
}
.demo-step-btn:hover { background: #f5f5f5; color: rgba(0,0,0,0.7); }

.demo-slider-row {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.2rem; width: 100%;
}
.demo-slider-label {
  font-size: 0.65rem; color: rgba(0,0,0,0.35);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.demo-slider-row input[type="range"] { width: 100%; accent-color: #2a6e6e; }
