* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.calculator {
    width: 100%;
    max-width: 400px;
    background: #222;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.display {
    background: #333;
    color: #fff;
    font-size: 3.5rem;
    font-weight: 300;
    text-align: right;
    padding: 30px 25px;
    min-height: 120px;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    word-break: break-all;
}

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

button {
    border: none;
    font-size: 1.8rem;
    font-weight: 400;
    padding: 25px;
    cursor: pointer;
    transition: all 0.1s ease;
}

button:active {
    opacity: 0.7;
}

.btn-num {
    background: #6b6b6b;
    color: #fff;
}

.btn-num:hover {
    background: #7a7a7a;
}

.btn-func {
    background: #5a5a5a;
    color: #fff;
}

.btn-func:hover {
    background: #6a6a6a;
}

.btn-op {
    background: #ff9f0a;
    color: #fff;
}

.btn-op:hover {
    background: #ffb340;
}

.span-2 {
    grid-column: span 2;
}

@media (max-width: 420px) {
    .calculator {
        border-radius: 0;
        max-width: 100%;
    }
    
    .display {
        font-size: 2.8rem;
        padding: 25px 20px;
        min-height: 100px;
    }
    
    button {
        font-size: 1.5rem;
        padding: 22px;
    }
}
