body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background: linear-gradient(45deg, #1a1a1a, #2d2d2d);
    font-family: 'Segoe UI', sans-serif;
}

.calculator {
    background: #333;
    border-radius: 20px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    padding: 20px;
    width: 320px;
}

.display {
    background: #222;
    color: #fff;
    font-size: 2.5em;
    padding: 20px;
    text-align: right;
    border-radius: 10px;
    margin-bottom: 20px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-height: 1.2em;
}

.display.error {
    color: #ff453a;
    animation: error-shake 0.4s;
}

@keyframes error-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

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

button {
    background: #444;
    border: none;
    color: white;
    padding: 20px;
    font-size: 1.2em;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

button:hover {
    background: #555;
}

.operator {
    background: #ff9500;
}

.operator:hover {
    background: #ffaa33;
}

.clear {
    background: #ff3b30;
}

.clear:hover {
    background: #ff453a;
}

.equals {
    background: #34c759;
}

.equals:hover {
    background: #30d158;
}

.zero {
    grid-column: span 2;
}
