* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #f0f0f0;
    padding: 2rem;
}

.back-button {
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    background: #de0000;
    color: white;
    font-weight: bold;
    border: none;
    margin-bottom: 2rem;
    transition: transform 0.2s;
    clip-path: polygon(0 0, 100% 0, 100% 70%, 90% 100%, 0 100%);
}

.back-button:hover {
    transform: translateY(-2px);
}

.calculator {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 24px;
    background: white;
    border-left: 8px solid #de0000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    width: 100%;
}

.display {
    grid-column: 1 / -1;
    background: #f0f0f0;
    padding: 24px;
    margin-bottom: 12px;
    text-align: right;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    word-wrap: break-word;
    word-break: break-all;
    border-bottom: 4px solid #1d1d1d;
}

.previous-operand {
    color: #666;
    font-size: 1.2rem;
    min-height: 1.5rem;
}

.current-operand {
    color: #1d1d1d;
    font-size: 2.5rem;
    font-weight: bold;
}

button {
    font-size: 1.25rem;
    padding: 20px;
    border: none;
    background: #f0f0f0;
    color: #1d1d1d;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: bold;
}

button:hover {
    transform: translateY(-2px);
}

.operator {
    background: #1d87e4;
    color: white;
}

.equals {
    background: #de0000;
    color: white;
}

.clear, .delete {
    background: #1d1d1d;
    color: white;
}

.span-two {
    grid-column: span 2;
}

.number {
    background: #f0f0f0;
    position: relative;
    overflow: hidden;
}

.number::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: #ffb100;
    transform: translateX(-100%);
    transition: transform 0.2s;
}

.number:hover::after {
    transform: translateX(0);
}