/* Benira native popup manager — mobile-first, scoped to the 504px app shell. */
.bn-popup-root[hidden],
#bn-popup-templates[hidden]{display:none!important;}

.bn-popup-root{
    position:fixed!important;
    inset-block:0!important;
    left:50%!important;
    width:min(100vw,504px)!important;
    transform:translateX(-50%)!important;
    z-index:100200!important;
    direction:rtl!important;
    font-family:"IRANSansX","IRANSans","IRANSansWeb",Tahoma,sans-serif!important;
}

html.bn-popup-page-locked,
body.bn-popup-page-locked{
    overflow:hidden!important;
    overscroll-behavior:none!important;
}

.bn-popup-overlay{
    position:absolute!important;
    inset:0!important;
    display:flex!important;
    align-items:var(--bn-popup-vertical-align,center)!important;
    justify-content:center!important;
    padding:max(14px,env(safe-area-inset-top)) 14px max(14px,env(safe-area-inset-bottom))!important;
    background:var(--bn-popup-overlay-background,rgba(var(--bn-color-text-rgb,15,23,42),.58))!important;
    background:color-mix(in srgb,var(--bn-popup-overlay-color,#111827) calc(var(--bn-popup-overlay-opacity,.58) * 100%),transparent)!important;
    -webkit-backdrop-filter:blur(1.5px)!important;
    backdrop-filter:blur(1.5px)!important;
    opacity:0!important;
    transition:opacity .22s ease!important;
    box-sizing:border-box!important;
}

.bn-popup-card{
    position:relative!important;
    width:min(100%,var(--bn-popup-card-width,380px))!important;
    height:var(--bn-popup-card-height,auto)!important;
    max-height:min(var(--bn-popup-card-max-height,100vh),calc(100vh - 28px))!important;
    max-height:min(var(--bn-popup-card-max-height,100dvh),calc(100dvh - 28px))!important;
    overflow:auto!important;
    overscroll-behavior:contain!important;
    scrollbar-width:none!important;
    border:1px solid rgba(219,234,254,.96)!important;
    border-radius:var(--bn-popup-card-radius,24px)!important;
    background:var(--bn-popup-card-color,#fff)!important;
    background:linear-gradient(180deg,color-mix(in srgb,var(--bn-popup-card-color,#fff) 93%,#dff5ff) 0,var(--bn-popup-card-color,#fff) 38%,var(--bn-popup-card-color,#fff) 100%)!important;
    box-shadow:0 22px 70px rgba(var(--bn-color-text-rgb,15,23,42),.28),0 2px 10px rgba(var(--bn-color-text-rgb,15,23,42),.08)!important;
    color:#27364a!important;
    outline:none!important;
    transform:translateY(14px) scale(.975)!important;
    transition:transform .28s cubic-bezier(.2,.75,.25,1)!important;
    box-sizing:border-box!important;
    -webkit-overflow-scrolling:touch!important;
}

.bn-popup-card::-webkit-scrollbar{display:none!important;}

.bn-popup-close{
    position:absolute!important;
    top:14px!important;
    right:14px!important;
    z-index:4!important;
    display:grid!important;
    place-items:center!important;
    width:var(--bn-popup-close-size,44px)!important;
    height:var(--bn-popup-close-size,44px)!important;
    padding:0!important;
    border:0!important;
    border-radius:50%!important;
    background:var(--bn-popup-close-bg,#fff)!important;
    color:var(--bn-popup-close-icon,#36516b)!important;
    box-shadow:0 5px 18px rgba(var(--bn-color-text-rgb,15,23,42),.14)!important;
    cursor:pointer!important;
    -webkit-tap-highlight-color:transparent!important;
    transition:transform .18s ease,background-color .18s ease!important;
}

.bn-popup-close:active{transform:scale(.94)!important;}
.bn-popup-close:focus-visible{outline:3px solid rgba(14,165,233,.28)!important;outline-offset:2px!important;}
.bn-popup-close svg{width:var(--bn-popup-close-icon-size,26px)!important;height:var(--bn-popup-close-icon-size,26px)!important;fill:none!important;stroke:currentColor!important;stroke-width:2!important;stroke-linecap:round!important;}

.bn-popup-badge{
    position:absolute!important;
    top:16px!important;
    left:16px!important;
    z-index:3!important;
    max-width:calc(100% - var(--bn-popup-close-size,44px) - 56px)!important;
    padding:9px 17px 8px!important;
    overflow:hidden!important;
    border-radius:999px!important;
    background:linear-gradient(135deg,var(--bn-popup-badge-start,#08b9e8),var(--bn-popup-badge-end,#1378ff))!important;
    box-shadow:0 6px 15px rgba(2,132,199,.24)!important;
    color:var(--bn-popup-badge-text,#fff)!important;
    font-size:var(--bn-popup-badge-font,13px)!important;
    font-weight:600!important;
    line-height:1.25!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
}

.bn-popup-media{
    width:min(var(--bn-popup-image-size,58%),calc(100% - 32px))!important;
    max-width:calc(100% - 32px)!important;
    aspect-ratio:1!important;
    margin:max(44px,calc(var(--bn-popup-close-size,44px) + 10px)) auto 12px!important;
    overflow:hidden!important;
    border-radius:50%!important;
    background:#eaf7ff!important;
    box-shadow:0 8px 24px rgba(2,132,199,.1)!important;
}

.bn-popup-image{
    display:block!important;
    width:100%!important;
    height:100%!important;
    margin:0!important;
    object-fit:cover!important;
    border:0!important;
    border-radius:inherit!important;
}

.bn-popup-card--without-image{padding-top:max(72px,calc(var(--bn-popup-close-size,44px) + 28px))!important;}

.bn-popup-content{
    display:flex!important;
    flex-direction:column!important;
    gap:0!important;
    padding:8px var(--bn-popup-content-pad-x,18px) var(--bn-popup-content-pad-bottom,18px)!important;
    text-align:center!important;
    box-sizing:border-box!important;
}

.bn-popup-title{
    margin:0 0 12px!important;
    color:var(--bn-popup-title-color,#087fca)!important;
    font-size:var(--bn-popup-title-font,15px)!important;
    font-weight:600!important;
    line-height:1.85!important;
    text-align:center!important;
}

.bn-popup-body{
    margin:0!important;
    color:var(--bn-popup-body-color,#334155)!important;
    font-size:var(--bn-popup-body-font,14px)!important;
    font-weight:400!important;
    line-height:2!important;
    text-align:center!important;
    overflow-wrap:anywhere!important;
}

.bn-popup-body p{
    margin:0 0 5px!important;
    font-size:inherit!important;
    line-height:inherit!important;
}
.bn-popup-body p:last-child{margin-bottom:0!important;}
.bn-popup-body a{color:#087fca!important;text-decoration:underline!important;text-underline-offset:3px!important;}

.bn-popup-coupon{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
    gap:10px!important;
    align-items:center!important;
    margin-top:16px!important;
    padding:10px!important;
    border:1px solid var(--bn-popup-coupon-border,#d5e9f8)!important;
    border-radius:16px!important;
    background:var(--bn-popup-coupon-bg,#edf8ff)!important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.72)!important;
    direction:ltr!important;
}

.bn-popup-coupon__code{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    min-height:var(--bn-popup-coupon-height,48px)!important;
    padding:4px 10px!important;
    overflow:hidden!important;
    border-radius:6px!important;
    background:var(--bn-popup-code-bg,#fff)!important;
    color:var(--bn-popup-code-text,#303b70)!important;
    font-family:inherit!important;
    font-size:var(--bn-popup-coupon-font,15px)!important;
    font-weight:500!important;
    line-height:1.3!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    direction:ltr!important;
    grid-column:1!important;
    grid-row:1!important;
    box-shadow:0 4px 13px rgba(var(--bn-color-text-rgb,15,23,42),.04)!important;
}

.bn-popup-coupon__copy{
    grid-column:2!important;
    grid-row:1!important;
    min-height:var(--bn-popup-coupon-height,48px)!important;
    padding:8px 12px!important;
    border:0!important;
    border-radius:6px!important;
    background:linear-gradient(135deg,var(--bn-popup-copy-start,#08b6e7),var(--bn-popup-copy-end,#1674ff))!important;
    color:var(--bn-popup-copy-text,#fff)!important;
    font-family:inherit!important;
    direction:rtl!important;
    font-size:var(--bn-popup-copy-font,14px)!important;
    font-weight:600!important;
    line-height:1.3!important;
    cursor:pointer!important;
    -webkit-tap-highlight-color:transparent!important;
    box-shadow:0 7px 18px rgba(17,117,255,.18)!important;
    transition:transform .18s ease,filter .18s ease!important;
}
.bn-popup-coupon__copy:active{transform:scale(.97)!important;}
.bn-popup-coupon__copy:focus-visible{outline:3px solid rgba(14,165,233,.28)!important;outline-offset:2px!important;}
.bn-popup-coupon__copy.is-copied{filter:saturate(.72)!important;}

.bn-popup-cta{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:100%!important;
    min-height:var(--bn-popup-cta-height,58px)!important;
    margin-top:18px!important;
    padding:10px 18px!important;
    border:0!important;
    border-radius:var(--bn-popup-cta-radius,15px)!important;
    background:linear-gradient(135deg,var(--bn-popup-cta-start,#08b6e7),var(--bn-popup-cta-end,#176dff))!important;
    color:var(--bn-popup-cta-text,#fff)!important;
    font-size:var(--bn-popup-cta-font,15px)!important;
    font-weight:600!important;
    line-height:1.35!important;
    text-align:center!important;
    text-decoration:none!important;
    box-shadow:0 9px 24px rgba(17,117,255,.2)!important;
    box-sizing:border-box!important;
    -webkit-tap-highlight-color:transparent!important;
    transition:transform .18s ease,filter .18s ease!important;
}
.bn-popup-cta:active{transform:scale(.985)!important;}
.bn-popup-cta:focus-visible{outline:3px solid rgba(14,165,233,.3)!important;outline-offset:3px!important;}

.bn-popup-overlay.is-visible{opacity:1!important;}
.bn-popup-overlay.is-visible .bn-popup-card{transform:translateY(0) scale(1)!important;}

.bn-popup-overlay--bottom-sheet{
    align-items:flex-end!important;
    padding:max(14px,env(safe-area-inset-top)) 0 0!important;
}
.bn-popup-overlay--bottom-sheet .bn-popup-card--bottom-sheet{
    width:100%!important;
    max-width:504px!important;
    max-height:min(var(--bn-popup-card-max-height,100vh),100vh)!important;
    max-height:min(var(--bn-popup-card-max-height,100dvh),100dvh)!important;
    border-radius:var(--bn-popup-card-radius,24px) var(--bn-popup-card-radius,24px) 0 0!important;
    transform:translateY(100%) scale(1)!important;
}
.bn-popup-overlay--bottom-sheet.is-visible .bn-popup-card--bottom-sheet{transform:translateY(0) scale(1)!important;}
.bn-popup-overlay--bottom-sheet .bn-popup-close{right:auto!important;left:14px!important;}
.bn-popup-overlay--bottom-sheet .bn-popup-badge{right:16px!important;left:auto!important;}

@media (max-width:359px){
    .bn-popup-overlay{padding-inline:10px!important;}
    .bn-popup-card{border-radius:var(--bn-popup-card-radius,24px)!important;}
    .bn-popup-close{top:11px!important;right:11px!important;width:var(--bn-popup-close-size,44px)!important;height:var(--bn-popup-close-size,44px)!important;}
    .bn-popup-badge{top:13px!important;left:12px!important;padding:8px 13px 7px!important;font-size:var(--bn-popup-badge-font,13px)!important;}
    .bn-popup-media{margin-top:max(42px,calc(var(--bn-popup-close-size,44px) + 8px))!important;}
    .bn-popup-content{padding:6px var(--bn-popup-content-pad-x,18px) var(--bn-popup-content-pad-bottom,18px)!important;}
    .bn-popup-title{margin-bottom:8px!important;line-height:1.75!important;}
    .bn-popup-body{font-size:var(--bn-popup-body-font,14px)!important;line-height:1.9!important;}
    .bn-popup-coupon{gap:8px!important;padding:8px!important;border-radius:14px!important;}
    .bn-popup-coupon__code,.bn-popup-coupon__copy{min-height:var(--bn-popup-coupon-height,48px)!important;}
    .bn-popup-cta{min-height:var(--bn-popup-cta-height,58px)!important;margin-top:14px!important;}
}

@media (max-height:620px) and (orientation:landscape){
    .bn-popup-overlay{align-items:var(--bn-popup-vertical-align,center)!important;}
    .bn-popup-card{max-height:min(var(--bn-popup-card-max-height,100dvh),calc(100dvh - 20px))!important;}
    .bn-popup-media{margin-top:40px!important;}
}

@media (prefers-reduced-motion:reduce){
    .bn-popup-overlay,.bn-popup-card{animation:none!important;transition:none!important;opacity:1!important;transform:none!important;}
    .bn-popup-close,.bn-popup-coupon__copy,.bn-popup-cta{transition:none!important;}
}

/* Prize-wheel popup container only. Gameplay styles live in benira-wheel.css. */
.bn-popup-card--wheel{
    width:min(var(--bn-popup-card-width,620px),calc(100vw - 20px))!important;
    height:var(--benira-wheel-modal-height,auto)!important;
    min-height:var(--benira-wheel-modal-min-height,0px)!important;
    max-height:min(var(--benira-wheel-modal-max-height,660px),var(--bn-popup-card-max-height,660px),calc(100dvh - 28px))!important;
    padding:50px 8px 8px!important;
    overflow:auto!important;
    background:var(--bn-popup-card-color,#fff)!important;
}
.bn-popup-wheel-content{width:100%!important;min-width:0!important;overflow:visible!important;}
.bn-popup-wheel-content .benira-wheel-shell{width:100%!important;max-width:none!important;min-height:0!important;height:auto!important;max-height:none!important;margin:0!important;padding:0!important;display:block!important;overflow:visible!important;}
.bn-popup-card--wheel .benira-wheel-shell--popup .benira-wheel-card{border-radius:18px 18px max(0px,calc(var(--bn-popup-card-radius,24px) - 8px)) max(0px,calc(var(--bn-popup-card-radius,24px) - 8px))!important;}
@media(max-width:480px){
    .bn-popup-overlay{padding:6px!important;}
    .bn-popup-card--wheel{width:calc(100vw - 12px)!important;max-height:min(var(--benira-wheel-modal-max-height,660px),calc(100dvh - 12px))!important;padding:47px 6px 6px!important;border-radius:min(var(--bn-popup-card-radius,24px),22px)!important;}
    .bn-popup-card--wheel .benira-wheel-shell--popup .benira-wheel-card{border-radius:18px 18px max(0px,calc(min(var(--bn-popup-card-radius,24px),22px) - 6px)) max(0px,calc(min(var(--bn-popup-card-radius,24px),22px) - 6px))!important;}
}
@media(max-height:650px) and (orientation:landscape){
    .bn-popup-card--wheel{padding-top:42px!important;}
}

.bn-popup-overlay.bn-popup-overlay--bottom-sheet{
    align-items:flex-end!important;
    padding-top:max(14px,env(safe-area-inset-top))!important;
    padding-right:0!important;
    padding-bottom:0!important;
    padding-left:0!important;
}

/* Benira focus guardrails: popup controls use a high-contrast keyboard indicator. */
.bn-popup-close:focus-visible,
.bn-popup-coupon__copy:focus-visible,
.bn-popup-cta:focus-visible {
    outline: 2px solid var(--bn-color-text,#0f172a) !important;
    outline-offset: 2px !important;
}
