* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

body {
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

.calculator {
    background-color: #333;
    border-radius: 15px;
    width: 340px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
    padding: 20px;
    border: none;
}

.previous-operation {
    height: 30px;
    width: 100%;
    background-color: #222;
    color: #999;
    text-align: right;
    padding: 5px 20px 0 20px;
    font-size: 1.2rem;
    border-radius: 8px 8px 0 0;
    box-sizing: border-box;
    overflow: hidden;
}

.calculator-screen {
    width: 100%;
    height: 60px;
    background-color: #222;
    color: #fff;
    text-align: right;
    padding: 5px 20px 10px 20px;
    font-size: 3rem;
    border: none;
    border-radius: 0 0 8px 8px;
    margin-bottom: 20px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    text-overflow: clip;
    pointer-events: none;
}

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

button {
    height: 70px;
    background-color: #555;
    border: none;
    font-size: 1.8rem;
    color: #fff;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

button:hover {
    background-color: #666;
    transform: translateY(-2px);
}

button:active {
    background-color: #444;
    transform: translateY(0);
}

.operator {
    background-color: #f79d37;
    color: #fff;
}

.operator:hover {
    background-color: #f58400;
}

.all-clear {
    background-color: #e74c3c;
    color: #fff;
}

.all-clear:hover {
    background-color: #c0392b;
}

.equal-sign {
    grid-column: 4 / 5;
    grid-row: 2 / 6;
    background-color: #2ecc71;
    color: #fff;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.equal-sign:hover {
    background-color: #27ae60;
}

@media (max-width: 450px) {
    .calculator {
        width: 90%;
        padding: 15px;
    }
    .calculator-screen {
        height: 60px;
        font-size: 2.5rem;
    }
    .previous-operation {
        height: 25px;
        font-size: 1rem;
    }
    button {
        height: 60px;
        font-size: 1.5rem;
    }
    .equal-sign {
        font-size: 2rem;
    }
}