/* © DJFuturo Tools. Todos los derechos reservados. */
/* ============================================================
   DJFuturo — Detector de Tono Online
   ============================================================ */

/* ── Reset básico dentro del wrapper ── */
#djf-detector-wrapper *,
#djf-detector-wrapper *::before,
#djf-detector-wrapper *::after {
  box-sizing: border-box;
}

#djf-detector-wrapper {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── Contenedor raíz ── */
.djf-detector-v1 {
  margin: 0 auto;
  padding: 0;
}

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

.djf-detector-header {
  padding: 16px 16px 0;
}

.djf-detector-title {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 2px 12px 2px 2px;
  background: linear-gradient(135deg, rgba(248, 208, 88, 0.5), transparent);
  border-radius: 30px;
  width: fit-content;
}

.djf-detector-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;
  overflow: hidden;
}

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

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

/* ============================================================
   BODY
   ============================================================ */

.djf-detector-body {
  background: linear-gradient(180deg, #fbfbfb, #f3f6f9);
  box-shadow: 0 6px 18px rgba(20, 30, 50, 0.06);
  border-radius: 12px;
  margin: 12px 0 0;
  padding: 10px 24px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* ============================================================
   RULETA
   ============================================================ */

.djf-detector-ruleta-wrap {
  position: relative;
  width: 100%;
  height: 150px;
  overflow: hidden;
}

.djf-detector-ruleta-canvas {
  display: block;
  width: 100%;
  height: 100%;

-webkit-mask-image:
    radial-gradient(circle at 0% 100%, transparent 0%, #000 45%),
    radial-gradient(circle at 100% 100%, transparent 0%, #000 45%),
    linear-gradient(to right, transparent 0%, #000 18%, #000 82%, transparent 100%),
    linear-gradient(to top, transparent 0%, #000 15%);
  -webkit-mask-composite: source-in, source-in, source-in, source-in;
  mask-image:
    radial-gradient(circle at 0% 100%, transparent 0%, #000 45%),
    radial-gradient(circle at 100% 100%, transparent 0%, #000 45%),
    linear-gradient(to right, transparent 0%, #000 18%, #000 82%, transparent 100%),
   linear-gradient(to top, transparent 0%, #000 15%);
  mask-composite: intersect, intersect, intersect, intersect;
}


/* ── Indicador/aguja fija (no se mueve, se mueve la ruleta detrás) ── */
.djf-detector-ruleta-needle {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
  background: #e63030;
  pointer-events: none;
  z-index: 2;
}

.djf-detector-ruleta-needle::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid #e63030;
}

/* ============================================================
   READOUT — Nota / Octava / Hz
   ============================================================ */

.djf-detector-readout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.djf-detector-note {
  font-size: 52px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #1a1a1a;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.djf-detector-note-octave {
  font-size: 20px;
  font-weight: 600;
  color: #888;
  margin-left: 2px;
  vertical-align: super;
}

.djf-detector-hz {
  font-size: 15px;
  font-weight: 500;
  color: #888;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   CONTROLES
   ============================================================ */

.djf-detector-controls {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: 100%;
  position: relative;
}

/* ── Botón principal circular (Activar/Detener) ── */
.djf-detector-btn-primary {
  width: 60px;
  height: 60px;
  min-width: 60px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e0a800;
  background: linear-gradient(180deg, #fcedbe 0%, #f8c040 100%);
  color: #1a1a1a;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) inset, 0 1px 1px rgba(248, 208, 88, 0.1), 0 0 0 7px rgba(248, 208, 88, 0.5), 0 0 0 14px rgba(248, 208, 88, 0.3), 0 0 0 15px rgba(248, 208, 88, 0.05);
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  flex-shrink: 0;
  touch-action: manipulation;
}

.djf-detector-btn-primary:hover {
  background: linear-gradient(180deg, #ffe170, #f8cc50);
  border-color: #d09000;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 3px 10px rgba(248, 208, 88, 0.5);
}

/* Estado activo (escuchando / solicitando permiso) */
.djf-detector-btn-primary.active {
  background: linear-gradient(180deg, #f8c040, #e8a800);
  border-color: #c08000;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.15) inset,
    0 0 0 3px rgba(248, 208, 88, 0.3);
  animation: djf-detector-pulse 1.4s ease-in-out infinite;
}

@keyframes djf-detector-pulse {
  0%, 100% { box-shadow: 0 2px 4px rgba(0,0,0,0.15) inset, 0 0 0 3px rgba(248,208,88,0.3); }
  50%      { box-shadow: 0 2px 4px rgba(0,0,0,0.15) inset, 0 0 0 8px rgba(248,208,88,0.12); }
}

.djf-detector-btn-primary.active .djf-mic-icon {
  opacity: 0.5;
}

/* ── Selector de nomenclatura (label + pill doble) ── */
.djf-detector-notation-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  position: absolute;
  right: 0;
}

.djf-detector-notation-label {
  font-size: 12px;
  font-weight: 600;
  color: #888;
  white-space: nowrap;
}

/* Contenedor único con aspecto de "pill", dividido internamente en dos
   botones sin bordes individuales — en vez de dos pills sueltas con gap. */
.djf-detector-notation-pillgroup {
  display: flex;
  border-radius: 20px;
  border: 2px solid #ddd;
  background: #fff;
  overflow: hidden;
}

.djf-detector-notation-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 14px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #555;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  touch-action: manipulation;
}

.djf-detector-notation-btn:hover {
  background: #fafafa;
  color: #333;
}

.djf-detector-notation-btn.active {
  background: #f8d058;
  color: #1a1a1a;
}

/* Separador visual sutil entre ambas mitades de la pill doble */
.djf-detector-notation-btn:first-child {
  border-right: 1px solid #ddd;
}


/* ── Botón pill "probar en el generador" ── */
.djf-detector-try-tone-btn {
  position: absolute;
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 20px;
  border: 3px solid #f0b830;
  background: linear-gradient(180deg, #fff6d9 0%, #fff 100%);
  color: #1a1a1a;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.djf-detector-try-tone-btn:hover {
  background: linear-gradient(180deg, #ffe170, #f8cc50);
  border-color: #d09000;
}

.djf-try-tone-icon {
  flex-shrink: 0;
  font-size: 14px;
  line-height: 1;
}

/* Estado deshabilitado: sin nota confirmada todavía que enviar */
.djf-detector-try-tone-btn[aria-disabled="true"] {
  background: #f0f0f0;
  border-color: #ddd;
  color: #aaa;
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.65;
}

/* ============================================================
   FEEDBACK
   ============================================================ */

.djf-detector-feedback {
  margin-top: 8px;
  font-size: 13px;
  color: #888;
  min-height: 18px;
  text-align: center;
  padding: 0 16px;
}

/* Feedback en rojo para estados de error/permiso denegado */
#djf-detector-wrapper[data-state="denied"] .djf-detector-feedback,
#djf-detector-wrapper[data-state="error"] .djf-detector-feedback {
  color: #c00;
}

/* ============================================================
   ESTADOS — atenuar ruleta/readout sin señal o sin permiso
   ============================================================ */

#djf-detector-wrapper[data-state="idle"] .djf-detector-ruleta-wrap,
#djf-detector-wrapper[data-state="denied"] .djf-detector-ruleta-wrap,
#djf-detector-wrapper[data-state="error"] .djf-detector-ruleta-wrap {
  opacity: 0.35;
}

#djf-detector-wrapper[data-state="idle"] .djf-detector-ruleta-needle,
#djf-detector-wrapper[data-state="denied"] .djf-detector-ruleta-needle,
#djf-detector-wrapper[data-state="error"] .djf-detector-ruleta-needle {
  background: #ccc;
}

#djf-detector-wrapper[data-state="idle"] .djf-detector-ruleta-needle::before,
#djf-detector-wrapper[data-state="denied"] .djf-detector-ruleta-needle::before,
#djf-detector-wrapper[data-state="error"] .djf-detector-ruleta-needle::before {
  border-top-color: #ccc;
}

/* ============================================================
   UTILIDADES
   ============================================================ */

.djf-detector-btn--hidden {
  display: none !important;
}

/* ============================================================
   RESPONSIVE — MÓVIL
   ============================================================ */


/* ============================================================
   RESPONSIVE — Controles: Escucha/Notación pasan a nueva línea
   ============================================================ */


@media (max-width: 900px) {}
  .djf-detector-body {
    padding: 10px 5px 10px;}

@media (max-width: 820px) {
  .djf-detector-controls {
    flex-wrap: wrap;
    row-gap: 12px;
  }

  /* El botón power ocupa toda la primera línea él solo,
     forzando que el resto de controles caigan a la siguiente. */
  .djf-detector-btn-primary {
    order: 1;
  }

  .djf-detector-controls::after {
    content: '';
    flex-basis: 100%;
    order: 2;
    height: 0;
  }


  /* Al perder el ancho disponible en una sola línea, dejan de
     anclarse a los extremos (absolute) y pasan a flujo normal,
     centrados junto al otro control en la segunda línea. */
  .djf-detector-try-tone-btn {
    position: static;
    order: 3;
  }

  .djf-detector-notation-toggle {
    position: static;
    order: 4;
  }
}



@media (max-width: 600px) {
  .djf-detector-body {
    gap: 20px;
  }

  .djf-detector-ruleta-wrap {
    height: 120px;
  }

  .djf-detector-note {
    font-size: 50px;
  }

  .djf-detector-note-octave {
    font-size: 17px;
  }

  .djf-detector-btn-primary {
    width: 68px;
    height: 68px;
    min-width: 68px;
  }

  .djf-detector-btn-primary svg {
    width: 26px;
    height: 26px;
  }

  .djf-detector-try-tone-btn {
font-size: 12px;
  }  
}

@media (max-width: 572px) {
  .djf-detector-try-tone-btn {
    order: 4;
  }

  .djf-detector-notation-toggle {
    order: 3;
  }

  }

@media (max-width: 400px) {

  .djf-detector-title h1 {
    font-size: 17px;
  }
}


@media (max-width: 330px) {

  .djf-detector-try-tone-btn {
gap: 2px;
padding: 7px 5px; 
  }
}


/* AD v1 */
.ad-slot--in-content {
    width: 100%;
    min-height: 100px;
    margin-bottom: 10px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}


@media (max-width: 1009px) {
    .ad-slot--in-content {
        min-height: 0;
        margin-bottom: 0;
    }
}