* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000;
    font-family: 'Space Mono', monospace;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    position: relative;
}


.calculator {
    width: 320px;
    background: rgba(10, 10, 10, 0.75);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border-radius: 40px;
    padding: 24px;
    position: relative;
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.9),
        inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.display {
    background: #000000;
    border-radius: 24px;
    padding: 24px 20px;
    margin-bottom: 16px;
    height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-end;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.display-expression {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 4px;
    word-break: break-all;
    max-width: 100%;
    text-align: right;
    transition: all 0.15s ease;
    min-height: 18px;
    visibility: hidden;
}

.display-result {
    font-size: 48px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -2px;
    word-break: break-all;
    max-width: 100%;
    text-align: right;
    transition: all 0.15s ease;
    line-height: 1.2;
}

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

.btn {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    border: none;
    font-family: 'Space Mono', monospace;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.btn:hover::before {
    opacity: 1;
}

.btn:active {
    transform: scale(0.92);
}

.btn-number {
    background: #1c1c1e;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.btn-function {
    background: #3a3a3c;
    color: #ffffff;
}

.btn-operator {
    background: #ffffff;
    color: #000000;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

.btn-double {
    grid-column: span 2;
    aspect-ratio: auto;
    border-radius: 40px;
    justify-content: flex-start;
    padding-left: 28px;
}

@keyframes press {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.btn.pressed {
    animation: press 0.15s ease;
}

@media (max-width: 360px) {
    .calculator {
        width: 100%;
        border-radius: 0;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .btn {
        width: 60px;
        height: 60px;
    }
    
    .btn-double {
        width: 130px;
    }
}

@keyframes press {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.btn.pressed {
    animation: press 0.15s ease;
}

@media (max-width: 400px) {
    .calculator {
        width: 100%;
        border-radius: 0;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}
