@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', Arial, Helvetica, sans-serif;
}

body {
    width: 100%;
    height: 100vh;
    display: grid;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    overflow: hidden;
}

/* Animated background orbs */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.25;
    pointer-events: none;
    animation: float 8s ease-in-out infinite alternate;
}
body::before {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #a855f7, #6366f1);
    top: -100px;
    left: -100px;
}
body::after {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, #f43f5e, #fb923c);
    bottom: -100px;
    right: -100px;
    animation-delay: -4s;
}

@keyframes float {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(30px, 20px) scale(1.1); }
}

/* ─── Calculator shell ─── */
.calculator {
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 24px 20px 20px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255,255,255,0.06) inset;
    animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* ─── Display ─── */
input {
    width: 319px;
    border: none;
    padding: 16px 20px;
    margin: 0 0 16px 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 42px;
    font-weight: 300;
    letter-spacing: 1px;
    text-align: right;
    cursor: default;
    color: #ffffff;
    outline: none;
    transition: background 0.2s;
    user-select: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* ─── Button rows ─── */
.btn-row {
    display: flex;
    justify-content: center;
}

/* ─── Buttons ─── */
button {
    border: none;
    width: 66px;
    height: 66px;
    margin: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.09);
    color: #e2e8f0;
    font-size: 22px;
    font-weight: 400;
    cursor: pointer;
    transition:
        background 0.18s ease,
        transform   0.12s ease,
        box-shadow  0.18s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    position: relative;
    overflow: hidden;
}

button::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    opacity: 0;
    transition: opacity 0.15s;
}

button:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.35);
}
button:hover::after { opacity: 1; }

button:active {
    transform: scale(0.92);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ─── Operator buttons ─── */
.operator {
    color: #a78bfa;
    font-weight: 600;
    background: rgba(167, 139, 250, 0.1);
    border-color: rgba(167, 139, 250, 0.2);
}
.operator:hover {
    background: rgba(167, 139, 250, 0.22);
}

/* ─── Decimal dot ─── */
.op {
    color: #94a3b8;
    font-size: 32px;
}

/* ─── Equals button ─── */
.equalbtn {
    background: linear-gradient(135deg, #f97316, #ef4444);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.45);
}
.equalbtn:hover {
    background: linear-gradient(135deg, #fb923c, #f87171);
    box-shadow: 0 8px 28px rgba(249, 115, 22, 0.55);
}
.equalbtn:active {
    box-shadow: 0 2px 10px rgba(249, 115, 22, 0.4);
}