* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #020617 100%);
    color: #f8fafc;
}

.calculator {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 28px;
    padding: 28px;
    width: 440px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.display {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 28px;
    text-align: right;
    box-shadow: inset 0 4px 15px rgba(0, 0, 0, 0.5);
    height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-all;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.previous-operand {
    color: #94a3b8;
    font-size: 1.1rem;
    min-height: 1.3rem;
    font-weight: 400;
}

.current-operand {
    font-size: 2.8rem;
    font-weight: 600;
    color: #f8fafc;
    line-height: 1.1;
    letter-spacing: 0.5px;
}

.keypad {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    border-radius: 16px;
    font-size: 1.15rem;
    padding: 18px 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.05);
    color: #f8fafc;
    font-weight: 500;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.02);
}

button:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.number {
    background: rgba(255, 255, 255, 0.08);
}

.number:hover {
    background: rgba(255, 255, 255, 0.15);
}

.function {
    background: rgba(129, 140, 248, 0.15);
    color: #a5b4fc;
    font-size: 1rem;
}

.function:hover {
    background: rgba(129, 140, 248, 0.25);
}

.operator {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    font-size: 1.4rem;
    font-weight: 600;
}

.operator:hover {
    background: rgba(245, 158, 11, 0.25);
}

.action {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    font-weight: 600;
}

.action:hover {
    background: rgba(239, 68, 68, 0.25);
}

.equals {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    font-weight: 600;
    font-size: 1.4rem;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    border: none;
}

.equals:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

@media (max-width: 500px) {
    .calculator {
        width: 95%;
        padding: 20px;
    }
    
    button {
        padding: 14px 0;
        font-size: 1rem;
    }
    
    .current-operand {
        font-size: 2.2rem;
    }
    
    .display {
        height: 100px;
    }
}
