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

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

body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background:
        radial-gradient(circle at top, #2b2b50, #121220 60%),
        #0f0f18;
    font-family: 'Inter', sans-serif;
    padding: 1rem;
    color: white;
}

.container {
    width: 100%;
    max-width: 430px;
}

.heading {
    text-align: center;
    margin-bottom: 1.5rem;
}

.heading h1 {
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    font-weight: 700;
    letter-spacing: 0.05rem;
}

.heading p {
    margin-top: 0.4rem;
    color: rgba(255,255,255,0.7);
    font-size: 0.95rem;
}

.calc {
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 2rem;
    padding: 1.2rem;
    box-shadow:
        0 20px 50px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.1);
}

.display-section {
    background: rgba(0,0,0,0.35);
    border-radius: 1.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mini-display {
    min-height: 24px;
    text-align: right;
    color: rgba(255,255,255,0.6);
    margin-bottom: 0.5rem;
    word-break: break-all;
    font-size: 0.95rem;
}

.display-section input {
    width: 100%;
    border: none;
    background: transparent;
    color: white;
    font-size: clamp(2rem, 6vw, 3rem);
    text-align: right;
    outline: none;
    font-weight: 600;
}

.buttons-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
}

.btn {
    height: 72px;
    border: none;
    border-radius: 1.2rem;
    font-size: 1.3rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    color: white;
    background: rgba(255,255,255,0.08);
    box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 8px 15px rgba(0,0,0,0.18);
}

.btn:hover {
    transform: translateY(-2px);
    background: rgba(255,255,255,0.15);
}

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

.operator {
    background: linear-gradient(135deg, #ff8a00, #ff5e00);
}

.equal {
    background: linear-gradient(135deg, #00b894, #00cec9);
}

.function {
    background: linear-gradient(135deg, #5f27cd, #341f97);
}

.zero {
    grid-column: span 1;
}

.keyboard-info {
    text-align: center;
    margin-top: 1rem;
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    line-height: 1.5;
}

@media (max-width: 520px) {
    body {
        padding: 0.6rem;
        align-items: flex-start;
        padding-top: 2rem;
    }

    .calc {
        padding: 1rem;
        border-radius: 1.6rem;
    }

    .btn {
        height: 62px;
        border-radius: 1rem;
        font-size: 1.1rem;
    }

    .display-section {
        min-height: 90px;
    }

    .display-section input {
        font-size: 2.2rem;
    }
}

@media (max-width: 380px) {
    .buttons-grid {
        gap: 0.6rem;
    }

    .btn {
        height: 56px;
        font-size: 1rem;
    }

    .display-section input {
        font-size: 1.8rem;
    }
}
