/* © DJFuturo Tools. Todos los derechos reservados. */
/* === BASE === */

.djfa-acordeon-v4f {
  position: relative;
  width: 100%;
  max-width: none !important;
  margin: 18px auto;
  color: #222;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.djfa-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 19px;
}

.djfa-header h1 {
  margin: 0;
  font-size: 18px;
}

.djfa-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.djfa-control-group {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  position: relative;
}

.djfa-control-group.has-separator::after {
  content: '';
  position: absolute;
  right: -1px;
  top: 50%;
  transform: translateY(-50%);
  height: 24px;
  width: 1px;
  background: linear-gradient(180deg, transparent, #ddd 20%, #ddd 80%, transparent);
}

.djfa-control-group:first-child {
  padding-left: 0;
}

/* === BOTONES GENERALES === */

.djfa-btn {
  padding: 7px 12px;
  border-radius: 6px;
  border: 1px solid #d0d0d0;
  background: linear-gradient(180deg, #ffffff, #f8f9fa);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.9) inset,
    0 1px 3px rgba(0,0,0,0.08);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #333;
  transition: all 0.15s ease;
  font-family: inherit;
}

.djfa-btn:hover {
  background: linear-gradient(180deg, #fafbfc, #f1f3f5);
  border-color: #bbb;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.9) inset,
    0 2px 4px rgba(0,0,0,0.12);
  transform: translateY(-1px);
}

.djfa-btn:active {
  transform: translateY(0);
  box-shadow:
    0 1px 2px rgba(0,0,0,0.15) inset;
  background: linear-gradient(180deg, #f1f3f5, #e9ecef);
}

.djfa-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: #f5f5f5;
  border-color: #e0e0e0;
  color: #999;
  box-shadow: none;
  transform: none;
}

.djfa-btn:disabled:hover {
  transform: none;
  box-shadow: none;
}

/* === REVERB TOGGLE === */

.djfa-reverb-toggle {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 16px;
  border-radius: 20px;
  border: 2px solid #ddd;
  background: #fff;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
}

.djfa-reverb-toggle:hover {
  border-color: #bbb;
  background: #fafafa;
}

.djfa-reverb-toggle.active {
  border: 2px solid #f8d058;
  box-shadow:
    0 0 0 2px #f8d058,
    0 0 0 4px rgba(248, 208, 88, 0.15),
    0 2px 6px rgba(248, 208, 88, 0.2);
}

.djfa-reverb-toggle input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
  width: 16px;
  height: 16px;
  accent-color: #f8d058;
}

.djfa-reverb-toggle span {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

/* === CONTENEDOR INSTRUMENTO === */

.djfa-instrumento-container {
  user-select: none;
  -webkit-user-select: none;  
border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(20,30,50,0.06);
  margin-bottom: 8px;
  padding-bottom: 19px;
background: #fffdf6;
}

/* === CONTENEDOR PIANO === */

.djfa-piano-container {
  user-select: none;
  touch-action: none;
  border-radius: 8px;
  padding: 12px;
  display: flex;
background: transparent;
}

.djfa-row {
  display: flex;
  position: relative;
  align-items: flex-end;
  padding: 6px 0;
  width: max-content;
  transform-origin: left center;
  transition: transform 0.25s ease;
}

/* Glow botones */
.djfa-reverb-toggle, .djfa-select, .djfa-btn {
  box-shadow: 0 0 0 3px rgba(248, 208, 88, 0.27);
}

/* === TECLAS === */

.djfa-key {
  position: relative;
  box-sizing: border-box;
  border: 1px solid #d6d6d6;
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,0.8) inset, 0 2px 4px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.04);
  height: 160px;
  width: 44px;
  margin: 0;
  border-radius: 6px;
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  font-size: 12px;
  color: #333;
  cursor: pointer;
  transition: transform .06s linear, box-shadow .06s linear, background .06s linear;
}

.djfa-key.active {
  background: #f8d058 !important;
  transform: translateY(3px);
  box-shadow: none;
}

.djfa-key.black {
  position: absolute;
  width: 30px;
  height: 100px;
  background: linear-gradient(180deg, #1a0808 0%, #1a0808 25%, #5b1d1d 100% );
  color: #fff;
  border-radius: 4px;
  top: 0;
  left: 30px;
  z-index: 2;
  box-shadow: 0 4px 8px rgba(0,0,0,0.35);
  transform-origin: bottom center;
}

.djfa-key.black.active {
  background: linear-gradient(180deg, #1a0808 0%, #1a0808 25%, #5b1d1d 100% ) !important;
  box-shadow: 0 0 10px #f8d058;
}

.djfa-octave {
  display: flex;
  position: relative;
  margin-right: 0;
}

.djfa-octave:last-child {
  margin-right: 0;
}

.djfa-octave .djfa-white-container {
  display: flex;
  gap: 0;
  z-index: 1;
}

.djfa-feedback {
  margin-top: 8px;
  font-size: 13px;
  color: #444;
  min-height: 18px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* === SELECT === */

.djfa-select {
  padding: 6px 10px;
  border-radius: 6px;
  background: linear-gradient(180deg, #fff, #f8f9fa);
  border: 1px solid #d0d0d0;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  color: #333;
  font-weight: 500;
  transition: all 0.15s ease;
}

.djfa-select:hover {
  border-color: #4a90e2;
  background: #fff;
}

.djfa-select:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow:
    0 0 0 3px rgba(74, 144, 226, 0.1),
    0 1px 3px rgba(0,0,0,0.08);
}

/* Ocultar texto de teclas en modo hidden */
.djfa-key.note-hidden {
  font-size: 0;
}

/* === Gap pantallas pequeñas === */
@media (max-width: 1150px) {
  .djfa-header {
    margin-bottom: 5px;
  }
}

/* === CONTROL DE DESPLAZAMIENTO DE TECLADO === */

.djfa-keyboard-shift {
  display: flex;
  align-items: center;
  gap: 6px;
}

.djfa-btn-sm {
  padding: 5px 10px;
  min-width: 32px;
  font-size: 12px;
}

/* Ocultar en móvil */
@media (max-width: 890px) {
  .djfa-keyboard-shift {
    display: none !important;
  }
}

/* Compactar en pantallas medianas */
@media (max-width: 1024px) {
  .djfa-keyboard-shift span {
    font-size: 13px !important;
  }

  #djfa-kbd-range {
    min-width: 45px !important;
    font-size: 12px !important;
  }
}

/* Dos filas header */
@media (max-width: 1200px) {
  .djfa-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
  }

  .djfa-controls {
    align-self: center;
  }
}

/* === MOBILE === */

@media (max-width: 800px) {
  .djfa-piano-container {
    overflow: hidden;
    padding: 8px 0;
    position: relative;
    border-radius: 4px;
  }

  .djfa-row {
    transform-origin: left center;
  }
}

/* === LABELS === */

.djfa-controls label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #555;
  font-weight: 500;
}

/* === RESPONSIVE HEADER === */

@media (max-width: 669px) {
  .djfa-header h1 {
    font-size: 16px;
  }

  .djfa-controls {
    gap: 8px;
  }

  .djfa-control-group {
    padding: 0 8px;
  }

  .djfa-control-group:first-child {
    padding-left: 0;
  }

  .djfa-control-group:last-child {
    padding-right: 0;
  }

  .djfa-reverb-toggle {
    padding: 5px 12px;
  }

  .djfa-reverb-toggle span {
    font-size: 13px;
  }

  .djfa-btn,
  .djfa-select {
    font-size: 12px;
    padding: 6px 8px;
  }

  .djfa-controls label {
    font-size: 13px;
  }

  .djfa-select {
    max-width: 110px;
  }
}

/* Móvil muy estrecho */
@media (max-width: 360px) {
  .djfa-header h1 {
    font-size: 15px;
    margin-bottom: 4px;
  }

  .djfa-controls {
    gap: 1px;
  }

  .djfa-btn,
  .djfa-select {
    font-size: 11px;
    padding: 5px 6px;
  }

  .djfa-select {
    max-width: 100px;
  }

  .djfa-controls label {
    font-size: 12px !important;
  }

  .djfa-reverb-toggle {
    padding: 4px 10px;
  }

  .djfa-reverb-toggle span {
    font-size: 12px;
  }
}

/* === LOADING OVERLAY === */

.djfa-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  border-radius: 8px;
}

.djfa-loading-content {
  text-align: center;
  max-width: 300px;
}

.djfa-spinner {
  width: 50px;
  height: 50px;
  margin: 0 auto 20px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #4a90e2;
  border-radius: 50%;
  animation: djfa-spin 1s linear infinite;
}

@keyframes djfa-spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.djfa-loading-content p {
  margin: 0 0 15px;
  font-size: 16px;
  color: #333;
}

.djfa-progress-bar {
  width: 100%;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}

.djfa-progress {
  height: 100%;
  background: linear-gradient(90deg, #4a90e2, #63b3ed);
  width: 0%;
  transition: width 0.3s ease;
}

#djfa-loading-text {
  font-size: 14px;
  color: #666;
}

.djfa-loading.hidden {
  display: none;
}

/* Overlay de activación solo móvil */
#djfa-audio-unlock-overlay {
position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

#djfa-audio-unlock-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.djfa-unlock-text {
  color: white;
  font-size: 20px;
  text-align: center;
  padding: 20px;
  user-select: none;
}

/* Mostrar solo en móvil */
@media (min-width: 801px) {
  #djfa-audio-unlock-overlay {
    display: none !important;
  }
}

/* Portrait móvil: teclas más altas */
@media (max-width: 600px) and (orientation: portrait) {
  .djfa-key.white {
    height: 250px;
  }

  .djfa-key.black {
    height: 145px;
  }

  .djfa-piano-container {
    padding: 0;
    height: 250px;
    overflow: hidden;
    display: flex;
    align-items: center;
  }

  .djfa-row {
    padding: 0;
    margin: 0;
  }
}

@media (max-width: 520px) and (orientation: portrait) {
  .djfa-piano-container {
    height: 200px;
  }
}
@media (max-width: 400px) and (orientation: portrait) {
  .djfa-piano-container {
    height: 169px;
  }
}

/* === BADGE === */

.djfa-tool-title {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 8px 2px 2px;
  background: linear-gradient(135deg, rgba(248, 208, 88, 0.5), transparent);
  border-radius: 30px;
}

.djfa-tool-badge {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd95a 0%, #f8c040 100%);
  border: 2px solid #f0b830;
  box-shadow:
    0 2px 8px rgba(248, 208, 88, 0.25),
    0 0 0 3px rgba(248, 208, 88, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.djfa-tool-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.djfa-tool-title h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #1a1a1a;
}

/* Badge Responsive */

@media (max-width: 669px) {
  .djfa-tool-badge {
    width: 36px;
    height: 36px;
  }

  .djfa-tool-title h1 {
    font-size: 18px;
  }
}

@media (max-width: 360px) {
  .djfa-tool-badge {
    width: 32px;
    height: 32px;
  }

  .djfa-tool-title h1 {
    font-size: 16px;
  }
}

/* Toggle y separadores adapt */
@media (max-width: 550px) {
  .djfa-control-group {
    padding: 0 2px;
  }

  .djfa-control-group:first-child {
    padding-left: 0;
  }

  .djfa-reverb-toggle span {
    font-size: 12px;
  }

  .djfa-control-group.has-separator::after {
    display: none;
  }

  .djfa-controls {
    gap: 1px;
  }
}



/* === BOTONES DE BAJOS === */
.djfa-bajos-container {
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  -webkit-touch-callout: none;
  border-radius: 8px;
  padding: 5px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: transparent;
  align-items: center;
}

.djfa-bajos-fila {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  padding: 2px 0;
}

.djfa-bajos-fila.acordes {
  padding-left: 68px;
}

.djfa-bajo-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid #c8cdd6;
  background: linear-gradient(180deg, #ffffff, #f0f2f5);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.9) inset,
    0 3px 6px rgba(0,0,0,0.12);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .06s linear, box-shadow .06s linear, background .06s linear;
  font-family: inherit;
  line-height: 1.1;
  text-align: center;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.djfa-bajo-btn:hover {
  border-color: #aab0bb;
  background: linear-gradient(180deg, #fafbfc, #e8ebf0);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.9) inset,
    0 4px 8px rgba(0,0,0,0.16);
  transform: translateY(-1px);
}

.djfa-bajo-btn.active {
  background: #f8d058 !important;
  border-color: #e0b030;
  transform: translateY(2px);
  box-shadow:
    0 1px 2px rgba(0,0,0,0.15) inset,
    0 0 8px rgba(248, 208, 88, 0.4);
  color: #333;
}

.djfa-bajos-fila.notas .djfa-bajo-btn {
  background: linear-gradient(0deg, #fff 0%, #f7dfdf 25%, #5b1d1d 100%);
  border-color: #8b3a2a;
}

.djfa-bajos-fila.acordes .djfa-bajo-btn {
  background: linear-gradient(0deg, #fff 0%, #f7dfdf 25%, #5b5555 100%);
  border-color: #776868;
}

.djfa-bajos-fila.acordes .djfa-bajo-btn:hover {
  background: linear-gradient(180deg, #fafaff, #e0e0f0);
}

/* === RESPONSIVE BOTONES DE BAJOS === */

@media (max-width: 1200px) {
  .djfa-bajos-container {
    padding: 5px 12px 1px;
  }
}

@media (max-width: 1150px) {
  .djfa-bajo-btn {
    width: 51px;
    height: 51px;
  }
  .djfa-bajos-fila.acordes {
    padding-left: 63px;
  }
}

@media (max-width: 700px) {
  .djfa-bajo-btn {
    width: 44px;
    height: 44px;
    font-size: 11px;
  }
  .djfa-bajos-fila {
    gap: 7px;
  }
  .djfa-bajos-fila.acordes {
    padding-left: 51px;
  }
}

@media (max-width: 500px) {
  .djfa-bajo-btn {
    width: 39px;
    height: 39px;
  }
  .djfa-bajos-fila.acordes {
    padding-left: 46px;
  }

.djfa-instrumento-container {
padding-bottom:0px;
}
}

@media (max-width: 420px) {
  .djfa-bajo-btn {
    width: 35px;
    height: 35px;
    font-size: 10px;
  }
  .djfa-bajos-fila {
    gap: 4px;
  }
  .djfa-bajos-fila.acordes {
    padding-left: 39px;
  }
}

@media (max-width: 400px) {
  .djfa-bajo-btn {
    width: 34px;
    height: 34px;
    font-size: 10px;
  }
  .djfa-bajos-fila.acordes {
    padding-left: 38px;
  }
}

@media (max-width: 350px) {
  .djfa-bajo-btn {
    width: 31px;
    height: 31px;
    font-size: 9px;
  }
  .djfa-bajos-fila.acordes {
    padding-left: 35px;
  }
}