* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #0f172a;
}

.calculator {
    width: 320px;
    background-color: #1e293b;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.display {
    background-color: #0f172a;
    border-radius: 10px;
    padding: 15px;
    text-align: right;
    margin-bottom: 20px;
    min-height: 80px;
    word-wrap: break-word;
    word-break: break-all;
}

.previous-operand {
    color: #94a3b8;
    font-size: 0.9rem;
    min-height: 20px;
}

.current-operand {
    color: #ffffff;
    font-size: 2rem;
    font-weight: 600;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.btn {
    padding: 16px;
    font-size: 1.2rem;
    border: none;
    border-radius: 10px;
    background-color: #334155;
    color: #ffffff;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.btn:hover {
    background-color: #475569;
}

.btn:active {
    transform: scale(0.95);
}

.btn-action {
    background-color: #ef4444;
}

.btn-action:hover {
    background-color: #dc2626;
}

.btn-operator {
    background-color: #3b82f6;
}

.btn-operator:hover {
    background-color: #2563eb;
}

.btn-equal {
    grid-column: span 2;
    background-color: #10b981;
}

.btn-equal:hover {
    background-color: #059669;
}