@keyframes popupFadeIn {
    0% { opacity: 0; transform: translate(-50%, -48%) scale(.94); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes popupFadeOut {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -52%) scale(.92); }
}

@keyframes popupGlowPulse {
    0%, 100% { opacity: .5; }
    50% { opacity: 1; }
}

@keyframes popupSparkSpin {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

.center_popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 680px;
    background: var(--1w-surface, #141b2d);
    border: 1px solid rgba(0, 150, 255, .3);
    border-radius: 24px;
    box-shadow: 0 0 0 1px rgba(0, 194, 255, .1),
                0 24px 60px rgba(0, 0, 0, .6),
                0 0 80px rgba(0, 150, 255, .12);
    display: block;
    z-index: 40;
    overflow: hidden;
    height: min(460px, 88vh);
    animation: popupFadeIn .45s cubic-bezier(.22, 1, .36, 1) forwards;
}

.center_popup.hiding,
#center_popup-trigger:not(:checked) ~ .center_popup.hiding {
    animation: popupFadeOut .3s ease forwards;
}

.center_popup__glow {
    position: absolute;
    inset: -1px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(0, 150, 255, .4), rgba(0, 194, 255, .2), rgba(0, 178, 75, .3));
    z-index: 0;
    animation: popupGlowPulse 3s ease-in-out infinite;
    pointer-events: none;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
    padding: 1px;
}

.center_popup__badge {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--1w-cyan, #00c2ff);
    background: rgba(0, 150, 255, .12);
    border: 1px solid rgba(0, 194, 255, .3);
    padding: 5px 16px;
    border-radius: 20px;
}

.center_popup__body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 18px;
    padding: 10px 0;
    position: relative;
    z-index: 2;
}

.center_popup__spark {
    font-size: 36px;
    color: var(--1w-cyan, #00c2ff);
    animation: popupSparkSpin 6s linear infinite;
    text-shadow: 0 0 20px rgba(0, 194, 255, .6);
    line-height: 1;
}

.center_popup__text { width: 100%; }

.center_popup__action {
    width: 100%;
    max-width: 340px;
}

.center_popup__note {
    font-size: 12px;
    color: var(--1w-text-muted, #8b9cb3);
    margin: 0;
}

.center_popup .close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 4;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .4);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 8px;
    color: rgba(255, 255, 255, .7);
    cursor: pointer;
    transition: .2s;
}

.center_popup .close-btn:hover {
    background: rgba(0, 150, 255, .3);
    color: #fff;
    border-color: rgba(0, 194, 255, .4);
}

.center_popup-content {
    padding: 52px 28px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 18px;
    height: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
}

@media (max-width: 767px) {
    .center_popup:not(.center_popup--fullscreen) {
        width: calc(100% - 32px);
        height: min(400px, 85vh);
        border-radius: 20px;
    }
    .center_popup-content { padding: 44px 20px 24px; }
}

.center_popup-content > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.center_popup-content p { text-transform: uppercase; }

.center_popup-content .button-primary { margin-inline: 20px; width: calc(100% - 40px); }

.center_popup-content p.big span,
.center_popup-content p.mid [data-text] {
    position: relative;
    background: linear-gradient(180deg, var(--1w-blue, #0096ff) 0%, var(--1w-blue-dark, #0066cc) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.center_popup-content p.big span::after,
.center_popup-content p.mid [data-text]::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0; right: 0;
    background: linear-gradient(180deg, #00c2ff 0%, #0096ff 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.center_popup-content p.big {
    font-weight: 700;
    font-size: 30px;
    line-height: 36px;
    color: #fff;
    margin-bottom: auto;
    text-shadow: 0 2px 12px rgba(0, 150, 255, .3);
}

.center_popup-content p.big span {
    display: block;
    font-weight: 900;
    font-size: 48px;
    line-height: 52px;
}

@media (max-width: 767px) {
    .center_popup-content p.big { font-size: 18px; line-height: 22px; }
    .center_popup-content p.big span { font-size: 28px; line-height: 32px; }
}

.center_popup-content p.mid {
    font-weight: 600;
    font-size: 18px;
    line-height: 26px;
    color: #fff;
    margin: 0 0 16px;
    text-transform: none;
}

.center_popup-content p.mid [data-text] {
    margin: 0 4px;
    font-weight: 900;
    font-size: 26px;
}

.center_popup-content p.mid .extra {
    font-weight: 900;
    font-size: 42px;
    line-height: 46px;
    margin-top: 4px;
    color: var(--1w-cyan, #00c2ff);
}

.center_popup-content p.small {
    font-size: 13px;
    color: var(--1w-text-muted, #8b9cb3);
    margin: 10px 0;
    text-transform: none;
}

.center_popup-content .button--site-style {
    filter: drop-shadow(0 0 8px rgba(0, 150, 255, .5));
    font-size: 18px;
    min-width: 260px;
    border-radius: 10px;
}

.center_popup-content .button--site-style:hover {
    filter: drop-shadow(0 0 14px rgba(0, 194, 255, .6));
}

#center_popup-trigger { display: none; }
#center_popup-trigger:not(:checked) ~ .center_popup { display: none; }

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(13, 19, 28, .88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    z-index: 36;
    transition: opacity .3s ease, visibility .3s ease;
}

#center_popup-trigger:checked ~ .overlay {
    opacity: 1;
    visibility: visible;
}

/* Fullscreen popup (popup-new-banner) */
.center_popup.center_popup--fullscreen {
    top: 0; left: 0; right: 0; bottom: 0;
    transform: none;
    width: 100%; height: 100dvh;
    min-height: 100dvh;
    max-width: none; max-height: none;
    border-radius: 0; border: none;
    background: #000; z-index: 50;
    animation: none;
}

.center_popup--fullscreen .close-btn {
    opacity: .15;
    font-size: 0;
    top: 12px; right: 12px;
    z-index: 3;
}

.center_popup--fullscreen .close-btn svg { display: none; }

.center_popup--fullscreen .close-btn::after {
    content: "×";
    font-size: 36px;
    color: #fff;
}

.center_popup--fullscreen .close-btn:hover { opacity: .4; }

.center_popup--fullscreen .center_popup-content {
    padding: 0;
    justify-content: center;
    gap: 0;
    position: relative;
}

.center_popup--fullscreen .center_popup-banner-link {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
}

.center_popup--fullscreen .popup-banner-media {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    margin: 0;
}

.center_popup--fullscreen .popup-banner-media p {
    position: absolute;
    inset: 0;
    margin: 0;
}

.center_popup--fullscreen .popup-banner-media img {
    width: 100%; height: 100%;
    max-width: none; max-height: none;
    object-fit: cover;
    display: block;
}

@media (min-width: 768px) {
    .center_popup--fullscreen .popup-banner-media.popup-banner-mobile:not(.popup-banner-desktop) { display: none; }
}

@media (max-width: 767px) {
    .center_popup--fullscreen .popup-banner-media.popup-banner-desktop:not(.popup-banner-mobile) { display: none; }
    .center_popup--fullscreen .center_popup-banner-action { bottom: 20px; width: calc(100% - 40px); }
}

.center_popup--fullscreen .center_popup-banner-action {
    position: absolute;
    left: 50%; bottom: 32px;
    transform: translateX(-50%);
    z-index: 2;
}

body.center-popup-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    left: 0; right: 0;
    touch-action: none;
}

body.center-popup-open .overlay { touch-action: none; }
