/*#region - ENVIRONMENT - */
.content-frame {
    overflow: clip;
}
/*#endregion */

/*#region - SPLASH - */
.splash {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.splash.fade-out {
    opacity: 0;
    pointer-events: none;
}

.sp__bar-wrap {
    width: 75cqw;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3cqw;
}

.sp__bar-bg {
    width: 100%;
    height: 0.5cqw;
    background: #ddd;
    overflow: hidden;
}

.sp__bar-fill {
    height: 0.5cqw;
    width: 0%;
    background: #3a3a3a;
    transition: width 0.08s linear;
}

.sp__pct {
    font-size: 3cqw;
    letter-spacing: 1cqw;
    color: rgb(255, 255, 255, 0.7);
}
/*#endregion */

/*#region - APP - */
.app {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: clip;
}
/* 轉場期間整體鎖互動 */
.app.is-transitioning {
    pointer-events: none;
}
/*#endregion */

/*#region - PAGE - */
.pg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    backface-visibility: hidden;
    transform: translate3d(100cqw, 0, 0);
    pointer-events: none;
}
/* use-transition：頁面啟用動態 */
.pg.use-transition {
    transition: transform 0.44s cubic-bezier(0.4, 0, 0.2, 1);
}

/* is-active：代表這一頁已經進入堆疊，可留在底下 */
.pg.is-active {
    transform: translate3d(0, 0, 0);
}

/* is-current：代表目前最上層頁面，只有它可互動 */
.pg.is-current {
    pointer-events: auto;
}

.pg__wrapper {
    width: 100%;
    display: flex;
    flex: 1 0 auto;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: clip;
}

/*#endregion */

/*#region - BUTTON - */
.btn {
    transition: all 0.1s ease;
    border: none;
    cursor: pointer;
    /* 去除文字底線 */
    text-decoration: none;
    /* 防止按鈕內文本被反白 */
    user-select: none;
    -webkit-user-select: none;
    /* 去除點擊後藍框 */
    -webkit-tap-highlight-color: transparent;

    &:hover {
        filter: brightness(1.02);
    }

    &:active {
        /* 向下移 */
        transform: translateY(0.2cqw);
        filter: brightness(0.95);
    }
}
/*#endregion */

/*#region - P03_COLLECTION - */
.collection-stamp {
    position: relative;
    width: 12.5cqw;
    aspect-ratio: 1 / 1;
    display: block;
    flex: 0 0 auto;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #ffffff;
    isolation: isolate;
    transform-origin: center;
}
.collection-stamp::before,
.collection-stamp::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(1);
    transform-origin: center;
    pointer-events: none;
}

.collection-stamp::before {
    background: url("/resources/stamp-default.webp") center / contain no-repeat;
}

.collection-stamp::after {
    background: url("/resources/stamp-active.webp") center / contain no-repeat;
    opacity: 0;
    z-index: 1;
}
/* is-collected：已收集 */
.collection-stamp.is-collected::after {
    opacity: 1;
}
/* is-collected：剛收集，播放集章動態 */
.collection-stamp.is-collecting {
    animation: item-pop 1s both;
    &::after {
        opacity: 1;
        transition: opacity 0.2s ease-out;
    }
}
/*#endregion */

/*#region - P04_EXCHANGE - */
.exchange-gift {
    position: relative;
    width: 24cqw;
    aspect-ratio: 1 / 1;
    display: grid;
    place-items: center;
    color: #ffffff;
    &::before,
    &::after {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: 2cqw;
    }

    &::before {
        background: #8a8a8a;
    }

    &::after {
        background: #ffffff;
        opacity: 0;
        transform: scale(1);
    }
}

.exchange-gift.is-exchanged::after {
    opacity: 1;
}

.exchange-gift.is-exchanging {
    animation: item-pop 1s both;
    &::after {
        transition: opacity 0.2s ease-out;
        opacity: 1;
    }
}
/*#endregion */

/*#region - P05_SCANNER - */
#scanner-container {
    width: 60cqw;
    aspect-ratio: 1/1;
    overflow: hidden;
    pointer-events: none;
    background: #ffff;
    position: relative;
}
#scanner-video {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/*#endregion */

@keyframes item-pop {
    0% {
        transform: scale3d(1, 1, 1);
    }
    30% {
        transform: scale3d(1.25, 0.75, 1);
    }
    40% {
        transform: scale3d(0.75, 1.25, 1);
    }
    50% {
        transform: scale3d(1.15, 0.85, 1);
    }
    65% {
        transform: scale3d(0.95, 1.05, 1);
    }
    75% {
        transform: scale3d(1.05, 0.95, 1);
    }
    100% {
        transform: scale3d(1, 1, 1);
    }
}

/*#region -  - */
/*#endregion */