body {
    background: rgb(39, 40, 44);
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.titles {
    color: white;
    position: absolute;
    top: 5%;
    left: 50%; /* Centrar horizontalmente */
    transform: translateX(-50%); /* Centrar horizontalmente */
    text-align: center;
}

.titles h1 {
    font-size: 2.4rem;
    margin: 0;
    margin-top: 2rem;
}

.titles h2 {
    font-size: 1.5rem;
    margin: 0;
    margin-top: 1rem;
}

.name {
    color: #089FFA;
}

.calculator {
    background-color: #ffff;
    border-radius: 1rem;
    box-shadow: 0 0 20px rgba(158, 158, 158, 0.4);
    padding: 1.5rem;
    display: inline-block;
    width: 100%; /* Ajustar ancho de la calculadora */
    max-width: 360px; /* Ancho máximo */
    margin: 0 auto;
}

#pantalla {
    width: 98.5%;
    font-size: 2rem;
    margin-bottom: 1rem;
    padding: 10px;
    box-sizing: border-box;
    border-radius: 10px;
    border: 1px solid rgb(180, 180, 180);
    text-align: end;
}

input[type="button"] {
    background: #f1f3f4;
    width: 80px;
    height: 50px;
    font-size: 16px;
    margin: 3px;
    cursor: pointer;
    border: 1px solid #f1f3f4;
    border-radius: 4px;
}

#resultado {
    background: #4285f4;
    color: white;
    border: 1px solid #4285f4;
    border-radius: 4px;
}

#specials {
    background: #dadce0;
    border: 1px solid #dadce0;
    border-radius: 4px;
}

#buttonC {
    background: #dadce0;
    border: 1px solid #dadce0;
    border-radius: 4px;
    width: 47.5%;
}

#button0 {
    background: #dadce0;
    border: 1px solid #dadce0;
    border-radius: 4px;
    width: 47.5%;
}

.instructions {
    color:white;
    position: absolute;
    bottom: 10%;
}

@media (max-width: 1366px) { /* Laptops 1366px */
    .titles {
        top: 2%;
    }

    .titles h1 {
        font-size: 2rem;
    }
    
    .titles h2 {
        font-size: 1.3rem;
    }

    .instructions {
        padding-left: 2rem;
        padding-right: 2rem;
        margin-bottom: -3rem;
        font-size: 15px;
    }
}

@media (max-width: 840px) { /* Tablets 800px */
     .titles {
        top: 9%;
    }

    .titles h1 {
        font-size: 2rem;
    }
    
    .titles h2 {
        font-size: 1.3rem;
    }

    .instructions {
        padding-left: 5rem;
        padding-right: 4rem;
        font-size: 16px;
    }
}

    @media (max-width: 480px) { /* Phones 480px */
        #pantalla {
            padding: 16px;
            font-size: 50rem;
        }

        .calculator {
            padding: 1rem; /* Puedes reducir el padding */
            width: 80%; /* Ajusta el ancho según tus necesidades */
            max-width: 280px;
            margin: 0 auto;
        }
    
        input[type="button"] {
            width: 60px; /* Reducir el ancho de los botones */
            height: 40px; /* Reducir la altura de los botones */
            font-size: 12px; /* Reducir el tamaño de la fuente de los botones */
        }
    
        #pantalla {
            font-size: 14px;
        }

        #buttonC {
            width: 46.5%;
        }
        
        #button0 {
            width: 46.5%;
        }
        
        .titles {
            top: 5%;
        }
    
        .titles h1 {
            font-size: 1.8rem;
        }
        
        .titles h2 {
            font-size: 1.2rem;
        }
    
        .instructions {
            padding-left: 2rem;
            padding-right: 2rem;
            margin-bottom: -3rem;
            font-size: 14px;
        }
}