* {
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #f4f4f4;
}

.calculator {
    border-radius: 10px;
    overflow: hidden;
    display: grid;
    grid-template-rows: 1fr 4fr;
    width: 100%;
    max-width: 400px; /* Adjust this value to a suitable size */
    height: auto; /* Let the height adjust naturally */
    background-color: #222;
}

.calculator-screen {
    background-color: #252525;
    color: white;
    font-size: 2.5rem;
    border: none;
    padding: 20px;
    text-align: right;
    width: 100%;
    box-sizing: border-box;
}

.calculator-keys {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-gap: 10px;
    padding: 10px;
}

button {
    font-size: 1.5rem;
    padding: 20px;
    background-color: #444;
    border: none;
    color: white;
    cursor: pointer;
    border-radius: 5px;
    width: 100%; /* Make sure buttons take up full available width */
}

button:hover {
    background-color: #555;
}

button.operator {
    background-color: #f78e42;
}

button.all-clear {
    background-color: #e23e57;
}

button.equal-sign {
    background-color: #00b894;
    grid-column: span 2; /* Spanning the equal button across two columns */
}

@media (max-width: 400px) {
    .calculator {
        max-width: 100%;
        padding: 20px;
    }

    button {
        font-size: 1.2rem; /* Adjust button text size on smaller screens */
        padding: 15px;
    }
}
