* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.calculator {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 25px;
    width: 100%;
    max-width: 320px;
}

.display {
    background: #2d3748;
    color: #fff;
    font-size: 2.5rem;
    padding: 20px;
    border-radius: 10px;
    text-align: right;
    margin-bottom: 20px;
    min-height: 80px;
    overflow-x: auto;
    word-break: break-all;
}

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

.btn {
    padding: 20px;
    font-size: 1.25rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-number {
    background: #f7fafc;
    color: #2d3748;
}

.btn-number:hover {
    background: #edf2f7;
}

.btn-operator {
    background: #667eea;
    color: #fff;
}

.btn-operator:hover {
    background: #5a67d8;
}

.btn-clear {
    background: #fc8181;
    color: #fff;
}

.btn-clear:hover {
    background: #f56565;
}

.btn-equals {
    background: #48bb78;
    color: #fff;
    grid-column: span 1;
}

.btn-equals:hover {
    background: #38a169;
}

.btn[data-action="decimal"] {
    background: #e2e8f0;
    color: #2d3748;
}

@media (max-width: 400px) {
    .calculator {
        padding: 15px;
    }
    
    .display {
        font-size: 2rem;
        padding: 15px;
    }
    
    .btn {
        padding: 15px;
        font-size: 1.1rem;
    }
}
