@font-face {
    font-family: "Home Popup Titan";
    src: url("store/assets/TitanOne-Latin-DwVbh4mi.woff2") format("woff2");
    font-display: swap;
    font-style: normal;
    font-weight: 400;
}

.home-popup {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    box-sizing: border-box;
    padding: 20px;
    overflow: auto;
    overflow-x: hidden;
    background: rgba(0, 0, 0, 0.82);
    opacity: 1;
    visibility: visible;
    transition: opacity 180ms ease, visibility 180ms ease;
}

.home-popup[hidden] {
    display: none;
}

.home-popup.is-closing {
    opacity: 0;
    visibility: hidden;
}

.home-popup__dialog {
    position: relative;
    container-type: inline-size;
    width: min(calc(100vw - 40px), 620px, calc(79.7vh - 32px));
    width: min(calc(100vw - 40px), 620px, calc(79.7dvh - 32px));
    text-align: center;
    isolation: isolate;
    outline: 0;
}

.home-popup__panel {
    position: relative;
    width: 100%;
    --home-popup-text-angle: -5deg;
}

.home-popup__art {
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
}

.home-popup__lucky-panel[hidden] {
    display: none;
}

.home-popup--lucky .home-popup__dialog {
    width: min(calc(100vw - 40px), 590px, calc(73.55vh - 32px));
    width: min(calc(100vw - 40px), 590px, calc(73.55dvh - 32px));
}

.home-popup__lucky-panel {
    position: relative;
    width: 100%;
}

.home-popup__lucky-art {
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
}

.home-popup__lucky-title {
    position: absolute;
    top: -5.2%;
    left: 50%;
    z-index: 2;
    display: block;
    width: 71%;
    height: auto;
    transform: translateX(-50%);
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.home-popup__lucky-countdown {
    position: absolute;
    bottom: 29%;
    left: 50%;
    z-index: 3;
    width: 31%;
    aspect-ratio: 3.45;
    transform: translateX(-50%);
    color: #6e2b27;
    font-family: "Arial Black", "Microsoft YaHei", "PingFang SC", "Noto Sans", sans-serif;
    font-size: clamp(0.62rem, 3.2vw, 1.35rem);
    font-weight: 900;
    font-synthesis: none;
    line-height: 1;
    text-shadow: none;
}

.home-popup__lucky-countdown-bg {
    position: absolute;
    inset: 0 0 0 9%;
    z-index: 1;
    display: flex;
    min-width: 0;
    overflow: hidden;
}

.home-popup__lucky-countdown-cap,
.home-popup__lucky-countdown-center {
    display: block;
    height: 100%;
    background-image: url("shop/images/activities/lucky-draw/countdown-panel.png");
    background-repeat: no-repeat;
}

.home-popup__lucky-countdown-cap {
    z-index: 1;
    flex: 0 0 auto;
    width: auto;
    aspect-ratio: 45 / 100;
    background-size: auto 100%;
}

.home-popup__lucky-countdown-cap--start {
    background-position: left center;
}

.home-popup__lucky-countdown-cap--end {
    background-position: right center;
}

.home-popup__lucky-countdown-center {
    z-index: 0;
    flex: 1 1 auto;
    min-width: 0;
    margin-inline: -1px;
    background-position: center;
    background-size: 145.2261306531% 100%;
}

.home-popup__lucky-clock {
    position: absolute;
    top: 50%;
    left: 0;
    z-index: 2;
    display: block;
    width: auto;
    height: 92%;
    aspect-ratio: 1;
    transform: translateY(-50%);
}

.home-popup__lucky-clock-face,
.home-popup__lucky-clock-hand {
    display: block;
    width: 100%;
    height: 100%;
}

.home-popup__lucky-clock-hand {
    position: absolute;
    inset: 0;
    object-fit: contain;
    transform-origin: 50% 50%;
    animation: home-lucky-clock-tick 4s linear infinite;
    will-change: transform;
}

@keyframes home-lucky-clock-tick {
    0% {
        animation-timing-function: cubic-bezier(0.2, 0.75, 0.35, 1);
        transform: rotate(0deg);
    }
    7%, 25% {
        transform: rotate(90deg);
    }
    25% {
        animation-timing-function: cubic-bezier(0.2, 0.75, 0.35, 1);
    }
    32%, 50% {
        transform: rotate(180deg);
    }
    50% {
        animation-timing-function: cubic-bezier(0.2, 0.75, 0.35, 1);
    }
    57%, 75% {
        transform: rotate(270deg);
    }
    75% {
        animation-timing-function: cubic-bezier(0.2, 0.75, 0.35, 1);
    }
    82%, 100% {
        transform: rotate(360deg);
    }
}

.home-popup__lucky-time {
    position: absolute;
    top: 5%;
    right: 10%;
    bottom: 17%;
    left: 30%;
    z-index: 3;
    display: grid;
    overflow: hidden;
    place-items: center;
    white-space: nowrap;
}

.home-popup__lucky-time-content {
    display: inline-block;
    width: max-content;
    max-width: none;
    transform-origin: center;
    white-space: nowrap;
}

@media (max-width: 540px) {
    .home-popup__lucky-countdown {
        font-size: clamp(0.76rem, 4vw, 1rem);
    }

    .home-popup__lucky-time {
        right: 7%;
        left: 26%;
    }
}

.home-popup__lucky-message {
    position: absolute;
    bottom: 24%;
    left: 50%;
    z-index: 3;
    width: 84%;
    margin: 0;
    transform: translateX(-50%);
    color: #fff8dd;
    font-family: "Home Popup Titan", "Arial Rounded MT Bold", sans-serif;
    font-size: clamp(13px, 4.1cqw, 27px);
    font-weight: 900;
    line-height: 1.08;
    text-align: center;
    -webkit-text-stroke: clamp(1px, 0.35cqw, 2px) #3c176f;
    paint-order: stroke fill;
    text-shadow: 0 clamp(1px, 0.45cqw, 3px) 0 #3c176f;
}

.home-popup__title,
.home-popup__subtitle,
.home-popup__badge,
.home-popup__go {
    font-family: "Arial Rounded MT Bold", "Trebuchet MS", Arial, sans-serif;
    font-weight: 900;
}

.home-popup--lucky .home-popup__go {
    bottom: 6.8%;
    width: 61%;
    aspect-ratio: 726 / 191;
    background-image: url("images/home-popup/lucky-draw-button.png?v=20260922-1");
}

.home-popup--lucky .home-popup__go > span {
    --fit-font-max: 54;
}

.home-popup__title,
.home-popup__subtitle,
.home-popup__badge strong,
.home-popup__badge span {
    font-family: "Arial Black", "Microsoft YaHei", "PingFang SC", "Noto Sans", sans-serif;
    font-weight: 900;
}

.home-popup__title,
.home-popup__subtitle,
.home-popup__badge strong,
.home-popup__badge span,
.home-popup__go > span {
    box-sizing: border-box;
    text-align: center;
    white-space: nowrap;
    transform-origin: center center;
}

.home-popup__title {
    --text-max-width: 47%;
    --fit-font-min: 8;
    --fit-font-max: 36;

    position: absolute;
    top: 53%;
    left: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--text-max-width);
    min-width: 0;
    margin: 0;
    overflow: hidden;
    transform: translate(-50%, -50%) rotate(var(--home-popup-text-angle));
    color: #fff;
    font-size: clamp(22px, 5.4vw, 46px);
    line-height: 1;
    letter-spacing: 0.02em;
    -webkit-text-stroke: 3px #de0b5b;
    paint-order: stroke fill;
    text-shadow: 0 6px 0 #de0b5b, 0 10px 12px rgba(117, 0, 54, 0.35);
}

.home-popup__subtitle {
    --text-max-width: 47%;
    --fit-font-min: 8;
    --fit-font-max: 40;

    position: absolute;
    top: 64.5%;
    left: 51%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--text-max-width);
    min-width: 0;
    margin: 0;
    overflow: hidden;
    transform: translate(-50%, -50%) rotate(var(--home-popup-text-angle));
    color: #fff;
    font-size: clamp(18px, 4.4vw, 38px);
    line-height: 1.1;
    -webkit-text-stroke: 2px #de0b5b;
    paint-order: stroke fill;
    text-shadow: 0 4px 0 #de0b5b;
}

.home-popup__badge {
    position: absolute;
    top: 36.5%;
    left: 76.5%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 18%;
    aspect-ratio: 1;
    transform: translate(-50%, -50%) rotate(4deg);
    color: #fff;
    line-height: 0.88;
    text-transform: uppercase;
    text-shadow: 0 3px 0 #970701;
    pointer-events: none;
}

.home-popup__badge strong {
    --fit-font-min: 12;
    --fit-font-max: 40;

    display: block;
    width: 100%;
    font-size: clamp(16px, 3.4vw, 34px);
    -webkit-text-stroke: 2px #970701;
    paint-order: stroke fill;
}

.home-popup__badge span {
    --fit-font-min: 12;
    --fit-font-max: 28;

    display: block;
    width: 100%;
    margin-top: 2%;
    color: #ffef29;
    font-size: clamp(9px, 1.8vw, 18px);
    -webkit-text-stroke: 2px #970701;
    paint-order: stroke fill;
}

.home-popup__go {
    --go-label-center-y: 46%;
    --go-stroke-width: clamp(1px, 0.35cqw, 3px);
    --go-text-shadow-y: clamp(1px, 0.6cqw, 5px);

    position: absolute;
    left: 50%;
    bottom: 7.5%;
    z-index: 3;
    display: grid;
    place-items: center;
    box-sizing: border-box;
    width: 56%;
    height: auto;
    aspect-ratio: 740 / 205;
    margin: 0;
    border: 0;
    background: url("images/home-popup/go-button.png?v=20260908-1") center / 100% 100% no-repeat;
    color: #fff8c5;
    font-size: clamp(40px, 8vw, 72px);
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    filter: none;
    transform: translateX(-50%);
    transition: transform 120ms ease, filter 120ms ease;
}

.home-popup__go:hover,
.home-popup__go:focus-visible {
    transform: translateX(-50%) translateY(-3px);
    filter: brightness(1.06);
    text-decoration: none;
}

.home-popup__go:active {
    transform: translateX(-50%) translateY(4px);
    filter: brightness(0.96);
}

.home-popup__go > span {
    --fit-font-min: 18;
    --fit-font-max: 60;

    position: absolute;
    top: var(--go-label-center-y);
    left: 50%;
    display: block;
    width: 82%;
    margin: 0;
    font-family: "Arial Black", "Microsoft YaHei", "PingFang SC", "Noto Sans", sans-serif;
    font-weight: 900;
    line-height: 1;
    transform: translate(-50%, -50%);
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
    -webkit-text-stroke: var(--go-stroke-width) #1a6110;
    paint-order: stroke fill;
    text-shadow: 0 var(--go-text-shadow-y) 0 #1a6110;
}

.home-popup__close {
    position: absolute;
    top: 2.5%;
    right: 3.5%;
    z-index: 4;
    display: block;
    box-sizing: border-box;
    width: clamp(40px, 9.4cqw, 70px);
    height: auto;
    aspect-ratio: 112 / 113;
    padding: 0;
    border: 0;
    border-radius: 24%;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
    outline: clamp(2px, 0.45cqw, 3px) solid transparent;
    outline-offset: clamp(2px, 0.6cqw, 4px);
    transition: transform 120ms ease, filter 120ms ease;
}

.home-popup--lucky .home-popup__close {
    top: 8.2%;
    right: 0.8%;
}

.home-popup__close img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.home-popup__close:hover,
.home-popup__close:focus-visible {
    transform: scale(1.06);
    filter: brightness(1.08);
}

.home-popup__close:focus-visible {
    outline-color: #fff8c5;
}

.home-popup__close:active {
    transform: translateY(clamp(2px, 0.4cqw, 4px)) scale(0.98);
}

body.home-popup-open {
    overflow: hidden;
}

@media (max-width: 520px) {
    .home-popup {
        padding: 12px;
    }

    .home-popup__dialog {
        width: min(calc(100vw - 24px), 620px, calc(79.7vh - 20px));
        width: min(calc(100vw - 24px), 620px, calc(79.7dvh - 20px));
    }

    .home-popup--lucky .home-popup__dialog {
        width: min(calc(100vw - 56px), 590px, calc(73.55vh - 20px));
        width: min(calc(100vw - 56px), 590px, calc(73.55dvh - 20px));
    }

    .home-popup--lucky .home-popup__lucky-title {
        width: 66%;
    }

    .home-popup--lucky .home-popup__close {
        right: 2.5%;
    }

    .home-popup__title {
        --fit-font-max: 28;

        font-size: clamp(18px, 5.4vw, 28px);
        -webkit-text-stroke-width: 2px;
        text-shadow: 0 4px 0 #de0b5b, 0 7px 9px rgba(117, 0, 54, 0.35);
    }

    .home-popup__subtitle,
    .home-popup__badge strong,
    .home-popup__badge span {
        -webkit-text-stroke-width: 1.5px;
    }

    .home-popup__subtitle {
        --fit-font-max: 23;

        font-size: clamp(14px, 4.4vw, 23px);
    }

    .home-popup__badge strong {
        --fit-font-max: 24;
    }

    .home-popup__badge span {
        --fit-font-max: 13;
    }

    .home-popup__go {
        width: 58%;
        font-size: clamp(36px, 10vw, 48px);
    }

    .home-popup__go > span {
        --fit-font-max: 48;
    }

}

@media (prefers-reduced-motion: reduce) {
    .home-popup,
    .home-popup__go,
    .home-popup__close {
        transition: none;
    }

    .home-popup__lucky-clock-hand {
        animation: none;
    }
}
