@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@300;400;500&family=DM+Sans:wght@400;500&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f0f0f;
    font-family: 'DM Sans', sans-serif;
}

.calc {
    width: 320px;
    background: #1a1a1a;
    border-radius: 24px;
    padding: 24px;
    border: 1px solid #2a2a2a;
}

.display {
    background: #111;
    border-radius: 14px;
    padding: 20px 18px 14px;
    margin-bottom: 20px;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-end;
    gap: 6px;
    border: 1px solid #222;
}

.display .expr {
    font-family: 'DM Mono', monospace;
    font-size: 13px;
    color: #555;
    min-height: 18px;
    word-break: break-all;
    text-align: right;
}

.display .result {
    font-family: 'DM Mono', monospace;
    font-size: 36px;
    font-weight: 300;
    color: #f0f0f0;
    word-break: break-all;
    text-align: right;
    line-height: 1.1;
    transition: font-size 0.15s;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

button {
    height: 60px;
    border-radius: 12px;
    border: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 17px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.1s, filter 0.15s;
    -webkit-tap-highlight-color: transparent;
}

button:active { transform: scale(0.93); }

.btn-num {
    background: #262626;
    color: #e8e8e8;
}
.btn-num:hover { filter: brightness(1.3); }

.btn-op {
    background: #2e2e2e;
    color: #f0a500;
}
.btn-op:hover { filter: brightness(1.3); }

.btn-fn {
    background: #252525;
    color: #aaa;
    font-size: 15px;
}
.btn-fn:hover { filter: brightness(1.3); }

.btn-eq {
    background: #f0a500;
    color: #111;
}
.btn-eq:hover { filter: brightness(1.15); }

.btn-zero { grid-column: span 2; }

.kbd-hint {
    text-align: center;
    font-size: 11px;
    color: #333;
    margin-top: 16px;
    font-family: 'DM Mono', monospace;
}
