* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: white;
    font-family: 'Arial', sans-serif;
    padding: 0.5cm 0; /* Espacio de 0.5 cm arriba y abajo en pantallas grandes */
}

.calculator {
    display: grid;
    grid-template-rows: 1fr 4fr;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    padding: 20px;
    width: 100%;
    height: calc(100% - 1cm); /* Espacio de 1 cm total (0.5 arriba y abajo) */
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

#display {
    background: #333;
    color: white;
    border: none;
    padding: 20px;
    font-size: 2rem;
    text-align: right;
    border-radius: 10px;
    width: 100%;
    height: 80px;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 0px;
    height: 100%;
}

button {
    background: #1e1e1e;
    color: #00ffcc;
    border: none;
    padding: 20px;
    font-size: 1.5rem;
    border-radius: 10px;
    transition: background 0.3s ease;
    width: 100%;
    height: 100%;
}

button:hover {
    background: #00ffcc;
    color: #121212;
    cursor: pointer;
}

/* Media query para dispositivos móviles */
@media (max-width: 768px) {
    body, html {
        padding: 0; /* Quitamos el padding superior/inferior para móviles */
    }

    .calculator {
        width: calc(100% - 0.6cm); /* Dejamos 0.3 cm a cada lado */
        height: 90%; /* Ocupa todo el alto de la ventana en móviles */
        max-width: none; /* Quitamos la restricción del ancho máximo */
        padding: 10px; /* Reducimos un poco el padding interno */
    }

    #display {
        font-size: 1.5rem; /* Ajustamos el tamaño de la fuente para móviles */
        height: 60px; /* Reducimos la altura del display en móviles */
    }

    button {
        font-size: 1.2rem; /* Reducimos el tamaño de los botones en móviles */
        padding: 15px; /* Ajustamos el padding de los botones en móviles */
    }
}
