* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #f5f5f5;
    padding: 2rem;
}

.back-button {
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    background: #6200ee;
    color: white;
    border-radius: 4px;
    font-size: 1rem;
    margin-bottom: 2rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.back-button:hover {
    background: #3700b3;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.ripple {
    position: relative;
    overflow: hidden;
    transform: translate3d(0, 0, 0);
}

.ripple:after {
    content: "";
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, #fff 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform .5s, opacity 1s;
}

.ripple:active:after {
    transform: scale(0, 0);
    opacity: .3;
    transition: 0s;
}

.calculator {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 24px;
    border-radius: 8px;
    background: white;
    box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
    width: 100%;
    max-width: 400px;
}

.display {
    grid-column: 1 / -1;
    background: #fafafa;
    padding: 24px;
    margin-bottom: 12px;
    border-radius: 4px;
    text-align: right;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    word-wrap: break-word;
    word-break: break-all;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.previous-operand {
    color: #757575;
    font-size: 1.2rem;
    min-height: 1.5rem;
}

.current-operand {
    color: #212121;
    font-size: 2.5rem;
    font-weight: 500;
}

button {
    font-size: 1.25rem;
    padding: 16px;
    border: none;
    background: #e0e0e0;
    color: #212121;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

button:hover {
    background: #bdbdbd;
}

button:active {
    background: #9e9e9e;
}

button[data-operation] {
    background: #03dac6;
    color: white;
}

button[data-operation]:hover {
    background: #018786;
}

button[data-equals] {
    background: #6200ee;
    color: white;
}

button[data-equals]:hover {
    background: #3700b3;
}

button[data-action="clear"],
button[data-action="delete"] {
    background: #cf6679;
    color: white;
}

button[data-action="clear"]:hover,
button[data-action="delete"]:hover {
    background: #b00020;
}

.span-two {
    grid-column: span 2;
}

@media (max-width: 480px) {
    .calculator {
        padding: 16px;
        gap: 8px;
    }

    button {
        padding: 12px;
        font-size: 1.1rem;
    }

    .display {
        padding: 16px;
    }

    .current-operand {
        font-size: 2rem;
    }
}