* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #0f172a;
    font-family: "Inter", Arial, sans-serif;
}

/* Calculator */

.calculator {
    width: 340px;
    padding: 22px;
    background: #111827;
    border: 1px solid #263244;
    border-radius: 24px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
}

/* Display */

#display {
    width: 100%;
    height: 85px;
    margin-bottom: 18px;
    padding: 15px;
    border: none;
    border-radius: 16px;
    outline: none;

    background: #0b1220;
    color: #f8fafc;

    font-size: 34px;
    font-weight: 500;
    text-align: right;

    box-shadow: inset 0 0 0 1px #1e293b;
}

/* Buttons */

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

button {
    height: 62px;
    border: none;
    border-radius: 14px;

    background: #1e293b;
    color: #f8fafc;

    font-size: 18px;
    font-weight: 600;

    cursor: pointer;
    transition: all 0.15s ease;
}

button:hover {
    background: #334155;
    transform: translateY(-2px);
}

button:active {
    transform: scale(0.96);
}

/* Clear */

button:first-child {
    background: #7f1d1d;
    color: #fecaca;
}

button:first-child:hover {
    background: #991b1b;
}

/* Delete */

button:nth-child(2) {
    background: #3f1d1d;
    color: #fca5a5;
}

button:nth-child(2):hover {
    background: #5b2222;
}

/* Operators */

button:nth-child(3),
button:nth-child(4),
button:nth-child(8),
button:nth-child(12) {
    background: #1d4ed8;
    color: white;
}

button:nth-child(3):hover,
button:nth-child(4):hover,
button:nth-child(8):hover,
button:nth-child(12):hover {
    background: #2563eb;
}

/* Equals */

button:nth-child(16) {
    background: #2563eb;
    color: white;
    grid-row: span 2;
    height: 134px;
}

button:nth-child(16):hover {
    background: #3b82f6;
}

/* Zero */

.zero {
    grid-column: span 2;
}

/* Decimal */

button:last-child {
    background: #1e293b;
}

/* Mobile */

@media (max-width: 400px) {

    .calculator {
        width: 92%;
        padding: 18px;
    }

    #display {
        height: 75px;
        font-size: 28px;
    }

    button {
        height: 58px;
    }

    button:nth-child(16) {
        height: 126px;
    }
}