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

body {
    /* Moving Gradient Background */
    background: linear-gradient(-45deg, #1e3c72, #2a5298, #0f2027, #203a43);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-family: 'Poppins', sans-serif;
    overflow: hidden;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* --- Floating Background Icons --- */
.bg-animation {
    position: fixed;
    /* Poori screen cover karne ke liye */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.bg-animation i {
    position: absolute;
    bottom: -100px;
    /* Screen ke niche se start honge */
    color: rgba(255, 255, 255, 0.15);
    /* Halka white color */
    font-size: 40px;
    animation: floatUp 12s linear infinite;
}

/* Har icon ki alag position aur speed */
.bg-animation i:nth-child(1) {
    left: 5%;
    animation-duration: 10s;
    animation-delay: 0s;
}

.bg-animation i:nth-child(2) {
    left: 15%;
    animation-duration: 14s;
    animation-delay: 2s;
}

.bg-animation i:nth-child(3) {
    left: 25%;
    animation-duration: 11s;
    animation-delay: 5s;
}

.bg-animation i:nth-child(4) {
    left: 35%;
    animation-duration: 16s;
    animation-delay: 1s;
}

.bg-animation i:nth-child(5) {
    left: 45%;
    animation-duration: 13s;
    animation-delay: 7s;
}

.bg-animation i:nth-child(6) {
    left: 55%;
    animation-duration: 15s;
    animation-delay: 3s;
}

.bg-animation i:nth-child(7) {
    left: 65%;
    animation-duration: 12s;
    animation-delay: 6s;
}

.bg-animation i:nth-child(8) {
    left: 75%;
    animation-duration: 14s;
    animation-delay: 0s;
}

.bg-animation i:nth-child(9) {
    left: 85%;
    animation-duration: 11s;
    animation-delay: 4s;
}

.bg-animation i:nth-child(10) {
    left: 95%;
    animation-duration: 17s;
    animation-delay: 2s;
}

/* Niche se oopar jaane ki animation */
@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-110vh) rotate(720deg);
        opacity: 0;
    }
}

/* --- Main Container --- */
.container {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 40px 30px;
    border-radius: 30px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 90%;
    max-width: 450px;
    z-index: 1;
}

h1 {
    font-size: clamp(1.8rem, 6vw, 2.5rem);
    margin-bottom: 20px;
    text-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.dice-container {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin: 40px 0;
}

.result i {
    font-size: clamp(70px, 18vw, 110px);
    color: #f1c40f;
    /* Gold color for dice */
    filter: drop-shadow(0 0 20px rgba(241, 196, 15, 0.4));
    transition: 0.3s;
}

/* --- Buttons --- */
.button-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 15px;
    font-size: 15px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    background: #ff4757;
    color: white;
    font-weight: bold;
    flex: 1 1 140px;
    box-shadow: 0 5px 15px rgba(255, 71, 87, 0.3);
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 71, 87, 0.5);
    background: #ff6b81;
}

.btn-both {
    background: #2ed573;
    box-shadow: 0 5px 15px rgba(46, 213, 115, 0.3);
    flex: 1 1 100%;
}

.btn-both:hover {
    background: #55efc4;
    box-shadow: 0 8px 20px rgba(46, 213, 115, 0.5);
}

/* Dice Rolling Animation */
.rolling {
    animation: bounceAndSpin 0.5s ease-in-out infinite;
}

@keyframes bounceAndSpin {
    0% {
        transform: scale(1) rotate(0deg);
    }

    50% {
        transform: scale(1.2) rotate(180deg);
    }

    100% {
        transform: scale(1) rotate(360deg);
    }
}

footer {
    margin-top: 40px;
    font-size: 14px;
    letter-spacing: 1px;
}

/* Mobile Responsive */
@media (max-width: 350px) {
    .container {
        padding: 20px 15px;
    }

    .result i {
        font-size: 60px;
    }
}