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

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

}

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

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

.djf-piano-controls {
  display:flex;
  gap:12px;
  align-items:center;
  flex-wrap: wrap;
}

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

/* Separador solo después de sustain y nomenclatura */
.djf-control-group.has-separator::after {
  content: '';
  position: absolute;
  right: -1px; /* ajuste fino para centrar */
  top: 50%;
  transform: translateY(-50%);
  height: 24px;
  width: 1px;
  background: linear-gradient(180deg, transparent, #ddd 20%, #ddd 80%, transparent);
}

/* Primer grupo sin padding izquierdo */
.djf-control-group:first-child {
  padding-left: 0;
}

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

.djf-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;
}

.djf-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);
}

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

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

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


/* === SUSTAIN TOGGLE === */

.djf-sustain-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;
}

.djf-sustain-toggle:hover {
  border-color: #bbb;
  background: #fafafa;
}

/* Estado activo con borde amarillo más grueso */
.djf-sustain-toggle.active {
  border: 2px solid #f8d058; /* mismo grosor */
  box-shadow: 
    0 0 0 2px #f8d058, /* simula borde de 4px total */
    0 0 0 4px rgba(248, 208, 88, 0.15),
    0 2px 6px rgba(248, 208, 88, 0.2);
}

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

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

.djf-piano-container {
  user-select:none;
  touch-action: none;
  border-radius:8px;
  padding:12px;
  background: linear-gradient(180deg,#fbfbfb,#f3f6f9);
  box-shadow: 0 6px 18px rgba(20,30,50,0.06);
  display: flex;
}

/* Fila interna: transform por JS (M1) */
.djfp-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: 3 o 2 px según intensidad*/
.djf-sustain-toggle, .djf-select, .djf-btn {
box-shadow:  0 0 0 3px rgba(248, 208, 88, 0.27);
}

/* === TECLAS === */

.djf-key {
  position:relative;
  box-sizing:border-box;
  border:1px solid #d6d6d6;
 /* background:#fff; */
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;
}


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

.djf-key.black {
  position:absolute;
  width:30px;
  height:100px;
  background:#111;
  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;
}

.djf-key.black.active {
  background:#333 !important;
  box-shadow:0 0 10px #f8d058;
}

.djf-octave {
  display:flex;
  position:relative;
 /* margin-right: 1px; */
  margin-right: 0;
}

.djf-octave:last-child {
  margin-right: 0; /* ← sin gap después de la última octava */
}

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

.djf-feedback {
  margin-top:8px;
  font-size:13px;
  color:#444;
  min-height:18px;
}

/* Contenedor de navegación de octavas */
#djf-octave-nav {
  display: none; /* oculto por defecto */
  align-items: center;
  gap: 8px;
}

/* Flechas deshabilitadas */
.djf-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  background: #f5f5f5;
  color: #999;
  border-color: #ddd;
}

/* === SELECT MEJORADO === */

.djf-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;
 /* box-shadow: 0 1px 3px rgba(0,0,0,0.08);*/
}

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

.djf-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 cuando está en modo "hidden" */
.djf-key.note-hidden {
  font-size: 0;
}

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

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

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

/* Botones pequeños */
.djf-btn-sm {
  padding: 5px 10px;
  min-width: 32px;
  font-size: 12px;
}

/* Ocultar en móvil (donde no hay teclado físico) */
@media (max-width: 800px) {
  .djf-keyboard-shift {
    display: none !important;
  }
}

/* Responsive: compactar en pantallas medianas */
@media (max-width: 1024px) {
  .djf-keyboard-shift span {
    font-size: 13px !important;
  }
  
  #djf-kbd-range {
    min-width: 45px !important;
    font-size: 12px !important;
  }
}

/* Dos filas */
@media (max-width: 825px) {
  .djf-piano-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
  }
  .djf-piano-controls {
    align-self: center;
  }
}

/* === MOBILE (M1) === */

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

  .djfp-row {
    transform-origin: left center; /* mantener consistencia */
  }

  #djf-prev-oct,
  #djf-next-oct {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding: 6px 8px;
  }
  
  #djf-octave-nav {
    display: flex !important;
  }
}

/* === LABELS === */

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

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

/* Movil Vertical: apilar controles en 2 filas */
@media (max-width: 669px) {
 /* .djf-piano-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
  } */
  
  .djf-piano-header h1 {
    font-size: 16px;
  }
  
  .djf-piano-controls {
    gap: 8px;
  }
  
  .djf-control-group {
    padding: 0 8px;
  }
  
  .djf-control-group:first-child {
    padding-left: 0;
  }
  
  .djf-control-group:last-child {
    padding-right: 0;
  }
  
  .djf-sustain-toggle {
    padding: 5px 12px;
  }
  
  .djf-sustain-toggle span {
    font-size: 13px;
  }
  
  .djf-btn,
  .djf-select {
    font-size: 12px;
    padding: 6px 8px;
  }
  
  .djf-piano-controls label {
    font-size: 13px;
  }

  
  /* Selector de notas más estrecho */
  .djf-select {
    max-width: 110px;
  }
  
  /* Botones de octavas más compactos */
  #djf-prev-oct,
  #djf-next-oct {
    min-width: 28px;
    padding: 5px 6px;
  }
}

/* Móvil muy estrecho: máxima compresión */
@media (max-width: 360px) {
  .djf-piano-header h1 {
    font-size: 15px;
    margin-bottom: 4px;
  }
  
  .djf-piano-controls {
    gap: 1px;
  }
  
  .djf-btn,
  .djf-select {
    font-size: 11px;
    padding: 5px 6px;
  }
  
  .djf-select {
    max-width: 100px;
  }
  
  /* Comprimir labels */
  .djf-piano-controls label {
    font-size: 12px !important;
  }

  .djf-sustain-toggle {
    padding: 4px 10px;
  }
  
  .djf-sustain-toggle span {
    font-size: 12px;
  }

}

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

.djf-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;
}

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

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

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

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

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

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

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

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

/* Overlay de activación solo móvil */
#djf-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;
}

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

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

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


@media (max-width: 600px) and (orientation: portrait) {
  .djf-key.white {
    height: 250px;
  }
  
  .djf-key.black {
    height: 145px;
  }
  
  /* Forzar altura exacta del contenedor */
  .djf-piano-container {
    padding: 0;
    height: 250px;
    overflow: hidden;
    display: flex;
    align-items: center; 
  }
  
  /* Asegurar que la fila no añada espacio extra */
  .djfp-row {
    padding: 0; 
    margin: 0;
  }
}
@media (max-width: 520px) and (orientation: portrait) {

  /* Forzar altura exacta del contenedor */
  .djf-piano-container {
    height: 200px;
  }
}

/*Badge*/

.djf-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;
}

.djf-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;
}

.djf-tool-badge img {
  width: 100%; /* llenar todo el badge */
  height: 100%;
  object-fit: cover; /* recortar para llenar sin deformar */
  border-radius: 50%; 
/*  filter: brightness(0) invert(1); icono blanco */
}

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

/*Badge Responsive*/

@media (max-width: 669px) {
  .djf-tool-badge {
    width: 36px;
    height: 36px;
  }
  
  .djf-tool-badge img {
  width: 100%; /* llenar todo el badge */
  height: 100%;
  }
  
  .djf-tool-title h1 {
    font-size: 18px;
  }
}

@media (max-width: 360px) {
  .djf-tool-badge {
    width: 32px;
    height: 32px;
  }
  
  .djf-tool-badge img {
  width: 100%; /* llenar todo el badge */
  height: 100%;
  }
  
  .djf-tool-title h1 {
    font-size: 16px;
  }
}

/*toggle y separadores adapt*/
@media (max-width: 400px) {
  .djf-control-group {
    padding: 0 6px; /* reducir padding */
  }
  
  .djf-control-group:first-child {
    padding-left: 0;
  }
 
/* más compacto  
  .djf-sustain-toggle {
    padding: 4px 10px; 
    gap: 6px;
  } */
  
  .djf-sustain-toggle span {
    font-size: 12px;
  }

  /* Ocultar separadores en muy estrecho (opcional) */
  .djf-control-group.has-separator::after {
    display: none;
  }
}

@media (max-width: 390px) {
.djf-piano-controls{
gap: 1px ;
}
.djf-control-group{
padding: 0 2px;}
}