body {
    font-family: 'Inter', sans-serif;
    background-color: #1a202c;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

.calculator {
    background-color: #2d3748;
    border-radius: 1.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 10px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 360px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.display {
    background-color: #1a202c;
    color: #e2e8f0;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    text-align: right;
    font-size: 2.5rem;
    font-weight: 300;
    min-height: 80px;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    word-break: break-all;
    overflow: hidden;
}

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

.calc-button {
    background-color: #4a5568;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 1rem;
    font-size: 1.5rem;
    font-weight: 500;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    user-select: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.calc-button:hover {
    background-color: #6a7a90;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.calc-button:active {
    background-color: #3b4252;
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.calc-button.operator {
    background-color: #d69e2e;
    color: #1a202c;
}

.calc-button.operator:hover {
    background-color: #ed8936;
}

.calc-button.operator:active {
    background-color: #c05621;
}

.calc-button.equals {
    background-color: #38a169;
    grid-column: span 2;
    color: #1a202c;
}

.calc-button.equals:hover {
    background-color: #48bb78;
}

.calc-button.equals:active {
    background-color: #2f855a;
}

.calc-button.clear, .calc-button.backspace {
    background-color: #c53030;
    color: #e2e8f0;
}

.calc-button.clear:hover, .calc-button.backspace:hover {
    background-color: #e53e3e;
}

.calc-button.clear:active, .calc-button.backspace:active {
    background-color: #9b2c2c;
}

@media (max-width: 400px) {
    .calculator {
        padding: 1rem;
        border-radius: 1rem;
    }
    .display {
        font-size: 2rem;
        min-height: 70px;
    }
    .calc-button {
        font-size: 1.25rem;
        padding: 0.75rem;
        border-radius: 0.75rem;
    }
    .buttons-grid {
        gap: 0.5rem;
    }
}