/* MS.2 — Piano Roll Panel
   Sits below the Clip Launcher grid in Performance mode. */

.piano-roll-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--role-button-face-primary), rgba(8, 12, 16, 0.95));
  border: 1px solid rgba(100, 200, 220, 0.25);
  margin-top: 12px;
}

.piano-roll-header {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: -apple-system, system-ui, "Segoe UI", sans-serif;
  font-size: 12px;
  color: var(--neon-color-button-text);
}

.piano-roll-title {
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64dcde;
  font-size: 11px;
}

.piano-roll-target {
  flex: 1;
  font-style: italic;
  color: #b8d0e0;
}

.piano-roll-info {
  font-family: monospace;
  font-size: 12px;
  color: #6890a8;
  white-space: nowrap;
}

/* MS.3 — Capture button + quantize selector */
.piano-roll-capture-btn {
  font-family: monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 3px;
  border: 1px solid rgba(180, 60, 60, 0.55);
  background: rgba(60, 18, 22, 0.85);
  color: #ff8a8a;
  cursor: pointer;
  transition: all 0.12s ease;
}
.piano-roll-capture-btn:hover {
  background: rgba(90, 24, 30, 0.95);
  color: #ffb0b0;
}
.piano-roll-capture-btn--armed {
  background: #d83a3a;
  color: #fff;
  border-color: var(--role-accent-record);
  box-shadow: 0 0 8px rgba(255, 80, 80, 0.6);
  animation: piano-roll-capture-pulse 1.2s ease-in-out infinite;
}
@keyframes piano-roll-capture-pulse {
  0%, 100% { box-shadow: 0 0 6px rgba(255, 80, 80, 0.45); }
  50%      { box-shadow: 0 0 14px rgba(255, 80, 80, 0.95); }
}
.piano-roll-quantize,
.piano-roll-follow,
.piano-roll-follow-loops,
.piano-roll-launch-quantize {
  font-family: monospace;
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 3px;
  border: 1px solid rgba(100, 180, 200, 0.3);
  background: var(--role-button-face-primary);
  color: var(--neon-color-button-text);
  cursor: pointer;
}
.piano-roll-follow-loops {
  width: 48px;
  cursor: text;
}

.piano-roll-canvas-wrap {
  overflow: auto;
  max-height: 480px;
  border-radius: 4px;
  background: #0a1015;
  border: 1px solid rgba(80, 130, 150, 0.2);
}

.piano-roll-canvas-wrap canvas {
  display: block;
  cursor: crosshair;
  /* Pixel-perfect rendering — important for the keyboard gutter labels */
  image-rendering: pixelated;
}

/* Make sure the panel doesn't appear outside Performance mode */
html:not([data-work-mode="performance"]) #pianoRollHost {
  display: none;
}
