* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(to right, #b06ee9, #340c83, #a464dc);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.calculator-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.calculator {
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 45px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.display {
    background-color: rgba(0, 0, 0, 0.75);
    color: white;
    text-align: right;
    padding: 20px;
    font-size: 2rem;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    word-wrap: break-word;
    word-break: break-all;
}

.previous-operand {
    color: rgba(255, 255, 255, 0.75);
    font-size: 1.2rem;
    min-height: 1.5rem;
}

.current-operand {
    font-size: 2.5rem;
    font-weight: 300;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background-color: rgba(0, 0, 0, 0.1);
}

button {
    border: none;
    outline: none;
    background-color: rgba(255, 255, 255, 0.9);
    font-size: 1.5rem;
    padding: 1.5rem 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

button:hover {
    background-color: rgba(255, 255, 255, 1);
}

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

.span-two {
    grid-column: span 2;
}

.operator {
    background-color: rgba(255, 255, 255, 0.75);
    color: #4a00e0;
    font-weight: bold;
}

.equals {
    background-color: #4a00e0;
    color: white;
}

.clear, .delete {
    background-color: rgba(255, 255, 255, 0.75);
    color: #e74c3c;
}

@media (max-width: 480px) {
    .calculator-container {
        padding: 10px;
    }
    
    .display {
        padding: 15px;
        min-height: 100px;
    }
    
    .current-operand {
        font-size: 2rem;
    }
    
    button {
        font-size: 1.2rem;
        padding: 1.2rem 0;
    }
}

@media (max-width: 320px) {
    button {
        font-size: 1rem;
        padding: 1rem 0;
    }
    
    .display {
        padding: 10px;
        min-height: 80px;
    }
    
    .current-operand {
        font-size: 1.5rem;
    }
}