/* ═══════════════════════════════════════════════════════
   RysUp MultiBand — Meta Edition CSS
   Native size: 1100 × 700
   ═══════════════════════════════════════════════════════ */

:root {
  --bg: #f5f2ee;
  --surface: #f5f2ee;
  --panel: #efebe4;
  --shadow-light: #ffffff;
  --shadow-dark: #d8d3ca;
  --shadow-depth: #c8c2b7;
  --text-main: #3d3b38;
  --text-dim: #928f8a;
  --text-label: #6b6863;
  --accent-red: #ff5555;
  --accent-red-glow: rgba(255, 85, 85, 0.4);
  --accent-cyan: #44cccc;
  --accent-orange: #ff8844;
  --font-main: 'Outfit', 'Inter', -apple-system, sans-serif;
  --nm-out: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
  --nm-in: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
  --nm-out-sm: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
  --nm-in-sm: inset 2px 2px 5px var(--shadow-dark), inset -2px -2px 5px var(--shadow-light);
}

body.theme-dark {
  --bg: #121212;
  --surface: #1e1e1e;
  --panel: #161616;
  --shadow-light: #2a2a2a;
  --shadow-dark: #080808;
  --shadow-depth: #000000;
  --text-main: #ececec;
  --text-dim: #888888;
  --text-label: #aaaaaa;
  --nm-out: 6px 6px 12px #050505, -6px -6px 12px #2a2a2a;
  --nm-in: inset 4px 4px 8px #050505, inset -4px -4px 8px #2a2a2a;
  --nm-out-sm: 3px 3px 6px #050505, -3px -3px 6px #2a2a2a;
  --nm-in-sm: inset 2px 2px 5px #050505, inset -2px -2px 5px #2a2a2a;
}
body.theme-dark .band-card.float-band {
  background: linear-gradient(175deg, #1e1e1e 0%, #1a1a1a 100%);
}
body.theme-dark .sat-coin {
  background: linear-gradient(180deg, #2a2a2a 0%, #3a3a3a 30%, #4a4a4a 70%, #333333 100%);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; overflow: hidden;
  background: var(--bg);
}

body {
  width: 1100px; height: 700px;
  font-family: var(--font-main);
  user-select: none; -webkit-user-select: none;
  color: var(--text-main);
}

#app-scale-container {
  width: 1100px; height: 700px;
  background: var(--bg);
  position: relative;
  display: flex; flex-direction: column;
  overflow: hidden;
}

.content-area {
  flex: 1;
  padding: 8px 12px 12px;
  display: flex; flex-direction: column;
  gap: 10px;
  min-height: 0;
}

/* ═══ SPECTRUM MODULE ═══ */
.spectrum-module {
  background: var(--panel);
  border-radius: 16px;
  box-shadow: var(--nm-in);
  padding: 8px;
  flex: 0 0 250px;
  overflow: hidden;
  position: relative;
}
.spectrum-svg {
  width: 100%; height: 100%;
  display: block;
}
.spectrum-overlay {
  position: absolute;
  inset: 8px;
  z-index: 40;
  pointer-events: none;
  overflow: visible;
}

.viz-node {
  pointer-events: none;
}
#spectrumPath { filter: drop-shadow(0 0 4px rgba(68,204,204,0.4)); }
#eqPath {
  pointer-events: none;
  filter: drop-shadow(0 0 5px rgba(255,85,85,0.6));
  z-index: 55;
}
.crossover-line {
  stroke: var(--text-dim);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  opacity: 0.5;
}
.crossover-handle {
  cursor: ew-resize;
}
.crossover-arrow {
  fill: var(--accent-cyan);
  opacity: 0.95;
  filter: drop-shadow(0 0 4px rgba(68,204,204,0.45));
}

/* --- Overlaid Display Selector (Neumorphic Tabs) --- */
.viz-display-controls {
  position: absolute;
  top: 10px; left: 10px;
  z-index: 100;
  pointer-events: auto;
}
.viz-tabs {
  display: flex;
  background: var(--panel);
  border-radius: 12px;
  box-shadow: var(--nm-in-sm);
  padding: 3px;
  position: relative;
  width: 100px;
}
.viz-tab-indicator {
  position: absolute;
  top: 3px; left: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  background: var(--surface);
  border-radius: 10px;
  box-shadow: var(--nm-out-sm);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
}
.viz-tab {
  flex: 1;
  text-align: center;
  font-size: 9px;
  font-weight: 800;
  color: var(--text-dim);
  padding: 5px 0;
  border-radius: 10px;
  cursor: pointer;
  transition: color 0.2s;
  position: relative;
  z-index: 1;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.viz-tab.active {
  color: var(--accent-red);
  text-shadow: 0 0 5px var(--accent-red-glow);
}
.viz-tab:not(.active):hover {
  color: var(--text-label);
}

body.theme-dark .viz-tab-indicator {
  background: var(--surface);
}

/* --- Nodes & Crossovers --- */
.viz-node {
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.35));
}
.crossover-line {
  stroke-width: 1;
  stroke-dasharray: 4 4;
  opacity: 0.4;
}
.crossover-handle {
  cursor: ew-resize;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}
.crossover-arrow {
  fill: var(--accent-cyan);
  opacity: 0.9;
}

/* ═══ BAND ROW ═══ */
.band-row {
  display: flex;
  gap: 6px;
  flex: 1 1 0;
  min-height: 0;
  align-items: stretch;
}

/* ═══ BAND CARD ═══ */
.band-card {
  --band-rms: 0;
  --band-gr: 0;
  --band-rms-opacity: 0.08;
  --band-rms-glow: 2px;
  --band-card-glow-opacity: 0;
  --band-dot-glow: 6px;
  flex: 1 1 0;
  min-width: 0;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--nm-out);
  padding: 8px 6px 8px;
  display: flex; flex-direction: column;
  gap: 6px;
  overflow: hidden;
  position: relative;
}
.band-card > * {
  position: relative;
  z-index: 1;
}
.band-card::before {
  content: '';
  position: absolute;
  inset: 6px auto 6px 4px;
  width: 3px;
  border-radius: 3px;
  background: var(--band-color);
  opacity: var(--band-rms-opacity);
  box-shadow: 0 0 var(--band-rms-glow) var(--band-color);
  pointer-events: none;
  z-index: 0;
  transition: opacity 16ms linear, box-shadow 16ms linear;
}
.band-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--band-color) 22%, transparent) 0%,
      transparent 52%),
    radial-gradient(circle at 50% 0%,
      color-mix(in srgb, var(--band-color) 38%, transparent) 0%,
      transparent 62%);
  opacity: var(--band-card-glow-opacity);
  pointer-events: none;
  z-index: 0;
  transition: opacity 16ms linear;
}
.band-card.signal-active .band-dot {
  box-shadow: 0 0 var(--band-dot-glow) var(--band-color);
}
.band-card.gain-reducing .band-title {
  color: color-mix(in srgb, var(--band-color) 55%, var(--text-label));
}

.band-card.float-band {
  background: linear-gradient(175deg, #f5f2ee 0%, #f2eee5 100%);
  box-shadow: var(--nm-out), inset 0 0 0 1px rgba(255,140,0,0.18);
}

.band-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-label);
  text-align: center;
  padding: 2px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
}
.band-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--band-color);
  box-shadow: 0 0 6px var(--band-color);
}

/* ═══ KNOB ROW (per band) ═══ */
.knob-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 4px;
  flex: 0 0 auto;
}
.knob-row.three-knobs {
  gap: 3px;
}

.card-body {
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 6px;
  align-items: stretch;
}
.control-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  padding: 2px 0 0;
}
.threshold-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.threshold-lane {
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(28px, 1fr) 8px;
  gap: 5px;
  align-items: stretch;
}
.float-threshold-panel {
  gap: 7px;
}
.float-extra-controls {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  align-items: start;
  justify-items: center;
}
.band-micro-knob {
  width: 100%;
  min-width: 0;
  gap: 1px;
}
.band-micro-knob .knob-label {
  font-size: 7px;
  letter-spacing: 0.45px;
  line-height: 1;
}
.band-micro-knob .knob-outer {
  margin-top: 1px;
}
.band-micro-knob .mini-pill {
  width: min(42px, 100%);
  min-width: 30px;
  max-width: 42px;
  padding: 1px 3px;
  font-size: 8.5px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

/* ═══ KNOB SYSTEM (shared) ═══ */
.knob-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.knob-outer {
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--nm-out-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: grab;
}
.knob-outer:active { cursor: grabbing; }

.knob-md  { width: 44px; height: 44px; }
.knob-sm  { width: 34px; height: 34px; }
.knob-xs  { width: 28px; height: 28px; }

.knob-inner {
  border-radius: 50%;
  background: linear-gradient(160deg, var(--panel) 0%, var(--surface) 100%);
  box-shadow: inset 0 2px 3px rgba(255,255,255,0.15), inset 0 -2px 3px var(--shadow-dark);
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
}
.knob-inner-md { width: 36px; height: 36px; }
.knob-inner-sm { width: 27px; height: 27px; }
.knob-inner-xs { width: 22px; height: 22px; }

.knob-pointer {
  position: absolute;
  background: var(--text-main);
  border-radius: 1px;
  top: 6px; left: 50%;
}
.knob-pointer-md { width: 2px; height: 6px; margin-left: -1px; top: 6px; transform-origin: 50% 12px; }
.knob-pointer-sm { width: 2px; height: 5px; margin-left: -1px; top: 5px; transform-origin: 50% 10px; }
.knob-pointer-xs { width: 2px; height: 4px; margin-left: -1px; top: 4px; transform-origin: 50% 8px; }

/* Arc rings */
.knob-ring-track, .knob-ring-fill {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
}
.knob-ring-track {
  background: conic-gradient(from 225deg, var(--shadow-dark) 0deg 270deg, transparent 270deg 360deg);
  -webkit-mask: radial-gradient(circle closest-side at center, transparent 68%, black 70% 90%, transparent 92%);
  mask: radial-gradient(circle closest-side at center, transparent 68%, black 70% 90%, transparent 92%);
  opacity: 0.4;
}
.knob-ring-fill {
  --arc-start: 0deg;
  --arc-end: 0deg;
  --ring-color: var(--accent-red);
  background: conic-gradient(from 225deg,
    transparent 0deg var(--arc-start),
    var(--ring-color) var(--arc-start) var(--arc-end),
    transparent var(--arc-end) 360deg);
  -webkit-mask: radial-gradient(circle closest-side at center, transparent 68%, black 70% 90%, transparent 92%);
  mask: radial-gradient(circle closest-side at center, transparent 68%, black 70% 90%, transparent 92%);
  filter: drop-shadow(0 0 3px var(--accent-red-glow));
}
.band-ring {
  --ring-color: var(--band-color);
  filter: drop-shadow(0 0 3px var(--band-color));
}

.knob-value {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-main);
  text-align: center;
  min-width: 20px;
  line-height: 1.2;
}
.knob-label {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  text-align: center;
  white-space: nowrap;
}
.knob-value input, .value-pill input {
  width: 100%; background: var(--surface); color: var(--text-main);
  border: 1px solid var(--accent-red); border-radius: 3px; outline: none;
  font: inherit; font-size: inherit; font-weight: inherit;
  text-align: center; padding: 0 2px; box-sizing: border-box;
}
.knob-value input::-webkit-inner-spin-button,
.value-pill input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ═══ THRESHOLD LANE ═══ */
.threshold-item {
  width: 100%;
  min-width: 0;
}
.threshold-item .sat-label {
  font-size: 7px;
  letter-spacing: 0.45px;
}
.threshold-item .sat-fader {
  width: 16px;
  min-height: 0;
}

.satellite-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1 1 0;
  min-width: 0;
  gap: 2px;
}
.sat-label {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
}

.sat-fader {
  width: 14px;
  flex: 1 1 0;
  min-height: 40px;
  border-radius: 7px;
  background: var(--panel);
  box-shadow:
    inset 2px 2px 4px var(--shadow-dark),
    inset -2px -2px 4px var(--shadow-light);
  position: relative;
  display: flex;
  justify-content: center;
  margin: 6px 0 4px;
}

.track-mask {
  position: absolute;
  top: 4px; left: 4px; right: 4px; bottom: 4px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--shadow-depth);
  z-index: 1;
}

.sat-fill {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 0%;
  background: linear-gradient(0deg, color-mix(in srgb, var(--band-color) 70%, black) 0%, var(--band-color) 100%);
}
.sat-fill.band-fill {
  background: linear-gradient(0deg, color-mix(in srgb, var(--band-color) 60%, black) 0%, var(--band-color) 100%);
}
.sat-fill.master-fill {
  background: linear-gradient(0deg, #991b1b 0%, #ef4444 60%, #ff6b6b 100%);
}

.sat-coin {
  position: absolute;
  left: 50%;
  width: 20px;
  height: 20px;
  background: linear-gradient(180deg, #d8d2c8 0%, #e8e3dc 30%, #f5f2ee 70%, #ebe6e0 100%);
  border-radius: 50%;
  box-shadow:
    0 2px 4px rgba(0,0,0,0.3),
    0 1px 1px rgba(0,0,0,0.15);
  border: none;
  transform: translateX(-50%);
  z-index: 5;
  cursor: grab;
}
.input-meter {
  align-self: stretch;
  margin: 20px 0 20px;
  border-radius: 999px;
  background: var(--shadow-depth);
  box-shadow:
    inset 1px 1px 2px rgba(0,0,0,0.18),
    inset -1px -1px 2px rgba(255,255,255,0.48);
  overflow: hidden;
  position: relative;
}
.input-meter-fill {
  position: absolute;
  inset: 0;
  transform: scaleY(var(--band-rms));
  transform-origin: bottom;
  border-radius: inherit;
  background: linear-gradient(0deg,
    color-mix(in srgb, var(--band-color) 78%, #111) 0%,
    var(--band-color) 72%,
    #ffffff 100%);
  box-shadow: 0 0 8px color-mix(in srgb, var(--band-color) 70%, transparent);
  opacity: calc(0.28 + var(--band-rms) * 0.72);
  transition: transform 16ms linear, opacity 16ms linear;
}
.sat-coin::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 18%;
  right: 18%;
  height: 2px;
  transform: translateY(-50%);
  border-radius: 2px;
  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.62) 0%,
    rgba(255,255,255,0.62) 49%,
    rgba(0,0,0,0.18) 50%,
    rgba(0,0,0,0.18) 100%);
}

.value-pill {
  background: var(--panel);
  box-shadow: var(--nm-in-sm);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-main);
  text-align: center;
  min-width: 28px;
}

/* ═══ TOGGLE ROW ═══ */
.toggle-row {
  display: flex;
  gap: 3px;
  flex: 0 0 auto;
  justify-content: space-between;
  padding: 0 2px;
}
.mb-toggle {
  flex: 1 1 0;
  min-width: 0;
  padding: 4px 0;
  border-radius: 6px;
  background: var(--panel);
  box-shadow: var(--nm-in-sm);
  text-align: center;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.15s, box-shadow 0.15s, background 0.15s;
  user-select: none;
}
.mb-toggle:hover { color: var(--text-main); }
.mb-toggle.on {
  color: #fff;
  background: var(--band-color);
  box-shadow: 0 0 8px color-mix(in srgb, var(--band-color) 60%, transparent),
              inset 0 1px 2px rgba(255,255,255,0.25),
              inset 0 -1px 2px rgba(0,0,0,0.25);
}
.mb-toggle.power.on {
  background: linear-gradient(160deg, color-mix(in srgb, var(--band-color) 80%, white), var(--band-color));
}

/* ═══ MASTER CARD ═══ */
.master-card {
  flex: 0 0 150px;
  min-width: 0;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--nm-out);
  padding: 8px 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}
.master-title {
  color: var(--accent-red);
  font-size: 11px;
  letter-spacing: 1.5px;
}
.master-body {
  display: flex;
  flex: 1 1 0;
  min-height: 0;
  gap: 6px;
}
.master-knobs {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  flex: 0 0 64px;
}
.master-knob {
  gap: 2px;
}
.master-knob .knob-label {
  font-size: 7px;
  margin-bottom: 1px;
}
.master-knob .knob-pill {
  margin-top: 2px;
  font-size: 10px;
  min-width: 38px;
}
.master-fader-wrap {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 2px;
  min-width: 0;
}
.master-fader {
  width: 18px;
  flex: 1 1 0;
  min-height: 60px;
}
.master-fader .sat-coin {
  width: 24px;
  height: 24px;
}
.master-pill {
  margin-top: 4px;
  font-size: 11px;
  min-width: 40px;
}
.master-output-label {
  font-size: 9px;
  font-weight: 800;
  color: var(--text-label);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 3px;
}

/* ═══ ACTIVATION OVERLAY (copied from Distortion) ═══ */
.activation-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.6);
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.activation-overlay.visible { display: flex; }
.activation-box {
  background: var(--surface);
  box-shadow: var(--nm-out), 0 16px 48px rgba(0,0,0,0.3);
  border-radius: 24px;
  padding: 32px 36px 28px;
  text-align: center;
  width: 320px;
  max-width: 90%;
}
.activation-logo { font-size: 24px; font-weight: 800; margin-bottom: 16px; letter-spacing: -0.5px; }
.about-brand { color: var(--text-main); }
.about-accent { color: var(--accent-red); }
.activation-title { font-size: 17px; font-weight: 700; color: var(--text-main); margin-bottom: 4px; }
.activation-subtitle { font-size: 11px; color: var(--text-dim); margin-bottom: 20px; line-height: 1.5; }
.activation-hub-btn {
  width: 100%; padding: 12px 0; border-radius: 12px; border: none;
  background: var(--accent-red); color: #fff;
  font-family: var(--font-main); font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(255, 85, 85, 0.3);
}
.activation-hub-btn:hover { box-shadow: 0 6px 20px rgba(255,85,85,0.45); transform: translateY(-1px); }
.activation-waiting {
  display: none; font-size: 11px; color: var(--text-dim); margin-top: 10px;
  animation: activationPulse 2s ease-in-out infinite;
}
.activation-waiting.visible { display: block; }
@keyframes activationPulse { 0%,100%{opacity:0.5;} 50%{opacity:1;} }
.activation-divider-or { display: flex; align-items: center; gap: 10px; margin: 18px 0 14px; }
.activation-divider-line { flex: 1; height: 1px; background: var(--shadow-dark); opacity: 0.15; }
.activation-divider-text { font-size: 11px; color: var(--text-dim); font-weight: 500; }
.activation-key-toggle {
  background: none; border: none; color: #60a5fa;
  font-family: var(--font-main); font-size: 12px; font-weight: 600;
  cursor: pointer; padding: 4px 0;
}
.activation-key-toggle:hover { opacity: 0.7; }
.activation-key-section { display: none; margin-top: 12px; }
.activation-key-section.visible { display: block; }
.activation-input-wrap { margin-bottom: 8px; }
.activation-input {
  width: 100%; padding: 10px 14px; border-radius: 12px; border: 1px solid transparent;
  background: var(--panel); box-shadow: var(--nm-in-sm);
  color: var(--text-main); font-family: var(--font-main);
  font-size: 14px; font-weight: 600; text-align: center; letter-spacing: 1.5px;
  outline: none; box-sizing: border-box;
}
.activation-input:focus { border-color: var(--accent-red); }
.activation-status { font-size: 11px; font-weight: 600; min-height: 18px; margin-bottom: 12px; }
.activation-status.error { color: #dc2626; }
.activation-status.success { color: #16a34a; }
.activation-status.loading { color: var(--text-dim); }
.activation-btn {
  width: 100%; padding: 10px 0; border-radius: 12px; border: none;
  background: var(--surface); box-shadow: var(--nm-out-sm);
  color: var(--text-main); font-family: var(--font-main);
  font-size: 13px; font-weight: 700; cursor: pointer;
}
.activation-btn:hover { color: var(--accent-red); box-shadow: var(--nm-out); }
.activation-buy-row { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 16px; }
.activation-link-label { font-size: 11px; color: var(--text-dim); }
.activation-link {
  font-size: 11px; font-weight: 700; color: var(--accent-red);
  background: none; border: none; cursor: pointer;
  font-family: var(--font-main); padding: 0;
}
