/* ============================================================
   Mid-Autumn / Mooncake Festival Theme
   Active window: 2026-09-22 12:00 - 2026-09-28 00:00 (visitor local browser time)
   All rules below (except @keyframes) are scoped under body.mooncake-theme-active,
   which is toggled on/off by an inline date-check script in template.master.
   This means the theme automatically and harmlessly reverts to normal once the
   window ends, with no further manual action needed.

   Note: the falling bunny icons (.snowflake) are DECORATIVE ONLY - they are not
   clickable. The reference "click bunny to open reward" mini-game (.rp-modal /
   .rp-* rules and markup) has been intentionally dropped from this integration.
   ============================================================ */

body.mooncake-theme-active .mooncake_bg{
    background: url(../images/mooncake_festival_theme/background.webp) no-repeat center center / cover;
    background-size: cover;
    background-position: right top;
    /* background-attachment: fixed; */
}

body.mooncake-theme-active .mooncake_header{
    background: url(../images/mooncake_festival_theme/header-bg.webp);
    border-bottom: 1px solid #000000;
}

/* swap default logo for the festive one only while the theme is active */
/* base state: festive logo hidden by default (not scoped, so it always applies -
   an inline style="display:none" would have beaten a scoped rule here, so this
   toggle is done purely through the stylesheet cascade instead) */
.mooncake-logo-festive {
    display: none;
}

body.mooncake-theme-active .mooncake-logo-default {
    display: none;
}

body.mooncake-theme-active .mooncake-logo-festive {
    display: inline-block;
}

body.mooncake-theme-active .snowflake {
    color: #fff;
    font-size: 1em;
    font-family: Arial;
    text-shadow: 0 0 1px #000;
}

@-webkit-keyframes snowflakes-fall {
    0% {
        top: -10%
    }

    100% {
        top: 100%
    }
}

@-webkit-keyframes snowflakes-shake {
    0% {
        -webkit-transform: translateX(0px);
        transform: translateX(0px)
    }

    50% {
        -webkit-transform: translateX(80px);
        transform: translateX(80px)
    }

    100% {
        -webkit-transform: translateX(0px);
        transform: translateX(0px)
    }
}

@keyframes snowflakes-fall {
    0% {
        top: -10%
    }

    100% {
        top: 100%
    }
}

@keyframes snowflakes-shake {
    0% {
        transform: translateX(0px)
    }

    50% {
        transform: translateX(80px)
    }

    100% {
        transform: translateX(0px)
    }
}

body.mooncake-theme-active .snowflake {
    position: fixed;
    top: -10%;
    z-index: 1020;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    cursor: default;
    pointer-events: none;
    appearance: none;
    -webkit-appearance: none;
    background: none;
    border: 0;
    padding: 0;
    animation-name: snowflakes-fall, snowflakes-shake;
    animation-duration: 10s, 3s;
    animation-timing-function: linear, ease-in-out;
    animation-iteration-count: infinite, infinite;
    animation-play-state: running, running;
}

body.mooncake-theme-active .snowflake:nth-of-type(0) {
    left: 1%;
    -webkit-animation-delay: 0s, 1s;
    animation-delay: 0s, 1s
}

body.mooncake-theme-active .snowflake:nth-of-type(1) {
    left: 5%;
    -webkit-animation-delay: 1s, 1s;
    animation-delay: 1s, 1s
}

body.mooncake-theme-active .snowflake:nth-of-type(2) {
    left: 8%;
    -webkit-animation-delay: 2s, .1s;
    animation-delay: 2s, .1s
}

body.mooncake-theme-active .snowflake:nth-of-type(3) {
    left: 4%;
    -webkit-animation-delay: 4s, 3s;
    animation-delay: 4s, 3s
}

body.mooncake-theme-active .snowflake:nth-of-type(4) {
    left: 1%;
    -webkit-animation-delay: 8s, 4s;
    animation-delay: 8s, 4s
}

body.mooncake-theme-active .snowflake:nth-of-type(5) {
    left: 5%;
    -webkit-animation-delay: 5s, 2s;
    animation-delay: 5s, 2s
}

body.mooncake-theme-active .snowflake:nth-of-type(6) {
    left: 8%;
    -webkit-animation-delay: 6s, 2s;
    animation-delay: 6s, 2s
}

body.mooncake-theme-active .snowflake:nth-of-type(7) {
    left: 80%;
    -webkit-animation-delay: 4s, 1s;
    animation-delay: 4s, 1s
}

body.mooncake-theme-active .snowflake:nth-of-type(8) {
    left: 85%;
    -webkit-animation-delay: 1s, 0s;
    animation-delay: 1s, 0s
}

body.mooncake-theme-active .snowflake:nth-of-type(9) {
    left: 90%;
    -webkit-animation-delay: 3s, 3s;
    animation-delay: 3s, 3s
}

body.mooncake-theme-active .snowflake:nth-of-type(10) {
    left: 95%;
    -webkit-animation-delay: 1s, 1.5s;
    animation-delay: 1s, 1.5s
}

body.mooncake-theme-active .snowflake:nth-of-type(11) {
    left: 80%;
    -webkit-animation-delay: 6s, 3s;
    animation-delay: 6s, 3s
}

body.mooncake-theme-active .snowflake:nth-of-type(12) {
    left: 85%;
    -webkit-animation-delay: 2s, 4s;
    animation-delay: 2s, 4s
}

body.mooncake-theme-active .snowflake:nth-of-type(13) {
    left: 90%;
    -webkit-animation-delay: 8s, 2s;
    animation-delay: 8s, 2s
}

body.mooncake-theme-active .snowflake:nth-of-type(14) {
    left: 95%;
    -webkit-animation-delay: 5s, 2s;
    animation-delay: 5s, 2s
}

body.mooncake-theme-active .snowflake img{
    width: 60px;
    opacity: 1;
    pointer-events: none;
}

/* pop out announcement - ported directly from the original GSG design reference
   ( [GSG][3webet SG][ZOVU-852]_[GSG][3webet MY][WB3MY-526\web\assets\css\mooncakefestival.css,
   .announcementmodal / .close / .round / .cls-checkbox rules ), adapted only to the selectors
   of this site's EXISTING backend-driven popup markup (#popupAnnouncementListingModal /
   #popupCarouselInner / proc_getPopupAnnouncementList) - the JS/API is untouched.
   Scoped to the festival window only, so the modal returns to its plain look automatically
   once the promo period ends. */
body.mooncake-theme-active .mooncake-announcement-modal.modal {
    z-index: 999999;
}

body.mooncake-theme-active .mooncake-announcement-modal .modal-dialog {
    max-width: 600px;
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

body.mooncake-theme-active .mooncake-announcement-modal .modal-content {
    position: relative;
    background-color: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

body.mooncake-theme-active .mooncake-announcement-modal,
body.mooncake-theme-active .mooncake-announcement-modal:focus,
body.mooncake-theme-active .mooncake-announcement-modal .modal-dialog:focus,
body.mooncake-theme-active .mooncake-announcement-modal .modal-content:focus {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

/* the gold/yellow rectangle around the popup image was traced to a site-wide .modal-body
   box-shadow glow (rgb(240,253,0)) meant for other modals - kill it just for this modal */
body.mooncake-theme-active .mooncake-announcement-modal .modal-body {
    box-shadow: none !important;
    border: none !important;
    outline: none !important;
}

body.mooncake-theme-active .mooncake-announcement-modal .modal-body img {
    margin: auto;
    border-radius: 5px;
    height: auto;
}

/* the round close (x) button centered below the image */
body.mooncake-theme-active .mooncake-announcement-modal .close {
    right: 0;
    left: 48%;
    top: auto;
    bottom: -10%;
    position: absolute;
    z-index: 111;
    color: #ffffff;
    opacity: 1;
    text-align: center;
    font-size: 27px;
    font-weight: 100;
    border: 2px solid #fff;
    border-radius: 100%;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* the JS builds the x as an inline-styled <span style="color:black;"> - force it white so it's
   actually visible inside the white-bordered circle */
body.mooncake-theme-active .mooncake-announcement-modal .close,
body.mooncake-theme-active .mooncake-announcement-modal .close span {
    color: #ffffff !important;
}

/* "Do not show again" checkbox - a general feature of the popup announcement modal, not tied
   to the festival theme, so it stays unscoped and available year-round for any campaign shown
   through this same backend-driven popup.
   Note: Bootstrap sets .modal-dialog { pointer-events: none } (so clicks in its gutter pass
   through to the backdrop) and only restores pointer-events on .modal-content. Since this
   checkbox row is a sibling of .modal-content (not inside it), it inherits that "none" and
   is unclickable unless re-enabled here - that's what made the checkbox stop responding. */
.mooncake-announcement-dnsa {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 5px;
    padding-bottom: 10px;
    font-size: 12px;
    color: #fff;
    pointer-events: auto;
}

.mooncake-announcement-dnsa .round {
    position: relative;
    margin-right: 10px;
    height: 16px;
}

.mooncake-announcement-dnsa .round label {
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    height: 16px;
    left: 0;
    position: absolute;
    top: 0;
    width: 16px;
    margin: 0;
}

.mooncake-announcement-dnsa .round label:after {
    border: 2px solid #a6852d;
    border-top: none;
    border-right: none;
    content: "";
    height: 6px;
    left: 1px;
    opacity: 0;
    position: absolute;
    top: 3px;
    transform: rotate(-45deg);
    width: 12px;
}

.mooncake-announcement-dnsa .round input[type="checkbox"] {
    visibility: hidden;
}

.mooncake-announcement-dnsa .round input[type="checkbox"]:checked + label {
    background-color: #eec95b;
    border-color: #eec95b;
}

.mooncake-announcement-dnsa .round input[type="checkbox"]:checked + label:after {
    opacity: 1;
}

body.mooncake-theme-active .download_index_wrap {
    background-color: unset;
}
body.mooncake-theme-active .step_section {
    background: unset;
}

@media (max-width: 999px) {
    body.mooncake-theme-active .mooncake_header{
        background: url(../images/mooncake_festival_theme/mobile-header.webp);
    }
}
