* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: radial-gradient(circle, #2e3440, #1a1c23);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Prevents scrolling */
}

.calculator {
    width: 90%;
    max-width: 400px;
    height: 85vh; /* Fits neatly on mobile screens */
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

.display {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-around;
    word-wrap: break-word;
    word-break: break-all;
    padding: 10px;
    margin-bottom: 20px;
}

#previous-operand {
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.2rem;
}

#current-operand {
    color: white;
    font-size: 3rem;
    font-weight: 300;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 12px;
    flex: 3;
}

button {
    cursor: pointer;
    font-size: 1.5rem;
    border: none;
    outline: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transition: 0.2s;
}

button:active { transform: scale(0.95); }
button:hover { background: rgba(255, 255, 255, 0.2); }

.operator { color: #81a1c1; font-weight: bold; }
.control { color: #bf616a; }
.equals { background: #88c0d0; color: #2e3440; }
.equals:hover { background: #a3be8c; }

.span-two { grid-column: span 2; }