:root {
    --bg: #f3f6fb;
    --card: #ffffff;
    --accent: #3b82f6;
    --muted: #6b7280;
    --shadow: 0 6px 20px rgba(2, 6, 23, 0.06);
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #e6eefc, var(--bg));
    font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Poppins', sans-serif;
    color: #111827;
    padding: 24px;
}

.calculator-wrap {
    width: 360px;
    max-width: 95%;
    text-align: center;
}

h1 {
    margin: 0 0 14px;
    font-size: 20px;
    color: #0f172a
}

.calculator {
    background: var(--card);
    border-radius: 14px;
    padding: 18px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.display {
    background: #0b1220;
    color: #fff;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
    text-align: right;
}

#display {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
    font-size: 28px;
    font-weight: 600;
    text-align: right;
    letter-spacing: 0.6px;
}

.preview {
    color: #c7d2fe;
    font-size: 14px;
    text-align: right;
    margin-bottom: 6px;
    opacity: 0.95;
}

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

button {
    background: #111827;
    color: #fff;
    border: 0;
    padding: 14px;
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    transition: transform .08s ease, background .10s;
    box-shadow: 0 2px 6px rgba(2, 6, 23, 0.08);
}

button:active {
    transform: translateY(2px)
}

button.op {
    background: var(--accent);
    color: #fff
}

button.wide {
    grid-column: span 2
}

button.equals {
    background: #0f172a
}

.note {
    margin-top: 12px;
    color: var(--muted);
    font-size: 13px;
}

@media (max-width:420px) {
    #display {
        font-size: 24px
    }

    button {
        padding: 12px;
        font-size: 16px
    }
}