/* ============================================================
   TEN Effects -- the non-treadle Bridge of Vibes in the preset
   builder (js/pedal-tools/builder-nt-page.js): the playable panel
   (ntp-, nt-pedal-panel.js), its state readout, the slot editor and
   the player's Outputs panel (vp-outs, vibe-player.js).
   Builds on ten.css, pedal-tools.css, pedal-builder.css and
   vibe-player.css.
   ============================================================ */

.nt-lede { max-width: 760px; color: var(--bone-2); margin: 0 0 18px; }

/* ---------- play it: the panel beside the readout and player ---------- */
.nt-play {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.nt-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }

/* ---------- the pedal ---------- */
.ntp-rig { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-end; }
.ntp-box {
  position: relative;
  width: 100%;
  max-width: 340px;
  aspect-ratio: 3.7 / 4.7;            /* a 1590BB, standing up */
  border-radius: 14px;
  padding: 34px 22px 20px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 3px),
    linear-gradient(160deg, #187a78 0%, #0F5C5C 55%, #0a4545 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), inset 0 -3px 8px rgba(0, 0, 0, 0.35), 0 14px 30px rgba(0, 0, 0, 0.45);
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  justify-items: center;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.ntp-jacks {
  position: absolute;
  top: -10px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
}
.ntp-jack {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bone-2);
  background: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2px 5px;
}

.ntp-knobs { display: flex; justify-content: space-between; width: 100%; gap: 6px; }
.ntp-knob-wrap { display: grid; justify-items: center; gap: 3px; min-width: 0; }
.ntp-knob {
  --turn: 0deg;
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #4a4a4f 0%, #1b1b1e 55%, #0c0c0d 100%);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  cursor: ns-resize;
  touch-action: none;
  transform: rotate(var(--turn));
}
.ntp-knob::after {                        /* the skirt */
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.ntp-knob:focus-visible { outline: 2px solid var(--bone); outline-offset: 6px; }
.ntp-knob-pointer {
  position: absolute;
  left: 50%;
  top: 5px;
  width: 3px;
  height: 18px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--bone);
}
.ntp-knob-label, .ntp-sw-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #e9f6f2;
}
.ntp-knob-val { font-family: var(--font-mono); font-size: 10px; color: rgba(233, 246, 242, 0.7); white-space: nowrap; }

.ntp-name {
  margin: 12px 0 10px;
  font-family: var(--font-display);
  font-stretch: 115%;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(233, 246, 242, 0.85);
}

.ntp-switches { display: flex; justify-content: space-between; width: 100%; gap: 4px; }
.ntp-sw-wrap { display: grid; justify-items: center; gap: 4px; min-width: 0; }
.ntp-sw-wrap .ntp-sw-label { font-size: 10px; letter-spacing: 0.08em; }
.ntp-sw, .ntp-rbtn {
  --hold: 0;
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: radial-gradient(circle at 40% 35%, #d9dcdc, #8e9393 70%, #6a6f6f);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  touch-action: none;
}
.ntp-sw:focus-visible, .ntp-rbtn:focus-visible, .ntp-stomp:focus-visible { outline: 2px solid var(--bone); outline-offset: 4px; }
.ntp-sw-cap {
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: #233735;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
  transition: background 40ms linear, box-shadow 40ms linear;
}
.ntp-sw.is-lit .ntp-sw-cap {
  background: radial-gradient(circle, #f1fffb 0%, var(--bridgeofvibes-sig) 55%, #2aa890 100%);
  box-shadow: 0 0 10px 3px rgba(79, 224, 196, 0.6);
}
.ntp-sw.is-down, .ntp-rbtn.is-down { transform: translateY(1px) scale(0.96); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
/* a hold guide: fills over the 1.5 s a hold takes (the pedal has no such ring) */
.ntp-sw-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(var(--bone) calc(var(--hold) * 360deg), transparent 0);
  -webkit-mask: radial-gradient(circle, transparent 0 calc(50% - 3px), #000 calc(50% - 2px));
  mask: radial-gradient(circle, transparent 0 calc(50% - 3px), #000 calc(50% - 2px));
  pointer-events: none;
}
.ntp-key {
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(233, 246, 242, 0.65);
  border: 1px solid rgba(233, 246, 242, 0.3);
  border-radius: 3px;
  padding: 0 4px;
  line-height: 15px;
}

.ntp-foot { display: flex; align-items: center; gap: 14px; align-self: end; margin-top: 10px; }
.ntp-led-red {
  width: 10px; height: 10px; border-radius: 50%;
  background: #4a1d1d;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6);
}
.ntp-led-red.is-lit { background: #ff4b3e; box-shadow: 0 0 8px 2px rgba(255, 75, 62, 0.6); }
.ntp-stomp {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: radial-gradient(circle at 40% 35%, #f3f4f4, #a9adad 55%, #6f7373 100%);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.5), inset 0 -2px 3px rgba(0, 0, 0, 0.3);
  display: grid;
  place-items: center;
}
.ntp-stomp-cap { width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fafafa, #b9bdbd); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); }
.ntp-stomp:active { transform: translateY(1px); }

/* the DR-1 */
.ntp-remote {
  width: 150px;
  border-radius: 10px;
  padding: 10px 12px 12px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 3px),
    linear-gradient(170deg, #c9cdcf, #8d9295);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  user-select: none;
  -webkit-user-select: none;
}
.ntp-remote-name { margin: 0 0 8px; font-family: var(--font-display); font-weight: 700; font-size: 12px; letter-spacing: 0.16em; color: #2a2e30; }
.ntp-remote-btns { display: flex; justify-content: space-between; }
.ntp-remote .ntp-sw-label { color: #2a2e30; font-size: 9px; text-align: center; }
.ntp-remote .ntp-key { color: #2a2e30; border-color: rgba(42, 46, 48, 0.4); }
.ntp-rbtn { width: 40px; height: 40px; }
.ntp-rbtn.is-green { background: radial-gradient(circle at 40% 35%, #8be38f, #2e9a3a 70%, #1d6a26); }
.ntp-rbtn.is-red { background: radial-gradient(circle at 40% 35%, #f59a90, #c4362a 70%, #87231b); }
.ntp-remote .ntp-sw-ring { background: conic-gradient(#2a2e30 calc(var(--hold) * 360deg), transparent 0); }

/* ---------- the readout ---------- */
.nt-state {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px 16px;
}
.nt-state-mode { margin: 0 0 8px; font-family: var(--font-display); font-weight: 600; font-size: 20px; color: var(--bone); }
.nt-state-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.nt-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 4px 8px;
  font-size: 13px;
}
.nt-chip-k { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--bone-3); }
.nt-chip-v { color: var(--bone); }
.nt-chip-n { font-family: var(--font-mono); font-size: 10px; color: var(--bridgeofvibes-sig); text-transform: uppercase; letter-spacing: 0.06em; }
.nt-state-event { margin: 10px 0 0; font-size: 14px; color: var(--bone-2); min-height: 1.5em; }
.nt-cal { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.nt-cal .pb-label { font-size: 13px; color: var(--bone-3); }
.nt-cal-select { flex: 1 1 220px; min-width: 0; max-width: 100%; min-height: 38px; font-size: 14px; }

/* the switches, explained */
.nt-cheat { margin-top: 22px; }
.nt-cheat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px 28px; margin-top: 10px; }
.nt-cheat-title { margin: 0 0 6px; font-size: 15px; font-weight: 600; color: var(--bone); }
.nt-cheat-text { margin: 0 0 8px; font-size: 14px; color: var(--bone-2); }
.nt-dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; }
.nt-dl dt { font-family: var(--font-mono); font-size: 12px; color: var(--bone); white-space: nowrap; padding-top: 2px; }
.nt-dl dd { margin: 0; color: var(--bone-2); }
.nt-cheat-steps { margin: 0 0 8px; padding-left: 20px; font-size: 14px; color: var(--bone-2); }

/* ---------- the Outputs panel (in the player) ---------- */
.vp-outs { grid-column: 1 / -1; display: grid; gap: 8px; }
.vp-outs-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.vp-outs-row .vp-mode[hidden] { display: none; }
.vp-outs-sliders { margin-top: 0; }
.vp-outs-sliders .pb-slider[hidden] { display: none; }
.vp-outs-say { font-family: var(--font-body); font-size: 13px; line-height: 1.5; }
.vp-scope-note { margin-top: 6px; }
.vp-scope-note[hidden] { display: none; }

/* ---------- the slots ---------- */
.nt-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.nt-tab {
  display: grid;
  gap: 2px;
  text-align: left;
  font: inherit;
  color: var(--bone-2);
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 14px;
  cursor: pointer;
  min-width: 170px;
}
.nt-tab[aria-selected="true"] { color: var(--bone); border-color: var(--bridgeofvibes-sig); box-shadow: inset 0 -3px 0 var(--bridgeofvibes-sig); }
.nt-tab:focus-visible { outline: 2px solid var(--bone); outline-offset: 2px; }
.nt-tab-name { font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.nt-tab-sum { font-family: var(--font-mono); font-size: 11px; color: var(--bone-3); }
.nt-tab-live { display: none; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--bridgeofvibes-sig); }
.nt-tab.is-live .nt-tab-live { display: block; }
.nt-panel[hidden] { display: none; }
.nt-panel-head { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin: 0 0 10px; }
.nt-hear-slot { background: var(--bridgeofvibes-sig); }
.nt-summary { margin: 0 0 14px; }
.nt-slot-top { margin-bottom: 16px; }
.nt-mode { display: flex; gap: 8px; flex-wrap: wrap; }
.nt-tag {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--phantasm-sig);
  border: 1px solid currentColor;
  border-radius: 2px;
  padding: 0 4px;
  vertical-align: 2px;
}
.nt-manual { margin-top: 16px; }
.nt-manual-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 4px 20px; }
.nt-locks { margin: 6px 0 12px; }

/* ---------- keep it ---------- */
.nt-code {
  margin: 0 0 14px;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  color: var(--bone);
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow-x: auto;
  white-space: pre;
}
.nt-later { margin: 18px 0 0; font-size: 14px; color: var(--bone-3); max-width: 760px; }
.nt-switch { font: inherit; color: var(--live); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }

@media (max-width: 900px) {
  .nt-play { grid-template-columns: minmax(0, 1fr); }
  .ntp-box { max-width: 360px; }
}
@media (max-width: 640px) {
  .ntp-box { padding: 30px 14px 16px; }
  .ntp-knob { width: 50px; height: 50px; }
  .ntp-sw { width: 40px; height: 40px; }
  .nt-tab { min-width: 0; flex: 1 1 140px; }
}
@media (prefers-reduced-motion: reduce) {
  .ntp-sw-cap { transition: none; }
}

/* the factory table scrolls inside its column instead of widening the page */
#nt-keep .pb-keep { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
#nt-keep .pb-keep-col { min-width: 0; }
