* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Comic Sans MS', cursive, sans-serif;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #f9f4e8;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 10h80v80H10z' fill='none' stroke='%23ddd' stroke-width='1' stroke-dasharray='5,5' stroke-linecap='round'/%3E%3C/svg%3E");
    padding: 2rem;
}

.back-button {
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    background: #fff;
    color: #333;
    border-radius: 15px;
    font-size: 1rem;
    margin-bottom: 2rem;
    transition: transform 0.2s;
    border: 3px solid #333;
    box-shadow: 4px 4px 0 #333;
}

.back-button:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #333;
}

.calculator {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 24px;
    background: #fff;
    border: 4px solid #333;
    border-radius: 20px;
    box-shadow: 8px 8px 0 #333;
    max-width: 400px;
    width: 100%;
}

.display {
    grid-column: 1 / -1;
    background: #e8f4e5;
    padding: 20px;
    margin-bottom: 15px;
    border: 3px solid #333;
    border-radius: 10px;
    text-align: right;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    word-wrap: break-word;
    word-break: break-all;
    font-family: 'Courier New', monospace;
}

.previous-operand {
    color: #666;
    font-size: 1.2rem;
    min-height: 1.5rem;
}

.current-operand {
    color: #333;
    font-size: 2.5rem;
    font-weight: bold;
}

button {
    font-family: 'Comic Sans MS', cursive, sans-serif;
    font-size: 1.25rem;
    padding: 15px;
    border: 3px solid #333;
    border-radius: 10px;
    background: #fff;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 3px 3px 0 #333;
}

button:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0 #333;
}

button:active {
    transform: translate(1px, 1px);
    box-shadow: 2px 2px 0 #333;
}

.span-two {
    grid-column: span 2;
}

.operator {
    background: #ffd6e0;
}

.equals {
    background: #c1e7ff;
}

.clear {
    background: #ffebb3;
}

.delete {
    background: #ffebb3;
}