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

body {
    font-family: 'Arial', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

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

.calculator h2 {
    text-align: center;
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.display {
    background: #f0f0f0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: right;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.display-history {
    font-size: 0.9rem;
    color: #888;
    min-height: 20px;
}

.display-current {
    font-size: 2rem;
    color: #333;
    font-weight: bold;
    word-break: break-all;
}

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

button {
    padding: 20px;
    font-size: 1.5rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

button:hover {
    transform: scale(1.05);
}

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

.btn-number {
    background: #f5f5f5;
    color: #333;
}

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

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

.btn-operator:hover {
    background: #5568d3;
}

.btn-clear {
    background: #f44336;
    color: white;
    grid-column: span 2;
}

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

.btn-equals {
    background: #4CAF50;
    color: white;
    grid-column: span 2;
}

.btn-equals:hover {
    background: #45a049;
}