:root {
      /* --primary: #00C6FB;
      --secondary: #005BEA;
      --background: linear-gradient(180deg, #3A8DFF 0%, #74C0FC 100%);
      --text-light: #ffffff;
      --text-muted: #D0E3FF;
      --blur-bg: rgba(255, 255, 255, 0.15); */

    
    
      --verde-bosque: #0F3D3E;
    --verde-salvia: #6F806E;
    --verde-hoja: #8FA58B;

    --terracota: #C08A6B;
    --terracota-oscuro: #9E6F56;

    --beige-fondo: #F5ECE3;
    --beige-profundo: #EADBCF;
    --beige-card: #FFF8F2;

    --texto-principal: #3A312C;
    --texto-suave: #7A6A60;


     /* ===== MAPEO COMPATIBLE (sistema viejo) ===== */

  --primary: #C08A6B;         /* antes azul → ahora terracota */
  --secondary: #6F806E;       /* antes azul oscuro → ahora verde */

  --background: linear-gradient(
      180deg,
      #F5ECE3 0%,
      #EADBCF 100%
  );

  --text-light: #3A312C;      /* antes blanco → ahora texto real */
  --text-muted: #7A6A60;      /* gris suave */

  --blur-bg: rgba(255, 248, 242, 0.65); /* glass cálido */




    }

    body {
     
      color: var(--text-light);
      display: flex;
      justify-content: center;
      align-items: center;
      font-family: 'Poppins', sans-serif;
    }

#edad-input, #genero{
      border: 1px solid transparent;
      background: rgb(139, 175, 242, 0.4) !important;
      line-height: 20px;   border-radius: 8px;

      padding: 5px;
      font-size: 16px;
 }

    
#area_input input[type="text"] {
   border-radius: 12px;
   
  font-size: 16px;
  width: 80%;
  margin-top: 5px;
}

#area_input input::placeholder {
      
  color: #cecccc; /* O el color que tú prefieras */
  opacity: 0.8;  
     /* Opcional: hace el texto un poco translúcido */
}

#texto-hablado {
  
    position: absolute;
    display: none;
     
    margin-top: -30px;
    left: 50%;
    transform: translateX(-50%);
    /* background-color: rgba(0, 0, 0, 0.85); */
    color: #0F3D3E;

    background: rgba(255, 248, 242, 0.96);
    /* color: #3A312C; */
    border: 1px solid rgba(192, 138, 107, 0.22);
    /* box-shadow: 0 12px 28px rgba(86, 60, 45, 0.18); */
     
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 14px;
    max-width: 400px;
    max-width: 80%;
    text-align: center;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);

    /* ✅ AÑADE ESTO */
    max-height: 160px;         /* o lo que consideres visualmente adecuado */
    overflow-y: auto;          /* activa scroll vertical si el texto excede */
    scrollbar-width: thin;     /* opcional: delgado en Firefox */

}

#texto-hablado.speech-bubble::after{

 content: "";
    position: absolute;
    top: -10px; /* La punta sale por la parte de arriba del globo */
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid rgba(0, 0, 0, 0.85); /* Aquí está el color de la flecha */  
    


}


#confirm-yes{

      border: none;
      border-radius: 30px;
      background: linear-gradient(90deg, var(--primary), var(--secondary));
      color: white;
      font-size: 0.8rem;
      font-weight: bold;
      cursor: pointer;
      box-shadow: 0 4px 10px rgba(0,0,0,0.3);

}

#confirm-no{
  border: none;
      border-radius: 30px;
      background: linear-gradient(90deg, var(--primary), rgba(51, 2, 2, 0.5));
      color: white;
      font-size: 0.8rem;
      font-weight: bold;
      cursor: pointer;
      box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

#confirm-modal{
 margin-top: 20px;
      padding: 15px 30px;
      border: none;
      border-radius: 30px;
      background: linear-gradient(90deg, var(--verde-hoja), var(--beige-profundo));
      color: white;
       
      font-size: 0.8rem;
      font-weight: bold;
      cursor: pointer;
      box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}


#cambiahabitos:hover{
  background: rgba(111, 128, 110, 0.18);
    color: #0F3D3E;
     cursor: pointer;
}


.btn-start{
 background: rgba(111, 128, 110, 0.12);
    color: #6F806E;
    border: 1px solid rgba(111, 128, 110, 0.2);
    border-radius: 12px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 500;
    box-shadow: none;
}
   

    .robot-image {
      width: 180px;
      height: auto;
      /* margin-bottom: 0px; */
    }

    .robot-min {
      width: 60px;
      height: auto;
      position: fixed;
      top: 10px;
      right: 10px;
      z-index: 9999;
      /* margin-bottom: 0px; */
    }




    .robot-container h1 {
      margin: 0 auto;
      font-size: 1.8rem;
      font-weight: 700;
      margin-top: -10px;
      max-width: 230px;
    }

    p.subtitle {
      font-size: 1rem;
      color: var(--text-muted);
      margin-bottom: 20px;
    }

    .input-group {
      min-width: 230px;
      background: var(--blur-bg);
      backdrop-filter: blur(10px);
      padding: 10px;
      border-radius: 12px;
      display: flex;
      align-items: center;
      margin-bottom: 20px;
    }

    .input-group input {
      background: transparent;
      border: none;
      outline: none;
      color: white;
      font-size: 1rem;
      flex: 1;
      padding-left: 10px;
    }



#tabla-emoji {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 10px !important;
    max-width: 100% !important;
    margin: 12px auto 24px !important;
    align-items: stretch !important;
}

#tabla-emoji .emotion-container {
    width: auto !important;
    min-width: 0 !important;
    height: 68px !important;
    margin: 0 !important;
    padding: 7px 5px 6px !important;

    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;

    border-radius: 14px !important;
    text-align: center !important;
}

#tabla-emoji .fugraemotion {
    font-size: 20px !important;
    line-height: 1 !important;
}

#tabla-emoji .emotion-label {
    font-size: 11px !important;
    line-height: 1.1 !important;
    margin-top: 6px !important;
}

/* El select debe ocupar todo el ancho debajo de los emojis */
#tabla-emoji > div:not(.emotion-container) {
    grid-column: 1 / -1 !important;
    display: flex !important;
    justify-content: center !important;
}





    .emotion-container:hover {
      transform: scale(1.05);
      background: rgba(255,255,255,0.25);
    }

    .emotion-label {
      display: block;
      font-size: 10px;
      /* margin-top: 5px; */
    }

    .start-button {
      margin-top: 20px;
      padding: 15px 30px;
      border: none;
      border-radius: 30px;
      background: linear-gradient(90deg, var(--primary), var(--secondary));
      color: white;
      font-size: 1rem;
      font-weight: bold;
      cursor: pointer;
      box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    }

    .settings-icon {
      
      /* position: absolute; */
      width: 20px;
      left:0;
      right:0;
      margin: 0 auto;
      top: 180px;
      left: 120px;
      font-size: 16px;
      cursor: pointer;
      color: white;
      /* z-index: 1000; */
    }
    .settings-icon{
      transition: transform 0.6s ease; /* Duración: 0.6 segundos */
    }

    .settings-icon:hover{
      cursor: pointer;
      /* font-size: 1.5rem; */
      transform: scale(1.5);
    }



.equalizer {
            display: flex;
            width: 80px;
            height: 40px;
            
            position: absolute;
            left: 0;
            right: 0;
            margin: 0 auto;
            left: 90px;
            margin-top:30px;
            
            transform: translateX(-50%);
            
            flex-direction: row;
            justify-content: space-around;
            align-items: flex-end;
            z-index: 10000;
        }

.equalizer.active {
            display: flex;
        }

.bar {
            width: 8px;
            background-color: var(--primary);
            border-radius: 4px;
            margin: 0 2px;
            transform-origin: bottom;
        }


@keyframes equalizerAnimation {
            0% { transform: scaleY(0.3); }
            50% { transform: scaleY(1.5); }
            100% { transform: scaleY(0.5); }
        }



/* Asegurar que el contenedor flotante sea visible en iOS */
.contenedor-texto-hablado {
    display: block !important;
    visibility: visible !important;
    pointer-events: none; /* Para que no interfiera con clicks */
}

/* Para iOS específicamente */


@supports (-webkit-touch-callout: none) {
    .contenedor-texto-hablado {
        position: fixed !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        z-index: 99999 !important;
       
    }

.robot-in-chat {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        margin: 0 auto 15px auto !important;
        transform: none !important;
    }
    
    #robot-main {
        transition: none !important; /* Evita animaciones problemáticas en iOS */
        
    }
    
    .chat-popup {
        margin-top: 80px !important; /* Espacio para el robot en iOS */
    }

}

/* sombra MODAL A la bentana de chat */
.modal-overlay {
    position: fixed;
    inset: 0; /* top, right, bottom, left = 0 */

    background: rgba(0, 0, 0, 0.25); /* sombra tenue */
    
    backdrop-filter: blur(3px); /* efecto pro */
    -webkit-backdrop-filter: blur(3px);

    z-index: 999; /* debajo del modal */
}




@media (max-width: 500px) {
    .container {
        width: calc(100% - 60px) !important; /* 20px por lado */
        margin-left: auto !important;
        margin-right: auto !important;
    }
}


    /* Media queries optimizadas para diferentes escenarios */
/* Caso 1: Cuando el ancho es pequeño (≤410px) pero altura normal */
@media (max-width: 410px) and (min-height: 501px) {

#texto-hablado{
    width: 80%;
}

.settings-icon {

      top: 90px;
      left: 120px;
      font-size: 16px;
      
    }

.equalizer {
          
            margin-top:30px;
            left: 90px;
            }

#area_input input::placeholder {
      
  color: #ffffff; /* O el color que tú prefieras */
  opacity: 0.8;   /* Opcional: hace el texto un poco translúcido */
}
     

  

 .container {
     margin-top:-40px;
    }

 .emotion-container {
      width: 50px !important;
      height: 40px; 
    }
    .emotion-label {
      font-size: 7px;
      /* margin-top: 5px; */
    }



   /* .equalizer {
            display: flex;
            top:30px;
            width: 50px;
   } */
   
    .robot-container {
      position: relative;
     margin-top:-20px;
    }
    
    .robot-image {
        max-height: 200px;
    }
    
    .panel {
        font-size: 10px;
        padding: 10px;
    }
}

/* Caso 2: Cuando la altura es pequeña (≤500px) pero ancho normal */
@media (min-width: 411px) and (max-height: 500px) {
    #texto-hablado{
    width: 80%;
}
input::placeholder {
      
  color: #ffffff; /* O el color que tú prefieras */
  opacity: 0.8;   /* Opcional: hace el texto un poco translúcido */
}

    .robot-image {
        max-height: 180px;
    }
}

/* Caso 3: Cuando ambos son pequeños (≤410px y ≤500px) */
@media (max-width: 410px) and (max-height: 500px) {
  #texto-hablado{
    width: 80%;
}
input::placeholder {
      
  color: #ffffff; /* O el color que tú prefieras */
  opacity: 0.8;   /* Opcional: hace el texto un poco translúcido */
}
    
    .robot-image {
        max-height: 150px;
    }
    
    .panel {
        font-size: 8px;
        padding: 8px;
    }
}

/* Caso 4: Pantallas muy estrechas (≤350px) */
@media (max-width: 350px) {
    
    .Holasoy{ 
     right:-40px;
    }
/* .voice-settings {
  position: absolute;
  right: -70px;
} */

    .welcome-message H1{
        margin:0 auto ;
        font-size: .9rem;
        max-width: 230px;
        /* background: #00b8ff; */
        margin-top: 90px;
    }
    
    
}


/* neevo */

@media (max-width: 768px) {
  body {
    height: auto !important;
    min-height: 100dvh;
    display: block !important;
    justify-content: unset !important;
    align-items: unset !important;
    padding: 12px 0 18px;
    overflow-x: hidden;
  }

  .container {
        width: calc(100% - 60px) !important; /* 20px por lado */
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

/* Responsive: se mantiene en 4 columnas, como los cuadros de abajo */
@media (max-width: 620px) {
    #tabla-emoji {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 8px !important;
    }

    #tabla-emoji .emotion-container {
        height: 62px !important;
        padding: 6px 4px !important;
        border-radius: 12px !important;
    }

    #tabla-emoji .fugraemotion {
        font-size: 20px !important;
    }

    #tabla-emoji .emotion-label {
        font-size: 10px !important;
    }
}

@media (max-width: 380px) {
    #tabla-emoji {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 6px !important;
    }

    #tabla-emoji .emotion-container {
        height: 58px !important;
        padding: 5px 3px !important;
    }

    #tabla-emoji .fugraemotion {
        font-size: 16px !important;
    }

    #tabla-emoji .emotion-label {
        font-size: 6.5px !important;
    }
}