/* ── GLITCH + REVERSE (processors-bottom) ─────────────────────────────────── */

#glitch,
#reverse {
  --pb-amount: 0;
  display: flex;
  align-items: center;
}

/* Shared: the little boxed dial with its "it does that" arrow */
#glitch .pb-dialbox,
#reverse .pb-dialbox {
  position: relative;
  display: grid;
  place-items: center;
  padding: 0.3cqw 0.4cqw 0.2cqw;
  background: var(--paper);
  border: var(--stroke) solid var(--line);
  border-radius: 12px 3px 10px 4px / 4px 10px 3px 12px;
  transform: rotate(3deg);
}
#glitch .pb-dialbox .knob-label,
#reverse .pb-dialbox .knob-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
#glitch .pb-dialbox .knob-value,
#reverse .pb-dialbox .knob-value {
  font-family: var(--font-hand);
  font-weight: 700;
  line-height: 0.9;
}
#glitch .pb-arrow,
#reverse .pb-arrow {
  position: absolute;
  right: -55%;
  top: -55%;
  width: 70%;
  aspect-ratio: 1;
  stroke: var(--line);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

/* ── GLITCH ── */
#glitch {
  gap: 0.6cqw;
  padding-right: 1.6cqw;
}
#glitch .pb-burst {
  flex: 1 1 auto;
  height: 100%;
  min-width: 0;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  --pb-hit: var(--processor);
}
#glitch .pb-burst svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  transform: scale(calc(0.9 + var(--pb-amount) * 0.12)) rotate(-4deg);
  transition: transform 0.25s;
}
#glitch .pb-burst-shape {
  fill: var(--paper);
  stroke: var(--line);
  stroke-width: 2.6;
  stroke-linejoin: round;
  transition: fill 0.12s;
}
#glitch .pb-burst-word {
  font-family: var(--font-marker);
  font-size: 19px;
  fill: var(--ink);
  text-anchor: middle;
  dominant-baseline: middle;
  letter-spacing: 0.5px;
}
#glitch.is-armed .pb-burst-shape {
  stroke: var(--processor);
}
#glitch .pb-burst[data-kind='stutter'] { --pb-hit: var(--creator); }
#glitch .pb-burst[data-kind='reverse'] { --pb-hit: var(--sky); }
#glitch .pb-burst[data-kind='pitch'] { --pb-hit: var(--recorder); }
#glitch .pb-burst[data-kind='crush'] { --pb-hit: var(--processor); }
#glitch .pb-burst[data-kind='dropout'] { --pb-hit: var(--ink-soft); }

#glitch .pb-burst.is-lit .pb-burst-shape,
#glitch.is-smashing .pb-burst-shape {
  fill: var(--pb-hit);
  stroke: var(--line);
}
#glitch .pb-burst.is-lit .pb-burst-word,
#glitch.is-smashing .pb-burst-word {
  fill: var(--paper);
}
#glitch .pb-burst.is-hit svg {
  animation: pb-jolt 0.16s steps(3) 1;
}
#glitch.is-smashing .pb-burst svg {
  animation: pb-jolt 0.12s steps(2) infinite;
}
@keyframes pb-jolt {
  0% { transform: scale(1.06) translate(1.5%, -2%) rotate(-7deg); }
  50% { transform: scale(0.97) translate(-2%, 1.5%) rotate(-1deg); }
  100% { transform: scale(1.02) translate(1%, 1%) rotate(-5deg); }
}

#glitch .pb-dialbox .knob svg {
  width: 3.4cqw;
  height: 3.4cqw;
}
#glitch .pb-dialbox .knob-value {
  font-size: clamp(10px, 1.1cqw, 18px);
}
#glitch .pb-arrow {
  transform: rotate(calc(var(--pb-amount) * -25deg));
  transform-origin: 0 100%;
  transition: transform 0.2s;
}

/* ── REVERSE ── */
#reverse {
  align-items: flex-end;
  gap: 0.3cqw;
}
#reverse .pb-rev-disc {
  flex: 0 0 auto;
  width: 6.6cqw;
  aspect-ratio: 1;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
#reverse .pb-rev-disc:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
#reverse .pb-rev-disc svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
#reverse .pb-rev-face {
  fill: var(--paper);
  stroke: var(--line);
  stroke-width: 3;
  transition: fill 0.2s;
}
#reverse .pb-rev-spin {
  transform-box: view-box;
  transform-origin: 50% 50%;
}
#reverse .pb-rev-arrow {
  fill: none;
  stroke: var(--line);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.2s;
}
#reverse .pb-rev-word {
  font-family: var(--font-marker);
  font-size: 15px;
  fill: var(--ink);
  text-anchor: middle;
  letter-spacing: 0.3px;
}
#reverse.is-on .pb-rev-face {
  fill: var(--processor);
}
#reverse.is-on .pb-rev-arrow {
  stroke: var(--paper);
}
#reverse.is-on .pb-rev-disc {
  box-shadow: 0 0 0 0.5cqw var(--glow);
}
#reverse .pb-rev-disc:active svg {
  transform: scale(0.96);
}

#reverse .pb-dialbox {
  align-self: flex-start;
  margin-top: 1.2cqw;
  transform: rotate(-2deg);
}
#reverse .pb-dialbox .knob svg {
  width: 2.4cqw;
  height: 2.4cqw;
}
#reverse .pb-dialbox .knob-value {
  font-size: clamp(10px, 0.95cqw, 16px);
  white-space: nowrap;
}
#reverse .pb-arrow {
  right: -45%;
  top: -60%;
  width: 60%;
}

/* Narrow screens: zones become fixed-height cards, so size by height instead. */
@media (max-width: 760px) {
  #glitch .pb-dialbox .knob svg {
    width: 40px;
    height: 40px;
  }
  #reverse .pb-rev-disc {
    width: auto;
    height: 100%;
  }
  #reverse .pb-dialbox .knob svg {
    width: 36px;
    height: 36px;
  }
}
