/* Vocal pedal: effect knobs in the top-right corner of the board + detail panel */

.vocal-fx-pedal {
  position: absolute;
  top: calc(100% + 8px);
  right: 16px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  max-width: calc(100% - 32px);
  font-family: var(--font-main);
  user-select: none;
  pointer-events: none; /* the header passes clicks through; only the cards take them */
}

.vocal-fx-pedal.is-hidden {
  display: none;
}

.vfx-row-knobs,
.vfx-panel {
  pointer-events: auto;
}

.vfx-row-knobs {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  padding: 6px 8px 4px;
  border: 1px solid var(--paper-border);
  border-radius: 12px;
  background: var(--paper-card);
  backdrop-filter: blur(6px);
  opacity: 0.8;
}

.vfx-knobs {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 2px 4px;
  width: calc(6 * 50px + 5 * 4px); /* starts as two lines of six */
  min-width: 0;
}

.vfx-row-knobs.is-sized .vfx-knobs {
  flex: 1 1 auto;
  width: auto;
}

.vfx-row-knobs {
  position: relative;
}

.vfx-row-knobs.is-animating {
  overflow: hidden;
}

.vfx-row-knobs.is-animating .vfx-knobs {
  flex: none;
}

.vfx-grip {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 14px;
  height: 14px;
  cursor: nesw-resize;
  touch-action: none;
  opacity: 0.7;
}

.vfx-grip::after {
  content: '';
  position: absolute;
  left: 4px;
  bottom: 4px;
  width: 6px;
  height: 6px;
  border-left: 2px solid var(--graphite-light);
  border-bottom: 2px solid var(--graphite-light);
  border-bottom-left-radius: 3px;
}

.vfx-grip:hover,
.vfx-row-knobs.is-resizing .vfx-grip {
  opacity: 1;
}

.vocal-fx-pedal.is-collapsed .vfx-knobs,
.vocal-fx-pedal.is-collapsed .vfx-grip {
  display: none;
}

.vocal-fx-pedal.is-collapsed .vfx-row-knobs {
  width: auto !important;
  height: auto !important;
}

.vfx-seg-group.vfx-presets {
  justify-content: center;
  margin-bottom: 2px;
}

.vfx-panel {
  --c: var(--fx-color-light);
}

.vfx-knob {
  --c: var(--fx-color-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 50px;
}

[data-theme="dark"] .vfx-knob,
[data-theme="dark"] .vfx-panel {
  --c: var(--fx-color);
}

.vfx-dial {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: ns-resize;
  touch-action: none;
  outline: none;
}

.vfx-dial:focus-visible {
  box-shadow: 0 0 0 2px var(--paper-border-focus);
}

.vfx-dial svg {
  display: block;
  overflow: visible;
}

.vfx-track {
  fill: none;
  stroke: var(--paper-border);
  stroke-width: 3;
  stroke-linecap: round;
}

.vfx-value {
  fill: none;
  stroke: var(--c);
  stroke-width: 3;
  stroke-linecap: round;
}

.vfx-cap {
  fill: var(--paper-panel);
  stroke: var(--paper-border);
  stroke-width: 1;
}

.vfx-pointer {
  stroke: var(--graphite-medium);
  stroke-width: 1.6;
  stroke-linecap: round;
}

[data-theme="dark"] .vfx-pointer {
  stroke: #e7e2d8;
}

.vfx-knob.is-zero .vfx-pointer {
  opacity: 0.45;
}

.vfx-label {
  margin-top: 1px;
  padding: 1px 2px;
  max-width: 100%;
  border: none;
  border-radius: 4px;
  background: none;
  color: var(--graphite-light);
  font: 600 9px/1.3 var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

[data-theme="dark"] .vfx-label {
  color: #b5aea3;
}

.vfx-label:hover,
.vfx-knob.is-open .vfx-label {
  color: var(--c);
  background: var(--graphite-hover);
}

.vfx-knob.is-dragging .vfx-label {
  color: var(--c);
}

/* Detail panel */

.vfx-panel {
  position: fixed;
  z-index: 41;
  width: 264px;
  padding: 10px 12px 10px;
  border: 1px solid var(--paper-border);
  border-top: 3px solid var(--c);
  border-radius: 10px;
  background: var(--paper-panel);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
  color: var(--graphite-dark);
}

[data-theme="dark"] .vfx-panel {
  color: #ece7dd;
}

.vfx-panel.is-hidden {
  display: none;
}

.vfx-panel-head,
.vfx-panel-hint {
  cursor: grab;
}

.vfx-panel.is-moving,
.vfx-panel.is-moving .vfx-panel-head {
  cursor: grabbing;
}

.vfx-panel-head {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 22px;
  font-size: 13px;
  text-align: center;
}

.vfx-panel-close {
  position: absolute;
  right: -4px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  opacity: 0.6;
  cursor: pointer;
}

.vfx-panel-close:hover {
  opacity: 1;
}

.vfx-panel-hint {
  margin: 4px 0 8px;
  text-align: center;
  font-size: 11px;
  line-height: 1.4;
  opacity: 0.7;
}

.vfx-panel-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.vfx-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px 8px;
  font-size: 11px;
}

.vfx-row input[type="range"] {
  grid-column: 1 / -1;
  width: 100%;
  margin: 0;
  accent-color: var(--c);
}

.vfx-row-value {
  font-family: var(--font-mono);
  font-size: 10.5px;
  opacity: 0.75;
}

.vfx-segmented {
  grid-template-columns: auto 1fr;
}

.vfx-seg-group {
  display: flex;
  justify-content: flex-end;
  gap: 3px;
  flex-wrap: wrap;
}

.vfx-seg {
  padding: 2px 6px;
  border: 1px solid var(--paper-border);
  border-radius: 6px;
  background: none;
  color: inherit;
  font: 600 10px/1.4 var(--font-mono);
  cursor: pointer;
}

.vfx-seg:hover {
  background: var(--graphite-hover);
}

.vfx-seg.active {
  border-color: var(--c);
  background: var(--graphite-active);
}

.vfx-panel-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  margin-top: 10px;
  font-size: 10.5px;
  opacity: 0.85;
}

.vfx-reset {
  padding: 3px 8px;
  font-size: 11px;
  white-space: nowrap;
}

.vfx-toggle {
  align-self: center;
  margin-right: 2px;
  padding: 3px 5px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--graphite-light);
  font: 700 9px/1 var(--font-mono);
  letter-spacing: 0.06em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  cursor: pointer;
}

[data-theme="dark"] .vfx-toggle {
  color: #b5aea3;
}

.vfx-toggle:hover {
  background: var(--graphite-hover);
}

.vocal-fx-pedal.is-collapsed .vfx-knob {
  display: none;
}

.vocal-fx-pedal.is-collapsed .vfx-toggle {
  writing-mode: horizontal-tb;
  transform: none;
  padding: 5px 6px;
}

@media (max-width: 720px) {
  .vocal-fx-pedal {
    top: calc(100% + 6px);
    right: 8px;
    max-width: calc(100% - 16px);
  }

  .vfx-panel {
    width: min(264px, calc(100vw - 16px));
  }
}

.vocal-fx-pedal.is-collapsed .vfx-row-knobs {
  padding: 3px;
}

