html {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(165deg,#0f0c29,#6159bb,#20002c);
    overflow: hidden;
    position: relative;
}

/* Stars container */
.stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

/* Single star (duplicated for multiple stars) */
.star {
    position: absolute;
    background-color: white;
    border-radius: 50%;
    animation: twinkle 3s infinite ease-in-out alternate, move 15s linear infinite;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

/* Keyframes for twinkling */
@keyframes twinkle {
    0% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Keyframes for moving stars (optional) */
@keyframes move {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-200px);
    }
}


/* Calculator container */
.calculator {
    background: linear-gradient(145deg, #d4d4d4, #ffffff); /* Background gradient */
    width: 400px;
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5); /* Shadow around the container */
    z-index: 2;
    transform: scale(0); /* Start in a scaled-down state */
    transform-origin: center; /* Keep the scaling centered */
    animation: popUp 0.6s ease-out forwards; /* Animate the pop-up effect */
}

@keyframes popUp {
    0% {
        transform: scale(0); /* Start with small size */
        opacity: 0; /* Start as invisible */
    }
    100% {
        transform: scale(1); /* Grow to normal size */
        opacity: 1; /* Fade in fully */
    }
}

/* Display */
.calculator-display {
    background: black;
    color: white;
    margin: 0;
    display: flex;
    justify-content: flex-end;
    border-radius: 12px 12px 0 0;
}

.calculator-display h1 {
    margin: 0;
    padding: 25px;
    font-size: 45px;
    font-family: "Lucida Console", sans-serif;
    font-weight: 100;
    overflow-x: auto;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
background: #888;
}

::-webkit-scrollbar-thumb:hover {
background: #555;
}

/* Buttons */
.calculator-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 10px;
}

button {
    min-height: 50px;
    font-size: 20px;
    font-weight: 100;
    border: none;
    cursor: pointer;
    background: rgb(199, 199, 199);
    background: linear-gradient(145deg, #d4d4d4, #f0f0f0);
    border-radius: 8px;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.4), -3px -3px 10px rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
    transform-style: preserve-3d;
}

button:hover {
    filter: brightness(110%);
}

button:active {
    transform: translateY(1px);
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.5), inset -2px -2px 5px rgba(255, 255, 255, 0.2);

}

button:focus {
    outline: none;
}

.operator {
    background: linear-gradient(145deg, #888, #555);
    color: white;
    font-size: 30px;
}

.clear {
    background:rgb(253, 40, 40);
    color: white;
}

.clear:hover {
    filter: brightness(90%);
}

.equal-sign {
    grid-column: -2;
    grid-row: 2 / span 4;
    background: rgb(13, 206, 71);
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.3), -3px -3px 10px rgba(255, 255, 255, 0.5);
    font-weight: bold;
    font-size: 25px;
}
