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

button {
    height: 58px;
    border: none;
    border-radius: 12px;
    background: #334155;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

button:hover {
    background: #475569;
}

button:nth-child(4n) {
    background: #2563eb;
}

button:first-child,
button:nth-child(2) {
    background: #dc2626;
}

button:last-child {
    background: #16a34a;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #141e30;
}

.calculator {
    width: 340px;
    padding: 22px;
    border-radius: 20px;
    background: #1e293b;
    box-shadow: 0 10px 30px #0005;
}

h2 {
    color: white;
    text-align: center;
    margin-bottom: 18px;
}

#display {
    width: 100%;
    height: 75px;
    margin-bottom: 18px;
    padding: 15px;
    border: none;
    border-radius: 10px;
    background: #e2e8f0;
    text-align: right;
    font-size: 30px;
}

/* Responsive calculator layout */
@media (max-width: 400px) {
    .calculator {
        width: calc(100% - 24px);
        padding: 16px;
    }

    .buttons {
        gap: 8px;
    }

    button {
        height: 52px;
        font-size: 18px;
    }

    #display {
        height: 65px;
        font-size: 26px;
    }
}

