.afex-warp-machine {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #e4f5ff;
  background: transparent;
  padding: 1.5rem 1rem;
  border-radius: 12px;
  box-sizing: border-box;
}

.afex-warp-title {
  font-size: 1.3rem;
  margin: 0 0 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9cf2ff;
}

.afex-warp-subtitle {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: #8aa4b0;
}

.afex-warp-section {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid rgba(120, 200, 255, 0.25);
  background: radial-gradient(circle at top left, rgba(80,140,200,0.2), rgba(0,0,0,0.6));
}

.afex-warp-sequencer-section {
  margin-bottom: 1.5rem;
}

.afex-warp-sequencer-header h3,
.afex-warp-piano-header h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  color: #b3f4ff;
}

.afex-warp-help {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.8rem;
  color: #7f99aa;
}

.afex-warp-seq-controls,
.afex-warp-piano-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.afex-warp-control-group {
  display: flex;
  flex-direction: column;
  font-size: 0.75rem;
}

.afex-warp-control-group label {
  margin-bottom: 0.15rem;
}

.afex-warp-control-group input[type="range"],
.afex-warp-control-group select {
  width: 140px;
  max-width: 100%;
}

.afex-warp-bpm-value {
  display: inline-block;
  min-width: 2.2rem;
  text-align: right;
  font-weight: 600;
  color: #d0f4ff;
  margin-left: 0.25rem;
}

/* Buttons */
.afex-warp-btn {
  background: rgba(120, 230, 255, 0.14);
  color: #e4f5ff;
  border: 1px solid rgba(120, 230, 255, 0.6);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.8rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.afex-warp-btn:hover {
  background: rgba(120, 230, 255, 0.25);
}

.afex-warp-btn-secondary {
  border-color: rgba(140,180,200,0.8);
  background: rgba(40,60,80,0.6);
}

/* Sequencer grid */

.afex-warp-seq-kidz-row {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 10px 0 6px;
}

.afex-warp-seq-kid {
    position: relative;
    width: 16px;
    height: 30px;
}

.afex-warp-seq-kid-body {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 10px;
    height: 20px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(120,180,255,0.9));
    box-shadow: 0 0 6px rgba(120,180,255,0.9);
}

.afex-warp-seq-kid::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 10px;
    height: 10px;
    transform: translate(-50%, -30%);
    border-radius: 50%;
    background: inherit;
    box-shadow: 0 0 4px rgba(255,255,255,0.9);
}

.afex-warp-seq-kid-active .afex-warp-seq-kid-body {
    transform: translateX(-50%) translateY(-3px);
    box-shadow: 0 0 10px rgba(255,255,180,1);
}

.afex-warp-seq-grid-wrapper {
  overflow-x: auto;
  margin-top: 0.5rem;
}

.afex-warp-seq-grid {
  border-collapse: collapse;
  width: 100%;
  min-width: 720px;
  font-size: 0.7rem;
}

.afex-warp-seq-grid thead th {
  position: sticky;
  top: 0;
  background: rgba(5, 15, 30, 0.95);
  z-index: 2;
}

.afex-warp-seq-step-header {
  text-align: center;
  padding: 0.15rem 0.25rem;
  border: 1px solid rgba(50,90,120,0.7);
  color: #7ca3c0;
  font-weight: 400;
}

.afex-warp-seq-step-header.afex-warp-seq-step-group-end {
  border-right: 2px solid rgba(160, 230, 255, 0.7);
}

.afex-warp-seq-instrument-col {
  padding: 0;
  min-width: 160px;
  border-right: 1px solid rgba(80,130,160,0.7);
  background: rgba(3,15,30,0.9);
}

.afex-warp-track-header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.4rem;
}

.afex-warp-track-color-dot {
  width: 8px;
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(to bottom, #ff91c3, #ffeb9a);
  box-shadow: 0 0 8px rgba(255, 190, 140, 0.7);
}

.afex-warp-track-label {
  font-size: 0.7rem;
  color: #b7d9f0;
}

.afex-warp-track-mute {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.65rem;
  margin-left: auto;
  color: #7ea2b9;
}

.afex-warp-track-mute input {
  transform: scale(0.9);
}

.afex-warp-track-vol {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin-left: 0.4rem;
}

.afex-warp-track-vol-label {
  font-size: 0.65rem;
  color: #7ea2b9;
}

.afex-warp-track-vol input[type="range"] {
  width: 60px;
}

/* Cells */
.afex-warp-seq-cell {
  padding: 0;
  border: 1px solid rgba(50,90,120,0.5);
  background: rgba(5, 15, 30, 0.8);
  cursor: pointer;
  position: relative;
}

.afex-warp-seq-cell.afex-warp-seq-step-group-end {
  border-right: 2px solid rgba(120,190,230,0.7);
}

.afex-warp-seq-step {
  width: 100%;
  height: 16px;
  box-sizing: border-box;
}

.afex-warp-seq-cell-on .afex-warp-seq-step {
  background: radial-gradient(circle at 50% 20%, #ffe59a, #ff91c3);
  box-shadow: 0 0 6px rgba(255, 170, 120, 0.9);
}

.afex-warp-seq-cell-active {
  box-shadow: inset 0 0 0 2px rgba(120, 240, 255, 0.7);
}

/* Piano */
.afex-warp-piano-keys {
  margin-top: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.afex-warp-piano-key {
  width: 42px;
  height:100px;
  border-radius: 10px;
  background: linear-gradient(to bottom, rgba(120,230,255,0.18), rgba(10,20,40,0.9));
  border: 1px solid rgba(120,230,255,0.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 0.15rem;
  box-sizing: border-box;
  cursor: pointer;
  position: relative;
  box-shadow: 0 0 8px rgba(80,150,220,0.5);
}

.afex-warp-piano-key-label {
  font-size: 0.65rem;
  color: #d7f4ff;
}

.afex-warp-piano-key-active {
  background: radial-gradient(circle at 50% 15%, #ffe59a, #ff91c3);
  box-shadow: 0 0 12px rgba(255, 196, 140, 0.95);
  transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
  .afex-warp-machine {
    padding: 1rem 0.5rem;
  }
  .afex-warp-seq-grid {
    font-size: 0.65rem;
    min-width: 640px;
  }
  .afex-warp-track-label {
    display: none;
  }
  .afex-warp-seq-instrument-col {
    min-width: 120px;
  }
  .afex-warp-seq-controls,
  .afex-warp-piano-controls {
    flex-direction: column;
    align-items: flex-start;
  }
  .afex-warp-piano-key {
    width: 28px;
    height: 52px;
  }
}

.afex-warp-piano-key::before {
    content: "";
    position: absolute;
    top: 4px;
    left: 50%;
    width: 14px;
    height: 14px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: inherit;
    box-shadow: 0 0 6px rgba(255,255,255,0.3);
}
/* ------------------------------------------- */
/* AFexKidz BUTTONS: SCALE + SOUND PRESETS     */
/* ------------------------------------------- */

.afex-warp-scale-btn,
.afex-warp-preset-btn {
    background: linear-gradient(
        to bottom,
        rgba(120,230,255,0.20),
        rgba(10,20,40,0.85)
    );
    border: 1px solid rgba(120,230,255,0.55);
    border-radius: 999px;

    padding: 0.32rem 0.85rem;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;

    color: #d9f7ff;
    cursor: pointer;

    box-shadow: 0 0 6px rgba(80,150,220,0.35);
    transition: 0.22s ease;
    user-select: none;
}

.afex-warp-scale-btn:hover,
.afex-warp-preset-btn:hover {
    background: radial-gradient(circle at 50% 20%, #c7faff, #6ecfff);
    color: #00131f;
    box-shadow: 0 0 12px rgba(120,230,255,0.8);
}

/* ACTIVE state (когда выбрана шкала/пресет) */
.afex-warp-scale-btn-active,
.afex-warp-preset-btn-active {
    background: radial-gradient(circle at 50% 20%, #ffe59a, #ff91c3);
    border-color: rgba(255,200,150,0.9);
    color: #1c0a18;
    box-shadow: 0 0 14px rgba(255,180,120,0.95);
    transform: translateY(-1px);
}
/* ---- BUMP анимация ---- */
@keyframes afexKeyBump {
    0%   { transform: translateY(0) scale(1); }
    35%  { transform: translateY(-6px) scale(1.03); }
    60%  { transform: translateY(-3px) scale(1.02); }
    100% { transform: translateY(0) scale(1); }
}

.afex-warp-piano-key-active {
    animation: afexKeyBump 160ms cubic-bezier(0.22, 1.4, 0.36, 1);
}
