.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(94vw, 820px, calc(121.35vh - 132px));
    max-width: 100%;
    text-align: center;
    isolation: isolate;
}

.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__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__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);
    --go-button-shadow-y: clamp(3px, 1cqw, 8px);
    --go-button-hover-shadow-y: clamp(5px, 1.35cqw, 11px);
    --go-button-active-shadow-y: clamp(2px, 0.4cqw, 3px);

    position: relative;
    display: grid;
    place-items: center;
    box-sizing: border-box;
    width: 48%;
    height: auto;
    aspect-ratio: 4.28 / 1;
    margin: -4% auto 0;
    border: 0;
    background: url("images/home-popup/go-button-wide.webp") center / 100% 100% no-repeat;
    color: #fff8c5;
    font-size: clamp(40px, 8vw, 72px);
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    filter: drop-shadow(0 var(--go-button-shadow-y) 0 rgba(18, 97, 16, 0.7));
    transition: transform 120ms ease, filter 120ms ease;
}

.home-popup__go:hover,
.home-popup__go:focus-visible {
    transform: translateY(-3px);
    filter: drop-shadow(0 var(--go-button-hover-shadow-y) 0 rgba(18, 97, 16, 0.7));
    text-decoration: none;
}

.home-popup__go:active {
    transform: translateY(4px);
    filter: drop-shadow(0 var(--go-button-active-shadow-y) 0 rgba(18, 97, 16, 0.7));
}

.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 {
    --home-popup-close-size: clamp(36px, 11.5cqw, 76px);
    --home-popup-close-border: clamp(3px, 0.65cqw, 5px);
    --home-popup-close-inset: clamp(4px, 0.85cqw, 7px);
    --home-popup-close-offset: clamp(3px, 0.6cqw, 5px);
    --home-popup-close-blur: clamp(10px, 2.2cqw, 18px);
    --home-popup-close-x-offset: clamp(2px, 0.5cqw, 4px);

    position: absolute;
    top: 9%;
    right: 5%;
    z-index: 2;
    display: grid;
    place-items: center;
    box-sizing: border-box;
    width: var(--home-popup-close-size);
    height: var(--home-popup-close-size);
    padding: 0;
    border: var(--home-popup-close-border) solid #ff5a51;
    border-radius: 27%;
    background: linear-gradient(#ff3938, #d8070b);
    box-shadow:
        inset 0 calc(0px - var(--home-popup-close-inset)) 0 #a80709,
        0 var(--home-popup-close-offset) 0 #760506,
        0 calc(var(--home-popup-close-offset) + 3px) var(--home-popup-close-blur) rgba(0, 0, 0, 0.38);
    color: #fff8c5;
    font-family: Arial, sans-serif;
    font-size: clamp(30px, 9.4cqw, 66px);
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    outline: none;
    -webkit-text-stroke: clamp(1.5px, 0.37cqw, 3px) #970701;
    paint-order: stroke fill;
    transition: transform 120ms ease, filter 120ms ease;
}

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

.home-popup__close:focus-visible {
    outline: none;
    box-shadow:
        inset 0 calc(0px - var(--home-popup-close-inset)) 0 #a80709,
        0 var(--home-popup-close-offset) 0 #760506,
        0 calc(var(--home-popup-close-offset) + 3px) var(--home-popup-close-blur) rgba(0, 0, 0, 0.38);
}

.home-popup__close:active {
    transform: translateY(var(--home-popup-close-offset)) scale(0.98);
}

.home-popup__close > span {
    display: block;
    transform: translateY(calc(0px - var(--home-popup-close-x-offset)));
}

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

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

    .home-popup__dialog {
        width: min(98vw, calc(126.62vh - 108px));
    }

    .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: 55%;
        margin-top: -2%;
        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;
    }
}
