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

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

body {
    background-color: #dce8d0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
}

#calculator {
    display: flex;
    flex-direction: column;
    width: 260px;

    border-radius: 12px;
    padding: 20px;
    gap: 14px;
    background-color: #f4f8f0;
    box-shadow: 0 4px 20px rgba(74, 103, 65, 0.15);
}

/* ── Display ── */
#calculator-top {
    width: 100%;
}

#screen {
    background-color: #e8f0e0;
    border: 1px solid #c2d4b0;
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    min-height: 64px;
}

#display {
    font-size: 2rem;
    font-weight: 400;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Buttons ── */
#calculator-body {
    width: 100%;
}

#buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#row1, #row2, #row3, #row4, #row5 {
    display: flex;
    gap: 8px;
}

#row5 {
    justify-content: flex-end;
}

.btn {
    flex: 1;
    height: 52px;
    border: none;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    background-color: #e4eed8;
    color: #2a3d20;
    transition: background-color 100ms ease;
    user-select: none;
}

.btn:hover {
    background-color: #d8e6c8;
}

.btn:active {
    background-color: #ccddb8;
}

/* Operators */
#add, #sub, #mul, #div {
    background-color: #c8ddb0;
    color: #3a5c28;
}

#add:hover, #sub:hover, #mul:hover, #div:hover {
    background-color: #bad4a0;
}

/* Equals */
#eql {
    background-color: #5a8a3c;
    color: #ffffff;
}

#eql:hover {
    background-color: #4e7a34;
}

/* Clear */
#clear {
    background-color: #f0e8d8;
    color: #8a5c2a;
}

#clear:hover {
    background-color: #e8dcc8;
}

/* Backspace */
#backspace {
    background-color: #e4eed8;
    color: #5a7248;
}

/* Row 5 fixed-width buttons */
#row5 .btn {
    flex: 0 0 auto;
    width: 52px;
}