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

.container {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #000;
    overflow: hidden;
}

.background {
    position: relative;
    width: 550px;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.background img {
    width: 100%;
    height: 100%;
    object-fit: fill;
}

.main-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    max-width: 550px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.text {
    position: absolute;
    top: 18%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.text img {
    width: 100%;
    height: 100%;
    max-width: 300px;
    object-fit: cover;
}

.backframe {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.backframe img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.reward-wrapper {
    position: absolute;
    top: 53%;
    right: 3%;          /* ផ្លាស់ប្តូរពី left: 100% មកប្រើ right: 0 ដើម្បីឱ្យវាជាប់គែមខាងស្តាំ */
    transform: translateY(-50%);
    width: 195px;      /* បង្ហាញទំហំតែពាក់កណ្តាល (390px / 2) */
    height: 390px;
    overflow: hidden;  /* លាក់ផ្នែកពាក់កណ្តាលខាងឆ្វេង */
    z-index: 5; 
}

.reward {
    position: absolute;
    top: 0;
    left: -200px; /* Offset to align center pivot perfectly with wrapper's left edge */
    width: 390px;
    height: 390px;
    transition: transform 0.5s ease-out;
    transform-origin: center center; /* Enforces pivot point stay fixed */
}

.reward img {
    width: 390px;
    height: 390px;
    object-fit: contain;
    margin-left: 0; /* Clear previous offset conflict */
}


.frame {
    position: absolute;
    top: 50%;
    left: 36%;
    transform: translate(-50%, -50%);
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.frame img {
    width: 70%;
    height: 70%;
    object-fit: cover;
}

.buttonPlay {
    position: absolute;
    top: 85%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.buttonPlay img {
    width: 100%;
    height: 100%;
    max-width: 300px;
    object-fit: cover;
    cursor: pointer;
}
/* Popup styles */
.popoutwin1 {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
}

.popoutwin1.active {
    display: flex;
    animation: fadeIn 0.5s ease-out;
}

.image-win {
    width: 100%;
    max-width: 500px;
    margin-top: 220px; /* Shift content down */
    text-align: center;
}

.image-win img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.5));
}

.buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-top: 130px;
}

.buttons img {
    width: 200px;
    cursor: pointer;
}
/* Popoutwin2 style */
.popoutwin2 {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
}

.popoutwin2.active {
    display: flex;
}

@media (max-width: 430px) {
    .container {
        width: 100%;
        height: 100vh;

        overflow: hidden;
    }

    .background {
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    .main-content {
        width: 100%;
        height: 100%;
        max-width: 100%;
    }

    .reward-wrapper {
        position: absolute;
        top: 53%;
        right: -3%;          /* ផ្លាស់ប្តូរពី left: 100% មកប្រើ right: 0 ដើម្បីឱ្យវាជាប់គែមខាងស្តាំ */
        transform: translateY(-50%);
        width: 190px;      /* បង្ហាញទំហំតែពាក់កណ្តាល (390px / 2) */
        height: 300px;
        overflow: hidden;  /* លាក់ផ្នែកពាក់កណ្តាលខាងឆ្វេង */
        z-index: 5; 
    }
    .reward {
        position: absolute;
        top: 0;
        left: -110px; /* Offset to align center pivot perfectly with wrapper's left edge */
        width: 280px;
        height: 280px;
        transition: transform 0.5s ease-out;
        transform-origin: center center; 
    }
    .reward img {
        width:100%;
        height: 100%;
        object-fit: fill;
        margin-left: 0; /* Clear previous offset conflict */
    }
        
    .buttons {
        display: flex;
        gap: 15px;
        justify-content: center;
        align-items: center;
        margin-top: 30px;
    }

    .buttons img {
        width: 180px;
        cursor: pointer;
    }
    
}
@media (max-width: 390px) {
    .reward-wrapper {
        position: absolute;
        top: 53%;
        right: -1%;          /* ផ្លាស់ប្តូរពី left: 100% មកប្រើ right: 0 ដើម្បីឱ្យវាជាប់គែមខាងស្តាំ */
        transform: translateY(-50%);
        width: 150px;      /* បង្ហាញទំហំតែពាក់កណ្តាល (390px / 2) */
        height: 250px;
        overflow: hidden;  /* លាក់ផ្នែកពាក់កណ្តាលខាងឆ្វេង */
        z-index: 5; 
    }
    .reward {
        position: absolute;
        top: 0;
        left: -120px; /* Offset to align center pivot perfectly with wrapper's left edge */
        width: 250px;
        height: 250px;
        transition: transform 0.5s ease-out;
        transform-origin: center center; 
    }
    .reward img {
        width:100%;
        height: 100%;
        object-fit: fill;
        margin-left: 0; /* Clear previous offset conflict */
    }
    
}
