/*
body, html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #f7f7f7;
}
*/

.event_content {
    font-family: "Noto Sans TC", sans-serif;
/*    min-height: 100vh;*/
}

.rain-bg {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    background: rgba(0, 0, 0, .8);
    z-index: 100;
}

#start-game {
    text-align: center;
    aspect-ratio: 695/579;
    max-width: 695px;
/*    max-width: 36vw;*/
    margin: auto;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    flex-direction: column;
    width: 100%;
    padding-bottom: 3%;
    z-index: 101;
    justify-content: flex-end;
}
.s_tit {
    max-width: 76%;
    margin: auto;
}
.btn-start {
    background-image: url('../img/btn1.png');
    background-size: cover;
    aspect-ratio: 234/81;
    width: 234px;
    margin: 0 auto;
    cursor: pointer;
    display: block;
    max-width: 34%;
}
.btn-start.click {
    animation: btnClick .8s ease backwards;
}
.fade_area {
    opacity: 0;
    width: 100%;
}
.fade_area.act {
    animation: fadeIn 1s linear forwards;
}

@keyframes btnClick {
    100% {
        transform: scale(0.9);
    }
}

.s_bg {
    background-image: url('../img/text1-bg.png');
    background-size: cover;
    aspect-ratio: 695/575;
    width: 100%;
    position: absolute;
    left: 0;
    top: 0;
    z-index: -1;
    opacity: 0;
    transform: scale(0);
}
.s_bg.act {
    animation: zoomIn 0.8s forwards;
}

@keyframes fadeIn {
  100% {
    opacity: 1;
  }
}

#horse {
    position: absolute;
    background-image: url('../img/horse.png');
    background-size: cover;
    aspect-ratio: 430/363;
    width: 215px;
    right: 0;
    top: 15%;
    opacity: 0;
    z-index: 1;
}
#horse.act {
    animation: horseRun 3s linear forwards;
}
@keyframes horseRun {
    0% {
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        top: 5%;
        right: 75%;
    }
}

#rain-container {
    position: absolute;
    width: 100%;
    height: 100%;
    max-width: 1000px;
    left: 50%;
    transform: translateX(-50%);
    overflow: hidden;
/*    transition: all .5s;*/
/*    border: 1px solid red;*/
}
#rain-container.end {
/*    opacity: 0;*/
}

/* 紅包外觀 */
.hongbao {
    position: absolute;
    width: 66px;
    background-image: url('../img/red.png');
    background-size: cover;
    animation-name: fall;
    animation-timing-function: linear;
    aspect-ratio: 66/134;
    cursor: pointer;
}
/*
.hongbao.fall {
    animation-name: fall;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}
*/

/* 硬幣外觀 */
.coin {
    position: absolute;
    width: 60px;
    background-image: url('../img/dollar.png');
    background-size: cover;
    animation-name: fall2;
    animation-timing-function: linear;
    aspect-ratio: 1;
    cursor: pointer;
}
/*
.coin.fall2 {
    animation-name: fall2;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}
*/

/* 櫻花外觀 */
.sakura {
    position: absolute;
    aspect-ratio: 1;
    width: 30px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    animation: sakura-fall linear;
}

/* 下落動畫 */
@keyframes fall {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  100% {
    transform: translateY(120vh) rotate(180deg);
  }
}

@keyframes fall2 {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  100% {
    transform: translateY(120vh) rotate(-90deg);
  }
}

@keyframes sakura-fall {
  0% {
    transform: translateY(-10vh) translateX(0) rotate(0deg);
  }
  100% {
    transform: translateY(110vh) translateX(60px) rotate(360deg);
  }
}

/* popup */
.p_layout {
    position: relative;
    margin: 20px auto;
    font-family: "Noto Sans TC", sans-serif;
    border: 5px solid rgb(230, 207, 140);
    background-color: rgb(255, 255, 255);
    aspect-ratio: 706/376;
    max-width: 706px;
    color: #000;
    font-weight: 700;
    border-radius: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    
    margin: 13% auto 0;
}
.game_main {
    opacity: 0;
}
#award {
    padding-top: 4%;
}
.p_layout:before {
    position: absolute;
    content: '';
    background-image: url(../img/text2-bg.png);
    background-size: contain;
    background-repeat: no-repeat;
    aspect-ratio: 695/575;
    max-width: 695px;
    width: 100%;
    top: -98%;
    z-index: -1;
    animation: zoomIn 0.5s 0.3s forwards;
    opacity: 0;
    transform: scale(0);
}

@keyframes zoomIn {
    100% {
        transform: scale(1);
        opacity: 1;
    }
}
.pop_close {
    aspect-ratio: 1;
    width: 5.4%;
    position: absolute;
    right: 13%;
    top: 2%;
/*    background: red;*/
/*    opacity: .5;*/
    background-image: url(../images/pop/close.png);
    background-size: contain;
    z-index: 1;
}
.p_inner {
    padding: 5% 5% 0;
    text-align: center;
    width: 100%;
}
.p_maintit {
    position: absolute;
    top: 4%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 73%;
}
.p_tit {
    font-weight: 900;
    font-size: 34px;
}
.copy_wrap {
    display: flex;
    gap: 2ch;
    justify-content: center;
    margin: 2ch 0;
}
.copy_wrap p {
    font-size: 30px;
    margin: 0;
}
.btn-copy {
    display: flex;
    gap: 0.5ch;
    align-items: center;
    color: #777777;
    font-size: 24px;
    cursor: pointer;
}
.btn-copy:before {
    content: '';
    background-image: url(../img/icon-copy.png);
    background-size: contain;
    background-repeat: no-repeat;
    aspect-ratio: 33 / 39;
    width: 33px;
}
.p_btns {
    display: flex;
    justify-content: center;
    margin: 2ch 0 0;
}
.p_btns .btns {
    aspect-ratio: 289 / 98;
    width: 289px;
    background-size: contain;
}
.btn-share {
    background-image: url(../img/CTA1.png);
}
.btn-exchange {
    background-image: url(../img/CTA2.png);
}
.btn-confirm {
    background-image: url(../img/btn2.png);
}

/* Fade-in animation */
.mfp-fade-in .mfp-content {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.mfp-fade-in.mfp-ready .mfp-content {
    opacity: 1;
}

/* Fade-out animation */
.mfp-fade-in.mfp-removing .mfp-content {
    opacity: 0;
}

@media screen and (max-width: 767px) {
    .p_layout {
        border-radius: 20px;
        border-width: 3px;
    }
    #award {
        padding-top: 10%;
    }
    .hongbao {
        width: 32px;
    }
    .coin {
        width: 30px;
    }
    .p_tit {
        font-size: 18px;
    }
    .copy_wrap p {
        font-size: 16px;
    }
    .btn-copy {
        font-size: 12px;
    }
    .btn-copy:before {
        width: 16px;
    }
    .copy_wrap {
        margin: 1ch 0;
    }
    #start-game {
        padding-top: 46%;
    }
    #horse {
        width: 120px;
    }
    @keyframes horseRun {
        0% {
            opacity: 0;
        }

        10% {
            opacity: 1;
        }

        90% {
            opacity: 1;
        }

        100% {
            opacity: 0;
            top: 5%;
            right: 65%;
        }
    }
}