* {
    box-sizing: border-box;
}

body {
    margin: 0;
    block-size: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #121212, #1f1f1f);
    font-family: 'Segoe UI', sans-serif;
}

.container {
    animation: fadeIn 1s ease-in-out;
}

#calculator {
    background: #2c2c2e;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
    max-inline-size: 400px;
    inline-size: 100%;
    transition: transform 0.3s ease;
}

#calculator:hover {
    transform: scale(1.02);
}

#display {
    inline-size: 100%;
    padding: 20px;
    font-size: 2.5rem;
    background: #1e1e1f;
    border: none;
    border-radius: 10px;
    color: #fff;
    margin-block-end: 15px;
    text-align: end;
}

#keys {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

button {
    padding: 20px;
    font-size: 1.5rem;
    border: none;
    border-radius: 12px;
    background: #3c3c3f;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s ease;
}

button:hover {
    background: #555;
}

button:active {
    transform: scale(0.95);
}

.operator {
    background: #ff9f43;
}

.operator:hover {
    background: #ffa94d;
}

.equal {
    background: #00d4ff;
    grid-column: span 2;
}

.equal:hover {
    background: #00e6ff;
}

.clear {
    background: #ff4d4d;
    grid-column: span 2;
}

.clear:hover {
    background: #ff6666;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}